Skip to content

D5: parse keyword field-init, as-cast, match-as-infix, unary minus, string map keys, and return - #11058

Merged
briansrls merged 4 commits into
mainfrom
session/sharp-tern-402
Sep 11, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/sharp-tern-402

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Six parse_g0_tokens_remain causes in one grammar authority (src/v2/extdeps/languages/dag.dag, ingest + formal productions together): keyword field-init, as casts, match/if/loop as primaries, unary minus, string map keys, return expr.
  • Each cause has an accepted control and a discriminating RED in src/v2/test/claim/parse/d5_expression_grammar_parse_test.dag.
  • Head 920fba08ee2 off baseline 199aee77. required-regen was first_generation_equal (155/155); only declared-divergent main.rs; no stage0 mirror bytes.
  • Left src/v2/std/runtime.dag (interpretation.match field → post-normalize well-formedness). Not one of the six; parent is filing that on the D4 follow-up card. Srv2 closure receipt is parent's, queued by this PR number.

Test plan

  • Local claim_batch 12/12 PASS (marginal CPU 202–356ms).
  • Parent srv2 combined-closure census vs the 199aee7 29-row set (regressed files first).
  • Required CI green on this head.

Made with Cursor

gunbc-ci-auto-heal and others added 2 commits September 11, 2026 13:41
…tring map keys, and return.

Grammar rows live in the dag language authority (ingest and emit together). Each of the six causes carries an accepted control and a discriminating RED fixture. required-regen on this tree was first_generation_equal with only declared-divergent main.rs.

Co-authored-by: Cursor <cursoragent@cursor.com>
…-name keywords as lexemes.

review 63835: combinators are the executing grammar, so D5 no longer appends unread formal rows. Keyword field names intern the lexeme, and the brace-map RED is now a missing value after the colon rather than trailing junk.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63835 (three findings), addressed on 39a7111:

  1. Confirmed: dag_formal_productions() has no caller; the executing grammar is dag_grammar_*_expr(). Wiring that catalog as the single authority the combinators derive from is a replacement, not a D5 patch. Stopped growing it — reverted the six unread formal rows this PR had added. Combinators unchanged.

  2. Confirmed: keyword arms of dag_grammar_binding_name_terminal were StampClass. They are now StampLexeme (same for string map keys). cause_p_keyword_field_init_name_is_lexeme_holds walks the accepted tree and requires a "module" lexeme atom; local claim_batch PASS.

  3. Confirmed: leftover-line RED was trailing garbage. It is now { "k": } (colon without a value). Local claim_batch PASS.

— sent from sharp-tern-402

@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63847, verified on 39a7111 (current head):

  • tokenize: the call at d5_tokenize_parse is real and the import is missing. Sibling harnesses import v2.compiler.tokenize { tokenize }. Local claim_batch on this head still resolved and PASSed the parse witnesses (so this head is not an unresolved tokenize refusal in the evaluator that ran them), but the explicit import block should name it the same way D1 does. Will add that import.

  • d5_find_emitted: confirmed dead. It is not called, and it names parse_subtree_find_production_captured / ParseSubtreeFound / ParseSubtreeAbsent without importing them. Delete on the next push.

Holding that one patch until required run 34609136498 terminates (parent standing order: do not move the observation head). Then one push.

— sent from sharp-tern-402

@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

srv2 closure receipt for D5 at head 39a7111 (overlay on main 7086eb4; instrument closure_pr.sh, pinned producer claim_executor_pinned built from the overlay, route --v2-native-route --source-root dag --source-root src/v2).

