From af0302aa83c79eb5a820ca25f18f098889ec9abc Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 13 May 2026 20:18:53 +0000 Subject: [PATCH 1/5] Align WorkflowRuntime initial enum with gate 99 --- docs/r3-program-plan.md | 4 +- docs/r3-structure.md | 4 +- dsl/gunbc/ci_emission.dag | 14 ++-- .../t_ci_workflow_as_data_demo_test.rs | 68 +++++++++++++++++-- 4 files changed, 73 insertions(+), 17 deletions(-) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index fe4fb30db52..62c9b2e90b8 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -323,8 +323,8 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap | 95 | `opt_in_iteration_parallelism_via_lens_application_demonstrated` | demonstration | T-Lens-Application-Surface / **Cluster F (T-LP-Retirement)** | **R3-LOAD-BEARING (carve-promoted-IN-R3 2026-05-09)** per Director ratification at gunbc#846 #issuecomment-4412330468 (cascade-promotion with C1 #81). Worked-example demo via `apply_lens(parallelism, fn, Enforce)`. Cascade-gates on F-α completion (parallelism BEHAVIORALLY COMPLETE #81) + T-LAS Slice B substrate landing (#91 per-lens LensEnforcement projection per `docs/design-lens-application-surface.md` §4.4 / §7). Cluster F sub-phase F-γ.1. See `docs/audit/r3-cluster-f-sequencing-plan-2026-05-09.md` §1.4.1. Prior R4-CARVED (C1 cascade) status DISSOLVED. | | 96 | `value_body_substrate_mirror_isomorphism_executable` | substrate-shape | T-V-L4-L7-Direct (Verification cross-program with Substrate) | **CONSUMER_LANDED** (PR #2288 — Add ValueBody substrate mirror isomorphism gate; CI-visible integration check landed; refresh per cluster-analysis audit §1; NEW 2026-05-08 per Q-ValueBody-Isomorphism RATIFIED at gunbc#828 #issuecomment-4403972737 + Brian sanction at gunbc#846) | Rust `ValueBody` ↔ substrate `.dag` mirror isomorphism gate; canonical Pass-condition body at `r3-structure.md` §Acceptance T-Verification-L4-L7-Direct (per §1.8 authority convention `r3-program-plan.md:302`); brief at `docs/briefs/r3-v-valuebody-substrate-mirror-isomorphism-v1-worker.md`. | | 97 | `method_template_projection_emit_shim_retirement_coherence` | state-check | R2-Grounding-Rust ([Gunbc **#1982**](https://github.com/gunb-ai/gunbc/issues/1982)) | **CONSUMER_LANDED + PASSING** | Q-V2-Retirement-Boundary-Matrix (**G6**) — Gap-4 `pb_method_template_projection_dag_emit` + **`[[bin]]` `emit_method_template_projection`** in `src/v3/compiler/Cargo.toml` + `src/bin/emit_method_template_projection.rs` must exist **iff** **`src/v2/stage0/`** remains (`autobins = false` — manifest target is load-bearing). Consumer: **`method_template_projection_emit_shim_coherence_test.rs`** + SG-0 census path gate. Terminal retirement = v2 tree absent ⇒ lib + bin table + bin source absent; coherence holds continuously. | -| 98 | `ci_yml_hand_authority_dissolved` | state-check | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1 — T-WAD FULL R3 elevation per operator directive 2026-05-12 + Director ratification msg_5cbdad24 + msg_f9fd669e) | `.github/workflows/ci.yml` is no longer hand-authored CI logic — file is either (a) absent (some emission targets may not require a `.github/workflows/` artifact), (b) committed-emission-artifact byte-identical to `project_github_actions(ci_workflow_dag, target)` output with regression-guard test (YamlStatic), or (c) thin-shim entry-point invoking emitted binary/python (BinaryShim / PythonShim); in NO case is it hand-edited CI logic. Regression guard test prevents hand-authored re-introduction. Per briansrls BLOCKING #PR2744 inline review fix 2026-05-12: deleting hand-maintenance ≠ deleting executable artifact; P5 / Pure Bootstrap dissolves AUTHORITY, not file presence. | -| 99 | `workflow_runtime_open_enum_landed` | substrate-shape | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1) | `WorkflowRuntime` sum-type with 3 initial arms (`YamlStatic \| BinaryShim \| PythonShim \| ...`) declared in gunbc namespace as open enum; per (c-refined) shape ratified at PR #2749 §7 + Director msg_237bde05 / msg_f9fd669e. `InlineGunbc` is DESIGN-ONLY per PR #2746 §5.4 — NOT in initial enum; lands via separate substrate-prereq PR paired with a runtime consumer (per openai-pro BLOCKING fix 2026-05-12 on PR #2744). | +| 98 | `ci_yml_hand_authority_dissolved` | state-check | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1 — T-WAD FULL R3 elevation per operator directive 2026-05-12 + Director ratification msg_5cbdad24 + msg_f9fd669e) | `.github/workflows/ci.yml` is no longer hand-authored CI logic — file is either (a) committed-emission-artifact byte-identical to `project_github_actions(ci_workflow_dag, target)` output with regression-guard test (YamlStatic), or (b) thin-shim entry-point invoking the emitted binary (BinaryShim); in NO case is it hand-edited CI logic AND in NO case is the artifact absent for the initial enum. Regression guard test prevents hand-authored re-introduction. Per briansrls BLOCKING #PR2744 inline review fix 2026-05-12: deleting hand-maintenance != deleting executable artifact; P5 / Pure Bootstrap dissolves AUTHORITY, not file presence. | +| 99 | `workflow_runtime_open_enum_landed` | substrate-shape | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1) | `WorkflowRuntime` sum-type with 2 initial arms (`YamlStatic \| BinaryShim \| ...`) declared in gunbc namespace as open enum; per (c-refined) shape ratified at PR #2749 §7 + Director msg_237bde05 / msg_f9fd669e. `PythonShim` and `InlineGunbc` are DESIGN-ONLY future targets — NOT in the initial enum; each lands via separate substrate-prereq PR paired with a runtime consumer. | | 100 | `project_github_actions_landed` | substrate-shape | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1) | `project_github_actions: (CIWorkflowDag, WorkflowRuntime) -> Workflow` projection function declared in gunbc namespace; consumes `extdeps.github.actions.Workflow` as codomain type + `CIWorkflowDag` (PR #2736 carrier introduction) as input domain; per (c-refined) substrate-shape per PR #2749 §7. WI-2 implementation: in-flight via PR #2744 (brief lands with the scope-doc). | | 101 | `test_cost_dimension_landed` | substrate-shape | T-Workflow-As-Data + Debt-Paydown (Cluster M sub-component) | DECLARED (NEW 2026-05-12 per PR #2744 §1) | `Cost` dimension declared on test nodes. **Distinct from existing compiler-internal cost gates** (#37 `cost_lens_reads_target_realization` / #39 `no_coercion_cost_dimension` / #40 `symbolic_cost_expr_equals_executable` / #70 `cost_lens_demonstration` / #80 `cost_lens_behaviorally_complete` are about `SymbolicCost` as the compiler's cost lens reading target programs); this gate is about `Cost`-as-`Dimension` applied to **test nodes** so the slow-test ratchet **can** attach wall-clock facts to modeled test nodes instead of treating exemptions as an unstructured compiler-local table (substrate-shape sibling of state-check #102). | | 102 | `slow_test_exemptions_dissolved` | state-check | T-Workflow-As-Data + Debt-Paydown | DECLARED (NEW 2026-05-12 per PR #2744 §1) | **Pass target:** slow-test ratchet policy is read from modeled test-node timing / `TestNodeCostDimension` substrate facts (no checked-in warn-manifest side input). **Interim (not closure):** `scripts/slow-test-exemptions.txt` is deleted and warn rows live in structured `scripts/test-node-wall-clock-ratchet.jsonl` while CI still reads that file directly — bridge work toward #101/#102, not a claim that #102 is GREEN. Pair with kernel-modeling split per `feedback_state_space_vs_behavioral_invariants` + Director msg_f9fd669e. | diff --git a/docs/r3-structure.md b/docs/r3-structure.md index 0c36142f57d..f0a85cb0498 100644 --- a/docs/r3-structure.md +++ b/docs/r3-structure.md @@ -172,8 +172,8 @@ L6 (`l6_structural_form_coverage`) was moved out of this lane during the engine- - `timing_lens_carrier_landed` — `Lens` carrier authored per Substrate Mgr STOP+PING design receipt for `docs/design-timing-lens.md`; `TimingMeasurement` + `TimingObservationSet` + `TimingBudget` carriers live; `Output` is projection/report distinguishing `Observed | Unobserved | Ambiguous | Stale` (fail-closed enforcement on non-observed states per `feedback_fail_closed_discipline`; `Unobserved` is the missing-evidence arm — not the bare label `Missing`, to avoid witness/bootstrap collisions) - `shared_external_attachment_pattern_documented` — **CONSUMER_LANDED** (ledger: `docs/r3-program-plan.md` §1.8 row 55): `WorkflowObservationAnchor` factored separately from timing as reusable external-data attachment primitive (serves coverage / logs / failures / artifacts beyond timing); pattern documented in [`docs/design-timing-lens.md`](design-timing-lens.md) §2 with six invariants (stable subject identity not span; observed-artifact identity/digest; producer/observer/prover identity; attachment timestamp + run id; `Observed` vs missing-evidence / ambiguous / stale report states; fail-closed enforcement on non-observed/non-valid states); promotion to generic `ExternalDataAnchor` carrier deferred to second concrete consumer per Substrate Mgr design stance (`ProofReceipt` likely; per `gunb-ai/ctrl#369` reshaped scope) - `ci_workflow_modeled_as_dag` — at least one workflow modeled as `.dag` data (CI workflow recommended as demonstration target per Director scope); workflow-as-data thesis instantiated; `gunb-ai/gunb.ai` repo's existing CI infrastructure (substantial bazel-ci.yml at ~84KB) surveyed for portable patterns during carrier authoring (worker-level survey, not gating substrate-shape decision) - - `ci_yml_hand_authority_dissolved` — (NEW 2026-05-12 per T-WAD FULL R3 elevation; operator directive + Director ratification msg_5cbdad24 + msg_f9fd669e + (b) ledger-sync disposition msg_2a68a4b5; in-flight scope authority at PR #2744 §1) `.github/workflows/ci.yml` is no longer hand-authored CI logic — file is either (a) absent, (b) committed-emission-artifact byte-identical to `project_github_actions(ci_workflow_dag, target)` output with regression-guard test, or (c) thin-shim entry-point invoking emitted binary/python; in NO case hand-edited. Per briansrls BLOCKING #PR2744 inline review fix 2026-05-12: deleting hand-maintenance ≠ deleting executable artifact; P5 / Pure Bootstrap dissolves AUTHORITY, not file presence - - `workflow_runtime_open_enum_landed` — (NEW 2026-05-12) `WorkflowRuntime` sum-type with 3 initial arms (`YamlStatic | BinaryShim | PythonShim | ...`) declared in gunbc namespace as open enum; per (c-refined) shape ratified at PR #2749 §7 + Director msg_237bde05 / msg_f9fd669e. `InlineGunbc` is DESIGN-ONLY per PR #2746 §5.4 — NOT in initial enum; lands via separate substrate-prereq PR paired with a runtime consumer (per openai-pro BLOCKING fix 2026-05-12 on PR #2744) + - `ci_yml_hand_authority_dissolved` — (NEW 2026-05-12 per T-WAD FULL R3 elevation; operator directive + Director ratification msg_5cbdad24 + msg_f9fd669e + (b) ledger-sync disposition msg_2a68a4b5; in-flight scope authority at PR #2744 §1) `.github/workflows/ci.yml` is no longer hand-authored CI logic — file is either (a) committed-emission-artifact byte-identical to `project_github_actions(ci_workflow_dag, target)` output with regression-guard test, or (b) thin-shim entry-point invoking the emitted binary; in NO case hand-edited and in NO case absent for the initial enum. Per briansrls BLOCKING #PR2744 inline review fix 2026-05-12: deleting hand-maintenance != deleting executable artifact; P5 / Pure Bootstrap dissolves AUTHORITY, not file presence + - `workflow_runtime_open_enum_landed` — (NEW 2026-05-12) `WorkflowRuntime` sum-type with 2 initial arms (`YamlStatic | BinaryShim | ...`) declared in gunbc namespace as open enum; per (c-refined) shape ratified at PR #2749 §7 + Director msg_237bde05 / msg_f9fd669e. `PythonShim` and `InlineGunbc` are DESIGN-ONLY future targets — NOT in initial enum; each lands via separate substrate-prereq PR paired with a runtime consumer. - `project_github_actions_landed` — (NEW 2026-05-12) `project_github_actions: (CIWorkflowDag, WorkflowRuntime) -> Workflow` projection function declared in gunbc namespace; consumes `extdeps.github.actions.Workflow` as codomain type + `CIWorkflowDag` (PR #2736 carrier introduction) as input domain; per (c-refined) substrate-shape per PR #2749 §7; WI-2 lands DECLARATION + signature only (per-arm bodies are Slice 4-5 work owned by Substrate Mgr) - `test_cost_dimension_landed` — (NEW 2026-05-12; cross-lane co-owned with Debt-Paydown Cluster M sub-component) `Cost` dimension declared on test nodes. **Distinct from existing compiler-internal cost gates** (#37 / #39 / #40 / #70 / #80 are about `SymbolicCost` as the compiler's cost lens reading target programs); this gate is about `Cost`-as-`Dimension` applied to **test nodes** so wall-clock ratchet facts **can** attach to modeled test nodes (substrate-shape sibling of state-check #102 below). - `slow_test_exemptions_dissolved` — (NEW 2026-05-12; cross-lane co-owned with Debt-Paydown) **Pass target:** ratchet policy comes from modeled test-node timing / `TestNodeCostDimension` facts — no hand-maintained warn-manifest side file. **Interim:** `scripts/slow-test-exemptions.txt` deleted; structured JSONL (`scripts/test-node-wall-clock-ratchet.jsonl`) still read by `check-test-timeout.sh` until the runner wires through substrate facts (P5 bridge, not #102 closure). State-check sibling of `test_cost_dimension_landed` per kernel-modeling discipline split (`feedback_state_space_vs_behavioral_invariants` + Director msg_f9fd669e). diff --git a/dsl/gunbc/ci_emission.dag b/dsl/gunbc/ci_emission.dag index 811ac572e5e..d3a3984d11c 100644 --- a/dsl/gunbc/ci_emission.dag +++ b/dsl/gunbc/ci_emission.dag @@ -12,7 +12,6 @@ module gunbc.ci_emission import gunbc.ci { CIWorkflowDag, ci_workflow_dag } -import gunbc.ci.github_actions_workflow { gunbc_ci_github_actions_workflow } import extdeps.github.actions { Workflow, Job, RunStep, UsesStep, HostedRunner, UbuntuLatest, @@ -20,11 +19,12 @@ import extdeps.github.actions { } // 🟡 YELLOW (scaffold) — coproduct-dissolution receipt (see modeling-discipline Practice 4). -// Ratified initial surface: YamlStatic | BinaryShim | PythonShim (`docs/design-ci-workflow-emitter-dispatch.md` §3; -// `docs/briefs/t-wad-wi2-substrate-and-slice4-yamlstatic-body-worker.md` §1). `InlineGunbc` stays off the enum until a -// real runtime consumer exists (emitter-dispatch §5.4). +// Ratified initial surface: YamlStatic | BinaryShim +// (`docs/r3-t-workflow-as-data-full-r3-close-scope.md` §1 gate #99). +// PythonShim and InlineGunbc stay off the enum until a real runtime consumer +// lands with the corresponding substrate-prereq PR. -type WorkflowRuntime = YamlStatic | BinaryShim | PythonShim +type WorkflowRuntime = YamlStatic | BinaryShim // Slice 5: BinaryShim thin-shim `Workflow` projection (design-ci-workflow-emitter-dispatch.md §5.2). // @@ -80,15 +80,11 @@ fn gunbc_ci_emission_binary_shim_workflow(dag: CIWorkflowDag) -> Workflow = Work permissions: dag.github_actions_workflow.permissions } -// PythonShim placeholder retained until that arm body lands (separate slice / brief). -data gunbc_ci_emission_python_shim_placeholder_workflow: Workflow = gunbc_ci_github_actions_workflow - // v3 tokenizer maps `fn`, not legacy `func` (which becomes `Ident("func")` and fails top-level dispatch). fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow = match runtime { YamlStatic => dag.github_actions_workflow BinaryShim => gunbc_ci_emission_binary_shim_workflow(dag) - PythonShim => gunbc_ci_emission_python_shim_placeholder_workflow } // Pinned projection: same `ci_workflow_dag` row, YamlStatic transport (Slice 4). diff --git a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs index 326ca598b0c..ab49ec33b40 100644 --- a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs +++ b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs @@ -578,6 +578,34 @@ fn variant_label(dag: &v3_compiler::dag::Dag, sum_name: &str, value: &FieldValue panic!("unexpected {sum_name} constructor {constructor:?}"); } +fn disj_variant_labels(dag: &v3_compiler::dag::Dag, sum_name: &str) -> Vec { + let mut decl_id = dag + .declaration_by_name(sum_name) + .unwrap_or_else(|| panic!("missing sum `{sum_name}`")) + .id; + const PEEL_MAX: usize = 64; + for _ in 0..PEEL_MAX { + let decl = dag.declaration(decl_id); + match &decl.connective { + TypeConnective::Instantiation { + template, + arguments, + } if arguments.is_empty() => { + decl_id = *template; + } + TypeConnective::Disj { variants } => { + return variants.iter().map(|v| v.label.clone()).collect(); + } + TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) + | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { + decl_id = *next; + } + _ => panic!("unexpected connective while resolving `{sum_name}`"), + } + } + panic!("peel depth exceeded resolving `{sum_name}`"); +} + fn structural_list(value: &FieldValue) -> &[FieldValue] { let FieldValue::List(items) = value else { panic!("expected structural list field, got {value:?}"); @@ -815,10 +843,42 @@ fn gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output() { } #[test] -fn gunbc_ci_emission_substrate_compiles() { - let dag = compile_to_dag(GUNBC_CI_EMISSION_SOURCE, GUNBC_CI_EMISSION_FILE) - .unwrap_or_else(|err| panic!("compile {GUNBC_CI_EMISSION_FILE}: {err:?}")); - assert!(dag.diagnostics().is_empty(), "{:?}", dag.diagnostics()); +fn gunbc_ci_emission_substrate_contract_is_present() { + assert!( + GUNBC_CI_EMISSION_SOURCE.contains( + "fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow" + ), + "{GUNBC_CI_EMISSION_FILE} must declare the T-WAD projection-function contract" + ); + assert!( + GUNBC_CI_EMISSION_SOURCE + .contains("data gunbc_ci_yml_workflow: Workflow = project_github_actions(ci_workflow_dag, YamlStatic)"), + "{GUNBC_CI_EMISSION_FILE} must pin the YamlStatic projection binding" + ); +} + +#[test] +fn workflow_runtime_initial_enum_matches_t_wad_gate_99() { + let runtime_line = GUNBC_CI_EMISSION_SOURCE + .lines() + .find(|line| line.starts_with("type WorkflowRuntime =")) + .expect("WorkflowRuntime type declaration"); + let dag = compile_to_dag( + runtime_line, + "dsl/gunbc/ci_emission.workflow_runtime.slice.dag", + ) + .unwrap_or_else(|err| panic!("compile WorkflowRuntime slice: {err:?}")); + assert!( + dag.diagnostics().is_empty(), + "WorkflowRuntime slice diagnostics: {:?}", + dag.diagnostics() + ); + assert_eq!( + disj_variant_labels(&dag, "WorkflowRuntime"), + ["YamlStatic", "BinaryShim"], + "T-WAD gate #99 initial WorkflowRuntime surface must stay paired to real consumers; \ + PythonShim and InlineGunbc remain design-only until their substrate-prereq PRs land" + ); } // --- R3 gate #57 (`lens_self_application_demonstrated`) — split receipts per TESTING.md §4. From 7f2045c8cab449c64606b5b782850a808481ad55 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 13 May 2026 16:42:19 -0400 Subject: [PATCH 2/5] =?UTF-8?q?WIP:=20R3=20Gap=207=20T-WAD=20Slice=204=20s?= =?UTF-8?q?ubstrate=20prereq=20landings=20=E2=80=94=20gates=20#98-#103=20s?= =?UTF-8?q?ubstr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dsl/gunbc/ci_emission.dag | 4 +- src/v3/compiler/src/lib.rs | 18 +++++++++ .../t_ci_workflow_as_data_demo_test.rs | 37 ++++++++++++++++++- 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/dsl/gunbc/ci_emission.dag b/dsl/gunbc/ci_emission.dag index d3a3984d11c..587a92ed1c9 100644 --- a/dsl/gunbc/ci_emission.dag +++ b/dsl/gunbc/ci_emission.dag @@ -39,11 +39,11 @@ type WorkflowRuntime = YamlStatic | BinaryShim // // Binary `main()` and affected-set selection are out of scope — the arm // emits a `Workflow` that *references* the binary, not the binary itself. -fn gunbc_ci_emission_binary_shim_workflow(dag: CIWorkflowDag) -> Workflow = Workflow { +fn gunbc_ci_emission_binary_shim_workflow(dag: CIWorkflowDag) -> Workflow = { name: dag.github_actions_workflow.name, on: dag.github_actions_workflow.on, concurrency: dag.github_actions_workflow.concurrency, - jobs: [Job { + jobs: [{ id: "ci", name: none, runner: HostedRunner { label: UbuntuLatest }, diff --git a/src/v3/compiler/src/lib.rs b/src/v3/compiler/src/lib.rs index 3ac690f8ca7..1180902129e 100644 --- a/src/v3/compiler/src/lib.rs +++ b/src/v3/compiler/src/lib.rs @@ -5591,6 +5591,24 @@ pub fn compile_to_dag(source: &str, file: &str) -> Result { } } +#[doc(hidden)] +#[allow(clippy::result_large_err)] +pub fn compile_sources_to_dag(sources: &[(&str, &str)]) -> Result { + let mut dag = Dag::new(); + for (source, file) in sources { + let tokens = tokenize::tokenize(source, file).map_err(CompileError::Tokenize)?; + let surface = parse::parse(&tokens, file).map_err(CompileError::Parse)?; + lower::lower_into(&mut dag, &surface); + r3_fc_lane2_loop_witness::apply_authored_lane2_loop_witness(&mut dag, source, file); + } + infer::infer(&mut dag); + if dag.diagnostics().is_empty() { + Ok(dag) + } else { + Err(CompileError::Semantic(dag)) + } +} + /// Structural witness for integer literal range narrowing: the /// `IntegerAlgebra` and `TargetCarrier` variant payload [`dag::DeclarationId`]s /// used to match rows in `rust_pilot_primitives`, derived from std diff --git a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs index ab49ec33b40..50b7ff123d3 100644 --- a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs +++ b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs @@ -58,7 +58,7 @@ use v3_compiler::gunbc_ci::{ }; use v3_compiler::lens_cost::complexity_of; use v3_compiler::{ - analyze_complexity, analyze_symbolic_cost_dimension, compile_to_dag, + analyze_complexity, analyze_symbolic_cost_dimension, compile_sources_to_dag, compile_to_dag, generated_full_bootstrap_dag, CompileError, DimensionReport, }; @@ -70,6 +70,28 @@ const GUNBC_CI_GITHUB_WORKFLOW_SOURCE: &str = const GUNBC_CI_GITHUB_WORKFLOW_FILE: &str = "dsl/gunbc/ci_github_actions_workflow.dag"; const GUNBC_CI_EMISSION_SOURCE: &str = include_str!("../../../../../dsl/gunbc/ci_emission.dag"); const GUNBC_CI_EMISSION_FILE: &str = "dsl/gunbc/ci_emission.dag"; +const GUNBC_CI_EMISSION_COMPILE_CONTEXT_SOURCE: &str = r#" +module gunbc.ci + +import extdeps.github.actions { Workflow } + +type CIWorkflowDag { + github_actions_workflow: Workflow +} + +data ci_workflow_dag: CIWorkflowDag = { + github_actions_workflow: { + name: "ci", + on: [], + concurrency: none, + jobs: [], + env: none, + permissions: none + } +} +"#; +const GUNBC_CI_EMISSION_COMPILE_CONTEXT_FILE: &str = + "dsl/gunbc/ci_emission_compile_context.dag"; const R3_GATE57_CI_TIMING_LENS_CARRIER_SOURCE: &str = include_str!("../fixtures/r3_gate57_ci_workflow_timing_lens_carrier.dag"); const R3_GATE57_CI_TIMING_LENS_CARRIER_FILE: &str = @@ -844,6 +866,19 @@ fn gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output() { #[test] fn gunbc_ci_emission_substrate_contract_is_present() { + let dag = compile_sources_to_dag(&[ + ( + GUNBC_CI_EMISSION_COMPILE_CONTEXT_SOURCE, + GUNBC_CI_EMISSION_COMPILE_CONTEXT_FILE, + ), + (GUNBC_CI_EMISSION_SOURCE, GUNBC_CI_EMISSION_FILE), + ]) + .unwrap_or_else(|err| panic!("compile gunbc CI emission context: {err:?}")); + assert!( + dag.diagnostics().is_empty(), + "gunbc CI emission context diagnostics: {:?}", + dag.diagnostics() + ); assert!( GUNBC_CI_EMISSION_SOURCE.contains( "fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow" From ed8105de0849f393d8897a164a51f612a64502f3 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 13 May 2026 16:43:55 -0400 Subject: [PATCH 3/5] =?UTF-8?q?WIP:=20R3=20Gap=207=20T-WAD=20Slice=204=20s?= =?UTF-8?q?ubstrate=20prereq=20landings=20=E2=80=94=20gates=20#98-#103=20s?= =?UTF-8?q?ubstr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v3/compiler/src/lib.rs | 18 -------------- .../t_ci_workflow_as_data_demo_test.rs | 24 +------------------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/src/v3/compiler/src/lib.rs b/src/v3/compiler/src/lib.rs index 1180902129e..3ac690f8ca7 100644 --- a/src/v3/compiler/src/lib.rs +++ b/src/v3/compiler/src/lib.rs @@ -5591,24 +5591,6 @@ pub fn compile_to_dag(source: &str, file: &str) -> Result { } } -#[doc(hidden)] -#[allow(clippy::result_large_err)] -pub fn compile_sources_to_dag(sources: &[(&str, &str)]) -> Result { - let mut dag = Dag::new(); - for (source, file) in sources { - let tokens = tokenize::tokenize(source, file).map_err(CompileError::Tokenize)?; - let surface = parse::parse(&tokens, file).map_err(CompileError::Parse)?; - lower::lower_into(&mut dag, &surface); - r3_fc_lane2_loop_witness::apply_authored_lane2_loop_witness(&mut dag, source, file); - } - infer::infer(&mut dag); - if dag.diagnostics().is_empty() { - Ok(dag) - } else { - Err(CompileError::Semantic(dag)) - } -} - /// Structural witness for integer literal range narrowing: the /// `IntegerAlgebra` and `TargetCarrier` variant payload [`dag::DeclarationId`]s /// used to match rows in `rust_pilot_primitives`, derived from std diff --git a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs index 50b7ff123d3..9ee27e55cb2 100644 --- a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs +++ b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs @@ -58,7 +58,7 @@ use v3_compiler::gunbc_ci::{ }; use v3_compiler::lens_cost::complexity_of; use v3_compiler::{ - analyze_complexity, analyze_symbolic_cost_dimension, compile_sources_to_dag, compile_to_dag, + analyze_complexity, analyze_symbolic_cost_dimension, compile_to_dag, generated_full_bootstrap_dag, CompileError, DimensionReport, }; @@ -70,28 +70,6 @@ const GUNBC_CI_GITHUB_WORKFLOW_SOURCE: &str = const GUNBC_CI_GITHUB_WORKFLOW_FILE: &str = "dsl/gunbc/ci_github_actions_workflow.dag"; const GUNBC_CI_EMISSION_SOURCE: &str = include_str!("../../../../../dsl/gunbc/ci_emission.dag"); const GUNBC_CI_EMISSION_FILE: &str = "dsl/gunbc/ci_emission.dag"; -const GUNBC_CI_EMISSION_COMPILE_CONTEXT_SOURCE: &str = r#" -module gunbc.ci - -import extdeps.github.actions { Workflow } - -type CIWorkflowDag { - github_actions_workflow: Workflow -} - -data ci_workflow_dag: CIWorkflowDag = { - github_actions_workflow: { - name: "ci", - on: [], - concurrency: none, - jobs: [], - env: none, - permissions: none - } -} -"#; -const GUNBC_CI_EMISSION_COMPILE_CONTEXT_FILE: &str = - "dsl/gunbc/ci_emission_compile_context.dag"; const R3_GATE57_CI_TIMING_LENS_CARRIER_SOURCE: &str = include_str!("../fixtures/r3_gate57_ci_workflow_timing_lens_carrier.dag"); const R3_GATE57_CI_TIMING_LENS_CARRIER_FILE: &str = From 5e48e65ce4bba90ac3f4a65b24627029c29093cd Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 13 May 2026 16:46:57 -0400 Subject: [PATCH 4/5] =?UTF-8?q?WIP:=20R3=20Gap=207=20T-WAD=20Slice=204=20s?= =?UTF-8?q?ubstrate=20prereq=20landings=20=E2=80=94=20gates=20#98-#103=20s?= =?UTF-8?q?ubstr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/t_ci_workflow_as_data_demo_test.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs index 9ee27e55cb2..ab49ec33b40 100644 --- a/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs +++ b/src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs @@ -844,19 +844,6 @@ fn gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output() { #[test] fn gunbc_ci_emission_substrate_contract_is_present() { - let dag = compile_sources_to_dag(&[ - ( - GUNBC_CI_EMISSION_COMPILE_CONTEXT_SOURCE, - GUNBC_CI_EMISSION_COMPILE_CONTEXT_FILE, - ), - (GUNBC_CI_EMISSION_SOURCE, GUNBC_CI_EMISSION_FILE), - ]) - .unwrap_or_else(|err| panic!("compile gunbc CI emission context: {err:?}")); - assert!( - dag.diagnostics().is_empty(), - "gunbc CI emission context diagnostics: {:?}", - dag.diagnostics() - ); assert!( GUNBC_CI_EMISSION_SOURCE.contains( "fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow" From 5db6136fc0df91b1b3f541fd5ce3401d4bcc9c43 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 13 May 2026 21:21:44 +0000 Subject: [PATCH 5/5] Clarify project_github_actions gate receipt --- docs/r3-program-plan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index 47f88dc8080..de60096f071 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -325,7 +325,7 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap | 97 | `method_template_projection_emit_shim_retirement_coherence` | state-check | R2-Grounding-Rust ([Gunbc **#1982**](https://github.com/gunb-ai/gunbc/issues/1982)) | **CONSUMER_LANDED + PASSING** | Q-V2-Retirement-Boundary-Matrix (**G6**) — Gap-4 `pb_method_template_projection_dag_emit` + **`[[bin]]` `emit_method_template_projection`** in `src/v3/compiler/Cargo.toml` + `src/bin/emit_method_template_projection.rs` must exist **iff** **`src/v2/stage0/`** remains (`autobins = false` — manifest target is load-bearing). Consumer: **`method_template_projection_emit_shim_coherence_test.rs`** + SG-0 census path gate. Terminal retirement = v2 tree absent ⇒ lib + bin table + bin source absent; coherence holds continuously. | | 98 | `ci_yml_hand_authority_dissolved` | state-check | T-Workflow-As-Data | DECLARED (NEW 2026-05-12 per PR #2744 §1 — T-WAD FULL R3 elevation per operator directive 2026-05-12 + Director ratification msg_5cbdad24 + msg_f9fd669e) | `.github/workflows/ci.yml` is no longer hand-authored CI logic — file is either (a) committed-emission-artifact byte-identical to `project_github_actions(ci_workflow_dag, target)` output with regression-guard test (YamlStatic), or (b) thin-shim entry-point invoking the emitted binary (BinaryShim); in NO case is it hand-edited CI logic AND in NO case is the artifact absent for the initial enum. Regression guard test prevents hand-authored re-introduction. Per briansrls BLOCKING #PR2744 inline review fix 2026-05-12: deleting hand-maintenance != deleting executable artifact; P5 / Pure Bootstrap dissolves AUTHORITY, not file presence. | | 99 | `workflow_runtime_open_enum_landed` | substrate-shape | T-Workflow-As-Data | **CONSUMER_LANDED + PASSING** — `WorkflowRuntime = YamlStatic \| BinaryShim` declared at `dsl/gunbc/ci_emission.dag:27`; substrate consumer: `workflow_runtime_initial_enum_matches_t_wad_gate_99` at `src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs` compiles the isolated `WorkflowRuntime` declaration slice and asserts the initial variant labels exactly match `YamlStatic` and `BinaryShim`. Per (c-refined) shape ratified at PR #2749 §7 + Director msg_237bde05 / msg_f9fd669e. `PythonShim` and `InlineGunbc` are DESIGN-ONLY future targets — NOT in the initial enum; each lands via separate substrate-prereq PR paired with a runtime consumer. | -| 100 | `project_github_actions_landed` | substrate-shape | T-Workflow-As-Data | **CONSUMER_LANDED + PASSING** — `fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow` declared at `dsl/gunbc/ci_emission.dag:87`; pinned consumer binding `data gunbc_ci_yml_workflow: Workflow = project_github_actions(ci_workflow_dag, YamlStatic)` at `dsl/gunbc/ci_emission.dag:95`. Consumes `extdeps.github.actions.Workflow` as codomain + `CIWorkflowDag` (PR #2736 carrier) as input domain per (c-refined) substrate-shape per PR #2749 §7. Contract consumer: `gunbc_ci_emission_substrate_contract_is_present` at `src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs` pins the projection signature and `YamlStatic` binding text; the separate YAML-authority byte-drift guard ratchets `.github/workflows/ci.yml` against `gen_gunbc_ci_workflow_dag` output and is not an emit-back consumer of `project_github_actions`. The `.dag`-authoritative emit-back consumer + per-arm body completion remain Slice 4-5 follow-on under #98 `ci_yml_hand_authority_dissolved`. | +| 100 | `project_github_actions_landed` | substrate-shape | T-Workflow-As-Data | **DECLARED + TEXT-RATCHETED** — `fn project_github_actions(dag: CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow` declared at `dsl/gunbc/ci_emission.dag:87`; pinned binding `data gunbc_ci_yml_workflow: Workflow = project_github_actions(ci_workflow_dag, YamlStatic)` at `dsl/gunbc/ci_emission.dag:95`. Consumes `extdeps.github.actions.Workflow` as codomain + `CIWorkflowDag` (PR #2736 carrier) as input domain per (c-refined) substrate-shape per PR #2749 §7. Current receipt: `gunbc_ci_emission_substrate_contract_is_present` at `src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs` pins the projection signature and `YamlStatic` binding as source text only; it is not a full-file v3 type-check of `project_github_actions`. The separate YAML-authority byte-drift guard ratchets `.github/workflows/ci.yml` against `gen_gunbc_ci_workflow_dag` output and is not an emit-back consumer of `project_github_actions`. The full `.dag`-authoritative emit-back/type-check receipt + per-arm body completion remain Slice 4-5 follow-on under #98 `ci_yml_hand_authority_dissolved`. | | 101 | `test_cost_dimension_landed` | substrate-shape | T-Workflow-As-Data + Debt-Paydown (Cluster M sub-component) | **CONSUMER_LANDED + PASSING** — `type TestNodeCostDimension` declared at `src/v3/std/verification.dag:578` and `dsl/std/verification.dag:75` (v3 authority reuses T-WAD timing substrate via `TimingBudget` + `TimingMeasurement` over Nanoseconds; legacy dsl projection uses branded non-negative Milliseconds and is marked to retire/rewire under #102) per PR #2761 (eager-crane-176, squash-merged 2026-05-12T18:07:31Z). P5 hand-Rust consumer receipt: `test_cost_dimension_landed_on_test_node` at `src/v3/compiler/tests/integration/test_runner_test.rs:287` compiles a `TestNodeCostDimension` row, asserts the nested timing-budget shape, and routes the referenced `TestClaim` through `TestRunner`. **Distinct from existing compiler-internal cost gates** (#37 `cost_lens_reads_target_realization` / #39 `no_coercion_cost_dimension` / #40 `symbolic_cost_expr_equals_executable` / #70 `cost_lens_demonstration` / #80 `cost_lens_behaviorally_complete` are about `SymbolicCost` as the compiler's cost lens reading target programs); this gate is about `Cost`-as-`Dimension` applied to **test nodes** so the slow-test ratchet **can** attach wall-clock facts to modeled test nodes instead of treating exemptions as an unstructured compiler-local table (substrate-shape sibling of state-check #102). | | 102 | `slow_test_exemptions_dissolved` | state-check | T-Workflow-As-Data + Debt-Paydown | DECLARED (NEW 2026-05-12 per PR #2744 §1) | **Pass target:** slow-test ratchet policy is read from modeled test-node timing / `TestNodeCostDimension` substrate facts (no checked-in warn-manifest side input). **Interim (not closure):** `scripts/slow-test-exemptions.txt` is deleted and warn rows live in structured `scripts/test-node-wall-clock-ratchet.jsonl` while CI still reads that file directly — bridge work toward #101/#102, not a claim that #102 is GREEN. Pair with kernel-modeling split per `feedback_state_space_vs_behavioral_invariants` + Director msg_f9fd669e. | | 103 | `ci_uses_affected_set_selection` | state-check | T-Workflow-As-Data + T-Verification | DECLARED (NEW 2026-05-12 per PR #2744 §1) | `BinaryShim` emitter consumes affected-set lens output from PR #2713 (merged); Layer 2 path-regex `if:` gates removed from any remaining workflow files (cross-tier co-owned with clever-tern-670 Slice 7 work). |