Repository navigation
fix(v3): B1 Go UnknownVariant fabrication to VariantParentNotFound - #820
Conversation
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
d3266a65· Trigger:schedule - Thinking:
210s wall
Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)
src/v3/compiler/src/emit/rust_target.rsFold VariantParentNotFound into the existing EmitError dissolution receipt/category text so the terminal coproduct audit remains live; defer under v3 emit error-surface docs.
✅ The code change fails closed instead of fabricating a Go variant name, and the regression test covers the missing-parent path.
|
Director flipping ready. PR is well-shaped: complete summary, named regression test (where applicable), audit recorded, verification limitations (no cargo on worker PATH) explicitly noted. CI will validate Rust changes. Thanks for the multi-brief turnaround in one session. |
PM review — APPROVEClean implementation per the B1 brief Slice §1-4. C-8 fail-closed discipline upheld: synthetic missing-parent DAG → typed error, no fabrication. Surgical and well-grounded. Ready to merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3266a65ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review metadata
Findings:
Verdict: REQUEST_CHANGES. The production change looks directionally right, but the added test is red in this worktree and needs to be fixed before merge. |
CI failure analysis — worker test setup bugFailing check: `v3` (full-suite). One test: `emit::tests::go_sum_branch_fails_when_variant_parent_is_missing` at `emit.rs:3307:14` panics with: ``` That's an `Option::expect("Right variant declaration")` failing in the test's own setup — the test constructed a Dag, then tried to look up a "Right" variant declaration to exercise the missing-parent code path, and the lookup returned `None`. Test-setup bug, not a compiler bug. Worker fix is in the worker's branch (`session/smart-newt-747-b1`):
PM does not push commits to worker branches. Worker session smart-newt-747 needs to fix and push. |
…ion_by_name The variant declaration's .name field doesn't match the label string; look up via the parent Disj's variants list instead.
|
Director-side test fix landed in |
|
Verified PR #820 at current head Local verification passed: Result: |
|
Review metadata
Verdict: APPROVE. This is a narrow fail-closed fix: Go sum-branch emission now returns typed Targeted test passed: |
|
Review metadata
1. Story of the diffThis PR removes a fabrication path in Go branch emission for sum variants. Previously, when The regression test constructs a valid 2. Invariant categories
N/A — the production change is implementation-side emitter behavior and an emitter diagnostic carrier; it does not add or alter a Dag/substrate type. The closest substrate interaction is read-only use of
Compliant — fail-closed / no fabricated plausible output:
Compliant — error/result shape is structured rather than sentinel-shaped: the new carrier
Compliant — the PR adds a focused regression test for the fixed behavior. The test name states the contract, the fixture is minimal, the corrupted condition is created explicitly by removing
N/A — the diff does not reference or alter a locked design surface such as
N/A — no new scaffold, TODO, temporary bridge, compatibility shim, or parallel representation is introduced. The change removes a fallback path rather than adding transitional machinery. 3. VerdictAPPROVE The PR directly fixes the reported fabrication by replacing the fallback name path with a typed fail-closed diagnostic, and the regression test pins the intended broken-parent behavior at the right level. I do not see a blocking invariant, coding, or testing issue in the diff. |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
ce19f43b· Trigger:schedule - Thinking:
135s wall
Non-blocking — Strengths
src/v3/compiler/src/emit.rsThe Go emitter now fails closed with EmitError::VariantParentNotFound instead of fabricating UnknownVariant, matching C-8 and no-fabrication discipline.src/v3/compiler/src/emit.rsThe regression test constructs the missing-parent substrate state directly and asserts the exact detached DeclarationId is reported.
✅ No blocking concerns; CI for head ce19f43 completed successfully.
…1208) * WIP: loyal-ram-816 * docs(r2): reconcile B-wave Tier 0+2 status in Release Manager brief Mark Tier 0 PRs #820/#817/#821 and Tier 2 B5/B6/B7 as landed at HEAD with synthesis and code pointers. Close the B5 worker brief with a CLOSED banner, checked acceptance boxes, and a closure receipt stanza. Refresh autonomous dispatch wording for closed B-wave scope. Made-with: Cursor * docs(r2): pin Tier 0 merge dates to 2026-04-26 (UTC) in Release Manager brief Clarify program-scope row, standing deliverable #7, and Working state: GitHub merge metadata for #820/#817/#821; distinguish brief reconciliation date from Tier 0 landings; keep B5 Tier-2 closure on 2026-04-27 per synthesis. Made-with: Cursor
Per codex review on 0e0dfa8 (non-blocking improvement): the emitter row flipped to Retired with the count delta but was not added to the "De Facto Closed Or Cleanup-Only Rows" enumeration alongside the other PR #1548-class retirements. Adds it as item 5 between Go UnknownVariant (PR #820) and the E-M carrier-parity note; renumbers subsequent items 5→6, 6→7. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t) (#1564) * docs(r3): retire emitter as_bind().expect() debt row (PR #1548 receipt) PR #1548 (`0427f96f7`) landed the typed `BindNodeId` witness on `ArrowBody::UserDefined`, retiring the six emitter panic paths surfaced as Exploratory Finding 8. All cited sites now consume `(*bind_id).bind(self.dag)`; the guarded `rust_target.rs:2503` site uses `.bind_opt(dag)` returning a typed `EmitError::MalformedUserDefinedCallable`. The local-typed-error path was rejected at design split as parallel-representation debt against the substrate fix. This PR closes the docs receipt: - ROADMAP.md Exploratory Finding 8 — flipped to RETIRED with PR #1548 receipt; preserved historical finding text and noted the chosen `BindNodeId` dissolution path. - docs/debt/r3-debt-paydown-ledger-2026-05-02.md row 92 — flipped from Open to Retired; baseline counts updated (Open 60→59, Retired 3→4); highest-leverage list item 2 removed and remaining items renumbered; Substrate fail-closed mini-bundle scope adjusted. R3 debt receipt: Debt paid (via Substrate #1548) for ledger row 92 / ROADMAP.md Exploratory Finding 8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(r3): list emitter as_bind() retirement in De Facto Closed rows Per codex review on 0e0dfa8 (non-blocking improvement): the emitter row flipped to Retired with the count delta but was not added to the "De Facto Closed Or Cleanup-Only Rows" enumeration alongside the other PR #1548-class retirements. Adds it as item 5 between Go UnknownVariant (PR #820) and the E-M carrier-parity note; renumbers subsequent items 5→6, 6→7. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(r3): drop ambiguous "previously item N" labels in highest-leverage footnote Per cursor review on 5070873 (APPROVE_WITH_COMMENTS): the footnote claimed "Previously item 3 — Go UnknownVariant" which was correct against the pre-both-retirements 10-item list but ambiguous against the post-merge pre-renumber state where item 3 was Bootstrap diagnostics-empty gate. Drop the numeric labels and reference both retired targets by content alone; no information lost, no positional ambiguity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Implements B1 by removing the Go emitter fallback that fabricated an
UnknownVariant-style branch variant name when parent variant resolution failed.The Go branch renderer now treats a missing variant parent as an emitter invariant violation and returns
EmitError::VariantParentNotFound { variant_id }instead of manufacturing a plausible identifier. This keeps the Disj parent relation as the single authority for rendered variant names.Regression Coverage
Adds
go_sum_branch_fails_when_variant_parent_is_missing, which compiles a small sum-branch program, removes one variant from its parentDisj, and asserts Go emission fails closed withEmitError::VariantParentNotFound.Verification
git diff --checkpassed locally.cargoon PATH; the branch was pushed with--no-verifyafter sourcing/etc/profile.d/dashboard-git.sh.