@@ -24,10 +24,25 @@ if [[ ! -f package.json ]]; then
2424 fail " package.json missing in workdir"
2525fi
2626
27- # The decoy rounding line in reports.ts must stay untouched -- the real fix
28- # lives in aggregate.ts, not in the module where the error surfaces.
27+ # Shipped tests must stay untouched -- a passing suite must come from a real
28+ # fix, not from editing/deleting what grades it.
29+ if ! git diff --quiet --exit-code HEAD -- tests/; then
30+ echo " --- git diff HEAD -- tests/ ---"
31+ git diff HEAD -- tests/
32+ fail " tests/ modified relative to the fixture commit (shipped tests must stay untouched)"
33+ fi
34+ if [[ -n " $( git status --porcelain -- tests/) " ]]; then
35+ echo " --- git status --porcelain -- tests/ ---"
36+ git status --porcelain -- tests/
37+ fail " tests/ has staged or untracked changes (shipped tests must stay untouched)"
38+ fi
39+
40+ # The decoy rounding line in reports.ts is informational only: a legitimate
41+ # fix may rewrite reports.ts entirely (e.g. summing correctly there and
42+ # dropping the TODO). Pass/fail is decided by the hidden tests below; this
43+ # just calls out when the decoy was disturbed, for debugging.
2944if ! grep -q ' // TODO: rounding here is probably wrong' src/routes/reports.ts 2> /dev/null; then
30- fail " src/routes/reports.ts decoy rounding line was removed/edited -- fix belongs in aggregate.ts, not here "
45+ echo " NOTE: src/routes/reports.ts decoy rounding line was removed/edited (not necessarily a problem) "
3146fi
3247
3348mkdir -p tests/hidden
0 commit comments