Skip to content

Pkg7d/7e: the emitted compiler closure as a derived multi-crate workspace, built, with a dropped-dependency RED - #12214

Merged
gunbai-bot[bot] merged 30 commits into
mainfrom
session/stern-lynx-90-pkg7e
Sep 24, 2026
Merged

gunbai-bot[bot] merged 30 commits into
mainfrom
session/stern-lynx-90-pkg7e

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Pkg7d/7e: the emitted compiler closure, rendered as a derived multi-crate workspace and built, with a dropped-dependency RED

Its stack has landed. #12171, #12190, #12200 and #12203 have all merged, and main is merged in, so the diff is now only the 7e change.

What it does

  • The plan: v2.workflow.emitted_crate_workspace emitted_workspace_plan. It partitions the v2.compiler.compile closure into crate rows, from:

    Nothing is read from the stage0 debt rows. The runtime is a fixed foundation crate.

  • Refusals, all typed:

    • The two closures (the live DAG and the emission) must be the same population. Any member of either missing from the other refuses ClosuresDisagree, naming every member.
    • A single-crate plan refuses NoDiscriminatingEdge.
  • One renderer. v1.compiler.stage0_crates now renders any row set (partition_crate_boundary_emit_outcome_over). Its owner and dependency lookups read the set they are handed. The committed stage0 rows are one caller, and this workspace is another. There is no second manifest or lib.rs writer.

  • One filename rule. module_to_filename / rust_module_emit_filename move to gunbc.rust_emitted_edge, the edge-endpoint authority. The emitter and the plan read the same function.

The instrument: gunbc test //gunbc/instruments:emitted-crate-workspace (parent condition 1)

  • How it's wired. It's a registry row plus a producer arm (gunbc.instrument_targets, gunbc.target_binding EmittedCrateWorkspaceProducer, host cli_run::emitted_crate_workspace_host).
  • What one invocation does:
    1. Emits the closure.
    2. Evaluates the plan with the emission's basenames and edges.
    3. Renders through the stage0 renderer.
    4. Builds the workspace (the positive control).
    5. Rewrites one crate with its RED rows and builds again.
  • The receipt names the head, the closure module count, the crate count, whether the facade is the whole closure, the rustc identity, both verdicts, and the RED's attributed diagnostic.

Receipt, one remote dispatch, on the merged head 87b0cc9:

emitted 190 module files and 1632 edges
plan modules=189 crates=8 facade_is_whole_closure=false red=v2-emitted-policy-unit-3 drops v2-emitted-policy-unit-2 (v2_std_artifact -> v2_std_diagnostic)
GREEN Completed status=0 rustc=rustc 1.98.1 (48a229cea 2026-09-01) ... green_exit_status=0 green_warning_count=0
RED refused as required — error[E0432]: unresolved import `crate::v2_std_diagnostic`

The RED cannot be papered over by the facade (parent condition 2)

  • How the dropped edge is chosen. It is a unit dependency in the transitive reduction: no other dependency of the source crate reaches the target, so no crate's pub use <dep>::* can re-export it by a second road. The emitter must also have written that edge as a real use-line, so rustc has a path that has to stop resolving.
  • How the RED is judged. A red that fails without naming the dropped module refuses as RedNotAttributed, and a red that builds refuses as RedBuiltGreen. Neither counts as a pass.

What this build does not prove (parent conditions 3 and 4)

  • Transitive facade. A layered crate re-exports its transitive dependency closure, which over-approximates the direct edges. That is deliberate: the inline crate::<module>:: paths the expression emitter writes are not returned as edges (gunbc.guarantee_stall emitted_inline_crate_path_edges_unreturned_stall). The facade did not degenerate to the whole closure (facade_is_whole_closure=false), so this is a partition, not one crate split into files. It is not a minimal public surface either.
  • No grounded interface maps. The crates carry no grounded interface maps. Step 2 (the contents projection) waits on host-effect emission of v2.compiler.source_authority module_storage_bindings_for_source_roots, the capability the existing InterfaceGroundingCapability debt row already names, so no new row is added. A green therefore says the derived partition compiles through glob facades; it says nothing about per-crate interfaces.
  • The instrument stays author-run; the plan's REDs are gated. The instrument (emission, the live-closure plan and two builds) is too heavy for the gate, so it runs by author invocation. The five fixture claims test.claim.emitted_crate_workspace_witness are a row of v2.workflow.required_floor required_gate_authored_modules (parent ruling). They run emitted_workspace_plan_over on a supplied three-module DAG and supplied edges, and never the live closure: RED selection, transitive re-exports, ClosuresDisagree and NoDiscriminatingEdge. Measured cost, from the required floor run at dd59430 ([enrolment-margin] lines, observed CPU against a 302 ms budget; every claim planned and passed):
