Skip to content

wrap_decision_predicate: fix Instantiation-wire caller bypass (v2-translate correctness) - #7264

Merged
briansrls merged 5 commits into
mainfrom
kernel-d-emit-lane
Jul 26, 2026
Merged

briansrls merged 5 commits into
mainfrom
kernel-d-emit-lane

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Correctness fix (construction), not an E0308 burn-down. translate_apply_use_site_ownership_to_projected_boundary in src/v2/compiler/06_translate.dag routed only TargetTypeExprAtom-kind wires through wrap_decision_gate; any TargetTypeExprInstantiation-kind wire (Option<T>, Rc<T>, Witness<T>, List<T>) fell through a catch-all _ => outcome_accepted(projected) bypass, silently skipping the ownership-wrap decision for composite type arguments at the v2-translate boundary. This closes the RE-OPENED wrap_decision_predicate migration trigger in dag/gunbc/v1_deletion_plan.dag.

This is the v2-translate half of OWNERSHIP; the seed emitter half (05_emit_rust chokepoint, the metric-moving side) is #7223 (witty-wolf-289). No file overlap confirmed (checked 06_translate.dag / wrap_decision.dag / this PR's test file against #7223's diff — additive-only in the shared rust.dag file, no shared callers).

New function translate_apply_use_site_ownership_to_instantiation_boundary: head/tail-splits both the projected and source-binding nodes, zips positional type arguments, recurses the boundary gate per argument (fail-fast via sequence_outcome/ShortCircuit), and rebuilds the node — making the unwrapped-composite state unwritable at this boundary rather than silently passing it through.

Test plan

  • src/v2/test/claim/wrap_decision_predicate_test.dag: added wrap_decision_instantiation_arg_is_wrapped, a discriminating witness that builds an Option<Node>-shaped composite TargetTypeExprInstantiation wire and asserts the wrapped result's inner argument decodes as TargetTypeExprInstantiation (Box-wrapped) rather than staying bare TargetTypeExprAtom.
    • Verified red against the pre-fix caller (reverted 06_translate.dag to the parent commit locally, re-ran): FAIL wrap_decision_instantiation_arg_is_wrapped.
    • Verified green with the fix: PASS wrap_decision_predicate_witness_holds, PASS wrap_decision_instantiation_arg_is_wrapped — cargo run --release --bin claim_batch -- --entry src/v2/test/claim/wrap_decision_predicate_test.dag --function wrap_decision_predicate_witness_holds --function wrap_decision_instantiation_arg_is_wrapped --source-root src/v2 --source-root dag.
  • gunbc compile --source-root dag --source-root src/v2 --entry src/v2/compiler/06_translate.dag --target dag: 0 blocking errors.
  • Deep-seven E0308 impact NOT measured (the classifier-v3 probe targets the seed emitter 05_emit_rust, not 06_translate.dag; this fix moves the v2-translate boundary metric, which the probe doesn't sample). No E0308-delta claim is made for this PR.

Also included: a stale-doc correction in docs/plans/interpreter-kernel-d.md — the "fail-closed emit_host" note is out of date; run_host_process/_with_cache/_admitted are already wired against live transport dispatch.

briansrls and others added 3 commits July 26, 2026 00:51
…tion-kind caller bypass

translate_apply_use_site_ownership_to_projected_boundary previously fell
through _ => outcome_accepted(projected) for any TargetTypeExprInstantiation
wire (Option<T>/Rc<T>/List<T> shapes), silently skipping the ownership-wrap
gate on composite type arguments. The prior commit added the
TargetTypeExprInstantiation arm; this adds the witness that proves it:
verified red against the pre-fix caller (bypass returns the arg unwrapped,
still TargetTypeExprAtom) and green against the fix (arg comes back wrapped,
decodes as TargetTypeExprInstantiation).

Closes the RE-OPENED wrap_decision_predicate migration trigger in
v1_deletion_plan.dag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
run_host_process/_with_cache/_admitted are wired (build_transport_admissible
admission + emit_host_run_transport dispatch); emit_host_transport_not_wired
no longer exists in emit_host.dag. Flagged during Kernel-D frontier review
(sharp-bee-290) — the pure-eval emit seam this section describes as a gap
is landed, not open.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title Kernel-D: emit v1 interpreter pure-eval native, prove cutover green-by-execution in CI wrap_decision_predicate: fix Instantiation-wire caller bypass (v2-translate correctness) Jul 26, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 26, 2026 01:30
@briansrls
briansrls merged commit a05897d into main Jul 26, 2026
5 checks passed
@briansrls
briansrls deleted the kernel-d-emit-lane branch July 26, 2026 12:54
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