Skip to content

Run the quality gates locally, before they ever reach CI - #118

Merged
dovvnloading merged 1 commit into
mainfrom
chore/local-quality-checks
Aug 10, 2026
Merged

Run the quality gates locally, before they ever reach CI#118
dovvnloading merged 1 commit into
mainfrom
chore/local-quality-checks

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

What

  • scripts/check.ps1 — runs the same gates CI runs, locally.
  • .githooks/pre-push — runs them automatically and aborts a failing push.
  • quality.yml — split into a fast PR gate and a heavy main-only job.

Local runner

./scripts/check.ps1            # quick tier, ~70-105s
./scripts/check.ps1 -Tier full # + compileall, Playwright e2e, bundle build

quick = ruff, pytest, contract drift, frontend types/lint/unit tests. full adds compileall, the browser tests, and the bundle build.

Packaging and the qualification spikes are deliberately excluded from both tiers — they take 35+ minutes and need signing tooling, so there's no honest way to put them in a local edit loop. CI keeps them.

Enable the hook once per clone:

git config core.hooksPath .githooks

Hooks live in a tracked .githooks/ directory rather than .git/hooks/, so they survive clones and work for anyone else. Bypass with git push --no-verify or CORTEX_SKIP_HOOK=1.

Workflow split

Job Trigger Contents
fast PRs + main Lint, tests, contracts, frontend (incl. e2e + build)
heavy main + manual dispatch, needs: fast Launcher bundle, PyInstaller packaging, worker/coordinator qualification, WebView2 signature check

A PR no longer waits on ~35 minutes of Windows packaging that it almost never invalidates, and needs: fast means nothing spends that time only to discover a lint error. All 26 steps from the original single job are preserved — verified by parsing both YAML files and diffing the step lists.

Note on cost

To be accurate about the motivation: this repo is public, so GitHub Actions on standard runners is already free and unlimited — this change doesn't reduce a bill, because there isn't one. What it does buy is faster feedback, fewer red PRs, and a much cheaper posture if the repo ever goes private (where windows-latest bills at a 2x multiplier).

Testing

The hook gated this very push: all 6 quick checks ran and passed in 68s before the push was allowed through.

🤖 Generated with Claude Code

Adds scripts/check.ps1, which runs the same checks quality.yml runs, on
your own machine. The default "quick" tier -- ruff, pytest, contract
drift, and frontend types/lint/unit tests -- finishes in about two
minutes. "-Tier full" adds compileall, the Playwright browser tests, and
the bundle build.

Packaging and the qualification spikes are deliberately excluded from
both tiers. They take 35+ minutes and need signing tooling, so there is
no honest way to make them part of a local edit loop.

A tracked .githooks/pre-push runs the quick tier and aborts the push if
anything fails, so a red build is caught before it is published rather
than minutes later in a browser tab. Enable it per clone with:

    git config core.hooksPath .githooks

Bypass with --no-verify when you genuinely need to.

quality.yml is split to match. A pull request now runs only the fast job
(lint, tests, contracts, frontend). The Windows packaging, the recipe
worker and coordinator qualifications, and the WebView2 signature check
move to a heavy job that runs on main or on demand, and only after the
fast job is green -- so nothing spends 35 minutes to discover a lint
error. Every step from the original single job is preserved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dovvnloading
dovvnloading merged commit f13408f into main Aug 10, 2026
2 checks passed
@dovvnloading
dovvnloading deleted the chore/local-quality-checks branch August 10, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant