Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
786d271
Pkg7d 1b: emitter use-line edges are returned typed and admitted agai…
Sep 23, 2026
de37e00
Emit-core re-exports gunbc_rust_emitted_edge: its #[path] copy of emi…
Sep 23, 2026
0ccd6b3
Enroll the emitted-edge admission witnesses on the required gate (nam…
Sep 23, 2026
baeda17
Merge origin/main; regenerate the emit_rust mirror over the merged so…
Sep 23, 2026
887cf87
Pkg7d/7e: the emitted closure rendered as a derived multi-crate works…
Sep 23, 2026
4867a3d
Emitted workspace plan: the two closures must agree, and a disagreeme…
Sep 23, 2026
2a90d96
A qualified path's first segment is a namespace root: the reference-d…
Sep 23, 2026
dd839d6
Merge branch 'session/stern-lynx-90-namespace-root' into session/ster…
Sep 23, 2026
5fe60a1
Regenerate the emit_rust mirror over the merged sources
Sep 24, 2026
2bc4fcc
Reference-derived edges skip substrate vocabulary: a kernel or contai…
Sep 24, 2026
5b545ab
Merge branch 'session/stern-lynx-90-substrate-vocab' into session/ste…
Sep 24, 2026
fd67ae1
WIP: emitted-text gate reads code outside string literals
Sep 24, 2026
18922f7
The emitted-text attestation reads code outside string literals, not …
Sep 24, 2026
3eb9a5d
Merge branch 'session/stern-lynx-90-emitted-token-gate' into session/…
Sep 24, 2026
ce1e790
Regenerate mirrors over the merged sources (fixed point)
Sep 24, 2026
7a8889e
Escape the braces the failure-mode row quotes: a .dag string interpol…
Sep 24, 2026
7ef9887
Merge remote-tracking branch 'origin/main' into session/stern-lynx-90
Sep 24, 2026
8320a90
Emitted edges are returned only for use-lines the file carries; merge…
Sep 24, 2026
804d333
Merge branch 'session/stern-lynx-90' into session/stern-lynx-90-pkg7e
Sep 24, 2026
295a649
Merge branch 'session/stern-lynx-90-emitted-token-gate' into session/…
Sep 24, 2026
30e6745
Regenerate mirrors over the merged sources (fixed point)
Sep 24, 2026
1aa9993
A path segment after :: does not attest a bare name: std::hash::Hash …
Sep 24, 2026
199d88d
Merge branch 'session/stern-lynx-90-emitted-token-gate' into session/…
Sep 24, 2026
968ba57
Regenerate mirrors over the merged sources (fixed point)
Sep 24, 2026
6b21e8c
Gate-enroll the emitted-workspace plan witnesses (named-module row); …
Sep 24, 2026
e7e68e7
Merge remote-tracking branch 'origin/main' into session/stern-lynx-90…
Sep 24, 2026
dd59430
Regenerate mirrors over the merged sources (fixed point)
Sep 24, 2026
ca26857
Declare the emitted-workspace instrument host as seed growth (review …
Sep 24, 2026
36e9f6d
Merge remote-tracking branch 'origin/main' into session/stern-lynx-90…
Sep 24, 2026
87b0cc9
Regenerate mirrors over the merged sources (fixed point)
Sep 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions dag/gunbc/emitted_crate_workspace_seed_growth.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module gunbc.emitted_crate_workspace_seed_growth

import gunbc.roadmap_model { RoadmapNodeId }
import gunbc.seed_growth { SeedGrowthJustification }
import std.decl_ref { DeclarationRef, WholeDeclaration }

data emitted_crate_workspace_seed_growth_justification: SeedGrowthJustification = SeedGrowthJustification {
hand_authored_declarations: [
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "WORKSPACE_ENTRY", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "PLAN_MODULE", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "EmittedCrateWorkspaceHeld", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "PlanRows", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "refusal", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "field", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "as_str", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "as_int", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "as_bool", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "as_str_list", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "str_list", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "row_from_value", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "rows_from_value", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "evaluate_plan", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "write_workspace", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "git_head", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.cli_run.emitted_crate_workspace_host", decl_name: "run_emitted_crate_workspace", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.target_invocation_host", decl_name: "run_emitted_crate_workspace", field: WholeDeclaration },
DeclarationRef { module_path: "v1_compiler.target_invocation_host", decl_name: "emitted_crate_workspace_source_roots", field: WholeDeclaration }
],
reason: "The Pkg7e instrument //gunbc/instruments:emitted-crate-workspace (gunbc#12214). Every partition decision is modeled: v2.workflow.emitted_crate_workspace emitted_workspace_plan derives the crate rows, the dependency packages and the dropped RED edge, and v1.compiler.stage0_crates partition_crate_boundary_emit_outcome_over renders manifests and lib.rs files. What stays in host Rust is the effect boundary the interpreter cannot perform -- the in-process seed emission of v2.compiler.compile, file writes, git rev-parse for the receipt head, and two cargo runs through the existing emitted_closure_compile_host -- plus the TRANSPORT of values across it: the emission's basenames and edges into the plan as interpreter lists, and the plan's rows back out as GeneratedPartitionCrateRow structs (field, as_str, as_int, as_bool, as_str_list, str_list, row_from_value, rows_from_value). That transport carries no decision: an unexpected shape refuses PlanShapeUnexpected rather than defaulting. Admitted by purpose under gunbc.v1_maintenance_standing v1_seed_standing: it is the build that proves the emitted v2 compiler partitions into crates. It is an instrument, run by author invocation, not a required phase; the plan's refusals are gated separately through test.claim.emitted_crate_workspace_witness. Classified against the refused classes: no language behavior, no compatibility obligation, no escape hatch (every arm refuses typed), no seed feature (the seed compiles what it compiled), and no public surface beyond the one cli_run re-export of the runner and its receipt struct.",
owning_dissolution_lane: "v1-hand-queue-drain" as RoadmapNodeId,
trigger: "Delete this host module when host-effect emission lets the instrument be a .dag fold end to end: the emission, the workspace writes and the two cargo runs are emitted realizations of modeled effects (the capability gunbc.source_root_eval_driver_seed_growth names for its own shim -- the rendered main becoming one call into the fold), sufficient for the plan's rows to reach the renderer and the build as values inside one evaluated program, so no interpreter-value transport or hand effect sequencing remains. Preserve the green build, the attributed dropped-dependency RED and the typed plan refusals at that replacement boundary.",
current_boundary: "Host only: emitted_crate_workspace_host.rs (wired by mod in cli_run.rs, one pub use of run_emitted_crate_workspace and EmittedCrateWorkspaceHeld) and one registry row plus dispatch arm in target_invocation_host.rs. It calls existing seed producers (compile_entry_emission, lane_emit_compile_probe_root, probe_cargo_invocation, run_cargo, make_eval_context) and adds none. No generated mirror is hand-edited; the stage0_crates generalization it renders through is .dag with regenerated mirrors."
}
33 changes: 31 additions & 2 deletions dag/gunbc/instrument_targets.dag
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import gunbc.target_binding {
FloorMemoryQualificationProducer,
CompileCleanDiagnosticCensusProducer,
EvaluationStoreAddressExactHeadProducer,
EmittedCrateWorkspaceProducer,
CompileCleanDiagnosticCensusStanding,
CompileCleanDiagnosticCensusCompleted,
CompileCleanDiagnosticCensusRefused,
Expand Down Expand Up @@ -199,6 +200,28 @@ fn v2_native_cli_label() -> Label {
Label { package: instruments_package() target: TargetName { name: "v2-native-cli" } }
}

// THE EMITTED CLOSURE AS A MULTI-CRATE WORKSPACE (Pkg7e). The seed emits `v2.compiler.compile`'s
// closure, `v2.workflow.emitted_crate_workspace` `emitted_workspace_plan` partitions it into crate
// rows from the derived module DAG, the emission's returned edges and the transitive unit
// dependencies, `v1.compiler.stage0_crates` renders those rows with the one partition renderer,
// and cargo builds the workspace -- the POSITIVE CONTROL. In the same invocation one derived
// dependency is dropped from one crate, chosen from the transitive reduction so no other crate's
// glob facade can re-export it, and the build must fail with an error naming the dropped target
// module -- the RED. The receipt names the head, the closure's module count, the crate count, the
// rustc identity, both verdicts and whether the facade degenerated to the whole closure.
//
// WHAT A GREEN DOES NOT ESTABLISH. The facade re-exports each crate's TRANSITIVE dependency closure,
// an over-approximation of the direct edges, because the inline crate::<module>:: paths the
// expression emitter writes are not returned as edges (gunbc.guarantee_stall
// emitted_inline_crate_path_edges_unreturned_stall). And the crates carry no grounded interface
// maps: that waits on host-effect emission of v2.compiler.source_authority
// module_storage_bindings_for_source_roots (v2.workflow.rust_crate_partition
// stage0_module_dag_interface_grounding). So a green says the derived partition compiles through
// glob facades; it does not say each crate's public surface is minimal or grounded.
fn emitted_crate_workspace_label() -> Label {
Label { package: instruments_package() target: TargetName { name: "emitted-crate-workspace" } }
}

// O(corpus) exact-head join of evaluation_store_address callers plus the fail-closed src/v2
// call-form scan. Not a DiscoverySelection floor witness (enrolment_bound_without_ceiling);
// not a required CI job. `gunbc test //gunbc/instruments:evaluation-store-address-exact-head`.
Expand Down Expand Up @@ -329,6 +352,10 @@ fn required_lane_resolution_census_target() -> BuildTarget {
instrument_test_target(label: required_lane_resolution_census_label())
}

fn emitted_crate_workspace_binding() -> TargetBinding {
TargetBinding { target: emitted_crate_workspace_label() producer: EmittedCrateWorkspaceProducer {} }
}

fn v2_native_cli_binding() -> TargetBinding {
TargetBinding { target: v2_native_cli_label() producer: V2NativeCliProducer {} }
}
Expand Down Expand Up @@ -459,7 +486,8 @@ fn instrument_targets() -> List<Label> {
evaluation_store_address_exact_head_label(), primitive_egress_census_label(),
primitive_egress_census_v2_label(), primitive_egress_census_dag_label(),
primitive_egress_census_seed_label(), floor_memory_qualification_label(),
required_lane_resolution_census_label(), bare_reference_channel_outcome_label()
required_lane_resolution_census_label(), bare_reference_channel_outcome_label(),
emitted_crate_workspace_label()
]
}

Expand All @@ -471,7 +499,8 @@ fn instrument_bindings() -> List<TargetBinding> {
evaluation_store_address_exact_head_binding(), primitive_egress_census_binding(),
primitive_egress_census_v2_binding(), primitive_egress_census_dag_binding(),
primitive_egress_census_seed_binding(), floor_memory_qualification_binding(),
required_lane_resolution_census_binding(), bare_reference_channel_outcome_binding()
required_lane_resolution_census_binding(), bare_reference_channel_outcome_binding(),
emitted_crate_workspace_binding()
]
}

