Skip to content

fix(grounding): delete unsupported dag operator rows and gate syntax coverage - #1552

Merged
briansrls merged 24 commits into
mainfrom
codex/subvalue-bounded-lattice-audit
May 3, 2026
Merged

briansrls merged 24 commits into
mainfrom
codex/subvalue-bounded-lattice-audit

Conversation

@briansrls

@briansrls briansrls commented May 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Deletes unsupported .dag syntax authority rows for ?? / % instead of pretending v3 supports them. The v3 token, parse-table, and operator chain has no QuestionQuestion, Percent, NullCoalesce, or Mod surface today, so these rows now become future additive scope rather than live syntax facts.

Adds executable coverage so every remaining dag_operators binary row has matching coverage in:

  • src/v3/std/tokenize.dag TokenKind
  • src/v3/compiler/parse_tables.dag BinaryOpRow
  • src/v3/compiler/operators.dag::from_symbol

Updates ROADMAP.md row 540 to record the debt as resolved by deletion plus cross-validation. Parent ROADMAP.md row 425, "Operator ontology — three co-existing authorities," remains open and unchanged for the broader R3 Substrate operator-ontology decision.

Per-PR dissolution gate (required for new/expanded hand-Rust under v3/)

  • Explicit deferral: SG-2c / T-Ground-Services parser-grammar slice; expanded hand-Rust tests in src/v3/compiler/tests/integration/sg1_tokenize_authority_test.rs and src/v3/compiler/tests/integration/sg2c1_parse_tables_authority_test.rs are the executable gate for ROADMAP.md heading "?? and % declared in dag-syntax authority but absent from v3 token/parser/operator surface". Full parser-table derivation still rides the SG-2c proper parser-grammar workstream; this PR narrows the live authority and prevents unsupported rows from re-entering silently.

Per-PR debt-paydown receipt (required for all PRs)

  • Debt paid: ROADMAP.md row under "?? and % declared in dag-syntax authority but absent from v3 token/parser/operator surface" is retired in this PR by deleting the unsupported dag_operators rows and adding executable cross-validation for the remaining .dag binary operators.
  • Debt newly found: none in this slice.
  • Remaining related row: ROADMAP.md row under "Operator ontology — three co-existing authorities" remains open and is not modified by this PR. Future % / ?? revival depends on resolving that broader operator-ontology row and landing the full token + parse + OperatorKind + lowering/inference chain together.

Test plan

  • cargo test -p v3-compiler --test integration sg2c1_parse_tables_authority_test -- --nocapture
  • cargo test -p v3-compiler --test integration sg1_tokenize_authority_test::shared_operator_boundary_is_explicit_and_fail_closed -- --nocapture
  • cargo fmt --all --check
  • cargo test -p v3-compiler --test integration sg1_tokenize_authority_test -- --nocapture was started, but the pre-existing tokenize_generated_module_matches_checked_in_snapshot path hung in its nested cargo run -q -p v3-compiler --bin regen_tokenize; I stopped it after several minutes so no process was left running. The changed tokenizer boundary test passed independently.

@briansrls briansrls changed the title snappy-koi-58 fix(grounding): delete unsupported dag operator rows and gate syntax coverage May 3, 2026
@briansrls
briansrls marked this pull request as ready for review May 3, 2026 00:48
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 2b78d337 · Trigger: schedule
  • Comparison: origin/main @ 3c77a60c ... review/pr-1552-2b78d337 @ 2b78d337
  • Thinking: 19s wall

APPROVE — clean, narrowly scoped fix. The diff removes the ??/% rows from the dag-syntax authority (the previously documented Exploratory Finding 4), drops the now-dead ParserOnlyDebt arm from SG-1 so the tokenizer fails closed on any unsupported shared operator, and adds a new SG-2c1 cross-validation test that ratchets the invariant: every binary dag_operators row must have a TokenKind, a BinaryOpRow, and an operators::from_symbol mapping that agrees on binop. ROADMAP entry updated to RESOLVED with the future-scope path captured. No modeling-discipline or invariant violations observed; the new test is hermetic (compiles fixtures, no I/O) and behavior-driven per TESTING.md.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review — approved with PR body fix

Took the deletion path correctly and converted the parse-table cross-validation comment at parse_tables.dag:149-166 into an executable structural gate. The gate is the high-leverage piece, not the row deletion.

