From 6c7e6f9aa1262b39d91eebaba95c0cfe509fac8c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 04:22:52 +0000 Subject: [PATCH 01/13] =?UTF-8?q?WIP:=20Wave=202=20=C2=A711.7.4=20?= =?UTF-8?q?=E2=80=94=20CiUpsertStep=20Class=20A=20shell=20exceptions=20(bo?= =?UTF-8?q?otstrap/M1/no-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/workflow/ci.dag | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 65662373430..8ff138e0f4e 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -366,6 +366,72 @@ data ci_always_run_carveouts: List = [ } ] +// ── Wave 2 — §11.7.5 temporary shell exception table (Class A safety floor) ────────────────── +// Authority: #4137 §11.7.5 "The temporary CI cut rule (codified)". A shell-owned check may remain +// REQUIRED on every PR only if it (1) protects a named §11.7.1 safety-floor item, (2) has no +// runtime-authoritative `CiUpsertStep` replacement yet, (3) is listed in THIS table, (4) names a +// structural dissolution path. Conditions (2)+(3) are definitional: a row exists here iff the step +// is still shell-owned and not yet emitted FROM its `CiUpsertStep` as ci.yml runtime authority. +// This is the first executable slice of Wave 2 (shell→`CiUpsertStep` migration, §11.7.7 lane 6): +// it models the exception registry the no-new-shell ratchet (§11.7.1 #5) consumes — the set of +// REQUIRED shell-owned ci-floor steps must equal these rows' `step_id`s; any unlisted required +// shell is a ratchet regression. Reuses `CiStepId` + `DissolutionTarget` (no parallel exception +// genus); sibling to `ci_always_run_carveouts` (run-policy carveout) — distinct concept (shell +// retirement vs always-run), shared leaf substrate. + +// §11.7.1 bare-minimum safety-floor item a shell exception protects (§11.7.5 cond 1). +type CiSafetyFloorItem + = FmtCheck + | BootstrapMinimalViability + | OneRustEmitProbe + | CiDagStructuralReceipt + | NoNewShellRatchet + +// Repo-relative path of the `.github/ci-floor/*.sh` script currently owning a Class-A floor step. +type ShellScriptPath = String + +// 🟡 coproduct dissolution — feature:wave2-class-a-shell-exception-table — bind #4137 §11.7.5 — dissolve-on-arrival: a row is DELETED when ci.yml emits its `step_id` FROM `replacement_upsert` as runtime authority (T-24), not when the shadow `CiUpsertStep` row merely exists; forbidden: a row without a named `dissolution_target`, or a Class-B/C/D (non-floor) step carried as a shell exception. +type CiShellExceptionRow { + step_id: CiStepId + shell_owner: ShellScriptPath + protects_floor: CiSafetyFloorItem + // The shadow `CiUpsertStep` that retires this row once it becomes ci.yml runtime authority. + replacement_upsert: Symbol + dissolution_target: DissolutionTarget +} + +// `replacement_upsert` symbol atoms — name the existing shadow `CiUpsertStep` rows (above) that +// each shell exception migrates onto. Dissolution `what` atoms — the runtime-authority emission +// substrate whose arrival deletes the row. +data ci_upsert_v2_bootstrap_smoke_execution_step: Symbol = ci_upsert_v2_bootstrap_smoke_execution_step +data ci_upsert_m1_rust_emit_probe_execution_step: Symbol = ci_upsert_m1_rust_emit_probe_execution_step +data ci_bootstrap_step_emitted_from_upsert_runtime_authority: Symbol = ci_bootstrap_step_emitted_from_upsert_runtime_authority +data ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority: Symbol = ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority + +data ci_class_a_shell_exceptions: List = [ + CiShellExceptionRow { + step_id: JobStep { job: v2_bootstrap_smoke_execution, step: v2_bootstrap_smoke_execution }, + shell_owner: ".github/ci-floor/v4-bootstrap-viability.sh", + protects_floor: BootstrapMinimalViability, + replacement_upsert: ci_upsert_v2_bootstrap_smoke_execution_step, + dissolution_target: ModelMissingSubstrate { + what: ci_bootstrap_step_emitted_from_upsert_runtime_authority + } + }, + CiShellExceptionRow { + step_id: JobStep { + job: m1_rust_emit_probe_execution, + step: m1_rust_emit_probe_execution + }, + shell_owner: ".github/ci-floor/v4-m1-rust-emit-probe.sh", + protects_floor: OneRustEmitProbe, + replacement_upsert: ci_upsert_m1_rust_emit_probe_execution_step, + dissolution_target: ModelMissingSubstrate { + what: ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority + } + } +] + // Wave 3 §11.7.4 — extend existing receipt (arbiter §8 2026-06-01); no parallel shadow receipt type. // 🟡 coproduct dissolution — feature:wave3-shadow-selection-receipt — bind Wave 4 active-skip — dissolve-on-arrival: `CiActiveFloorSkipEvidence` is populated from cached TestClaimRun verdict partition; forbidden: bare `Active` tag without skip evidence (illegal floor-skip state). type CiActiveFloorSkipEvidence { From 91d69100e72a265c621f114196aa61e1aad447be Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 04:25:18 +0000 Subject: [PATCH 02/13] =?UTF-8?q?Wave=202=20=C2=A711.7.5:=20model=20Class-?= =?UTF-8?q?A=20temporary=20shell=20exception=20table=20(bootstrap/M1)=20?= =?UTF-8?q?=E2=80=94=20first=20executable=20slice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authority: #4137 §11.7.5 "The temporary CI cut rule (codified)". First slice of the Wave 2 shell→CiUpsertStep migration (§11.7.7 lane 6): model the registry of Class-A shell-owned floor steps allowed to stay REQUIRED pending their runtime-authoritative CiUpsertStep replacement. ci.dag: - `CiSafetyFloorItem` (§11.7.1 bare-minimum floor enum) + `CiShellExceptionRow`, reusing existing `CiStepId` + `DissolutionTarget` (no parallel exception genus; sibling to `ci_always_run_carveouts` — distinct concept: shell retirement vs always-run run-policy). - `ci_class_a_shell_exceptions`: two rows — bootstrap viability (v4-bootstrap-viability.sh) and M1 rust emit probe (v4-m1-rust-emit-probe.sh), each citing the floor item it protects + a structural dissolution_target (ci.yml emitted FROM the CiUpsertStep as T-24 runtime authority). Executable slice (smoke test): table well-formedness (exactly bootstrap+M1, structural dissolution per row), forward binding (each shell_owner is a live required ci.yml floor invocation), and the no-new-shell ratchet (§11.7.1 #5): every REQUIRED ci-floor/*.sh invocation in ci.yml must carry an exception row. Test: CTRL_BUILD_WRAP_CARGO=0 cargo test -p v3-compiler v4_workflow_ci_runner_dag_smoke_test — 38/38 passed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 04f20ce17e0..85f72fabb73 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1120,6 +1120,99 @@ fn v4_workflow_ci_bootstrap_gate_skip_policy_is_modeled() { ); } +/// Wave 2 — §11.7.5 temporary shell exception table (first executable slice). Authority: #4137 +/// §11.7.5. Models the Class-A shell-owned floor steps allowed to stay REQUIRED pending their +/// `CiUpsertStep` runtime-authority migration (bootstrap viability + M1 rust emit), and the +/// no-new-shell ratchet (§11.7.1 #5): every REQUIRED ci-floor shell invocation in ci.yml must +/// carry a row here. Dissolve-on: ci.yml emits these steps FROM their `CiUpsertStep` (T-24), +/// at which point the rows delete and this slice retires. +#[test] +fn v4_workflow_ci_class_a_shell_exception_table_first_slice() { + let module = parse_module(CI_DAG, CI_DAG_PATH); + + // Type substrate: the exception-row record + the §11.7.1 safety-floor enum it cites. + assert!( + module.items.iter().any(|item| matches!( + item, + SurfaceItem::TypeRecord { name, .. } if name == "CiShellExceptionRow" + )), + "{CI_DAG_PATH}: §11.7.5 must model CiShellExceptionRow" + ); + assert!( + module.items.iter().any(|item| matches!( + item, + SurfaceItem::TypeSum { name, .. } if name == "CiSafetyFloorItem" + )), + "{CI_DAG_PATH}: §11.7.5 must model the §11.7.1 safety-floor item enum" + ); + + // Isolate the table body so per-row assertions can't accidentally match elsewhere. + let table = CI_DAG + .split("data ci_class_a_shell_exceptions:") + .nth(1) + .unwrap_or_else(|| panic!("{CI_DAG_PATH}: missing data ci_class_a_shell_exceptions")) + .split("\n]") + .next() + .expect("ci_class_a_shell_exceptions table must terminate with `]`"); + + // Exactly the two Class-A shell-owned floor steps carry an exception: bootstrap + M1. + assert_eq!( + table.matches("CiShellExceptionRow {").count(), + 2, + "{CI_DAG_PATH}: §11.7.5 carries exactly two Class-A shell exceptions (bootstrap + M1)" + ); + for needle in [ + "job: v2_bootstrap_smoke_execution", + ".github/ci-floor/v4-bootstrap-viability.sh", + "protects_floor: BootstrapMinimalViability", + "job: m1_rust_emit_probe_execution", + ".github/ci-floor/v4-m1-rust-emit-probe.sh", + "protects_floor: OneRustEmitProbe", + ] { + assert!( + table.contains(needle), + "{CI_DAG_PATH}: shell exception table must carry `{needle}`" + ); + } + + // §11.7.5 cond 4 — every row names a structural dissolution path (no calendar/owner carrier). + assert_eq!( + table + .matches("dissolution_target: ModelMissingSubstrate") + .count(), + 2, + "{CI_DAG_PATH}: each shell exception must name a structural dissolution_target" + ); + + // §11.7.5 cond 1 — each row's shell_owner is a live REQUIRED ci.yml floor invocation + // (no phantom exception for a script that does not actually run on PRs). + for script in [ + ".github/ci-floor/v4-bootstrap-viability.sh", + ".github/ci-floor/v4-m1-rust-emit-probe.sh", + ] { + assert!( + CI_YML.contains(&format!("bash {script}")), + "{CI_YML_PATH}: shell exception owner `{script}` must be a live floor invocation" + ); + } + + // no-new-shell ratchet (§11.7.1 #5): the converse direction — every REQUIRED `ci-floor/*.sh` + // invocation in ci.yml must be listed in the table. A new required shell with no exception + // row is a ratchet regression caught here. + for line in CI_YML.lines() { + let trimmed = line.trim(); + if let Some(rest) = trimmed.strip_prefix("run: bash .github/ci-floor/") { + let leaf = rest.split_whitespace().next().unwrap_or(""); + let script = format!(".github/ci-floor/{leaf}"); + assert!( + table.contains(&script), + "{CI_YML_PATH}: required ci-floor shell `{script}` has no §11.7.5 \ + exception row (no-new-shell ratchet — add a CiShellExceptionRow or model it)" + ); + } + } +} + #[test] fn v4_workflow_affected_set_ci_runner_claim_dag_tokenizes_and_parses() { let _module = parse_module(CLAIM_DAG, CLAIM_PATH); From 32750d2c24839461a98a6c85fa7dac9c6f70fb85 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 04:31:46 +0000 Subject: [PATCH 03/13] Bind shell-exception replacement_upsert to canonical CiUpsertStepSymbol authority (codex RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex REQUEST_CHANGES: `replacement_upsert` used freshly-invented `_step` Symbol atoms instead of the existing CiUpsertStep authorities — a parallel symbol that can drift and cannot prove the named upsert exists (INVARIANTS P2 single-authority). Fix: change the field type from `Symbol` to `CiUpsertStepSymbol` and point each row at the canonical authority data (`ci_upsert_v2_bootstrap_smoke_execution` :950, `ci_upsert_m1_rust_emit_probe_execution` :1084); delete the two `_step` alias atoms. Dissolution `what` atoms retained — those name not-yet-existent runtime-authority substrate, the standard `ModelMissingSubstrate` pattern. Smoke test extended: asserts each `replacement_upsert` binds the named upsert AND that upsert is a declared `CiUpsertStepSymbol` (proves existence, blocks regression to a parallel alias). 38/38 passed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 19 +++++++++++++++++++ src/v4/workflow/ci.dag | 17 ++++++++--------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 85f72fabb73..6e9edea927b 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1175,6 +1175,25 @@ fn v4_workflow_ci_class_a_shell_exception_table_first_slice() { ); } + // P2 single-authority: `replacement_upsert` binds the canonical `CiUpsertStepSymbol` data + // declared elsewhere in this module — NOT a parallel `Symbol` alias that could drift or name + // a non-existent upsert. Assert both the table reference and the authority declaration exist. + for upsert in [ + "ci_upsert_v2_bootstrap_smoke_execution", + "ci_upsert_m1_rust_emit_probe_execution", + ] { + assert!( + table.contains(&format!("replacement_upsert: {upsert}")), + "{CI_DAG_PATH}: shell exception must point `replacement_upsert` at the canonical \ + upsert authority `{upsert}` (P2 single-authority — no parallel `_step` Symbol alias)" + ); + assert!( + CI_DAG.contains(&format!("data {upsert}: CiUpsertStepSymbol")), + "{CI_DAG_PATH}: `replacement_upsert` authority `{upsert}` must be a declared \ + `CiUpsertStepSymbol` (proves the named upsert exists)" + ); + } + // §11.7.5 cond 4 — every row names a structural dissolution path (no calendar/owner carrier). assert_eq!( table diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 8ff138e0f4e..897aa4a9d38 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -395,16 +395,15 @@ type CiShellExceptionRow { step_id: CiStepId shell_owner: ShellScriptPath protects_floor: CiSafetyFloorItem - // The shadow `CiUpsertStep` that retires this row once it becomes ci.yml runtime authority. - replacement_upsert: Symbol + // The existing shadow `CiUpsertStep` AUTHORITY that retires this row once it becomes ci.yml + // runtime authority. Binds to the canonical `CiUpsertStepSymbol` data (single-authority, P2) — + // NOT a parallel `Symbol` alias that could drift or name a non-existent upsert. + replacement_upsert: CiUpsertStepSymbol dissolution_target: DissolutionTarget } -// `replacement_upsert` symbol atoms — name the existing shadow `CiUpsertStep` rows (above) that -// each shell exception migrates onto. Dissolution `what` atoms — the runtime-authority emission -// substrate whose arrival deletes the row. -data ci_upsert_v2_bootstrap_smoke_execution_step: Symbol = ci_upsert_v2_bootstrap_smoke_execution_step -data ci_upsert_m1_rust_emit_probe_execution_step: Symbol = ci_upsert_m1_rust_emit_probe_execution_step +// Dissolution `what` atoms — the runtime-authority emission substrate whose arrival deletes the +// row (does NOT yet exist; standard `ModelMissingSubstrate` naming, like `ci_gate_run_policy_*`). data ci_bootstrap_step_emitted_from_upsert_runtime_authority: Symbol = ci_bootstrap_step_emitted_from_upsert_runtime_authority data ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority: Symbol = ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority @@ -413,7 +412,7 @@ data ci_class_a_shell_exceptions: List = [ step_id: JobStep { job: v2_bootstrap_smoke_execution, step: v2_bootstrap_smoke_execution }, shell_owner: ".github/ci-floor/v4-bootstrap-viability.sh", protects_floor: BootstrapMinimalViability, - replacement_upsert: ci_upsert_v2_bootstrap_smoke_execution_step, + replacement_upsert: ci_upsert_v2_bootstrap_smoke_execution, dissolution_target: ModelMissingSubstrate { what: ci_bootstrap_step_emitted_from_upsert_runtime_authority } @@ -425,7 +424,7 @@ data ci_class_a_shell_exceptions: List = [ }, shell_owner: ".github/ci-floor/v4-m1-rust-emit-probe.sh", protects_floor: OneRustEmitProbe, - replacement_upsert: ci_upsert_m1_rust_emit_probe_execution_step, + replacement_upsert: ci_upsert_m1_rust_emit_probe_execution, dissolution_target: ModelMissingSubstrate { what: ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority } From 7334b514dfc9b2f6c20cf92d258d94fec09cae89 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 04:37:18 +0000 Subject: [PATCH 04/13] =?UTF-8?q?Add=20explicit=20P5=20T-PB-B=20same-path?= =?UTF-8?q?=20receipt=20for=20the=20=C2=A711.7.5=20smoke=20test=20fn=20(co?= =?UTF-8?q?dex=20RC=20#4284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex RC: new hand-Rust test fn under src/v3/ lacks an explicit P5 receipt. This is a same-path SG-0 expansion: the SG-0 census is PATH-denominated (a .rs file counts by workspace-relative path membership, per sg0_census_test.rs), so adding a test FUNCTION to the existing v4_workflow_ci_runner_dag_smoke_test harness adds +0 new paths and is already covered by that file's single census entry — same posture as the T-38/T-38B expansions documented in the file header. Make the receipt explicit in the changed file: the new test's doc comment now names the P5 deferral lane (ROADMAP § "Nine lanes" row T-PB-B / pb_rust_tests_outside_residual_zero) and the concrete dissolution (generated .dag TestClaim execution covers the §11.7.5 table + no-new-shell ratchet, retiring the hand-Rust harness). No new authority surface. 38/38 smoke tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../integration/v4_workflow_ci_runner_dag_smoke_test.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 6e9edea927b..eef90ee278d 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1126,6 +1126,14 @@ fn v4_workflow_ci_bootstrap_gate_skip_policy_is_modeled() { /// no-new-shell ratchet (§11.7.1 #5): every REQUIRED ci-floor shell invocation in ci.yml must /// carry a row here. Dissolve-on: ci.yml emits these steps FROM their `CiUpsertStep` (T-24), /// at which point the rows delete and this slice retires. +/// +/// **P5 receipt (T-PB-B same-path SG-0 expansion):** this is a +0-new-path addition to the +/// existing `v4_workflow_ci_runner_dag_smoke_test` harness (already carried by one SG-0 +/// hand-authored-test census entry), NOT a new hand-Rust test path/authority surface — same +/// posture as the T-38/T-38B expansions documented in this file's header. Explicit P5 deferral: +/// ROADMAP.md § "Nine lanes" row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. Dissolution: +/// generated `.dag` `TestClaim` execution covers the §11.7.5 shell-exception table + no-new-shell +/// ratchet (and A15 Shape-B emitted `ci.yml`), retiring this hand-Rust parse/string harness. #[test] fn v4_workflow_ci_class_a_shell_exception_table_first_slice() { let module = parse_module(CI_DAG, CI_DAG_PATH); From a369d67e8c64860c6e06ced5d7b59362230a723d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 04:52:50 +0000 Subject: [PATCH 05/13] Shell-exception table: use canonical RepoPath carrier + tag CiSafetyFloorItem disposition (codex RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two valid codex BLOCKING findings: - ci.dag:391 — `ShellScriptPath = String` duplicated the canonical repo-relative path authority. `RepoPath` (v4.lens.edit_locus) is already imported and is the single carrier (and `.github/ci-floor/v4-m1-rust-emit-probe.sh` is already typed RepoPath at ci_component_affected.dag:23). Fix: delete the alias; `shell_owner: RepoPath`. - ci.dag:383 — `CiSafetyFloorItem` coproduct lacked a disposition tag. Fix: add the 🟡 coproduct-dissolution tag (bind #4137 §11.7.1; dissolve-on-arrival when the dynamic affected-set+testgen safety net replaces the static floor list). The other two codex findings are refuted on the PR (not valid against HEAD): shell_owner paths ARE the live ci.yml invocations (.github/ci-floor/, :239/:249; no scripts/ equivalents exist), and ROADMAP.md DOES carry T-PB-B / pb_rust_tests_outside_residual_zero (:43, :63). 38/38 smoke tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/v4/workflow/ci.dag | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 897aa4a9d38..cf6585beb23 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -379,7 +379,7 @@ data ci_always_run_carveouts: List = [ // genus); sibling to `ci_always_run_carveouts` (run-policy carveout) — distinct concept (shell // retirement vs always-run), shared leaf substrate. -// §11.7.1 bare-minimum safety-floor item a shell exception protects (§11.7.5 cond 1). +// 🟡 coproduct dissolution — feature:wave2-class-a-shell-exception-table — bind #4137 §11.7.1 — dissolve-on-arrival: this closed enumeration mirrors the §11.7.1 bare-minimum floor; it is DELETED when the dynamic affected-set + testgen safety net (§11.7.7 end state) replaces the static floor list and `protects_floor` no longer needs a fixed-arm carrier; forbidden: an open `Symbol`/`String` floor key, or an arm with no §11.7.1 row. type CiSafetyFloorItem = FmtCheck | BootstrapMinimalViability @@ -387,13 +387,12 @@ type CiSafetyFloorItem | CiDagStructuralReceipt | NoNewShellRatchet -// Repo-relative path of the `.github/ci-floor/*.sh` script currently owning a Class-A floor step. -type ShellScriptPath = String - // 🟡 coproduct dissolution — feature:wave2-class-a-shell-exception-table — bind #4137 §11.7.5 — dissolve-on-arrival: a row is DELETED when ci.yml emits its `step_id` FROM `replacement_upsert` as runtime authority (T-24), not when the shadow `CiUpsertStep` row merely exists; forbidden: a row without a named `dissolution_target`, or a Class-B/C/D (non-floor) step carried as a shell exception. type CiShellExceptionRow { step_id: CiStepId - shell_owner: ShellScriptPath + // Repo-relative path of the `.github/ci-floor/*.sh` script owning this Class-A floor step. + // Canonical `RepoPath` carrier (v4.lens.edit_locus) — NOT a parallel path-as-String authority. + shell_owner: RepoPath protects_floor: CiSafetyFloorItem // The existing shadow `CiUpsertStep` AUTHORITY that retires this row once it becomes ci.yml // runtime authority. Binds to the canonical `CiUpsertStepSymbol` data (single-authority, P2) — From 85efa0d214106d26f0923b9f3a57f70383dbb640 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 06:12:09 +0000 Subject: [PATCH 06/13] =?UTF-8?q?Wire=20=C2=A711.7.5=20shell-exception=20r?= =?UTF-8?q?eceipt=20into=20required=20ci=5Ffloor=20(rename=20to=20wave1=5F?= =?UTF-8?q?=20prefix)=20=E2=80=94=20codex=20RC=20#4284?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid codex BLOCKING: the new executable receipt was not enforced in required CI — the ci_floor "M1 v4 workflow CI model/YAML binding smoke" step runs only the `::v4_workflow_ci_m1_..._bound_to_ci_yml`, `::v4_workflow_ci_bankruptcy_tier0_`, and `::v4_workflow_ci_wave1_` filters, and `v4_workflow_ci_class_a_shell_exception_table_first_slice` matched none. Fix (test-file only; no ci.yml edit — brief does not name ci.yml, avoids carrier re-pin): rename to `v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice` so the required `::v4_workflow_ci_wave1_` floor-binding filter executes it on every PR. Legitimate placement, not filter-gaming: the no-new-shell ratchet it enforces is §11.7.1 item #5 — a Wave 1 safety-floor gate — even though the §11.7.5 table it asserts is Wave 2 modeling. Doc comment documents the wiring + prefix rationale. Verified: `cargo test -p v3-compiler --test integration v4_workflow_ci_runner_dag_smoke_test::v4_workflow_ci_wave1_` (the exact ci.yml:255 command) now runs 3 tests incl. the renamed one, all pass; full suite 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../integration/v4_workflow_ci_runner_dag_smoke_test.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index eef90ee278d..46893c5088a 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1134,8 +1134,14 @@ fn v4_workflow_ci_bootstrap_gate_skip_policy_is_modeled() { /// ROADMAP.md § "Nine lanes" row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. Dissolution: /// generated `.dag` `TestClaim` execution covers the §11.7.5 shell-exception table + no-new-shell /// ratchet (and A15 Shape-B emitted `ci.yml`), retiring this hand-Rust parse/string harness. +/// +/// **Required-CI wiring:** the `v4_workflow_ci_wave1_` name prefix places this under the required +/// `ci_floor` "M1 v4 workflow CI model/YAML binding smoke" step's `::v4_workflow_ci_wave1_` filter +/// (`.github/workflows/ci.yml`), so the no-new-shell ratchet — §11.7.1 item #5, a safety-floor +/// gate — is enforced on every PR, not just locally. The §11.7.5 table it asserts is Wave 2 work, +/// but the ratchet it enforces is Wave 1 floor, which is why it joins the `wave1_` floor-binding group. #[test] -fn v4_workflow_ci_class_a_shell_exception_table_first_slice() { +fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { let module = parse_module(CI_DAG, CI_DAG_PATH); // Type substrate: the exception-row record + the §11.7.1 safety-floor enum it cites. From a217da1e285d1aef0c6d4deaadb4ba45fb2a11b7 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 06:57:26 +0000 Subject: [PATCH 07/13] =?UTF-8?q?WIP:=20Wave=202=20=C2=A711.7.4=20?= =?UTF-8?q?=E2=80=94=20CiUpsertStep=20Class=20A=20shell=20exceptions=20(bo?= =?UTF-8?q?otstrap/M1/no-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 64 +++++++++++++++---- src/v4/workflow/ci.dag | 17 +++-- 2 files changed, 64 insertions(+), 17 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 46893c5088a..45dffa6ac51 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1229,21 +1229,61 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { ); } - // no-new-shell ratchet (§11.7.1 #5): the converse direction — every REQUIRED `ci-floor/*.sh` - // invocation in ci.yml must be listed in the table. A new required shell with no exception - // row is a ratchet regression caught here. + // no-new-shell ratchet (§11.7.1 #5) — bidirectional bijection between the REQUIRED + // `.github/ci-floor/*.sh` invocations in ci.yml and the table's rows. + // + // Scan EVERY line (not just lines beginning `run: bash …`) so a block-scalar `run: |` body + // such as ` bash .github/ci-floor/foo.sh` cannot evade the gate by its YAML spelling. + let mut ci_floor_scripts: Vec = Vec::new(); for line in CI_YML.lines() { - let trimmed = line.trim(); - if let Some(rest) = trimmed.strip_prefix("run: bash .github/ci-floor/") { - let leaf = rest.split_whitespace().next().unwrap_or(""); - let script = format!(".github/ci-floor/{leaf}"); - assert!( - table.contains(&script), - "{CI_YML_PATH}: required ci-floor shell `{script}` has no §11.7.5 \ - exception row (no-new-shell ratchet — add a CiShellExceptionRow or model it)" - ); + if !line.contains("bash ") { + continue; } + if let Some(idx) = line.find(".github/ci-floor/") { + let leaf: String = line[idx..] + .chars() + .take_while(|c| !c.is_whitespace()) + .collect(); + if leaf.ends_with(".sh") { + ci_floor_scripts.push(leaf); + } + } + } + ci_floor_scripts.sort(); + ci_floor_scripts.dedup(); + assert!( + !ci_floor_scripts.is_empty(), + "{CI_YML_PATH}: expected at least one required ci-floor shell invocation to ratchet" + ); + + // Forward — every required ci-floor shell must have an exception row (fail CLOSED on a new + // unlisted required shell). + for script in &ci_floor_scripts { + assert!( + table.contains(script.as_str()), + "{CI_YML_PATH}: required ci-floor shell `{script}` has no §11.7.5 \ + exception row (no-new-shell ratchet — add a CiShellExceptionRow or model it)" + ); } + // Bijection — distinct required scripts must equal the row count, so a NEW ci-floor shell (or + // a duplicate/extra row) breaks the 1:1 correspondence and fails the gate rather than passing + // open on mere string containment. + assert_eq!( + ci_floor_scripts.len(), + table.matches("CiShellExceptionRow {").count(), + "{CI_DAG_PATH}: §11.7.5 table must be 1:1 with the required ci-floor invocations \ + in {CI_YML_PATH} (count {} scripts vs rows) — a new required shell or an extra/stale \ + row breaks the no-new-shell bijection", + ci_floor_scripts.len() + ); + + // RESIDUAL (tracked, openai-pro #4284): this gate keys on the script PATH, not the modeled + // `(job, step)` `CiStepId`, because ci.yml's step→`CiStepId` mapping is not yet available in a + // string-checkable form here. A *second* required step reusing an already-listed ci-floor + // script would not yet be distinguished by its own `step_id`. Dissolves on the same trigger as + // this harness's overall retirement: the generated `.dag` CI step model lets the ratchet + // compare live `(job, step, script)` against `step_id + shell_owner` directly. Until then the + // bijection above (path-keyed, block-form-safe, count-exact) is the enforced contract. } #[test] diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index cf6585beb23..ef1ca148324 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -373,11 +373,18 @@ data ci_always_run_carveouts: List = [ // structural dissolution path. Conditions (2)+(3) are definitional: a row exists here iff the step // is still shell-owned and not yet emitted FROM its `CiUpsertStep` as ci.yml runtime authority. // This is the first executable slice of Wave 2 (shell→`CiUpsertStep` migration, §11.7.7 lane 6): -// it models the exception registry the no-new-shell ratchet (§11.7.1 #5) consumes — the set of -// REQUIRED shell-owned ci-floor steps must equal these rows' `step_id`s; any unlisted required -// shell is a ratchet regression. Reuses `CiStepId` + `DissolutionTarget` (no parallel exception -// genus); sibling to `ci_always_run_carveouts` (run-policy carveout) — distinct concept (shell -// retirement vs always-run), shared leaf substrate. +// it models the exception registry the no-new-shell ratchet (§11.7.1 #5) consumes. INTENDED +// contract: the set of REQUIRED shell-owned ci-floor steps equals these rows' `step_id`s. +// ENFORCED today (`v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice`): a path-keyed +// bijection between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows +// (block-form-safe, count-exact) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, +// openai-pro #4284): the gate keys on script path, not the modeled `(job, step)` `CiStepId`, since +// ci.yml's step→`CiStepId` mapping is not yet string-checkable; a *second* step reusing a listed +// script is not yet distinguished by `step_id`. Dissolves when the generated `.dag` CI step model +// lets the ratchet compare live `(job, step, script)` against `step_id + shell_owner` directly. +// Reuses `CiStepId` + `DissolutionTarget` (no parallel exception genus); sibling to +// `ci_always_run_carveouts` (run-policy carveout) — distinct concept (shell retirement vs +// always-run), shared leaf substrate. // 🟡 coproduct dissolution — feature:wave2-class-a-shell-exception-table — bind #4137 §11.7.1 — dissolve-on-arrival: this closed enumeration mirrors the §11.7.1 bare-minimum floor; it is DELETED when the dynamic affected-set + testgen safety net (§11.7.7 end state) replaces the static floor list and `protects_floor` no longer needs a fixed-arm carrier; forbidden: an open `Symbol`/`String` floor key, or an arm with no §11.7.1 row. type CiSafetyFloorItem From 9cafbebac6edb382977845831bcbc61c58ebeb4e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 08:31:55 +0000 Subject: [PATCH 08/13] =?UTF-8?q?WIP:=20Wave=202=20=C2=A711.7.4=20?= =?UTF-8?q?=E2=80=94=20CiUpsertStep=20Class=20A=20shell=20exceptions=20(bo?= =?UTF-8?q?otstrap/M1/no-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/workflow/ci.dag | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 202992c3fe6..267cf8bb039 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -432,10 +432,15 @@ data ci_m1_rust_emit_step_emitted_from_upsert_runtime_authority: Symbol = ci_m1_ data ci_class_a_shell_exceptions: List = [ CiShellExceptionRow { - step_id: JobStep { job: v2_bootstrap_smoke_execution, step: v2_bootstrap_smoke_execution }, + // `.github/ci-floor/v4-bootstrap-viability.sh` is the v2→v4 FULL COMPILE over src/v4 (script + // header: "v2-compiler full compile over src/v4"; ci.yml step "v2 -> v4 bootstrap compile"), + // so the live step + its retiring authority are `v2_compile_src_v4` / `ci_upsert_v2_compile_src_v4` + // (verify `BootstrapStageCompile { produces: v4_stage0_binary }`) — NOT the lighter + // `v2_bootstrap_smoke_execution`. Bound by what the script DOES, not by name resemblance (P1/P2). + step_id: JobStep { job: v2_compile_src_v4, step: v2_compile_src_v4 }, shell_owner: ".github/ci-floor/v4-bootstrap-viability.sh", protects_floor: BootstrapMinimalViability, - replacement_upsert: ci_upsert_v2_bootstrap_smoke_execution, + replacement_upsert: ci_upsert_v2_compile_src_v4, dissolution_target: ModelMissingSubstrate { what: ci_bootstrap_step_emitted_from_upsert_runtime_authority } From 0f26e16bd2262f14934d81faa824477f975ff9eb Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 08:32:34 +0000 Subject: [PATCH 09/13] Fix bootstrap shell-exception row: bind to v2_compile_src_v4 authority, not bootstrap_smoke (codex RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid codex BLOCKING (P1/P2): the bootstrap row was bound by NAME ("bootstrap") to `v2_bootstrap_smoke_execution` / `ci_upsert_v2_bootstrap_smoke_execution`, but the live `.github/ci-floor/v4-bootstrap-viability.sh` is the v2→v4 FULL COMPILE over src/v4 (script header: "v2-compiler full compile over src/v4"; ci.yml step "v2 -> v4 bootstrap compile (fail-closed full)"), which is modeled by `v2_compile_src_v4` / `ci_upsert_v2_compile_src_v4` (verify `BootstrapStageCompile { produces: v4_stage0_binary }`). So the row pointed at the wrong replacement authority. Fix: rebind the bootstrap row's step_id AND replacement_upsert to v2_compile_src_v4 / ci_upsert_v2_compile_src_v4 — bound by what the script DOES, not name resemblance. shell_owner / protects_floor (BootstrapMinimalViability) / dissolution_target unchanged. Test needles updated to match; ci_upsert_v2_compile_src_v4 confirmed a declared CiUpsertStepSymbol authority (ci.dag:1105). Bijection intact (still 2 scripts ↔ 2 rows, distinct step_ids: v2_compile_src_v4 + m1_rust_emit_probe_execution). Required `::v4_workflow_ci_wave1_` filter runs 3 tests incl. the ratchet; full suite 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../integration/v4_workflow_ci_runner_dag_smoke_test.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 45dffa6ac51..afb0e24ecf8 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1176,7 +1176,9 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { "{CI_DAG_PATH}: §11.7.5 carries exactly two Class-A shell exceptions (bootstrap + M1)" ); for needle in [ - "job: v2_bootstrap_smoke_execution", + // bootstrap-viability.sh is the v2→v4 full compile over src/v4 — its live step + retiring + // authority are `v2_compile_src_v4`, not the lighter `v2_bootstrap_smoke_execution`. + "job: v2_compile_src_v4", ".github/ci-floor/v4-bootstrap-viability.sh", "protects_floor: BootstrapMinimalViability", "job: m1_rust_emit_probe_execution", @@ -1193,7 +1195,7 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { // declared elsewhere in this module — NOT a parallel `Symbol` alias that could drift or name // a non-existent upsert. Assert both the table reference and the authority declaration exist. for upsert in [ - "ci_upsert_v2_bootstrap_smoke_execution", + "ci_upsert_v2_compile_src_v4", "ci_upsert_m1_rust_emit_probe_execution", ] { assert!( From 55d269e7ee93801930c0c1d70f775f798c53ae64 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 09:56:50 +0000 Subject: [PATCH 10/13] Pin no-new-shell forward ratchet to shell_owner FIELD, not comment-inclusive containment (openai-pro RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid openai-pro REQUEST_CHANGES (P2/P3 fail-open): the forward ratchet used `table.contains(script)` over the raw `ci_class_a_shell_exceptions` slice, which INCLUDES comments. The bootstrap row's comment documents its script path (`.github/ci-floor/v4-bootstrap-viability.sh`), so the gate could pass on the path appearing in prose while the actual `shell_owner` field was stale/wrong — i.e. the no-new-shell ratchet failed open, defeating its purpose. Fix: match the field spelling `shell_owner: "{script}"` instead of bare containment, so the assertion is pinned to `CiShellExceptionRow.shell_owner` and a path mentioned only in a comment no longer satisfies it. Updated the ci.dag ENFORCED-today contract note to say the bijection is keyed on the shell_owner field. Required `::v4_workflow_ci_wave1_` filter runs 3 tests incl. the ratchet; full 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 12 ++++++++---- src/v4/workflow/ci.dag | 7 ++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index afb0e24ecf8..93b2b0e6be4 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1258,13 +1258,17 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { "{CI_YML_PATH}: expected at least one required ci-floor shell invocation to ratchet" ); - // Forward — every required ci-floor shell must have an exception row (fail CLOSED on a new - // unlisted required shell). + // Forward — every required ci-floor shell must have an exception row, matched at the + // `shell_owner` FIELD (`shell_owner: ""`), NOT bare path containment over the slice. + // A path can also appear in a row comment (e.g. the bootstrap row documents what the script + // does), so containment would pass even with a stale/wrong `shell_owner` field — i.e. fail + // OPEN. Pinning to the field spelling keeps it fail-CLOSED (openai-pro #4284). for script in &ci_floor_scripts { assert!( - table.contains(script.as_str()), + table.contains(&format!("shell_owner: \"{script}\"")), "{CI_YML_PATH}: required ci-floor shell `{script}` has no §11.7.5 \ - exception row (no-new-shell ratchet — add a CiShellExceptionRow or model it)" + `CiShellExceptionRow.shell_owner` field (no-new-shell ratchet — the path appearing \ + only in a comment does not count; add/repair the `shell_owner` field or model it)" ); } // Bijection — distinct required scripts must equal the row count, so a NEW ci-floor shell (or diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 267cf8bb039..1521669de97 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -392,9 +392,10 @@ data ci_always_run_carveouts: List = [ // This is the first executable slice of Wave 2 (shell→`CiUpsertStep` migration, §11.7.7 lane 6): // it models the exception registry the no-new-shell ratchet (§11.7.1 #5) consumes. INTENDED // contract: the set of REQUIRED shell-owned ci-floor steps equals these rows' `step_id`s. -// ENFORCED today (`v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice`): a path-keyed -// bijection between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows -// (block-form-safe, count-exact) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, +// ENFORCED today (`v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice`): a bijection +// between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows, matched at the +// `shell_owner` FIELD (not bare path containment, which a row comment could satisfy fail-open) and +// block-form-safe + count-exact — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, // openai-pro #4284): the gate keys on script path, not the modeled `(job, step)` `CiStepId`, since // ci.yml's step→`CiStepId` mapping is not yet string-checkable; a *second* step reusing a listed // script is not yet distinguished by `step_id`. Dissolves when the generated `.dag` CI step model From b0cdb4577c5f7e740e93795a39127d4432f69132 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 10:16:55 +0000 Subject: [PATCH 11/13] =?UTF-8?q?WIP:=20Wave=202=20=C2=A711.7.4=20?= =?UTF-8?q?=E2=80=94=20CiUpsertStep=20Class=20A=20shell=20exceptions=20(bo?= =?UTF-8?q?otstrap/M1/no-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 41 ++++++++++++------- src/v4/workflow/ci.dag | 5 ++- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index 93b2b0e6be4..ab199154050 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1219,25 +1219,23 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { "{CI_DAG_PATH}: each shell exception must name a structural dissolution_target" ); - // §11.7.5 cond 1 — each row's shell_owner is a live REQUIRED ci.yml floor invocation - // (no phantom exception for a script that does not actually run on PRs). - for script in [ - ".github/ci-floor/v4-bootstrap-viability.sh", - ".github/ci-floor/v4-m1-rust-emit-probe.sh", - ] { - assert!( - CI_YML.contains(&format!("bash {script}")), - "{CI_YML_PATH}: shell exception owner `{script}` must be a live floor invocation" - ); - } - // no-new-shell ratchet (§11.7.1 #5) — bidirectional bijection between the REQUIRED // `.github/ci-floor/*.sh` invocations in ci.yml and the table's rows. // - // Scan EVERY line (not just lines beginning `run: bash …`) so a block-scalar `run: |` body - // such as ` bash .github/ci-floor/foo.sh` cannot evade the gate by its YAML spelling. + // Build the live invocation set FIRST, comment-safe, and reuse it for BOTH the row-liveness + // (cond 1) and the bijection — never raw `CI_YML.contains(...)`, which a comment could satisfy. + // Scan EVERY non-comment line (not just lines beginning `run: bash …`) so a block-scalar + // `run: |` body such as ` bash .github/ci-floor/foo.sh` cannot evade the gate by its + // YAML spelling, while a commented-out `# bash .github/ci-floor/foo.sh` is NOT counted as live + // (openai-pro #4284: skip comment-only lines + strip inline ` # …` trailers). let mut ci_floor_scripts: Vec = Vec::new(); - for line in CI_YML.lines() { + for raw in CI_YML.lines() { + let line = raw.trim_start(); + if line.starts_with('#') { + continue; + } + // Drop any inline YAML comment (a ` #` trailer) before looking for an invocation. + let line = line.split_once(" #").map_or(line, |(code, _)| code); if !line.contains("bash ") { continue; } @@ -1258,6 +1256,19 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { "{CI_YML_PATH}: expected at least one required ci-floor shell invocation to ratchet" ); + // §11.7.5 cond 1 — each modeled shell_owner is a live REQUIRED ci.yml floor invocation, + // checked against the SAME comment-safe parsed live set (not raw `CI_YML.contains`, which a + // comment could satisfy). No phantom exception for a script that does not actually run on PRs. + for script in [ + ".github/ci-floor/v4-bootstrap-viability.sh", + ".github/ci-floor/v4-m1-rust-emit-probe.sh", + ] { + assert!( + ci_floor_scripts.iter().any(|s| s == script), + "{CI_YML_PATH}: shell exception owner `{script}` must be a live (non-comment) floor invocation" + ); + } + // Forward — every required ci-floor shell must have an exception row, matched at the // `shell_owner` FIELD (`shell_owner: ""`), NOT bare path containment over the slice. // A path can also appear in a row comment (e.g. the bootstrap row documents what the script diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index 1521669de97..cfed4c2d752 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -394,8 +394,9 @@ data ci_always_run_carveouts: List = [ // contract: the set of REQUIRED shell-owned ci-floor steps equals these rows' `step_id`s. // ENFORCED today (`v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice`): a bijection // between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows, matched at the -// `shell_owner` FIELD (not bare path containment, which a row comment could satisfy fail-open) and -// block-form-safe + count-exact — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, +// `shell_owner` FIELD (not bare path containment, which a row comment could satisfy fail-open), +// reading ci.yml invocations from a comment-safe, block-form-safe, count-exact live set (a +// commented-out `# bash …` is not counted) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, // openai-pro #4284): the gate keys on script path, not the modeled `(job, step)` `CiStepId`, since // ci.yml's step→`CiStepId` mapping is not yet string-checkable; a *second* step reusing a listed // script is not yet distinguished by `step_id`. Dissolves when the generated `.dag` CI step model From 62e1b1342ef729d7e21b70c26ae65cc7fa87a859 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 10:56:54 +0000 Subject: [PATCH 12/13] no-new-shell ratchet: canonicalize ci-floor path tokens + fail-closed on unrecognized spelling (openai-pro RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid openai-pro REQUEST_CHANGES (P3 fail-open): the live-shell scanner took the path token until whitespace then `if leaf.ends_with(".sh")`, silently DROPPING punctuated/ quoted spellings — `bash ".github/ci-floor/x.sh"` (token ends `.sh"`) or `bash .github/ci-floor/x.sh; echo` (ends `.sh;`) — so a new required shell in those spellings would never reach the bijection (fail-open). Fix: canonicalize the token by reading until whitespace OR a shell/YAML separator/quote (`"' ; & | ) ``), and FAIL CLOSED — assert — on any non-comment `bash` line referencing `.github/ci-floor/` that does not canonicalize to a `*.sh` path, rather than silently ignoring it. Now quoted, `;`/`&`/`|`-suffixed, and subshell spellings are all caught, and an unrecognized spelling trips the gate. ci.dag contract note updated. Required `::v4_workflow_ci_wave1_` filter runs 3 tests incl. the ratchet; full 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 25 +++++++++++++++---- src/v4/workflow/ci.dag | 3 ++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index ab199154050..a3e4828d2d5 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1240,13 +1240,28 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { continue; } if let Some(idx) = line.find(".github/ci-floor/") { - let leaf: String = line[idx..] + // Canonicalize the path token: read from the path start until whitespace OR a shell / + // YAML separator/quote (`"' ; & | ) ``), so quoted/punctuated spellings like + // `bash ".github/ci-floor/x.sh"` or `bash .github/ci-floor/x.sh; echo` canonicalize to + // the bare `.sh` path rather than being silently dropped. + let token: String = line[idx..] .chars() - .take_while(|c| !c.is_whitespace()) + .take_while(|&c| { + !c.is_whitespace() && !matches!(c, '"' | '\'' | ';' | '&' | '|' | ')' | '`') + }) .collect(); - if leaf.ends_with(".sh") { - ci_floor_scripts.push(leaf); - } + // Fail CLOSED on any ci-floor invocation we cannot canonicalize to a `*.sh` script: + // a non-comment `bash` line referencing `.github/ci-floor/` that does not yield a `.sh` + // path is treated as an unrecognized live shell the ratchet must not silently ignore + // (openai-pro #4284 — a new required shell in an unhandled spelling must trip the gate). + assert!( + token.ends_with(".sh"), + "{CI_YML_PATH}: ci-floor invocation `{}` did not canonicalize to a `*.sh` script — \ + the no-new-shell ratchet fails CLOSED on unrecognized live shell spellings; \ + normalize the invocation or extend the canonicalizer", + line.trim() + ); + ci_floor_scripts.push(token); } } ci_floor_scripts.sort(); diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index cfed4c2d752..fe4705b1b45 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -396,7 +396,8 @@ data ci_always_run_carveouts: List = [ // between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows, matched at the // `shell_owner` FIELD (not bare path containment, which a row comment could satisfy fail-open), // reading ci.yml invocations from a comment-safe, block-form-safe, count-exact live set (a -// commented-out `# bash …` is not counted) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, +// commented-out `# bash …` is not counted; quoted/punctuated path spellings are canonicalized and +// an unrecognizable ci-floor spelling trips the gate) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, // openai-pro #4284): the gate keys on script path, not the modeled `(job, step)` `CiStepId`, since // ci.yml's step→`CiStepId` mapping is not yet string-checkable; a *second* step reusing a listed // script is not yet distinguished by `step_id`. Dissolves when the generated `.dag` CI step model From 6259d49cd53a5b9913171a170127a32df347c8be Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 2 Jun 2026 11:11:48 +0000 Subject: [PATCH 13/13] no-new-shell ratchet: key on ci-floor PATH not `bash ` prefix (shell-form-agnostic) (openai-pro RC #4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Valid openai-pro REQUEST_CHANGES (P3 fail-open): the scanner filtered `if !line.contains("bash ") { continue; }` BEFORE checking `.github/ci-floor/`, so a required floor step spelled `sh .github/ci-floor/new.sh`, `./.github/ci-floor/new.sh`, or `source .github/ci-floor/new.sh` would be skipped — never canonicalized, never in the live set, never compared to the table (fail-open). Fix: drop the `bash ` pre-filter; key on the `.github/ci-floor/` PATH for every non-comment line. Any ci-floor reference is treated as a live invocation, canonicalized, and must yield a modeled `.sh` (else the existing fail-closed assert trips). Now bash, sh, ./, source, and bare spellings are all caught. ci.dag contract note updated (shell-form-agnostic). Verified no false trips: ci.yml references ci-floor only in the two real `.sh` invocations. Required `::v4_workflow_ci_wave1_` filter runs 3 tests incl. the ratchet; full 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../v4_workflow_ci_runner_dag_smoke_test.rs | 15 ++++++++------- src/v4/workflow/ci.dag | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs index a3e4828d2d5..7fdfdac336b 100644 --- a/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs @@ -1236,13 +1236,14 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { } // Drop any inline YAML comment (a ` #` trailer) before looking for an invocation. let line = line.split_once(" #").map_or(line, |(code, _)| code); - if !line.contains("bash ") { - continue; - } + // Key on the `.github/ci-floor/` PATH, not on a `bash ` prefix — a required floor step can + // be spelled `sh …`, `./…`, `source …`, etc. Filtering on `bash ` first would let those + // non-`bash` spellings escape the live set (openai-pro #4284). Any non-comment reference to + // a ci-floor path is treated as a live invocation and must canonicalize to a modeled `.sh`. if let Some(idx) = line.find(".github/ci-floor/") { // Canonicalize the path token: read from the path start until whitespace OR a shell / // YAML separator/quote (`"' ; & | ) ``), so quoted/punctuated spellings like - // `bash ".github/ci-floor/x.sh"` or `bash .github/ci-floor/x.sh; echo` canonicalize to + // `".github/ci-floor/x.sh"` or `.github/ci-floor/x.sh; echo` canonicalize to // the bare `.sh` path rather than being silently dropped. let token: String = line[idx..] .chars() @@ -1250,9 +1251,9 @@ fn v4_workflow_ci_wave1_class_a_shell_exception_table_first_slice() { !c.is_whitespace() && !matches!(c, '"' | '\'' | ';' | '&' | '|' | ')' | '`') }) .collect(); - // Fail CLOSED on any ci-floor invocation we cannot canonicalize to a `*.sh` script: - // a non-comment `bash` line referencing `.github/ci-floor/` that does not yield a `.sh` - // path is treated as an unrecognized live shell the ratchet must not silently ignore + // Fail CLOSED on any ci-floor reference we cannot canonicalize to a `*.sh` script: + // a non-comment line referencing `.github/ci-floor/` that does not yield a `.sh` path + // is treated as an unrecognized live shell the ratchet must not silently ignore // (openai-pro #4284 — a new required shell in an unhandled spelling must trip the gate). assert!( token.ends_with(".sh"), diff --git a/src/v4/workflow/ci.dag b/src/v4/workflow/ci.dag index fe4705b1b45..d0334946b98 100644 --- a/src/v4/workflow/ci.dag +++ b/src/v4/workflow/ci.dag @@ -396,8 +396,9 @@ data ci_always_run_carveouts: List = [ // between the required `.github/ci-floor/*.sh` invocations in ci.yml and these rows, matched at the // `shell_owner` FIELD (not bare path containment, which a row comment could satisfy fail-open), // reading ci.yml invocations from a comment-safe, block-form-safe, count-exact live set (a -// commented-out `# bash …` is not counted; quoted/punctuated path spellings are canonicalized and -// an unrecognizable ci-floor spelling trips the gate) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, +// commented-out `# bash …` is not counted; keyed on the ci-floor PATH not a `bash ` prefix, so +// `sh`/`./`/`source` spellings are caught too; quoted/punctuated paths are canonicalized and an +// unrecognizable ci-floor spelling trips the gate) — a new unlisted required shell fails CLOSED. RESIDUAL (tracked, // openai-pro #4284): the gate keys on script path, not the modeled `(job, step)` `CiStepId`, since // ci.yml's step→`CiStepId` mapping is not yet string-checkable; a *second* step reusing a listed // script is not yet distinguished by `step_id`. Dissolves when the generated `.dag` CI step model