Expand Down
15 changes: 15 additions & 0 deletions dag/gunbc/rust_emitted_edge.dag
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ type EmittedEdge {
provenance: EmittedEdgeProvenance
}

// THE ENDPOINT NAME. An edge row names a module by the basename of the file the emitter writes for
// it, so the projection from a module's dotted name to that basename is this module's fact, not the
// emitter's private one: v1.compiler.emit_rust renders files and paths with it, and a partition
// derived over dotted module names (v2.workflow.emitted_crate_workspace) maps onto edge endpoints
// with the same function. `main` renders as `main_mod` because it collides with the crate's own
// entry file.
fn module_to_filename(name: String) -> String {
name |> split(delimiter: ".") |> join(separator: "_")
}

fn rust_module_emit_filename(module_name: String) -> String {
let raw = module_to_filename(name: module_name)
if raw == "main" { "main_mod" } else { raw }
}

// The runtime-support module every emitted module paths into. emit_prelude renders its prelude
// lines from the rows below, so the module named in the text and the module named by the edge are
// the same value.
Expand Down
2 changes: 2 additions & 0 deletions dag/gunbc/seed_growth_admission.dag
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import gunbc.source_root_eval_driver_seed_growth { source_root_eval_driver_seed_
import gunbc.gen_one_executable_keep_seed_growth { gen_one_executable_keep_seed_growth_justification }
import gunbc.roadmap_authority { observation_scoped_run_seed_growth_justification }
import gunbc.target_invocation_seed_growth { target_invocation_seed_growth_justification }
import gunbc.emitted_crate_workspace_seed_growth { emitted_crate_workspace_seed_growth_justification }
import gunbc.bootstrap_operation_seed_growth {
bootstrap_operation_seed_growth_justification,
cli_dispatch_host_boundary_seed_growth_justification
Expand Down Expand Up @@ -286,6 +287,7 @@ fn seed_growth_justification_roster() -> List<SeedGrowthJustification> {
qualified_pipe_callee_seed_growth_justification,
regen_digest_spelling_seed_growth_justification,
target_invocation_seed_growth_justification,
emitted_crate_workspace_seed_growth_justification,
bootstrap_operation_seed_growth_justification,
cli_dispatch_host_boundary_seed_growth_justification,
generated_artifact_boundary_seed_growth_justification,
Expand Down
8 changes: 6 additions & 2 deletions dag/gunbc/stage0/stage0_emitted_edge_admission.dag
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import gunbc.rust_emitted_edge {
ReexportFacade,
SemanticSourceReference
}
import gunbc.stage0_crate_partition_generated { generated_partition_crate_rows }
import gunbc.stage0_crate_partition_generated { GeneratedPartitionCrateRow, generated_partition_crate_rows }
import gunbc.stage0_partition_package_graph {
stage0_host_shell_dependency_names,
stage0_host_shell_package_name,
Expand Down Expand Up @@ -60,7 +60,11 @@ type Stage0EmittedEdgeAdmission
// this too, so the crate a lib.rs includes a module into and the crate this admission places it in
// are one answer.
fn stage0_partition_module_owner_packages(module_basename: String) -> List<String> {
generated_partition_crate_rows
partition_module_owner_packages_over(module_basename: module_basename, rows: generated_partition_crate_rows)
}

fn partition_module_owner_packages_over(module_basename: String, rows: List<GeneratedPartitionCrateRow>) -> List<String> {
rows
|> filter(row =>
stage0_partition_row_is_module_bearing_package(row: row)
&& (row.modules |> any(m => m == module_basename))
Expand Down
17 changes: 14 additions & 3 deletions dag/gunbc/stage0/stage0_partition_package_graph.dag
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,27 @@ fn stage0_partition_row_is_module_bearing_package(row: GeneratedPartitionCrateRo
}

fn stage0_partition_module_bearing_package_names() -> List<String> {
generated_partition_crate_rows
partition_module_bearing_package_names_over(rows: generated_partition_crate_rows)
}

fn stage0_partition_package_dependency_names(row: GeneratedPartitionCrateRow) -> List<String> {
partition_package_dependency_names_over(row: row, rows: generated_partition_crate_rows)
}

// The same edges over ANY row set of this shape: the committed stage0 rows above, or rows a
// derivation produced (v2.workflow.emitted_crate_workspace). The emit shell's edges are a property
// of the set it sits in, so the set is a parameter rather than read from the committed one.
fn partition_module_bearing_package_names_over(rows: List<GeneratedPartitionCrateRow>) -> List<String> {
rows
|> filter(row => stage0_partition_row_is_module_bearing_package(row: row))
|> map(row => row.package_name)
}

fn stage0_partition_package_dependency_names(row: GeneratedPartitionCrateRow) -> List<String> {
fn partition_package_dependency_names_over(row: GeneratedPartitionCrateRow, rows: List<GeneratedPartitionCrateRow>) -> List<String> {
match row.kind {
GeneratedFoundationCrate => []
GeneratedLayeredCoreCrate => row.reexport_packages
GeneratedEmitCoreCrate => stage0_partition_module_bearing_package_names()
GeneratedEmitCoreCrate => partition_module_bearing_package_names_over(rows: rows)
}
}

Expand Down
1 change: 1 addition & 0 deletions dag/gunbc/target_binding.dag
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type TargetProducer
| HeadsReadingDifferentialProducer
| CompileCleanDiagnosticCensusProducer
| V2NativeCliProducer
| EmittedCrateWorkspaceProducer
| EvaluationStoreAddressExactHeadProducer
| PrimitiveEgressCensusProducer
| PrimitiveEgressCensusV2Producer
Expand Down
6 changes: 1 addition & 5 deletions src/v1/05_emit_core_support.dag
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import v1.std.core {
}

import v1.compiler.artifact { RenderTarget }
import gunbc.rust_emitted_edge { EmittedEdge }
import gunbc.rust_emitted_edge { EmittedEdge, module_to_filename }

import v1.compiler.infer_items { ResolvedGraph, TypedModule, leaf_owner_modules_from_registry }

Expand Down Expand Up @@ -51,10 +51,6 @@ fn escape_json_string(s: String) -> String {
|> split(delimiter: "\t") |> join(separator: "\\t")
}

fn module_to_filename(name: String) -> String {
name |> split(delimiter: ".") |> join(separator: "_")
}

type ModuleFilenameOwners {
owners: Map<String, String>
diagnostics: List<ErrorNode>
Expand Down
15 changes: 5 additions & 10 deletions src/v1/05_emit_rust.dag
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import std.repair_input_origin {
import std.primitive_projection {
primitive_identity_runtime_name, primitive_projection_row_for_declaration
}
import gunbc.rust_emitted_edge { EmittedEdge, rust_prelude_emitted_edges, emitted_edge_target_module, semantic_source_reference_edge, RuntimePrelude, ReexportFacade }
import gunbc.rust_emitted_edge { EmittedEdge, rust_module_emit_filename, rust_prelude_emitted_edges, emitted_edge_target_module, semantic_source_reference_edge, RuntimePrelude, ReexportFacade }
import gunbc.reference_derived_candidate {
ReferenceDerivedCandidateDisposition,
CandidateSurvived,
Expand Down Expand Up @@ -3594,15 +3594,10 @@ fn emit_rust_selected(typed: ResolvedGraph, selection: RustModuleRenderSelection
EmitResult { files: files, diagnostics: module_refusals, emitted_edges: published_module_emissions |> flat_map(e => e.emitted_edges) }
}

// THE ONE PLACE A MODULE'S EMITTED FILENAME IS DECIDED, read by the renderer and by every
// population-denominated aggregate that must name a module it did not render. `main` collides
// with the crate's own entry file, so it renders as `main_mod`; that rename used to live inside
// `emit_module_full` alone, where a second reader of the same fact had no way to reach it.
fn rust_module_emit_filename(module_name: String) -> String {
let raw = module_to_filename(name: module_name)
if raw == "main" { "main_mod" } else { raw }
}

// A MODULE'S EMITTED PATH, read by the renderer and by every population-denominated aggregate that
// must name a module it did not render. The basename is decided once, in gunbc.rust_emitted_edge
// rust_module_emit_filename, because the emitter's edge rows name their endpoints by it and a
// partition over dotted module names maps onto those endpoints with the same function.
fn rust_module_emit_path(module_name: String) -> String {
concat(rust_source_root(), rust_module_emit_filename(module_name: module_name), rust_source_ext())
}
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ mod census_heads;
#[path = "declaration_index.rs"]
pub mod declaration_index;
pub mod derived_row_roster;
mod emitted_crate_workspace_host;
mod native_lane_runner;
pub mod required_ci_measurement;
mod required_floor_runner;
mod required_lane_roster;
pub mod rostered_row_join;
pub mod scope_rank_view;
mod serve_budget_refusal;
pub use emitted_crate_workspace_host::{run_emitted_crate_workspace, EmittedCrateWorkspaceHeld};
pub use native_lane_runner::{
run_required_v2_native, run_self_host, run_v2_native_cli, NativeMemberTermination,
NativeRouteOutcome, SelfHostHeld, V2NativeCliHeld,
Expand Down
Loading