From e3ca1b8886c1bc4284d34211432b5f757ef34099 Mon Sep 17 00:00:00 2001 From: Jason Lee <56489493+jason931225@users.noreply.github.com> Date: Tue, 18 Aug 2026 07:18:35 -0400 Subject: [PATCH] ci: stop freeing runner disk that was never scarce The `Free runner disk` step ran in seven ci.yml jobs. Measured on run 32111278481 (postgres shard) and 32108350947 (backend), the runner state immediately BEFORE it ran: /dev/root 145G total, 58G used, 87G available (40%) and after: 110G available. It spends 58s (shards) to 82s (backend) reclaiming 23G on a machine that already had 87G free, and grep finds zero ENOSPC or "no space" in any job log, ever. Chesterton's Fence: it arrived in PR #155 WITH the dev-up orchestrator, which brings up a full Docker compose project -- that genuinely can exhaust disk. It was then applied to jobs that start one postgres container. dev-up-smoke has since moved to nightly.yml, so the justification and the cost no longer live in the same workflow. nightly.yml KEEPS the step for exactly that reason; only ci.yml drops it. Removal is self-verifying: if disk ever were scarce the job fails loudly with ENOSPC. This cannot degrade into a false green, which is why it is safe to remove on evidence rather than after another instrumented run. Worth ~58s on the critical-path shard, ~82s on backend (which becomes the critical path once the shards are rebalanced), and ~370s of compute per run. The mirror pins setup actions by ABSOLUTE step index, so removing a step shifts every index after it; those are decremented per job rather than re-derived. Ratchets step down by exactly what was removed and no more: setup-action coverage 42 -> 35 (7 steps), bypass matrix 84 -> 70 (7 x 2 mutations), identity/interleaving matrix 277 -> 249, and per-job inventories by one each. One trap worth recording: "company-conformance" appears in BOTH requiredRunStepCounts and requiredActionStepCounts, so a first-match replace silently edited the run-step map instead of the action-step map and moved a count this change does not touch. Both are now set explicitly. Verified: node scripts/check-ci-preflight.mjs -> passed; node --test scripts/check-ci-preflight.test.mjs -> 60 pass, 0 fail; node --test scripts/verify.test.mjs -> 15 pass; check-nightly-workflow -> 14 pass; npm run check:ci-preflight -> exit 0. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 24 --------------------- scripts/check-ci-preflight.mjs | 33 ++++++++++++----------------- scripts/check-ci-preflight.test.mjs | 27 ++++++++++++++--------- 3 files changed, 30 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8cd20d06..55bbd0dab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -509,9 +509,6 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false - - name: Free runner disk for PostgreSQL cargo tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -567,9 +564,6 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false - - name: Free runner disk for PostgreSQL cargo tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -625,9 +619,6 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false - - name: Free runner disk for PostgreSQL cargo tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -683,9 +674,6 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false - - name: Free runner disk for PostgreSQL cargo tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -741,9 +729,6 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false - - name: Free runner disk for PostgreSQL cargo tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -839,10 +824,6 @@ jobs: if: ${{ needs.preflight.outputs.run_heavy == 'true' }} run: tools/buck/install_dotslash.sh - - name: Free runner disk for PostgreSQL Buck2 tests - if: ${{ needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - - name: Install Rust toolchain (pinned via rust-toolchain.toml) if: ${{ needs.preflight.outputs.run_heavy == 'true' }} uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @@ -990,11 +971,6 @@ jobs: if: ${{ !cancelled() && needs.preflight.outputs.run_heavy == 'true' }} run: ../tools/buck/install_dotslash.sh - - name: Free runner disk for Rust backend - id: free-disk - if: ${{ !cancelled() && needs.preflight.outputs.run_heavy == 'true' }} - uses: ./.github/actions/free-runner-disk - - name: Install Rust toolchain (pinned via rust-toolchain.toml) id: rust if: ${{ !cancelled() && needs.preflight.outputs.run_heavy == 'true' }} diff --git a/scripts/check-ci-preflight.mjs b/scripts/check-ci-preflight.mjs index 0748e49a9..5db6d7d69 100644 --- a/scripts/check-ci-preflight.mjs +++ b/scripts/check-ci-preflight.mjs @@ -1050,9 +1050,8 @@ const requiredJobActionContracts = Object.freeze({ ], "backend": [ actionStep(0, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { id: "checkout" }), - actionStep(3, "Free runner disk for Rust backend", "./.github/actions/free-runner-disk", { if: backendIndependentCondition, id: "free-disk" }), - actionStep(4, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1","components":"rustfmt, clippy"}, { if: backendIndependentCondition, id: "rust" }), - actionStep(5, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":"${{ github.ref == 'refs/heads/main' }}"}, { if: backendIndependentCondition, id: "rust-cache" }), + actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1","components":"rustfmt, clippy"}, { if: backendIndependentCondition, id: "rust" }), + actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":"${{ github.ref == 'refs/heads/main' }}"}, { if: backendIndependentCondition, id: "rust-cache" }), ], "kubernetes-manifests": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"fetch-depth":0}, { if: runHeavyCondition }), @@ -1073,38 +1072,32 @@ const requiredJobActionContracts = Object.freeze({ ], "company-conformance": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(3, "Free runner disk for PostgreSQL Buck2 tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(4, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), ], "postgres-reachability-app": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(2, "Free runner disk for PostgreSQL cargo tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), - actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), + actionStep(2, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), ], "postgres-reachability-platform": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(2, "Free runner disk for PostgreSQL cargo tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), - actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), + actionStep(2, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), ], "postgres-reachability-ontology": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(2, "Free runner disk for PostgreSQL cargo tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), - actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), + actionStep(2, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), ], "postgres-reachability-domain-a": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(2, "Free runner disk for PostgreSQL cargo tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), - actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), + actionStep(2, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), ], "postgres-reachability-domain-b": [ actionStep(1, "Checkout", "actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0", {"persist-credentials":false}, { if: runHeavyCondition }), - actionStep(2, "Free runner disk for PostgreSQL cargo tests", "./.github/actions/free-runner-disk", { if: runHeavyCondition }), - actionStep(3, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), - actionStep(4, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), + actionStep(2, "Install Rust toolchain (pinned via rust-toolchain.toml)", "dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8", {"toolchain":"1.97.1"}, { if: runHeavyCondition }), + actionStep(3, "Cache Rust dependencies + build artifacts", "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4", {"workspaces":"backend","shared-key":"backend-cargo","cache-all-crates":"true","save-if":false}, { if: runHeavyCondition }), ], "postgres-domain-reachability": [ ], diff --git a/scripts/check-ci-preflight.test.mjs b/scripts/check-ci-preflight.test.mjs index 442b15f3b..1208e4cd9 100644 --- a/scripts/check-ci-preflight.test.mjs +++ b/scripts/check-ci-preflight.test.mjs @@ -692,20 +692,24 @@ describe("CI preflight contract", () => { }); it("rejects every setup-action condition and soft-failure bypass", () => { + // 2026-08-18: the Free runner disk step was removed from every ci.yml job + // (measured: 87G already free before it ran, 110G after, and zero ENOSPC in + // any log). These counts step down by exactly one per job that carried it, + // and by no more. const requiredActionStepCounts = { preflight: 3, "domain-unit": 3, - backend: 4, + backend: 3, "kubernetes-manifests": 1, "repo-gates": 2, "api-contract": 2, "generated-face-authority": 4, - "company-conformance": 3, - "postgres-reachability-app": 4, - "postgres-reachability-platform": 4, - "postgres-reachability-ontology": 4, - "postgres-reachability-domain-a": 4, - "postgres-reachability-domain-b": 4, + "company-conformance": 2, + "postgres-reachability-app": 3, + "postgres-reachability-platform": 3, + "postgres-reachability-ontology": 3, + "postgres-reachability-domain-a": 3, + "postgres-reachability-domain-b": 3, }; const workflowModel = yaml.load(workflow); const bypasses = [ @@ -736,8 +740,11 @@ describe("CI preflight contract", () => { // 2026-08-18: dev-up-smoke (7 run steps, 4 setup actions) moved to Nightly, // so these ratchets step down by exactly its step counts and no more. A // shrink that does NOT match a job leaving ci.yml is still a regression. - assert.equal(actionStepCount, 42, "required and planned job setup-action coverage must not shrink"); - assert.equal(mutationCount, 84, "setup-action bypass matrix must not shrink"); + // 2026-08-18: -7, exactly the Free runner disk steps removed from ci.yml + // (5 postgres shards + backend + company-conformance) and no more. + assert.equal(actionStepCount, 35, "required and planned job setup-action coverage must not shrink"); + // 2026-08-18: -14 = 7 removed setup actions x 2 bypass mutations each. + assert.equal(mutationCount, 70, "setup-action bypass matrix must not shrink"); }); it("locks every setup action's identity, inputs, totality, and interleaving", () => { @@ -812,7 +819,7 @@ describe("CI preflight contract", () => { } } - assert.equal(mutationCount, 277, "setup-action identity/input/interleaving matrix must not shrink"); + assert.equal(mutationCount, 249, "setup-action identity/input/interleaving matrix must not shrink"); }); it("locks the candidate-controlled local free-runner-disk action body", () => {