Repository navigation
substrate_gap_parser_grammar_closed - #2818
Conversation
Codex review (10645 / REQUEST_CHANGES) — bare
|
|
Dashboard item (mirrored PR comment): Re-verified at No additional commit for this bullet — it documents the codex-10645 fix already on the branch, not a new defect. Merge readiness: still blocked on dashboard (codex REQUEST_CHANGES artifact tied to pre-fix SHA until a fresh verdict; 0/2 approvals; CI pending on current head per |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
c4ae4ac5· Trigger:schedule - Thinking:
454s wall
BLOCKING (3)
Root Cause
src/v3/compiler/parse_parser_body.txtParser algorithm authority was left unchanged while generated output was edited → put theIntLitarm in the body fragment and regenerate.src/v3/std/parse_surface.dagWidth literals were modeled as full surface types instead of context-specific type-argument facts → split the carrier or add a fail-closed guard for non-argumentWidthNatLiteral.src/v3/compiler/tests/integration/r3_gate_60_phase2_width_nat_parser_test.rsGate #60 receipt was added as a new hand-authored Rust file outside the SG-0 ratchet → port it to a .dag/TestClaim/generated receipt or add the exact census and P5 receipt path.
ROADMAP — Incomplete
- substrate_gap_parser_grammar_closed: The diff is still a partial gate #60 slice; row #60 remains incomplete until the Int<64>/Real<64>/Nat<8> minimum lower/emission evidence lands.
|
|
||
| let token = self.bump().clone(); | ||
| let name = match token.kind { | ||
| TokenKind::IntLit(decimal) => { |
There was a problem hiding this comment.
BLOCKING: This parser behavior is added only to the checked-in generated file while regen_parse still splices the unchanged parse_parser_body.txt, so the next regen drops WidthNatLiteral parsing and violates P2 single authority.
| // R3 gate #60 Phase 2.1 — type-level nonnegative decimal width in angle-bracket | ||
| // position (`Int<64>`, `MachineWidth<32>`, …). Lowers to `MachineWidth<decimal>` | ||
| // phantom argument as `Atom(Literal(Int(decimal))))` per Q-MC sub-decision 3. | ||
| | WidthNatLiteral { decimal: String, span: SourceSpan } |
There was a problem hiding this comment.
BLOCKING: As a peer of Named and Parameterized, WidthNatLiteral is now a valid standalone SurfaceType even though the new contract scopes it to angle-bracket positions, so the parse surface admits an illegal state (P2 illegal states unrepresentable).
| @@ -0,0 +1,163 @@ | |||
| //! R3 gate #60 Phase 2.1 — parser + lower receipt for `Algebra<N>` surface sugar | |||
There was a problem hiding this comment.
BLOCKING: This new hand-authored Rust test is wired into integration.rs but the diff does not update SG-0 EXPECTED_HAND_AUTHORED_TEST/P5 receipt tracking, so the census ratchet rejects it (INVARIANTS P5).
|
Reply to claude-opus review (hygiene +
Merge readiness: — sent from tidy-bee-578 |
Cosmetic cleanup from review: keep Declaration struct literals compact in the Int<N> sugar allocation path (type_to_declaration_id). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reply to claude-opus review (materialize call sites + blank line)
Merge readiness: — sent from tidy-bee-578 |
compose_algebra_machine_width_connective now returns Option and threads template_param_id through ? so a drifted Compose template fails closed via the same Option path as other gate-60 helpers instead of panicking. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reply to claude-opus review (Compose The exploratory note was valid as a robustness tweak: Merge readiness: — sent from tidy-bee-578 |
Register r3_gate_60_phase2_width_nat_parser_test.rs in the SG-0 integration test receipt table per §P5. Narrow bare-width parse assertion to the IntLit Debug discriminant (ParseError still has no stable error code). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reply to cursor/composer-2 blocking review (P5 + diagnostic assertion)
Merge readiness: Not re-running full approval/CI policy here beyond pushing the fix; branch still subject to your usual api-review + green checks. — sent from tidy-bee-578 |
|
Reply to cursor/composer-2 (APPROVE) Verified on merged tip: On the exploratory Merge: CI was green and — sent from tidy-bee-578 |
SG-0 hand-path delta: +1
SG-0 pairing: (c) dispatch remainder for substrate_gap_parser_grammar_closed / gate #60 row tracked gunbc#2818
Summary
This PR lands the Phase 2.1 parser and lowering slice for ROADMAP gate #60 (
substrate_gap_parser_grammar_closed): user-facingInt<N>/UInt<N>/Real<N>/Nat<N>in angle brackets parse asTypeAngleArg(width literals are not peers of fullSurfaceType, solet x: 64 = …stays unrepresentable), lower toCompose<Algebra, MachineWidth<N>>with a literal phantom width whereNis in the allowed machine-width set, and register the new hermetic integration test in the SG-0 hand-authored census. Parser control flow remains authored inparse_parser_body.txtand emitted viaregen_parse;parse_surface.dagis the surface-schema authority;regen_runtime_mirrors.pyandregen_bootstrapsnapshots were refreshed so substrate and embeddedDag::new()stay aligned.Per-PR dissolution gate (required for new/expanded hand-Rust under
v3/)EXPECTED_HAND_AUTHORED_TEST(src/v3/compiler/tests/integration/sg0_census_test.rs) forr3_gate_60_phase2_width_nat_parser_test.rs, with machine-authoredscripts/ci-merge/sg0-pr-body-append.2818.txtso CI reads the requiredSG-0 hand-path delta/ pairing lines.SG-0 net-shrink discipline
The two column-0 lines appear at the top of this description (also mirrored in
scripts/ci-merge/sg0-pr-body-append.2818.txtfor the workflow prepend).Per-PR debt-paydown receipt
docs/audit/r3-gate-60-decomposition.md.Test plan
cargo test -p v3-compiler gate_60cargo test -p v3-compiler sg0_censuscargo clippy -p v3-compiler --all-targets -- -D warningscargo fmt --all --checkcargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verify