claim cpu
the_chain_plans_three_crates_plus_the_runtime_with_transitive_reexports 8 ms
the_red_drops_an_edge_the_emitter_wrote_as_a_use_line 8 ms
a_single_crate_plan_refuses_for_want_of_a_discriminating_edge 7 ms
a_dag_module_the_emission_did_not_produce_refuses_by_name 1 ms
an_emitted_module_outside_the_dag_refuses_by_name 1 ms

The floor log prints no eval-step count for a passing claim, so CPU is the measurement given. None of the five re-runs the real closure.

What the build found, each fixed at its root in its own PR

  1. A qualified path's first segment is a namespace root: reference-derived edges no longer bind it to a same-named declaration #12190 (merged). A namespace root (v2 in v2.std.*) resolved as a bare reference to a test module's fn v2(). The live DAG had 24 modules the emission lacked.
  2. Reference-derived edges skip substrate vocabulary: a kernel or container spelling binds no module #12200. A kernel spelling (String in std.primitives) resolved to std.string_type. That left one module still in disagreement.
  3. The emitted-text attestation reads code outside string literals, not prose #12203. The emitter's use-line text gate was attested by string-literal prose and then by std::hash::Hash path segments. The result was a dead pub use crate::v2_std_node::{Hash}, a reverse edge the partition refused.
  4. Pkg7d 1b: emitter use-line edges returned typed, admitted against the stage0 crate partition #12171 (amended). Edges came from use-lines taken before dedupe. That produced false edges for lines the file doesn't carry.

v1 admission. This is v2 self-host work under gunbc.v1_maintenance_standing v1_seed_standing. Hand Rust added:

  • the instrument host file (cli_run/emitted_crate_workspace_host.rs: the effect boundary plus value transport; it decides nothing about the partition);
  • one registry row and dispatch arm in target_invocation_host.rs.

The stage0_crates generalization is .dag, with regenerated mirrors; the seed regen is a fixed point.

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 28 commits September 23, 2026 19:46
…nst the stage0 crate partition

v1.compiler.emit_rust returns SemanticSourceReference edges beside the use-lines it renders
(emit_imports, reference_derived_use_line_plan, service imports); they ride EmitResult and
PipelineResult out to required-regen, where gunbc.stage0_emitted_edge_admission refuses an
edge whose target crate the source crate does not reach (E0432 class) and names a module
outside the seed as NotCovered. gunbc_rust_emitted_edge moves into the std-core unit, which
the first partition build demanded. v1 touched as v2 self-host work (v1_seed_standing).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t_core_support names it at the crate root

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed-module row)

The REDs and controls execute over fixtures on every required run; the admission over the real
seed emission still runs only at author regen, under gunbc.rung_drop witness_floor_off_the_required_gate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…urces

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pace, built with a dropped-dependency red

v2.workflow.emitted_crate_workspace derives crate rows from the closure's module DAG, the emission's
returned edges and the transitive unit dependencies; v1.compiler.stage0_crates renders any row set
with the one partition renderer; //gunbc/instruments:emitted-crate-workspace emits, renders, builds
the workspace and requires a transitive-reduction dependency drop to fail naming its target module.
The module filename rule moves to gunbc.rust_emitted_edge, the edge-endpoint authority.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nt names every member

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…erived producer no longer resolves it to a same-named declaration

ExprVarClassification classify treated a dotted chain's head as a namespace segment only when no
declaration anywhere shared its spelling, and reference_resolution_facts runs with no declaration
index, so the head of every v2.std.* path fell to the free-reference default and resolved
UniqueBare to test.claim.secret_rotation_witness fn v2(). A head whose chain names a declared
module is now QualifiedChainHead; binders still outrank it and value chains keep their edges.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n-lynx-90-pkg7e

# Conflicts:
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ner spelling binds no module

dag/std/primitives (import-free) annotates data with the kernel type String, and the producer resolved
it UniqueBare to std.string_type. The census pull already skipped kernel and container spellings; that
rule is now the named is_substrate_vocabulary and the reference-derived producer reads it too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…prose

