diff --git a/.gitattributes b/.gitattributes index 3d4c4960c36..33fbb6d09ed 100644 --- a/.gitattributes +++ b/.gitattributes @@ -98,7 +98,6 @@ src/v1/stage0/src/v2_compiler_body_producer.rs !merge src/v1/stage0/src/v2_compiler_compile.rs !merge src/v1/stage0/src/v2_compiler_discovery_enumeration.rs !merge src/v1/stage0/src/v2_compiler_infer.rs !merge -src/v1/stage0/src/v2_compiler_normalize.rs !merge src/v1/stage0/src/v2_compiler_parse_engine_hooks.rs !merge src/v1/stage0/src/v2_compiler_program_assembly.rs !merge src/v1/stage0/src/v2_compiler_program_partition.rs !merge diff --git a/dag/gunbc/emit_subject_clean_frontier.dag b/dag/gunbc/emit_subject_clean_frontier.dag index 1c59b0e1838..e9371b869ac 100644 --- a/dag/gunbc/emit_subject_clean_frontier.dag +++ b/dag/gunbc/emit_subject_clean_frontier.dag @@ -1548,7 +1548,7 @@ fn observation_component_name(component: ObservationComponent) -> String { fn assembly_mode_text(mode: EmissionAssemblyMode) -> String { match mode { - SeedLinkedAssembly { std_bridge_dir: d } => concat("seed-linked:", d) + SeedLinkedAssembly => "seed-linked" } } diff --git a/dag/gunbc/instruments/emission_entry_instrument.dag b/dag/gunbc/instruments/emission_entry_instrument.dag index bb58e38d37e..b64ac6480b6 100644 --- a/dag/gunbc/instruments/emission_entry_instrument.dag +++ b/dag/gunbc/instruments/emission_entry_instrument.dag @@ -23,7 +23,6 @@ import gunbc.whole_corpus_compile_admission { whole_corpus_compile_repository } import gunbc.whole_corpus_compile_demand_projection { whole_corpus_compile_demand_projection_path } import tools.host_prelude { witness_bin, witness_bin_ready, witness_bin_release_path } import tools.self_host_curated_seed_linked_harness { - cssl_std_bridge_shims_rel, cssl_v1_compiled_probe_lib_cargo_toml } import gunbc.emit_diagnostic_observation { @@ -133,7 +132,7 @@ type WorkingTreeStanding // The assembly step is a coproduct rather than a directory string so a second assembly mode becomes // a variant here rather than an unlabelled path difference between two measurements. type EmissionAssemblyMode - = SeedLinkedAssembly { std_bridge_dir: String } + = | SeedLinkedAssembly // THE SUBJECT IS A SCOPE, NOT AN ENTRY STRING, AND THE REASON IS A MEASURED DEFECT RATHER THAN // GENERALITY FOR ITS OWN SAKE. Three whole-corpus runs were taken on 2026-08-28 under @@ -212,7 +211,7 @@ fn working_tree_standing_text(standing: WorkingTreeStanding) -> String { fn emission_assembly_mode_text(mode: EmissionAssemblyMode) -> String { match mode { - SeedLinkedAssembly { std_bridge_dir: d } => concat("seed-linked via ", d) + SeedLinkedAssembly => "seed-linked" } } @@ -593,8 +592,7 @@ fn measure_cargo_half( args: [ "--out-dir", out_dir, "--entry-dag", assembly_entry, - "--root", root, - "--std-bridge-dir", cssl_std_bridge_shims_rel + "--root", root ] ) if !assemble.success || !string_contains(s: assemble.stdout, pattern: "CSSL_ASSEMBLE: PASS") { @@ -761,7 +759,7 @@ fn establish_subject(scope: EmissionScope, render_target: EmissionRenderTarget, working_tree: if status.entries_nul == "" { WorkingTreeClean } else { WorkingTreeDirty }, compiler: compiler, assembler: assembler, - assembly_mode: SeedLinkedAssembly { std_bridge_dir: cssl_std_bridge_shims_rel } + assembly_mode: SeedLinkedAssembly } } } diff --git a/dag/gunbc/instruments/self_host_03_normalize_declared_source_refs.dag b/dag/gunbc/instruments/self_host_03_normalize_declared_source_refs.dag index a98bafaf40f..c203ee5da0c 100644 --- a/dag/gunbc/instruments/self_host_03_normalize_declared_source_refs.dag +++ b/dag/gunbc/instruments/self_host_03_normalize_declared_source_refs.dag @@ -11,48 +11,27 @@ import v2.std.collection { List } // share. cli_run.rs's declared_source_ref scan is closure-wide (every file in a witness entry's // transitive import closure), so a declared_source_refs list living in the shared roster would leak // this selection axis onto all 16 entries; a dedicated per-entry module keeps the axis scoped to -// 03_normalize alone, matching the roster row's module_path/shim_lib_rel/shim_writes/driver_rel -// exactly. +// 03_normalize alone, matching the roster row's module_path/driver_rel exactly. data sn_source_ref: SourceRef = source_ref_for_storage_path(path: "src/v2/compiler/03_normalize.dag") -data sn_shim_lib_ref: SourceRef = source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs") - data sn_shim_driver_ref: SourceRef = source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs") // Hand-verified completeness (docs/plans/declared-source-ref-selection-design.md §5.1 flagship): -// every storage path this transport reads is listed in declared_source_refs — emitter .dag, shim -// lib, witness driver, and each curated shim write source. Widening opt-in past this row waits on -// effect_reach census join admission. The five shared-std shim writes (algebra, collection, -// diagnostic, node, integer) now resolve to dag/gunbc/instruments/self_host_std_bridge_shims/ -// rather than this row's own shim dir (the de-fork: one bridge, not one copy per row), so the -// selection axis follows the file that actually drives the receipt — a declared ref pointing at a -// no-longer-consumed copy would read as covered while the real input went unselected. - -// KNOWN INCOMPLETE, and NOT a read-completeness bug: declared_source_refs lists what this transport -// READS, so it does not list src/v2/std/*.dag — the authority the shared std bridge mirrors. A -// widening of v2.std.diagnostic therefore does not select this witness even though it can break it, -// which is exactly how the Locus struct-to-coproduct drift stayed invisible until a wet falsifier -// run days later. Closing it needs a correctness-dependency axis (authority -> mirror) distinct -// from the read axis; the shim-surface wall is the intended mechanism and the medium decision -// (char-fold lens vs seed bin vs declared surface rows) is open. Until then this gap is stated here -// rather than papered over by adding authority paths to a list whose contract is reads. +// every storage path this transport reads from the repository is listed -- the entry .dag and the +// witness driver. It used to list a shim lib and thirteen shim writes as well; those hand Rust +// copies were deleted when every row moved to whole-closure assembly +// (tools.self_host_curated_seed_linked_harness), so the receipt now builds only emitted bytes. + +// KNOWN INCOMPLETE, and NOT a read-completeness bug: the emitted closure is derived from every +// .dag module 03_normalize imports (src/v2/std/*.dag among them), and none of those is listed, so a +// change to v2.std.diagnostic does not select this witness even though it can break it. The shim +// half of that gap is gone -- there is no hand mirror left to drift from its authority -- but the +// closure half remains: closing it needs a correctness-dependency axis (entry -> import closure) +// distinct from the read axis. Until then the gap is stated here rather than papered over by adding +// closure paths to a list whose contract is reads. data declared_source_refs: List = [ sn_source_ref, - sn_shim_lib_ref, - sn_shim_driver_ref, - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_collection.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_grammar.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_compilers_sugar.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_body_lowering_fold.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_normalized_tree.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_extdeps_languages_dag.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/std_algebra.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/std_types.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_integer.rs"), - source_ref_for_storage_path(path: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_namespace_graft.rs") + sn_shim_driver_ref ] diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs deleted file mode 100644 index 082baec47d5..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -// seed-linked pilot lib — narrow closure manifest for 03_normalize wet receipt. -// Post-#7057 closure grew (~48 emitted pub mods); this manifest keeps only the -// modules the witness crate rustc-links, with ABI-bridge shims for seed-retained -// deps and minimal std stubs for normalize's import surface. -#![allow(clippy::all, dead_code, unused_imports)] -#![recursion_limit = "512"] -pub use v1_compiler::NonEmptyVec; -pub use v1_compiler::NonEmptyBTreeSet; -pub use v1_compiler::v1_rt; -pub mod std_algebra; -pub mod std_types; -pub mod v2_std_integer; -pub mod v2_std_algebra; -pub mod v2_std_collection; -pub mod v2_std_grammar; -pub mod v2_std_diagnostic; -pub mod v2_std_node; -pub mod v2_std_compilers_sugar; -pub mod v2_compiler_body_lowering_fold; -pub mod v2_compiler_normalized_tree; -pub mod v2_extdeps_languages_dag; -pub mod v2_compiler_namespace_graft; -pub mod v2_compiler_normalize; diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/std_algebra.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/std_algebra.rs deleted file mode 100644 index cea11b45696..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/std_algebra.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Minimal ABI stub: normalize imports FreeMonoid only. -pub enum FreeMonoid { - Empty, - Cons { - head: T, - tail: std::rc::Rc>, - }, -} diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/std_types.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/std_types.rs deleted file mode 100644 index 40401531b5e..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/std_types.rs +++ /dev/null @@ -1,2 +0,0 @@ -// Minimal ABI stub: normalize imports Char only. -pub type Char = char; diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_body_lowering_fold.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_body_lowering_fold.rs deleted file mode 100644 index 1e617405342..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_body_lowering_fold.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::rc::Rc; - -use crate::v2_std_collection::Optional; -use crate::v2_std_diagnostic::{diag_none, Diagnostics, Outcome}; -use crate::v2_std_node::{Node, Symbol}; - -pub fn body_lower_is_deferred_lower_emitted(emitted: Symbol) -> bool { - emitted == "dag_surface_fn_body" - || emitted == "dag_surface_pattern" - || emitted == "dag_surface_match_arm" - || emitted == "dag_surface_match_arm_stmt_body" -} - -// Faithful port of body_lowering_fold::body_lower_is_deferred_lower_at_normalize (the fn_body seam -// deferral: an fn_body production is deferred only while under an enclosing fn_decl; every other -// production defers by its own emitted-identity rule). -pub fn body_lower_is_deferred_lower_at_normalize(emitted: Symbol, under_fn_decl: bool) -> bool { - if emitted == "dag_surface_fn_body" { - under_fn_decl - } else { - body_lower_is_deferred_lower_emitted(emitted) - } -} - -pub fn body_lower_finish( - _n: Rc, - folded: Rc, - cd: Rc, -) -> Rc>> { - Rc::new(Outcome::Accepted { - value: folded, - diagnostics: cd, - }) -} - -// Emitted normalize passes `Diagnostics::None` (import shadow) where `Rc` is -// required — rustc rejects verbatim entry without emitter wrap fix. Witness transport records -// this as emit-surface debt; shim keeps the faithful signature for the cd.clone() call sites. -pub fn body_lower_finish_none_folded( - n: Rc, - folded: Rc, -) -> Rc>> { - body_lower_finish(n, folded, diag_none()) -} - -// Faithful port of body_lowering_fold::body_lower_finish_for_normalize. cool-gull's #6840 renamed -// the normalize finish seam (body_lower_finish -> body_lower_finish_for_normalize) and threaded an -// fn_body_pass_through flag; on the normalize path that refactor is behavior-preserving, so this -// delegates to the existing body_lower_finish stub (the pass-through flag governs only the deferred -// fn_body shell, which never reaches this shim's finish step on the seed-oracle probe inputs). -pub fn body_lower_finish_for_normalize( - n: Rc, - folded: Rc, - cd: Rc, - _fn_body_pass_through: bool, -) -> Rc>> { - body_lower_finish(n, folded, cd) -} diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_namespace_graft.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_namespace_graft.rs deleted file mode 100644 index 8e94f751106..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_namespace_graft.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::rc::Rc; - -use crate::v2_std_diagnostic::{outcome_accepted, Outcome}; -use crate::v2_std_node::Node; - -// Witness fixtures are value nodes, not module shells — graft candidate is always false. -pub fn namespace_graft_is_graft_candidate(_root: Rc) -> bool { - false -} - -pub fn module_header_containment_graft(root: Rc) -> Rc>> { - outcome_accepted(root) -} diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_normalized_tree.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_normalized_tree.rs deleted file mode 100644 index 0a54529dbbc..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_normalized_tree.rs +++ /dev/null @@ -1,5 +0,0 @@ -use std::rc::Rc; - -pub use crate::v2_std_node::Node; - -pub type NormalizedTree = Rc; diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_extdeps_languages_dag.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_extdeps_languages_dag.rs deleted file mode 100644 index 45afb8bbcf8..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_extdeps_languages_dag.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::rc::Rc; - -pub type Optional = Option; - -use crate::v2_std_node::Node; - -pub fn parse_production_emitted_identity_optional(_node: Rc) -> Rc> { - Rc::new(None) -} diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_compilers_sugar.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_compilers_sugar.rs deleted file mode 100644 index eaf9ddb1bff..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_compilers_sugar.rs +++ /dev/null @@ -1,39 +0,0 @@ -use std::rc::Rc; - -use crate::v2_std_collection::Optional; -use crate::v2_std_diagnostic::{Diagnostics, Outcome}; -use crate::v2_std_node::{Connective, Node, Symbol}; - -#[derive(Debug, Clone, PartialEq)] -pub enum SugarKey { - SurfaceAtomKey { atom: String }, - ProductionIdentityKey { identity: String }, -} - -#[derive(Debug, Clone, PartialEq)] -pub enum SugarLowering { - SugarRewriteConnective { - connective: Rc, - }, -} - -#[derive(Debug, Clone, PartialEq)] -pub struct SugarRule { - pub key: Rc, - pub lowering: Rc, -} - -pub fn sugar_rule_for_key(_key: Rc) -> Option> { - None -} - -pub fn apply_sugar( - _rule: Rc, - _n: Rc, - folded: Rc, -) -> Rc>> { - Rc::new(Outcome::Accepted { - value: folded, - diagnostics: Rc::new(Diagnostics::None), - }) -} diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_grammar.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_grammar.rs deleted file mode 100644 index 2382ccae644..00000000000 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_grammar.rs +++ /dev/null @@ -1,5 +0,0 @@ -use std::rc::Rc; - -pub use crate::v2_std_node::Node; - -pub type ParseTree = Rc; diff --git a/dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs b/dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs index 8f969941f34..87446f76184 100644 --- a/dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs +++ b/dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs @@ -1,78 +1,63 @@ -use im::{vector as vec, Vector as Vec}; +use im::vector as vec; use std::rc::Rc; use v1_compiled::v2_compiler_normalize as emitted; use v1_compiled::v2_std_node::{ - node_synthetic as emitted_node_synthetic, Behavior as EBehavior, Connective as EConnective, - NodeKind as ENodeKind, + node_synthetic, Behavior, Edge, EdgeLabel, Node, NodeKind, }; -use v1_compiler::v2_compiler_normalize as seed; -use v1_compiler::usv_pilot_v2_std_node::{ - node_synthetic as seed_node_synthetic, Behavior as SBehavior, Connective as SConnective, - NodeKind as SNodeKind, -}; - -fn outcome_is_accepted_emitted(o: &Rc>) -> bool { - matches!(&**o, emitted::Outcome::Accepted { .. }) -} -fn outcome_is_accepted_seed(o: &Rc>) -> bool { - matches!(&**o, seed::Outcome::Accepted { .. }) -} +// NO SEED ORACLE, ON PURPOSE. This driver used to compare against +// v1_compiler::v2_compiler_normalize, a hand-retained stub whose well_formed returned `true`, so +// "parity with the seed" meant "accepts everything". Its expected verdicts are instead read off +// the authority itself: src/v2/compiler/03_normalize.dag refuses a tree v2.std.node well_formed +// rejects (post_normalize_not_well_formed_diagnostic) and accepts one it admits. -fn value_node_emitted() -> Rc { - emitted_node_synthetic( - Rc::new(ENodeKind::ComputationNode { - behavior: EBehavior::Value, - }), - Rc::new(vec![]), - ) +fn accepted(o: &Rc>) -> bool { + matches!(&**o, emitted::Outcome::Accepted { .. }) } -fn value_node_seed() -> Rc { - seed_node_synthetic( - Rc::new(SNodeKind::ComputationNode { - behavior: SBehavior::Value, +fn value_node() -> Rc { + node_synthetic( + Rc::new(NodeKind::ComputationNode { + behavior: Behavior::Value, }), Rc::new(vec![]), ) } -fn malformed_disj_emitted() -> Rc { - emitted_node_synthetic( - Rc::new(ENodeKind::TypeNode { - connective: Rc::new(EConnective::Disj), +// v2.std.node behavior_edges_conform gives Value `count(children) == 0`, so a Value node carrying +// one edge is not well formed. +fn value_with_child() -> Rc { + node_synthetic( + Rc::new(NodeKind::ComputationNode { + behavior: Behavior::Value, }), - Rc::new(vec![]), + Rc::new(vec![Rc::new(Edge { + label: Rc::new(EdgeLabel::Positional), + target: value_node(), + })]), ) } +// THE FAULT RUN INVERTS EXACTLY ONE PROPOSITION. Plain: the well-formed tree is accepted AND the +// malformed one is refused. Injected: the malformed tree is ACCEPTED -- the planted fault is the claim +// that normalize admits it. So a correct normalize passes plain and fails injected (the harness +// reads that FAIL as the fault detected); an accept-everything normalize fails plain and PASSES +// injected, so cssl_fault_run_detected_the_planted_fault refuses; a reject-everything normalize +// fails plain. An earlier revision fed the malformed tree into both arms, so the injected run was +// `p && !p` and printed FAIL for every implementation -- a fault arm with no reachable green. fn main() { let inject_fault = std::env::args().any(|a| a == "--inject-fault"); - let mut all_pass = true; - - let e_init = emitted::normalize_fold_init(value_node_emitted()); - let s_init = seed::normalize_fold_init(value_node_seed()); - let init_ok = - outcome_is_accepted_emitted(&e_init) && outcome_is_accepted_seed(&s_init); - println!("normalize_fold_init eq_accept={init_ok}"); - all_pass &= init_ok; - - let e_parse = if inject_fault { - malformed_disj_emitted() + let malformed_accepted = accepted(&emitted::normalize(value_with_child())); + let all_pass = if inject_fault { + println!("normalize injected: not_well_formed accepted={malformed_accepted}"); + malformed_accepted } else { - value_node_emitted() + let valid_accepts = accepted(&emitted::normalize(value_node())); + println!("normalize well_formed accepts={valid_accepts}"); + println!("normalize not_well_formed refuses={}", !malformed_accepted); + valid_accepts && !malformed_accepted }; - let e_norm = emitted::normalize(e_parse); - let s_norm = seed::normalize(value_node_seed()); - let norm_ok = outcome_is_accepted_emitted(&e_norm) == outcome_is_accepted_seed(&s_norm) - && (!inject_fault || !outcome_is_accepted_emitted(&e_norm)); - println!( - "normalize inject_fault={inject_fault} parity={norm_ok} emitted_accept={} seed_accept={}", - outcome_is_accepted_emitted(&e_norm), - outcome_is_accepted_seed(&s_norm) - ); - all_pass &= norm_ok; if all_pass { println!("SELF_HOST_03_NORMALIZE_BEHAVIORAL_RECEIPT: PASS"); diff --git a/dag/gunbc/instruments/self_host_body_producer_shims/lib.rs b/dag/gunbc/instruments/self_host_body_producer_shims/lib.rs deleted file mode 100644 index 6a822f3df34..00000000000 --- a/dag/gunbc/instruments/self_host_body_producer_shims/lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -// seed-linked pilot lib — entry module gunbc-emitted, seed-retained dep shims -#![allow(clippy::all, dead_code, unused_imports)] -#![recursion_limit = "256"] -pub mod v1_rt; -pub mod v2_std_algebra; -pub mod v2_std_diagnostic; -pub mod v2_std_node; -pub mod v2_compiler_body_producer; -pub use v1_compiler::NonEmptyVec; -pub use v1_compiler::NonEmptyBTreeSet; diff --git a/dag/gunbc/instruments/self_host_body_producer_shims/witness_main.rs b/dag/gunbc/instruments/self_host_body_producer_shims/witness_main.rs index 45d4ed6642d..10b324d8739 100644 --- a/dag/gunbc/instruments/self_host_body_producer_shims/witness_main.rs +++ b/dag/gunbc/instruments/self_host_body_producer_shims/witness_main.rs @@ -24,7 +24,15 @@ fn transform_body_emitted() -> Rc { Rc::new(ENodeKind::ComputationNode { behavior: EBehavior::Transform, }), - Rc::new(vec![]), + Rc::new(vec![Rc::new(EEdge { + label: Rc::new(EEdgeLabel::Positional), + target: emitted_node_synthetic( + Rc::new(ENodeKind::ComputationNode { + behavior: EBehavior::Value, + }), + Rc::new(vec![]), + ), + })]), ) } @@ -33,7 +41,15 @@ fn transform_body_seed() -> Rc { Rc::new(SNodeKind::ComputationNode { behavior: SBehavior::Transform, }), - Rc::new(vec![]), + Rc::new(vec![Rc::new(SEdge { + label: Rc::new(SEdgeLabel::Positional), + target: seed_node_synthetic( + Rc::new(SNodeKind::ComputationNode { + behavior: SBehavior::Value, + }), + Rc::new(vec![]), + ), + })]), ) } @@ -77,6 +93,10 @@ fn arrow_signature_seed() -> Rc { ) } +// The Transform fixture carries one positional edge because v2.std.node behavior_edges_conform +// requires `count(children) >= 1` for Transform. It carried none while this row linked a hand +// v2_std_node shim laxer than that authority; against the emitted module the edgeless fixture is +// (correctly) refused, so the shim had been keeping a malformed input green. fn main() { let inject_fault = std::env::args().any(|a| a == "--inject-fault"); let mut all_pass = true; @@ -95,25 +115,30 @@ fn main() { println!("dispatch_non_behavior eq_reject={reject_ok}"); all_pass &= reject_ok; - let e_produce = emitted::produce_arrow_with_structured_body( - arrow_signature_emitted(), - if inject_fault { - atom_body_emitted() - } else { - transform_body_emitted() - }, - ); - let s_produce = seed::produce_arrow_with_structured_body( - arrow_signature_seed(), - transform_body_seed(), - ); - let produce_ok = outcome_is_accepted_emitted(&e_produce) - == outcome_is_accepted_seed(&s_produce) - && (!inject_fault || !outcome_is_accepted_emitted(&e_produce)); - println!( - "produce_arrow inject_fault={inject_fault} parity={produce_ok}" - ); - all_pass &= produce_ok; + // THE FAULT RUN INVERTS EXACTLY ONE PROPOSITION: the planted claim is that emitted + // produce_arrow ACCEPTS an Atom body. A correct producer refuses it, so the injected run + // fails (the harness reads that as the fault detected); an accept-everything producer makes + // the injected run PASS, and cssl_fault_run_detected_the_planted_fault refuses. An earlier + // revision required `parity && !accepted` there, which no implementation could satisfy. + let produce_ok = if inject_fault { + let e_atom = emitted::produce_arrow_with_structured_body( + arrow_signature_emitted(), + atom_body_emitted(), + ); + outcome_is_accepted_emitted(&e_atom) + } else { + let e_produce = emitted::produce_arrow_with_structured_body( + arrow_signature_emitted(), + transform_body_emitted(), + ); + let s_produce = seed::produce_arrow_with_structured_body( + arrow_signature_seed(), + transform_body_seed(), + ); + outcome_is_accepted_emitted(&e_produce) && outcome_is_accepted_seed(&s_produce) + }; + println!("produce_arrow inject_fault={inject_fault} ok={produce_ok}"); + all_pass = if inject_fault { produce_ok } else { all_pass && produce_ok }; if all_pass { println!("SELF_HOST_BODY_PRODUCER_BEHAVIORAL_RECEIPT: PASS"); diff --git a/dag/gunbc/instruments/self_host_curated_seed_linked_harness.dag b/dag/gunbc/instruments/self_host_curated_seed_linked_harness.dag index 9b8bc2285d0..4ab83c33772 100644 --- a/dag/gunbc/instruments/self_host_curated_seed_linked_harness.dag +++ b/dag/gunbc/instruments/self_host_curated_seed_linked_harness.dag @@ -1,6 +1,5 @@ module tools.self_host_curated_seed_linked_harness -import std.dissolution { DissolutionCondition, dissolution_description, unbound_dissolution } import extdeps.shell import extdeps.filesystem.filesystem_io { Filesystem } @@ -15,13 +14,20 @@ import v2.std.text { String } import tools.host_prelude { witness_bin, witness_bin_ready, witness_bin_release_path } // Reusable curated seed-linked self-host harness (Wave 2 easy-flip lane): factors the duplicated -// emit->shim-assemble->cargo->witness(fault) spine shared by Band A behavioral transports. Probe +// emit->assemble->cargo->witness(fault) spine shared by Band A behavioral transports. Probe // lane consumes only cssl_v1_compiled_probe_lib_cargo_toml via tools.self_host_curated_probe_cargo. -// Curated = gunbc emit must succeed, then seed-retained dep shims + shim lib.rs replace the emitted -// closure so the entry module rustc-links against v1-compiler without waiting for full std -// self-emit or emitter Track-B body fixes. Each module lane supplies its own shim file paths, -// witness driver, pass marker, and zero or more supplementary claim-runs. Empty shim_lib_rel = keep -// gunbc-emitted lib.rs (runtime closure only). Empty claim_runs = skip supplementary claim-runs. +// Every receipt links the WHOLE EMITTED CLOSURE (cssl_assemble, below) against v1-compiler; a module +// lane supplies only its witness driver, pass marker, and zero or more supplementary claim-runs. +// HAND SHIMS ARE GONE, AND THE FIELDS THAT CARRIED THEM WITH THEM. Rows used to overwrite emitted +// modules with hand-authored Rust (a shim lib.rs plus per-module shim writes, most from a shared +// std-bridge directory). Each shim was a second realization of a .dag module that nothing kept in +// step with the emitter, so it went stale silently: self_host_03 was red for 13 E0308 because the +// v2_std_diagnostic shim still spelled Diagnostics as an enum after the emitter moved it to Option, +// and the lax v2_std_node shim was keeping malformed fixtures green in two drivers. Every shim row +// was censused before the cut -- the emitted closure builds and the driver passes with no shim -- +// so the override has no admitted use and is deleted rather than left empty: a row CANNOT name a +// shim now, which is gunbc.recurring_failure_mode hand_shim_shadows_an_emitted_module's rung. +// Empty claim_runs = skip supplementary claim-runs. // LANDED: the per-module copy-paste this note names is dissolved by // tools.self_host_module_behavioral_transport_roster — one config row per frontier module, one // generic compiler_module_behavioral_receipt_for(module_path) dispatch, this kernel unchanged as @@ -30,22 +36,18 @@ import tools.host_prelude { witness_bin, witness_bin_ready, witness_bin_release_ // Mirrors slb_cargo_features_note: text_lookup_work_counter feature declared for -D warnings // consumers. -// LANDED (2026-07-17): generic seed-shim closure assembly via cssl_assemble bin + +// LANDED (2026-07-17): generic closure assembly via cssl_assemble bin + // cssl_seed_linked_closure_assembly.rs (typed Refused final arm; explicit dag/std · lens · // peripheral emit-retain). Former assembly Refused arms (compiler dep absent from seed lib.rs; // v2_std module without shared std-bridge shim) fold into byte-untouched emit-retain — refusal // relocates to cargo verdict, not silent green (the sanitize scaffold debt on this path dissolved // 2026-07-23 when strip_repeated_use_symbols landed in v1.compiler.emit_rust). Invoked from -// cssl_seed_linked_behavioral_receipt when shim_lib_rel empty and shim_writes empty. cssl_assemble +// cssl_seed_linked_behavioral_receipt for every row. cssl_assemble // IS the assembly entrypoint (a modeled bin, invoked directly); the hand probe runners that used to // drive it under CSSL_STD_SEED_LINK=1 lived in scripts/ and were deleted 2026-07-23 — their // measurement receipts are in docs/probes, and re-measuring goes through cssl_assemble, not a // restored shell wrapper. -data cssl_std_bridge_shims_rel: String = "dag/gunbc/instruments/self_host_std_bridge_shims" - -data cssl_std_bridge_scaffold_dissolution_trigger: DissolutionCondition = unbound_dissolution(description: "dissolve-on: dag/gunbc/instruments/self_host_std_bridge_shims/* shared std-bridge (emitted-side ONLY; seed oracle uses v1_compiler real std). DISSOLVES WHEN v2 std self-emits and gunbc emits seed-linked extern imports without hand ABI bridges.") - // CSSL DOES NOT ADD MODULES TO THE v1 SEED, AND THE ABSENCE OF THIS SENTENCE HAS A MEASURED COST. // cssl_assemble writes into out_dir ONLY -- the gunbc-emitted CANDIDATE crate. AS OF THIS REVISION // IT DOES NOT READ src/v1/stage0/src AT ALL, AND THAT IS A STRENGTHENING OF THIS PARAGRAPH, NOT A @@ -73,7 +75,7 @@ data cssl_std_bridge_scaffold_dissolution_trigger: DissolutionCondition = unboun // assemble_seed_linked_closure actually writes. A refusal doing its job was read as evidence of a // fork. The distinction costs one paragraph here and cost a wrong work item without it. -data cssl_closure_assembly_note: String = "Generic closure assembly: the dep population is the EMITTED-POPULATION MANIFEST the compiler writes into the same out_dir (src/emitted_population.rs), read under the grammar both ends resolve from gunbc.stage0_emitted_population_manifest -- split on the separator, strip the line prefix. Entry module bytes hash-locked. Emit-retain rule: every path the emitter DECLARED it produced must be materialized in out_dir, byte-untouched; a declared path with no file is a typed refusal (RefusedDeclaredMember), and refusal for anything the bytes then say relocates to the cargo verdict. THIS REPLACED THE LAST RUST TEXT-PARSE ON THIS PATH (the prior revision scraped src/lib.rs pub mod lines to recover closure membership), and the swap is a strengthening rather than a rename: lib.rs mod list is rendered FROM the same module file list the writer then writes out, so that check could only agree with itself on the real path and its only reachable red came from a hand-authored lib.rs -- while the manifest declares Cargo.toml, lib.rs, main.rs, every module, every test file and itself, so the declared-versus-materialized question is answerable at the grain that matters. BOOTSTRAP_INLINE_MODS is deleted with it: the manifest never declares NonEmptyVec/NonEmptyBTreeSet because they are inlined structs and not files, so the state that skip tolerated is not representable in the population assembly reads. The seed lib.rs is still NOT consulted: the compiler-seed-re-export arm and its seed_has_pub_mod oracle are deleted (see cssl_is_not_a_seed_admission_path_note), so seed mod-tree membership has one authority, v2.compiler.self_host.stage0_crate_layout, and this harness is not a second reader of it. Hand shim_lib_rel/shim_writes = optional fast-path override (body_producer / behavioral receipts)." +data cssl_closure_assembly_note: String = "Generic closure assembly: the dep population is the EMITTED-POPULATION MANIFEST the compiler writes into the same out_dir (src/emitted_population.rs), read under the grammar both ends resolve from gunbc.stage0_emitted_population_manifest -- split on the separator, strip the line prefix. Entry module bytes hash-locked. Emit-retain rule: every path the emitter DECLARED it produced must be materialized in out_dir, byte-untouched; a declared path with no file is a typed refusal (RefusedDeclaredMember), and refusal for anything the bytes then say relocates to the cargo verdict. THIS REPLACED THE LAST RUST TEXT-PARSE ON THIS PATH (the prior revision scraped src/lib.rs pub mod lines to recover closure membership), and the swap is a strengthening rather than a rename: lib.rs mod list is rendered FROM the same module file list the writer then writes out, so that check could only agree with itself on the real path and its only reachable red came from a hand-authored lib.rs -- while the manifest declares Cargo.toml, lib.rs, main.rs, every module, every test file and itself, so the declared-versus-materialized question is answerable at the grain that matters. BOOTSTRAP_INLINE_MODS is deleted with it: the manifest never declares NonEmptyVec/NonEmptyBTreeSet because they are inlined structs and not files, so the state that skip tolerated is not representable in the population assembly reads. The seed lib.rs is still NOT consulted: the compiler-seed-re-export arm and its seed_has_pub_mod oracle are deleted (see cssl_is_not_a_seed_admission_path_note), so seed mod-tree membership has one authority, v2.compiler.self_host.stage0_crate_layout, and this harness is not a second reader of it." // SCAFFOLD — tracked debt: Cargo.toml TOML markup authored via concat string literals in // cssl_v1_compiled_cargo_* (same class as slb_cargo_toml / ssuv_cargo_toml / peh_cargo_toml). @@ -120,56 +122,6 @@ fn cssl_v1_compiled_probe_lib_cargo_toml(root: String) -> String { ) } -type CuratedSeedLinkedShimWrite { - dest_rel: String - source_rel: String -} - -fn cssl_write_shim_from_repo( - root: String, - out_dir: String, - shim: CuratedSeedLinkedShimWrite -) -> Bool { - let read = Filesystem.Read(path: cssl_repo_path(root: root, rel: shim.source_rel)) - let write = Filesystem.Write( - path: concat(out_dir, concat("/src/", shim.dest_rel)), - content: read.content - ) - read.success && write.success -} - -fn cssl_write_shims_from_repo( - root: String, - out_dir: String, - shims: List -) -> Bool { - fold_list( - xs: shims, - empty: true, - cons: fn(ok, shim) { - ok && cssl_write_shim_from_repo(root: root, out_dir: out_dir, shim: shim) - } - ) -} - -fn cssl_write_shim_lib_from_repo( - root: String, - out_dir: String, - shim_lib_rel: String -) -> Bool { - if shim_lib_rel == "" { - true - } else { - let read = Filesystem.Read(path: cssl_repo_path(root: root, rel: shim_lib_rel)) - let write = Filesystem.Write(path: concat(out_dir, "/src/lib.rs"), content: read.content) - read.success && write.success - } -} - -fn cssl_uses_hand_shim_fast_path(shim_lib_rel: String, shim_writes: List) -> Bool { - shim_lib_rel != "" || length(xs: shim_writes) > 0 -} - fn cssl_run_generic_closure_assembly( root: String, out_dir: String, @@ -182,8 +134,7 @@ fn cssl_run_generic_closure_assembly( args: [ "--out-dir", out_dir, "--entry-dag", source_rel, - "--root", root, - "--std-bridge-dir", cssl_std_bridge_shims_rel + "--root", root ] ) assemble.success && string_contains(s: assemble.stdout, pattern: "CSSL_ASSEMBLE: PASS") @@ -295,12 +246,9 @@ fn cssl_fault_run_detected_the_planted_fault( fn cssl_seed_linked_behavioral_receipt( source_rel: String, - shim_lib_rel: String, - shim_writes: List, driver_rel: String, pass_marker: String, - claim_runs: List, - run_closure_assembly: Bool + claim_runs: List ) -> Bool { let root = git.Inspect.Toplevel() let module_read = Filesystem.Read(path: cssl_repo_path(root: root.path, rel: source_rel)) @@ -326,19 +274,12 @@ fn cssl_seed_linked_behavioral_receipt( ) let src_dir = shell.Mkdir.Parents(path: concat(out_dir.path, "/src")) - let hand_shim_path = cssl_uses_hand_shim_fast_path(shim_lib_rel: shim_lib_rel, shim_writes: shim_writes) - let generic_assembly_ok = if hand_shim_path && !run_closure_assembly { - true - } else { - cssl_run_generic_closure_assembly( - root: root.path, - out_dir: out_dir.path, - source_rel: source_rel, - cssl_assemble_bin: cssl_assemble_bin - ) - } - let lib_written = cssl_write_shim_lib_from_repo(root: root.path, out_dir: out_dir.path, shim_lib_rel: shim_lib_rel) - let shims_written = cssl_write_shims_from_repo(root: root.path, out_dir: out_dir.path, shims: shim_writes) + let generic_assembly_ok = cssl_run_generic_closure_assembly( + root: root.path, + out_dir: out_dir.path, + source_rel: source_rel, + cssl_assemble_bin: cssl_assemble_bin + ) let manifest = Filesystem.Write(path: concat(out_dir.path, "/Cargo.toml"), content: cssl_v1_compiled_cargo_toml(root: root.path)) let main_rs = Filesystem.Write(path: concat(out_dir.path, "/src/main.rs"), content: driver_read.content) @@ -369,7 +310,6 @@ fn cssl_seed_linked_behavioral_receipt( && out_dir.success && gunbc_built && cssl_assemble_built && emit.success && src_dir.success && generic_assembly_ok - && lib_written && shims_written && manifest.success && main_rs.success && build.success && pass_run.success && string_contains(s: pass_run.stdout, pattern: pass_marker) diff --git a/dag/gunbc/instruments/self_host_module_behavioral_transport_roster.dag b/dag/gunbc/instruments/self_host_module_behavioral_transport_roster.dag index 74185933873..5e0693f6361 100644 --- a/dag/gunbc/instruments/self_host_module_behavioral_transport_roster.dag +++ b/dag/gunbc/instruments/self_host_module_behavioral_transport_roster.dag @@ -1,7 +1,6 @@ module tools.self_host_module_behavioral_transport_roster import tools.self_host_curated_seed_linked_harness { - CuratedSeedLinkedShimWrite, CuratedSeedLinkedClaimRun, cssl_seed_linked_behavioral_receipt } @@ -32,8 +31,10 @@ import v2.std.text { String } // 01_tokenize, 02_parse, 03_body_producer, 03_ingest, 03_normalize, 03_resolve, 04_infer, // 07_target_carriers, discovery_enumeration, materialization_carriers, parse_engine_hooks, // program_assembly, program_partition, source_authority, use_site_verdict). Each row is config data -// only (shim paths, driver path, pass marker, supplementary claim-runs) migrated verbatim from -// those files; the seed-vs-emitted execution stays entirely in the shared kernel +// only (module path, driver path, pass marker, supplementary claim-runs); the hand shim paths the +// rows once carried are deleted with the fields that held them (see +// gunbc.recurring_failure_mode hand_shim_shadows_an_emitted_module), so every row links the whole +// emitted closure. The emit/assemble/cargo/witness execution stays entirely in the shared kernel // (tools.self_host_curated_seed_linked_harness), so a new frontier row's receipt is one roster row, // not a new file. Fail-closed: an unrecognized module_path returns false (never a fabricated pass) // — see compiler_module_behavioral_receipt_for. tools.self_host_logic_behavioral_transport and @@ -44,153 +45,61 @@ import v2.std.text { String } type ModuleBehavioralTransportConfig { module_path: String - shim_lib_rel: String - shim_writes: List driver_rel: String pass_marker: String claim_runs: List - run_closure_assembly: Bool } data compiler_module_behavioral_transport_roster: List = [ ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/00_compile.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_00_compile_shims/witness_main.rs", pass_marker: "SELF_HOST_00_COMPILE_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/01_tokenize.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_01_tokenize_shims/witness_main.rs", pass_marker: "SELF_HOST_01_TOKENIZE_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/02_parse.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_02_parse_shims/witness_main.rs", pass_marker: "SELF_HOST_02_PARSE_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/03_body_producer.dag", - shim_lib_rel: "dag/gunbc/instruments/self_host_body_producer_shims/lib.rs", - shim_writes: [ - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_node.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_algebra.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_diagnostic.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs" - } - ], driver_rel: "dag/gunbc/instruments/self_host_body_producer_shims/witness_main.rs", pass_marker: "SELF_HOST_BODY_PRODUCER_BEHAVIORAL_RECEIPT: PASS", claim_runs: [ CuratedSeedLinkedClaimRun { - entry_rel: "src/v2/test/claim/manual/structured_body_dispatch.dag", + entry_rel: "src/v2/test/claim/manual/structured_body_dispatch_test.dag", function: "structured_body_dispatch_accepts_transform_call" } - ], - run_closure_assembly: false + ] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/03_ingest.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_03_ingest_shims/witness_main.rs", pass_marker: "SELF_HOST_03_INGEST_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/03_normalize.dag", - shim_lib_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs", - shim_writes: [ - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_algebra.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_collection.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_collection.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_grammar.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_grammar.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_diagnostic.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_node.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_compilers_sugar.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_std_compilers_sugar.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_compiler_body_lowering_fold.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_body_lowering_fold.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_compiler_normalized_tree.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_normalized_tree.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_extdeps_languages_dag.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_extdeps_languages_dag.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "std_algebra.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/std_algebra.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "std_types.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/std_types.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_std_integer.rs", - source_rel: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_integer.rs" - }, - CuratedSeedLinkedShimWrite { - dest_rel: "v2_compiler_namespace_graft.rs", - source_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/v2_compiler_namespace_graft.rs" - } - ], driver_rel: "dag/gunbc/instruments/self_host_03_normalize_shims/witness_main.rs", pass_marker: "SELF_HOST_03_NORMALIZE_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/03_resolve.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_03_resolve_shims/witness_main.rs", pass_marker: "SELF_HOST_03_RESOLVE_BEHAVIORAL_RECEIPT: PASS", - claim_runs: [], - run_closure_assembly: false + claim_runs: [] }, ModuleBehavioralTransportConfig { module_path: "src/v2/compiler/04_infer.dag", - shim_lib_rel: "", - shim_writes: [], driver_rel: "dag/gunbc/instruments/self_host_04_infer_shims/witness_main.rs", pass_marker: "SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: PASS", claim_runs: [ @@ -198,13 +107,10 @@ data compiler_module_behavioral_transport_roster: List EvidenceSubjectCompleted { outcome: if cssl_seed_linked_behavioral_receipt( source_rel: cfg.module_path, - shim_lib_rel: cfg.shim_lib_rel, - shim_writes: cfg.shim_writes, driver_rel: cfg.driver_rel, pass_marker: cfg.pass_marker, - claim_runs: cfg.claim_runs, - run_closure_assembly: cfg.run_closure_assembly + claim_runs: cfg.claim_runs ) { BehavioralReceiptHeld } else { diff --git a/dag/gunbc/instruments/self_host_parse_engine_hooks_shims/lib.rs b/dag/gunbc/instruments/self_host_parse_engine_hooks_shims/lib.rs deleted file mode 100644 index 994db7a6a75..00000000000 --- a/dag/gunbc/instruments/self_host_parse_engine_hooks_shims/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -// seed-linked pilot lib — entry module self-emitted (gunbc output), seed-retained dep shim -#![allow(clippy::all, dead_code, unused_imports)] -#![recursion_limit = "256"] -pub mod v1_rt; -pub mod v2_std_node; -pub mod v2_compiler_parse_engine_hooks; -pub use v1_compiler::NonEmptyVec; -pub use v1_compiler::NonEmptyBTreeSet; diff --git a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs b/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs deleted file mode 100644 index 802822614f1..00000000000 --- a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_algebra.rs +++ /dev/null @@ -1,8 +0,0 @@ -use im::Vector as Vec; -use std::rc::Rc; - -pub fn list_snoc_item(xs: Rc>, item: T) -> Rc> { - let mut out = xs.as_ref().clone(); - out.push_back(item); - Rc::new(out) -} diff --git a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_collection.rs b/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_collection.rs deleted file mode 100644 index 61f3bc82ce7..00000000000 --- a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_collection.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Shared std-bridge shim — curated minimal v2.std.collection surface. -// -// AUTHORITY: src/v2/std/collection.dag. Hand-authored scaffold; see the header of -// v2_std_diagnostic.rs in this directory for why the bridge exists, what dissolves it, and -// why drift against the authority is caught only by the wet receipt's cargo build today. -// -// UNION, NOT A PICK. This file replaces two same-named per-transport copies whose surfaces -// were DISJOINT: the 03_normalize copy provided only the `Optional` import path, the -// use_site_verdict copy only `List`. Repointing both at either copy would have silently -// removed the other's surface — a de-fork that drops symbols is not a de-fork, it is a -// regression wearing one. So the bridge carries the union, and the rule for any future -// consumer is the same: widen this file to a superset, never narrow a consumer to whatever -// happens to be here already. -pub type List = im::Vector; - -// Optional import path for dead `use Optional::{Absent, Present}` in emitted entry. -pub mod Optional { - pub enum Enum { - Absent, - Present { value: T }, - } - pub use Enum::{Absent, Present}; -} - -pub fn optional_absent() -> Option { - None -} - -pub fn optional_present(value: T) -> Option { - Some(value) -} diff --git a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs b/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs deleted file mode 100644 index e101f6667d9..00000000000 --- a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_diagnostic.rs +++ /dev/null @@ -1,216 +0,0 @@ -// Shared std-bridge shim — curated minimal v2.std.diagnostic surface. -// -// AUTHORITY: src/v2/std/diagnostic.dag. This file is a hand-authored scaffold standing in -// for the emitted module while the emitted v2 std closure still fails to compile (Clone-bound -// derivation on emitted generics; see cssl_std_bridge_scaffold_dissolution_trigger). It is a -// parallel representation of a canonical fact and is therefore drift-prone BY CONSTRUCTION — -// the public type surface here must stay a superset of what emitted entry modules import. -// -// DRIFT DETECTION TODAY — stated plainly because it is weak: the only thing that catches a -// missing name is the emitted crate's own cargo build inside the wet behavioral receipt, and -// that receipt runs on the falsifier cadence, not per-PR (the selection axis is reads, and -// src/v2/std/*.dag is this file's AUTHORITY, not its read — see -// tools.self_host_03_normalize_declared_source_refs's authority-gap note). That is how a -// widened v2.std.diagnostic (Locus struct -> coproduct, plus Extent / LocusAnchor / -// Diagnostics / NonEmptyDiagnostics) rotted here unnoticed for days. This file re-syncs that -// widening; it does NOT close the gap. The intended mechanism is a shim-surface wall reading -// the emitted `use crate::::{..}` names and refusing when this file does not -// provide them; it DOES NOT EXIST YET and its medium is undecided. -// -// dissolve-on: emitted v2 std closure compiles; then this bridge is deleted, not re-synced. -use im::Vector as Vec; -use std::rc::Rc; - -use crate::v2_std_node::{Node, Symbol}; - -#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum NoCorrectionReason { - UserInputBoundary, - AmbiguousIntent, - ExternalContractUnknown, - CorrectionNotModeled, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Correction { - Suggested { node: Rc }, - Unavailable { reason: NoCorrectionReason }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Extent { - WholeFile, - ByteRange { start: i64, end: i64 }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -pub struct LocusAnchor { - pub at: T, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Locus { - Textual { - file: Symbol, - extent: Rc, - }, - NodeLocus { - anchor: Rc>>, - }, - SourcePortLocus { - anchor: Rc>, - file: Symbol, - extent: Rc, - }, - InvariantPortLocus { - anchor: Rc>, - invariant: Symbol, - }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -pub struct Diagnostic { - pub reason: Symbol, - pub at: Rc, - pub correction: Rc, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -pub struct NonEmptyDiagnostics { - pub head: Rc, - pub tail: Rc>>, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Diagnostics { - None, - Some { - diagnostics: Rc, - }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Outcome { - Accepted { - value: T, - diagnostics: Rc, - }, - Rejected { - diagnostics: Rc, - }, -} - -pub fn diagnostics_singleton(d: Rc) -> Rc { - Rc::new(NonEmptyDiagnostics { - head: d, - tail: Rc::new(Vec::new()), - }) -} - -pub fn node_locus(node: Rc) -> Rc { - Rc::new(Locus::NodeLocus { - anchor: Rc::new(LocusAnchor { at: node }), - }) -} - -pub fn source_port_locus(port: Symbol, file: Symbol, extent: Rc) -> Rc { - Rc::new(Locus::SourcePortLocus { - anchor: Rc::new(LocusAnchor { at: port }), - file, - extent, - }) -} - -pub fn invariant_port_locus(port: Symbol, invariant: Symbol) -> Rc { - Rc::new(Locus::InvariantPortLocus { - anchor: Rc::new(LocusAnchor { at: port }), - invariant, - }) -} - -pub fn textual_whole_file_locus(file: Symbol) -> Rc { - Rc::new(Locus::Textual { - file, - extent: Rc::new(Extent::WholeFile), - }) -} - -pub fn diag_none() -> Rc { - Rc::new(Diagnostics::None) -} - -pub fn diagnostics_merge(outer: Rc, inner: Rc) -> Rc { - match (outer.as_ref(), inner.as_ref()) { - (Diagnostics::None, Diagnostics::None) => Rc::new(Diagnostics::None), - (Diagnostics::None, Diagnostics::Some { diagnostics }) => Rc::new(Diagnostics::Some { - diagnostics: diagnostics.clone(), - }), - (Diagnostics::Some { diagnostics: a }, Diagnostics::None) => Rc::new(Diagnostics::Some { - diagnostics: a.clone(), - }), - (Diagnostics::Some { diagnostics: a }, Diagnostics::Some { diagnostics: b }) => { - let mut merged = a.tail.as_ref().clone(); - merged.push_back(a.head.clone()); - merged.extend(b.tail.iter().cloned()); - merged.push_back(b.head.clone()); - let head = merged.pop_front().unwrap(); - Rc::new(Diagnostics::Some { - diagnostics: Rc::new(NonEmptyDiagnostics { - head, - tail: Rc::new(merged), - }), - }) - } - } -} - -pub fn rejected_with_pending( - pending: Rc, - rejected: Rc, -) -> Rc { - match pending.as_ref() { - Diagnostics::None => rejected, - Diagnostics::Some { diagnostics: p } => { - let mut merged = p.tail.as_ref().clone(); - merged.push_back(p.head.clone()); - merged.extend(rejected.tail.iter().cloned()); - merged.push_back(rejected.head.clone()); - let head = merged.pop_front().unwrap(); - Rc::new(NonEmptyDiagnostics { - head, - tail: Rc::new(merged), - }) - } - } -} - -pub fn outcome_accepted(value: T) -> Rc> { - Rc::new(Outcome::Accepted { - value, - diagnostics: Rc::new(Diagnostics::None), - }) -} - -pub fn outcome_rejected(d: Rc) -> Rc> { - Rc::new(Outcome::Rejected { - diagnostics: diagnostics_singleton(d), - }) -} - -pub fn bind_outcome(o: Rc>, f: F) -> Rc> -where - F: Fn(T) -> Rc> + Clone, -{ - match &*o { - Outcome::Accepted { value, .. } => f(value.clone()), - Outcome::Rejected { diagnostics } => Rc::new(Outcome::Rejected { - diagnostics: diagnostics.clone(), - }), - } -} diff --git a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_integer.rs b/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_integer.rs deleted file mode 100644 index dd46ee67bcd..00000000000 --- a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_integer.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Shared std-bridge shim — curated minimal v2.std.integer surface. -// -// AUTHORITY: src/v2/std/integer.dag (Int = GroupCompletion, per dag/std/algebra.dag). -// -// WHY A SHIM AND NOT THE EMITTED MODULE: the emitted v2_std_integer.rs is a closure-projection -// stub that reads `use crate::std_nat::Nat;`, but the emitted lib.rs never declares -// `pub mod std_nat` — the closure manifest omits std_nat while the stub that needs it is -// emitted anyway. That is an emitter closure-projection defect, not shim drift, and it is NOT -// fixed here. Receipt (2026-07-29): building any of these transports with a derived whole- -// closure lib.rs instead of its narrow hand manifest reds on exactly -// `error[E0432]: unresolved import crate::std_nat --> src/v2_std_integer.rs:6:12`. That is -// also why the narrow hand lib.rs files are load-bearing and stay: they declare WHICH emitted -// modules participate, so an unshimmed broken stub is never compiled. -// -// REPRESENTATION DIVERGENCE (deliberate, and narrow): its one consumer today is the -// 03_normalize row, whose narrow lib re-exports `Int` without using it in a typed position, so -// the checkpoint -// scalar rendering (rust_scalar_checkpoint_reference_base, Int -> i64) is sufficient here and -// keeps the bridge free of the Nat coproduct. If a consumer ever uses Int in a typed position -// this alias is wrong and must be grounded on the real GroupCompletion pair construction. -// -// dissolve-on: emitted closure declares std_nat alongside the stub that imports it; then this -// file is deleted and the emitted module is used directly. -pub type Int = i64; diff --git a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs b/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs deleted file mode 100644 index 49090ce730a..00000000000 --- a/dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs +++ /dev/null @@ -1,182 +0,0 @@ -// Shared std-bridge shim — curated minimal v2.std.node surface. -// -// AUTHORITY: src/v2/std/node.dag. Hand-authored scaffold; see the header of -// v2_std_diagnostic.rs in this directory for why the bridge exists, what dissolves it, and -// why drift against the authority is caught only by the wet receipt's cargo build today. -use im::{vector as vec, Vector as Vec}; -use std::rc::Rc; - -pub type Symbol = String; - -// src/v2/std/node.dag:7 `type Hash = ContentHash` -// dag/std/types.dag:164 `type ContentHash = NonEmptyStr where brand("ContentHash")` -pub type Hash = String; - -// src/v2/std/node.dag:9 `type OccurrenceId = std.occurrence_identity.OccurrenceId` -// dag/std/occurrence_identity.dag:22 `type OccurrenceId { value: Int }` -// -// Modeled as the real record, NOT as the emitted form. The emitter currently renders this -// alias as `pub struct OccurrenceId(pub std::marker::PhantomData<()>)` — the hollow-alias / -// checkpoint_scalar_phantom class DESIGN.md tracks as a defect — so copying the emitted shape -// here would enshrine it in a second representation. -#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] -pub struct OccurrenceId { - pub value: i64, -} - -// AUTHORITY: dag/std/occurrence_identity.dag `NodeOccurrenceIdentity`. v2.std.node no longer -// declares an occurrence carrier of its own -- the compatibility coproduct and its two conversions -// are deleted -- so `Node.occurrence_id` is this shared carrier directly. The projected arm's -// `caused_by` payload (`ScopedOccurrenceRef`) is not modeled in this curated shim because nothing -// on the bridge constructs or reads it; the arm is carried so a decoded projected occurrence -// refuses here instead of silently landing in a two-arm enum. -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum NodeOccurrenceIdentity { - OccurrenceSynthetic, - OccurrenceMinted { id: OccurrenceId }, - OccurrenceProjected { id: OccurrenceId }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Connective { - Atom { identity: String }, - Conj, - Disj, - Arrow, - Cardinality, - Instantiation, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum Behavior { - Value, - Transform, - Branch, - Loop, - Bind, - Match, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum NodeKind { - TypeNode { connective: Rc }, - ComputationNode { behavior: Behavior }, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum EdgeLabel { - Named { name: String }, - Positional, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -pub struct Edge { - pub label: Rc, - pub target: Rc, -} - -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -pub struct Node { - pub kind: Rc, - pub children: Rc>>, - pub occurrence_id: Rc, -} - -pub fn node_synthetic(kind: Rc, children: Rc>>) -> Rc { - Rc::new(Node { - kind, - children, - occurrence_id: Rc::new(NodeOccurrenceIdentity::OccurrenceSynthetic), - }) -} - -pub fn node_rebuild(n: Rc, children: Rc>>) -> Rc { - Rc::new(Node { - kind: n.kind.clone(), - children, - occurrence_id: n.occurrence_id.clone(), - }) -} - -// src/v2/std/node.dag:568 `fn well_formed(n: Node) -> Bool` -// -// UNION OF BODIES, not just of names. The two per-transport copies this bridge replaces -// DISAGREED here: body_producer's was `let _ = n; true` and 03_normalize's carried the real -// root check below. Taking the weaker one would have been a §5 fail-open on a fail-closed -// path — emitted 03_normalize gates graft output on `well_formed` and raises -// `post_normalize_not_well_formed_diagnostic` on false, so an always-true stub lets a -// malformed empty Conj/Disj through the normalize gate in the seed-linked Rust path. -// The name-superset check that cleared the other eleven replacements does NOT catch this -// class: both copies define `well_formed`, and only the bodies differ. Bodies are compared -// too now (review 44739 found this one). -// -// RESIDUAL GAP vs the authority, stated rather than implied: the authority folds -// `locally_well_formed` over the whole tree (`connective_edges_conform` / -// `behavior_edges_conform` per node). This carries the strongest surviving SHIM behavior — -// a root-level non-emptiness check — not that fold. It is strictly stronger than -// either copy it replaces and strictly weaker than the authority. -// dissolve-on: emitted v2 std closure compiles; then the authority's fold is used directly. -// -// THE CATCH-ALL IS GONE, AND IT WAS NOT COSMETIC. `_ => true` answered well-formed for -// `Cardinality` and `Instantiation`, and the authority `connective_edges_conform` requires -// `count(children) >= 1` for BOTH — so an empty node of either form passed a check the -// authority fails. That is the same §5 fail-open this shim's own header says it exists to -// prevent, one connective away from the case review 44739 caught, and a wildcard is exactly -// what hid it: the two forms were never named here, so no reader could see they were -// unanswered. Every form is now named, which also means a new `Connective` member in -// `v2.std.node` stops this compile instead of being silently admitted as well-formed. -// -// `Arrow` remains `true` and that is a DECLARED residue, not an answer: the authority routes -// it to `arrow_body_edges_conform`, which this bridge does not carry, and inventing a weaker -// arrow rule here would be a second authority for the same fact. It is named rather than -// absorbed into a wildcard so the gap is countable. -pub fn well_formed(n: Rc) -> bool { - match n.kind.as_ref() { - NodeKind::TypeNode { connective } => match connective.as_ref() { - Connective::Atom { .. } => true, - Connective::Conj | Connective::Disj => !n.children.is_empty(), - Connective::Cardinality | Connective::Instantiation => !n.children.is_empty(), - Connective::Arrow => true, - }, - NodeKind::ComputationNode { .. } => true, - } -} - -// src/v2/std/node.dag:355 `type NamedEdgeTargetLookup = Found { target: Node } | Ambiguous | Absent` -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] -#[serde(tag = "_variant")] -pub enum NamedEdgeTargetLookup { - Found { target: Rc }, - Ambiguous, - Absent, -} - -// src/v2/std/node.dag:360 `fn named_edge_target_lookup(children: List, name: Symbol)` -pub fn named_edge_target_lookup( - children: Rc>>, - name: Symbol, -) -> Rc { - children - .iter() - .cloned() - .fold(Rc::new(NamedEdgeTargetLookup::Absent), |acc, e| { - match (&*e.label, &*acc) { - (EdgeLabel::Named { name: sym }, NamedEdgeTargetLookup::Absent) - if sym == &name => - { - Rc::new(NamedEdgeTargetLookup::Found { - target: e.target.clone(), - }) - } - (EdgeLabel::Named { name: sym }, _) if sym == &name => { - Rc::new(NamedEdgeTargetLookup::Ambiguous) - } - _ => acc, - } - }) -} diff --git a/dag/gunbc/instruments/self_host_use_site_verdict_shims/lib.rs b/dag/gunbc/instruments/self_host_use_site_verdict_shims/lib.rs deleted file mode 100644 index f53b62d9b79..00000000000 --- a/dag/gunbc/instruments/self_host_use_site_verdict_shims/lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -// seed-linked pilot lib — entry module self-emitted, seed-retained dep shim -#![allow(clippy::all, dead_code, unused_imports)] -#![recursion_limit = "256"] -pub mod v1_rt; -pub mod v2_std_node; -pub mod v2_std_algebra; -pub mod v2_std_collection; -pub mod v2_compiler_use_site_verdict; -pub use v1_compiler::NonEmptyVec; -pub use v1_compiler::NonEmptyBTreeSet; diff --git a/dag/gunbc/recurring_failure_mode/hand_shim_shadows_an_emitted_module.dag b/dag/gunbc/recurring_failure_mode/hand_shim_shadows_an_emitted_module.dag new file mode 100644 index 00000000000..51e9f504606 --- /dev/null +++ b/dag/gunbc/recurring_failure_mode/hand_shim_shadows_an_emitted_module.dag @@ -0,0 +1,18 @@ +module gunbc.recurring_failure_mode.hand_shim_shadows_an_emitted_module + +import std.types { NonEmptyStr } +import std.decl_ref { DeclarationRef, WholeDeclaration } +import gunbc.recurring_failure_mode { RecurringFailureMode } + +data hand_shim_shadows_an_emitted_module: RecurringFailureMode = RecurringFailureMode { + identity: "hand_shim_shadows_an_emitted_module" as NonEmptyStr, + + receipts: [ + "**a hand-authored Rust copy of a .dag module is substituted for the emitted one, and when the emitter evolves the copy silently stops matching both the emitter and the authority** (INVALID STATE: tools.self_host_module_behavioral_transport_roster rows overwrote emitted modules with hand shims -- a shared std-bridge directory (v2_std_node, v2_std_algebra, v2_std_collection, v2_std_diagnostic, v2_std_integer) plus per-row shim lib.rs files -- so the self-host behavioral receipts linked a crate that was neither the emitter's output nor the .dag's meaning. HARM, THREE MEASURED FACES: (1) self_host_03_normalize_behavioral_receipt_holds was red for 13 E0308 because the v2_std_diagnostic shim, last touched in #10929, still spelled Diagnostics as `enum Diagnostics` with `rejected_with_pending(pending: Rc, ..)` after the emitter moved the None | Some coproduct to Option>; the red was read as an EMITTER defect (value/Rc boundary at call sites) and briefed as one, while the emitted crate alone cargo-checked clean. (2) The lax v2_std_node shim kept a MALFORMED fixture green: the body_producer driver's Transform body carried zero edges, which v2.std.node behavior_edges_conform refuses (Transform needs count(children) >= 1); against the emitted module the fixture is refused. (3) The same slice hid a hollow ORACLE: the seed's hand-retained v1_compiler::v2_compiler_normalize answered well_formed = true for every tree, and the old fault input (an empty Disj) is accepted by both realizations, so the 03_normalize fault arm was red whichever way emitted normalize behaved -- parity with a stub that accepts everything is not evidence. DISTINGUISHING FACTS: the shim is a SECOND realization of a module whose authority is a .dag file, so it is the section 3 fork at the realization layer; nothing ties its bytes to the emitter, so it drifts on every emitter change that touches the module's shape, and it fails in whichever direction the drift points -- toward a compile red that blames the emitter, or toward a laxer check that greens a wrong input. The dissolution trigger the bridge carried ('v2 std self-emits and gunbc emits seed-linked extern imports without hand ABI bridges') had already fired and nothing read it. RECOGNITION RULE: when a witness builds 'the emitted X', read the assembly and ask which bytes of X the emitter actually produced; any file written from the repository over an emitted path is a hand realization and is presumed stale. When a behavioral receipt compares against a hand oracle, run one input the authority REFUSES through both sides before trusting parity. RUNG FOUND AT: silent -- the receipts are outside the required lane, so the red sat on main unnoticed. RUNG NOW, FOR THE ROSTER: structurally impossible -- every shim row was censused (emitted closure builds and the driver passes with no shim), the shims were deleted, and ModuleBehavioralTransportConfig / cssl_seed_linked_behavioral_receipt no longer carry shim_lib_rel or shim_writes, so a row cannot name a shim. CEILING AND RESIDUE: the class survives one layer down, in the seed's other hand-retained oracles (v1_compiler v2_compiler_body_producer, v2_compiler_parse_engine_hooks, v2_compiler_use_site_verdict, v2_compiler_target_carriers, v2_compiler_discovery_enumeration) that the remaining receipts compare against; each is a hand realization that can be laxer than its authority exactly as v2_compiler_normalize was. NEXT-RUNG TRIGGER: the behavioral oracle is the v1 interpreter's evaluation of the SAME .dag entry rather than a hand-retained Rust module, sufficient that no receipt's expected value can come from a copy of the module under test. Replacing one stub with a better stub does not discharge it.)", + ], + + evidence: [ + DeclarationRef { module_path: "tools.self_host_curated_seed_linked_harness", decl_name: "cssl_seed_linked_behavioral_receipt", field: WholeDeclaration }, + DeclarationRef { module_path: "tools.self_host_module_behavioral_transport_roster", decl_name: "ModuleBehavioralTransportConfig", field: WholeDeclaration }, + ], +} diff --git a/dag/gunbc/seed_closed_vocabulary_wildcard_census.dag b/dag/gunbc/seed_closed_vocabulary_wildcard_census.dag index 29f1fd40e99..b0eeaec9370 100644 --- a/dag/gunbc/seed_closed_vocabulary_wildcard_census.dag +++ b/dag/gunbc/seed_closed_vocabulary_wildcard_census.dag @@ -178,18 +178,6 @@ data seed_closed_vocabulary_wildcard_sites: List = [ disposition: FabricatedSubstitution { substituted: "the empty string, now announced per occurrence as a located [extdeps-argv-unprojectable] line rather than absorbed silently" }, next_trigger: "ExtdepsTransportArgvFact carries a typed projection (ProjectedToken / UnprojectableForm) the way the materialization row already does, and the policy fold reads it -- at which point the empty string is unwritable and the boundary refuses. THE HARD REFUSAL WAS BUILT AND DELIBERATELY NOT LANDED: it stops corpus_git_policy_leak_defused_holds, and that red is not closable by the author who causes it, because the argv-call population is another lane's counted debt. A wall whose only reachable green is someone else's modelling change is not a wall this change may raise" }, - SeedWildcardSite { - file: "dag/gunbc/instruments/self_host_std_bridge_shims/v2_std_node.rs", - symbol: "well_formed", - vocabulary_authority: [ - DeclarationRef { module_path: "v2.std.node", decl_name: "Connective", field: WholeDeclaration }, - ], - unhandled_forms: "Cardinality and Instantiation were answered well-formed; both are now checked, and Arrow is named as a declared residue", - reachability: "the arm was reachable for any node of either form; no run was watched reaching it, so the defect is established against the authority rather than against an observed input", - harm: "CLOSED by this change. The authority connective_edges_conform requires count(children) >= 1 for BOTH Cardinality and Instantiation, so an empty node of either form passed a check the authority fails -- a fail-open in the seed-linked normalize gate, one connective away from the case review 44739 caught in the same function", - disposition: EveryFormNamed, - next_trigger: "Arrow still answers true because the authority routes it to arrow_body_edges_conform, which this bridge does not carry; it dissolves with the bridge itself when the emitted v2 std closure compiles and the authority's fold is used directly" - }, SeedWildcardSite { file: "src/v1/stage0/src/v2_compiler_target_carriers.rs", symbol: "target_fidelity_quotient_optional", diff --git a/dag/gunbc/stage0/stage0_crate_layout_generated.dag b/dag/gunbc/stage0/stage0_crate_layout_generated.dag index ae3ba2b1705..d1e61a1efe5 100644 --- a/dag/gunbc/stage0/stage0_crate_layout_generated.dag +++ b/dag/gunbc/stage0/stage0_crate_layout_generated.dag @@ -4,7 +4,7 @@ import std.types { List, String } data stage0_crate_layout_generated_note: String = "Generated by gunbc stage0_crate_layout_emit — do not hand-edit. Authority: v2.compiler.self_host.stage0_crate_layout; regen via dag/gunbc/instruments/generated_artifact_gate.dag main_wet." -data generated_pub_mod_block: String = "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod gunbc_file_transport_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod memory_governor;\npub mod module_path_index;\npub mod v2_compiler_body_producer;\npub mod v2_compiler_normalize;\npub mod v2_compiler_target_carriers;\npub mod v2_compiler_discovery_enumeration;\npub mod v2_compiler_parse_engine_hooks;\npub mod v2_compiler_use_site_verdict;\npub mod process_group;\npub mod v2_compiler_compile;\npub mod v2_compiler_program_assembly;\npub mod v2_compiler_source_authority;\npub mod std_logic;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;\npub mod evaluation_budget_consequence_generated;\npub mod release_locus_seed_constants_generated;" +data generated_pub_mod_block: String = "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod gunbc_file_transport_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod memory_governor;\npub mod module_path_index;\npub mod v2_compiler_body_producer;\npub mod v2_compiler_target_carriers;\npub mod v2_compiler_discovery_enumeration;\npub mod v2_compiler_parse_engine_hooks;\npub mod v2_compiler_use_site_verdict;\npub mod process_group;\npub mod v2_compiler_compile;\npub mod v2_compiler_program_assembly;\npub mod v2_compiler_source_authority;\npub mod std_logic;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;\npub mod evaluation_budget_consequence_generated;\npub mod release_locus_seed_constants_generated;" data generated_pub_mod_basenames: List = [ "v1_interpreter", @@ -19,7 +19,6 @@ data generated_pub_mod_basenames: List = [ "memory_governor", "module_path_index", "v2_compiler_body_producer", - "v2_compiler_normalize", "v2_compiler_target_carriers", "v2_compiler_discovery_enumeration", "v2_compiler_parse_engine_hooks", @@ -59,7 +58,6 @@ data generated_stage0_filenames: List = [ "memory_governor.rs", "namespace_baseline.rs", "v2_compiler_body_producer.rs", - "v2_compiler_normalize.rs", "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", diff --git a/dag/test/claim/emission_entry_instrument_witness_test.dag b/dag/test/claim/emission_entry_instrument_witness_test.dag index 05e74ee931a..b2db4112cf9 100644 --- a/dag/test/claim/emission_entry_instrument_witness_test.dag +++ b/dag/test/claim/emission_entry_instrument_witness_test.dag @@ -428,7 +428,7 @@ data specimen_subject: EmissionMeasurementSubject = EmissionMeasurementSubject { working_tree: WorkingTreeClean, compiler: sha256_digest(hex: "aa" as NonEmptyStr), assembler: sha256_digest(hex: "bb" as NonEmptyStr), - assembly_mode: SeedLinkedAssembly { std_bridge_dir: "dag/gunbc/instruments/self_host_std_bridge_shims" } + assembly_mode: SeedLinkedAssembly } data unreached_specimen: EmissionMeasurement = EmissionSubjectUnestablished { diff --git a/dag/test/claim/emit_subject_clean_frontier_witness_test.dag b/dag/test/claim/emit_subject_clean_frontier_witness_test.dag index b9a28e074f0..a70a12dc0fb 100644 --- a/dag/test/claim/emit_subject_clean_frontier_witness_test.dag +++ b/dag/test/claim/emit_subject_clean_frontier_witness_test.dag @@ -990,7 +990,7 @@ fn fixture_subject(revision: String, compiler_hex: String, tree: WorkingTreeStan working_tree: tree, compiler: sha256_digest(hex: compiler_hex as NonEmptyStr), assembler: sha256_digest(hex: "bbbb" as NonEmptyStr), - assembly_mode: SeedLinkedAssembly { std_bridge_dir: "dag/std" } + assembly_mode: SeedLinkedAssembly } } @@ -1310,7 +1310,7 @@ test fn a_population_scoped_measurement_does_not_match_a_roster_entry() -> Bool working_tree: WorkingTreeClean, compiler: sha256_digest(hex: "aaaa" as NonEmptyStr), assembler: sha256_digest(hex: "bbbb" as NonEmptyStr), - assembly_mode: SeedLinkedAssembly { std_bridge_dir: "dag/std" } + assembly_mode: SeedLinkedAssembly } emission_subject_entry_text(s: population_subject) != fixture_alpha } diff --git a/dag/test/claim/self_host_03_normalize_behavioral_witness_test.dag b/dag/test/claim/self_host_03_normalize_behavioral_witness_test.dag index 7e6117a1e56..e3109452230 100644 --- a/dag/test/claim/self_host_03_normalize_behavioral_witness_test.dag +++ b/dag/test/claim/self_host_03_normalize_behavioral_witness_test.dag @@ -11,7 +11,7 @@ data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly // Wet self-host behavioral receipt probe for Gate-A flip (03_normalize): // tools.self_host_module_behavioral_transport_roster's compiler_module_behavioral_receipt_for emits // src/v2/compiler/03_normalize.dag via gunbc --entry, assembles curated seed-linked v1_compiled -// (emitted entry + dep shims + v1-compiler path dep), runs cargo build + witness (plain + +// (the whole emitted closure + v1-compiler path dep), runs cargo build + witness (plain + // --inject-fault). ROUTE STANDING (2026-08-26): this row previously said it was enrolled on the // nightly falsifier when its frontier row was SelfEmitted. Both things it named are gone -- // falsifier.yml was deleted at 611fd02770/#8283 on 2026-08-15 and the self-host frontier roster no @@ -29,5 +29,5 @@ test fn self_host_03_normalize_behavioral_receipt_holds() -> Bool { } test fn self_host_03_normalize_declared_source_refs_complete_holds() -> Bool { - length(xs: declared_source_refs) == 16 + length(xs: declared_source_refs) == 2 } diff --git a/dag/test/claim/self_host_body_producer_behavioral_witness_test.dag b/dag/test/claim/self_host_body_producer_behavioral_witness_test.dag index 5c3412be0d5..bfe10f2c270 100644 --- a/dag/test/claim/self_host_body_producer_behavioral_witness_test.dag +++ b/dag/test/claim/self_host_body_producer_behavioral_witness_test.dag @@ -5,7 +5,7 @@ import tools.self_host_module_behavioral_transport_roster { compiler_module_beha // Wet self-host behavioral receipt probe for Wave 2 easy-flip lane (03_body_producer): // tools.self_host_module_behavioral_transport_roster's compiler_module_behavioral_receipt_for emits // src/v2/compiler/03_body_producer.dag via gunbc --entry, assembles a seed-linked v1_compiled crate -// (gunbc-emitted entry + dep shims + v1-compiler path dep), runs cargo build + witness (plain + +// (the whole emitted closure + v1-compiler path dep), runs cargo build + witness (plain + // --inject-fault), and claim-run on structured_body_dispatch. Live host effects, so it is // CLASSIFIED onto the falsifier Wet batch when the frontier row is SelfEmitted with binding -- and // classification is membership, not execution (corrected 2026-09-01, matching diff --git a/src/v1/stage0/src/bin/cssl_assemble.rs b/src/v1/stage0/src/bin/cssl_assemble.rs index 19482ea5eff..d44a3d5ab54 100644 --- a/src/v1/stage0/src/bin/cssl_assemble.rs +++ b/src/v1/stage0/src/bin/cssl_assemble.rs @@ -1,4 +1,4 @@ -//! CLI for generic seed-shim closure assembly (curated self-host harness). +//! CLI for whole-emitted-closure assembly (curated self-host harness). #![allow(clippy::disallowed_macros)] use clap::Parser; @@ -18,26 +18,16 @@ struct Args { entry_dag: PathBuf, #[arg(long)] root: PathBuf, - #[arg( - long, - default_value = "dag/gunbc/instruments/self_host_std_bridge_shims" - )] - std_bridge_dir: PathBuf, } fn main() { let args = Args::parse(); - let std_bridge = if args.std_bridge_dir.is_absolute() { - args.std_bridge_dir - } else { - args.root.join(args.std_bridge_dir) - }; let entry_dag = if args.entry_dag.is_absolute() { args.entry_dag } else { args.root.join(args.entry_dag) }; - match assemble_seed_linked_closure(&args.out_dir, &entry_dag, &std_bridge) { + match assemble_seed_linked_closure(&args.out_dir, &entry_dag) { Ok(()) => { println!("CSSL_ASSEMBLE: PASS"); } diff --git a/src/v1/stage0/src/bootstrap_seed_retention_frontier_generated.rs b/src/v1/stage0/src/bootstrap_seed_retention_frontier_generated.rs index 02ea7d62dbe..8ba92c46f7f 100644 --- a/src/v1/stage0/src/bootstrap_seed_retention_frontier_generated.rs +++ b/src/v1/stage0/src/bootstrap_seed_retention_frontier_generated.rs @@ -21,7 +21,6 @@ pub const SEED_RETENTION_FRONTIER_TOP_LEVEL_SRC_BASENAMES: &[&str] = &[ "derived_realization_schedule.rs", "memory_governor.rs", "v2_compiler_body_producer.rs", - "v2_compiler_normalize.rs", "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", diff --git a/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs b/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs index 76ddf6b4903..ea01c200a1f 100644 --- a/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs @@ -20,7 +20,6 @@ pub const HAND_MAINTAINED_STAGE0_FILES: &[&str] = &[ "memory_governor.rs", "namespace_baseline.rs", "v2_compiler_body_producer.rs", - "v2_compiler_normalize.rs", "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", diff --git a/src/v1/stage0/src/cssl_seed_linked_closure_assembly.rs b/src/v1/stage0/src/cssl_seed_linked_closure_assembly.rs index 35b4c69a8d8..e4cc714de70 100644 --- a/src/v1/stage0/src/cssl_seed_linked_closure_assembly.rs +++ b/src/v1/stage0/src/cssl_seed_linked_closure_assembly.rs @@ -1,4 +1,4 @@ -//! Generic seed-shim assembly for curated self-host behavioral receipts. +//! Whole-emitted-closure assembly for curated self-host behavioral receipts. //! Authority: tools.self_host_curated_seed_linked_harness (5-arm design). //! dissolve-on: v2 std self-emits + gunbc emits seed-linked extern imports. @@ -159,11 +159,7 @@ fn declared_emitted_paths(manifest: &Path) -> Result, AssemblyError> /// `closure_compiler_mod_stays_emit_retained` stays enrolled as the regression control for that /// climb (DESIGN 4b(4)): a compiler-family closure member keeps its emitted bytes and never /// becomes a `pub use v1_compiler::` re-export. -pub fn assemble_seed_linked_closure( - out_dir: &Path, - entry_dag: &Path, - _std_bridge_dir: &Path, -) -> Result<(), AssemblyError> { +pub fn assemble_seed_linked_closure(out_dir: &Path, entry_dag: &Path) -> Result<(), AssemblyError> { let src_dir = out_dir.join("src"); let manifest_path = src_dir.join(emitted_population_manifest_basename()); let entry_mod = dag_entry_rust_module(entry_dag)?; @@ -279,14 +275,12 @@ mod tests { base } - fn entry_dag_and_bridge(root: &Path, stem: &str, module: &str) -> (PathBuf, PathBuf) { + fn entry_dag(root: &Path, stem: &str, module: &str) -> PathBuf { let repo = root.join("repo"); let dag = repo.join(format!("src/v2/compiler/{stem}.dag")); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, format!("module {module}\n")).expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - (dag, bridge) + dag } #[test] @@ -306,9 +300,7 @@ mod tests { let dag = repo.join("src/v2/compiler/01_tokenize.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.tokenize\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(out.join("src/std_error_primitives.rs")).expect("read"); assert!(kept.contains("emitted std_error_primitives")); } @@ -348,9 +340,7 @@ mod tests { let dag = repo.join("src/v2/compiler/04_infer.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.infer\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(src.join("v2_compiler_resolve.rs")).expect("read"); assert!( kept.contains("pub struct ResolvedTree"), @@ -389,9 +379,7 @@ mod tests { let dag = repo.join("src/v2/compiler/01_tokenize.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.tokenize\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(src.join("v2_compiler_resolve.rs")).expect("read"); assert!( kept.contains("broken_syntax"), @@ -427,9 +415,7 @@ mod tests { let dag = repo.join("src/v2/compiler/self_host.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.self_host\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(out.join("src/extdeps_communication_medium.rs")).expect("read"); assert!(kept.contains("emitted extdeps_communication_medium")); @@ -448,9 +434,7 @@ mod tests { let dag = repo.join("src/v2/compiler/self_host.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.self_host\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(out.join("src/dry_run.rs")).expect("read"); assert!(kept.contains("emitted dry_run")); } @@ -468,9 +452,7 @@ mod tests { let dag = repo.join("src/v2/compiler/03_name_resolve.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.name_resolve\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(out.join("src/gunbc_plans_md_helpers.rs")).expect("read"); assert!(kept.contains("emitted gunbc_plans_md_helpers")); } @@ -491,9 +473,7 @@ mod tests { let dag = repo.join("src/v2/compiler/05_emit.dag"); fs::create_dir_all(dag.parent().unwrap()).expect("dag dir"); fs::write(&dag, "module v2.compiler.emit\n").expect("dag"); - let bridge = repo.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - fs::create_dir_all(&bridge).expect("bridge"); - assemble_seed_linked_closure(&out, &dag, &bridge).expect("assemble"); + assemble_seed_linked_closure(&out, &dag).expect("assemble"); let kept = fs::read_to_string(out.join("src/test_claim_materialization_ladder_witness.rs")) .expect("read"); assert!(kept.contains("emitted test_claim_materialization_ladder_witness")); @@ -520,8 +500,8 @@ mod tests { ], ) .expect("manifest"); - let (dag, bridge) = entry_dag_and_bridge(&root, "01_tokenize", "v2.compiler.tokenize"); - let err = assemble_seed_linked_closure(&out, &dag, &bridge).unwrap_err(); + let dag = entry_dag(&root, "01_tokenize", "v2.compiler.tokenize"); + let err = assemble_seed_linked_closure(&out, &dag).unwrap_err(); match err { AssemblyError::RefusedDeclaredMember { declared_path, @@ -544,8 +524,8 @@ mod tests { fs::create_dir_all(&src).expect("src"); fs::write(out.join("src/lib.rs"), "pub mod v2_compiler_tokenize;\n").expect("lib"); fs::write(src.join("v2_compiler_tokenize.rs"), "// entry\n").expect("entry"); - let (dag, bridge) = entry_dag_and_bridge(&root, "01_tokenize", "v2.compiler.tokenize"); - match assemble_seed_linked_closure(&out, &dag, &bridge).unwrap_err() { + let dag = entry_dag(&root, "01_tokenize", "v2.compiler.tokenize"); + match assemble_seed_linked_closure(&out, &dag).unwrap_err() { AssemblyError::MissingPopulationManifest { path } => { assert!(path.ends_with(emitted_population_manifest_basename())); } @@ -568,139 +548,12 @@ mod tests { "not a declared line\n", ) .expect("manifest"); - let (dag, bridge) = entry_dag_and_bridge(&root, "01_tokenize", "v2.compiler.tokenize"); - match assemble_seed_linked_closure(&out, &dag, &bridge).unwrap_err() { + let dag = entry_dag(&root, "01_tokenize", "v2.compiler.tokenize"); + match assemble_seed_linked_closure(&out, &dag).unwrap_err() { AssemblyError::EmptyPopulationManifest { path } => { assert!(path.ends_with(emitted_population_manifest_basename())); } other => panic!("expected EmptyPopulationManifest, got {other:?}"), } } - - /// RED control for 03_normalize wet-receipt shim refresh: dropping `pub mod - /// v2_compiler_namespace_graft` from the narrow hand lib must refuse cargo. - #[test] - fn normalize_stale_narrow_lib_without_namespace_graft_refuses_cargo() { - let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let root = manifest - .parent() - .and_then(|p| p.parent()) - .and_then(|p| p.parent()) - .expect("repo root") - .to_path_buf(); - let gunbc = root.join("target/release/gunbc"); - let assemble_bin = root.join("target/release/cssl_assemble"); - let shim_dir = root.join("dag/gunbc/instruments/self_host_03_normalize_shims"); - if !gunbc.is_file() || !assemble_bin.is_file() || !shim_dir.is_dir() { - panic!( - "release bins or shim dir missing (gunbc={}, assemble={}, shims={})", - gunbc.is_file(), - assemble_bin.is_file(), - shim_dir.is_dir() - ); - } - let out = - std::env::temp_dir().join(format!("cssl_normalize_stale_red_{}", std::process::id())); - let _ = fs::remove_dir_all(&out); - let compile_status = std::process::Command::new(&gunbc) - .args([ - "compile", - "--source-root", - "dag", - "--source-root", - "src/v2", - "--entry", - "src/v2/compiler/03_normalize.dag", - "--output-dir", - &out.to_string_lossy(), - "--target", - "rust", - "--dependency-pool-index", - "primary-precedence", - ]) - .current_dir(&root) - .output() - .expect("gunbc compile spawn"); - if !compile_status.status.success() { - panic!( - "RED-control setup refused: gunbc compile failed (exit={:?}):\n{}\n{}", - compile_status.status.code(), - String::from_utf8_lossy(&compile_status.stdout), - String::from_utf8_lossy(&compile_status.stderr) - ); - } - let assemble_status = std::process::Command::new(&assemble_bin) - .args([ - "--out-dir", - &out.to_string_lossy(), - "--entry-dag", - "src/v2/compiler/03_normalize.dag", - "--root", - &root.to_string_lossy(), - "--std-bridge-dir", - "dag/gunbc/instruments/self_host_std_bridge_shims", - ]) - .current_dir(&root) - .output() - .expect("cssl_assemble spawn"); - if !assemble_status.status.success() { - panic!( - "RED-control setup refused: cssl_assemble failed (exit={:?}):\n{}\n{}", - assemble_status.status.code(), - String::from_utf8_lossy(&assemble_status.stdout), - String::from_utf8_lossy(&assemble_status.stderr) - ); - } - // Mirror the roster row's shim writes: shared std surface from the std-bridge (one - // authority, not one copy per transport), the rest from this transport's shim dir. - // Copying only shim_dir would leave emitted std stubs in place and the control would - // refuse for the wrong reason -- the assertion is about the dropped - // `pub mod v2_compiler_namespace_graft`, not a broken std surface. - let std_bridge_dir = root.join("dag/gunbc/instruments/self_host_std_bridge_shims"); - for dir in [&std_bridge_dir, &shim_dir] { - for entry in fs::read_dir(dir).expect("shim dir") { - let entry = entry.expect("entry"); - let name = entry.file_name(); - let name = name.to_string_lossy(); - if name == "lib.rs" || name == "witness_main.rs" { - continue; - } - fs::copy(entry.path(), out.join("src").join(name.as_ref())).expect("copy shim"); - } - } - let stale_lib = "// stale RED control — namespace_graft pub mod deliberately dropped\n\ - #![allow(clippy::all, dead_code, unused_imports)]\n\ - pub use v1_compiler::NonEmptyVec;\n\ - pub use v1_compiler::NonEmptyBTreeSet;\n\ - pub use v1_compiler::v1_rt;\n\ - pub mod std_algebra;\npub mod std_types;\npub mod v2_std_integer;\n\ - pub mod v2_std_algebra;\npub mod v2_std_collection;\npub mod v2_std_grammar;\n\ - pub mod v2_std_diagnostic;\npub mod v2_std_node;\npub mod v2_std_compilers_sugar;\n\ - pub mod v2_compiler_body_lowering_fold;\npub mod v2_compiler_normalized_tree;\n\ - pub mod v2_extdeps_languages_dag;\npub mod v2_compiler_normalize;\n"; - fs::write(out.join("src/lib.rs"), stale_lib).expect("stale lib"); - fs::write( - out.join("Cargo.toml"), - format!( - "[package]\nname = \"stale_red\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n\ - [lib]\npath = \"src/lib.rs\"\n\n[dependencies]\n\ - im = {{ version = \"15.1\", features = [\"serde\"] }}\n\ - v1-compiler = {{ path = \"{}\" }}\n", - root.join("src/v1/stage0").display() - ), - ) - .expect("cargo"); - let status = std::process::Command::new("cargo") - .args(["build", "--lib"]) - .current_dir(&out) - .env("RUSTC_WRAPPER", "") - .env("CTRL_BUILD_WRAP_CARGO", "0") - .status() - .expect("cargo"); - assert!( - !status.success(), - "stale narrow lib without namespace_graft must refuse cargo" - ); - let _ = fs::remove_dir_all(&out); - } } diff --git a/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs b/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs index 14f041563b1..d16c4b58179 100644 --- a/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs @@ -21,7 +21,7 @@ pub fn stage0_crate_layout_generated_note() -> String { pub fn generated_pub_mod_block() -> String { thread_local! { static CACHED: String = { - "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod gunbc_file_transport_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod memory_governor;\npub mod module_path_index;\npub mod v2_compiler_body_producer;\npub mod v2_compiler_normalize;\npub mod v2_compiler_target_carriers;\npub mod v2_compiler_discovery_enumeration;\npub mod v2_compiler_parse_engine_hooks;\npub mod v2_compiler_use_site_verdict;\npub mod process_group;\npub mod v2_compiler_compile;\npub mod v2_compiler_program_assembly;\npub mod v2_compiler_source_authority;\npub mod std_logic;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;\npub mod evaluation_budget_consequence_generated;\npub mod release_locus_seed_constants_generated;".to_string() + "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod gunbc_file_transport_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod memory_governor;\npub mod module_path_index;\npub mod v2_compiler_body_producer;\npub mod v2_compiler_target_carriers;\npub mod v2_compiler_discovery_enumeration;\npub mod v2_compiler_parse_engine_hooks;\npub mod v2_compiler_use_site_verdict;\npub mod process_group;\npub mod v2_compiler_compile;\npub mod v2_compiler_program_assembly;\npub mod v2_compiler_source_authority;\npub mod std_logic;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;\npub mod evaluation_budget_consequence_generated;\npub mod release_locus_seed_constants_generated;".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -30,7 +30,7 @@ pub fn generated_pub_mod_block() -> String { pub fn generated_pub_mod_basenames() -> Rc> { thread_local! { static CACHED: Rc> = { - Rc::new(vec!["v1_interpreter".to_string(), "cli_run".to_string(), "codex_app_server_stdio_session".to_string(), "coproduct_reflection".to_string(), "data_initializer_identity".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "derived_realization_schedule".to_string(), "memory_governor".to_string(), "module_path_index".to_string(), "v2_compiler_body_producer".to_string(), "v2_compiler_normalize".to_string(), "v2_compiler_target_carriers".to_string(), "v2_compiler_discovery_enumeration".to_string(), "v2_compiler_parse_engine_hooks".to_string(), "v2_compiler_use_site_verdict".to_string(), "process_group".to_string(), "v2_compiler_compile".to_string(), "v2_compiler_program_assembly".to_string(), "v2_compiler_source_authority".to_string(), "std_logic".to_string(), "usv_pilot_v2_std_algebra".to_string(), "usv_pilot_v2_std_collection".to_string(), "usv_pilot_v2_std_node".to_string(), "v2_compiler_resolve".to_string(), "v2_compiler_program_partition".to_string(), "v2_compiler_tokenize".to_string(), "v2_compiler_infer".to_string(), "evaluation_budget_consequence_generated".to_string(), "gunbc_file_transport_generated".to_string(), "release_locus_seed_constants_generated".to_string()]) + Rc::new(vec!["v1_interpreter".to_string(), "cli_run".to_string(), "codex_app_server_stdio_session".to_string(), "coproduct_reflection".to_string(), "data_initializer_identity".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "derived_realization_schedule".to_string(), "memory_governor".to_string(), "module_path_index".to_string(), "v2_compiler_body_producer".to_string(), "v2_compiler_target_carriers".to_string(), "v2_compiler_discovery_enumeration".to_string(), "v2_compiler_parse_engine_hooks".to_string(), "v2_compiler_use_site_verdict".to_string(), "process_group".to_string(), "v2_compiler_compile".to_string(), "v2_compiler_program_assembly".to_string(), "v2_compiler_source_authority".to_string(), "std_logic".to_string(), "usv_pilot_v2_std_algebra".to_string(), "usv_pilot_v2_std_collection".to_string(), "usv_pilot_v2_std_node".to_string(), "v2_compiler_resolve".to_string(), "v2_compiler_program_partition".to_string(), "v2_compiler_tokenize".to_string(), "v2_compiler_infer".to_string(), "evaluation_budget_consequence_generated".to_string(), "gunbc_file_transport_generated".to_string(), "release_locus_seed_constants_generated".to_string()]) }; } CACHED.with(|c: &Rc>| c.clone()) @@ -39,7 +39,7 @@ pub fn generated_pub_mod_basenames() -> Rc> { pub fn generated_stage0_filenames() -> Rc> { thread_local! { static CACHED: Rc> = { - Rc::new(vec!["v1_interpreter.rs".to_string(), "bounded_shell_host_drain.rs".to_string(), "cli_run.rs".to_string(), "codex_app_server_stdio_session.rs".to_string(), "coproduct_reflection.rs".to_string(), "data_initializer_identity.rs".to_string(), "declaration_index.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "census_exclude_derive.rs".to_string(), "derived_realization_schedule.rs".to_string(), "memory_governor.rs".to_string(), "namespace_baseline.rs".to_string(), "v2_compiler_body_producer.rs".to_string(), "v2_compiler_normalize.rs".to_string(), "v2_compiler_target_carriers.rs".to_string(), "v2_compiler_discovery_enumeration.rs".to_string(), "v2_compiler_parse_engine_hooks.rs".to_string(), "v2_compiler_use_site_verdict.rs".to_string(), "cssl_seed_linked_closure_assembly.rs".to_string(), "required_regen_host.rs".to_string(), "target_invocation_host.rs".to_string(), "behavioral_receipt_host.rs".to_string(), "partition_crate_boundary_host.rs".to_string(), "generated_artifact_boundary_host.rs".to_string(), "emitted_closure_compile_host.rs".to_string(), "evaluation_budget_consequence_falsifier_host.rs".to_string(), "process_group.rs".to_string(), "v2_compiler_compile.rs".to_string(), "v2_compiler_program_assembly.rs".to_string(), "v2_compiler_source_authority.rs".to_string(), "std_logic.rs".to_string(), "usv_pilot_v2_std_algebra.rs".to_string(), "usv_pilot_v2_std_collection.rs".to_string(), "usv_pilot_v2_std_node.rs".to_string(), "v2_compiler_resolve.rs".to_string(), "v2_compiler_program_partition.rs".to_string(), "v2_compiler_tokenize.rs".to_string(), "v2_compiler_infer.rs".to_string(), "bootstrap_stage0_crate_layout_generated.rs".to_string(), "bootstrap_seed_retention_frontier_generated.rs".to_string(), "v1_interpreter_dispatch_generated.rs".to_string(), "evaluation_budget_consequence_generated.rs".to_string(), "gunbc_file_transport_generated.rs".to_string(), "release_locus_seed_constants_generated.rs".to_string(), "main.rs".to_string()]) + Rc::new(vec!["v1_interpreter.rs".to_string(), "bounded_shell_host_drain.rs".to_string(), "cli_run.rs".to_string(), "codex_app_server_stdio_session.rs".to_string(), "coproduct_reflection.rs".to_string(), "data_initializer_identity.rs".to_string(), "declaration_index.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "census_exclude_derive.rs".to_string(), "derived_realization_schedule.rs".to_string(), "memory_governor.rs".to_string(), "namespace_baseline.rs".to_string(), "v2_compiler_body_producer.rs".to_string(), "v2_compiler_target_carriers.rs".to_string(), "v2_compiler_discovery_enumeration.rs".to_string(), "v2_compiler_parse_engine_hooks.rs".to_string(), "v2_compiler_use_site_verdict.rs".to_string(), "cssl_seed_linked_closure_assembly.rs".to_string(), "required_regen_host.rs".to_string(), "target_invocation_host.rs".to_string(), "behavioral_receipt_host.rs".to_string(), "partition_crate_boundary_host.rs".to_string(), "generated_artifact_boundary_host.rs".to_string(), "emitted_closure_compile_host.rs".to_string(), "evaluation_budget_consequence_falsifier_host.rs".to_string(), "process_group.rs".to_string(), "v2_compiler_compile.rs".to_string(), "v2_compiler_program_assembly.rs".to_string(), "v2_compiler_source_authority.rs".to_string(), "std_logic.rs".to_string(), "usv_pilot_v2_std_algebra.rs".to_string(), "usv_pilot_v2_std_collection.rs".to_string(), "usv_pilot_v2_std_node.rs".to_string(), "v2_compiler_resolve.rs".to_string(), "v2_compiler_program_partition.rs".to_string(), "v2_compiler_tokenize.rs".to_string(), "v2_compiler_infer.rs".to_string(), "bootstrap_stage0_crate_layout_generated.rs".to_string(), "bootstrap_seed_retention_frontier_generated.rs".to_string(), "v1_interpreter_dispatch_generated.rs".to_string(), "evaluation_budget_consequence_generated.rs".to_string(), "gunbc_file_transport_generated.rs".to_string(), "release_locus_seed_constants_generated.rs".to_string(), "main.rs".to_string()]) }; } CACHED.with(|c: &Rc>| c.clone()) diff --git a/src/v1/stage0/src/lib.rs b/src/v1/stage0/src/lib.rs index 262fcf0988f..76ff2375ae1 100644 --- a/src/v1/stage0/src/lib.rs +++ b/src/v1/stage0/src/lib.rs @@ -811,7 +811,6 @@ pub mod v2_compiler_body_producer; pub mod v2_compiler_compile; pub mod v2_compiler_discovery_enumeration; pub mod v2_compiler_infer; -pub mod v2_compiler_normalize; pub mod v2_compiler_parse_engine_hooks; pub mod v2_compiler_program_assembly; pub mod v2_compiler_program_partition; diff --git a/src/v1/stage0/src/v2_compiler_normalize.rs b/src/v1/stage0/src/v2_compiler_normalize.rs deleted file mode 100644 index 9b7fbee4e8f..00000000000 --- a/src/v1/stage0/src/v2_compiler_normalize.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Seed realization for v2.compiler.normalize (Wave 2 parallel flip). -// Hand-retained Rust oracle — independent of the self-emitted artifact under test. -// Dissolve-on: self-emit cutover retires this module when v2.compiler.normalize -// is emitted-only and the behavioral harness is modeled (sn_scaffold_dissolution_trigger). - -// CLIPPY ROSTER -- 3 finding(s) this module trips today, listed one lint per line with -// its count. Until this commit the generated crate root allowed `clippy::all` plus six -// rustc groups on behalf of every module under it, so `cargo clippy --all-targets -- -D -// warnings` decided nothing here; the root now excuses only the generated modules it -// speaks for (v1.compiler.emit_rust generated_rust_lint_relaxations), and this is what -// that leaves visible. The list is MONOTONE NON-INCREASING: a name leaves when its last -// site is repaired, and a lint not named below reds the build, which is the whole point. -#![allow( - unused_imports, // 3 -)] - -use im::{vector as vec, Vector as Vec}; -use std::rc::Rc; - -use crate::usv_pilot_v2_std_algebra::list_snoc_item; -use crate::usv_pilot_v2_std_node::{node_rebuild, Behavior, Connective, Node, NodeKind}; - -fn well_formed(_n: Rc) -> bool { - true -} - -#[derive(Debug, Clone, PartialEq)] -pub enum Outcome { - Accepted { value: T, diagnostics: () }, - Rejected { diagnostics: () }, -} - -pub type NormalizedTree = Rc; -pub type ParseTree = Rc; - -pub fn normalize_fold_init(n: Rc) -> Rc>> { - Rc::new(Outcome::Accepted { - value: node_rebuild(n, Rc::new(vec![])), - diagnostics: (), - }) -} - -pub fn normalize(parse_tree: ParseTree) -> Rc> { - let init = normalize_fold_init(parse_tree); - match init.as_ref() { - Outcome::Accepted { value, .. } => { - if well_formed(value.clone()) { - Rc::new(Outcome::Accepted { - value: value.clone(), - diagnostics: (), - }) - } else { - Rc::new(Outcome::Rejected { diagnostics: () }) - } - } - Outcome::Rejected { diagnostics } => Rc::new(Outcome::Rejected { - diagnostics: *diagnostics, - }), - } -} diff --git a/src/v2/compiler/self_host/seed_retention_frontier.dag b/src/v2/compiler/self_host/seed_retention_frontier.dag index 7d39fc0e645..92538f3e792 100644 --- a/src/v2/compiler/self_host/seed_retention_frontier.dag +++ b/src/v2/compiler/self_host/seed_retention_frontier.dag @@ -181,7 +181,6 @@ data seed_retention_frontier_roster: List = [ retained_reason_undeclared(path: "src/derived_realization_schedule.rs", cause: SeedRetainedIntrinsicSource), retained_reason_undeclared(path: "src/memory_governor.rs", cause: SeedRetainedIntrinsicSource), retained_reason_undeclared(path: "src/v2_compiler_body_producer.rs", cause: SeedRetainedIntrinsicSource), - retained_reason_undeclared(path: "src/v2_compiler_normalize.rs", cause: SeedRetainedIntrinsicSource), retained_reason_undeclared(path: "src/v2_compiler_target_carriers.rs", cause: SeedRetainedIntrinsicSource), retained_reason_undeclared(path: "src/v2_compiler_discovery_enumeration.rs", cause: SeedRetainedIntrinsicSource), retained_reason_undeclared(path: "src/v2_compiler_parse_engine_hooks.rs", cause: SeedRetainedIntrinsicSource), diff --git a/src/v2/compiler/self_host/stage0_crate_layout.dag b/src/v2/compiler/self_host/stage0_crate_layout.dag index c7d53cb1119..4d04de24bf4 100644 --- a/src/v2/compiler/self_host/stage0_crate_layout.dag +++ b/src/v2/compiler/self_host/stage0_crate_layout.dag @@ -86,7 +86,6 @@ data seed_retained_intrinsic_registrations: List