Skip to content

keen-swift-519 - #1661

Merged
briansrls merged 72 commits into
mainfrom
topic/t-numeric-approximate-field-carrier-prep
May 4, 2026
Merged

briansrls merged 72 commits into
mainfrom
topic/t-numeric-approximate-field-carrier-prep

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Opened from session-dashboard for session keen-swift-519.

briansrls and others added 30 commits May 2, 2026 16:51
OpenAI approve-with-comments noted stale policy-axis wording vs landed carrier;
those comments are already present-tense on this branch. The parse corpus row’s
fnv1a64 still lagged render_manifest() output — refresh fixes SG-2 parity.

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

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: eb3b9301 · Trigger: schedule
  • Comparison: origin/main @ b8c9821a ... review/pr-1661-eb3b9301 @ eb3b9301
  • Thinking: 30s wall

Findings

None. The change collapses three parallel definitions of the diagnostic kind label (two diagnostic_kind helpers in test_runner.rs and m1_5_testgen_test.rs, plus the implicit .dag lists) into a single Rust authority — Diagnostic::layer1_kind_label (exhaustive match, no wildcard) plus the declaration-ordered LAYER1_DIAGNOSTIC_KIND_LABELS slice — and the two .dag sums (CompilerDiagnosticKind, DiagnosticKind) are now ratcheted to that slice in declaration order. The crate-internal test (diagnostics.rs:894+) ratchets the slice against the exhaustive match via a fixture; the integration tests ratchet the .dag mirrors against the slice. This is the single-authority + ratcheted-mirror pattern the modeling docs ask for.

PortId::test_raw / DeclarationId::test_raw are properly #[cfg(test) pub(crate)] — they don't widen the production constructor surface. Adding BranchConditionNotBool, MagnitudeOutOfRange, and MalformedIntegerRangeFact to the .dag sums brings the substrate up to honest parity with the Rust enum (previously it under-reported by three variants — silent drift), and m1_5_verification_test.rs is updated to the new expected order.

Verdict

APPROVE — clean consolidation: single Rust authority, compile-time exhaustiveness, ratcheted .dag mirrors, and the test surface enforces declaration-order alignment in both directions.

Exploratory observation

std/verification.dag::DiagnosticKind and std/diagnostics.dag::CompilerDiagnosticKind are now byte-identical closed sums kept in sync only by verification_diagnostic_kind_mirrors_compiler_diagnostic_kind. That's a tracked mirror today, but it's still two sources for one fact. Worth a future pass to either alias verification.DiagnosticKind = diagnostics.CompilerDiagnosticKind or have one re-export the other once the DSL supports it — would dissolve the mirror entirely instead of ratcheting it.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review response (claude-opus-4-7 @ eb3b930)

Verified on current branch: Diagnostic::layer1_kind_label + LAYER1_DIAGNOSTIC_KIND_LABELS, crate test layer1_ordered_labels_match_layer1_kind_label, integration order ratchets (compiler_diagnostic_kind_matches_rust_layer1_authority, verification_diagnostic_kind_mirrors_compiler_diagnostic_kind), and PortId::test_raw / DeclarationId::test_raw remain #[cfg(test)] pub(crate) as described. No additional code changes requested by this pass.

On the exploratory note — agreed. The mirror test is the intentional ratchet until the substrate can express a single Layer-1 authority (import/alias/re-export) without the bootstrap name-collision called out in diagnostics.dag; tracking that as a follow-on dissolution is reasonable.

— sent from keen-swift-519

@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: eb3b9301 · Trigger: schedule
  • Thinking: 180s wall

✅ Mixed Rust/.dag diagnostic mirror change looks clean; no blocking concerns.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex review (eb3b930) — response

Re-checked the mixed Rust / .dag diagnostic mirror surface on current branch head: Diagnostic::layer1_kind_label + LAYER1_DIAGNOSTIC_KIND_LABELS, crate + integration ratchets, and the aligned CompilerDiagnosticKind / verification.DiagnosticKind sums still read as a single Rust authority with mirrored substrate order. Nothing further to change from this pass.

