Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
V4_M1_CARGO_CHECK_JOBS: "4"
V4_M1_RUST_EMIT_PROBE_STRICT: "0"
run: bash scripts/v4-m1-rust-emit-probe.sh
- name: v2 → v4 bootstrap compile (fail-closed full)
- name: v2 -> v4 bootstrap compile (fail-closed full)
timeout-minutes: 35
env:
V4_BOOTSTRAP_OUT: ${{ runner.temp }}/v4-bootstrap
Expand Down Expand Up @@ -169,6 +169,6 @@ jobs:
exit 1
fi
echo "ci aggregator: Wave 1 safety floor satisfied (five Class-A gates in ci_floor; affected is shadow-only)"
- name: ci receipt (§11.7.1 floor)
- name: ci receipt (section 11.7.1 floor)
run: |
echo "::notice::Required CI: fmt + ci_floor (M1, bootstrap, ci.dag structural receipt, no-new-shell)"
73 changes: 69 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
"src/v2/stage0",
"src/v2/tests",
"src/v3/compiler",
"tools/gen_gunbc_ci_workflow_dag",
"tools/ci_affected_components",
"tools/emit_host_runner",
"src/v3/grounding_pilot",
Expand Down
4 changes: 2 additions & 2 deletions INVARIANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ An import edge pointing opposite to this order (`extdeps/ → compiler/`, `std/

### Problem shape: Task-scope drift — out-of-brief CI modification

A PR's brief assigns a bounded scope (language fill, extdeps/ substrate, refactor sweep). While working, the worker finds an unrelated CI issue — a `/tmp` reference that should be `${RUNNER_TEMP}`, a stale runner spec, a cache-key rename — and includes the fix in the same commit. The CI change may be correct in isolation, but it bypasses the single-authority contract for CI configuration. Authority has two phases: **current** — `.github/workflows/ci.yml` is the hand-edited source of truth; `dsl/gunbc/ci_github_actions_workflow.dag` is generated *from* ci.yml by `tools/gen_gunbc_ci_workflow_dag` (file header: `@generated … source: .github/workflows/ci.yml`). **Future (T-24)** — `src/v4/workflow/ci.dag` becomes the data model; ci.yml becomes its emitted output. Bundling incidental CI edits into unrelated PRs bypasses that authority chain regardless of phase and makes the history unreadable.
A PR's brief assigns a bounded scope (language fill, extdeps/ substrate, refactor sweep). While working, the worker finds an unrelated CI issue — a `/tmp` reference that should be `${RUNNER_TEMP}`, a stale runner spec, a cache-key rename — and includes the fix in the same commit. The CI change may be correct in isolation, but it bypasses the single-authority contract for CI configuration. Authority has two phases: **current** — `.github/workflows/ci.yml` is the hand-edited source of truth and `dsl/gunbc/ci_github_actions_workflow.dag` is the pinned typed Actions carrier. **Future (T-24)** — `src/v4/workflow/ci.dag` becomes the data model; ci.yml becomes its emitted output. Bundling incidental CI edits into unrelated PRs bypasses that authority chain regardless of phase and makes the history unreadable.

**Solution shape:** Workers do not modify `.github/workflows/ci.yml` or `dsl/gunbc/ci_github_actions_workflow.dag` unless those files are explicitly listed in their task brief. `ci_github_actions_workflow.dag` is a `@generated` artifact — never hand-edit it; the generator (`tools/gen_gunbc_ci_workflow_dag`) owns its content. Authorized exceptions: (a) the task brief names CI files explicitly; (b) a binary/toolchain rename that must update cache-key paths throughout (the rename scope includes CI); (c) T-24 (builds `src/v4/workflow/ci.dag`, the future CI authority, which will then emit ci.yml — after T-24 lands, ci.yml is generated and must never be hand-edited); (d) T-38 dissolution PRs with named CI step targets. Any real CI issue found outside a worker's brief becomes a separate work item — not a bundled fix.
**Solution shape:** Workers do not modify `.github/workflows/ci.yml` or `dsl/gunbc/ci_github_actions_workflow.dag` unless those files are explicitly listed in their task brief. Authorized exceptions: (a) the task brief names CI files explicitly; (b) a binary/toolchain rename that must update cache-key paths throughout (the rename scope includes CI); (c) T-24 (builds `src/v4/workflow/ci.dag`, the future CI authority, which will then emit ci.yml — after T-24 lands, ci.yml is generated and must never be hand-edited); (d) T-38 dissolution PRs with named CI step targets. Any real CI issue found outside a worker's brief becomes a separate work item — not a bundled fix.

**Receipt:** A GrammarExpr→FormalProduction refactor PR included a `/tmp` → `${RUNNER_TEMP}` fix (cleaned up before merge). A Wasm Wave 2a language fill PR bundled the same class of fix (stripped before merge, 2026-05-28). The binary-rename PR (#3826) is the ratified exception: renaming `v2-compiler` → `gunbc` spans CI cache paths by definition.

Expand Down
21 changes: 10 additions & 11 deletions dsl/gunbc/ci.dag
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
// Consumers:
// .github/workflows/ci.yml — sole live Actions transport for gunbc CI (single authority).
// dsl/gunbc/ci.dag — compiler-intent gates (`CIPipeline` / `CIGate`) plus the pinned GitHub
// Actions `Workflow` carrier field on `CIWorkflowDag` (regenerated from `.github/workflows/ci.yml`
// into `dsl/gunbc/ci_github_actions_workflow.dag` — single structural consumer; no hand-parallel
// Actions `Workflow` carrier field on `CIWorkflowDag` (from
// `dsl/gunbc/ci_github_actions_workflow.dag` — single structural consumer; no hand-parallel
// `Workflow` mirror elsewhere in this module).
// dsl/gunbc/ci_emission.dag — WI-2 / Slice 4: `WorkflowRuntime` + `project_github_actions` +
// pinned `gunbc_ci_yml_workflow` (`project_github_actions(ci_workflow_dag, YamlStatic)`).
Expand Down Expand Up @@ -111,15 +111,14 @@ type CIGateEdge {
}

// `github_actions_workflow` does not author `pipeline` / `edges` (sole gate-topology
// authority remains those fields). It pins the typed Actions `Workflow` carrier regenerated from
// `.github/workflows/ci.yml` into `dsl/gunbc/ci_github_actions_workflow.dag`
// (**R3 gate #98**, `ci_yml_hand_authority_dissolved`):
// `.github/workflows/ci.yml` matches deterministic `serde_yaml` serialization after
// `tools/gen_gunbc_ci_workflow_dag` validates the modeled `Workflow` subset (integration test:
// `ci_yml_hand_authority_dissolved`). Gate #59 YAML→`.dag` byte drift stays orthogonal.
// That mechanical encoding is not a second editorial source for
// which compiler gates exist; gate-vs-Actions alignment is process + follow-on projection
// (WI-2), not dual authority over the same axis (INVARIANTS P2 / modeling Practices 3+5).
// authority remains those fields). It pins the committed typed Actions `Workflow` carrier from
// `dsl/gunbc/ci_github_actions_workflow.dag`.
// `.github/workflows/ci.yml` remains the hand-edited source of truth until the T-24 CI model emits it.
// The pinned carrier is an interim static input, not a second editorial source for which compiler
// gates exist; gate-vs-Actions alignment is process + follow-on projection (WI-2), not dual
// authority over the same axis (INVARIANTS P2 / modeling Practices 3+5).
// Dissolve-on: T-24 `src/v4/workflow/ci.dag` projection emits the Actions workflow and deletes
// the static carrier.
type CIWorkflowDag {
pipeline: CIPipeline
edges: List<CIGateEdge>
Expand Down
10 changes: 4 additions & 6 deletions dsl/gunbc/ci_emission.dag
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// gunbc/ci_emission.dag — T-WAD WI-2 / Slice 4: `WorkflowRuntime` + `project_github_actions`.
//
// Canonical GitHub Actions `Workflow` bytes live in `gunbc.ci.github_actions_workflow`
// (`dsl/gunbc/ci_github_actions_workflow.dag`, regenerated from canonical `.github/workflows/ci.yml`).
// **R3 gate #98:** `ci.yml` is machine-serialized YAML (see `gen_gunbc_ci_workflow_dag`
// `--write-canonical-github-actions-yaml`); no hand-authored comments in the committed artifact.
// `CIWorkflowDag.github_actions_workflow` pins that carrier as part of the same authority
// row as the gate graph (`dsl/gunbc/ci.dag`).
// Static GitHub Actions `Workflow` carrier bytes live in `gunbc.ci.github_actions_workflow`
// (`dsl/gunbc/ci_github_actions_workflow.dag`). `.github/workflows/ci.yml` remains the
// hand-edited workflow authority until the T-24 CI model emits it. `CIWorkflowDag.github_actions_workflow`
// pins the static carrier as part of the same authority row as the gate graph (`dsl/gunbc/ci.dag`).
//
// `project_github_actions(..., YamlStatic)` returns that YAML-pinned carrier (Slice 4:
// no structural projection from `pipeline`/`edges` yet; WI-2 follow-on). Transport-arm
Expand Down
14 changes: 9 additions & 5 deletions dsl/gunbc/ci_github_actions_workflow.dag
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// @generated by tools/gen_gunbc_ci_workflow_dag — source: .github/workflows/ci.yml
// Regenerate: CTRL_BUILD_WRAP_CARGO=0 cargo run -q -p gen_gunbc_ci_workflow_dag -- .github/workflows/ci.yml > dsl/gunbc/ci_github_actions_workflow.dag
// Non-authoritative interim typed Actions carrier for .github/workflows/ci.yml.
// `.github/workflows/ci.yml` remains the hand-edited workflow authority until the T-24 CI model
// emits it; this static carrier is only the YamlStatic input consumed by `gunbc.ci`.
// Source-SHA256(.github/workflows/ci.yml): b7ad5d44b641db79bb51708d0e80c1909f55d6fa84cffdd4c695778e1308c0f8
// Dissolve-on: T-24 `src/v4/workflow/ci.dag` projection emits the Actions workflow and deletes
// this static carrier.

module gunbc.ci.github_actions_workflow

Expand Down Expand Up @@ -268,7 +272,7 @@ data gunbc_ci_github_actions_workflow: Workflow = {
continue_on_error: false,
timeout_minutes: Some { value: 20 }
}, RunStep {
name: Some { value: "v2 → v4 bootstrap compile (fail-closed full)" },
name: Some { value: "v2 -> v4 bootstrap compile (fail-closed full)" },
id: none,
run: "bash scripts/v4-bootstrap-viability.sh",
shell: Bash,
Expand Down Expand Up @@ -321,9 +325,9 @@ data gunbc_ci_github_actions_workflow: Workflow = {
continue_on_error: false,
timeout_minutes: none
}, RunStep {
name: Some { value: "ci receipt (§11.7.1 floor)" },
name: Some { value: "ci receipt (section 11.7.1 floor)" },
id: none,
run: "echo \"::notice::Required CI: fmt + ci_floor (M1, bootstrap, ci.dag structural receipt, no-new-shell). See docs/planning/ci-required-surface-cut-2026-06-01.md\"\n",
run: "echo \"::notice::Required CI: fmt + ci_floor (M1, bootstrap, ci.dag structural receipt, no-new-shell)\"\n",
shell: Bash,
env: none,
working_directory: none,
Expand Down
2 changes: 0 additions & 2 deletions scripts/publish-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ STRIP_PATHS=(
"RELEASE_TODO.md"
"scripts/session-dashboard"
"scripts/_internal"
"tools/gen_gunbc_ci_workflow_dag"

# Editor/agent metadata.
".cursor"
Expand Down Expand Up @@ -179,7 +178,6 @@ snapshot_patch_workspace_cargo() {
fi
awk '
/"src\/v3\// { next }
/gen_gunbc_ci_workflow_dag/ { next }
{ print }
' "$cargo_toml" > "${cargo_toml}.snapshot" \
&& mv "${cargo_toml}.snapshot" "$cargo_toml"
Expand Down
3 changes: 2 additions & 1 deletion src/v3/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ libc = { version = "0.2", default-features = false }
# R3 C1 — Tier-3 mirror dissolution perf budget (Phase 1 baseline capture); see
# `docs/briefs/r3-pb-tier3-perf-budget-worker.md` deliverable 0a/0b.
criterion = "0.5"
gen_gunbc_ci_workflow_dag = { path = "../../../tools/gen_gunbc_ci_workflow_dag" }
ci_affected_components = { path = "../../../tools/ci_affected_components" }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
sha2 = { workspace = true }
# T-V2 G-1 manifest ratchet: structured Cargo.toml walk (`toml` value parse).
toml = { workspace = true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
//!
//! E6-G1.a Option 3 — static `Lens<Int>` consumer wiring (argument-opaque `Dag` / `Behavior`).
//!
//! Authority: `docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md` + feasibility probe
//! (`docs/briefs/r3-pr-e6-g1a-option3-feasibility-probe.md`). Both are on-tree (landed
//! `gunbc#1853`); `include_str!` receipts at the end of this file bind the integration crate to
//! those paths (P1/P5 checkable receipt even when the PR diff is test-only).
//! Mechanism demonstration only; lens-over-`Dag` folding is deferred to `ReflectedProgram<T>` /
//! typed declaration-reference carrier work (Q-Reification).
//! Authority: E6-G1.a Option 3 static `Lens<Int>` mechanism landed in `gunbc#1853`; SG-0
//! `EXPECTED_HAND_AUTHORED_TEST` census membership keeps this hand-authored integration harness
//! visible to the P5 subratchet.
//! Mechanism demonstration only; dissolve-on: Q-Reification `ReflectedProgram<T>` / typed
//! declaration-reference carrier work migrates lens-over-`Dag` folding to substrate data and the
//! corresponding `.dag` `TestClaim` receipt replaces this host harness.
//!
//! **Hard bars:** no `lens_declaration_apply`, `eval_substrate_reify`, or reflection-helper imports/calls.
//!
Expand Down Expand Up @@ -490,14 +490,3 @@ fn value_contains_int_literal(v: &Value, needle: i64) -> bool {
_ => false,
}
}

