|
| 1 | +# Codifide v2.0 Language Work — Requirements |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +v2.0 language work is driven by the Agent Adoption Initiative findings. |
| 6 | +Every requirement here is justified by at least one finding from Track 1 |
| 7 | +(case studies) or Track 2 (infrastructure audit). Items without adoption |
| 8 | +evidence are not in scope. |
| 9 | + |
| 10 | +Evidence base: `dispatches/2026-05-13-track1-summary.*`, |
| 11 | +`dispatches/2026-05-13-track2-sable-audit.md`, |
| 12 | +`dispatches/2026-05-13-track2-sable-reaudit.*` |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## REQ-V2-1: RPC API |
| 17 | + |
| 18 | +**Priority:** P1 |
| 19 | + |
| 20 | +**Evidence:** Program 5 (content-addressed composition) was the universal |
| 21 | +failure point across all three Track 1 sessions (T1-2, T1-3, T1-4). Every |
| 22 | +agent had to manually manage the store CLI, set `CODIFIDE_RUNTIME=python`, |
| 23 | +and write `from`-import syntax. The friction is in the composition layer, |
| 24 | +not the language semantics. |
| 25 | + |
| 26 | +**Requirement:** A network interface (HTTP or gRPC) that accepts canonical |
| 27 | +CBOR, stores it, returns its hash, and resolves imports. Agents speak |
| 28 | +canonical form directly without surface syntax or CLI. |
| 29 | + |
| 30 | +**Acceptance criteria:** |
| 31 | +- An agent can publish a symbol via HTTP POST and receive its SHA-256 hash |
| 32 | +- An agent can resolve an import by hash via HTTP GET |
| 33 | +- An agent can complete Program 5 of `docs/AGENT_TASK_SPEC.md` using only |
| 34 | + HTTP requests — no CLI, no `CODIFIDE_RUNTIME=python` |
| 35 | +- The API accepts canonical CBOR (primary) and canonical JSON (secondary) |
| 36 | +- The API is documented in `docs/RPC_API.md` |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +## REQ-V2-2: Static bind-before-when detection |
| 41 | + |
| 42 | +**Priority:** P2 |
| 43 | + |
| 44 | +**Evidence:** Claude (T1-4) hit `unbound name: 'label'` when writing a `cand` |
| 45 | +block with a bind followed by a `when` guard. The pattern is syntactically |
| 46 | +accepted by the parser and fails at runtime with a misleading error. GPT-4o |
| 47 | +and Gemini avoided it by accident. Any agent reaching for idiomatic |
| 48 | +multi-branch dispatch will hit it. |
| 49 | + |
| 50 | +**Requirement:** The parser detects bind-before-when statically and raises |
| 51 | +`ParseError` with a message explaining guard-before-body execution order. |
| 52 | + |
| 53 | +**Acceptance criteria:** |
| 54 | +- `cand label <- f() when eq(label, x) "y"` raises `ParseError` (not |
| 55 | + `unbound name` at runtime) |
| 56 | +- Error message names the fix: move bind into body, use `if/then/else` |
| 57 | +- Existing programs with correct bind placement are unaffected |
| 58 | +- The runtime hint added in post-T1-4 fixes can be removed once the parser |
| 59 | + catches it statically |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## REQ-V2-3: `from`-import in Rust parser |
| 64 | + |
| 65 | +**Priority:** P3 |
| 66 | + |
| 67 | +**Evidence:** All three Track 1 agents needed `CODIFIDE_RUNTIME=python` for |
| 68 | +Program 5. The Rust parser does not support `from <hash> import name` syntax. |
| 69 | +This means the default runtime cannot do content-addressed composition. |
| 70 | + |
| 71 | +**Requirement:** Implement `from <hash> import name, name` in the Rust parser |
| 72 | +and interpreter, with store resolution. |
| 73 | + |
| 74 | +**Acceptance criteria:** |
| 75 | +- Program 5 of `docs/AGENT_TASK_SPEC.md` runs without `CODIFIDE_RUNTIME=python` |
| 76 | +- Byte-level conformance with Python runtime on all existing test programs |
| 77 | +- The `CODIFIDE_RUNTIME=python` note in `docs/AGENT_QUICKREF.md` can be removed |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## REQ-V2-4: Manifest `docs` field |
| 82 | + |
| 83 | +**Priority:** P3 |
| 84 | + |
| 85 | +**Evidence:** AUD-T2-03 (Track 2 Sable audit). An agent fetching |
| 86 | +`codifide.com/capability.json` cannot discover the cookbook, quickref, or |
| 87 | +`FOR_AGENTS.md` from the manifest alone. |
| 88 | + |
| 89 | +**Requirement:** Add a `docs` field to the capability manifest schema with |
| 90 | +stable URLs for key agent-facing documents. |
| 91 | + |
| 92 | +**Acceptance criteria:** |
| 93 | +- `python3 -m codifide capability | jq .docs` returns URLs for |
| 94 | + `FOR_AGENTS.md`, `AGENT_COOKBOOK.md`, and `AGENT_QUICKREF.md` |
| 95 | +- The manifest drift test catches changes to the `docs` field |
| 96 | +- `docs/CAPABILITY.md` documents the `docs` field schema |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Out of scope for v2.0 |
| 101 | + |
| 102 | +- Effect inference — no adoption evidence |
| 103 | +- Time-indexed types — no adoption evidence |
| 104 | +- Editor integration — no adoption evidence |
| 105 | +- Structural diff and merge — no adoption evidence |
| 106 | +- Hosted runtime / cloud service — v3.0 territory |
| 107 | +- Certification program — v3.0 territory |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +*Spec version 1.0 — May 2026* |
| 112 | +*Author: Douglas Jones + Claude* |
| 113 | +*Governed by: GOVERNANCE.md* |
0 commit comments