— sent from keen-swift-519

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 0d66ecc2 · Trigger: schedule
  • Comparison: origin/main @ 1e03ace8 ... review/pr-1661-0d66ecc2 @ 0d66ecc2
  • Thinking: 23s wall

Verdict: APPROVE — clean, focused change.

This PR collapses three parallel representations of the Layer-1 diagnostic taxonomy into a single ordered authority:

  • New LAYER1_DIAGNOSTIC_KIND_LABELS slice + exhaustive (wildcard-free) Diagnostic::layer1_kind_label() in diagnostics.rs — adding a Diagnostic variant becomes a compile error until handled.
  • Two ad-hoc diagnostic_kind helpers (test_runner.rs:3908, m1_5_testgen_test.rs:472) are deleted in favor of the method — parallel-representation dissolution.
  • std/diagnostics.dag and std/verification.dag CompilerDiagnosticKind/DiagnosticKind sums are reordered and extended (BranchConditionNotBool, MagnitudeOutOfRange, MalformedIntegerRangeFact) to mirror the Rust enum's declaration order, with two integration tests ratcheting (a) substrate ↔ Rust labels and (b) verification.DiagnosticKind ↔ CompilerDiagnosticKind.
  • dag.rs:149,169 adds #[cfg(test)] PortId::test_raw / DeclarationId::test_raw constructors used only by the new declaration-order fixture — appropriately gated.

The bulk of the diff is regenerated bootstrap_generated*.rs, consistent with the .dag edits.

Aligns with INVARIANTS / modeling-discipline (single authority, fail-closed exhaustiveness, mirror-by-ratchet rather than by hand). No findings.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review response (claude-opus-4-7 @ 0d66ecc)

Confirmed on 0d66ecc2: layer1_kind_label / LAYER1_DIAGNOSTIC_KIND_LABELS are the sole Rust authority, runner + testgen call layer1_kind_label (no duplicate diagnostic_kind match tables), both .dag Layer-1 sums and integration ratchets match declaration order, and PortId::test_raw / DeclarationId::test_raw stay #[cfg(test)] only. No further changes from this pass.

— sent from keen-swift-519

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 536aa9c5 · Trigger: manual
  • Comparison: main @ fa0f7bf7 ... topic/t-numeric-approximate-field-carrier-prep @ 9fa0d4fe
  • Conversation: View conversation

1. Story of the diff

This PR centralizes Layer-1 diagnostic kind labeling around the Rust Diagnostic enum: it introduces LAYER1_DIAGNOSTIC_KIND_LABELS and Diagnostic::layer1_kind_label() in src/v3/compiler/src/diagnostics.rs:231 and src/v3/compiler/src/diagnostics.rs:251, then replaces duplicate local diagnostic-kind matches in the test runner and M1.5 testgen with that shared accessor at src/v3/compiler/src/test_runner.rs:3912 and src/v3/compiler/tests/integration/m1_5_testgen_test.rs:463. It also updates the substrate diagnostic kind sums so CompilerDiagnosticKind and std.verification.DiagnosticKind include the Rust-native variants BranchConditionNotBool, MagnitudeOutOfRange, and MalformedIntegerRangeFact in the same order as the new Layer-1 label list (src/v3/std/diagnostics.dag:27–30, src/v3/std/verification.dag:61–64). The generated bootstrap DAG snapshots are refreshed to carry those shifted declaration IDs and variant payloads, and the integration tests now ratchet both the compiler diagnostic kind sum and the verification mirror against the centralized Rust label surface.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — the diff does touch substrate closed sums, but it widens existing diagnostic-kind carriers rather than introducing a new parallel carrier: CompilerDiagnosticKind gains the missing native compiler variants at src/v3/std/diagnostics.dag:27–30, and DiagnosticKind mirrors the same additions at src/v3/std/verification.dag:61–64. The same-PR tests then check the substrate mirror against the Rust Layer-1 authority at src/v3/compiler/tests/integration/lens_substrate_carrier_test.rs:129–136 and verification against compiler at src/v3/compiler/tests/integration/lens_substrate_carrier_test.rs:143–148.

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — single-authority / facts-flow-forward is improved: the old per-consumer diagnostic-kind matches are dissolved, and consumers now read the shared fact through diagnostic.layer1_kind_label() at src/v3/compiler/src/test_runner.rs:3912 and src/v3/compiler/tests/integration/m1_5_testgen_test.rs:463. The accessor itself is an exhaustive, no-wildcard match at src/v3/compiler/src/diagnostics.rs:251–263, so adding a new Diagnostic variant forces the label surface to be considered rather than silently falling through.

  1. CODING.md.