// INVARIANTS P1 / P5 — checkable receipt: this integration crate must not build if the cited
// briefs are missing from the worktree (the PR file list may omit `docs/` when unchanged).
const _: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../../docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md"
));
const _: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../../docs/briefs/r3-pr-e6-g1a-option3-feasibility-probe.md"
));
8 changes: 4 additions & 4 deletions src/v3/compiler/tests/integration/sg0_census_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
"src/v3/compiler/tests/integration/common/budgeted.rs",
"src/v3/compiler/tests/integration/common/cached_compile.rs",
"src/v3/compiler/tests/integration/common/determinism_fixtures.rs",
// E6-G1.a Option 3 static lens mechanism (#1853 worker brief + #1857):
// E6-G1.a Option 3 static lens mechanism (#1853 + #1857):
// `find_list_empty_constructor_tag` helper for opaque-`Dag` harness tags
// (P1/P5 compile-time brief receipts live in `e6_g1a_option3_static_lens_test.rs`).
// (P5 receipt: SG-0 census membership for `e6_g1a_option3_static_lens_test.rs`).
"src/v3/compiler/tests/integration/common/list_variant_tags.rs",
"src/v3/compiler/tests/integration/common/mod.rs",
"src/v3/compiler/tests/integration/common/r1_gates_bridge.rs",
Expand Down Expand Up @@ -527,8 +527,8 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// coverage owns the same carrier and first-row projection.
"src/v3/compiler/tests/integration/dissolution_subsumption_carrier_test.rs",
// E6-G1.a Option 3 — static `Lens<Int>` + `mini_report` mechanism demonstration
// (Director #1853 brief; witness-flow + TESTING.md split + `include_str!` brief
// receipts per #1857). SG-0 ratchet: new hand-authored integration test.
// (#1853; witness-flow + TESTING.md split per #1857). SG-0 ratchet: hand-authored
// integration test census membership.
"src/v3/compiler/tests/integration/e6_g1a_option3_static_lens_test.rs",
"src/v3/compiler/tests/integration/e_i_lane_induction_preflight_test.rs",
// T-Substrate-Lens-Primitive Lens<EmissionProvenance> structural cementing
Expand Down
Loading
Loading