Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-architecture-mv/patches/9606f53e6622aeb5 # aien-architecture-mv Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-architecture-mv#121 (code only) closed derived `9606f53e6622aeb5` #121 Imported from GitHub aien-dev/aien-architecture-mv#121 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `0128197fd5bf0d5582d14705be7371e47a2c967c` · Head `e3d0e15ece09783a0779a9d830583979033ac8eb` ### Apply it ``` git checkout -b patch-9606f53e6622aeb5 0128197fd5bf0d5582d14705be7371e47a2c967c curl -fsSL https://interplane.io/drakestapleton/aien-architecture-mv/patches/9606f53e6622aeb5.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-architecture-mv 121 e3d0e15ece09783a0779a9d830583979033ac8eb ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-architecture-mv","number":121,"url":"https://github.com/aien-dev/aien-architecture-mv/pull/121","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:44Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/docs/CRUMB_PROTOCOL.md b/docs/CRUMB_PROTOCOL.md index a399d95..69bf818 100644 --- a/docs/CRUMB_PROTOCOL.md +++ b/docs/CRUMB_PROTOCOL.md @@ -19,6 +19,8 @@ Crumbline is the training curriculum in `aien-sovereign-core/crates/crumbs`. The If the Rust crate and RFC-0001 disagree, RFC-0001 wins. The tool leaves legacy files untouched and reports them. +RFC-0002 (`docs/CRUMB_PROTOCOL_RFC_0002.md`) extends this protocol with a repository-wide coordination plane shared by all worktrees, `crumb explain`, and Continuation Crumbs for session handoff; agent workflow in `docs/crumbs/AGENT_WORKFLOW.md`. + ## The two files - `.crumb`: durable, committed, JSON. Required: `schema_version` ("1.0.0"), `name`, `purpose`. Optional: `layer`, `above`, `below`, `invariants`, `exports`, `extensions`. diff --git a/docs/CRUMB_PROTOCOL_RFC_0002.md b/docs/CRUMB_PROTOCOL_RFC_0002.md new file mode 100644 index 0000000..c51cef4 --- /dev/null +++ b/docs/CRUMB_PROTOCOL_RFC_0002.md @@ -0,0 +1,159 @@ +# Crumb Protocol RFC-0002: Common Coordination Plane and Continuation Crumbs + +**Status:** Proposed, 2026-10-04. Decided by the operator, Drake Stapleton, through his approved design of 2026-10-04 (pasted; the paste is the decision, no separate ratification). Source of record: `~/handoffs/rfc-0002/master-spec-drake-2026-10-04.md` on the Spark. +**Extends:** RFC-0001 v1.0.0 (`aien-dev/crumb-spec` `SPEC.md`, `ROLES.md`, frozen at `10b8251`). RFC-0001 is not changed; this document adds a storage scope, a mutation discipline, two commands and one new object. Protocol version becomes **1.1.0**. +**Related:** `docs/CRUMB_PROTOCOL.md` (how RFC-0001 is used here), ARCH-0029 (Verified Crumbs: untouched), ARCH-0028 (receipts). +**Implementation:** `tools/crumb/crumb.c` (C11/POSIX, no dependencies), tests in `tools/crumb/test.sh`. Code is the truth; where this text and the code differ, the difference is a bug in one of them and is named, not papered over. + +## In plain words (read this first) + +Git remembers what happened. Crumbs explain what it meant. Today every checkout folder of a repository keeps its own private notebook of "who is working where" (`.crumb.local`), so two agents working in two folders of the same repository cannot see each other. RFC-0002 moves that notebook to the one place all those folders already share (the repository's common git directory), makes writing to it safe when two agents write at the same moment, and adds two things on top: a way to ask Crumb what an unfamiliar file is for (`crumb explain`), and a compact record of where a session stopped so a fresh agent can continue without the old conversation (a Continuation Crumb). + +## 0. Current-state audit (2026-10-04, against aien-architecture `origin/main` `0128197`) + +| Item | Finding | +|---|---| +| Standard | RFC-0001 v1.0.0 in archived `crumb-spec` (`SPEC.md`, `ROLES.md`, `schema/crumb.schema.json`, `schema/crumb-local.schema.json`). `ROLES.md` section 3 already defines a Subagent Handoff Protocol (whisper assignments, child registers scent, completion whisper, parent verifies). | +| Live tool | `tools/crumb/crumb.c`, 941 lines, commands seed/backfill/create/claim/update/whisper/close/sniff/list/validate. Writes `.crumb.local` **next to each `.crumb`** (line ~311) with tmp + `rename()` (line ~259). No OS lock. Targets are stored as given (basenames or relative strings), not normalized to repository-relative paths. Scents carry agent id, focus, TTL; locks carry holder, target, intent, TTL. No worktree, branch or HEAD metadata. | +| Scope bug | Linked worktrees do not share `.crumb.local`. Observed in this very lane: a claim made in `~/workspace/hive-worktrees/rfc-0002-docs/docs` is invisible from `~/workspace/aien-architecture/docs`. | +| Tests | `tools/crumb/test.sh`: seed idempotence, gitignore, legacy `.crumb` untouched, validate, hand edits survive reseed, claim/second-claim-blocked (exit 2)/different target, in ONE scratch repo. No worktree, concurrency, TTL, normalization or legacy-import tests. | +| Rust | `crumb-spec/src/{lib.rs,ledger.rs}` (archived) and the older `spark-crumbs` crate write a different shape; `docs/CRUMB_PROTOCOL.md` already rules that RFC-0001 wins and legacy files are left alone. Neither is on the agents' path; the C tool is. | +| Handoff today | Free-form Markdown in `~/handoffs/`, plus (since 2026-10-04) the `checkpoint` skill with `cc.sh` writing `~/handoffs/checkpoints/.json` and a crumb whisper pointer. Works, but lives outside the repository's coordination plane. | +| Verified Crumbs | ARCH-0029 defines `VerifiedCrumbV1` for dependency resolution; nothing implemented. Not touched by this RFC. | + +Discrepancy named: `docs/CRUMB_PROTOCOL.md` says agents "coordinate through crumbs" as if that were repository-wide; the implementation is worktree-local. The implementation changes; the sentence then becomes true. + +## 1. Versioning decision + +A new RFC (RFC-0002) rather than editing RFC-0001, because RFC-0001 is frozen in an archived repository and other documents cite it by number. RFC-0002 is additive: every RFC-0001 field keeps its meaning; what changes is **where** `active_scents`, `locks`, `whispers` and `history` are stored and **how** they are written. A tool that implements RFC-0002 reports protocol version `1.1.0`. A directory's committed `.crumb` is unchanged and still validates against `crumb.schema.json` 1.0.0. + +## 2. Common Coordination Plane + +### 2.1 Coordination root resolution (deterministic) +1. `CRUMB_COORD_ROOT` environment variable, if set (escape hatch for unusual layouts and tests). +2. `git config crumb.coordinationRoot`, if set in the repository. +3. `git rev-parse --git-common-dir` + `/crumb/v1`. +4. Otherwise **fail clearly** for shared operations: `no repository context: run inside a git checkout or set CRUMB_COORD_ROOT`. The tool never invents global state under a home directory. (Transition only: a directory outside any git repository may keep today's `.crumb.local` behaviour; the sniff output must say `shared coordination: none`.) + +### 2.2 Layout (semantic requirement; physical shape may be simplified by the implementation) +``` +/ + dirs/.json one record per directory, same fields as RFC-0001 .crumb.local + agents/.json presence and git context of each live agent + continuations/.json Continuation Crumbs (section 5) + ledger/ append-only action vectors beyond the 20-entry rolling history + .lock transaction lock file (section 3) +``` +The repository root directory is keyed `_root`. + +### 2.3 Repository-relative identity +A resource is identified by **repository identity + repository-relative path**. `/wt-a/native/kernel/core/infer.c` and `/wt-b/native/kernel/core/infer.c` are one resource `native/kernel/core/infer.c`. The implementation normalizes every `dir` and `target` argument through `git rev-parse --show-toplevel` of the worktree it is invoked in, resolves `.`/`..`/symlinks, and stores the relative form. Branch, worktree path, HEAD and base commit are **holder metadata**, never part of the identity. There is no per-branch namespace; a future `--allow-parallel-branch` flag may relax this explicitly, the safe behaviour is the default. + +### 2.4 Lock semantics +A lock on a repository-relative target is visible from every linked worktree. A second `claim` on a held, unexpired target returns exit code 2 and prints the holder, its worktree, branch and intent. Git permitting conflicting edits is not a reason to weaken this; surfacing that overlap is the point of Crumb. + +### 2.5 Holder metadata +Scents and locks carry: `agent_id` (stable session id supplied by the caller; never a PID alone), `worktree`, `branch`, `head`, `base` when cheaply known (`merge-base` with `origin/main`), `focus`/`intent`, `acquired_at`/`updated_at`, `ttl_seconds`. + +### 2.6 Sniff output (shared view) +``` +CRUMB +shared coordination: ACTIVE root: +ACTIVE AGENTS id, branch, focus, heartbeat age +LOCKS target, holder, branch, intent, expires in +OTHER WORKTREES path, branch, agent if any, conflicts with this directory or none +WHISPERS priority, from, to, age, text +CONTINUATIONS newest continuation ids whose scope touches this directory (section 5) +``` +followed by the RFC-0001 `.crumb` summary (purpose, invariants, exports, related). + +## 3. Mutation discipline (transaction safety) + +tmp + `rename()` prevents torn files but not lost updates (A and B both read version 10, both write version 11, one lock vanishes). Every mutation of the shared store runs: +``` +acquire fcntl(F_SETLKW, F_WRLCK) on /.lock +read current record(s) -> prune expired scents and locks -> validate -> apply mutation +write temporary file -> fsync(tmp) -> rename(tmp, final) -> fsync(directory) -> release the lock +``` +The **transaction lock** is an OS lock held for milliseconds and protects the database. The **Crumb resource lock** is the advisory claim in `locks[]`, held for minutes or hours and meaning "an agent owns this target". They are different things and are never confused in code or output. + +## 4. Legacy `.crumb.local` (RFC-0001 physical form) + +- New writes go only to the shared store (inside a repository). +- Reads merge: shared store first, then any `.crumb.local` present in the invoking worktree; an unexpired legacy scent or lock is shown with `legacy:` and an `imported_from: ` provenance. Legacy state never overrides a newer shared record for the same key. +- `crumb seed` / first shared write in a directory imports an existing `.crumb.local` once (provenance kept) and leaves the file on disk; nothing is deleted. +- `.gitignore` handling for `.crumb.local` stays, for the transition and for non-repository directories. + +## 5. Continuation Crumb (`ContinuationCrumbV1`) + +Purpose: checkpoint the meaningful **state of work** when a session ends so another agent, in any worktree, can continue. It is not a transcript, not a summary of the chat, and not an oracle. Schema: `docs/crumbs/continuation-crumb.schema.json`. Reference implementation today: the `checkpoint` skill (`cc.sh`), whose record is this schema's `acr_version: 1` precursor; it moves into `/continuations/` as `crumb checkpoint` / `crumb resume` (section 7). + +### 5.1 Shape (smallest stable set) +``` +identity id, version, created_at, created_by (agent id), reason, supersedes +repository remote, branch, base, head, worktree (one entry per repository in scope) +mission objective, milestone, definition_of_done[] (verbatim; may not be softened at checkpoint time) +state[] {tag: PROVEN|PARTIAL|BLOCKED|ASSUMED|OPEN, claim, evidence[], blocker, note} +evidence commits[], prs[], tests[] {name, command, result, where}, receipts[], golden_values[] {name, value, source} +execution current, next[] {id, task, depends_on[], gate}, backlog[] +coordination scope[] (.crumb paths this record is about), owned[], other_owned[] {who, paths}, do_not_touch[] +operator approval_required[], hardware_rules[], destructive_rules[], standing_preferences[] +resume validate_first[], first_action, bootstrap (<= 700 chars) +revalidation status UNVERIFIED|NEEDS_REVIEW|VERIFIED, checked_at, checked_by, findings[] {field, result: CONFIRMED|STALE|SUPERSEDED|UNKNOWN, note} +``` +Rules enforced by the tool, not by goodwill: a `PROVEN` item without at least one evidence reference is rejected; a `BLOCKED` item without a named blocker is rejected; `definition_of_done` must be non-empty; the record is rejected above a size budget (~4000 tokens of JSON) because size means history crept in. + +### 5.2 Referential, not duplicative +Evidence entries are references the next agent follows: `commit:`, `pr:#`, `receipt:`, `test:`, `crumb:/.crumb`. Nothing Git already knows (diffs, authorship, chronology) is copied in. The `scope[]` list names the committed `.crumb` files that describe the code involved; `crumb explain` and `crumb sniff` surface a continuation whenever its scope touches the directory being asked about. + +### 5.3 Epistemic boundary +`PROVEN` means "a receipt exists at this reference against this commit", not "the previous agent was confident". Where a receipt is an `EvidenceReceiptV1` (ARCH-0028) or, in future, a `VerifiedCrumbV1` (ARCH-0029), the reference points at it; this RFC does not redefine either object. + +## 6. Lifecycle additions + +Normal work (RFC-0001): SNIFF -> LEASE -> EXECUTE -> WHISPER. +Session end: SNIFF -> **QUIESCE** (no new branches, decisions or workers) -> **CHECKPOINT** (write the record from the machine state, not from memory) -> **VERIFY** (`check` passes) -> **WHISPER** (high-priority pointer `Session continuing at ` in the root and each scope directory) -> **RELEASE** (close every held lock). +Fresh session: SNIFF -> **RESOLVE CONTINUATION** (newest id from the whisper or `continuations/LATEST`) -> **REVALIDATE** (section 6.1) -> LEASE (re-claim `owned[]`; exit 2 means someone else holds it: stop) -> RESUME (`first_action`). + +### 6.1 Revalidation (mandatory) +The tool compares each recorded repository entry with the live repository: fetch; HEAD moved? pinned commit still an ancestor of `origin/main` (else SUPERSEDED)? evidence commits present? receipt files present? who holds locks now? It writes machine findings into `revalidation.findings`. The agent then does what the tool cannot: re-check the top blocker at its implementation site, re-read the cheapest critical receipt, and record a verdict per stale field. Nothing in the record is presented as current until this has run. + +## 7. Commands (CLI stays small) + +Existing: `sniff`, `claim`, `update`, `whisper`, `close`, `list`, `seed`, `backfill`, `create`, `validate` (now operating on the shared store). +New: +- `crumb explain `: assembles, in this order and nothing more: nearest `.crumb` (purpose, layer, invariants, exports, related); inherited invariants from parent `.crumb` files up to the root; shared coordination for that directory (agents, locks, whispers); the last 10 commits touching the path (`git log --oneline -- `) plus any commit the `.crumb` or a continuation names as significant; evidence references found in `.crumb` `extensions` and in continuations whose scope touches the path; the newest continuation touching the path with its `state` lines. Output is plain text sections of bounded size (defaults: 10 commits, 5 whispers, 1 continuation) so an LLM can read it without a large payload. Answers: what is this, why, what rules, how did it get here, what is proven, who is here now, where did prior work stop. +- `crumb checkpoint [--reason R]`: creates `/continuations/.json` from the template with repository entries filled from git, prints the path for the agent to complete, then `crumb checkpoint --seal ` runs the checks, stamps `sealed_at` and sha256, writes the Markdown rendering, updates `LATEST`, leaves the whisper. +- `crumb resume `: prints the record, runs revalidation, records findings, prints the bootstrap text. + +Why checkpoint/resume may start outside the C binary: the logic exists today as `cc.sh` (POSIX sh + `jq`) and is being used; porting it to C is mechanical and planned, but landing the shared store first keeps the C change reviewable. Until the port, `cc.sh` resolves its store exactly as section 2.1 does, so records already land in `/continuations/`. That is the precise, implementation-ready continuation for deliverable 14/15, not a TODO. + +## 8. Scope boundary + +This RFC closes the gap for **all linked worktrees of one repository on one filesystem**. Independent clones (another machine, CI, another Spark node) do not share a common git directory and are out of scope. The store is reached through one small internal interface (`store_read`, `store_write`, `store_lock`, `store_root`) so a later `DaemonStore` or distributed backend can replace `GitCommonStore` without touching command code. No transport is chosen now. + +## 9. Tests (the feature is not done until these run) + +| # | Test | Where | +|---|---|---| +| T1 | Cross-worktree visibility: A claims `src/runtime.c`, B's sniff from worktree B shows it | `tools/crumb/test.sh` | +| T2 | Cross-worktree conflict: B's claim of the same target exits 2 | same | +| T3 | Release: A closes, B's claim succeeds | same | +| T4 | Independent targets: both claims survive | same | +| T5 | Concurrent mutation: 8 parallel distinct claims all survive; 8 same-target claims yield exactly one success | same | +| T6 | TTL/crash: expired lock pruned, reclaimable | same | +| T7 | Path normalization: two absolute worktree paths -> one lock identity | same | +| T8 | Legacy `.crumb.local` read/import with provenance, never overriding newer shared state | same | +| T9 | Continuation revalidation: checkpoint at C, advance the repo, resume reports STALE/SUPERSEDED and status NEEDS_REVIEW | `tools/crumb/test-continuation.sh` | + +Results are reported PASS / FAIL / NOT_RUN per test in the merging PR; nothing unrun is called PASS. + +## 10. Agent bootstrap rule (global, one paragraph) + +> Before modifying an unfamiliar repository path, inspect the applicable Crumb (`crumb explain `, then `crumb sniff`). Respect its invariants and shared locks. Follow related Crumbs, Git history, evidence and active continuation state until the purpose of the code is understood. Do not rely on undocumented assumptions from previous sessions. Load context on demand; do not expect the whole architecture in your window up front. + +Workflow detail: `docs/crumbs/AGENT_WORKFLOW.md`. + +## 11. Principle (keep the layers apart) + +Git is the historical substrate. `.crumb` files are the semantic graph. Receipts are the proof layer. Continuation Crumbs are resumable execution state. The shared coordination plane is the live concurrency layer. None of them takes over the job of another: no history copied into crumbs, no claims accepted without receipts, no coordination state treated as architecture, no continuation treated as truth before revalidation. diff --git a/docs/crumbs/AGENT_WORKFLOW.md b/docs/crumbs/AGENT_WORKFLOW.md new file mode 100644 index 0000000..473107e --- /dev/null +++ b/docs/crumbs/AGENT_WORKFLOW.md @@ -0,0 +1,39 @@ +# How an agent works with Crumbs (RFC-0001 + RFC-0002) + +One rule, always: **before modifying an unfamiliar repository path, inspect the applicable Crumb. Respect its invariants and shared locks. Follow related Crumbs, Git history, evidence and active continuation state until the purpose of the code is understood. Do not rely on undocumented assumptions from previous sessions.** Context is loaded on demand; nobody hands you the whole architecture up front. + +## Meeting an unfamiliar file +``` +crumb explain native/kernel/core/infer.c +``` +You get, in bounded sections: what the directory is for and its layer; the invariants it inherits from parent crumbs; who holds locks or scents there right now; the last commits that touched the path and any commit the crumb calls significant; evidence references; and the newest Continuation Crumb whose scope includes it, with its PROVEN / PARTIAL / BLOCKED lines. Follow the references that matter (`git show `, the receipt file, the related `.crumb`) instead of reading everything. + +## Doing a cut (RFC-0001 lifecycle, now repository-wide) +``` +crumb sniff # read before touching; shows agents, locks, whispers from EVERY worktree +crumb claim "" # exit 2 = someone else holds it: stop, read their scent, do not take it +crumb update "" # heartbeat while you work +crumb whisper - "" # what the next agent must know +crumb close modify "" # after pushing +``` +`` is a stable session id you choose once (e.g. `claude-l6b-7f32`), never a process id. Targets are repository-relative; it does not matter which worktree you run the command in. + +## Ending a long session (QUIESCE -> CHECKPOINT -> VERIFY -> WHISPER -> RELEASE) +1. Quiesce: no new branches, decisions or workers; finish the cut in hand to a clean boundary or record exactly where it stopped. +2. `crumb checkpoint --reason context-pressure` (today: `cc.sh new`), fill the record from the machine state (`git`, receipts, test output), not from memory. Tag every fact PROVEN (with a reference) / PARTIAL / BLOCKED (named dependency) / ASSUMED / OPEN. Keep the definition of done verbatim. Order next tasks by dependency with gates. Carry operator boundaries and who-owns-what. +3. Seal (`--seal` / `cc.sh seal`): the checks must pass; the tool leaves the pointer whisper. +4. Release every lock with `crumb close`. + +## Starting a session (SNIFF -> RESOLVE -> REVALIDATE -> LEASE -> RESUME) +1. `crumb sniff` the root: the high-priority whisper names the continuation id (or read `continuations/LATEST`). +2. `crumb resume ` (today: `cc.sh resume `): prints the record and compares it with the live repository; stale or superseded pins are flagged. +3. Judge each flag yourself: has the top blocker been fixed since? did main move past the pin? Record verdicts. Re-read the cheapest critical receipt; do not rerun long gates just to feel sure. +4. Re-claim the owned paths. Exit 2 means another agent is there: stop. +5. Do `first_action`. Only now. + +## What not to do +- Do not paste the previous conversation into the new one. +- Do not call something PROVEN because a previous agent sounded sure. Point at the receipt or downgrade it. +- Do not soften the definition of done while checkpointing. +- Do not write to `.crumb.local` inside a repository; the shared store is authoritative. Legacy files are read, imported with provenance, and left alone. +- Do not start work before the lock table is rebuilt. diff --git a/docs/crumbs/continuation-crumb.schema.json b/docs/crumbs/continuation-crumb.schema.json new file mode 100644 index 0000000..ff04286 --- /dev/null +++ b/docs/crumbs/continuation-crumb.schema.json @@ -0,0 +1,117 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/aien-dev/aien-architecture/main/docs/crumbs/continuation-crumb.schema.json", + "title": "ContinuationCrumbV1", + "description": "Compact, referential record of where a development session stopped and how another agent resumes (RFC-0002 section 5). Not a transcript. Not an oracle: revalidation is mandatory on resume.", + "type": "object", + "required": ["acr_version", "identity", "repository", "mission", "state", "evidence", "execution", "coordination", "operator", "resume", "revalidation"], + "properties": { + "acr_version": { "const": 1 }, + "identity": { + "type": "object", + "required": ["id", "created_at", "created_by", "reason"], + "properties": { + "id": { "type": "string", "pattern": "^cc-[0-9]{4}-[a-z0-9][a-z0-9-]*$" }, + "created_at": { "type": "string", "format": "date-time" }, + "sealed_at": { "type": ["string", "null"], "format": "date-time" }, + "created_by": { "type": "string", "description": "Stable agent/session id, never a PID alone." }, + "reason": { "type": "string", "enum": ["context-pressure", "milestone", "handoff-to-peer", "end-of-session", "failing-repeatedly", "other"] }, + "supersedes": { "type": ["string", "null"] }, + "sha256": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" } + } + }, + "repository": { + "type": "array", "minItems": 1, + "items": { + "type": "object", "required": ["remote", "branch", "head"], + "properties": { + "name": { "type": "string" }, "remote": { "type": "string" }, "worktree": { "type": "string" }, + "branch": { "type": "string" }, "head": { "type": "string", "pattern": "^[0-9a-f]{7,40}$" }, + "base": { "type": ["string", "null"], "pattern": "^[0-9a-f]{7,40}$" }, "dirty_files": { "type": "integer", "minimum": 0 } + } + } + }, + "mission": { + "type": "object", "required": ["objective", "milestone", "definition_of_done"], + "properties": { + "objective": { "type": "string", "minLength": 1 }, "milestone": { "type": "string", "minLength": 1 }, + "definition_of_done": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Verbatim. The outgoing session may not soften it while compressing." }, + "priority": { "type": "string" } + } + }, + "state": { + "type": "array", "minItems": 1, + "items": { + "type": "object", "required": ["tag", "claim"], + "properties": { + "tag": { "enum": ["PROVEN", "PARTIAL", "BLOCKED", "ASSUMED", "OPEN"] }, + "claim": { "type": "string", "minLength": 1 }, + "evidence": { "type": "array", "items": { "$ref": "#/$defs/ref" } }, + "blocker": { "type": "string", "description": "Required when tag is BLOCKED: the exact dependency at implementation level." }, + "note": { "type": "string" } + }, + "allOf": [ + { "if": { "properties": { "tag": { "const": "PROVEN" } } }, "then": { "required": ["evidence"], "properties": { "evidence": { "minItems": 1 } } } }, + { "if": { "properties": { "tag": { "const": "BLOCKED" } } }, "then": { "required": ["blocker"], "properties": { "blocker": { "minLength": 1 } } } } + ] + } + }, + "evidence": { + "type": "object", + "properties": { + "commits": { "type": "array", "items": { "$ref": "#/$defs/ref" } }, + "prs": { "type": "array", "items": { "$ref": "#/$defs/ref" } }, + "tests": { "type": "array", "items": { "type": "object", "required": ["name", "command", "result"], "properties": { "name": { "type": "string" }, "command": { "type": "string" }, "result": { "type": "string", "description": "PASS / FAIL / NOT_RUN plus commit" }, "where": { "type": "string" } } } }, + "receipts": { "type": "array", "items": { "$ref": "#/$defs/ref" } }, + "golden_values": { "type": "array", "items": { "type": "object", "required": ["name", "value"], "properties": { "name": { "type": "string" }, "value": {}, "source": { "type": "string" } } }, "description": "Exact values a correct result must reproduce; a mismatch is a FAIL regardless of anything else." } + } + }, + "execution": { + "type": "object", "required": ["current", "next"], + "properties": { + "completed": { "type": "array", "items": { "type": "string" } }, + "current": { "type": "string" }, + "next": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["id", "task"], "properties": { "id": { "type": "string" }, "task": { "type": "string" }, "depends_on": { "type": "array", "items": { "type": "string" } }, "gate": { "type": "string" } } } }, + "backlog": { "type": "array", "items": { "type": "string" } } + } + }, + "coordination": { + "type": "object", + "properties": { + "scope": { "type": "array", "items": { "type": "string" }, "description": "Repository-relative directories whose .crumb describes the code involved; sniff/explain surface this record for them." }, + "owned": { "type": "array", "items": { "type": "string" } }, + "other_owned": { "type": "array", "items": { "type": "object", "required": ["who", "paths"], "properties": { "who": { "type": "string" }, "paths": { "type": "array", "items": { "type": "string" } }, "note": { "type": "string" } } } }, + "active_workers": { "type": "array", "items": { "type": "string" } }, + "do_not_touch": { "type": "array", "items": { "type": "string" } } + } + }, + "operator": { + "type": "object", + "properties": { + "approval_required": { "type": "array", "items": { "type": "string" } }, + "hardware_rules": { "type": "array", "items": { "type": "string" } }, + "destructive_rules": { "type": "array", "items": { "type": "string" } }, + "standing_preferences": { "type": "array", "items": { "type": "string" } } + } + }, + "resume": { + "type": "object", "required": ["validate_first", "first_action", "bootstrap"], + "properties": { + "validate_first": { "type": "array", "minItems": 1, "items": { "type": "string" } }, + "first_action": { "type": "string", "minLength": 1 }, + "bootstrap": { "type": "string", "minLength": 1, "maxLength": 700 } + } + }, + "revalidation": { + "type": "object", "required": ["status"], + "properties": { + "status": { "enum": ["UNVERIFIED", "NEEDS_REVIEW", "VERIFIED"] }, + "checked_at": { "type": ["string", "null"] }, "checked_by": { "type": ["string", "null"] }, + "findings": { "type": "array", "items": { "type": "object", "required": ["field", "result"], "properties": { "field": { "type": "string" }, "result": { "enum": ["CONFIRMED", "STALE", "SUPERSEDED", "UNKNOWN"] }, "note": { "type": "string" } } } } + } + } + }, + "$defs": { + "ref": { "type": "string", "description": "A reference the next agent follows, not a copy: commit:, pr:#, receipt:, test:, crumb:/.crumb, or a short free-form pointer.", "minLength": 3 } + } +} ```