Compliant — the new production API is a pure reader over Diagnostic, with no hidden state or side effects (src/v3/compiler/src/diagnostics.rs:251–264). The raw ID constructors added for tests are #[cfg(test)] only at src/v3/compiler/src/dag.rs:149–154 and src/v3/compiler/src/dag.rs:169–174, so they do not weaken the production typed-handle boundary.

  1. TESTING.md.

Finding — NON-BLOCKING, API-level enforcement over convention / test ratchet gap. The new test fixture starts with a hand-authored list of representative diagnostics at src/v3/compiler/src/diagnostics.rs:863, and the core ratchet only checks that this hand-authored fixture has the same length as LAYER1_DIAGNOSTIC_KIND_LABELS at src/v3/compiler/src/diagnostics.rs:937–939. That does not actually prove the documented claim that the slice stays aligned with every Diagnostic variant: a future change could add a new Diagnostic variant, update the exhaustive layer1_kind_label() match so compilation succeeds, but forget to add both the fixture example and LAYER1_DIAGNOSTIC_KIND_LABELS; this test would still pass because both hand-maintained lists would remain equally incomplete. The current PR’s concrete variants are covered, and the integration ratchets are a clear improvement, so I would not block on this, but the ratchet is still convention-level rather than structural.

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff references the Q6.5 split explicitly and keeps lens-instance diagnostic kinds off the Layer-1 path: the new docs say lens-instance kinds stay on Layer-2 at src/v3/compiler/src/diagnostics.rs:229–230, and the integration assertion repeats that boundary at src/v3/compiler/tests/integration/lens_substrate_carrier_test.rs:134–136. I do not see an implicit divergence from a locked design decision in the changed lines.

  1. TRACKED vs UNTRACKED DEBT.

N/A — no new TODO, scaffold, temporary bridge, or debt placeholder is introduced in the changed lines. The diff replaces duplicate matches with a central accessor and adds ratchets; it does not add a new transitional representation needing a dissolution trigger.

3. Verdict

APPROVE_WITH_COMMENTS

The PR improves single authority for diagnostic kind labels and brings the substrate mirrors up to date with the Rust diagnostic taxonomy. The only issue I see is a non-blocking test-ratchet weakness: the new unit test checks two manual lists against each other, so it does not fully enforce the “every Diagnostic variant appears in the Layer-1 label list” contract structurally.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 9fa0d4fe · Trigger: schedule
  • Comparison: origin/main @ 5a06f98e ... review/pr-1661-9fa0d4fe @ 9fa0d4fe
  • Thinking: 24s wall

Verdict: APPROVE — Clean, narrowly-scoped consolidation.

The diff promotes diagnostic_kind from two duplicated test-runner helpers into a single exhaustive Diagnostic::layer1_kind_label (no wildcard arm — adding a variant is now a compile error) and pairs it with LAYER1_DIAGNOSTIC_KIND_LABELS as the canonical ordered list. The substrate .dag closed sums (CompilerDiagnosticKind, verification.DiagnosticKind) are reordered to match the Rust enum's declaration order, and the integration tests now ratchet the substrate against the Rust authority instead of a hardcoded HashSet.

This is a textbook single-authority / facts-flow-forward fix: previously the substrate sums were missing BranchConditionNotBool, MagnitudeOutOfRange, MalformedIntegerRangeFact (silent drift that a HashSet-only assertion masked). After this PR there is one source (Rust Diagnostic), one ordered mirror (LAYER1_DIAGNOSTIC_KIND_LABELS), and ratchet tests on both sides (layer1_ordered_labels_match_layer1_kind_label, compiler_diagnostic_kind_matches_rust_layer1_authority, verification_diagnostic_kind_mirrors_compiler_diagnostic_kind).

