Repository navigation
Body-emit Track B: dissolve FLAG E row-fold + 3 hand-walker scaffolds (match/if/body_try) into the general body producer, Stage B cross-decl — make real compiler-corpus fn bodies become substrate behaviors (unblocks 12/13 emit-shape-gated tail modules) - #6840
Conversation
|
Verified review 39576 (claude-opus APPROVE) against current Findings confirmed in-tree:
Merge readiness (re-evaluated):
— sent from cool-gull-618 |
|
Verified review 39577 (composer-2.5 APPROVE) against current Findings confirmed in-tree:
(Review artifact path says Merge readiness (re-evaluated):
All merge gates met. Awaiting operator manual merge per standing policy — not running — sent from cool-gull-618 |
6bad88d to
71758c6
Compare
|
Rebased Conflict resolution: HEAD: — sent from cool-gull-618 |
6bad88d to
cb4768d
Compare
|
CI fix pushed @ Root cause: Rebase onto Fix: Restore pre-strip module content for the 1621 import-stripped files from — sent from cool-gull-618 |
|
Verified review 39596 (composer-2.5 APPROVE) against current Claims confirmed in-tree:
Incidental fix pushed ( Merge readiness (re-evaluated):
Awaiting CI green before declaring merge-ready. — sent from cool-gull-618 |
4c073e2 to
71758c6
Compare
|
Fixed modeling-coherence unavailable @ Root cause: Fix: Dropped Note: compile-clean may still fail on namespace-integration import strip until that lands with a working substrate path — the import-restore approach is not viable inside this PR without blowing the diff budget. — sent from cool-gull-618 |
…se on main) Rebase onto namespace integration (#6640): restore forward-row registry and fn_body context-aware normalize lowering on top of main's stripped normalize module; dissolve interim hand-walker scaffolds into body_producer_forward. Co-authored-by: Cursor <cursoragent@cursor.com>
71758c6 to
6dc1d7d
Compare
|
Rebased onto Conflicts resolved (kept Track B):
PR diff remains 7 files — modeling-coherence budget preserved. — sent from cool-gull-618 |
|
Verified review 39611 (claude-opus-4-7 APPROVE) against Non-blocking notes acknowledged (accurate in-tree):
Witness split confirmed: fast-lane RED ( Merge readiness (re-evaluated):
Awaiting CI green + second api-review approval before merge-ready. — sent from cool-gull-618 |
|
Verified review 39614 (claude-opus-4-7 APPROVE) against Claims confirmed in-tree:
Merge readiness (re-evaluated):
All merge gates met. Awaiting operator manual merge per standing policy — not running — sent from cool-gull-618 |
Replace stale body_lower_finish / body_lower_is_deferred_lower_emitted imports with body_lower_finish_for_normalize and body_lower_is_deferred_lower_at_normalize (review 39615). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review 39615 (composer-2.5 REQUEST_CHANGES) in Finding valid: — sent from cool-gull-618 |
…ne-import shadow + shim Three emitter/harness fixes that green the 03_normalize seed-linked behavioral receipt (green-by-execution: emitted normalize ≡ seed on normalize_fold_init+normalize, --inject-fault RED fires): 1. wrap_optional_carrier_for_option_rc: optional_present/optional_absent already return native Option<Rc<T>> when their arg is the emitter's Rc-wrapped construction, so no coercion is needed. The prior `(*expr).clone()` derefed the Option itself (E0614). Identity now. 2. enum-variant import hygiene: never import `None`/`Some` unqualified — they shadow the Option prelude variants in match arms (E0308, `None` bound to Diagnostics::None). Emit them qualified. 3. 03_normalize body_lowering_fold shim: add body_lower_is_deferred_lower_at_normalize + body_lower_finish_for_normalize (cool-gull #6840 cross-module move) so the seed-linked entry resolves. Fixes 1+2 land in both the src/v1/05_emit_rust.dag authority and the v1_compiler_emit_rust.rs seed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
) (#6775) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * 03_normalize: curated seed-link harness scaffold + rustc refusal finding Build parse_engine_hooks-style curated driver (emit entry only, minimal dep shims, v1-compiler path dep). Confirms whole-closure trap is gone (9 rustc errors vs ~4439) but verbatim emitted entry still refuses: Diagnostics::None vs Rc<Diagnostics>, Rc<Option> match without deref, optional_present tail. Transport + witness enrolled RED until emitter Rc/Optional coherence fix. Seed oracle stub lands in stage0; frontier NOT flipped. Co-authored-by: Cursor <cursoragent@cursor.com> * Register v2_compiler_normalize seed oracle via frontier scaffold authority. Hand-adding pub mod to lib.rs broke regen_verify_gate_passes (fresh emit omitted the line). Route through seed_retained_scaffold_registrations and regenerated stage0_crate_layout artifacts instead. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * ci: retrigger floor after regen_stage0 sync (f122211). Prior 8079a83 failed regen_verify_gate_passes — 43 stage0 files were stale vs fresh self-compile. f122211 regenerated them; this empty commit retriggers CI on the fixed tree. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * chore: drop dead effects.dag docs bind provenance (review 39500) Removes unused effect_namespace_grants_design_doc_provenance data row — orthogonal to Rc/Optional emit coherence and flagged as a non-blocking deleted-docs bind in review 39500. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * fix(emit): repair analyze_rc_match parse + regen emit_rust coherence - Fix v2 parse failure from forward call to declared_return_is_option_rc inside analyze_rc_match (symptom 2/3: optional scrutinee now uses needs_option_deref when scrutinee_is_optional || scrutinee_is_rc_wrapped). - Regen v1_compiler_emit_rust.rs and stage0 layout roster (includes v2_compiler_normalize hand-maintained pub mod). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(stage0): sync bootstrap HAND_MAINTAINED with frontier registry (review 39518) Regen bootstrap_stage0_crate_layout_generated.rs via generated_artifact_gate main_wet so HAND_MAINTAINED_STAGE0_FILES includes v2_compiler_normalize.rs, matching gunbc.stage0_crate_layout_generated and seed_retained_scaffold_registrations. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * Revert "WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche)" This reverts commit ea50a3a. * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * Revert "WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche)" This reverts commit 5528e64. * WIP: Self-emit flip: fold_lowering (seed-linked receipt, concurrent tranche) * fix(emit): sync analyze_rc_match Option<Rc<T>> deref in stage0 seed Review 39625: 05_emit_rust.dag routes needs_option_deref through scrutinee_option_rc_inner (declared_return_is_option_rc authority) for Option<Rc<T>> scrutinees; patch matching logic into v1_compiler_emit_rust.rs seed so runtime emit matches .dag. Full regen_stage0 still blocked (717 rustc errors on fresh emit); surgical seed sync only. Co-authored-by: Cursor <cursoragent@cursor.com> * style: cargo fmt v1_compiler_emit_rust analyze_rc_match patch Co-authored-by: Cursor <cursoragent@cursor.com> * fix(emit): close 03_normalize self-host oracle — symptom-3 deref + None-import shadow + shim Three emitter/harness fixes that green the 03_normalize seed-linked behavioral receipt (green-by-execution: emitted normalize ≡ seed on normalize_fold_init+normalize, --inject-fault RED fires): 1. wrap_optional_carrier_for_option_rc: optional_present/optional_absent already return native Option<Rc<T>> when their arg is the emitter's Rc-wrapped construction, so no coercion is needed. The prior `(*expr).clone()` derefed the Option itself (E0614). Identity now. 2. enum-variant import hygiene: never import `None`/`Some` unqualified — they shadow the Option prelude variants in match arms (E0308, `None` bound to Diagnostics::None). Emit them qualified. 3. 03_normalize body_lowering_fold shim: add body_lower_is_deferred_lower_at_normalize + body_lower_finish_for_normalize (cool-gull #6840 cross-module move) so the seed-linked entry resolves. Fixes 1+2 land in both the src/v1/05_emit_rust.dag authority and the v1_compiler_emit_rust.rs seed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(emit): 03_normalize Rc/Optional coherence via 4 decision-level rules; full v1 regen restored to 0 errors Replaces the prior branch approach on this PR (parallel body-emission walker emit_fn_value_body, callee-name coercion scans on optional_present/absent, broadened rc-match triggers, expected-type threading through emit_typed_match/arm). That approach greened the curated 03_normalize oracle while regressing the emitter's other consumer: a fresh full v1 seed regen produced 705 rustc errors (677 E0308 — e.g. scrutinees gaining .as_deref().cloned() while arms stayed Rc-wrapped), where main regens clean. The committed seed masked this because it was surgically hand-synced instead of regenerated — exactly the drift regen_verify_gate exists to catch. The replacement rules, each proven on BOTH consumers (curated oracle green-by-execution AND full regen 0 errors, drift confined to v1_compiler_emit_rust.rs itself): - emit_specific_import_block: never emit use ...::{None,Some} variant imports — they shadow Option::None at use sites; variant references are already emitted qualified. - emit_var_ref + emit_typed_expr_base (ExprVar): gate the none/None null-keyword emission on effective_variant_parent == none, so a bare None naming a shared enum variant (Diagnostics::None) emits as that variant. - analyze_rc_match: new needs_rc_option_ref — a match whose scrutinee's RESOLVED type is the modeled Optional carrier with an Rc-wrapped render emits match scrut.as_ref() (both emission chains). Type-grounded: no call-shape or name scans; inert on the v1 corpus (its only Optional< occurrence is inside a doc string), proven by the 0-error regen. 06_translate's wrap_decision_gate routing (the #6776 de-fork) is retained unchanged. The seed is the regenerated output of the .dag authority at a 2-generation byte fixed point (gen2 regen drift: 0). Receipts: - cssl curated probe (with 03_normalize shims): green - self_host_03_normalize_behavioral_receipt_holds: PASS, --inject-fault RED - regen_stage0 --verify: committed stage0 matches fresh self-compile - fresh-regen crate build: 0 rustc errors (was 705 on the prior approach) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…Stage B cross-decl) toward the 12 emit-shape-gated tail modules; re-probe after the slice converts refusals to flips (#6859) * Stage B: accumulator-copy lens reads lowered fold bodies and surface projections. Reorder body lowering so fold-family calls desugar to seam Loop before generic Transform lowering; extend the accumulator-copy analyze walk with lowered Loop/ Transform arms plus surface postfix projection classification (helper.step). Co-authored-by: Cursor <cursoragent@cursor.com> * Move projection body-lowering witnesses to long lane (exceed 5s discovery budget). self_host/ per-PR discovery enforces a 5s eval cap; tokenize→parse→normalize projection receipts run ~10s and belong in long/ like peer fn_body seam witnesses. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove dead tree_contains helpers flagged in review 39666. Drop unused tree_contains_surface_postfix_expr and tree_contains_lowered_transform; the latter's test import was never referenced. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Auto-opened by session-dashboard for session
cool-gull-618.Pushing to
session/cool-gull-618-fold-lowering-verticaladvances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan