#!/usr/bin/env bash # Pre-commit + CI checks for the nixos flake. # Runs the most useful invariants from analysis-report.md §5. # # Usage: # .ci/checks.sh # run all # .ci/checks.sh --no-build # skip nix flake check (faster, no network) # # Exit codes: # 0 — all checks passed # 1 — at least one check failed (stderr has details) # # Checks implemented: # #2 nix flake check (all outputs evaluate) # #7 secrets/ files match .sops.yaml path_regex # #1 no `:latest` in container images (whitelist: tape-rotation only; # 3x-ui is pinned to v3.11.0 since 2026-10-25, was v3.10.2 since # 2026-10-20, R1.5/ADR-0007) # #8 every import reference resolves (no dangling imports) — added 2026-10-24 # #9 .agent JSON artefacts validate against their schemas — added 2026-10-25 # #10 CoreDNS records and nginx vhosts agree — added 2026-11-15 # #11 `listen.addr` names an interface, not a network — added 2026-11-15 # #12 AGENTS.md / manifest.md / manifest.json / decisions index agree # — added 2026-11-15 # #13 shell scripts pass ShellCheck — added 2026-11-15 # # Every python check below is also a standalone script, so it can be run # directly: `python3 .ci/tests/