Repository navigation
Repair spec parser discards and reuse AST test helpers #8756
Description
Master 12c6d91403e58584a44d9bab39547a5b3d35b418 fails the corpus and duplicate-body ratchets on existing spec defects. These also block owner-authored PRs #8749 and #8755.
Repair scope:
specs/a/b_c.t27andspecs/a_b/c.t27: remove unmatched final braces and describe them honestly as distinct seal-path fixtures, not evidence for unrelated project acceptance criteria.specs/compiler/optimizer.t27: two placeholder tests contain no implemented behavior, and their semicolon-commented given/then blocks account for all 84 discarded top-level tokens. Keep the deferred requirements as explicit prose and remove the nonexecuting test declarations. Do not claim a working optimizer or fix its known compiler/type blockers.specs/tri/t27b/ast_shape.t27duplicates the clear and mark-mask test helpers fromast_scan.t27. Export and reuse the original helpers instead of copying their bodies; preserve test assertions and function behavior.
Acceptance: all five specs parse with zero top-level discards; executable seal-path fixtures and AST specs pass their actual tests; regenerate and verify the affected seals; duplicate-body ratchet no longer reports the two added groups. No wholesale ledger blessing, handwritten foreign implementation, CI weakening, historical authorship change or unrelated placeholder coverage claim.
User Scenarios
- Given the spec parser discards top-level tokens in five cited specs, when the parser runs on the corpus, then all five specs parse with zero top-level discards.
- Given
specs/tri/t27b/ast_shape.t27duplicates clear and mark-mask helpers fromast_scan.t27, when the helpers are exported fromast_scan.t27and reused inast_shape.t27, then the duplicate-body ratchet no longer reports the two added groups. - Given
specs/compiler/optimizer.t27contains placeholder tests with semicolon-commented given/then blocks accounting for 84 discarded tokens, when the nonexecuting test declarations are removed and deferred requirements kept as prose, then the spec parses without discards and makes no claim of a working optimizer.
Requirements
FR-001: specs/a/b_c.t27 and specs/a_b/c.t27 MUST remove unmatched final braces and be described honestly as distinct seal-path fixtures.
FR-002: specs/compiler/optimizer.t27 MUST remove the two placeholder tests with semicolon-commented given/then blocks and keep deferred requirements as explicit prose.
FR-003: specs/tri/t27b/ast_scan.t27 MUST export the clear and mark-mask test helpers for reuse.
FR-004: specs/tri/t27b/ast_shape.t27 MUST import and reuse the exported helpers instead of copying their bodies, preserving test assertions and function behavior.
FR-005: All five affected specs MUST parse with zero top-level discards.
FR-006: Executable seal-path fixtures and AST specs MUST pass their actual tests.
FR-007: Affected seals MUST be regenerated and verified.
FR-008: The duplicate-body ratchet MUST no longer report the two added groups from ast_shape.t27.
Success Criteria
t27c specs/a/b_c.t27exits 0 with zero top-level discardst27c specs/a_b/c.t27exits 0 with zero top-level discardst27c specs/compiler/optimizer.t27exits 0 with zero top-level discardst27c specs/tri/t27b/ast_scan.t27exits 0 with zero top-level discardst27c specs/tri/t27b/ast_shape.t27exits 0 with zero top-level discards- Seal regeneration for affected fixtures:
.trinity/seals/parser.jsonupdated and verified - Duplicate-body ratchet reports 0 groups for the clear and mark-mask helpers (previously 2)
- Corpus ratchet passes on master branch
Boundary
- specs/a/b_c.t27
- specs/a_b/c.t27
- specs/compiler/optimizer.t27
- specs/tri/t27b/ast_shape.t27
- specs/tri/t27b/ast_scan.t27
- .trinity/seals/parser.json
Activity
dmitrii-f-t27 commentedon Oct 10, 2026
One further master corpus failure belongs in the same spec repair:
specs/port/trinity/src/tri/orchestrator_bench.t27cannot generate Verilog because its local[10][]const u8command array is a 2D aggregate. The function only observes the array length and each string's length; it never returns or compares command text. Replace that array with the same ten numeric lengths, preserve iteration counts and assertions, and add a length-table regression. This restores the supported representation of the existing synthetic iteration benchmark; it does not claim real command lookup, sacred score calculation or measured performance. Scope is six source specs, with regenerated applicable seals.dmitrii-f-t27 commentedon Oct 10, 2026
The remaining duplicate group is an identical
samebyte comparison inint_cast_plan.t27,opaque_plan.t27andtype_text.t27. The two plan specs will call the already publictype_text::same, adding those two source files to this repair.The two seal naming fixtures also derive the same
a_b_c_spec.jsonfilename.seal --savecurrently overwrites it without refusing, so both cannot have independently valid seals. Give the second fixture a distinct module name (no repository imports of either fixture), regenerate both separate seals, and record the general compiler collision bug separately. This repair does not claim collision protection in the compiler.fix(specs): repair parser discards and reuse AST helpers (Refs gHashT…
fix(specs): integrate corpus parser and helper repairs (Refs gHashTag…
fix(codegen): refresh dependent Rust copies (Refs gHashTag#8756)
merge: preserve spec repairs with latest master (Refs gHashTag#8756)
Merge upstream master d2570f4 for spec repairs (Refs gHashTag#8756)
fix(specs): keep large frame arrays as byte memories (Refs gHashTag#8756
fix(specs): reconcile upstream corpus repairs (Refs gHashTag#8756)
fix(specs): refresh seal after upstream compiler repair (Refs gHashTa…
fix(specs): enroll ten verified native passes (Refs gHashTag#8756)
Merge origin/master 5e5493c into codex/spec-tests-7641 (Refs gHashTag…
fix(codegen): regenerate t27b Rust copies with the merged compiler (R…
Merge master into codex/spec-tests-7641; ledgers = master minus entri…