refactor(gates): runtime_registry splits under the R3 file cap — the orchestrator's own +99 debt paid #81
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/081-refactor-gates-runtime-registry-splits-under-t"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
refactor(gates): runtime_registry splits under the R3 file cap — the orchestrator's own +99 debt paid
Along the way:
Touches 58 files:
handoff.md,plan.md,src/rust/Cargo.lock,src/rust/crates/ck_codegen/Cargo.toml,src/rust/crates/ck_codegen/src/arena.rs,src/rust/crates/ck_codegen/src/arg.rsand 52 more.Approving. I would have split
src/rust/crates/ck_driver/tests/date_literal_run.rsdifferently, but not enough to hold this up.@ -0,0 +212,4 @@pat,Value::Int(pattern.len() as i64),sub,Value::Int(body.len() as i64),The
ascast truncates silently ifValueis ever wider than the target. Is the bound guaranteed, or should this betry_from?@ -0,0 +133,4 @@.arg("-d").arg(binary).output().expect("spawn `objdump -d`");The expect message on
expectis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?, at src/rust/crates/ck_driver/tests/date_literal_run.rs:136.It said what I assumed. Reworded in
src/rust/crates/ck_driver/tests/date_literal_run.rsso it names the input that broke it, which is what the bug report will need.Not guaranteed.
Valuegoes through try_from now and the overflow is a typed error insrc/rust/crates/ck_driver/src/literal_lex.rs.The RUNTIME_EXEMPT landing (b82dc88) pushed runtime_registry.rs to 941 lines past the 850 cap and its post-check missed the arch tier — caught one slice later by the full-suite re-run. Fix is structural, not a cap raise (this file grows a justified row per corpus stone; a raise would be a ceiling): the single-file test becomes tests/runtime_registry/{main.rs 30, registry.rs 733, coverage.rs 202} — pure motion, every doc comment and test name verbatim; cargo keeps the same target name. registry.rs sits above the 700 target at its structural floor (the const body + its per-entry docs alone are 726 lines) with 14% headroom, flagged honestly. R3's walk was already recursive — no scan extension needed, no gate escape. Verified first-hand: arch 22/22 incl. r3 green, runtime_registry green, fmt 0, clippy -D 0.The front half of the exotic-literal pipeline (plan_literals §5): ck_lex gains an injected LiteralMatcher capability (content-free — Cargo deps unchanged); the driver's ClaimMatcher drives the CkLang LiteralDSL::match_literal through the bounded evaluator off the settled LiteralClaimTable (prefix on sight; suffix/embedded digit-gated per §6·2). A match emits one SyntaxKind::TypedLit + span-keyed side-record naming no type; Lit::Typed(TypeId) self-types at check with zero by-name branches. Stdlib lexes content-free; app-root files only. ADD: ck_lex/{matcher,numeric,render}.rs (numeric/render are R3 moves), lower_body_typed (ck_resolve), load_project_with_matcher (ck_load), ck_driver/literal_lex.rs, arch literals.rs guard (23rd test) + R8 roster widened with world-type names/markers (owner-ratified). Red-fire proven by the orchestrator (copy-based probe: 22 passed/1 failed, restored to 23/23). KILL: none (ADD half; the String/List retrofit KILL rides 8d-ii). An exotic literal reaching codegen fails honestly (Unsupported) until the 8d-i·b fold. Net Rust +735 (1340 insertions − 605 move-deletions). Gates: fmt 0 · clippy -D warnings 0 · build 0 warnings · suite exit 0 (202 result lines) · arch 23/23. Geo's space-aware scan deferred (§6·4, noted in-code); debt #72 closes in ·b.The back half of the exotic-literal pipeline (plan_literals §5). A claimed literal now const-folds at compile time to its representation word: the Date literal 2026-07-20 lowers to a single `mov $0x50ae,%eax` (20654 epoch days), no runtime call to days_from_civil — proven by ckc disassemble on the stone. ADD: - Lit::Typed(TypeId) → Lit::Typed(TypeId, i64) carries the folded word; ck_lower's Typed arm → Const(Int{bits, leaf}) via the existing identity-retype value-type law → one iconst. ZERO new ck_codegen arms. - build_matcher_and_claims: ONE load → ONE link_project → ONE interner, claims extracted from the same linked artifacts — so every claim.fold_fns FnId resolves in the harness provider. CLOSES debt #72 (the mismatched-interner second build that returned EvalError::Unresolved is gone from the run path). - ClaimMatcher::fold runs match_literal for capture spans, decodes by shape tag, builds Value::Record, evaluate(fold_fns[0]), unwraps to the repr word — no type name or glyph in Rust. - bounded_eval gains ONE generic value-type construction law, keyed on resolution SHAPE (construction_head), never a name (R8 green). - production path threads the single harness through lex + fold + recursion + reconcile; apps without exotic literals are a byte-identical no-op. STONE: tests/corpus/date_literal (RUNTIME_TESTED); exit 174 (20654 & 0xFF). Color/Geo/TimeSpan park on debt #71 (Option/Float captures) — fold returns None, literal fail-softs; noted in-code, never forced by naming Option in Rust. KILL: none (ADD half; the String/List retrofit KILL rides 8d-ii). Net Rust +623 (of which +238 gate test). Gates (orchestrator-run): fmt 0 · clippy -D warnings 0 · build 0 warnings · suite exit 0 (204 result lines) · arch 23/23. Fold-is-a-fold verified via ckc disassemble; #72 closure verified.