Skip to content

chore(repo): one canonical way to run the checks - #249

Merged
JArmandoAnaya merged 1 commit into
mainfrom
chore/post-run-3
Aug 3, 2026
Merged

chore(repo): one canonical way to run the checks#249
JArmandoAnaya merged 1 commit into
mainfrom
chore/post-run-3

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Two background invocations of uv run pytest -q | tail -20 reported exit 0 during the #229#233 run while the suite was failing. A pipeline's status is the last command's, so tail succeeding at printing lines masked pytest failing at running them — and a real broken test survived two task cycles.

scripts/check.sh is the fix, and the place the rule now lives.

bash scripts/check.sh                  # python + frontend + generated
bash scripts/check.sh python           # one group
pnpm check                             # the same script, from the other half

It carries set -euo pipefail, and it collects every failure rather than stopping at the first — knowing that lint and a test are broken is one round trip where learning it twice is two.

Decisions taken

A script, not a Makefile. This repository has never had make, and scripts/build_dist.sh / scripts/cycle_server.sh are the established shape for "several commands whose order or failure handling matters". Adding a second tool convention to hold four lines of dispatch is not worth it.

What it does not run is stated rather than implied. The wheel build, the 30-minute flow, the format smoke tests (ultralytics brings torch) and everything Playwright stay in CI, because each costs minutes or needs its own install. CONTRIBUTING.md's table is still the full list and now carries an In check.sh column — including for the rows covered indirectly, so pnpm -r lint running the annotator boundary gate and uv run pytest running the wire-fixture gate are visible rather than assumed.

The generated group mirrors each artifact's real mechanism instead of inventing a uniform --check they do not have. openapi.json has no check mode, so it regenerates and diffs exactly as CI does — a side effect worth knowing about, since a stale spec is left corrected in the working tree. tests/fixtures/wire_annotations.json is deliberately absent: its gate is tests/server/test_wire_fixtures.py, which the python group already runs.

A missing node_modules is refused up front, with a sentence naming pnpm install. Found while testing this in a fresh worktree: otherwise the first thing you see is ERR_MODULE_NOT_FOUND: openapi-typescript under a nine-line node stack, which reads as "the generated client is broken" rather than "nothing is installed" — and a fresh worktree is exactly where somebody runs this first.

Verification

The original bug, reproduced and then caught. A deliberately failing test:

--- old habit: pipe through tail ---
FAILED tests/kernel/test_zz_mutation_probe.py::test_deliberately_broken_for_a_mutation_check
PIPELINE_EXIT=0          # <- the bug

--- the script ---
SCRIPT_EXIT=1
    FAILED (python tests, exit 1)
FAILED: python tests

All three groups run green on this branch (python, frontend, generated).

Not in this PR

The same rule was added to the local CLAUDE.md, which is git-excluded and must never be committed. The committed home for it is CONTRIBUTING.md, above the check table.

Two background invocations of `uv run pytest -q | tail -20` reported exit 0
during the #229#233 run while the suite was failing. A pipeline's status is the
last command's, so `tail` succeeding at printing lines masked pytest failing at
running them, and a real broken test survived two task cycles.

`scripts/check.sh` is the fix and the place the rule now lives. It carries
`set -euo pipefail`, and it collects every failure rather than stopping at the
first — knowing that lint *and* a test are broken is one round trip where
learning it twice is two. Three groups, run individually or together:

    bash scripts/check.sh                  # python + frontend + generated
    bash scripts/check.sh python
    pnpm check                             # the same script, from the other half

A script rather than a Makefile because this repository has never had `make`,
and `build_dist.sh` / `cycle_server.sh` are the established shape for "several
commands whose order or failure handling matters".

What it does not run is stated rather than implied: the wheel build, the
30-minute flow, the format smoke tests and everything Playwright stay in CI,
because each costs minutes or needs its own install. `CONTRIBUTING.md`'s table
is still the full list and now carries a column saying which group covers each
row — including the two that are covered indirectly, so `pnpm -r lint` running
the annotator boundary and `uv run pytest` running the wire-fixture gate are
visible rather than assumed.

Two details worth the lines. The `generated` group mirrors each artifact's real
mechanism instead of inventing a uniform `--check` they do not have: `openapi.json`
has no check mode, so it regenerates and diffs the way CI does, and the wire
fixture is absent because its gate is a pytest test the `python` group already
runs. And a missing `node_modules` is refused up front with a sentence naming
`pnpm install`, because otherwise the first thing a fresh worktree sees is
`ERR_MODULE_NOT_FOUND: openapi-typescript` under a nine-line node stack, which
reads as a broken client rather than an empty checkout.

Verified by reproducing the original bug: a deliberately failing test gives
`exit 0` through `| tail -3` and `exit 1` through this script, naming the group.
All three groups run green on this branch.
@JArmandoAnaya
JArmandoAnaya merged commit a4c7b44 into main Aug 3, 2026
13 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the chore/post-run-3 branch August 3, 2026 04:48
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