Skip to content
Merged
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
2c201b6
WIP: wartime
briansrls May 25, 2026
853b1e8
T-6/T-7/T-34: v4 lexer walk, PEG parse walk, Wave-1 evaluator hooks
briansrls May 25, 2026
3eb0e0e
WIP: wartime
briansrls May 25, 2026
2f4f2f1
Address codex review: fix mutual left-recursion detection and parse_r…
briansrls May 25, 2026
0f50efe
Address second codex review: zero-width walk guard, emitted wiring, d…
briansrls May 25, 2026
5283610
Fix RC1: replace Empty/Cons pattern-matching and self-recursive char …
briansrls May 25, 2026
99acbc2
WIP: wartime
briansrls May 25, 2026
9041384
Fix remaining RC1/RC2-easy: list_skip stdlib primitive; lex_match_pre…
briansrls May 25, 2026
a73201e
Address cursor RC: parse_e1_syntax_error replaces walk_not_realized f…
briansrls May 25, 2026
ba3007f
Fix is_prefix_of named-arg labels in lex_match_prefix: xs:/ys: → pref…
briansrls May 25, 2026
ddc20bb
Fix type errors: [] → Empty for FreeMonoid<T> initial values in fold …
briansrls May 25, 2026
85deaf5
WIP: wartime
briansrls May 25, 2026
4eecc7f
Fix codex RC: Practice 4 dissolution tags on CharResult/TokenPeek; ex…
briansrls May 25, 2026
3813c96
Fix remaining [] literal in parse_skip_to_sync false-branch
briansrls May 25, 2026
32d3433
Fix review blockers: list_skip negative-n guard + grammar production-…
briansrls May 25, 2026
8b3969b
Fix ParseSyncState.result: List<Token> → FreeMonoid<Token> for fold_l…
briansrls May 25, 2026
c09ec7d
Fix tok.class inference: extract parse_sync_step helper with explicit…
briansrls May 25, 2026
b09de94
WIP: wartime
briansrls May 25, 2026
5d3165a
Fix p.expression/p.name type inference in grammar fold lambdas
briansrls May 25, 2026
d6934a6
Fix Wave-1 evaluator hooks: Accepted with fabricated RuntimeUnit → Re…
briansrls May 25, 2026
b5cb02e
Fix P5: tag sync_tokens/recovery path as staged (T-8), correct header…
briansrls May 25, 2026
41e7f79
Add Practice 10 disposition tags to lex_repeat_pattern and lex_match_…
briansrls May 25, 2026
c7b20a6
WIP: wartime
briansrls May 25, 2026
4052785
Add Practice 10 tags to GrammarExpr walkers; validate root.start in g…
briansrls May 25, 2026
1693683
Fix dead GrammarProductionMissing arm: wrong diagnostic after root.st…
briansrls May 25, 2026
d53c955
Complete sync_tokens rollout to all language models; fix transfer Sus…
briansrls May 25, 2026
e993ff5
WIP: wartime
briansrls May 25, 2026
605bd60
Fix sync_tokens rollout: use grammar_empty_sync_tokens() in swift/typ…
briansrls May 25, 2026
bff7ee3
WIP: wartime
briansrls May 25, 2026
4f5644b
T-7 parse: separate production identity from parse-capture; add dupli…
briansrls May 25, 2026
be8ab82
Fix parse_skip_to_sync silent token-drain; add T-8 terminal payload b…
briansrls May 25, 2026
cb7c1f8
Fix Nonterminal arm: wrap parse_expr result with production.emitted i…
briansrls May 25, 2026
25c111f
WIP: wartime
briansrls May 25, 2026
5454661
WIP: wartime
briansrls May 25, 2026
8a4c494
fix(parse): fuel-based termination proof for Nonterminal arms; fold R…
briansrls May 25, 2026
6dd64c3
fix(test/claim/parse): fix Token.start/end Int type; add dangling-non…
briansrls May 25, 2026
0e1df31
fix(parse/algebra): P3+P2 tracked bridges for list_skip and grammar_r…
briansrls May 25, 2026
a7fb16a
WIP: wartime
briansrls May 25, 2026
9fd8d2a
WIP: wartime
briansrls May 25, 2026
83259c8
fix(tokenize): fuel-based termination proof for lex_match_pattern/lex…
briansrls May 25, 2026
8160f4c
WIP: wartime
briansrls May 25, 2026
765e63d
WIP: wartime
briansrls May 25, 2026
3408e62
WIP: wartime
briansrls May 25, 2026
f3efe34
WIP: wartime
briansrls May 25, 2026
7999716
fix(parse): extract expr_direct_left_corner_step to resolve Coproduct…
briansrls May 25, 2026
dcfc068
Merge remote-tracking branch 'origin/main' into session/neat-seal-750
briansrls May 25, 2026
7d4de99
WIP: wartime
briansrls May 25, 2026
e4cc311
fix(parse): rename left/right to lhs/rhs in expr_direct_left_corner_s…
briansrls May 25, 2026
0f8ff71
fix(parse/algebra): address openai-pro review findings — list_skip an…
briansrls May 25, 2026
669e80d
Merge remote-tracking branch 'origin/session/neat-seal-750' into sess…
briansrls May 25, 2026
26757d8
Merge main (7eb5264e9 B1-CANON content_hash) into session/neat-seal-750
briansrls May 25, 2026
f027c04
fix(parse): inline Sequence arm — put nullable-conditional inside lis…
briansrls May 25, 2026
3195052
fix(parse): convert if/else to match in expr_direct_left_corner_step
briansrls May 25, 2026
d439767
merge: resolve conflict — adopt operator's inlined Sequence arm fix
briansrls May 25, 2026
02e15ab
fix(parse): use grammar_empty_corner_list() to anchor List<Symbol> in…
briansrls May 25, 2026
02f5a01
fix(dag): use wave1_canonical_symbols in dag_language_model_wave1_mod…
briansrls May 25, 2026
fc41e2c
WIP: wartime
briansrls May 25, 2026
698dc1a
fix(eval): thread RuntimeValue through transfer via runtime_value_res…
briansrls May 25, 2026
5158489
fix(parse): grammar_fuel = production_count + token_count for correct…
briansrls May 25, 2026
1048764
chore(parse): remove unused parse_walk_not_realized dead code
briansrls May 25, 2026
aa2c52a
fix(parse): restore NodeFold and fold_node to v4.std.node import
briansrls May 25, 2026
7e5d3fd
docs(eval): add 🟡 gate to v4_eval_wave1_transfer with dissolve-on con…
briansrls May 25, 2026
1a309d3
WIP: wartime
briansrls May 25, 2026
ad53b95
fix(algebra): list_skip n<0 returns xs (identity) not Empty; update t…
briansrls May 25, 2026
e6097d7
chore(algebra): delete orphaned list_skip and ListSkipState
briansrls May 25, 2026
82fd874
fix(algebra): add list_tail<T> — move FreeMonoid head-pop to stdlib
briansrls May 25, 2026
2e1a517
WIP: wartime
briansrls May 25, 2026
23adcb6
WIP: Fuel rework
briansrls May 25, 2026
c82c92f
WIP: Fuel rework
briansrls May 25, 2026
17a391f
fix(parse): bind grammar_root_to_node P2-boundary gate to T-8
briansrls May 25, 2026
4b634dc
merge: integrate main (d702a606d) into session/bold-bee-345
briansrls May 25, 2026
d2fdb30
Merge remote-tracking branch 'origin/main' into session/neat-seal-750
briansrls May 25, 2026
5d8a114
fix(parse): replace GrammarDupCheckState with coproduct; add Practice…
briansrls May 25, 2026
acbe35c
fix(v4/lex): block-comment star lookahead + drop unconsumed nat_monus
briansrls May 25, 2026
eecfedd
WIP: Fuel rework
briansrls May 25, 2026
27927a6
fix(tokenize): try-close-first DelimitedPattern; P3/P5 list_tail gate…
briansrls May 25, 2026
1eecce6
merge: integrate PR #3655 (session/neat-seal-750) into fuel rework br…
briansrls May 25, 2026
f8aad2e
revert(v4/lex): drop ConsumeCharUnlessFollowedByPattern LexPattern va…
briansrls May 25, 2026
d0b1319
WIP: Fuel rework
briansrls May 25, 2026
277b9fd
WIP: Fuel rework
briansrls May 25, 2026
0bd6f55
WIP: Fuel rework
briansrls May 25, 2026
73bc8b6
WIP: Fuel rework
briansrls May 25, 2026
efae99e
WIP: Fuel rework
briansrls May 25, 2026
aeecb2d
WIP: Fuel rework
briansrls May 25, 2026
5cad4bf
fix: add P5(b) receipt for parse-table smoke test
briansrls May 25, 2026
abe9c83
fix: SG-0 pairing (c) dispatch wording for CI discipline gate
briansrls May 25, 2026
76239f0
fix: parse_production uses root-owned production by name only
briansrls May 25, 2026
b455e6c
WIP: Fuel rework
briansrls May 25, 2026
b7e423b
WIP: Fuel rework
briansrls May 25, 2026
26299e5
WIP: Fuel rework
briansrls May 25, 2026
b3f3802
Merge remote-tracking branch 'origin/main' into session/bold-bee-345
briansrls May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions INVARIANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX
| `src/v3/compiler/tests/integration/v4_bin_main_dag_smoke_test.rs` | **T-15** (`src/v4/bin/main.dag` — trampoline **`String`** authority + B1 digest **placeholder** `Node`s; closed-tree invariant #2 / pure-bootstrap zero-floor per `docs/design-pure-bootstrap-zero.md`). **Grounded-indicator authoring on `main.dag` is HOLD** pending hub-relayed canonical spec (operator-direct format under-spec; neat-hawk-87 cascade 2026-05-19). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `main.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe. **Interim ratchet:** `v4_bin_main_dag_tokenizes_and_parses_with_trampoline_source_anchor` runs `tokenize_for_test` + `parse_for_test` on the pinned `include_str!` source and asserts the trampoline / stub `data` identifiers plus the escaped `include!` spelling remain present in source text (full `compile_to_dag` on `main.dag` alone is deferred: `import v4.std.node` is not linked in the single-file harness). |
| `src/v3/compiler/tests/integration/v4_compiler_emit_translate_smoke_test.rs` | **TASKS.md** T-10 / Wave-3-B (`src/v4/compiler/06_translate.dag` — `fold_node` translate + `coercion_fold` wrapper, `TargetSelectionPolicy` from target-model bundle; `src/v4/compiler/05_emit.dag` — `serialize_target ∘ translate`, grammar-as-bidir serialize via bundle `emitted`/`source` keys; `src/v4/test/claim/manual/mvp1_rust_add_translate.dag` structural TestClaim anchors). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **This PR expansion (+0 census paths):** same-file interim ratchet adds `v4_rust_language_model_declares_t11_translation_rules` (`src/v4/extdeps/languages/rust.dag` grammar-relation + `target_model` import surface), `v4_java_language_model_declares_t11_translation_rules` (**TASKS.md** T-4 `src/v4/extdeps/languages/java.dag` — parallel `JavaGrammarRelationRow` / `java_mvp1_translation_rules_node` parse surface), `v4_typescript_language_model_declares_t11_translation_rules` (`src/v4/extdeps/languages/typescript.dag`), `v4_swift_language_model_declares_t11_translation_rules` (`src/v4/extdeps/languages/swift.dag`), and `v4_wasm_language_model_declares_t11_translation_rules` (`src/v4/extdeps/languages/wasm.dag`). **Dissolution:** remove when translate/emit/MVP-1 surfaces are exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe (full `compile_to_dag` over v4 compiler modules deferred until multi-module load). **Interim ratchet:** `v4_find_witness_dag_tokenizes_and_parses` / `v4_find_witness_dag_declares_find_witness_entrypoint` — find_witness primitive parse surface; `v4_translate_dag_tokenizes_and_parses` / `v4_emit_dag_tokenizes_and_parses` / `v4_mvp1_rust_add_claim_tokenizes_and_parses` — tokenize+parse only; `v4_translate_dag_module_path_is_compiler_translate` — module path; `v4_translate_dag_imports_coercion_fold_delegate` — `coercion_fold` import; `v4_translate_dag_imports_fold_node_traversal` — `fold_node` import; `v4_translate_dag_declares_coerce_grounded_node` — `coerce_grounded_node` decl; `v4_translate_dag_declares_translate_node_and_translate` — `translate_node`/`translate` decls; `v4_translate_dag_imports_find_witness_types_not_inline_fn` — `CandidateSet` import without `find_witness` fn; `v4_emit_dag_module_path_is_compiler_emit` — module path; `v4_emit_dag_imports_translate_stage` — `translate` import (`serialize_target ∘ translate`); `v4_emit_dag_declares_emit_entrypoint` — `emit` decl; `v4_emit_dag_does_not_import_find_witness` — emit must not import `find_witness`; `v4_mvp1_rust_add_claim_imports_translate_and_emit` — claim imports translate+emit; `v4_rust_language_model_declares_t11_translation_rules` — `rust.dag` `RustGrammarRelationRow` + `rust_mvp1_translation_rules_node`; `v4_java_language_model_declares_t11_translation_rules` — `java.dag` `JavaGrammarRelationRow` + `java_mvp1_translation_rules_node`; `v4_typescript_language_model_declares_t11_translation_rules` — `typescript.dag` `TsGrammarRelationRow` + `ts_mvp1_translation_rules_node`; `v4_swift_language_model_declares_t11_translation_rules` — `swift.dag` `SwiftGrammarRelationRow` + `swift_mvp1_translation_rules_node`; `v4_wasm_language_model_declares_t11_translation_rules` — `wasm.dag` `WasmGrammarRelationRow` + `wasm_mvp1_translation_rules_node`; `v4_rust_integer_overflow_disposition_is_mode_aware_and_axis_bound` — `rust.dag` `OverflowDisposition<RustIntegerCarrier>` checked-arithmetic mode-aware surface + `primitive_fact_axis_overflow_disposition` binding. **T-11 serialize status:** `target_serialize_source_from_model` live in `06_translate.dag` — `grammar_relation_row_for_emitted` + positional token structural check via `grammar_serialize_source_matches_row`, then grammar-inverse lex walk via `token_sequence_to_source` / `token_spelling_from_model` (`grammar_relation_field_tokens` → `concrete_syntax_token_field_class` → fixed spellings from `TargetModel.lex` / `LiteralPattern`, bound spellings from `binding_spellings`; no string templates). `TargetModel.authority_source_text` retained as self-host anchor only. Accepted MVP-1 emit end-to-end on real programs still awaits populated `InferredTree.facts` via T-9 cardinality propagation on non-fixture inputs; translate/coercion/find_witness bodies landed (`find_witness` enumeration + `TargetSelection`, `canonical_grounding_for_node` reads infer-authored witnesses only). |
| `src/v3/compiler/tests/integration/v4_compiler_compile_public_terminal_smoke_test.rs` | **Wave-5-A / P3 commitment 6** (`src/v4/compiler/00_compile.dag` — `validate_then_compile` public terminal, `Validated<CompileOutput>` carrier, `infer` → required-lens gates on `InferredTree` → `compile_inferred`; `src/v4/compiler/07_target_carriers.dag` — acyclic `TargetModel`/`TargetSource` authority; `src/v4/test/claim/manual/validate_then_compile_public_terminal.dag` manual TestClaim anchors). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `validate_then_compile` / compile-core surfaces are exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe (full `compile_to_dag` over v4 compiler modules deferred until multi-module load). **Interim ratchet:** `v4_compile_dag_tokenizes_and_parses` / `v4_compile_dag_module_path_is_compiler_compile` / `v4_compile_dag_declares_public_validate_then_compile` / `v4_compile_dag_declares_ratified_compile_core` / `v4_compile_dag_imports_target_carriers_not_emit_cycle` / `v4_compile_dag_does_not_import_specific_lens_modules` / `v4_emit_dag_does_not_import_compile_module` / `v4_validate_then_compile_claim_tokenizes_and_parses` / `v4_validate_then_compile_claim_imports_public_terminal_helpers` — tokenize+parse + import-row receipts for `compile_lens_gate_rejected_diagnostic`, `TranslateTo`, `validate_then_compile`. |
| `src/v3/compiler/tests/integration/v4_compiler_parse_table_dag_smoke_test.rs` | **TASKS.md** **T-7** (`src/v4/compiler/02_parse.dag` — memoized `ParseTable` / `build_parse_table` / `parse_production`; `src/v4/test/claim/parse/grammar_validation.dag` — `claim_right_recursive_parse_succeeds` + `validation_right_recursive_parse_fixture`; `src/v4/std/algebra.dag` — fail-closed `ListTailResult` tail projection). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness; SG-0 census net +1 pairing `(c)` is mechanically prepended via `scripts/ci-merge/sg0-pr-body-append.3661.txt` in CI (`.github/workflows/ci.yml`). **Dissolution:** remove when parse-table acceptance and T-7 entrypoints are exercised only by `.dag` `TestClaim` rows / T-22 eval runner / generated harness without this host `parse_for_test` structural ratchet. **Interim ratchet:** `v4_compiler_parse_table_dag_tokenizes_and_parses` — tokenize+parse `02_parse.dag`, `grammar_validation.dag`, and `algebra.dag`; `v4_compiler_parse_table_entrypoints_and_claim_wiring` — asserts `build_parse_table`, `parse_production`, `parse_table_empty`, `ListTailResult`, `claim_right_recursive_parse_succeeds`, and `validation_right_recursive_parse_fixture` wiring to `parse_production(`. |
| `src/v3/compiler/tests/integration/v4_lens_edit_locus_dag_smoke_test.rs` | **TASKS.md** T-21 (`src/v4/lens/edit_locus.dag` — `GitDiffNameOnly` → `resolve_edit_locus` → `affected_set` edit_locus via `EditLocusRead` path-regex injection; claims in `src/v4/test/claim/lens_affected_set/edit_locus_resolver.dag`). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when git-diff → edit-locus resolution is exercised only by `.dag` `TestClaim` rows / BinaryShim host without this parse probe (full wire: `TestClaimExerciseSurface` + `ci_runner.dag` — parent cool-hawk-221). **Interim ratchet:** `v4_lens_edit_locus_dag_tokenizes_and_parses`; `v4_lens_edit_locus_module_authority_and_entrypoints`; `v4_lens_edit_locus_claim_wiring`. |
| `src/v3/compiler/tests/integration/v4_lens_affected_set_dag_smoke_test.rs` | **TASKS.md** T-21 IRT-1 (`src/v4/lens/affected_set.dag` — `re_exec_frontier_from_diff: (Dag, Diff) -> Witness<ReExecFrontier>` changed-subgraph frontier fold; purity-aware boundary prune via injectable `AffectedSetRead`; fail-closed whole-DAG gate; six focused leaf `.dag` TestClaims plus aggregate `irt1_leaf_claim_suite.dag` TestClaim under `src/v4/test/claim/lens_affected_set/` with matching six-leaf `affected_set_irt1_subsumed_fixes` DiffIds and `affected_set_irt1_leaf_claim_suite` MechanicalReverification handle in `affected_set_irt1_subsumption` (`src/v4/lens/subsumption.dag`)). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when IRT-1 frontier fold + leaf receipt behaviors are exercised only by `.dag` `TestClaim` rows / generated harness without this parse probe. **Interim ratchet:** `v4_lens_affected_set_dag_tokenizes_and_parses`; `v4_lens_affected_set_module_authority_and_entrypoints`; `v4_lens_affected_set_irt1_leaf_claim_wiring`; `v4_lens_affected_set_irt1_leaf_claim_suite_wiring`. |
| `src/v3/compiler/tests/integration/v4_lens_application_dag_smoke_test.rs` | **TASKS.md** T-23 (`src/v4/lens/application.dag` — `SectionRef`, `EnforcedApplication`, `IntrospectApplication`, `LensApplicationConfig`, `apply_lens`, `apply_advisory_lens`, D1 `subterm_at` / `apply_diff`; minimal `src/v4/std/report.dag` advisory carriers). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when lens-application surface is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse probe (full `DeclarationId` / `NodeId` section projection deferred — see 🟡 `section_subject` in `application.dag`). **Interim ratchet:** `v4_lens_application_dag_tokenizes_and_parses`; `v4_lens_application_module_authority_and_entrypoints`. |
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci-merge/sg0-pr-body-append.3661.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SG-0 hand-path delta: +1

SG-0 pairing: (c) Net +1 on `EXPECTED_HAND_AUTHORED_TEST` for `v4_compiler_parse_table_dag_smoke_test.rs` (INVARIANTS §P5(b) tokenize/parse receipt for T-7 `ParseTable` / `parse_production` + `grammar_validation.dag` claim wiring). Follow-up dispatch to retire host smoke when `.dag` `TestClaim` execution (T-22) or generated harness covers the same facts per ROADMAP T-PB-B / `pb_rust_tests_outside_residual_zero`; tracked gunbc#3661 + `src/v4/TASKS.md` T-7.
2 changes: 2 additions & 0 deletions src/v3/compiler/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ mod v4_bin_main_dag_smoke_test;
mod v4_compiler_compile_public_terminal_smoke_test;
#[path = "integration/v4_compiler_emit_translate_smoke_test.rs"]
mod v4_compiler_emit_translate_smoke_test;
#[path = "integration/v4_compiler_parse_table_dag_smoke_test.rs"]
mod v4_compiler_parse_table_dag_smoke_test;
#[path = "integration/v4_extdeps_coordination_dag_smoke_test.rs"]
mod v4_extdeps_coordination_dag_smoke_test;
#[path = "integration/v4_extdeps_file_system_dag_smoke_test.rs"]
Expand Down
3 changes: 3 additions & 0 deletions src/v3/compiler/tests/integration/sg0_census_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// `v4_java_language_model_declares_t11_translation_rules` (T-4 `java.dag` grammar-relation
// parse surface, same harness file) — interim ratchet rows appended in INVARIANTS.md §SG-0.
"src/v3/compiler/tests/integration/v4_compiler_emit_translate_smoke_test.rs",
// T-7: parse-table memoization receipt (`02_parse.dag`, grammar_validation claim, ListTailResult).
// SG-0 + INVARIANTS §P5(b) receipt — row `v4_compiler_parse_table_dag_smoke_test.rs` in INVARIANTS.md.
"src/v3/compiler/tests/integration/v4_compiler_parse_table_dag_smoke_test.rs",
// Wave-2-C2 / T-4.5: extdeps/file_system.dag pure resource model (Practice 11 companion).
"src/v3/compiler/tests/integration/v4_extdeps_file_system_dag_smoke_test.rs",
// T-4.8 coordination substrate: decomposed WireContractFacts + CoordinationBind shape,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
//! **Layer:** integration
//!
//! T-7 receipt: `src/v4/compiler/02_parse.dag` ParseTable memoization (`build_parse_table`,
//! `parse_production`) and `src/v4/test/claim/parse/grammar_validation.dag` parse-success claim
//! for a right-recursive grammar.
//!
//! **PR receipt (P5 Mechanism (b)):** this harness + matching `EXPECTED_HAND_AUTHORED_TEST`
//! line in `sg0_census_test.rs` + INVARIANTS table row land in the same PR.
//!
//! **TESTING.md:** M1(2.7) tokenize/parse gate; full T-22 claim execution deferred until eval
//! runner lands (same posture as peer v4 smoke tests).

use v3_compiler::parse_for_test;
use v3_compiler::parse_surface::{SurfaceItem, SurfaceType};
use v3_compiler::tokenize_for_test;

const PARSE_DAG: &str = include_str!("../../../../v4/compiler/02_parse.dag");
const PARSE_DAG_PATH: &str = "src/v4/compiler/02_parse.dag";
const CLAIM_DAG: &str = include_str!("../../../../v4/test/claim/parse/grammar_validation.dag");
const CLAIM_PATH: &str = "src/v4/test/claim/parse/grammar_validation.dag";
const ALGEBRA_DAG: &str = include_str!("../../../../v4/std/algebra.dag");
const ALGEBRA_PATH: &str = "src/v4/std/algebra.dag";

fn parse_module(source: &str, path: &str) -> v3_compiler::parse_surface::SurfaceModule {
let tokens =
tokenize_for_test(source, path).unwrap_or_else(|e| panic!("{path}: tokenize: {e:?}"));
parse_for_test(&tokens, path).unwrap_or_else(|e| panic!("{path}: parse: {e:?}"))
}

fn surface_declares_fn(module: &v3_compiler::parse_surface::SurfaceModule, name: &str) -> bool {
module.items.iter().any(|item| match item {
SurfaceItem::Fn {
name: item_name, ..
}
| SurfaceItem::FnExternalBody {
name: item_name, ..
} => item_name == name,
_ => false,
})
}

fn surface_declares_type_sum(
module: &v3_compiler::parse_surface::SurfaceModule,
name: &str,
) -> bool {
module.items.iter().any(|item| match item {
SurfaceItem::TypeSum {
name: item_name, ..
} => item_name == name,
_ => false,
})
}

fn surface_declares_test_claim_data(
module: &v3_compiler::parse_surface::SurfaceModule,
name: &str,
) -> bool {
module.items.iter().any(|item| match item {
SurfaceItem::Data {
name: item_name,
ty: SurfaceType::Named { name: ty_name, .. },
..
} => item_name == name && ty_name == "TestClaim",
_ => false,
})
}

#[test]
fn v4_compiler_parse_table_dag_tokenizes_and_parses() {
let _parse = parse_module(PARSE_DAG, PARSE_DAG_PATH);
let _claim = parse_module(CLAIM_DAG, CLAIM_PATH);
let _algebra = parse_module(ALGEBRA_DAG, ALGEBRA_PATH);
}

#[test]
fn v4_compiler_parse_table_entrypoints_and_claim_wiring() {
let parse = parse_module(PARSE_DAG, PARSE_DAG_PATH);
for name in ["build_parse_table", "parse_production", "parse_table_empty"] {
assert!(
surface_declares_fn(&parse, name),
"{PARSE_DAG_PATH}: must declare {name}"
);
}

let algebra = parse_module(ALGEBRA_DAG, ALGEBRA_PATH);
assert!(
surface_declares_type_sum(&algebra, "ListTailResult"),
"{ALGEBRA_PATH}: ListTailResult fail-closed tail projection"
);

let claim = parse_module(CLAIM_DAG, CLAIM_PATH);
assert!(
surface_declares_test_claim_data(&claim, "claim_right_recursive_parse_succeeds"),
"{CLAIM_PATH}: parse-table success receipt claim"
);
assert!(
surface_declares_fn(&claim, "validation_right_recursive_parse_fixture"),
"{CLAIM_PATH}: fixture must call parse_production over memoized ParseTable path"
);
assert!(
CLAIM_DAG.contains("parse_production("),
"{CLAIM_PATH}: claim must exercise parse_production"
);
}
Loading
Loading