WUT_Computer_Science/scripts
Krzysztof kuhy Rudnicki f780d023be A run may no longer change the tree it ran in
Executing coursework has silently overwritten a submitted deliverable twice in
this campaign -- TRAK's outputs/output.png and SPD's results_*.png -- and both
times it was found by a later `git status`, not by the run. `course_main` now
snapshots what git sees under the course root before and after `_run`, and
fails with a diff naming the files if anything moved. Gitignored build output
does not show up there, which is why every runner already writes into build/.

Seen failing before being trusted: a stub whose `_run` appends a newline to
TRAK's config.ini exits 1 and names the file; the same stub without the append
exits 0; and a real `./run.sh run Programming/TRAK` still exits 0 after
rendering, because it writes into build/.

The notebook branch was the specific landmine. `nbconvert --execute --inplace`
rewrites the notebook it just ran, and all four notebooks here are tracked with
their outputs. It now executes to a temp --output-dir. That alone is not
enough, though: nbconvert runs the kernel with its cwd set to the notebook's
own directory, so a cell calling plt.savefig('x.png') still writes beside the
notebook. The tree check above is what actually catches that, which is why it
lives in course_main and applies to every course kind rather than to notebooks.

`_have jupyter` was also the wrong probe. jupyter on this machine is a pipx
shim whose interpreter is gone: `command -v` finds it, and running it exits
127. Both the probe and the runner now use `_works`, which runs `--version`.
`./Programming/twm_4/run.sh --probe` reports "needs jupyter" and exit 78
instead of failing confusingly mid-run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 07:59:15 +02:00
..
check_ignore_consistency.sh Gate the invariants, fix ECOTE's unrunnable tests, contain build output 2026-08-28 18:43:13 +02:00
check_md_naming.sh Add pre-commit and fix everything it found 2026-08-28 18:21:22 +02:00
check_no_binaries.sh Add the no-binaries gate with a path-scoped allowlist 2026-08-28 17:37:53 +02:00
check_refactor_safety.py PORR runs in 28s, and three checks so the next pass cannot repeat my mistakes 2026-08-28 20:50:46 +02:00
course_lib.sh A run may no longer change the tree it ran in 2026-08-29 07:59:15 +02:00
course_probe.sh A run may no longer change the tree it ran in 2026-08-29 07:59:15 +02:00
course_run.sh A run may no longer change the tree it ran in 2026-08-29 07:59:15 +02:00
split_tex_sections.py Split 19 over-cap LaTeX reports, proving each PDF is unchanged 2026-08-28 19:47:12 +02:00
tex_fingerprint.sh Split 19 over-cap LaTeX reports, proving each PDF is unchanged 2026-08-28 19:47:12 +02:00