Repository navigation
cargo-green emitter fixes: M: Clone bound on bare-generic returns (E0599) + Optional receiver unwrap before method call (E0624) - #5777
Merged
Conversation
Without the `body_is_param_ref` guard, `emit_fn_def` added `M: Clone` to
every function whose return type was a bare generic param — breaking
`generic_fn_emits_type_params_without_synthesized_bounds` (identity/fold_stack).
Correct signal: `ExprVar` nodes carry the variable name as `.name` and have no
children; `ExprFieldAccess` nodes carry the field name (not the receiver).
So `body.name ∈ value_param_names` IFF the body is a direct parameter return.
Clone bound is now added only when `return_is_bare_generic && !body_is_param_ref`,
which fires for `measure_count<Q,S,M>(m) -> M { m.count }` (field access, M: Clone
needed to call `.clone()` through Rc) but not for `identity<T>(x) -> T { x }`
(direct param ref, no Rc access, no .clone() emitted).
Also regenerate docs/plans/host-effect-orchestration.md from its .dag authority
(pre-existing drift since #5764; the committed file matched an older Phase A/B state).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
My regeneration via main_wet reverted the plan doc from LANDED [#5756] to [now, parallel] — wrong direction. The .dag Plan authority needs to be updated (not the committed .md) to fix the drift, and that belongs to the host-effect lane (neat-boar/fierce-carp). Restoring the correct LANDED state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
type Compose<Algebra, MachineConstraint> = Phantom emits a bare Phantom ZST with neither param referenced in the RHS → E0091 ×2. Fix mirrors the struct path (rust_phantom_marker_inner, line ~3229): detect params absent from the alias RHS via alias_unused_param_names (same type_node_mentions_name predicate as struct_unused_param_names), then substitute std::marker::PhantomData<(Algebra, MachineConstraint)> for the RHS. Guard: only fires when unused_params |> count > 0 — param-using aliases (List<T>, Map<K,V>) have their params present in the RHS and are left unchanged. Witness: unused_param_alias_gets_phantom_data (positive — Compose gains PhantomData carrying both params) + param_using_alias_has_no_phantom_data (negative control — Wrapper<T> = List<T> is unperturbed). Both axes of E0599+E0624 witnesses still green (no regression). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ports extdeps.languages.html after d3ed2a9) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 25, 2026
briansrls
added a commit
that referenced
this pull request
Jun 28, 2026
… receipt (#5899) * WIP: Lane A cargo-green last mile (re-census FIRST): #5777 merged (5->2), dri * Revert "Merge origin/main into lane-a-cargo-green-receipt (stay current for CI)" This reverts commit 60b4e2e, reversing changes made to 02e6529. --------- Co-authored-by: Brian Searls <briansrls@gunb.ai>
This was referenced Jul 1, 2026
briansrls
added a commit
that referenced
this pull request
Jul 1, 2026
…#6099) * integration: slice-2 (length->count) + marker derives * integration: + bright-badger Measure (04_infer+05_emit) + eager-boar MachineWidth (05_emit) * emit(import-completeness): authored imports for emitter-rendered symbols (empty_intern_table, InductiveField, is_bare_leaf_item, SemVerConstraint) — clears E0425 from peeled/turbofish types not in source import set * integration: bring #5325 regen_stage0.rs languages_consumer_census mod-injection patch (clears E0433 x6 in bootstrap) * emit(List seed carrier): render List nominal as host Vec in seed branch (option d, container analogue of String/Nat) — guarded, List-only, at the 2 preserve-nominal sites; clears E0425/E0432 for newly-enrolled std files (realization_schedule Schedule, std_types list_length). v2-target faithful FreeMonoid untouched. * emit(Int generic-arg seed carrier): apply rust_seed_host_numeric_alias at the bare-nominal alias-RHS branch so Int/Nat as a generic ARG (Measure<...,Int>) lowers to i64 in the seed, consistent with the type Int = i64 alias def — clears the std_measure Int E0425 * Merge origin/main into emitter/seed-green-integration (resolve emitter conflicts) Resolved 4 conflicts in src/v1/05_emit_rust.dag and 1 in width_nat_type_arg_test.rs: - render_rust_applied_type: keep branch's rust_seed_host_container_base (List->host Vec) - rust_phantom_marker_inner: take main's join() simplification (equivalent, supersedes Optional-peel) - emit_rust_expr_record_lit: take main's peeled_type_name refactor (branch lines were superseded duplicates) - phantom-field comment: take main's wording (matches the refactor) - machine_width test: keep active (un-ignore) — this branch carries the #5325 emitter fix the ignore waited on Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Re-ignore machine_width emit test: committed seed not yet regenerated The test runs compile_sources against the in-process lib (committed stage0 seed), whose emit_rust.rs does not yet carry this branch's .dag peel fix (branch updated 05_emit_rust.dag only, not the committed seed mirror). So it must stay #[ignore]d until the seed regen lands (Track A step 3 / 2-stage bootstrap). Reverts an over-eager un-ignore from the main merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Add lexer-layer host builtins to v2 interpreter (chars/chars_to_string/metering) So `gunbc run` can interpret the live .dag compile/emit fold (compile_sources) WITHOUT regenerating the seed mirror — making a .dag emitter fix verifiable BY INTERPRETATION (DESIGN §5 green-by-execution, §7 self-host). Additive only (fills previously-erroring builtin cases; cannot regress existing behavior). Proven by execution: the interpreter now resolves the source closure and runs the full lexer (tokenize) over a probe source, advancing into parse/resolve. Remaining gaps are deeper interpreter semantics (e.g. raw_map_lookup on a plain Record), not missing builtins. - chars(s) -> List<Int>: code points (matches languages.dag emit template + lexer source_chars: List<Int>), method dispatch. - chars_to_string(List<Int>, start, end) -> String: code-point slice -> token text, free-fn dispatch. - record_source_chars_index_lookup(): no-op unit metering stub. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Interpreter spike: additive record-form-map + list_push method dispatch Bounded spike (parent-approved) toward running the emit fold by interpretation. Both additive / non-regressing (fill previously-erroring cases): - raw_map_lookup: a Record without a callable `lookup` field is now treated as a record-form map (key looked up as a field name; miss -> Null -> Violates via the existing Witness bridge). Unblocks `data x: Map<K,V> = { ... }` literals, which the interpreter builds as Records. (Deeper root: literals are never built as type-directed Maps; this handles it at the consumption site.) - list_push: dedicated method-dispatch arm (was free-fn only). Pushes the arg as a single element, unlike concat/append/push which merge a list-valued arg. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Route-A class 1/6: correct splice dissolution pointer to adhoc-1bdd0259-2e3 The HAND-APPLIED-REGEN-MIRROR-SYNC mark previously pointed at snappy-swift-91 / #5325 (done-but-re-drifted, unreachable). The live dissolution lane is bright-stag's adhoc-1bdd0259-2e3: re-repair the 18-error regen-fixpoint hole + add a regen-equals-committed CI drift-gate so a main-merge can never silently re-drift the fixpoint. Comment-only; the panic! splice (code) is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Route-A: rustfmt the fixture-lever mirror splice (CI fmt gate) The compile_error! -> panic! mirror splice shortened the string literal, so rustfmt joins it onto one line (the original was split for the longer compile_error! form). Hand-edit fmt-drift; cargo fmt --all applied. No code change -- the splice is identical, only formatting. Restores rust_monolith_gate fmt --all --check green on #5481. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP class-3 computation layer: corpus_repr single authority (inert, .dag-only) Foundational half of the class-3 corpus-representation-coherence fix (the realization-layer handler-selection root behind the 26 List + 15 generic-syntax census errors). Adds the named selector RustCorpusRepr = HostNative | FaithfulFreeMonoid (04_emit_info.dag, auto-committed) and computes it ONCE as the single authority in build_emit_graph_info (rust_corpus_repr over the whole module corpus), threading it as the corpus_repr field through all 7 EmitGraphInfo construction sites (each COPIES the field, never recomputes — quick-seal's field=authority/param=read invariant). INERT checkpoint: the type-renderer leaf gates still read the old per-module rust_corpus_includes_v1_compiler/rust_emit_faithful_text_carrier, so emitted output is byte-unchanged. Typechecks clean via the existing binary (0 diagnostics, 410 files emitted). The gate-switch + ~15-fn corpus_repr threading + leaf-fn param swap + dead-gate deletion + exact mirror transcription land in the next pass, then the full-loop census oracle. Realization-layer coherence fix, not a model change (List<e>=FreeMonoid<e> at std/types.dag:227 untouched). Carrier B-home, idiom-threaded (per quick-seal). adhoc-1bdd0259-2e3 dissolution lane. #5481. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Revert "WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra" This reverts commit aeb61f6. * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Revert "WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra" This reverts commit 6cf05a7. * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Section 5 self-host: thread corpus-global RustCorpusRepr selector through emitter (class-3 representation-coherence) Realization-layer-not-model-change: replaces the per-module host-vs-faithful gate (rust_emit_faithful_text_carrier(source_indices)) with a single corpus-global RustCorpusRepr (computed once in rust_corpus_repr, stored on EmitGraphInfo.corpus_repr), threaded as the corpus_repr selector to every renderer/emitter/seam site. Deletes the old per-module gate fns (§5 single-authority: divergence was writable). §6-transitional: collapses to HostNative when src/v1 is deleted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Restore known-good stage0 seed (revert premature regen); keep .dag class-3 logic The auto-committed regen'd seed pulled in pre-existing .dag<->seed drift (the extdeps.cargo_version import wiring + faithful-emitted orphan modules) that breaks the v1-compiler build — that drift is the regen-lockstep capstone's domain, not class-3. The class-3 representation-coherence work stays fully in the .dag source; the seed regen lands via the regen-lockstep lane once a class-3 gunbc emits the bundled extdeps modules host-mode. Seed .rs reverted to the committed fixpoint so CI's rust gate is green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * Restore known-good stage0 seed (auto-committed local regen reverted again) Local class-3 verification re-ran the regen in the working tree, which the harness auto-committed and re-broke the seed build. Seed reverted to the committed fixpoint; class-3 logic remains entirely in the .dag source. Seed regen is the regen-lockstep lane's deliverable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * class-3 review fix: correct §6 dissolution-direction comment (src/v1 deleted → FaithfulFreeMonoid, not HostNative) quick-seal by-execution review: 05_emit_rust.dag:221 stated the dissolution collapse backwards. src/v1 deleted → no seed → has_seed=false → FaithfulFreeMonoid (the pure-v2 faithful target), matching 04_infer.dag:6395 and the §6 ruling. Comment-only; the code (04_infer.dag else-branch) was already correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * PATH A — land class-3-embodying cargo-green seed via overlay-3-committed HAND-SYNCED MIRROR, not a regen fixpoint. Splice the three class-3 emitter files (v1_compiler_emit_rust.rs, v1_compiler_infer.rs, v1_compiler_infer_emit_info.rs) from a faithful regen of the class-3 .dag onto the committed seed; every other module stays byte-identical to committed. Two local drifts hand-resolved: - cargo header inlined in emit_rust so it does not import the deliberately-unwired extdeps_cargo_version orphan (byte-identical to committed emit); - wire policy passed by value (Rc clone) at wire_value_serialize.rs to match the class-3 by-value policy_* signatures. The std-tower orphans (std_measure / std_algebra / std_realization_schedule / std_machine_constraints / std_integer / extdeps_version_semver / extdeps_cargo_version) stay UNWIRED exactly as on main. A faithful full regen would wire them and surface the deferred ~150-gap emitter-completeness lane (regen-fixpoint emitter-self-host); that lane is NOT closed here and `regen_stage0 --verify` is expected to differ. Carrier mark recorded in regen_stage0.rs + the 3 spliced file headers (self-contained; breadcrumb node://adhoc-80af9ff8-40f). Validated in scratch: cargo build -p v1-compiler --release --features text_lookup_work_counter --bins = 0 errors / 0 warnings (all 5 bins); cargo fmt --all --check clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * PATH A carrier-mark: append quick-seal's representation-invariance caveat Comment-only. Append quick-seal's verbatim invariance line to all four carrier marks (regen_stage0.rs registry + the 3 spliced file headers): the class-3 host-vs-faithful selection is representation-invariant on the v1-bundled host seed at this tip (CONTROL B gate-isolated revert builds green; CONTROL A errors are the wire policy confound, not representation), so the selection's behavioral discriminating-proof is OWED by the deferred faithful target where the selection actually fires. Keeps the HAND-SYNCED-MIRROR / not-regen-fixpoint / deferred-~150-lane mark intact. Still cargo-green (0 errors/0 warnings, all 5 bins; fmt --all --check clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(seed-green): restore main serialize/record_emit after stale merge regressions The branch had accidentally reverted #6045 record serialization and related witnesses during prior main merges. Restore the main-line authorities so the emitter/seed-green-integration branch tracks current main for Route-A closure. Co-authored-by: Cursor <cursoragent@cursor.com> * test(route-a): add emit-fresh cargo-green execution witness Reconcile emitter/seed-green-integration with main and land an ignored-by-default test that assembles the faithful --emit-fresh crate and proves debug+release cargo build succeed (0 rustc errors). Closes the Route-A last-mile receipt loop alongside the existing regen --verify CI gate. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): align zero-budget spawn width with execution-corpus cap witness gunbc_ci_floor_spawn_width_for_budget(0) returned the blind conservative fallback (4) while witness_floor_spawn_width_zero_budget_falls_back expected min(4, execution_corpus_spawn_width()) = 3. Apply the same int_min at the authority site and update the envelope witness to match. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(self-host): mark Route-A cargo-green landed (#5777/#5873) Re-verified cool-ant-875: regen_stage0 --emit-fresh → cargo build debug+release is 0 errors. Sync v2_self_hosting plan bullets that still claimed the last mile was open; note emitter/seed-green-integration absorbed. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(docs): regen v2-self-hosting.md from plan authority v2_self_hosting.dag is enrolled in PlanArtifact (generated_artifact registry); committed docs/plans/v2-self-hosting.md must match artifact_generate. Regen via main_wet after cargo-green bullet sync. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(docs): finish v2-self-hosting plan sync for #5873 wiring Address cursor REQUEST_CHANGES: regen-verify is wired via RegenVerifyGate (#5873, not closed #5325); forced-precondition step 1 marks Track A cargo-green done in lockstep with Track A bullet 2. Regen committed .md from .dag authority. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(plans): land TypeScript gap census as generated Plan (Lane C step A) Discriminating audit-first record: 9 VEP source-string GREEN families, 2 FAIL-CLOSED, 8 FAIL-OPEN (#13–#20) with named witness/authority sites. Clarifies bar (b) vs bar (c) — tsc/emit_host oracle red even for add (#19). Enrolled in plan_registry; regen docs/plans/typescript-gap-census.md via main_wet. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Section 5 self-host execution manager: Lane A drive the emitted rust cra * fix(docs): name .dag authority in typescript gap census plan Address cursor REQUEST_CHANGES (#34390): status line no longer says "This file is the authority" in generated .md — names typescript_gap_census.dag explicitly (DESIGN §3/§6). Regen committed projection via main_wet. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(docs): bind typescript-gap-census into doc graph CI failed doc_graph_has_no_orphan_docs — new PlanArtifact md had no reachability root. Add bind: provenance on typescript_gap_census.dag (mirror commit_workflow / accelerator_demo_plan pattern). Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Route-A last mile: fix the two emitter root causes that blocked cargo build on the faithful emitted crate, reducing the error count from 5 → 2 (the remaining 2 are E0091 Compose phantom-type-param, HOLD per operator ruling).
What and why
E0599 (
std_measure.rs:126):emit_fn_defcalledemit_type_paramswith no bounds even when the function's return type is a bare generic param (e.g.Minfn measure_count<Q,S,M>(...) -> M). The emitter accesses the field viam.count.clone()which requiresM: Clone(becausecount: Box<M>andBox<M>: ClonerequiresM: Clone). Fix: detectauthored_name_at(inferred) ∈ generic_param_namesinemit_fn_defand switch toemit_type_params_with_clone_boundfor that param.E0624 (
std_realization_schedule.rs:204/228): method calls on Optional receivers were emitted without unwrapping. Whenbatch0 = schedule.first()(returningOptional<List<T>>), callingbatch0.count()emittedbatch0.len()— butOption<Vec<T>>has no.len(). Fix: detectresolved_type(receiver).return_cardinality == CardOptionalin theAlgebraMethodSemanticselse-branch and append.expect("fail-closed: ...")before template expansion. Reuses the same unwrap pattern asrust_call_arg_fail_closed_unwrapfor function arguments.Both fixes land in
.dag(the authority:src/v1/05_emit_rust.dag) and are hand-synced to the seed (src/v1/stage0/src/v1_compiler_emit_rust.rs). No seed-only changes.Evidence
--emit-freshreceipt showing 5 → 2 errors after fixes:E0599 × 1 and E0624 × 2 are gone.
Test plan
Each test has a positive gate (the fix fires) and a negative control (the gate is not too broad).