# DevCD

DevCD is a local-first Agent Continuity Layer: typed local events -> state, memory, policy decisions, and policy-filtered Continuity Packets for agents. Developer workflow continuity is the first mature proof; Context Packs extend the same infrastructure to other domains.

DevCD is not a model, chat UI, task runner, remote exporter, telemetry service, or action executor.

Agent context paths:
- CLI brief: `devcd context brief --surface cli --detail standard`
- Reproducible handoff demo: `devcd context handoff-demo --events examples/before-after-agent-continuity/sample-events.jsonl`
- Machine-readable handoff: `devcd context handoff-demo --events examples/agent-resurrection/sample-events.jsonl --json`
- Local feedback: `devcd context feedback <brief_id> --kind missing --note "..."`, then `devcd context quality`
- HTTP daemon: `devcd run`, then use loopback endpoints `GET /context/work-state` and `POST /context/brief`
- MCP stdio: `devcd mcp serve`; use as a read-only MCP context source for MCP-native agent runtimes such as OpenClaw; exposes read-only resources only, no tools or prompts
  - `devcd://context/continuity-packet` — domain-neutral policy-filtered Continuity Packet (developer pack by default)
  - `devcd://context/agent-handoff-packet` — legacy developer handoff JSON contract (kept for backward compatibility)
- Integration snippets: `devcd integrations openclaw` and `devcd integrations hermes`; add `--json` for machine-readable output or `--smoke-test` to verify initialize/resources/list/tools/list/prompts/list locally without mutating external config
- Context Packs: `devcd context packs` or `devcd context packs --json`; developer and research packs are built-in
- Pytest failure recipe: `devcd recipe pytest-failure --input examples/event-source-recipes/pytest-failure/input.json`

Agent resurrection and continuity:
- `docs/superpowers/agent-resurrection.md` — problem, capability, demo, policy-safe withholding, boundary
- `examples/agent-resurrection/handoff-packet.md` — expected handoff packet from resurrection fixture
- `examples/agent-resurrection/handoff-packet.json` — expected machine-readable handoff packet
- `schemas/devcd-agent-handoff-packet.schema.json` — JSON contract for agent handoff packets
- `examples/before-after-agent-continuity/without-devcd.md` — baseline: what the next agent knows without DevCD
- `examples/agent-switch/README.md` — surface-specific handoff for coding vs. review agents

Agent handoff examples:
- `examples/agent-handoff/README.md`
- `examples/agent-handoff/context-brief.md`
- `examples/agent-handoff/sample-events.jsonl`

Policy boundaries:
- Loopback HTTP requires a local bearer token from `DEVCD_TOKEN` or `.devcd/token`.
- Default policy allows observation/local storage for metadata, denies sensitive/full-text/disallowed-source context, denies actions, and denies remote export.
- Withheld context is represented by safe summaries and policy reasons; do not infer hidden payloads.
- Feedback notes are treated as full-text local input and withheld from quality output by policy.

Verified commands:
- `python -m pip install -e ".[dev]"`
- `devcd init`
- `devcd run`
- `devcd event ide file_focus --payload '{"path":"src/app.py","duration_seconds":30}'`
- `devcd git-snapshot --repo .`
- `devcd context state`
- `devcd context brief --surface cli --detail standard`
- `devcd context handoff-demo --events examples/agent-handoff/sample-events.jsonl`
- `devcd context handoff-demo --events examples/agent-resurrection/sample-events.jsonl`
- `devcd context handoff-demo --events examples/before-after-agent-continuity/sample-events.jsonl`
- `devcd context handoff-demo --events examples/agent-switch/sample-events.jsonl --surface coding-agent`
- `devcd context handoff-demo --events examples/agent-switch/sample-events.jsonl --surface review-agent`
- `devcd context feedback demo-handoff-brief --kind missing --note "Add the failing test name."`
- `devcd context quality`
- `devcd context memory --scope working`
- `devcd mcp serve`
- `make check`
