Part of #9. Phase 1 — level 1.
Learning goals
Integration testing a binary (TRPL Writing Automated Tests + the assert_cmd/predicates
crates), filesystem hygiene (tempfile), serde round-trips as a cache format, GitHub Actions for
Rust (dtolnay/rust-toolchain, Swatinem/rust-cache — already in your release.yml, reuse them).
Task
- Per-run output cache: write
analysis_cache.json under -c after every successful run;
on a lazy re-run, reuse per-file RustModules whose hash/mtime/size are unchanged and rebuild
only what changed. --eager forces a clean rebuild and rewrites the cache.
- Flag validation everywhere:
--format msgpack (until implemented) and any unknown --emit
exit non-zero with a clear message — asserted by an integration test, not a promise.
- stdout contract: no
-o → compact JSON on stdout, logs on stderr only (pipe-clean at -vv).
- CI: a
test.yml running fmt + clippy -D warnings + the full test suite on push/PR, so every
later issue's gate is un-regressable.
Teacher's notes
- The four caching behaviors to assert (from the skill's testing reference): CacheFileWritten,
CacheContentsRoundTrip, SecondRunReuses, EagerForcesRebuild (sleep ≥1s so mtime can advance).
assert_cmd drives the real binary — this is where the stdout/stderr split gets honest.
Gate
- All four caching tests + both flag-validation tests green, in CI.
- A
-vv run piped to jq . parses — logs never contaminate stdout.
Part of #9. Phase 1 — level 1.
Learning goals
Integration testing a binary (TRPL Writing Automated Tests + the
assert_cmd/predicatescrates), filesystem hygiene (
tempfile), serde round-trips as a cache format, GitHub Actions forRust (
dtolnay/rust-toolchain,Swatinem/rust-cache— already in your release.yml, reuse them).Task
analysis_cache.jsonunder-cafter every successful run;on a lazy re-run, reuse per-file
RustModules whose hash/mtime/size are unchanged and rebuildonly what changed.
--eagerforces a clean rebuild and rewrites the cache.--format msgpack(until implemented) and any unknown--emitexit non-zero with a clear message — asserted by an integration test, not a promise.
-o→ compact JSON on stdout, logs on stderr only (pipe-clean at -vv).test.ymlrunning fmt + clippy -D warnings + the full test suite on push/PR, so everylater issue's gate is un-regressable.
Teacher's notes
CacheContentsRoundTrip, SecondRunReuses, EagerForcesRebuild (sleep ≥1s so mtime can advance).
assert_cmddrives the real binary — this is where the stdout/stderr split gets honest.Gate
-vvrun piped tojq .parses — logs never contaminate stdout.