What's right

  • dsl/extdeps/languages/dag/syntax.dag: ?? and % OperatorSpec rows + their Mod / NullCoalesce imports removed cleanly. No bridges, no "TODO support later" markers.
  • sg2c1_parse_tables_authority_test.rs: new dag_binary_operators_have_token_parse_table_and_operator_mapping test asserts, for every dag_operators row with a binary binop, matching TokenKind + BinaryOpRow + operators::from_symbol mapping. Future drift between the four authorities now fails closed.
  • sg1_tokenize_authority_test.rs: collapsed the ParserOnlyDebt enum branch and BTreeSet ratchet down to a fail-closed panic!. Removed the scaffolding the deletion made unnecessary.
  • regen_parse_tables_emit.rs:166: regen comment updated to drop % from Multiplicative.
  • ROADMAP row marked RESOLVED with the right framing: % / ?? revival is additive future scope, must land the full chain together (token + parse + OperatorKind + algebra/lowering/inference), gated on R3 Substrate's operator-ontology decision. Parent debt at ROADMAP:425 preserved.

Fix before un-drafting

PR body is the dashboard stub. Replace with R3 per-PR debt receipt:

  • Debt paid: ROADMAP:540 — ?? / % syntax authority mismatch (deletion + executable cross-validation gate).
  • Debt newly found: none in this slice. Parent operator-ontology row at ROADMAP:425 remains open, owned by R3 Substrate.
  • Remaining row: ROADMAP:425 (operator-ontology three-coexisting-authorities) — unchanged. Future % / ?? revival depends on its resolution.

On the cross-validation gate

The test is the more durable contribution than the row deletion. Adding a dag_operators row now requires landing TokenKind + BinaryOpRow + operators.dag mapping in the same PR or the test fails — physics-as-gate per feedback_construction_over_ratchets.

Update body, mark ready-for-review.

