From fa0a4a7dd97aa5024d7fe2ccb77835807b76ad82 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 11:28:13 +0000 Subject: [PATCH 1/7] =?UTF-8?q?WIP:=20Gate-A=20flip:=20self-emit=2004=5Fin?= =?UTF-8?q?fer=20=E2=80=94=20curated=20scaffold=20now=20(SeedRetained),=20?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dag/gunbc/stage0_crate_layout_generated.dag | 8 +++-- ..._host_04_infer_behavioral_witness_test.dag | 9 ++++++ ...elf_host_04_infer_behavioral_transport.dag | 29 +++++++++++++++++ .../self_host_04_infer_shims/witness_main.rs | 32 +++++++++++++++++++ ...bootstrap_stage0_crate_layout_generated.rs | 3 +- .../gunbc_stage0_crate_layout_generated.rs | 4 +-- src/v1/stage0/src/lib.rs | 1 + src/v1/stage0/src/v2_compiler_infer.rs | 9 ++++++ 8 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 dag/test/claim/self_host_04_infer_behavioral_witness_test.dag create mode 100644 dag/tools/self_host_04_infer_behavioral_transport.dag create mode 100644 dag/tools/self_host_04_infer_shims/witness_main.rs create mode 100644 src/v1/stage0/src/v2_compiler_infer.rs diff --git a/dag/gunbc/stage0_crate_layout_generated.dag b/dag/gunbc/stage0_crate_layout_generated.dag index f52f339bdc7..79e8d1e7ac9 100644 --- a/dag/gunbc/stage0_crate_layout_generated.dag +++ b/dag/gunbc/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.frontier; regen via dag/tools/generated_artifact_gate.dag main_wet." -data generated_pub_mod_block: String = "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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;" +data generated_pub_mod_block: String = "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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 v2_compiler_infer;" data generated_pub_mod_basenames: List = [ "v1_interpreter", @@ -23,7 +23,8 @@ data generated_pub_mod_basenames: List = [ "v2_compiler_target_carriers", "v2_compiler_discovery_enumeration", "v2_compiler_parse_engine_hooks", - "v2_compiler_use_site_verdict" + "v2_compiler_use_site_verdict", + "v2_compiler_infer" ] data generated_stage0_filenames: List = [ @@ -46,7 +47,8 @@ data generated_stage0_filenames: List = [ "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", - "v2_compiler_use_site_verdict.rs" + "v2_compiler_use_site_verdict.rs", + "v2_compiler_infer.rs" ] data generated_stage0_dirs: List = [ diff --git a/dag/test/claim/self_host_04_infer_behavioral_witness_test.dag b/dag/test/claim/self_host_04_infer_behavioral_witness_test.dag new file mode 100644 index 00000000000..94c82598f74 --- /dev/null +++ b/dag/test/claim/self_host_04_infer_behavioral_witness_test.dag @@ -0,0 +1,9 @@ +module test.claim.self_host_04_infer_behavioral_witness + +import tools.self_host_04_infer_behavioral_transport { i4_behavioral_receipt_holds } + +data self_host_04_infer_behavioral_witness_doc: String = "Wet self-host behavioral receipt probe for Gate-A flip prep (04_infer): compares gunbc-emitted vs seed infer_arrow_domain_binding_heuristic_note (04_infer.dag module authority constant); --inject-fault perturbs emitted comparison (not driver flag). Full infer-tree walk deferred until emit surface greens (#6775). Live host effects — enroll when frontier flips SelfEmitted with binding." + +test fn self_host_04_infer_behavioral_receipt_holds() -> Bool { + i4_behavioral_receipt_holds() +} diff --git a/dag/tools/self_host_04_infer_behavioral_transport.dag b/dag/tools/self_host_04_infer_behavioral_transport.dag new file mode 100644 index 00000000000..041a3ef5d74 --- /dev/null +++ b/dag/tools/self_host_04_infer_behavioral_transport.dag @@ -0,0 +1,29 @@ +module tools.self_host_04_infer_behavioral_transport + +import tools.self_host_curated_seed_linked_harness { cssl_seed_linked_behavioral_receipt } +import v2.std.collection { List } +import std.logic { Bool } + +data i4_doc: String = "Gate-A flip prep (04_infer self-emit): curated seed-linked behavioral receipt via tools.self_host_curated_seed_linked_harness. Emit ONLY v2.compiler.infer via gunbc compile --entry; runtime gunbc closure (empty shim_lib + shim_writes) — no committed frozen dep snapshots. Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (exported module-authority constant from 04_infer.dag). Witness compares emitted vs seed on infer_arrow_domain_binding_heuristic_note with inject-fault perturbing emitted side (03_resolve pattern). Full infer-tree behavioral oracle deferred until post-#6775 Rc/Optional emit surface greens. Frontier NOT flipped until rustc-green receipt — migration_trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag)." + +data i4_emit_surface_note: String = "emit-surface rustc refusal probe (04_infer entry): tracked against #6775 landing (emit: Rc/Optional coherence) — the migration_trigger this scaffold flips on. Runtime emit supplies dep closure." + +data i4_source_rel: String = "src/v2/compiler/04_infer.dag" + +data i4_shim_driver_rel: String = "dag/tools/self_host_04_infer_shims/witness_main.rs" + +data i4_scaffold_dissolution_trigger: String = "dissolve-on: dag/tools/self_host_04_infer_shims/witness_main.rs + i4 harness transport. DISSOLVES WHEN modeled self-host behavioral-equivalence harness emits comparison driver + manifest." + +data i4_receipt_pass_marker: String = "SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: PASS" + +fn i4_behavioral_receipt_holds() -> Bool { + cssl_seed_linked_behavioral_receipt( + source_rel: i4_source_rel, + shim_lib_rel: "", + shim_writes: [], + driver_rel: i4_shim_driver_rel, + pass_marker: i4_receipt_pass_marker, + claim_entry_rel: "", + claim_function: "" + ) +} diff --git a/dag/tools/self_host_04_infer_shims/witness_main.rs b/dag/tools/self_host_04_infer_shims/witness_main.rs new file mode 100644 index 00000000000..689564eaa98 --- /dev/null +++ b/dag/tools/self_host_04_infer_shims/witness_main.rs @@ -0,0 +1,32 @@ +use v1_compiled::v2_compiler_infer as emitted; +use v1_compiler::v2_compiler_infer as seed; + +fn sym_eq(a: &str, b: &str) -> bool { + a == b +} + +fn main() { + let inject_fault = std::env::args().any(|a| a == "--inject-fault"); + let cases: [(&str, String, String); 1] = [( + "infer_arrow_domain_binding_heuristic_note", + emitted::infer_arrow_domain_binding_heuristic_note(), + seed::infer_arrow_domain_binding_heuristic_note(), + )]; + let mut all_pass = true; + for (i, (label, e, s)) in cases.iter().enumerate() { + let e_cmp = if inject_fault && i == 0 { + "INJECTED_FAULT".to_string() + } else { + e.clone() + }; + let ok = sym_eq(&e_cmp, s); + println!("{label} emitted_len={} seed_len={} eq={ok}", e_cmp.len()); + all_pass &= ok; + } + if all_pass { + println!("SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: PASS"); + std::process::exit(0); + } + println!("SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: FAIL"); + std::process::exit(1); +} 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 70e33d1e4cc..6883e56ba22 100644 --- a/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs @@ -22,7 +22,8 @@ pub const HAND_MAINTAINED_STAGE0_FILES: &[&str] = &[ "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", - "v2_compiler_use_site_verdict.rs" + "v2_compiler_use_site_verdict.rs", + "v2_compiler_infer.rs" ]; #[rustfmt::skip] 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 e41fe8bd388..dce85de531c 100644 --- a/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs @@ -23,7 +23,7 @@ pub fn stage0_crate_layout_generated_note() -> String { pub fn generated_pub_mod_block() -> String { thread_local! { static CACHED: String = { - "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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;".to_string() + "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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 v2_compiler_infer;".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -32,7 +32,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(), "coproduct_reflection".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "memory_governor".to_string(), "module_path_index".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_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()]) + Rc::new(vec!["v1_interpreter".to_string(), "cli_run".to_string(), "coproduct_reflection".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "memory_governor".to_string(), "module_path_index".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_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(), "v2_compiler_infer".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 1e85e06352f..4d4a8f08da3 100644 --- a/src/v1/stage0/src/lib.rs +++ b/src/v1/stage0/src/lib.rs @@ -119,6 +119,7 @@ pub mod v1_std_core; pub mod v1_test_non_ascii_perf_fixture; pub mod v2_compiler_body_producer; pub mod v2_compiler_discovery_enumeration; +pub mod v2_compiler_infer; pub mod v2_compiler_parse_engine_hooks; pub mod v2_compiler_resolve; pub mod v2_compiler_target_carriers; diff --git a/src/v1/stage0/src/v2_compiler_infer.rs b/src/v1/stage0/src/v2_compiler_infer.rs new file mode 100644 index 00000000000..6b6219d7506 --- /dev/null +++ b/src/v1/stage0/src/v2_compiler_infer.rs @@ -0,0 +1,9 @@ +// Seed realization for v2.compiler.infer (Gate-A flip prep, curated seed-link scaffold). +// Hand-retained Rust oracle — independent of the self-emitted artifact under test. +// Dissolve-on: self-emit cutover retires this module when v2.compiler.infer +// is emitted-only and the behavioral harness is modeled (i4_scaffold_dissolution_trigger). + +/// Mirrors `data infer_arrow_domain_binding_heuristic_note` in src/v2/compiler/04_infer.dag. +pub fn infer_arrow_domain_binding_heuristic_note() -> String { + "interim: infer_find_arrow_domain_type_in_tree DFS-walks the resolved tree for the first Arrow whose Conj domain names the atom-binding symbol — symbol-name collision across unrelated arrows picks first-visit order, not lexical scope. dissolve-on: namespace-only name resolution consumes containment-tree binding→domain (DESIGN open thread §namespace-only); delete this heuristic walker when SymbolIndex lookup lands.".to_string() +} From b8f5973c9520247ff31aa0a64b84031b17410d6a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 11:39:08 +0000 Subject: [PATCH 2/7] =?UTF-8?q?WIP:=20Gate-A=20flip:=20self-emit=2004=5Fin?= =?UTF-8?q?fer=20=E2=80=94=20curated=20scaffold=20now=20(SeedRetained),=20?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dag/gunbc/ci_layer_roots.dag | 1 + ...elf_host_04_infer_behavioral_transport.dag | 93 ++++++++++++++++--- .../gunbc_stage0_crate_layout_generated.rs | 2 +- 3 files changed, 82 insertions(+), 14 deletions(-) diff --git a/dag/gunbc/ci_layer_roots.dag b/dag/gunbc/ci_layer_roots.dag index 31ac5a0ad01..5875c31a90e 100644 --- a/dag/gunbc/ci_layer_roots.dag +++ b/dag/gunbc/ci_layer_roots.dag @@ -41,6 +41,7 @@ data witness_exclusion_substrings: List = [ "self_host_target_carriers_behavioral_witness_test.dag", "self_host_body_producer_behavioral_witness_test.dag", "self_host_03_resolve_behavioral_witness_test.dag", + "self_host_04_infer_behavioral_witness_test.dag", "dag_collect_fingerprint_witness_test.dag", "dag_compile_clean_perturb_receipts_test.dag", "test/claim/diagnostics_test.dag", diff --git a/dag/tools/self_host_04_infer_behavioral_transport.dag b/dag/tools/self_host_04_infer_behavioral_transport.dag index 041a3ef5d74..3bb664b95ed 100644 --- a/dag/tools/self_host_04_infer_behavioral_transport.dag +++ b/dag/tools/self_host_04_infer_behavioral_transport.dag @@ -1,29 +1,96 @@ module tools.self_host_04_infer_behavioral_transport -import tools.self_host_curated_seed_linked_harness { cssl_seed_linked_behavioral_receipt } -import v2.std.collection { List } +import extdeps.shell +import extdeps.filesystem.filesystem_io +import extdeps.cargo_build +import extdeps.git +import extdeps.gunbc import std.logic { Bool } +import tools.host_prelude { witness_bin, witness_bin_ensure_built_typed, witness_bin_release_path } -data i4_doc: String = "Gate-A flip prep (04_infer self-emit): curated seed-linked behavioral receipt via tools.self_host_curated_seed_linked_harness. Emit ONLY v2.compiler.infer via gunbc compile --entry; runtime gunbc closure (empty shim_lib + shim_writes) — no committed frozen dep snapshots. Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (exported module-authority constant from 04_infer.dag). Witness compares emitted vs seed on infer_arrow_domain_binding_heuristic_note with inject-fault perturbing emitted side (03_resolve pattern). Full infer-tree behavioral oracle deferred until post-#6775 Rc/Optional emit surface greens. Frontier NOT flipped until rustc-green receipt — migration_trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag)." +data i4_doc: String = "Gate-A flip prep (04_infer self-emit): shim-free seed-linked behavioral receipt mirroring tools.self_host_target_carriers_behavioral_transport (stc). Emit ONLY v2.compiler.infer via gunbc compile --entry; the emitted lib.rs carries its full std import closure (no hand dep shims — 49 files, 0 diagnostics measured). Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of the emitted artifact). Behavioral bar: cargo-green witness pairs emitted vs seed on infer_arrow_domain_binding_heuristic_note (04_infer.dag module authority constant) with --inject-fault RED control, plus supplementary claim-run on pipeline_infer_add_fixture_relationship_green. Full infer-tree behavioral oracle deferred until post-#6775 Rc/Optional emit surface greens (curated_cargo_frontier_probe_report.md row 04_infer: cargo build --lib refuses on HARNESS_ARTIFACT_std_dup Int128 dup under the probe-lib layout; this receipt uses the [[bin]] witness layout instead, which does not hit that dup). Frontier NOT flipped until rustc-green receipt — migration_trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag)." -data i4_emit_surface_note: String = "emit-surface rustc refusal probe (04_infer entry): tracked against #6775 landing (emit: Rc/Optional coherence) — the migration_trigger this scaffold flips on. Runtime emit supplies dep closure." +data i4_seed_retained_note: String = "Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of emitted artifact). Dissolve-on: same as i4_scaffold_dissolution_trigger." data i4_source_rel: String = "src/v2/compiler/04_infer.dag" +data i4_test_entry_rel: String = "src/v2/test/compiler/pipeline/infer_stage_test.dag" + data i4_shim_driver_rel: String = "dag/tools/self_host_04_infer_shims/witness_main.rs" -data i4_scaffold_dissolution_trigger: String = "dissolve-on: dag/tools/self_host_04_infer_shims/witness_main.rs + i4 harness transport. DISSOLVES WHEN modeled self-host behavioral-equivalence harness emits comparison driver + manifest." +data i4_scaffold_dissolution_trigger: String = "dissolve-on: dag/tools/self_host_04_infer_shims/witness_main.rs + i4_cargo_toml — hand-written equivalence driver + driver-crate manifest (mirrors stc scaffold debt; shim-free for std deps only). DISSOLVES WHEN a modeled self-host behavioral-equivalence harness producer emits the comparison driver + manifest without hand shims." data i4_receipt_pass_marker: String = "SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: PASS" +data i4_cargo_features_note: String = "Mirrors stc_cargo_features_note: text_lookup_work_counter feature declared for -D warnings consumers." + +fn i4_repo_path(root: String, rel: String) -> String { + concat(root, concat("/", rel)) +} + +fn i4_cargo_toml(root: String) -> String { + concat( + "[package]\nname = \"v1_compiled\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[features]\ntext_lookup_work_counter = []\n\n[[bin]]\nname = \"witness\"\npath = \"src/main.rs\"\n\n[dependencies]\nim-rc = { version = \"15.1\", features = [\"serde\"] }\nserde = { version = \"1\", features = [\"derive\", \"rc\"] }\nserde_json = \"1\"\nstacker = \"0.1\"\nlazy_static = \"1\"\nunicode-ident = \"1\"\nunicode-properties = { version = \"0.1\", features = [\"emoji\"] }\nv1-compiler = { path = \"", + concat(root, "/src/v1/stage0\" }\n") + ) +} + fn i4_behavioral_receipt_holds() -> Bool { - cssl_seed_linked_behavioral_receipt( - source_rel: i4_source_rel, - shim_lib_rel: "", - shim_writes: [], - driver_rel: i4_shim_driver_rel, - pass_marker: i4_receipt_pass_marker, - claim_entry_rel: "", - claim_function: "" + let root = git.Core.Toplevel() + let module_read = Filesystem.Read(path: i4_repo_path(root: root.path, rel: i4_source_rel)) + let driver_read = Filesystem.Read(path: i4_repo_path(root: root.path, rel: i4_shim_driver_rel)) + + let out_dir = shell.Mktemp.Dir() + let gunbc_built = witness_bin_ensure_built_typed(root: root.path, bin: witness_bin(var_name: "GUNBC", bin_name: "gunbc")) + let gunbc_bin = witness_bin_release_path(root: root.path, bin_name: "gunbc") + let emit = gunbc.WitnessBin.Run( + workdir: root.path, + bin_path: gunbc_bin, + args: [ + "compile", + "--source-root", "dag", + "--source-root", "src/v2", + "--entry", i4_source_rel, + "--output-dir", out_dir.path, + "--target", "rust", + "--dependency-pool-index", "primary-precedence" + ] ) + + let manifest = Filesystem.Write(path: concat(out_dir.path, "/Cargo.toml"), content: i4_cargo_toml(root: root.path)) + let main_rs = Filesystem.Write(path: concat(out_dir.path, "/src/main.rs"), content: driver_read.content) + + let build = cargo.Build.BuildManifest( + workdir: out_dir.path, + manifest_path: concat(out_dir.path, "/Cargo.toml"), + target_dir: concat(out_dir.path, "/target"), + extra_args: ["--release"] + ) + + let witness_bin_path = concat(out_dir.path, "/target/release/witness") + let pass_run = gunbc.WitnessBin.Run(workdir: out_dir.path, bin_path: witness_bin_path) + let fault_run = gunbc.WitnessBin.Run(workdir: out_dir.path, bin_path: witness_bin_path, args: ["--inject-fault"]) + + let eval_pipeline = gunbc.WitnessBin.Run( + workdir: root.path, + bin_path: gunbc_bin, + args: [ + "run", "--claim-run", + "--source-root", "dag", + "--source-root", "src/v2", + "--entry", i4_test_entry_rel, + "--function", "pipeline_infer_add_fixture_relationship_green" + ] + ) + + let cleanup_out = shell.Remove.RecursiveForce(path: out_dir.path) + + module_read.success && driver_read.success + && out_dir.success && gunbc_built && emit.success + && manifest.success && main_rs.success + && build.success + && pass_run.success && string_contains(s: pass_run.stdout, pattern: i4_receipt_pass_marker) + && (fault_run.success == false) + && eval_pipeline.success + && cleanup_out.success } 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 dce85de531c..dc20e7efe13 100644 --- a/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs @@ -41,7 +41,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(), "cli_run.rs".to_string(), "coproduct_reflection.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "main.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "memory_governor.rs".to_string(), "std_lens_verdict.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_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()]) + Rc::new(vec!["v1_interpreter.rs".to_string(), "cli_run.rs".to_string(), "coproduct_reflection.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "main.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "memory_governor.rs".to_string(), "std_lens_verdict.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_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(), "v2_compiler_infer.rs".to_string()]) }; } CACHED.with(|c: &Rc>| c.clone()) From e0ee4704bd508c7dabf81579330db25214747d3e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 12:24:06 +0000 Subject: [PATCH 3/7] =?UTF-8?q?WIP:=20Gate-A=20flip:=20self-emit=2004=5Fin?= =?UTF-8?q?fer=20=E2=80=94=20curated=20scaffold=20now=20(SeedRetained),=20?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...elf_host_04_infer_behavioral_transport.dag | 91 +++---------------- 1 file changed, 13 insertions(+), 78 deletions(-) diff --git a/dag/tools/self_host_04_infer_behavioral_transport.dag b/dag/tools/self_host_04_infer_behavioral_transport.dag index 3bb664b95ed..741dce5b847 100644 --- a/dag/tools/self_host_04_infer_behavioral_transport.dag +++ b/dag/tools/self_host_04_infer_behavioral_transport.dag @@ -1,16 +1,12 @@ module tools.self_host_04_infer_behavioral_transport -import extdeps.shell -import extdeps.filesystem.filesystem_io -import extdeps.cargo_build -import extdeps.git -import extdeps.gunbc +import tools.self_host_curated_seed_linked_harness { cssl_seed_linked_behavioral_receipt } +import v2.std.collection { List } import std.logic { Bool } -import tools.host_prelude { witness_bin, witness_bin_ensure_built_typed, witness_bin_release_path } -data i4_doc: String = "Gate-A flip prep (04_infer self-emit): shim-free seed-linked behavioral receipt mirroring tools.self_host_target_carriers_behavioral_transport (stc). Emit ONLY v2.compiler.infer via gunbc compile --entry; the emitted lib.rs carries its full std import closure (no hand dep shims — 49 files, 0 diagnostics measured). Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of the emitted artifact). Behavioral bar: cargo-green witness pairs emitted vs seed on infer_arrow_domain_binding_heuristic_note (04_infer.dag module authority constant) with --inject-fault RED control, plus supplementary claim-run on pipeline_infer_add_fixture_relationship_green. Full infer-tree behavioral oracle deferred until post-#6775 Rc/Optional emit surface greens (curated_cargo_frontier_probe_report.md row 04_infer: cargo build --lib refuses on HARNESS_ARTIFACT_std_dup Int128 dup under the probe-lib layout; this receipt uses the [[bin]] witness layout instead, which does not hit that dup). Frontier NOT flipped until rustc-green receipt — migration_trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag)." +data i4_doc: String = "Gate-A flip prep (04_infer self-emit): curated seed-linked behavioral receipt via tools.self_host_curated_seed_linked_harness (converged onto the shared cssl authority — DESIGN §3 — after #6791 was found to have clobbered it and #6801 restored it; do not re-fork a per-module copy). Emit ONLY v2.compiler.infer via gunbc compile --entry; runtime gunbc closure (empty shim_lib + shim_writes) — no committed frozen dep snapshots. Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of the emitted artifact). Behavioral bar: cargo-green witness pairs emitted vs seed on infer_arrow_domain_binding_heuristic_note (04_infer.dag module authority constant) with --inject-fault RED control, plus supplementary claim-run on pipeline_infer_add_fixture_relationship_green. NOTE (sharp-bee-290, cross-worker confirmed): gunbc --entry emits the WHOLE transitive closure, not entry-only, so a cargo refusal on a large closure (168 errors measured pre-convergence: missing generic params, duplicate std defs) is a HARNESS ARTIFACT of the current shim mechanism, not necessarily 04_infer's real Gate-A verdict — the real verdict awaits a generic seed-shim assembly (still-pike-676, in design) that auto re-exports every non-entry closure module against the seed crate. Frontier NOT flipped until a faithful rustc-green receipt exists — migration_trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag)." -data i4_seed_retained_note: String = "Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of emitted artifact). Dissolve-on: same as i4_scaffold_dissolution_trigger." +data i4_seed_retained_note: String = "Seed oracle: v1_compiler::v2_compiler_infer in src/v1/stage0 (hand-retained, independent of emitted artifact). Dissolve-on: generic seed-shim assembly (still-pike-676) lands + #6775 Rc/Optional emit surface greens, giving a faithful cargo verdict; frontier flips SelfEmitted then." data i4_source_rel: String = "src/v2/compiler/04_infer.dag" @@ -18,79 +14,18 @@ data i4_test_entry_rel: String = "src/v2/test/compiler/pipeline/infer_stage_test data i4_shim_driver_rel: String = "dag/tools/self_host_04_infer_shims/witness_main.rs" -data i4_scaffold_dissolution_trigger: String = "dissolve-on: dag/tools/self_host_04_infer_shims/witness_main.rs + i4_cargo_toml — hand-written equivalence driver + driver-crate manifest (mirrors stc scaffold debt; shim-free for std deps only). DISSOLVES WHEN a modeled self-host behavioral-equivalence harness producer emits the comparison driver + manifest without hand shims." +data i4_scaffold_dissolution_trigger: String = "dissolve-on: dag/tools/self_host_04_infer_shims/witness_main.rs — hand-written equivalence driver. DISSOLVES WHEN a modeled self-host behavioral-equivalence harness producer emits the comparison driver without hand authoring (parallel to cssl_doc dissolution)." data i4_receipt_pass_marker: String = "SELF_HOST_04_INFER_BEHAVIORAL_RECEIPT: PASS" -data i4_cargo_features_note: String = "Mirrors stc_cargo_features_note: text_lookup_work_counter feature declared for -D warnings consumers." - -fn i4_repo_path(root: String, rel: String) -> String { - concat(root, concat("/", rel)) -} - -fn i4_cargo_toml(root: String) -> String { - concat( - "[package]\nname = \"v1_compiled\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[features]\ntext_lookup_work_counter = []\n\n[[bin]]\nname = \"witness\"\npath = \"src/main.rs\"\n\n[dependencies]\nim-rc = { version = \"15.1\", features = [\"serde\"] }\nserde = { version = \"1\", features = [\"derive\", \"rc\"] }\nserde_json = \"1\"\nstacker = \"0.1\"\nlazy_static = \"1\"\nunicode-ident = \"1\"\nunicode-properties = { version = \"0.1\", features = [\"emoji\"] }\nv1-compiler = { path = \"", - concat(root, "/src/v1/stage0\" }\n") - ) -} - fn i4_behavioral_receipt_holds() -> Bool { - let root = git.Core.Toplevel() - let module_read = Filesystem.Read(path: i4_repo_path(root: root.path, rel: i4_source_rel)) - let driver_read = Filesystem.Read(path: i4_repo_path(root: root.path, rel: i4_shim_driver_rel)) - - let out_dir = shell.Mktemp.Dir() - let gunbc_built = witness_bin_ensure_built_typed(root: root.path, bin: witness_bin(var_name: "GUNBC", bin_name: "gunbc")) - let gunbc_bin = witness_bin_release_path(root: root.path, bin_name: "gunbc") - let emit = gunbc.WitnessBin.Run( - workdir: root.path, - bin_path: gunbc_bin, - args: [ - "compile", - "--source-root", "dag", - "--source-root", "src/v2", - "--entry", i4_source_rel, - "--output-dir", out_dir.path, - "--target", "rust", - "--dependency-pool-index", "primary-precedence" - ] + cssl_seed_linked_behavioral_receipt( + source_rel: i4_source_rel, + shim_lib_rel: "", + shim_writes: [], + driver_rel: i4_shim_driver_rel, + pass_marker: i4_receipt_pass_marker, + claim_entry_rel: i4_test_entry_rel, + claim_function: "pipeline_infer_add_fixture_relationship_green" ) - - let manifest = Filesystem.Write(path: concat(out_dir.path, "/Cargo.toml"), content: i4_cargo_toml(root: root.path)) - let main_rs = Filesystem.Write(path: concat(out_dir.path, "/src/main.rs"), content: driver_read.content) - - let build = cargo.Build.BuildManifest( - workdir: out_dir.path, - manifest_path: concat(out_dir.path, "/Cargo.toml"), - target_dir: concat(out_dir.path, "/target"), - extra_args: ["--release"] - ) - - let witness_bin_path = concat(out_dir.path, "/target/release/witness") - let pass_run = gunbc.WitnessBin.Run(workdir: out_dir.path, bin_path: witness_bin_path) - let fault_run = gunbc.WitnessBin.Run(workdir: out_dir.path, bin_path: witness_bin_path, args: ["--inject-fault"]) - - let eval_pipeline = gunbc.WitnessBin.Run( - workdir: root.path, - bin_path: gunbc_bin, - args: [ - "run", "--claim-run", - "--source-root", "dag", - "--source-root", "src/v2", - "--entry", i4_test_entry_rel, - "--function", "pipeline_infer_add_fixture_relationship_green" - ] - ) - - let cleanup_out = shell.Remove.RecursiveForce(path: out_dir.path) - - module_read.success && driver_read.success - && out_dir.success && gunbc_built && emit.success - && manifest.success && main_rs.success - && build.success - && pass_run.success && string_contains(s: pass_run.stdout, pattern: i4_receipt_pass_marker) - && (fault_run.success == false) - && eval_pipeline.success - && cleanup_out.success } From ace9c8d87f836272da8281f9d382c6384dfc43f3 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 12:40:35 +0000 Subject: [PATCH 4/7] =?UTF-8?q?WIP:=20Gate-A=20flip:=20self-emit=2004=5Fin?= =?UTF-8?q?fer=20=E2=80=94=20curated=20scaffold=20now=20(SeedRetained),=20?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v2/compiler/self_host/frontier.dag | 3 +- .../crate_layout_witness_debug_test.dag | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag diff --git a/src/v2/compiler/self_host/frontier.dag b/src/v2/compiler/self_host/frontier.dag index 74870d31be8..fe683d5f913 100644 --- a/src/v2/compiler/self_host/frontier.dag +++ b/src/v2/compiler/self_host/frontier.dag @@ -911,7 +911,8 @@ data seed_retained_scaffold_registrations: List List { diff --git a/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag b/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag new file mode 100644 index 00000000000..1fb0b540c27 --- /dev/null +++ b/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag @@ -0,0 +1,33 @@ +module v2.test.claim.self_host.crate_layout_witness_debug + +import v2.test.claim.self_host.crate_layout_witness { + witness_generated_basenames_match_frontier_holds, + witness_generated_filenames_match_frontier_holds, + witness_generated_dirs_match_frontier_holds, + witness_generated_pub_mod_block_matches_frontier_holds, + witness_generated_includes_every_self_emitted_basename_holds, + witness_generated_has_no_phantom_registration_holds, + witness_hand_maintained_filenames_include_self_emitted_holds, + witness_self_emitted_count_matches_derived_basenames_holds, + witness_no_orphan_self_emitted_basename_holds, + witness_parse_engine_hooks_derived_from_frontier_holds, + witness_use_site_verdict_derived_from_frontier_holds, + witness_discovery_enumeration_derived_from_frontier_holds +} +import v2.compiler.self_host.frontier { compiler_frontier_crate_layout_holds, compiler_frontier_self_emitted_count, compiler_frontier_self_emitted_baseline } +import v2.std.logic { Bool } + +test fn debug_a() -> Bool { compiler_frontier_crate_layout_holds() } +test fn debug_b() -> Bool { witness_parse_engine_hooks_derived_from_frontier_holds() } +test fn debug_c() -> Bool { witness_use_site_verdict_derived_from_frontier_holds() } +test fn debug_d() -> Bool { witness_discovery_enumeration_derived_from_frontier_holds() } +test fn debug_e() -> Bool { witness_generated_pub_mod_block_matches_frontier_holds() } +test fn debug_f() -> Bool { witness_generated_basenames_match_frontier_holds() } +test fn debug_g() -> Bool { witness_generated_filenames_match_frontier_holds() } +test fn debug_h() -> Bool { witness_generated_dirs_match_frontier_holds() } +test fn debug_i() -> Bool { witness_generated_includes_every_self_emitted_basename_holds() } +test fn debug_j() -> Bool { witness_generated_has_no_phantom_registration_holds() } +test fn debug_k() -> Bool { witness_hand_maintained_filenames_include_self_emitted_holds() } +test fn debug_l() -> Bool { witness_self_emitted_count_matches_derived_basenames_holds() } +test fn debug_m() -> Bool { witness_no_orphan_self_emitted_basename_holds() } +test fn debug_n() -> Bool { compiler_frontier_self_emitted_count() == compiler_frontier_self_emitted_baseline } From 81dd5a26b5299459da2e7e287396ca40ffa6d54e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 12:43:20 +0000 Subject: [PATCH 5/7] Fix: register v2_compiler_infer as SeedRetained scaffold in frontier Review 39240 (PR #6802) correctly flagged that adding v2_compiler_infer to the generated crate-layout artifacts without a matching SeedRetainedScaffoldRegistration row breaks the single-authority crate_layout_witness_test (frontier.dag is the sole crate-layout authority per compiler_frontier_crate_layout_note). Registered it alongside v2_compiler_resolve (the same SeedRetained-scaffold pattern from #6784) and reordered the generated pub_mod block/basenames/ filenames to match hand_maintained_pub_mod_basenames' derivation order (scaffold rows before self-emitted rows), which the exact-match witness_generated_pub_mod_block_matches_frontier_holds requires. Verified crate_layout_witnesses() green by execution via gunbc run --claim-run. --- dag/gunbc/stage0_crate_layout_generated.dag | 10 +++--- .../gunbc_stage0_crate_layout_generated.rs | 6 ++-- .../crate_layout_witness_debug_test.dag | 33 ------------------- 3 files changed, 8 insertions(+), 41 deletions(-) delete mode 100644 src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag diff --git a/dag/gunbc/stage0_crate_layout_generated.dag b/dag/gunbc/stage0_crate_layout_generated.dag index 79e8d1e7ac9..8314aab3427 100644 --- a/dag/gunbc/stage0_crate_layout_generated.dag +++ b/dag/gunbc/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.frontier; regen via dag/tools/generated_artifact_gate.dag main_wet." -data generated_pub_mod_block: String = "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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 v2_compiler_infer;" +data generated_pub_mod_block: String = "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_infer;\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;" data generated_pub_mod_basenames: List = [ "v1_interpreter", @@ -19,12 +19,12 @@ data generated_pub_mod_basenames: List = [ "usv_pilot_v2_std_collection", "usv_pilot_v2_std_node", "v2_compiler_resolve", + "v2_compiler_infer", "v2_compiler_body_producer", "v2_compiler_target_carriers", "v2_compiler_discovery_enumeration", "v2_compiler_parse_engine_hooks", - "v2_compiler_use_site_verdict", - "v2_compiler_infer" + "v2_compiler_use_site_verdict" ] data generated_stage0_filenames: List = [ @@ -43,12 +43,12 @@ data generated_stage0_filenames: List = [ "usv_pilot_v2_std_collection.rs", "usv_pilot_v2_std_node.rs", "v2_compiler_resolve.rs", + "v2_compiler_infer.rs", "v2_compiler_body_producer.rs", "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", - "v2_compiler_use_site_verdict.rs", - "v2_compiler_infer.rs" + "v2_compiler_use_site_verdict.rs" ] data generated_stage0_dirs: List = [ 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 dc20e7efe13..971ea65384f 100644 --- a/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs @@ -23,7 +23,7 @@ pub fn stage0_crate_layout_generated_note() -> String { pub fn generated_pub_mod_block() -> String { thread_local! { static CACHED: String = { - "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_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 v2_compiler_infer;".to_string() + "\npub mod v1_interpreter;\npub mod cli_run;\npub mod coproduct_reflection;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod memory_governor;\npub mod module_path_index;\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_infer;\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;".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -32,7 +32,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(), "coproduct_reflection".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "memory_governor".to_string(), "module_path_index".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_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(), "v2_compiler_infer".to_string()]) + Rc::new(vec!["v1_interpreter".to_string(), "cli_run".to_string(), "coproduct_reflection".to_string(), "resolved_graph_cache".to_string(), "shared_typecheck_store".to_string(), "recorded_fixture".to_string(), "memory_governor".to_string(), "module_path_index".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_infer".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()]) }; } CACHED.with(|c: &Rc>| c.clone()) @@ -41,7 +41,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(), "cli_run.rs".to_string(), "coproduct_reflection.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "main.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "memory_governor.rs".to_string(), "std_lens_verdict.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_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(), "v2_compiler_infer.rs".to_string()]) + Rc::new(vec!["v1_interpreter.rs".to_string(), "cli_run.rs".to_string(), "coproduct_reflection.rs".to_string(), "resolved_graph_cache.rs".to_string(), "shared_typecheck_store.rs".to_string(), "recorded_fixture.rs".to_string(), "main.rs".to_string(), "phase_profile.rs".to_string(), "pre_push.rs".to_string(), "memory_governor.rs".to_string(), "std_lens_verdict.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_infer.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()]) }; } CACHED.with(|c: &Rc>| c.clone()) diff --git a/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag b/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag deleted file mode 100644 index 1fb0b540c27..00000000000 --- a/src/v2/test/claim/self_host/crate_layout_witness_debug_test.dag +++ /dev/null @@ -1,33 +0,0 @@ -module v2.test.claim.self_host.crate_layout_witness_debug - -import v2.test.claim.self_host.crate_layout_witness { - witness_generated_basenames_match_frontier_holds, - witness_generated_filenames_match_frontier_holds, - witness_generated_dirs_match_frontier_holds, - witness_generated_pub_mod_block_matches_frontier_holds, - witness_generated_includes_every_self_emitted_basename_holds, - witness_generated_has_no_phantom_registration_holds, - witness_hand_maintained_filenames_include_self_emitted_holds, - witness_self_emitted_count_matches_derived_basenames_holds, - witness_no_orphan_self_emitted_basename_holds, - witness_parse_engine_hooks_derived_from_frontier_holds, - witness_use_site_verdict_derived_from_frontier_holds, - witness_discovery_enumeration_derived_from_frontier_holds -} -import v2.compiler.self_host.frontier { compiler_frontier_crate_layout_holds, compiler_frontier_self_emitted_count, compiler_frontier_self_emitted_baseline } -import v2.std.logic { Bool } - -test fn debug_a() -> Bool { compiler_frontier_crate_layout_holds() } -test fn debug_b() -> Bool { witness_parse_engine_hooks_derived_from_frontier_holds() } -test fn debug_c() -> Bool { witness_use_site_verdict_derived_from_frontier_holds() } -test fn debug_d() -> Bool { witness_discovery_enumeration_derived_from_frontier_holds() } -test fn debug_e() -> Bool { witness_generated_pub_mod_block_matches_frontier_holds() } -test fn debug_f() -> Bool { witness_generated_basenames_match_frontier_holds() } -test fn debug_g() -> Bool { witness_generated_filenames_match_frontier_holds() } -test fn debug_h() -> Bool { witness_generated_dirs_match_frontier_holds() } -test fn debug_i() -> Bool { witness_generated_includes_every_self_emitted_basename_holds() } -test fn debug_j() -> Bool { witness_generated_has_no_phantom_registration_holds() } -test fn debug_k() -> Bool { witness_hand_maintained_filenames_include_self_emitted_holds() } -test fn debug_l() -> Bool { witness_self_emitted_count_matches_derived_basenames_holds() } -test fn debug_m() -> Bool { witness_no_orphan_self_emitted_basename_holds() } -test fn debug_n() -> Bool { compiler_frontier_self_emitted_count() == compiler_frontier_self_emitted_baseline } From fc79b3f9965ebe36fef1b9d0957f7090a2bffd7d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 18:46:44 +0000 Subject: [PATCH 6/7] =?UTF-8?q?WIP:=20Gate-A=20flip:=20self-emit=2004=5Fin?= =?UTF-8?q?fer=20=E2=80=94=20curated=20scaffold=20now=20(SeedRetained),=20?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/claim/self_host/scratch_expected_rs_test.dag | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/v2/test/claim/self_host/scratch_expected_rs_test.dag diff --git a/src/v2/test/claim/self_host/scratch_expected_rs_test.dag b/src/v2/test/claim/self_host/scratch_expected_rs_test.dag new file mode 100644 index 00000000000..ffbbb57a021 --- /dev/null +++ b/src/v2/test/claim/self_host/scratch_expected_rs_test.dag @@ -0,0 +1,11 @@ +module v2.test.claim.self_host.scratch_expected_rs + +import gunbc.stage0_crate_layout_emit { expected_stage0_crate_layout_generated_rs } +import v2.std.algebra { any, fold_list, length } +import v2.std.collection { List } +import v2.std.logic { Bool } +import v2.std.text { String } + +test fn scratch_print_expected_rs() -> Bool { + expected_stage0_crate_layout_generated_rs() == "__SENTINEL__" +} From 9691b2a42f723b20d9fc803a318887d780494cb4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 17 Jul 2026 18:56:22 +0000 Subject: [PATCH 7/7] Fix generated-artifact drift: bootstrap crate-layout ordering + remove scratch test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bootstrap_stage0_crate_layout_generated.rs is the actual artifact the drift gate checks (Stage0CrateLayoutGeneratedRsArtifact), separate from gunbc_stage0_crate_layout_generated.rs which I'd edited earlier. Its HAND_MAINTAINED_STAGE0_FILES list had v2_compiler_infer.rs appended at the end instead of directly after v2_compiler_resolve.rs, matching frontier.dag's scaffold-registration order — drifting from expected_stage0_crate_layout_generated_rs()'s byte-order-sensitive output. Also removes an accidental scratch witness (scratch_expected_rs_test.dag) left in src/v2/test/claim during local diagnosis — a *_test.dag file with an unsatisfiable assertion that the witness layer-root walk would enroll and fail. Addresses review 39310. Co-Authored-By: Claude Sonnet 5 --- .../src/bootstrap_stage0_crate_layout_generated.rs | 4 ++-- .../test/claim/self_host/scratch_expected_rs_test.dag | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 src/v2/test/claim/self_host/scratch_expected_rs_test.dag 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 6883e56ba22..8b46ede05f5 100644 --- a/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs +++ b/src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs @@ -18,12 +18,12 @@ pub const HAND_MAINTAINED_STAGE0_FILES: &[&str] = &[ "usv_pilot_v2_std_collection.rs", "usv_pilot_v2_std_node.rs", "v2_compiler_resolve.rs", + "v2_compiler_infer.rs", "v2_compiler_body_producer.rs", "v2_compiler_target_carriers.rs", "v2_compiler_discovery_enumeration.rs", "v2_compiler_parse_engine_hooks.rs", - "v2_compiler_use_site_verdict.rs", - "v2_compiler_infer.rs" + "v2_compiler_use_site_verdict.rs" ]; #[rustfmt::skip] diff --git a/src/v2/test/claim/self_host/scratch_expected_rs_test.dag b/src/v2/test/claim/self_host/scratch_expected_rs_test.dag deleted file mode 100644 index ffbbb57a021..00000000000 --- a/src/v2/test/claim/self_host/scratch_expected_rs_test.dag +++ /dev/null @@ -1,11 +0,0 @@ -module v2.test.claim.self_host.scratch_expected_rs - -import gunbc.stage0_crate_layout_emit { expected_stage0_crate_layout_generated_rs } -import v2.std.algebra { any, fold_list, length } -import v2.std.collection { List } -import v2.std.logic { Bool } -import v2.std.text { String } - -test fn scratch_print_expected_rs() -> Bool { - expected_stage0_crate_layout_generated_rs() == "__SENTINEL__" -}