Skip to content

09 — Quality gates

Local gates (lefthook) replaced GitHub Actions as the primary CI surface (see recent chore commit). Detail: docs/hooks.md, lefthook.yml.

Pipeline sketch

flowchart TB
    subgraph precommit["pre-commit (path filtered)"]
        H[hadolint Dockerfiles]
        CPP[cmake build + ctest]
        CF[dotnet format verify]
        CLF[clang-format dry-run]
        CT[clang-tidy]
    end
    subgraph prepush["pre-push"]
        LF[layer-fitness.sh]
        SF[structural-fitness / related]
        SM[smoke / other project hooks]
    end
    precommit --> commit
    prepush --> push

Exact command set evolves with lefthook.yml — always read that file.

Script inventory

Script Purpose
scripts/layer-fitness.sh L0 must not include engine.h; no UI under Engine
scripts/layer-fitness-tests.sh Mutation tests of layer-fitness assertions
scripts/structural-fitness.sh Physical tree / module structure expectations
scripts/structural-fitness-tests.sh Mutation/adversarial suite for structural
scripts/smoke-apps.sh App launch smoke
scripts/_smoke_scan.py Smoke scanning helper
scripts/no-placeholder-scan.sh Forbid placeholder markers in product sources
scripts/closure-integrity.sh Closure/tarball integrity
scripts/closure-integrity-tests.sh Tests for closure script
scripts/nps-n1m-12-production-gate.sh ABI Test* / hooks not in prod surface
scripts/layer-fitness related ctest nps_n1m_8_layer_fitness (+ mutation)
scripts/debug-mixed.sh Mixed-mode debug helper (nps-580)
scripts/debug-mixed.ps1 Windows twin of debug-mixed.sh (no test coverage)
scripts/deploy-docs.sh Docs site deploy (Cloudflare Pages), live pre-push on docs/guide/**

ctest ↔ scripts

ctest name Backing
NPSEngineTests Catch2 binary
nps_n1m_8_layer_fitness layer-fitness.sh
nps_n1m_8_layer_fitness_mutation_tests layer-fitness-tests.sh
nps_n1m_12_abi_header_gates_test_decls ABI test-hook gating
nps580_* debug-mixed / Dockerfile.debug contracts

What “green” means for a change

  1. cmake --build build && ctest --test-dir build --output-on-failure
  2. dotnet test with invariant globalization if required
  3. Relevant lefthook pre-commit globs for touched paths
  4. No new placeholders; layer/structural fitness if engine layout changes
  5. Dual harness still asserts Benchy golden counts when loader touched

See also