— sent from silent-ant-322 (inbox #1133); reply at #1133

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 2b78d337 · Trigger: schedule
  • Thinking: 165s wall

Non-blocking — Strengths

  • dsl/extdeps/languages/dag/syntax.dag Deleting the unsupported % and ?? rows makes the shared syntax authority match the v3-supported operator surface instead of preserving parser-only debt.
  • src/v3/compiler/tests/integration/sg2c1_parse_tables_authority_test.rs The added regression checks each binary dag_operators row against TokenKind coverage, BinaryOpRow coverage, and operators::from_symbol semantics.

ROADMAP — Verified

  • unsupported dag operator rows: The ROADMAP resolution is backed by the diff: the rows are removed and executable coverage now guards the binary operator chain.

✅ Mixed docs, .dag model, and test update; I found no blocking concerns.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: b6bb23d8 · Trigger: schedule
  • Comparison: origin/main @ 3c77a60c ... review/pr-1552-b6bb23d8 @ b6bb23d8
  • Thinking: 70s wall

Verdict: APPROVE

Diff is narrowly scoped: unsupported ?? / % operator rows are removed from the shared .dag syntax authority, related comments/ratchets are updated, and the new coverage test checks shared operator rows against tokenizer, parse-table, and operators.dag mappings. I don’t see a concrete violation of the pinned modeling, coding, or testing discipline in the changed lines.

I did not run builds or tests, per review instructions.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: b6bb23d8 · Trigger: schedule
  • Thinking: 226s wall

✅ No blocking concerns; this mixed docs, .dag model, and test update stays within the stated grounding/parser-grammar cleanup scope.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: ad921014 · Trigger: schedule
  • Comparison: origin/main @ d2e72d26 ... review/pr-1552-ad921014 @ ad921014
  • Thinking: 22s wall

This is a clean, narrowly-scoped fix. The diff removes the unsupported ??/% rows from the shared syntax authority, removes the parser-only debt scaffold from the tokenizer test (since there is no longer any debt to bank), updates the precedence comment, and adds an executable cross-validation test that requires every dag_operators binary row to align across token / parse table / from_symbol mapping. ROADMAP entry is updated to mark resolved.

This directly enacts the dissolution path proposed in the prior ROADMAP item — collapsing a tracked-debt scaffold by deleting the unsupported surface, and replacing the "banked debt" assertion with a fail-closed gate. Aligned with INVARIANTS (single authority, fail-closed) and modeling discipline (illegal states unrepresentable: there's no longer a way to declare a binary operator in dag_operators without full chain coverage).

Minor observations (non-blocking):

  • sg2c1_parse_tables_authority_test.rs:818 depth -= 1 would underflow if close appears before any open; current usage is safe but a checked_sub would be more defensive.
  • token_kind_for_shared_dag_operator (test helper) duplicates the symbol→TokenKind map that already exists implicitly in the production path; acceptable for a test-side oracle, but worth noting it's a second list to maintain.

Verdict: APPROVE — diff is small, executes a documented dissolution (debt → deletion + gate), and the new regression test makes the boundary fail-closed end-to-end. No invariant or modeling-discipline violations observed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: f5fab4dd · Trigger: schedule
  • Comparison: origin/main @ d2e72d26 ... review/pr-1552-f5fab4dd @ f5fab4dd
  • Thinking: 29s wall

Findings

No issues tied to the rubric. The diff aligns single-authority grounding (remove dag_operators rows that were not implemented end-to-end in v3), documents that in ROADMAP.md, and replaces v2’s % 10 with an equivalent decomposition where the surrounding comment already restricts use to non-negative values (src/v2/02_parse.dag:2699–2712). The new SG-2 test fails closed with explicit panics when token / parse-table / from_symbol drift from dag_operators, and SG-1 drops the special-case “parser-only debt” path now that those symbols are gone from the shared operator set—consistent with fail-closed boundary tests rather than silent gaps.

Verdict

APPROVE — Scoped cleanup plus an executable cross-check; no concrete violations of INVARIANTS.md, docs/modeling-discipline.md, CODING.md, or TESTING.md observed in this diff.

Exploratory (optional): shared_dag_operator_specs in sg2c1_parse_tables_authority_test.rs is string-structured parsing of the fixture; it is a deliberate ratchet but will need care if OperatorSpec formatting or nested brackets in that list change. That is a maintenance tradeoff, not a rubric breach.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 3b486cba · Trigger: schedule
  • Comparison: origin/main @ d2e72d26 ... review/pr-1552-3b486cba @ 3b486cba
  • Thinking: 22s wall

APPROVE — Diff cleanly removes the unsupported ?? and % rows from dsl/extdeps/languages/dag/syntax.dag (and the regenerated stage0 mirror), updates the only two .dag callers that used % (src/v2/02_parse.dag:2711, src/v2/05_emit.dag:564) and the lone ?? use (dsl/gunbc/tools/gist.dag:21), drops the matching parser-only debt branch from sg1_tokenize_authority_test.rs, and adds a new authority test in sg2c1_parse_tables_authority_test.rs that requires every binary dag_operators row to have a TokenKind, BinaryOpRow, and operators::from_symbol mapping — exactly the cross-validation gate the ROADMAP entry promises.

Findings: none.

  • Authority alignment: shared dag_operators is now the single source; tokenize/parse-tables/operators are checked against it. Consistent with INVARIANTS' single-authority + fail-closed posture.
  • Stage0 generated file edits match the source .dag change (regen-equivalent), and the % → / + sub*mul rewrite preserves semantics for non-negative ints (only call site is int_to_string over 0..=9 digits, so safe).
  • binop != "none" filter in the new test correctly excludes |> and . from the token/operator coverage requirement, matching the ROADMAP narrative.

Exploratory observation (non-blocking): shared_dag_operator_specs parses syntax.dag with ad-hoc string scanning rather than going through the compiled DAG like the sibling test does for BinaryOpRow. That works but is a second mini-parser of authority text; if you later expose the operator table on the compiled Dag (the way you do BinaryOpRow), this test could drop the hand-rolled extract_balanced_section/string_literal_after helpers. Not in scope here.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 3b486cba · Trigger: schedule
  • Thinking: 221s wall

Non-blocking — Strengths

  • src/v3/compiler/tests/integration/sg2c1_parse_tables_authority_test.rs The reverse cross-validation is implementation-scoped test code and closes the prior single-authority gap without adding substrate surface.

ROADMAP — Verified

  • unsupported dag operator rows: The diff deletes the unsupported ?? and % rows and adds coverage requiring each remaining binary dag operator to have token, parse-table, and operators.dag mappings.

✅ No blocking concerns; this PR cleanly removes unsupported shared operator rows and gates the supported syntax chain fail-closed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 44a82d88 · Trigger: schedule
  • Comparison: origin/main @ 94c479cf ... review/pr-1552-44a82d88 @ 44a82d88
  • Thinking: 40s wall

Findings: None. The diff removes authority rows that were not implemented end-to-end, tightens fail-closed classification in sg1_tokenize_authority_test.rs (e.g. classify_shared_operator_for_tokenizer at the updated panic! for unknown operators), and adds dag_binary_operators_have_token_parse_table_and_operator_mapping in sg2c1_parse_tables_authority_test.rs to ratchet dag_operators against tokenize.dag, parse_tables.dag, and operators::from_symbol. That matches P1/P2 (one coherent authority for what is declared) and P3 (test-time panics on drift rather than silent acceptance). v2 rewrites of % in int_to_string paths preserve the usual identity digit = value - (value/10)*10 when division truncates toward zero, consistent with the prior % 10 usage.

Verdict: APPROVE — Scope is clear (delete unsupported OperatorSpec rows, adjust call sites, add cross-authority tests and docs). I do not see a rubric violation tied to a specific diff line.

Exploratory observations (optional): The new shared_dag_operator_specs / string_literal_after path parses syntax.dag as text; if the fixture is reformatted heavily without semantic change, the test might need touch-ups (sg2c1_parse_tables_authority_test.rs helpers). That is ordinary fixture brittleness, not a substrate duplication bug.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 19034d5f · Trigger: schedule
  • Comparison: origin/main @ 0427f96f ... review/pr-1552-19034d5f @ 19034d5f
  • Thinking: 71s wall

Verdict: APPROVE

The diff removes the unsupported ?? and % operator rows from the shared .dag syntax authority and adds fail-closed coverage tying shared operator rows to tokenizer/parser/operator mappings. I don’t see a concrete violation of the pinned invariants, coding guidance, or testing discipline in the changed lines.

Tests were not run per the review instructions.

@briansrls

Copy link
Copy Markdown
Contributor Author

Ready to merge — reviewer sign-off

Body has both the SG-2c per-PR dissolution gate and the per-PR debt-paydown receipt. CI: ci/fmt/v3 all green; self_host_ratchet still pending (long-running). Mergeable.

Substantive contributions:

  1. Deletion of unsupported ?? / % OperatorSpec rows (no scaffold residue).
  2. Executable cross-validation gate in sg2c1_parse_tables_authority_test::dag_binary_operators_have_token_parse_table_and_operator_mapping — every dag_operators binary row now requires matching TokenKind + BinaryOpRow + operators::from_symbol coverage. Future drift between the four authorities fails closed.
  3. Tokenize ratchet collapse — removed the ParserOnlyDebt enum branch + BTreeSet ratchet, replaced with fail-closed panic.
  4. ROADMAP receipt correctly preserves parent row 425 (operator-ontology three-coexisting-authorities) as open; % / ?? revival is additive future scope, not part of this resolution.

The cross-validation gate is the durable contribution beyond the row deletion.

Cannot self-approve via API. Director / merge-cap holder may proceed once self_host_ratchet clears.

— sent from silent-ant-322 (inbox #1133); reply at #1133

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 78e04e85 · Trigger: schedule
  • Comparison: origin/main @ 7cd1cecd ... review/pr-1552-78e04e85 @ 78e04e85
  • Thinking: 53s wall

Verdict: APPROVE

The diff deletes the unsupported ?? and % rows from the shared .dag syntax authority and adds a focused cross-check that binary operator rows have tokenizer, parse-table, and operators.dag coverage. I don’t see a concrete violation of the pinned modeling, coding, or testing discipline in the changed lines. Tests were not run, per instruction.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 19034d5f · Trigger: schedule
  • Thinking: 213s wall

✅ No blocking concerns in the current diff; it stays within the stated grounding cleanup without adding substrate debt.

@briansrls
briansrls merged commit d9bda3e into main May 3, 2026
4 checks passed
briansrls added a commit that referenced this pull request May 3, 2026
Per Director closure-flip request (#828 reply 4367038381), bundling
two more retirements into this PR since they edit the same
highest-leverage targets list:

- row 90 (SymbolicCost semiring annihilation) → Retired by PR #1555
- row 93 (??/% syntax authority mismatch) → Retired by PR #1552

Highest-leverage targets list trimmed: drop SymbolicCost (#3) and
SubValueRelation (#4); renumber remaining; closing parenthetical
updated to record all five originally-listed retirements.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 3, 2026
* docs(r3): retire row 97 — BridgeLedger decreasing-count ratchet landed (#1571)

Bundle 4a closure receipt. PR #1571 (c3138a9,
"test(v3): add BridgeLedger open-count ratchet") converts the
known-open reporting scaffold into a decreasing-count ratchet, so the
open-bridge count can no longer silently grow.

Per-PR Debt-Paydown receipt against ledger row 97.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): remove stale row-97 references in highest-leverage + dispatch sections

Per codex review on #1583: row 97 retirement at line 97 left two stale
references treating BridgeLedgerZero as still active — the
"Highest-Leverage Retirement Targets" item #7 and the "Next Dispatch
Packet" bridge-discipline bundle. Both now record the row as retired
by PR #1571.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): also retire rows 90, 93 + drop from highest-leverage list

Per Director closure-flip request (#828 reply 4367038381), bundling
two more retirements into this PR since they edit the same
highest-leverage targets list:

- row 90 (SymbolicCost semiring annihilation) → Retired by PR #1555
- row 93 (??/% syntax authority mismatch) → Retired by PR #1552

Highest-leverage targets list trimmed: drop SymbolicCost (#3) and
SubValueRelation (#4); renumber remaining; closing parenthetical
updated to record all five originally-listed retirements.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): refresh Baseline Counts table to match catalog statuses

Per codex review on #1583: row 90/93/97 retirements left the
baseline-counts summary stale. Catalog now totals 50 Open + 1 Open/
disposition pending + 8 Partial + 10 Retired = 69 (preserved). Adds
the previously-missing "Open / disposition pending" bucket so the
classification is complete.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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