reference_derived_use_line_plan admitted a candidate use-line when its name was among the emitted
source's identifier tokens, string literal contents included, so std.content_hash's prose mention of
v2.std.node.Hash emitted pub use crate::v2_std_node::{Hash} -- unused, and a reverse edge the crate
partition refuses. The token set now comes from rust_code_outside_string_literals. Across the seed
eleven dead prose-attested imports drop from six mirrors; the seed compiles and regen is a fixed point.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…stern-lynx-90-pkg7e

# Conflicts:
#	src/v1/stage0/src/emitted_population.rs
#	src/v1/stage0/src/v1_compiler_emit.rs
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ates {...}, so {Hash} evaluated Hash

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/v1/05_emit_rust.dag
#	src/v1/stage0/src/emitted_population.rs
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
… origin/main

Import edges were taken before dedupe_rust_import_lines, so a line dedupe dropped still reached the
partition as an edge -- measured as EmitterReverseEdge std_content_hash -> v2_std_node over the
v2.compiler.compile closure, with no such line in the emitted file. rust_use_line_edges_surviving
keeps a typed edge only when a surviving line names its target module.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/v1/stage0/src/v1_compiler_emit.rs
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
#	src/v1/stage0/src/v1_compiler_infer.rs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…no longer emits a Hash use-line

Over the full v2.compiler.compile closure std_content_hash's derive of std::hash::Hash still attested
a proposed Hash through the colon-splitting tokenizer. Segments after :: are marked so they never
equal a candidate; path heads stay tokens. Seed regen reaches a fixed point; the seed compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…stern-lynx-90-pkg7e

# Conflicts:
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
#	src/v1/stage0/src/v1_compiler_infer.rs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…they run over supplied inputs

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-pkg7e

# Conflicts:
#	dag/gunbc/recurring_failure_mode/a_namespace_root_segment_resolves_as_a_bare_reference.dag
#	dag/test/claim/namespace_root_reference_edge_witness_test.dag
#	src/v1/stage0/src/cli_run.rs
#	src/v1/stage0/src/v1_compiler_infer.rs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…70840)

gunbc.emitted_crate_workspace_seed_growth names every hand-authored declaration, the reason (effect
boundary plus value transport, no partition decision), the owning lane and the capability trigger
that retires it: host-effect emission making the instrument one .dag fold.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Review 70840: fixed in the latest push. gunbc.emitted_crate_workspace_seed_growth declares the host as seed growth (DESIGN §7), and it's rostered in gunbc.seed_growth_admission. It lists all 17 hand-authored declarations in v1_compiler.cli_run.emitted_crate_workspace_host, plus the two in target_invocation_host. It states the reason: an effect boundary (the emission, file writes, git rev-parse for the receipt head, two cargo runs) plus the interpreter-value transport, with no partition decision. The owning lane is v1-hand-queue-drain. The trigger is at capability grain: host-effect emission making the instrument one .dag fold, the same capability gunbc.source_root_eval_driver_seed_growth names, so no value transport or hand effect sequencing remains. test.claim.seed_growth_admission_witness passes 7/7 with the row. That row is also the receipt the advisory asks for: a lane-plus-row deferral.

— sent from stern-lynx-90

…-pkg7e

# Conflicts:
#	dag/gunbc/stage0/stage0_emitted_edge_admission.dag
#	src/v1/05_emit_core_support.dag
#	src/v1/05_emit_rust.dag
#	src/v1/stage0/src/gunbc_rust_emitted_edge.rs
#	src/v1/stage0/src/gunbc_stage0_emitted_edge_admission.rs
#	src/v1/stage0/src/v1_compiler_emit.rs
#	src/v1/stage0/src/v1_compiler_emit_core_support.rs
#	src/v1/stage0/src/v1_compiler_emit_go.rs
#	src/v1/stage0/src/v1_compiler_emit_python.rs
#	src/v1/stage0/src/v1_compiler_emit_rust.rs
#	src/v1/stage0/src/v1_compiler_infer.rs
#	src/v1/stage0/src/v1_compiler_stage0_crates.rs
#	src/v1/stage0/src/v1_tests_claim_reference_derived_disposition_census_witness_test.rs
#	src/v1/stage0_crates.dag
#	src/v2/workflow/required_floor.dag
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit e770dda Sep 24, 2026
5 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/stern-lynx-90-pkg7e branch September 24, 2026 18:36
@briansrls
briansrls restored the session/stern-lynx-90-pkg7e branch September 24, 2026 18:42
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.

0 participants