Quality & Testing

The quality gate

Every push passes beforePush.sh / beforePush.ps1 (5 stages):

  1. ruff check (lint)
  2. ruff format check
  3. mypy src
  4. CRITICAL suite pytest run (tests/critical_suite.txt, ~779 tests,

RAM-aware xdist workers, coverage)

  1. Forensic deploy gate writing artifacts/forensics/deploy_gate_result.json

-FullSuite runs the whole ~1931-test unit corpus. CI mirrors the gate

(.github/workflows/ci.yml) and adds CodeQL, Trivy, OSV, lockfile-diff and JS

tests on separate workflows.

Test architecture

SuiteLocationCharacter
Unittests/unit/~1900 tests; critical subset in critical_suite.txt
Integrationtests/integration/API + engine-level, run standalone/sequential in CI
Goldentests/golden/ + test_*_golden.pybyte/behavior-identical extraction gates (decomposition safety)
CLI E2Etest_cli_end_to_end.py66 end-to-end CLI contracts incl. exit codes
Installertests/installer/stage protocol tests
JStests/js/Control Center syntax/behavior gates

Golden tests (decomposition safety)

Large hot-path modules are decomposed only behind golden tests written

before extraction: the extracted seam must be behaviorally identical

(e.g. OrderManager's state machine, protection ledger, recovery budget;

reporting read-adapter golden JSON).

No fake green

"passing" runs.

2 usage · 3 environment blocked · 4 release verification · 5 update.

Static anti-crash checks

scripts/ci/anti_crash_static.py scans for silent exception handlers

(SILENT_HANDLER sites are ledgered as P1 findings, with an explicit inline

allow marker + allowlist for legitimate migrations).