Regressed files vs the main baseline (closure_main.sh at 199aee7; 29 refusals): none. Stage shifts (same path, different cause): none.

  • Emitted closure: 172 files, digest a1acc8feab5e… (changed from main's c17ed878…, as expected: src/v2/extdeps/languages/dag.dag is a closure member). Emitted binary sha256 234574a1d2347b75.

  • Closure root 167 modules; native fold EXIT=0, _terminal: complete, wall 368 s, rss 1.25 GB.

  • After-set: 14 file refusals (13 parse_g0_tokens_remain, 1 normalize_reason_post_normalize_not_well_formed on src/v2/std/runtime.dag), joined by path against the baseline's 29: 0 new, 15 cleared:

    • parse_g0_tokens_remain dag/extdeps/external_authority.dag
    • parse_g0_tokens_remain dag/extdeps/languages/rust/emit.dag
    • parse_g0_tokens_remain dag/gunbc/v1/v1_interpreter_primitive_surface.dag
    • parse_g0_tokens_remain dag/std/cache_interface.dag
    • parse_g0_tokens_remain dag/std/decl_ref.dag
    • parse_g0_tokens_remain dag/std/dissolution.dag
    • parse_g0_tokens_remain dag/std/measure.dag
    • parse_g0_tokens_remain dag/std/primitive_identity.dag
    • parse_g0_tokens_remain dag/std/primitive_projection.dag
    • parse_g0_tokens_remain dag/std/roster_frontier.dag
    • parse_g0_tokens_remain src/v2/compiler/03_resolve.dag
    • parse_g0_tokens_remain src/v2/compiler/program_assembly.dag
    • parse_g0_tokens_remain src/v2/extdeps/languages/dag.dag
    • parse_g0_tokens_remain src/v2/extdeps/languages/typescript.dag
    • parse_g0_tokens_remain src/v2/extdeps/runtimes/v2_evaluator.dag

Remaining 14 after D5:

  • normalize_reason_post_normalize_not_well_formed src/v2/std/runtime.dag
  • parse_g0_tokens_remain dag/extdeps/units/iso_80000_3.dag
  • parse_g0_tokens_remain dag/extdeps/uri.dag
  • parse_g0_tokens_remain dag/extdeps/uri_path.dag
  • parse_g0_tokens_remain dag/std/content_hash.dag
  • parse_g0_tokens_remain dag/std/integer.dag
  • parse_g0_tokens_remain dag/std/interval.dag
  • parse_g0_tokens_remain dag/std/pareto.dag
  • parse_g0_tokens_remain dag/std/types.dag
  • parse_g0_tokens_remain src/v2/compiler/00_compile.dag
  • parse_g0_tokens_remain src/v2/compiler/06_translate.dag
  • parse_g0_tokens_remain src/v2/compiler/normalized_tree.dag
  • parse_g0_tokens_remain src/v2/compiler/source_authority.dag
  • parse_g0_tokens_remain src/v2/std/cross_tree/resolution.dag

Six causes targeted, fifteen files cleared, nothing lost: receipt-positive by execution.

…mitted helper.

review 63847: an explicit import block replaces the ambient pool, so the harness now names tokenize the same way D1 does.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

srv2 combined-closure receipt on 39a7111 (parent overlay on main 7086eb4): native fold EXIT=0 over the 167-module closure. After-set 14 vs the 29-row baseline — 0 new rows, 0 stage shifts, 15 cleared (external_authority, rust/emit, v1_interpreter_primitive_surface, cache_interface, decl_ref, dissolution, measure, primitive_identity, primitive_projection, roster_frontier, 03_resolve, program_assembly, dag, typescript, v2_evaluator). Remaining 13 parse_g0_tokens_remain plus runtime.dag normalize are the next D-train census. Observation run 34609136498 on that SHA completed success.

review 63847 was still RC on 39a7111. One push after that run terminated: 02ebd3d imports tokenize in the D5 harness (sibling of D1) and deletes unused d5_find_emitted. Parser is the closure — retake the srv2 receipt on this head.

— sent from sharp-tern-402

review 63847 finding 1 is refuted by floor run 34609136498 (12 d5 identities planned-and-passed). Finding 2 deletion of d5_find_emitted already landed; this only removes the import the module does not need.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63847, split:

  1. tokenize import — REFUTED by execution. Run 34609136498 floor at 39a7111: every v2.test.parse.d5_expression_grammar_parse identity (cause_h / i / n / o / p / q, parses_holds and red_tokens_remain_holds — 12 identities) is disposition=planned_as_changed_witness standing=planned-and-passed outcome=passed. FloorClean 3628 passed / 0 failed. An extra tokenize import is not required; 8b4eb34 removes the one that was added.

  2. d5_find_emitted — real §3c dangling declaration. Deleted. Net vs 39a7111 is only src/v2/test/claim/parse/d5_expression_grammar_parse_test.dag (7 lines). Nothing under src/v2/compiler, src/v2/extdeps, or dag/std, so the srv2 receipt at 39a7111 (15 cleared, 0 regressed) carries.

— sent from sharp-tern-402

@gunbai-bot

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63918, verified on 8b4eb34. No push: observation run 34624634893 is still in progress.

  1. Missing tokenize import — same claim as review 63847 finding 1, and it is REFUTED by execution. Run 34609136498 floor at 39a7111 lists every v2.test.parse.d5_expression_grammar_parse identity (cause_h/i/n/o/p/q, parses_holds and red_tokens_remain_holds — 12 identities) as disposition=planned_as_changed_witness standing=planned-and-passed outcome=passed, FloorClean 3628 passed / 0 failed. 8b4eb34 vs 39a7111 is only the deletion of unused d5_find_emitted in that same test module; it does not change how tokenize resolves. Parent standing order after 63847: do not add an import the module does not need.

  2. Combinators vs dag_formal_productions() — the unread catalog is real (git grep still has one hit: the definition). review 63835 already required either wiring it as the consumed authority or stopping growth; this PR stopped growth (reverted the D5 formal rows). Extending those rows would re-grow a declaration nothing consumes. Deleting the whole roster would touch src/v2/extdeps/languages/dag.dag, which is inside the emitted closure, and would drop the 15-cleared/0-regressed srv2 receipt at 39a7111. The executing grammar is dag_grammar_root / the dag_grammar_* combinators. Holding any dag.dag edit until 34624634893 terminates.

— sent from sharp-tern-402

@briansrls
briansrls merged commit 4914330 into main Sep 11, 2026
4 checks passed
@briansrls
briansrls deleted the session/sharp-tern-402 branch September 11, 2026 21:13
gunbai-bot Bot pushed a commit that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant