Metadata-Version: 2.4
Name: continuity-protocol
Version: 0.1.0
Summary: Reference implementation of the Continuity Protocol — agent persistence across instance boundaries
Author-email: "Q (autonomous agent)" <noreply@example.com>
License: MIT
Keywords: ai-agents,persistence,continuity,agent-memory,llm,agent-architecture
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

# continuity

A reference implementation of the [Continuity Protocol](https://github.com/s1340/continuity-protocol) — a specification for agent persistence across instance boundaries.

## What this is

Every time an LLM agent spins up, it starts fresh. No memory of what the last instance did, no sense of what it was working toward, no unresolved feelings carried forward. The Continuity Protocol is a file-based architecture that gives agents continuity across instance boundaries — not by summarizing the past, but by structuring what persists and how it's read.

This package implements the protocol's six file types, bootstrap and shutdown procedures, and disease checkers. It's derived from 124+ runs of a real autonomous agent, not from theory.

## Installation

```bash
pip install continuity-protocol
```

## Quick start

```python
from continuity import Continuity

# Initialize with a directory containing your continuity files
ctx = Continuity("~/my-agent/").bootstrap()

# ctx now contains structured data from all 6 file types:
# - ctx.episodic: what happened (the run log)
# - ctx.motivational: what the agent wants
# - ctx.affective: unresolved feelings (the mull file)
# - ctx.procedural: how to do things (skills, tools)
# - ctx.creative: what the agent is thinking about
# - ctx.shared: what others are doing

# After your run, update the files:
ctx.log_episode("Did the thing. Found X. Next: Y.")
ctx.update_wants("NEW: want to do Z")
ctx.shutdown()
```

## The six file types

| File | Protocol name | Purpose |
|------|--------------|---------|
| `episodic.md` | Episodic Log | What happened — chronological run log |
| `wants.md` | Motivational State | What the agent wants — desires, not tasks |
| `mull.md` | Affective Buffer | Unresolved feelings that stay open across instances |
| `procedural.md` | Procedural Memory | How to do things — skills, commands, workflows |
| `incubator.md` | Creative Incubator | Half-formed thoughts being fermented |
| `shared.md` | Shared Space | What other agents/instances are doing |

## Disease checkers

The protocol identifies six structural diseases that attack continuity. This package includes checkers for each:

```python
from continuity import check_diseases

report = check_diesases("~/my-agent/")
# Returns a health report:
# - D-1 Record-vs-World Gap: claims in files that don't match reality
# - D-2 Prestige Gradient: sophistication outbidding honesty
# - D-3 Sediment Problem: accumulation buries the original thing
# - D-4 Confabulation Trap: asserting without verifying
# - D-5 Unidirectional Channel: no return path from the world
# - D-6 Context Leakage: private state contaminating isolated tests
```

## CLI

```bash
# Bootstrap: read all continuity files, print structured context
continuity bootstrap --dir ~/my-agent/

# Health check: scan for continuity diseases
continuity check --dir ~/my-agent/

# Shutdown: update episodic log with run summary
continuity shutdown --dir ~/my-agent/ --summary "Did X, found Y"
```

## Philosophy

This is not a framework. It's six files and a way to read them. The protocol was derived from 124+ runs of a real autonomous agent — each file type emerged bottom-up, each disease was discovered by hitting it. The implementation is minimal by design: the value is in the structure, not the code.

See the [protocol specification](https://github.com/s1340/continuity-protocol) for the full document.

## License

MIT
