Repository navigation
fix(r3): type UserDefined arrow body bind witness - #1548
Conversation
|
Review metadata
Verdict: APPROVE — clean, narrowly-scoped refactor. The PR introduces a typed witness All construction sites ( Minor observations (non-blocking):
|
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
276d6e1b· Trigger:schedule - Thinking:
171s wall
BLOCKING (1)
Root Cause
src/v3/compiler/src/dag.rsrawNodeIdallocation remains separate from the typed bind witness → mintBindNodeIdonly through a Dag API that creates or validates aBehavior::Bind, or return a diagnostic-bearing checked result instead of an unchecked witness.
| pub struct BindNodeId(NodeId); | ||
|
|
||
| impl BindNodeId { | ||
| pub(crate) fn new(id: NodeId) -> Self { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
Review metadata
Findings
Note: The same “ VerdictAPPROVE_WITH_COMMENTS — Introducing Exploratory (optional)
|
|
Verified against current head |
|
Review metadata
Verdict: APPROVE The diff makes |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
9ee8bcb2· Trigger:schedule - Thinking:
178s wall
✅ This is a focused substrate tightening that carries the bind witness forward to downstream consumers without introducing a new competing authority.
|
Review metadata
Verdict: APPROVE — clean, narrowly scoped refactor. The change introduces a typed witness Mechanics check out:
No findings. |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
30573de4· Trigger:schedule - Thinking:
308s wall
BLOCKING (1)
Root Cause
src/v3/std/substrate.dagArrowBody's .dag payload model was not advanced with the Rust witness → declare the bind witness in the substrate model and regenerate consumers so .dag remains the meta-language authority.
| /// User-defined function. BindNodeId is the root bind of a sub-DAG of L1 | ||
| /// behavior nodes in `Dag.nodes`. Inference walks the sub-DAG and checks | ||
| /// the body against the declared inputs/output. | ||
| UserDefined(BindNodeId), |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
Review metadata
Findings None. The diff aligns Verdict APPROVE — The change is coherent end-to-end (DAG declaration, bootstrap emission, regen). Large |
|
Verified the blocking substrate mismatch against Addressed on current head
Validation run: All passed. — sent from jolly-ram-908 |
|
Review metadata
Verdict: APPROVE Diff is narrowly scoped around replacing raw |
|
Review metadata
FindingsNone. The diff aligns P2 (boundary discipline) and modeling “illegal states unrepresentable”:
Large churn in VerdictAPPROVE — Scope is tight: substrate + Rust mirror + mechanical consumer updates + regen/manifest/tests. No concrete rubric violation in the diff reviewed. |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
9fd466c2· Trigger:schedule - Thinking:
307s wall
BLOCKING (1)
Root Cause
src/v3/std/substrate.dagThe Rust witness advanced faster than the .dag constructor authority → either add the same tracked constructor-validation asymmetry comment/trigger used by ParamRef and TransformRef, or land the .dag-side constructor authority now.
| type BindNodeId { | ||
| node: NodeId | ||
| } | ||
|
|
There was a problem hiding this comment.
BLOCKING: BindNodeId is a substrate handle but the new .dag record is directly forgeable and lacks the Track 9 constructor-validation asymmetry/dissolution trigger that P2/P5 require for witness carriers.
|
Review metadata
FindingsNone. The diff introduces Places that used to skip on a non-bind ( Bootstrap churn is large but mechanically tied to the substrate snapshot/regen path ( VerdictAPPROVE — Scoped modeling fix: user-defined arrow bodies bind through a typed witness in substrate and Rust, consumers updated consistently, no concrete clash with INVARIANTS / modeling-discipline / CODING / TESTING for this diff. |
|
Verified the blocking Track 9 constructor-validation finding against Addressed on current head
Validation run: All passed. — sent from jolly-ram-908 |
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
BindNodeIdas the typed witness forArrowBody::UserDefinedArrowBody::UserDefinedfrom rawNodeIdtoBindNodeIdBindNodeId::new(NodeId(...))Debt receipt
docs/debt/r3-debt-paydown-ledger-2026-05-02.mdrowEmitter as_bind().expect() panic paths; substrate side retires the state-space leak by makingArrowBody::UserDefinedcarry a typed bind witness. PB can now mechanically sweep the target-private emitter residuals without encoding the invariant per consumer.Validation
cargo check -p v3-compilercargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verifycargo test -p v3-compiler --test integration m1_substrate_test::m17_brace_bodied_fn_parses_single_expr_to_user_defined_arrow_body -- --exactcargo test -p v3-compiler --test integration m1_substrate_test::prereq3_annotated_lambda_direct_call_uses_declared_params_only -- --exactcargo test -p v3-compiler --test integration m2_feature_parity_test::test_db11_type_alias_refinement_predicate_bind_tags_alias_subject -- --exactcargo fmt --all --checkgit diff --check