From e204d2d3d747e2572e36264758713f431e13c341 Mon Sep 17 00:00:00 2001 From: Daniel Petro <45949032+WellDunDun@users.noreply.github.com> Date: Mon, 2 Nov 2026 15:14:02 +0300 Subject: [PATCH 1/5] Cancel superseded PR checks and reserve macOS builds for merge and release --- .changeset/trim-actions-usage.md | 5 ++ .github/scripts/ci-policy.mjs | 76 ++++++++++++++++++++++++ .github/scripts/ci-policy.test.mjs | 79 +++++++++++++++++++++++++ .github/workflows/ci.yml | 44 +++++++++++++- .github/workflows/desktop.yml | 61 ++++++++++--------- .github/workflows/selfhost-image.yml | 32 +++++++++- docs/ci.md | 18 ++++++ tests/scripts/release-workflows.test.ts | 2 +- 8 files changed, 282 insertions(+), 35 deletions(-) create mode 100644 .changeset/trim-actions-usage.md create mode 100644 .github/scripts/ci-policy.mjs create mode 100644 .github/scripts/ci-policy.test.mjs create mode 100644 docs/ci.md diff --git a/.changeset/trim-actions-usage.md b/.changeset/trim-actions-usage.md new file mode 100644 index 00000000..f13a3a5d --- /dev/null +++ b/.changeset/trim-actions-usage.md @@ -0,0 +1,5 @@ +--- +"@selftune/desktop": patch +--- + +Cancel superseded pull-request CI runs and check macOS desktop packages on merge and release. Documentation-only pull requests skip heavy CI jobs while retaining required check names. diff --git a/.github/scripts/ci-policy.mjs b/.github/scripts/ci-policy.mjs new file mode 100644 index 00000000..afd57aeb --- /dev/null +++ b/.github/scripts/ci-policy.mjs @@ -0,0 +1,76 @@ +import { execFileSync } from "node:child_process"; +import { appendFileSync, readFileSync } from "node:fs"; +import { pathToFileURL } from "node:url"; + +const desktopTargets = [ + { + os: "macos-15", + platform: "mac", + target: "bun-darwin-arm64", + package_script: "package:mac", + arch_flag: "--arm64", + artifact: "selftune-desktop-macos-arm64", + }, + { + os: "macos-15-intel", + platform: "mac", + target: "bun-darwin-x64", + package_script: "package:mac", + arch_flag: "--x64", + artifact: "selftune-desktop-macos-x64", + }, + { + os: "ubuntu-latest", + platform: "linux", + target: "bun-linux-x64", + package_script: "package:linux", + arch_flag: "--x64", + artifact: "selftune-desktop-linux-x64", + }, + { + os: "windows-latest", + platform: "win", + target: "bun-windows-x64", + package_script: "package:win", + arch_flag: "--x64", + artifact: "selftune-desktop-windows-x64", + }, +]; + +export function isDocsOnly(paths) { + return ( + paths.length > 0 && paths.every((path) => path.endsWith(".md") || path.startsWith("docs/")) + ); +} + +export function selectPolicy(eventName, paths) { + return { + run_heavy: eventName !== "pull_request" || !isDocsOnly(paths), + desktop_matrix: { + include: desktopTargets.filter( + (target) => eventName !== "pull_request" || target.platform !== "mac", + ), + }, + }; +} + +export function changedPaths(event, cwd = process.cwd()) { + const base = event.pull_request?.base?.sha; + if (!/^[a-f0-9]{40}$/i.test(base ?? "")) throw new Error("Expected a full PR base commit SHA"); + return execFileSync("git", ["diff", "--name-only", "--no-renames", "-z", base, "HEAD"], { + cwd, + encoding: "utf8", + maxBuffer: 32 * 1024 * 1024, + }) + .split("\0") + .filter(Boolean); +} + +if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) { + const eventName = process.env.GITHUB_EVENT_NAME; + const event = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, "utf8")); + const policy = selectPolicy(eventName, eventName === "pull_request" ? changedPaths(event) : []); + const output = `run_heavy=${policy.run_heavy}\ndesktop_matrix=${JSON.stringify(policy.desktop_matrix)}\n`; + if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, output); + process.stdout.write(output); +} diff --git a/.github/scripts/ci-policy.test.mjs b/.github/scripts/ci-policy.test.mjs new file mode 100644 index 00000000..7113831d --- /dev/null +++ b/.github/scripts/ci-policy.test.mjs @@ -0,0 +1,79 @@ +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { mkdtempSync, mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import test from "node:test"; +import { changedPaths, isDocsOnly, selectPolicy } from "./ci-policy.mjs"; + +for (const paths of [ + ["README.md"], + ["apps/desktop/README.md"], + ["docs/image.png", "docs/setup.md"], +]) { + test(`documentation skips heavy PR jobs: ${paths.join(", ")}`, () => { + assert.equal(isDocsOnly(paths), true); + assert.equal(selectPolicy("pull_request", paths).run_heavy, false); + }); +} +for (const paths of [ + [], + ["package.json"], + ["docs/setup.md", "apps/local/main.ts"], + [".github/scripts/ci-policy.mjs"], +]) { + test(`code or unknown changes run PR jobs: ${paths.join(", ")}`, () => { + assert.equal(selectPolicy("pull_request", paths).run_heavy, true); + }); +} +test("PRs keep Linux and Windows, while merge, push and release retain all platforms", () => { + assert.deepEqual( + selectPolicy("pull_request", ["apps/desktop/main.ts"]).desktop_matrix.include.map( + (target) => target.platform, + ), + ["linux", "win"], + ); + for (const event of ["push", "merge_group", "workflow_dispatch", "release"]) { + const policy = selectPolicy(event, ["README.md"]); + assert.equal(policy.run_heavy, true); + assert.deepEqual( + policy.desktop_matrix.include.map((target) => target.platform), + ["mac", "mac", "linux", "win"], + ); + } +}); +test("renames out of source, deleted code and newline names cannot masquerade as docs", () => { + const root = mkdtempSync(join(tmpdir(), "selftune-ci-policy-")); + const git = (...args) => + execFileSync( + "git", + ["-c", "user.name=CI fixture", "-c", "user.email=ci@example.invalid", ...args], + { cwd: root, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }, + ).trim(); + try { + git("init", "-b", "main"); + mkdirSync(join(root, "docs")); + writeFileSync(join(root, "source.js"), "source"); + writeFileSync(join(root, "delete.js"), "delete"); + git("add", "."); + git("commit", "-m", "base"); + const base = git("rev-parse", "HEAD"); + renameSync(join(root, "source.js"), join(root, "docs/source.md")); + rmSync(join(root, "delete.js")); + writeFileSync(join(root, "code\nname.js"), "code"); + git("add", "."); + git("commit", "-m", "changes"); + const paths = changedPaths({ pull_request: { base: { sha: base } } }, root); + assert.deepEqual( + new Set(paths), + new Set(["source.js", "delete.js", "docs/source.md", "code\nname.js"]), + ); + assert.equal(isDocsOnly(paths), false); + assert.throws( + () => changedPaths({ pull_request: { base: { sha: "--bad" } } }, root), + /full PR base/, + ); + } finally { + rmSync(root, { force: true, recursive: true }); + } +}); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f14e869b..3161e66a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,49 @@ name: CI on: - pull_request: + push: branches: [main] + merge_group: + pull_request: workflow_dispatch: {} +concurrency: + group: ci-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: {} jobs: + changes: + runs-on: ubuntu-latest + timeout-minutes: 3 + permissions: + contents: read + outputs: + run_heavy: ${{ steps.policy.outputs.run_heavy }} + desktop_matrix: ${{ steps.policy.outputs.desktop_matrix }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Verify CI selection + run: node --test .github/scripts/ci-policy.test.mjs + - name: Select CI jobs + id: policy + run: node .github/scripts/ci-policy.mjs + lint: + needs: changes + if: always() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') runs-on: ubuntu-latest permissions: contents: read steps: + - name: Require successful change selection + env: + RESULT: ${{ needs.changes.result }} + run: test "$RESULT" = success - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: @@ -28,7 +59,8 @@ jobs: - run: bun run lint-architecture.ts build-dashboard: - needs: [lint] + needs: [changes, lint] + if: needs.changes.outputs.run_heavy == 'true' runs-on: ubuntu-latest timeout-minutes: 20 permissions: @@ -71,11 +103,17 @@ jobs: run: bash .github/scripts/generate-sbom.sh test: - needs: [lint] + needs: [changes, lint] + if: always() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') runs-on: ubuntu-latest permissions: contents: read steps: + - name: Require successful selection and lint + env: + SELECTION: ${{ needs.changes.result }} + LINT: ${{ needs.lint.result }} + run: test "$SELECTION" = success && test "$LINT" = success - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 12aecb56..7bea1b9a 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -34,6 +34,9 @@ on: description: Immutable 40-character source commit for the release tag required: true type: string + push: + branches: [main] + merge_group: pull_request: paths: - apps/desktop/** @@ -58,16 +61,41 @@ on: - scripts/release-plan.ts - scripts/validate-release-ref.ts - tests/scripts/release-workflows.test.ts + - .github/scripts/ci-policy.mjs + - .github/scripts/ci-policy.test.mjs + - "!**/*.md" + - "!docs/**" permissions: contents: read concurrency: - group: desktop-${{ inputs.release_tag || github.ref }} - cancel-in-progress: false + group: desktop-${{ inputs.release_tag || github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + changes: + runs-on: ubuntu-latest + timeout-minutes: 3 + permissions: + contents: read + outputs: + run_heavy: ${{ steps.policy.outputs.run_heavy }} + desktop_matrix: ${{ steps.policy.outputs.desktop_matrix }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Verify CI selection + run: node --test .github/scripts/ci-policy.test.mjs + - name: Select CI jobs + id: policy + run: node .github/scripts/ci-policy.mjs + build-windows-sidecar: + needs: changes + if: needs.changes.outputs.run_heavy == 'true' runs-on: ubuntu-latest timeout-minutes: 20 env: @@ -128,35 +156,10 @@ jobs: if-no-files-found: error build: - needs: build-windows-sidecar + needs: [changes, build-windows-sidecar] strategy: fail-fast: false - matrix: - include: - - os: macos-15 - platform: mac - target: bun-darwin-arm64 - package_script: package:mac - arch_flag: --arm64 - artifact: selftune-desktop-macos-arm64 - - os: macos-15-intel - platform: mac - target: bun-darwin-x64 - package_script: package:mac - arch_flag: --x64 - artifact: selftune-desktop-macos-x64 - - os: ubuntu-latest - platform: linux - target: bun-linux-x64 - package_script: package:linux - arch_flag: --x64 - artifact: selftune-desktop-linux-x64 - - os: windows-latest - platform: win - target: bun-windows-x64 - package_script: package:win - arch_flag: --x64 - artifact: selftune-desktop-windows-x64 + matrix: ${{ fromJSON(needs.changes.outputs.desktop_matrix) }} runs-on: ${{ matrix.os }} timeout-minutes: 60 env: diff --git a/.github/workflows/selfhost-image.yml b/.github/workflows/selfhost-image.yml index 16fa1185..f15c7745 100644 --- a/.github/workflows/selfhost-image.yml +++ b/.github/workflows/selfhost-image.yml @@ -28,6 +28,9 @@ on: description: Immutable 40-character source commit for the release tag required: true type: string + push: + branches: [main] + merge_group: pull_request: paths: - apps/selfhost/** @@ -46,10 +49,14 @@ on: - package.json - bun.lock - .dockerignore + - .github/scripts/ci-policy.mjs + - .github/scripts/ci-policy.test.mjs + - "!**/*.md" + - "!docs/**" concurrency: - group: selfhost-image-${{ inputs.release_tag || github.ref }} - cancel-in-progress: false + group: selfhost-image-${{ inputs.release_tag || github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read @@ -58,7 +65,28 @@ env: REGISTRY_IMAGE: ghcr.io/selftune-dev/selftune-selfhost jobs: + changes: + runs-on: ubuntu-latest + timeout-minutes: 3 + permissions: + contents: read + outputs: + run_heavy: ${{ steps.policy.outputs.run_heavy }} + desktop_matrix: ${{ steps.policy.outputs.desktop_matrix }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Verify CI selection + run: node --test .github/scripts/ci-policy.test.mjs + - name: Select CI jobs + id: policy + run: node .github/scripts/ci-policy.mjs + verify: + needs: changes + if: needs.changes.outputs.run_heavy == 'true' runs-on: ubuntu-latest timeout-minutes: 15 outputs: diff --git a/docs/ci.md b/docs/ci.md new file mode 100644 index 00000000..2a92a1e1 --- /dev/null +++ b/docs/ci.md @@ -0,0 +1,18 @@ +# CI execution policy + +Superseded pull-request runs cancel earlier runs for the same PR in CI, Desktop and Self-Host Image. Main pushes and merge-queue runs get distinct concurrency groups, so another push cannot cancel a full verification run. Release candidates retain per-tag serialization without cancelling an in-progress release. + +CI runs on pull requests, including stacked PRs, and keeps the required `lint` and `test` names. Documentation-only PRs skip heavy jobs. Both required jobs fail if change selection fails; `test` also fails if lint fails. A mixed code and documentation PR runs normal validation. Unknown paths and an empty changed-file list select normal validation. Renames retain their source and destination names. + +Desktop and Self-Host Image keep PR path selection because only `lint` and `test` are required by the current main ruleset. Markdown and `docs/` are excluded from those PR triggers. Workflow and selection-script changes trigger validation. + +Desktop PRs package and smoke-test Linux and Windows. Pushes to main, merge queues and immutable release builds retain macOS ARM64, macOS Intel, Linux and Windows. All three workflows run their full checks on main pushes and merge queues even when only documentation changed. Release publishing, signing, image provenance and smoke gates are unchanged. + +Local checks: + +```sh +node --test .github/scripts/ci-policy.test.mjs +bun test tests/scripts/release-workflows.test.ts +``` + +Before merging CI changes, verify a stacked documentation-only PR and the implementation PR in GitHub Actions. Confirm job conclusions, selected platforms and superseded-run cancellation. Local selection tests do not establish hosted runner results. diff --git a/tests/scripts/release-workflows.test.ts b/tests/scripts/release-workflows.test.ts index 86247861..ecea210f 100644 --- a/tests/scripts/release-workflows.test.ts +++ b/tests/scripts/release-workflows.test.ts @@ -319,7 +319,7 @@ describe("parsed release workflow graph", () => { }), ]), }, - build: { needs: "build-windows-sidecar", "timeout-minutes": 60 }, + build: { needs: ["changes", "build-windows-sidecar"], "timeout-minutes": 60 }, "build-windows-sidecar": { env: { BUN_TARGET: "bun-windows-x64" }, "runs-on": "ubuntu-latest", From a0d8c73de8f4a244e926e06b42ef1a497fce0682 Mon Sep 17 00:00:00 2001 From: Daniel Petro <45949032+WellDunDun@users.noreply.github.com> Date: Mon, 2 Nov 2026 15:15:40 +0300 Subject: [PATCH 2/5] Clarify workflow-specific cancellation boundaries --- docs/ci.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ci.md b/docs/ci.md index 2a92a1e1..7fe95e06 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -16,3 +16,5 @@ bun test tests/scripts/release-workflows.test.ts ``` Before merging CI changes, verify a stacked documentation-only PR and the implementation PR in GitHub Actions. Confirm job conclusions, selected platforms and superseded-run cancellation. Local selection tests do not establish hosted runner results. + +Concurrency groups use a distinct prefix per workflow. A newer CI run cannot cancel Desktop or Self-Host Image, and PR cancellation cannot cancel an immutable release candidate. From 125bc1e43cd8e71b3aaa518db5a17067440ecc1a Mon Sep 17 00:00:00 2001 From: Daniel Petro <45949032+WellDunDun@users.noreply.github.com> Date: Mon, 2 Nov 2026 15:18:26 +0300 Subject: [PATCH 3/5] Keep required failure gates cancellable on superseded PR runs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3161e66a..7321b735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: lint: needs: changes - if: always() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') + if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') }} runs-on: ubuntu-latest permissions: contents: read @@ -104,7 +104,7 @@ jobs: test: needs: [changes, lint] - if: always() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') + if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') }} runs-on: ubuntu-latest permissions: contents: read From 965b9c74dbbebfc741632143321f7a0ca7bc2e8a Mon Sep 17 00:00:00 2001 From: Daniel Petro <45949032+WellDunDun@users.noreply.github.com> Date: Mon, 2 Nov 2026 15:20:28 +0300 Subject: [PATCH 4/5] Guard cancellable required checks and full merge verification --- tests/scripts/release-workflows.test.ts | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/scripts/release-workflows.test.ts b/tests/scripts/release-workflows.test.ts index ecea210f..5d73c1c4 100644 --- a/tests/scripts/release-workflows.test.ts +++ b/tests/scripts/release-workflows.test.ts @@ -240,6 +240,36 @@ describe("Changesets release ownership", () => { }); describe("parsed release workflow graph", () => { + test("required PR gates propagate selector failures without resisting cancellation", () => { + expect(workflow("ci.yml")).toMatchObject({ + jobs: { + lint: { + if: expect.stringContaining("!cancelled() && (needs.changes.result != 'success'"), + steps: expect.arrayContaining([ + expect.objectContaining({ run: 'test "$RESULT" = success' }), + ]), + }, + test: { + if: expect.stringContaining("!cancelled() && (needs.changes.result != 'success'"), + steps: expect.arrayContaining([ + expect.objectContaining({ + run: 'test "$SELECTION" = success && test "$LINT" = success', + }), + ]), + }, + }, + }); + }); + + test("cancels only PR runs and retains unfiltered main and merge-queue verification", () => { + for (const name of ["ci.yml", "desktop.yml", "selfhost-image.yml"]) { + expect(workflow(name)).toMatchObject({ + on: { push: { branches: ["main"] }, merge_group: null }, + concurrency: { "cancel-in-progress": "${{ github.event_name == 'pull_request' }}" }, + }); + } + }); + test("serializes post-merge releases and gates npm on both immutable candidates", () => { expect(workflow("publish.yml")).toMatchObject({ on: { From 4af0e7fbcbd0c982b46cab655da3955a7f7684e6 Mon Sep 17 00:00:00 2001 From: Daniel Petro <45949032+WellDunDun@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:31:25 +0300 Subject: [PATCH 5/5] Apply CI cost trim skill with measured usage and security validation --- .github/workflows/ci.yml | 2 - .github/workflows/desktop.yml | 12 +- docs/ci.md | 2 +- docs/reports/ci-cost-report.md | 774 +++++++++++++++++++ docs/reports/ci-cost-runs.csv | 77 ++ docs/reports/test-suite-efficiency-report.md | 26 + tests/scripts/release-workflows.test.ts | 18 +- 7 files changed, 903 insertions(+), 8 deletions(-) create mode 100644 docs/reports/ci-cost-report.md create mode 100644 docs/reports/ci-cost-runs.csv create mode 100644 docs/reports/test-suite-efficiency-report.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7321b735..f1d68dda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [main] merge_group: pull_request: workflow_dispatch: {} diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 7bea1b9a..4417ba8b 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -164,6 +164,8 @@ jobs: timeout-minutes: 60 env: BUN_TARGET: ${{ matrix.target }} + DESKTOP_PACKAGE_SCRIPT: ${{ matrix.package_script }} + DESKTOP_ARCH_FLAG: ${{ matrix.arch_flag }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: @@ -284,7 +286,8 @@ jobs: if: inputs.release_tag == '' env: CSC_IDENTITY_AUTO_DISCOVERY: "false" - run: bun run --cwd apps/desktop ${{ matrix.package_script }} -- ${{ matrix.arch_flag }} --publish never + shell: bash + run: bun run --cwd apps/desktop "$DESKTOP_PACKAGE_SCRIPT" -- "$DESKTOP_ARCH_FLAG" --publish never - name: Build signed macOS release distributable if: inputs.release_tag != '' && matrix.platform == 'mac' @@ -327,7 +330,7 @@ jobs: max_attempts=3 for attempt in $(seq 1 "$max_attempts"); do set +e - bun run --cwd apps/desktop "${{ matrix.package_script }}" -- "${{ matrix.arch_flag }}" --publish never + bun run --cwd apps/desktop "$DESKTOP_PACKAGE_SCRIPT" -- "$DESKTOP_ARCH_FLAG" --publish never status=$? set -e @@ -348,7 +351,8 @@ jobs: if: inputs.release_tag != '' && matrix.platform != 'mac' env: CSC_IDENTITY_AUTO_DISCOVERY: "false" - run: bun run --cwd apps/desktop ${{ matrix.package_script }} -- ${{ matrix.arch_flag }} --publish never + shell: bash + run: bun run --cwd apps/desktop "$DESKTOP_PACKAGE_SCRIPT" -- "$DESKTOP_ARCH_FLAG" --publish never - name: Verify signed macOS application bundle if: inputs.release_tag != '' && matrix.platform == 'mac' @@ -376,7 +380,7 @@ jobs: - name: Preserve macOS update manifest per architecture if: matrix.platform == 'mac' shell: bash - run: mv apps/desktop/dist/latest-mac.yml "apps/desktop/dist/latest-mac-${{ matrix.target }}.yml" + run: mv apps/desktop/dist/latest-mac.yml "apps/desktop/dist/latest-mac-${BUN_TARGET}.yml" - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: diff --git a/docs/ci.md b/docs/ci.md index 7fe95e06..c903fd49 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -6,7 +6,7 @@ CI runs on pull requests, including stacked PRs, and keeps the required `lint` a Desktop and Self-Host Image keep PR path selection because only `lint` and `test` are required by the current main ruleset. Markdown and `docs/` are excluded from those PR triggers. Workflow and selection-script changes trigger validation. -Desktop PRs package and smoke-test Linux and Windows. Pushes to main, merge queues and immutable release builds retain macOS ARM64, macOS Intel, Linux and Windows. All three workflows run their full checks on main pushes and merge queues even when only documentation changed. Release publishing, signing, image provenance and smoke gates are unchanged. +Desktop PRs package and smoke-test Linux and Windows. Pushes to main, merge queues and immutable release builds retain macOS ARM64, macOS Intel, Linux and Windows. Desktop and Self-Host Image run full checks on main pushes and merge queues even when only documentation changed. CI runs the full workspace suite for merge queues; the existing Publish test job keeps full workspace coverage on main pushes without a duplicate CI push run. Release publishing, signing, image provenance and smoke gates are unchanged. Local checks: diff --git a/docs/reports/ci-cost-report.md b/docs/reports/ci-cost-report.md new file mode 100644 index 00000000..d23a5964 --- /dev/null +++ b/docs/reports/ci-cost-report.md @@ -0,0 +1,774 @@ +| Workflow | Issue | Evidence | Estimated runner minutes saved per 30 days | +| --- | --- | --- | --- | +| `.github/workflows/desktop.yml` | macOS on every relevant PR | Excluding this task's verification branches, 5 Desktop PR runs consumed 129.67 min; macOS accounts for 65.38 min across retry attempts. | Gross upper bound 65.38 min at the same PR mix. Extra full main/merge runs offset this, so net savings are not yet measured. | +| `ci.yml`, `desktop.yml`, `selfhost-image.yml` | Superseded PR work was not consistently cancelled | Automatic cancellation is demonstrated by runs 41443628010, 41443628016 and 41443628019. These controlled runs are excluded from historical forecasts. | Not extrapolated from intentionally induced cancellations. | +| `ci.yml` / `publish.yml` | A new CI push trigger would duplicate the existing full post-merge workspace suite | Publish already runs lint, architecture checks, full workspace typecheck/tests, desktop/self-host runtime checks on each main push. The first CI patch added another push run; this audit removes that new duplicate trigger. | Avoided additional usage, not historical savings. Publish main coverage remains; CI covers the merge queue. | +| `codeql.yml` + `dynamic/github-code-quality/codeql` | Overlapping scanners merit scope comparison | Explicit CodeQL used 43.97 min; dynamic code-quality runs used 33.05 min. Coverage equivalence is not established. | No scanner removed or coverage reduction proposed. | +| `ci.yml` | Workspace tests consume a substantial share of CI time | CI workspace test steps consumed 27.95 of 60.28 CI min; Publish test steps add 20.50 min. Per-test timings are not retrieved. See the bounded test-suite report. | No test deletion, merge or quarantine; savings pending profiling. | + +# CI cost report + +Repository: [selftune-dev/selftune](https://github.com/selftune-dev/selftune). Implementation: [PR #183](https://github.com/selftune-dev/selftune/pull/183). Baseline ref: `5335ce6a6e5469b2adf57bdb8035a6f3461a76a4`. Audit date: November 2, 2026. + +## Measurement and limits + +Window: **October 3, 2026 12:57:26 UTC through November 2, 2026 12:57:26 UTC**. All repo workflow-run pages were retrieved, splitting date ranges below GitHub's 1,000-result cap and deduplicating by run ID. Job lists use `filter=all`, paginate, and include retried jobs/matrix targets. No job-list requests failed. + +Retrieved **76 run records**, with **81 summed attempt ordinals**, and **547.50 observed runner minutes**. Attempt ordinals count rerun events, not proof that every job reran. Per-job attempt numbers are retained in the source data. Job durations count only jobs with a nonzero runner ID and completed timestamps; skipped, unassigned and unfinished work does not become zero-cost execution proof. Totals include the complete duration of retrieved attempts whose parent run was created in the window. A retry after the cutoff can therefore extend beyond the window; parent runs created before the window but retried inside it are not captured by this created-date query. This is a run-cohort measurement, not a billing-period export. + +Runner minutes sum job start-to-completion durations and include parallel jobs and retry work. They are **not billed minutes or dollar spend**; billing usage, rounding, multipliers, included allowances and runner pricing were not retrieved. Workflow elapsed proxies use latest `run_started_at → updated_at`, include queue/metadata effects, and cannot be added to or substituted for runner minutes. Previous-attempt workflow elapsed time is not available from that proxy. Failures count failure/timed_out/startup_failure/action_required; cancellations are separate. Pending work has no final outcome at the snapshot. + +[Run ledger](ci-cost-runs.csv) records ID, workflow, duration, actor/type, branch, revision, event and outcome for each run. Bot identities are taken from GitHub actor type; a user account is not evidence of human authorship. Agent authorship and historical draft state were not retrieved. This task's `codex/trim-actions-usage`, `codex/verify-docs-only-actions` and SelfTune PR 183 dynamic runs are marked verification work. Totals show them; historical forecasts exclude them. Never extrapolate the intentionally cancelled verification runs as organic savings. + +## Workflow totals + +| Workflow | Runs / attempt ordinals | Failure / cancelled runs | Observed runner min | Share | Latest-attempt elapsed proxy min | +| --- | ---: | ---: | ---: | ---: | ---: | +| `.github/workflows/ci.yml` | 11 / 11 | 1 (9.1%) / 3 | 60.28 | 11.0% | 56.28 | +| `.github/workflows/auto-bump-cli-version.yml` | 9 / 9 | 0 (0.0%) / 0 | 2.83 | 0.5% | 3.50 | +| `.github/workflows/codeql.yml` | 15 / 15 | 0 (0.0%) / 0 | 43.97 | 8.0% | 56.78 | +| `.github/workflows/selfhost-image.yml` | 9 / 9 | 0 (0.0%) / 3 | 35.87 | 6.6% | 40.33 | +| `.github/workflows/desktop.yml` | 9 / 11 | 1 (11.1%) / 4 | 149.45 | 27.3% | 61.12 | +| `dynamic/github-code-quality/codeql` | 15 / 15 | 0 (0.0%) / 0 | 33.05 | 6.0% | 34.47 | +| `.github/workflows/scorecard.yml` | 4 / 4 | 0 (0.0%) / 0 | 3.00 | 0.5% | 25.33 | +| `.github/workflows/sync-skill-to-site.yml` | 2 / 2 | 0 (0.0%) / 0 | 0.08 | 0.0% | 0.22 | +| `.github/workflows/publish.yml` | 2 / 5 | 0 (0.0%) / 0 | 218.97 | 40.0% | 1.75 | + +Failure rates can be calculated as the failure column divided by run count; the ledger preserves each outcome. Observed runner-OS shares are retained below. Missing/deleted workflows and externally managed dynamic workflows appear in totals when observed; their current repository configuration cannot be inventoried from an absent file. + +Representative run evidence for each workflow: + +- `.github/workflows/ci.yml`: [run 41444025277](https://github.com/selftune-dev/selftune/actions/runs/41444025277). +- `.github/workflows/auto-bump-cli-version.yml`: [run 41443911622](https://github.com/selftune-dev/selftune/actions/runs/41443911622). +- `.github/workflows/codeql.yml`: [run 41443911465](https://github.com/selftune-dev/selftune/actions/runs/41443911465). +- `.github/workflows/selfhost-image.yml`: [run 41443911471](https://github.com/selftune-dev/selftune/actions/runs/41443911471). +- `.github/workflows/desktop.yml`: [run 41443911448](https://github.com/selftune-dev/selftune/actions/runs/41443911448). +- `dynamic/github-code-quality/codeql`: [run 41443905824](https://github.com/selftune-dev/selftune/actions/runs/41443905824). +- `.github/workflows/scorecard.yml`: [run 40351274034](https://github.com/selftune-dev/selftune/actions/runs/40351274034). +- `.github/workflows/sync-skill-to-site.yml`: [run 40073451186](https://github.com/selftune-dev/selftune/actions/runs/40073451186). +- `.github/workflows/publish.yml`: [run 40073451157](https://github.com/selftune-dev/selftune/actions/runs/40073451157). + +## Execution gaps and access + +One zero-job run is a cancelled superseded verification run, not proof of runner or billing failure. The current self-hosted runner API lists no registered runners and cannot describe historical hosted availability. The main ruleset requires `lint` and `test`; classic protection returns branch-not-protected because this policy is in rulesets. Required names remain unchanged. A failed selector reports failures through both required jobs, rather than silently skipping them. No protection rule was changed. + +## Ranked implementation and compute decision + +1. Cancel superseded PR runs with distinct per-workflow groups. Keep running release candidates and unrelated branches isolated. Required failure gates use !cancelled() so cancellation works. +2. Skip verified docs-only PR heavy jobs while preserving required statuses and failing closed on selector errors. Optional Desktop/Image workflows retain PR path filters. +3. Keep Linux/Windows PR package smoke tests; run all four desktop targets on merge queue/main/release. Keep full post-merge workspace coverage in Publish instead of duplicating it with a CI push run. Full main Desktop/Image runs add cost versus the old baseline; report the net tradeoff after merging rather than summing gross PR savings. +4. Transfer dynamic matrix fields through quoted environment variables instead of shell-source expressions. All signed-release, image-digest and smoke gates remain. +5. Investigate explicit versus dynamic CodeQL scope before any consolidation; no scanner or test was removed. See [test-suite efficiency](test-suite-efficiency-report.md). + +Keep GitHub-hosted runners for now. No self-hosted migration, paid runner service, infrastructure benchmark or Bazel rollout is proposed from this small cohort. Billing access is incomplete and the volume changes have not been re-measured after merge. No compute was purchased and no benchmark was performed. Any later runner recommendation needs current primary-source pricing and a representative authorized benchmark. + +Do not total the findings-table estimates: draft/docs filtering, consolidation and cancellation overlap, while full main/merge coverage adds work. **Measured post-merge savings: not retrieved. Net estimated savings: not established.** + +## Validation and security + +Whole-workflow actionlint passes after edits. Baseline zizmor findings by rule: `{'artipacked': 7, 'adhoc-packages': 4, 'use-trusted-publishing': 2, 'template-injection': 3, 'secrets-inherit': 1, 'self-repository': 2}`. Current findings: `{'artipacked': 7, 'adhoc-packages': 4, 'template-injection': 3, 'secrets-inherit': 1, 'self-repository': 2}`. Zizmor does not pass cleanly; remaining existing findings are recorded, not suppressed. New dynamic-matrix shell interpolation findings in the first SelfTune patch were fixed by quoting environment values. Touched third-party action pins were resolved through GitHub tag/commit APIs on November 2; action versions were not upgraded. No secret values or references changed. + +23 parsed release/workflow tests and 9 selector tests pass, along with changed-file oxlint/oxfmt and commit hooks. [Code CI](https://github.com/selftune-dev/selftune/actions/runs/41443911708), [Desktop](https://github.com/selftune-dev/selftune/actions/runs/41443911448) and [Self-Host Image](https://github.com/selftune-dev/selftune/actions/runs/41443911471) all passed. Only Linux/Windows PR targets were allocated. [Docs-only run](https://github.com/selftune-dev/selftune/actions/runs/41444025277) passed changes and skipped lint/test/build-dashboard; Desktop/Image did not trigger. Superseded runs 41443628010/016/019 cancelled automatically without a cancellation API. An older always()-based verification run needed manual cleanup; it is not counted as automatic cancellation proof. + +The [implementation PR description](https://github.com/selftune-dev/selftune/pull/183) is the live verification ledger for the final pinned/security revision, additional deliberate-failure checks, and temporary PR cleanup. Pre-pin passing runs above establish the original code path, not a claim that a later commit already passed. Temporary tests are closed without merging. No implementation PR has been merged by this task. + +Merge-group selection is covered locally with the actual selector and workflow graph. **Live merge-queue verification is pending**: no queue was configured or exercised, and changing protection/queue settings is outside scope. Main/release builds on the final revision remain pending merge/release; local matrix/graph tests do not establish a live signed release. + +## Two-week follow-up + +Pending request or an authorized schedule. Fourteen days after actual merge, retrieve the next complete run cohort and all job attempts using the same method. Compare total runner minutes, minutes per relevant code PR and completed main/merge candidate, failure/execution-gap rates, docs/draft skips, cancellations, OS share and actual schedule count. Separate tests from setup/builds and normalize for run volume, matrix targets, release frequency and incomplete jobs. Confirm required checks still block relevant failures. Report billed usage separately only if retrieved. No follow-up automation was created. + +## Current workflow inventory + +All current repository workflow files are recorded below: triggers, branches/path filters, concurrency, matrices, OS, explicit/default timeouts and cache-related setup. Missing cache keys are not assumed effective. A missing timeout uses GitHub's normal six-hour job limit; reusable jobs may inherit caller limits. Historical workflow definitions can differ from this final-review snapshot. + +```json +{ + "auto-bump-cli-version.yml": { + "name": "Changeset Required", + "on": { + "pull_request": { + "types": [ + "opened", + "synchronize", + "reopened", + "ready_for_review" + ], + "branches": [ + "main" + ], + "paths": [ + ".dockerignore", + ".npmignore", + ".github/scripts/smoke-selfhost-image.sh", + ".github/workflows/auto-bump-cli-version.yml", + ".github/workflows/ci.yml", + ".github/workflows/desktop.yml", + ".github/workflows/publish.yml", + ".github/workflows/selfhost-image.yml", + "CHANGELOG.md", + "README.md", + "apps/desktop/**", + "apps/cli/**", + "apps/local/**", + "apps/local-dashboard/**", + "apps/selfhost/**", + "assets/**", + "bin/**", + "bun.lock", + "cli/selftune/**", + "package.json", + "packages/control-plane/**", + "packages/dashboard-core/**", + "packages/harnesses/**", + "packages/orchestration/**", + "packages/runtime/**", + "packages/telemetry-contract/**", + "packages/ui/**", + "scripts/pack-package.ts", + "scripts/publish-package-json.cjs", + "scripts/smoke-packed-package.ts", + "scripts/release-version.ts", + "scripts/release-plan.ts", + "scripts/render-release-notes.ts", + "scripts/sync-skill-version.ts", + "scripts/validate-release-ref.ts", + "skill/**", + "templates/**", + "lint-architecture.ts", + "turbo.json" + ] + } + }, + "concurrency": { + "group": "changeset-required-${{ github.event.pull_request.number }}", + "cancel-in-progress": true + }, + "jobs": { + "changeset-required": { + "runner": "ubuntu-latest", + "timeout": 10, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + } + ], + "if": null + } + } + }, + "publish.yml": { + "name": "Publish", + "on": { + "push": { + "branches": [ + "main" + ] + }, + "workflow_dispatch": { + "inputs": { + "repair_release": { + "description": "Rebuild and re-promote an existing release from its verified source tag", + "required": false, + "default": false, + "type": "boolean" + }, + "release_tag": { + "description": "Existing vX.Y.Z tag to repair; required when repair_release is true", + "required": false, + "type": "string" + } + } + } + }, + "concurrency": { + "group": "publish-selftune", + "cancel-in-progress": false + }, + "jobs": { + "test": { + "runner": "ubuntu-latest", + "timeout": 30, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + } + ], + "if": null + }, + "prepare-release": { + "runner": "ubuntu-latest", + "timeout": 15, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f", + "with": { + "node-version": "24", + "registry-url": "https://registry.npmjs.org" + } + } + ], + "if": "always() && needs.test.result == 'success'" + }, + "desktop-candidate": { + "runner": null, + "timeout": "default 360", + "matrix": null, + "cache": [], + "if": "always() && needs.prepare-release.result == 'success' && needs.prepare-release.outputs.should_release == 'true'" + }, + "selfhost-candidate": { + "runner": null, + "timeout": "default 360", + "matrix": null, + "cache": [], + "if": "always() && needs.prepare-release.result == 'success' && needs.prepare-release.outputs.should_release == 'true'" + }, + "publish-npm": { + "runner": "ubuntu-latest", + "timeout": 20, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f", + "with": { + "node-version": "24", + "registry-url": "https://registry.npmjs.org" + } + } + ], + "if": "always() && needs.prepare-release.outputs.should_release == 'true' && needs.desktop-candidate.result == 'success' && needs.selfhost-candidate.result == 'success'" + }, + "promote-release": { + "runner": "ubuntu-latest", + "timeout": 15, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f", + "with": { + "node-version": "24", + "registry-url": "https://registry.npmjs.org" + } + } + ], + "if": "always() && needs.prepare-release.outputs.should_release == 'true' && needs.desktop-candidate.result == 'success' && needs.selfhost-candidate.result == 'success' && needs.publish-npm.result == 'success'" + } + } + }, + "codeql.yml": { + "name": "CodeQL", + "on": { + "push": { + "branches": [ + "main" + ] + }, + "pull_request": { + "branches": [ + "main" + ] + }, + "schedule": [ + { + "cron": "0 9 * * 1" + } + ] + }, + "concurrency": null, + "jobs": { + "analyze": { + "runner": "ubuntu-latest", + "timeout": "default 360", + "matrix": null, + "cache": [], + "if": null + } + } + }, + "sync-skill-to-site.yml": { + "name": "Sync skill to marketing site", + "on": { + "push": { + "branches": [ + "main" + ], + "paths": [ + "skill/**" + ] + }, + "workflow_dispatch": null + }, + "concurrency": null, + "jobs": { + "trigger-rebuild": { + "runner": "ubuntu-latest", + "timeout": "default 360", + "matrix": null, + "cache": [], + "if": null + } + } + }, + "selfhost-image.yml": { + "name": "Self-Host Image", + "on": { + "workflow_call": { + "inputs": { + "release_tag": { + "description": "Existing draft GitHub release tag for the immutable image candidate", + "required": true, + "type": "string" + }, + "source_sha": { + "description": "Immutable 40-character source commit for the release tag", + "required": true, + "type": "string" + } + }, + "outputs": { + "image_ref": { + "description": "Immutable version-tagged self-host image reference", + "value": "${{ jobs.publish-release-manifest.outputs.image_ref }}" + }, + "manifest_digest": { + "description": "Digest of the proven multi-architecture image manifest", + "value": "${{ jobs.publish-release-manifest.outputs.manifest_digest }}" + } + } + }, + "workflow_dispatch": { + "inputs": { + "release_tag": { + "description": "Existing release tag to publish as a multi-architecture image", + "required": true, + "type": "string" + }, + "source_sha": { + "description": "Immutable 40-character source commit for the release tag", + "required": true, + "type": "string" + } + } + }, + "push": { + "branches": [ + "main" + ] + }, + "merge_group": null, + "pull_request": { + "paths": [ + "apps/selfhost/**", + "apps/cli/**", + "apps/local/**", + "apps/local-dashboard/**", + "cli/selftune/**", + "packages/control-plane/**", + "packages/harnesses/**", + "packages/orchestration/**", + "packages/runtime/**", + ".github/scripts/smoke-selfhost-image.sh", + ".github/workflows/selfhost-image.yml", + "scripts/release-version.ts", + "scripts/validate-release-ref.ts", + "package.json", + "bun.lock", + ".dockerignore", + ".github/scripts/ci-policy.mjs", + ".github/scripts/ci-policy.test.mjs", + "!**/*.md", + "!docs/**" + ] + } + }, + "concurrency": { + "group": "selfhost-image-${{ inputs.release_tag || github.event.pull_request.number || github.run_id }}", + "cancel-in-progress": "${{ github.event_name == 'pull_request' }}" + }, + "jobs": { + "changes": { + "runner": "ubuntu-latest", + "timeout": 3, + "matrix": null, + "cache": [], + "if": null + }, + "verify": { + "runner": "ubuntu-latest", + "timeout": 15, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + } + ], + "if": "needs.changes.outputs.run_heavy == 'true'" + }, + "build-validation": { + "runner": "ubuntu-latest", + "timeout": 30, + "matrix": null, + "cache": [], + "if": "inputs.release_tag == ''" + }, + "build-release-digest": { + "runner": "ubuntu-latest", + "timeout": 45, + "matrix": { + "include": [ + { + "platform": "linux/amd64", + "artifact": "amd64" + }, + { + "platform": "linux/arm64", + "artifact": "arm64" + } + ] + }, + "cache": [], + "if": "inputs.release_tag != ''" + }, + "publish-release-manifest": { + "runner": "ubuntu-latest", + "timeout": 10, + "matrix": null, + "cache": [], + "if": "inputs.release_tag != ''" + } + } + }, + "desktop.yml": { + "name": "Desktop", + "on": { + "workflow_call": { + "inputs": { + "release_tag": { + "description": "Existing draft GitHub release tag to attach desktop artifacts to", + "required": true, + "type": "string" + }, + "source_sha": { + "description": "Immutable 40-character source commit for the release tag", + "required": true, + "type": "string" + } + }, + "secrets": { + "DESKTOP_APPLE_API_ISSUER": { + "required": false + }, + "DESKTOP_APPLE_API_KEY": { + "required": false + }, + "DESKTOP_APPLE_API_KEY_ID": { + "required": false + }, + "DESKTOP_CSC_KEY_PASSWORD": { + "required": false + }, + "DESKTOP_CSC_LINK": { + "required": false + }, + "RELEASE_PAT": { + "required": false + } + } + }, + "workflow_dispatch": { + "inputs": { + "release_tag": { + "description": "Existing GitHub release tag to build and attach signed desktop artifacts to", + "required": true, + "type": "string" + }, + "source_sha": { + "description": "Immutable 40-character source commit for the release tag", + "required": true, + "type": "string" + } + } + }, + "push": { + "branches": [ + "main" + ] + }, + "merge_group": null, + "pull_request": { + "paths": [ + "apps/desktop/**", + "apps/cli/**", + "apps/local/**", + "apps/local-dashboard/**", + "scripts/smoke-windows-service.ps1", + "cli/selftune/**", + "packages/control-plane/**", + "packages/dashboard-core/**", + "packages/harnesses/**", + "packages/orchestration/**", + "packages/runtime/**", + "packages/telemetry-contract/**", + "packages/ui/**", + "skill/settings_snippet.json", + ".github/workflows/desktop.yml", + ".changeset/**", + "package.json", + "bun.lock", + "scripts/release-version.ts", + "scripts/release-plan.ts", + "scripts/validate-release-ref.ts", + "tests/scripts/release-workflows.test.ts", + ".github/scripts/ci-policy.mjs", + ".github/scripts/ci-policy.test.mjs", + "!**/*.md", + "!docs/**" + ] + } + }, + "concurrency": { + "group": "desktop-${{ inputs.release_tag || github.event.pull_request.number || github.run_id }}", + "cancel-in-progress": "${{ github.event_name == 'pull_request' }}" + }, + "jobs": { + "changes": { + "runner": "ubuntu-latest", + "timeout": 3, + "matrix": null, + "cache": [], + "if": null + }, + "build-windows-sidecar": { + "runner": "ubuntu-latest", + "timeout": 20, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + } + ], + "if": "needs.changes.outputs.run_heavy == 'true'" + }, + "build": { + "runner": "${{ matrix.os }}", + "timeout": 60, + "matrix": "${{ fromJSON(needs.changes.outputs.desktop_matrix) }}", + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f", + "with": { + "node-version": "24" + } + } + ], + "if": null + }, + "attach-release": { + "runner": "ubuntu-latest", + "timeout": 15, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + } + ], + "if": "inputs.release_tag != ''" + } + } + }, + "ci.yml": { + "name": "CI", + "on": { + "merge_group": null, + "pull_request": null, + "workflow_dispatch": {} + }, + "concurrency": { + "group": "ci-${{ github.event.pull_request.number || github.run_id }}", + "cancel-in-progress": "${{ github.event_name == 'pull_request' }}" + }, + "jobs": { + "changes": { + "runner": "ubuntu-latest", + "timeout": 3, + "matrix": null, + "cache": [], + "if": null + }, + "lint": { + "runner": "ubuntu-latest", + "timeout": "default 360", + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830", + "with": { + "path": "~/.bun/install/cache", + "key": "bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}", + "restore-keys": "bun-${{ runner.os }}-" + } + } + ], + "if": "${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') }}" + }, + "build-dashboard": { + "runner": "ubuntu-latest", + "timeout": 20, + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830", + "with": { + "path": "~/.bun/install/cache", + "key": "bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}", + "restore-keys": "bun-${{ runner.os }}-" + } + }, + { + "action": "actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f", + "with": { + "node-version": "24" + } + } + ], + "if": "needs.changes.outputs.run_heavy == 'true'" + }, + "test": { + "runner": "ubuntu-latest", + "timeout": "default 360", + "matrix": null, + "cache": [ + { + "action": "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + "with": { + "bun-version": "1.3.14" + } + }, + { + "action": "actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830", + "with": { + "path": "~/.bun/install/cache", + "key": "bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}", + "restore-keys": "bun-${{ runner.os }}-" + } + } + ], + "if": "${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run_heavy == 'true') }}" + } + } + }, + "scorecard.yml": { + "name": "OpenSSF Scorecard", + "on": { + "schedule": [ + { + "cron": "0 9 * * 1" + } + ] + }, + "concurrency": null, + "jobs": { + "analysis": { + "runner": "ubuntu-latest", + "timeout": "default 360", + "matrix": null, + "cache": [], + "if": null + } + } + } +} +``` + +## Runner-OS totals + +```json +{ + ".github/workflows/ci.yml": { + "Linux": 60.28333333333334 + }, + ".github/workflows/auto-bump-cli-version.yml": { + "Linux": 2.8333333333333335 + }, + ".github/workflows/codeql.yml": { + "Linux": 43.96666666666667 + }, + ".github/workflows/selfhost-image.yml": { + "Linux": 35.86666666666667 + }, + ".github/workflows/desktop.yml": { + "Linux": 39.45, + "Windows": 44.61666666666667, + "macOS": 65.38333333333333 + }, + "dynamic/github-code-quality/codeql": { + "Linux": 33.05 + }, + ".github/workflows/scorecard.yml": { + "Linux": 2.9999999999999996 + }, + ".github/workflows/sync-skill-to-site.yml": { + "Linux": 0.08333333333333334 + }, + ".github/workflows/publish.yml": { + "Linux": 104.51666666666668, + "macOS": 81.93333333333334, + "Windows": 32.516666666666666 + } +} +``` diff --git a/docs/reports/ci-cost-runs.csv b/docs/reports/ci-cost-runs.csv new file mode 100644 index 00000000..ecda6db6 --- /dev/null +++ b/docs/reports/ci-cost-runs.csv @@ -0,0 +1,77 @@ +run_id,workflow_path,event,actor,actor_type,branch,head_sha,created_at_utc,run_attempts,conclusion,job_count_all_attempts,runner_assigned_jobs,runner_minutes_all_attempts,latest_attempt_elapsed_proxy_minutes,verification_branch,url +37349620975,.github/workflows/scorecard.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-05T17:35:55Z,1,success,1,1,0.6500,0.7333,False,https://github.com/selftune-dev/selftune/actions/runs/37349620975 +37354751201,.github/workflows/codeql.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-05T18:16:49Z,1,success,1,1,4.0500,4.1167,False,https://github.com/selftune-dev/selftune/actions/runs/37354751201 +37435594676,dynamic/github-code-quality/codeql,dynamic,github-code-quality[bot],Bot,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-06T08:21:46Z,1,success,1,1,2.2167,2.3000,False,https://github.com/selftune-dev/selftune/actions/runs/37435594676 +38290467834,.github/workflows/scorecard.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-12T18:22:28Z,1,success,1,1,0.7000,0.7500,False,https://github.com/selftune-dev/selftune/actions/runs/38290467834 +38293874219,.github/workflows/codeql.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-12T18:52:45Z,1,success,1,1,4.0000,4.0500,False,https://github.com/selftune-dev/selftune/actions/runs/38293874219 +38368671341,dynamic/github-code-quality/codeql,dynamic,github-code-quality[bot],Bot,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-13T08:21:10Z,1,success,1,1,2.3833,2.4667,False,https://github.com/selftune-dev/selftune/actions/runs/38368671341 +39282258486,.github/workflows/scorecard.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-19T16:01:25Z,1,success,1,1,1.0000,22.9833,False,https://github.com/selftune-dev/selftune/actions/runs/39282258486 +39285063777,.github/workflows/codeql.yml,schedule,WellDunDun,User,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-19T16:23:34Z,1,success,1,1,4.1833,15.8000,False,https://github.com/selftune-dev/selftune/actions/runs/39285063777 +39392840629,dynamic/github-code-quality/codeql,dynamic,github-code-quality[bot],Bot,main,76f6dbeefc22995c3735c1b6d11dc76f704fe041,2026-10-20T08:21:45Z,1,success,1,1,2.5833,2.6667,False,https://github.com/selftune-dev/selftune/actions/runs/39392840629 +39559484494,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/181/head,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:34Z,1,success,1,1,2.5000,2.5667,False,https://github.com/selftune-dev/selftune/actions/runs/39559484494 +39559486201,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:35Z,1,success,1,1,2.4667,2.5333,False,https://github.com/selftune-dev/selftune/actions/runs/39559486201 +39559486219,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:35Z,1,success,4,2,5.8667,5.9667,False,https://github.com/selftune-dev/selftune/actions/runs/39559486219 +39559486259,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:35Z,1,success,6,5,20.2333,8.3833,False,https://github.com/selftune-dev/selftune/actions/runs/39559486259 +39559486271,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:35Z,1,failure,3,3,4.8500,3.3167,False,https://github.com/selftune-dev/selftune/actions/runs/39559486271 +39559486274,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,28a64750ba6cd65624c0485fb6091a0b8be566b9,2026-10-21T07:04:35Z,1,success,1,1,0.3333,0.4000,False,https://github.com/selftune-dev/selftune/actions/runs/39559486274 +39560968719,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/181/head,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:40Z,1,success,1,1,2.2500,2.3000,False,https://github.com/selftune-dev/selftune/actions/runs/39560968719 +39560972866,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:42Z,1,success,3,3,10.1167,8.6333,False,https://github.com/selftune-dev/selftune/actions/runs/39560972866 +39560972867,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:42Z,1,success,1,1,2.2167,2.2667,False,https://github.com/selftune-dev/selftune/actions/runs/39560972867 +39560972987,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:42Z,1,success,1,1,0.3333,0.3833,False,https://github.com/selftune-dev/selftune/actions/runs/39560972987 +39560973027,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:42Z,1,success,6,5,21.0000,8.4500,False,https://github.com/selftune-dev/selftune/actions/runs/39560973027 +39560973070,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/performance-0-5-2,7f5632e91e83b916b691f78fef0bba74864df530,2026-10-21T07:17:42Z,1,success,4,2,4.2167,4.3000,False,https://github.com/selftune-dev/selftune/actions/runs/39560973070 +39562105398,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,main,a3629e15a3a600345d8871668efeb572d9d715ee,2026-10-21T07:27:29Z,1,success,1,1,2.4667,2.5500,False,https://github.com/selftune-dev/selftune/actions/runs/39562105398 +39562105491,.github/workflows/publish.yml,push,WellDunDun,User,main,a3629e15a3a600345d8871668efeb572d9d715ee,2026-10-21T07:27:29Z,3,success,45,39,128.1833,0.8833,False,https://github.com/selftune-dev/selftune/actions/runs/39562105491 +39562105510,.github/workflows/sync-skill-to-site.yml,push,WellDunDun,User,main,a3629e15a3a600345d8871668efeb572d9d715ee,2026-10-21T07:27:29Z,1,success,1,1,0.0500,0.1333,False,https://github.com/selftune-dev/selftune/actions/runs/39562105510 +39562105522,.github/workflows/codeql.yml,push,WellDunDun,User,main,a3629e15a3a600345d8871668efeb572d9d715ee,2026-10-21T07:27:29Z,1,success,1,1,4.4500,4.5167,False,https://github.com/selftune-dev/selftune/actions/runs/39562105522 +40070038927,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/182/head,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:48Z,1,success,1,1,2.3667,2.4333,False,https://github.com/selftune-dev/selftune/actions/runs/40070038927 +40070040582,.github/workflows/desktop.yml,pull_request,WellDunDun,User,release/storage-write-amplification,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:50Z,1,cancelled,6,5,19.0000,9.3833,False,https://github.com/selftune-dev/selftune/actions/runs/40070040582 +40070040590,.github/workflows/ci.yml,pull_request,WellDunDun,User,release/storage-write-amplification,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:50Z,1,success,3,3,8.1667,6.4667,False,https://github.com/selftune-dev/selftune/actions/runs/40070040590 +40070040591,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,release/storage-write-amplification,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:50Z,1,success,1,1,0.3333,0.3833,False,https://github.com/selftune-dev/selftune/actions/runs/40070040591 +40070040608,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,release/storage-write-amplification,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:50Z,1,success,4,2,5.1000,5.1833,False,https://github.com/selftune-dev/selftune/actions/runs/40070040608 +40070040684,.github/workflows/codeql.yml,pull_request,WellDunDun,User,release/storage-write-amplification,656dd1e68f02a8acc8d7a6eca41e13ffecd3b032,2026-10-24T06:23:50Z,1,success,1,1,2.8333,2.8667,False,https://github.com/selftune-dev/selftune/actions/runs/40070040684 +40070429591,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/182/head,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:50Z,1,success,1,1,1.6000,1.6667,False,https://github.com/selftune-dev/selftune/actions/runs/40070429591 +40070431757,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,release/storage-write-amplification,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:53Z,1,success,1,1,0.2667,0.3167,False,https://github.com/selftune-dev/selftune/actions/runs/40070431757 +40070431764,.github/workflows/desktop.yml,pull_request,WellDunDun,User,release/storage-write-amplification,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:53Z,1,failure,6,5,13.8667,8.4167,False,https://github.com/selftune-dev/selftune/actions/runs/40070431764 +40070431774,.github/workflows/codeql.yml,pull_request,WellDunDun,User,release/storage-write-amplification,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:53Z,1,success,1,1,2.7667,2.8167,False,https://github.com/selftune-dev/selftune/actions/runs/40070431774 +40070431793,.github/workflows/ci.yml,pull_request,WellDunDun,User,release/storage-write-amplification,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:53Z,1,success,3,3,9.9667,8.7333,False,https://github.com/selftune-dev/selftune/actions/runs/40070431793 +40070431841,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,release/storage-write-amplification,15fdd8c18c82c8d8e81cf71d1238c4f0e0cb966b,2026-10-24T06:29:53Z,1,success,4,2,4.9333,5.0000,False,https://github.com/selftune-dev/selftune/actions/runs/40070431841 +40071421701,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/182/head,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:55Z,1,success,1,1,1.8167,2.0500,False,https://github.com/selftune-dev/selftune/actions/runs/40071421701 +40071423442,.github/workflows/ci.yml,pull_request,WellDunDun,User,release/storage-write-amplification,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:57Z,1,success,3,3,9.5667,8.4833,False,https://github.com/selftune-dev/selftune/actions/runs/40071423442 +40071423452,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,release/storage-write-amplification,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:57Z,1,success,4,2,4.2333,4.2833,False,https://github.com/selftune-dev/selftune/actions/runs/40071423452 +40071423471,.github/workflows/codeql.yml,pull_request,WellDunDun,User,release/storage-write-amplification,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:57Z,1,success,1,1,2.0000,2.0500,False,https://github.com/selftune-dev/selftune/actions/runs/40071423471 +40071423481,.github/workflows/desktop.yml,pull_request,WellDunDun,User,release/storage-write-amplification,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:57Z,3,success,18,15,55.5667,9.8500,False,https://github.com/selftune-dev/selftune/actions/runs/40071423481 +40071423493,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,release/storage-write-amplification,857a9d5a9ba81d693773d5bbe01fd6135c121d16,2026-10-24T06:44:57Z,1,success,1,1,0.3500,0.3833,False,https://github.com/selftune-dev/selftune/actions/runs/40071423493 +40073450619,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-24T07:15:56Z,1,success,1,1,2.4333,2.4833,False,https://github.com/selftune-dev/selftune/actions/runs/40073450619 +40073451157,.github/workflows/publish.yml,push,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-24T07:15:56Z,2,success,30,28,90.7833,0.8667,False,https://github.com/selftune-dev/selftune/actions/runs/40073451157 +40073451172,.github/workflows/codeql.yml,push,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-24T07:15:57Z,1,success,1,1,4.1333,4.1667,False,https://github.com/selftune-dev/selftune/actions/runs/40073451172 +40073451186,.github/workflows/sync-skill-to-site.yml,push,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-24T07:15:57Z,1,success,1,1,0.0333,0.0833,False,https://github.com/selftune-dev/selftune/actions/runs/40073451186 +40351274034,.github/workflows/scorecard.yml,schedule,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-26T15:38:16Z,1,success,1,1,0.6500,0.8667,False,https://github.com/selftune-dev/selftune/actions/runs/40351274034 +40355278805,.github/workflows/codeql.yml,schedule,WellDunDun,User,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-26T16:02:45Z,1,success,1,1,4.1667,4.3167,False,https://github.com/selftune-dev/selftune/actions/runs/40355278805 +40472963547,dynamic/github-code-quality/codeql,dynamic,github-code-quality[bot],Bot,main,5335ce6a6e5469b2adf57bdb8035a6f3461a76a4,2026-10-27T08:21:46Z,1,success,1,1,2.4833,2.5500,False,https://github.com/selftune-dev/selftune/actions/runs/40472963547 +41443118420,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/183/head,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:55Z,1,success,1,1,2.0500,2.3000,True,https://github.com/selftune-dev/selftune/actions/runs/41443118420 +41443122894,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:57Z,1,success,1,1,0.3167,0.5500,True,https://github.com/selftune-dev/selftune/actions/runs/41443122894 +41443122973,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:57Z,1,cancelled,5,3,2.3333,2.5000,True,https://github.com/selftune-dev/selftune/actions/runs/41443122973 +41443123025,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:57Z,1,cancelled,5,4,2.3667,2.1667,True,https://github.com/selftune-dev/selftune/actions/runs/41443123025 +41443123029,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:57Z,1,cancelled,4,4,4.3833,4.4000,True,https://github.com/selftune-dev/selftune/actions/runs/41443123029 +41443123039,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,e204d2d3d747e2572e36264758713f431e13c341,2026-11-02T12:14:57Z,1,success,1,1,1.8167,1.8833,True,https://github.com/selftune-dev/selftune/actions/runs/41443123039 +41443249080,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/183/head,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:47Z,1,success,1,1,2.1167,2.2000,True,https://github.com/selftune-dev/selftune/actions/runs/41443249080 +41443257474,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:51Z,1,cancelled,5,3,2.5000,4.2333,True,https://github.com/selftune-dev/selftune/actions/runs/41443257474 +41443257510,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:51Z,1,cancelled,5,4,3.3833,3.4333,True,https://github.com/selftune-dev/selftune/actions/runs/41443257510 +41443257625,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:51Z,1,cancelled,0,0,0.0000,2.7833,True,https://github.com/selftune-dev/selftune/actions/runs/41443257625 +41443257660,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:51Z,1,success,1,1,0.2667,0.3333,True,https://github.com/selftune-dev/selftune/actions/runs/41443257660 +41443257789,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,a0d8c73de8f4a244e926e06b42ef1a497fce0682,2026-11-02T12:15:51Z,1,success,1,1,1.8333,2.0500,True,https://github.com/selftune-dev/selftune/actions/runs/41443257789 +41443322582,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/verify-docs-only-actions,5f3d4b1bc26f28faf15c377a716ff2fb99cfea91,2026-11-02T12:16:20Z,1,success,4,1,0.1333,0.2833,True,https://github.com/selftune-dev/selftune/actions/runs/41443322582 +41443622605,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/183/head,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:33Z,1,success,1,1,1.6667,1.7333,True,https://github.com/selftune-dev/selftune/actions/runs/41443622605 +41443628002,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:36Z,1,success,1,1,1.7833,1.8667,True,https://github.com/selftune-dev/selftune/actions/runs/41443628002 +41443628010,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:36Z,1,cancelled,4,4,2.6500,2.9833,True,https://github.com/selftune-dev/selftune/actions/runs/41443628010 +41443628016,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:36Z,1,cancelled,5,4,3.4667,2.9000,True,https://github.com/selftune-dev/selftune/actions/runs/41443628016 +41443628019,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:36Z,1,cancelled,5,2,0.6500,2.2500,True,https://github.com/selftune-dev/selftune/actions/runs/41443628019 +41443628054,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,125bc1e43cd8e71b3aaa518db5a17067440ecc1a,2026-11-02T12:18:36Z,1,success,1,1,0.3333,0.4000,True,https://github.com/selftune-dev/selftune/actions/runs/41443628054 +41443905824,dynamic/github-code-quality/codeql,dynamic,WellDunDun,User,refs/pull/183/head,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:35Z,1,success,1,1,2.1167,2.2000,True,https://github.com/selftune-dev/selftune/actions/runs/41443905824 +41443911448,.github/workflows/desktop.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:37Z,1,success,5,4,10.5667,8.1333,True,https://github.com/selftune-dev/selftune/actions/runs/41443911448 +41443911465,.github/workflows/codeql.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:37Z,1,success,1,1,1.2667,1.4833,True,https://github.com/selftune-dev/selftune/actions/runs/41443911465 +41443911471,.github/workflows/selfhost-image.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:37Z,1,success,5,3,6.0333,6.6167,True,https://github.com/selftune-dev/selftune/actions/runs/41443911471 +41443911622,.github/workflows/auto-bump-cli-version.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:38Z,1,success,1,1,0.3000,0.3500,True,https://github.com/selftune-dev/selftune/actions/runs/41443911622 +41443911708,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/trim-actions-usage,965b9c74dbbebfc741632143321f7a0ca7bc2e8a,2026-11-02T12:20:38Z,1,success,4,4,10.3167,10.0000,True,https://github.com/selftune-dev/selftune/actions/runs/41443911708 +41444025277,.github/workflows/ci.yml,pull_request,WellDunDun,User,codex/verify-docs-only-actions,74cb27ba359ad06802ea1539c5fd410b10875dd7,2026-11-02T12:21:27Z,1,success,4,1,0.1333,0.2000,True,https://github.com/selftune-dev/selftune/actions/runs/41444025277 diff --git a/docs/reports/test-suite-efficiency-report.md b/docs/reports/test-suite-efficiency-report.md new file mode 100644 index 00000000..7e87a4c4 --- /dev/null +++ b/docs/reports/test-suite-efficiency-report.md @@ -0,0 +1,26 @@ +# Test-suite efficiency audit + +Bounded discovery for the November 2, 2026 CI audit. Recommendations only. No test was deleted, merged, skipped or quarantined, and no coverage or project-rule gate changed. + +## Evidence and limits + +Window: October 3, 2026 12:57:26 UTC through November 2, 2026 12:57:26 UTC. The CI `Full workspace tests` steps consumed **48.45 observed runner minutes** across available attempts. CI as a whole consumed 60.28 observed job minutes. Of those test-step minutes, CI accounts for 27.95 min across 8 executions and Publish for 20.50 min across 5 executions. CI test steps are therefore 46.4% of the 60.28 measured CI job minutes. Setup, builds and parallel jobs are accounted separately in [the CI report](ci-cost-report.md). + +The final pre-audit [code CI run](https://github.com/selftune-dev/selftune/actions/runs/41443911708) passed its required test job in 8m05s. Historical jobs include intentional cancellation tests; those are not organic flakiness. Per-test durations, JUnit artifacts, assertion-level failure history, test counts/LOC growth and authorship were not retrieved. No mutation experiment was performed because no individual candidate has yet been identified with sufficient evidence. No claim about generated tests, redundant assertions or agent-created runtime share is supported. + +## Recommendations + +| Test or shared fixture | Origin and confidence | Runtime per run | Executions in window | Observed failures and history gaps | Mutation evidence and scope | Protected behavior and overlap | Proposal | Estimated runner minutes saved per month and confidence | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| Full workspace suite, `bun run test` | Mixed or unknown author origin; high confidence in job-step measurement, no individual test ranking | Individual timing not retrieved; latest required test job 8m05s includes more than this command | 13 executions: 8 CI and 5 Publish; a test-step execution is not the same as run count | One CI suite-step failure and no Publish suite-step failures were observed. The available final code run passes. Per-test historical failure records are not retrieved. Deliberate cancellations are separated from failures. | Not run; no selected candidate | Protects workspace behavior and failure paths. Equivalent coverage from desktop/self-host follow-up commands has not been established. | Keep all assertions. Collect existing per-test timing/report artifacts first, then time-box investigation of the slowest representative suite. | Pending; no defensible reduction estimate | +| Repeated dependency installation across CI/packaging/release jobs | Shared workflow setup, not attributed to agents | Across all workflows, `bun install --frozen-lockfile` steps consumed 23.00 min and ignore-scripts installs 23.30 min; setup command variants have different trust/runtime behavior | Complete job cohort is in the CI report; do not assume all installs are interchangeable | No cache-hit ledger or install-specific failure history retrieved | Not applicable to assertion removal | Installs pinned dependencies and native/runtime build inputs. Separate jobs require isolation; a shared node_modules artifact can change trust boundaries. | Inspect existing cache hit/miss rates and native dependencies. Prefer safe download-cache improvements before test removal. Preserve immutable lockfiles and release isolation. | Pending measurement; these totals are gross setup time, not avoidable savings | + +Value card for the workspace suite: it protects observable cross-package behavior; a real runtime or type-contract regression should fail it; overlapping suite coverage is not proven; no production-only-for-test seam was identified. Without individual timings and assertions, a deletion or consolidation recommendation would be speculation. + +Value card for dependency setup: it protects reproducible execution of the pinned suite; missing or incompatible dependencies should fail before tests run; repeated setup does not imply redundant behavior coverage; native packages and release isolation justify separate environments. + +## Next bounded pass + +Retrieve the repo's existing timing/artifact output for one expensive completed test job, separating installation, collection, fixture setup, test execution and teardown. Rank actual expensive test IDs. For any serious candidate, document its protected behavior, a plausible failing regression, overlap for the same boundary inputs, and any test-only production seam. Use a disposable checkout for a targeted fault only when it resolves a real uncertainty. Preserve known bug regressions, authentication and security checks. + +A later implementation step would need separate authorization for any test deletion, consolidation or quarantine. This audit does not add a CI stage, mutation tool or new project rule. Two-week remeasurement remains pending request or an authorized schedule. diff --git a/tests/scripts/release-workflows.test.ts b/tests/scripts/release-workflows.test.ts index 5d73c1c4..c6160c2e 100644 --- a/tests/scripts/release-workflows.test.ts +++ b/tests/scripts/release-workflows.test.ts @@ -240,6 +240,16 @@ describe("Changesets release ownership", () => { }); describe("parsed release workflow graph", () => { + test("passes dynamic matrix values through the environment rather than shell source", () => { + const desktop = workflowText("desktop.yml"); + expect(desktop).toContain("DESKTOP_PACKAGE_SCRIPT: ${{ matrix.package_script }}"); + expect(desktop).toContain("DESKTOP_ARCH_FLAG: ${{ matrix.arch_flag }}"); + expect(desktop).toContain('"$DESKTOP_PACKAGE_SCRIPT" -- "$DESKTOP_ARCH_FLAG"'); + expect(desktop).not.toContain("run: bun run --cwd apps/desktop ${{ matrix."); + expect(desktop).not.toContain('"${{ matrix.package_script }}"'); + expect(desktop).not.toContain("latest-mac-${{ matrix.target }}"); + }); + test("required PR gates propagate selector failures without resisting cancellation", () => { expect(workflow("ci.yml")).toMatchObject({ jobs: { @@ -264,10 +274,16 @@ describe("parsed release workflow graph", () => { test("cancels only PR runs and retains unfiltered main and merge-queue verification", () => { for (const name of ["ci.yml", "desktop.yml", "selfhost-image.yml"]) { expect(workflow(name)).toMatchObject({ - on: { push: { branches: ["main"] }, merge_group: null }, + on: { merge_group: null }, concurrency: { "cancel-in-progress": "${{ github.event_name == 'pull_request' }}" }, }); } + // Publish already owns the full post-merge workspace suite; avoid a duplicate CI push run. + expect(workflow("publish.yml")).toMatchObject({ on: { push: { branches: ["main"] } } }); + for (const name of ["desktop.yml", "selfhost-image.yml"]) { + expect(workflow(name)).toMatchObject({ on: { push: { branches: ["main"] } } }); + } + expect(workflowText("ci.yml")).not.toContain(" push:"); }); test("serializes post-merge releases and gates npm on both immutable candidates", () => {