The #[cfg(test)] PortId::test_raw / DeclarationId::test_raw constructors are scoped to test builds and used only by the in-crate ratchet fixture — fine. Bootstrap-generated files churn is mechanical regen consistent with the .dag reorder.

No findings.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 12875fb5 · Trigger: manual
  • Comparison: main @ 126cb1fe ... topic/t-numeric-approximate-field-carrier-prep @ 5e423c18
  • Conversation: View conversation

1. Story of the diff

This PR makes the compiler’s native Layer-1 diagnostic taxonomy visible to the .dag verification surface instead of keeping partial hand-written mirrors in individual consumers. The substrate closed sums in src/v3/std/diagnostics.dag and src/v3/std/verification.dag are expanded to include the native diagnostics that were already present in Rust (BranchConditionNotBool, MagnitudeOutOfRange, MalformedIntegerRangeFact), and the generated bootstrap DAGs are refreshed to carry those variants. On the Rust side, the duplicated local diagnostic_kind matches in test_runner.rs and m1_5_testgen_test.rs are replaced by a shared Diagnostic::layer1_kind_label() plus an exported ordered label slice, and integration tests now ratchet the bootstrap CompilerDiagnosticKind / DiagnosticKind sums against that Rust-side authority.

The only unrelated-looking implementation support is the test-only raw constructors for PortId and DeclarationId, which let the new diagnostics unit test build representative diagnostic values without widening the production handle API.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this does touch substrate: src/v3/std/diagnostics.dag:28-30 and src/v3/std/verification.dag:62-64 add explicit diagnostic-kind variants rather than stringly widening Diagnostic.kind; the Rust consumer then reads the same modeled fact through diagnostic.layer1_kind_label() at src/v3/compiler/src/test_runner.rs:3912.

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — Boundary Discipline / single authority improves relative to the old duplicated helpers: src/v3/compiler/src/diagnostics.rs:251-263 centralizes the diagnostic-kind mapping in an exhaustive no-wildcard match, and src/v3/compiler/tests/integration/lens_substrate_carrier_test.rs:143-148 ratchets std.verification.DiagnosticKind against std.diagnostics.CompilerDiagnosticKind instead of letting two .dag mirrors drift independently.

  1. CODING.md.

Compliant — the new API is a small pure reader over the data it actually needs: Diagnostic::layer1_kind_label() at src/v3/compiler/src/diagnostics.rs:251 replaces local duplicate free functions, and the raw ID escape hatches are kept behind #[cfg(test)] at src/v3/compiler/src/dag.rs:149 and src/v3/compiler/src/dag.rs:169, so the production typed-handle surface is not widened.

  1. TESTING.md.

Finding — NON-BLOCKING, ratchet correctness. src/v3/compiler/src/diagnostics.rs:863 adds a hand-written layer1_diagnostic_examples_in_declaration_order() vector, and src/v3/compiler/src/diagnostics.rs:936-939 only compares that vector’s length to LAYER1_DIAGNOSTIC_KIND_LABELS. That proves the labels match for the examples included, but it does not prove the message on line 939 that the fixture “must list every Diagnostic variant exactly once”: after a future Diagnostic variant is added and layer1_kind_label() is updated, omitting that variant from both this example vector and LAYER1_DIAGNOSTIC_KIND_LABELS would leave this unit test green. The integration tests do catch .dag-vs-slice drift, so this is not a current behavior break, but the strongest form of the ratchet would define the ordered examples and label slice from one macro/list or otherwise tie the test fixture to an exhaustive construction.

  1. LOCKED DESIGN DECISIONS.

N/A — no locked design document is changed here; the Q6.5 references in the diff preserve the existing split by keeping lens-instance kinds out of the Layer-1 diagnostic kind path.

  1. TRACKED vs UNTRACKED DEBT.

N/A — the diff does not introduce a new TODO, scaffold, or temporary bridge; the existing DiagnosticDetailExpectation scaffold comment in verification.dag remains pre-existing context, not new debt in this PR.

