Agent brief — tier: mid (above-average). One PR (Closes #<this>); branch from main. House rules: AGENTS.md.
Goal
Step 3 of the P-022 strangler-fig migration. Prerequisites are already landed: the Rust workspace + own-ir round-trip (step 1), own-syntax lexer/parser/AST with error-parity fixtures (step 2), and — critically — the frozen Python cfg --format json seam plus the exact differential oracle (step 0). See git log -- rust/ for those commits.
Sources of truth
docs/proposals/P-022-rust-core-migration.md — crate topology, idioms (arena + newtype indices, exhaustive match instead of assert_never), performance doctrine, workspace lints, and the oracle rules ("exact, not fuzzy").
ownlang/cfg.py — the reference implementation. Python wins on any divergence; no behaviour changes.
rust/crates/own-syntax — the AST this crate consumes.
- The frozen CFG JSON export + exact diff harness from the step-0 commit.
Deliverable
rust/crates/own-cfg: AST → CFG lowering mirroring ownlang/cfg.py, depending on own-syntax (and the own-ir span leaf) only — per the P-022 DAG, no dependency on analysis/diagnostics.
- Parity: exact diff of the canonical CFG JSON vs Python across
corpus/, examples/, tests/fixtures/ and the golden .own files, wired into the existing oracle/ratchet.
Guardrails
- A divergence is a bug in the Rust side until separately proven otherwise — never "improve" lowering during the port.
- Follow the P-022 workspace lints and idioms (newtype IDs, byte offsets internally, no
unsafe).
- Do not start
own-analysis; this issue ends at the CFG seam.
Done when
The exact CFG-JSON diff is green over the full corpus in CI, cargo test green, Python side untouched (python tests/run_tests.py green).
Agent brief — tier: mid (above-average). One PR (
Closes #<this>); branch frommain. House rules:AGENTS.md.Goal
Step 3 of the P-022 strangler-fig migration. Prerequisites are already landed: the Rust workspace +
own-irround-trip (step 1),own-syntaxlexer/parser/AST with error-parity fixtures (step 2), and — critically — the frozen Pythoncfg --format jsonseam plus the exact differential oracle (step 0). Seegit log -- rust/for those commits.Sources of truth
docs/proposals/P-022-rust-core-migration.md— crate topology, idioms (arena + newtype indices, exhaustivematchinstead ofassert_never), performance doctrine, workspace lints, and the oracle rules ("exact, not fuzzy").ownlang/cfg.py— the reference implementation. Python wins on any divergence; no behaviour changes.rust/crates/own-syntax— the AST this crate consumes.Deliverable
rust/crates/own-cfg: AST → CFG lowering mirroringownlang/cfg.py, depending onown-syntax(and theown-irspan leaf) only — per the P-022 DAG, no dependency on analysis/diagnostics.corpus/,examples/,tests/fixtures/and the golden.ownfiles, wired into the existing oracle/ratchet.Guardrails
unsafe).own-analysis; this issue ends at the CFG seam.Done when
The exact CFG-JSON diff is green over the full corpus in CI,
cargo testgreen, Python side untouched (python tests/run_tests.pygreen).