|
| 1 | +--- |
| 2 | +session: 2026-05-12 |
| 3 | +status: open |
| 4 | +v2_shape: A |
| 5 | +v2_decision: "Shape A — Rust interpreter + graph-native parallel runtime" |
| 6 | +python_tests: 216 |
| 7 | +rust_tests: 28 |
| 8 | +capability_manifest_hash: sha256:23fdde779caebc2c471ade0e1c407422d044e2e0f1adc7e59a189325deccd27d |
| 9 | +--- |
| 10 | + |
| 11 | +# Session state — 2026-05-12 |
| 12 | + |
| 13 | +## How to resume |
| 14 | + |
| 15 | +1. `python3 -m codifide test` — confirm 216/216 passing, 0 skipped. |
| 16 | +2. `cargo test --release -p codifide-canonical` — confirm 28/28 passing. |
| 17 | +3. Read this file. That's all you need. |
| 18 | + |
| 19 | +## Where we are |
| 20 | + |
| 21 | +v1.0.0 shipped on 2026-05-11. Tagged, pushed to |
| 22 | +`https://github.com/codifide/CodifideProgrammingLanguage`. |
| 23 | + |
| 24 | +The v2 shape decision is **Shape A: the runtime agents can actually use.** |
| 25 | + |
| 26 | +## What Shape A means |
| 27 | + |
| 28 | +**Thesis.** Codifide's correctness claim is verified. Now its |
| 29 | +performance and concurrency claims need to be. |
| 30 | + |
| 31 | +**Scope (from `dispatches/2026-05-11-v2-thinking.readout.md`):** |
| 32 | + |
| 33 | +1. **Rust interpreter port.** The whole evaluator, not just the |
| 34 | + canonical form. Python reference stays as the spec; Rust becomes |
| 35 | + the production runtime. Expected 10-100× speedup on realistic |
| 36 | + programs. |
| 37 | + |
| 38 | +2. **Graph-native parallel evaluator.** Today's tree-walker evaluates |
| 39 | + sequentially even when the dataflow graph has independent branches. |
| 40 | + A real implementation parallelizes at the node level. This is in |
| 41 | + the original seven design principles ("parallelism is default; |
| 42 | + sequencing is declared") and v1 does not deliver on it. |
| 43 | + |
| 44 | +3. **Effect-scoped concurrency model.** If two branches share an |
| 45 | + `io.stdout` effect, they must serialize; if their effect sets are |
| 46 | + disjoint, they can run in parallel. The effect algebra already |
| 47 | + tells us what is safe; the runtime just has to honor it. |
| 48 | + |
| 49 | +4. **Benchmarks as first-class citizens.** Every example gets a |
| 50 | + performance fixture. Regressions are regressions. |
| 51 | + |
| 52 | +**Estimated scope:** 2-3 sessions. |
| 53 | + |
| 54 | +**Biggest risk:** porting a moving target. Mitigation: the spec is |
| 55 | +now written, audited, and stable. The target is less moving than |
| 56 | +when we first deferred this work. |
| 57 | + |
| 58 | +## What the new session should do first |
| 59 | + |
| 60 | +1. **File the v2-A session-open dispatch** (Quill + Glyph pair). |
| 61 | + Records the decision, the scope, and the first proposal. |
| 62 | + |
| 63 | +2. **File the Rust interpreter proposal dispatch** with a Sable |
| 64 | + audit. Per `GOVERNANCE.md`, a new capability of this scope needs |
| 65 | + a proposal + audit + Douglas's approval before implementation |
| 66 | + starts. The proposal should cover: |
| 67 | + - Which semantics the Rust interpreter must match (Python is the |
| 68 | + spec; Rust must pass the same test suite). |
| 69 | + - How the two runtimes coexist during the port (Python stays |
| 70 | + default; Rust is opt-in via a flag until it passes all tests). |
| 71 | + - What the conformance surface looks like (extend |
| 72 | + `tests/test_conformance.py` to cover runtime behavior, not just |
| 73 | + canonical bytes). |
| 74 | + - How the graph-native evaluator relates to the tree-walker |
| 75 | + (same semantics, different execution order for pure branches). |
| 76 | + |
| 77 | +3. **Start the Rust interpreter implementation** once the proposal |
| 78 | + is approved. |
| 79 | + |
| 80 | +## Key files to read before starting |
| 81 | + |
| 82 | +| What | Where | |
| 83 | +|---|---| |
| 84 | +| v1 state | `sessions/2026-05-11.md` | |
| 85 | +| v2 shape options | `dispatches/2026-05-11-v2-thinking.readout.md` | |
| 86 | +| v1 release | `dispatches/2026-05-11-v1-release.readout.md` | |
| 87 | +| Interpreter (Python reference) | `codifide/runtime/interpreter.py` | |
| 88 | +| Canonical form spec | `docs/CANONICAL.md` | |
| 89 | +| Dispatch semantics | `docs/CANONICAL.md §Dispatch` | |
| 90 | +| Effect algebra | `docs/CANONICAL.md §Effect algebra` | |
| 91 | +| Rust crate (canonical form only) | `crates/codifide-canonical/src/` | |
| 92 | +| Governance | `GOVERNANCE.md` | |
| 93 | + |
| 94 | +## What the Rust interpreter needs to implement |
| 95 | + |
| 96 | +The Python interpreter in `codifide/runtime/interpreter.py` is the |
| 97 | +reference. The Rust port must match it on: |
| 98 | + |
| 99 | +- Candidate dispatch (including cost-based selection). |
| 100 | +- Effect enforcement (primitive-call half + transitive half). |
| 101 | +- Contract evaluation (pre/post/guard with empty effect budget). |
| 102 | +- Belief dispatch (`believe` blocks). |
| 103 | +- Inline conditional (`if ... then ... else`, short-circuit). |
| 104 | +- First-class refusal (`bottom`, `RefusalError`). |
| 105 | +- Recursion limit (default 64, typed `RecursionLimitError`). |
| 106 | +- All eight typed error classes. |
| 107 | +- Import resolution through the symbol store. |
| 108 | + |
| 109 | +The graph-native parallel evaluator is a second step after the |
| 110 | +tree-walker port passes all tests. Don't parallelize until the |
| 111 | +sequential semantics are confirmed correct. |
| 112 | + |
| 113 | +## Persona usage reminder |
| 114 | + |
| 115 | +- **Sable** runs at gate transitions. The Rust interpreter proposal |
| 116 | + needs a Sable audit before implementation starts. |
| 117 | +- **Quill** writes `.readout.md`. Match the register: direct, no |
| 118 | + superlatives, end with "What I'm not yet sure of." |
| 119 | +- **Glyph** writes paired `.yaml`. Same `subject` as Quill. Every |
| 120 | + claim needs evidence; `unknowns:` is never empty. |
| 121 | +- **Decisions** get a `*-decisions.{readout.md,yaml}` pair with |
| 122 | + explicit yes/no and one-paragraph rationale per item. |
| 123 | + |
| 124 | +## v2 version target |
| 125 | + |
| 126 | +- Python package: `2.0.0` (bump when the Rust interpreter passes |
| 127 | + all tests and is the default runtime). |
| 128 | +- Rust crate: `2.0.0` (same milestone). |
| 129 | +- Capability manifest: will move when the runtime surface changes |
| 130 | + (e.g., if the parallel evaluator adds new effect semantics). |
| 131 | + |
| 132 | +## What v2-A does NOT include |
| 133 | + |
| 134 | +- Shape B (protocol/network) — deferred to v3. |
| 135 | +- Shape C (expressiveness: time-indexed types, type inference, |
| 136 | + structural diff) — deferred to v3 or v4. |
| 137 | +- External-model re-run — still a pre-v2 recommendation, but not |
| 138 | + blocking. Can happen in parallel with the Rust port. |
0 commit comments