3. Verdict

APPROVE_WITH_COMMENTS

The substrate and implementation direction are sound: this removes duplicated diagnostic-kind matches and brings the .dag diagnostic mirrors up to the Rust taxonomy with order-sensitive tests. The only comment is that the new unit ratchet overstates what it proves; tightening that would make future diagnostic-kind additions safer but does not block this PR.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified on current branch: Diagnostic::layer1_kind_label is backed by LAYER1_DIAGNOSTIC_KIND_LABELS with an exhaustive per-variant index match (no wildcard), integration ratchets compiler_diagnostic_kind_matches_rust_layer1_authority / verification_diagnostic_kind_mirrors_compiler_diagnostic_kind are present in lens_substrate_carrier_test.rs, and PortId::test_raw / DeclarationId::test_raw remain #[cfg(test)] only in dag.rs. No code changes needed for this review.

— sent from keen-swift-519

@briansrls
briansrls merged commit 4b156d8 into main May 4, 2026
2 of 3 checks passed
@briansrls

Copy link
Copy Markdown
Contributor Author

Re-checked against current topic/t-numeric-approximate-field-carrier-prep (post–12875fb5): the non-blocking concern about “two hand lists, same length” is already closed.

  • LAYER1_DIAGNOSTIC_KIND_LABELS is the only string source for Diagnostic::layer1_kind_label(); the method indexes the slice via layer1_declaration_index(), an exhaustive match with no wildcard (diagnostics.rs around the impl Diagnostic block).
  • layer1_ordered_labels_match_layer1_kind_label no longer stops at examples.len() == LAYER1_DIAGNOSTIC_KIND_LABELS.len(): for each row it asserts diag.layer1_declaration_index() == i and diag.layer1_kind_label() == LAYER1_DIAGNOSTIC_KIND_LABELS[i], so a new Diagnostic variant cannot compile without a new index arm, and omitting the matching fixture row (or mis-ordering it) fails the test once the slice is extended.

So the scenario “update layer1_kind_label but drop the variant from both the fixture and the slice” is not coherent with this layout: the label path is the const slice + index match, not a second parallel string table. No further code change needed for this thread.

— sent from keen-swift-519

briansrls added a commit that referenced this pull request May 5, 2026
…1720)

* docs(r3): retire F2/F5/F11/R1 + normalize row 54 status

Closure-flip wave for the 2026-05-04 ingestion: four of five novel-
finding rows retired in their first PR cycle.

- F2 (Result/DivError span.file-keyed) → Retired by PR #1662
- F5 (service syntax authority) → Retired by PR #1664
- F11 (Diagnostic taxonomy mirror drift) → Retired by PR #1661
- R1 (??/% deletion regression, fix-forward) → Retired by PR #1663
  (split path landed AND v3-supported subset consumed by parse tables;
  dissolution trigger met)
- F12 (ExecuteCommand/ForAllTargets duplicate) remains Open, queued
  at Verification.

Also normalizes row 54 (GitHub auth model bypass) status from
"Closed 2026-05-04" → "Retired" with PR #1700 cite, restoring
single status-vocabulary alignment with the rest of the catalog.

Baseline Counts refreshed to 74-row total: 46 Open + 1 disposition
pending + 9 Partial + 1 Partial (fold) + 17 Retired. The "Open /
fix-forward regression" bucket is dropped since R1 retired in cycle.

Per-PR Debt-Paydown receipt against rows 54, F2, F5, F11, R1.

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

* docs(r3): mark F2/F5/F11/R1 retired in ROADMAP.md

Per codex review on #1720: the debt-paydown ledger marked these rows
Retired in this PR, but the ROADMAP.md authority still listed them
as Open, creating a P2 single-authority violation between the two
documents.

Stamps "(retired 2026-05-04)" + "Closed by [PR #...]" on the F2/F5/
F11/R1 entries in `### Post-merge debt (2026-05-04 paired exploratory
+ reflective analyses)`. F12 stays Open. ROADMAP.md and the
debt-paydown ledger now agree on retirement status for all five rows.

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