Files
archived-orca/.github/workflows/main-blocking-work.yml
Brennan Benson fb71c6ae4c ci(ratchets): fail PRs that add callers of sync helpers on Electron main (#43399)
* ci(ratchets): guard callers of sync helpers on main and skip worker-only modules

The main-thread ratchets counted blocking call syntax per file, so a new
caller of an existing sync helper in another file (env store reads, Codex
transcript cursor, durable secure writes) passed CI. A new ratchet counts
references to functions that make a synchronous fs, child_process or
SQLite call. Modules imported only by worker/utility entries are no longer
charged as main-thread work, and SQLite pragma()/transaction() now count.

* ci(ratchets): follow sync helpers two levels so timer and handler callers count

* ci(ratchets): guard event-loop entries, follow default exports and barrels, carry rows across renames

* test(ratchets): keep the shared import when checking a guarded entry

* ci(ratchets): shadow helpers only by parameters in scope, fail on unreadable entry lists, keep transaction results out of SQLite receivers

* ci(ratchets): match helper names file-wide (council ruling), harden entry discovery, count transaction modes

* Merge origin/main; baseline main's new WSL helper callers

* fix(ratchets): preserve helper exports and fail closed on missing roots

* Keep main's note on the worker large-send log baseline row
2026-11-17 14:49:39 -08:00

28 lines
1.1 KiB
YAML

name: Main blocking work guards
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: main-blocking-work-${{ github.ref }}
cancel-in-progress: false
jobs:
ratchets:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-node-dependencies
# Run the blocking-work ratchets over the full tree after every main merge.
- name: Enforce ratchets
run: |
node config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-sync-fs-ratchet.mjs
node config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-api-ratchet.mjs
node config/scripts/static-analysis/ratchets/runtime-lifecycle/check-main-blocking-helper-ratchet.mjs
# The PR preflight runs spawn separately, so the discovery runner intentionally excludes it.
- name: Enforce synchronous launches
if: '!cancelled()'
run: node config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.mjs