feat(justfile): add classify-fixtures recipe (MK-15) #33

Merged
David merged 1 commit from feat/justfile-classify-fixtures-MK-15 into main 2026-05-24 05:38:14 +02:00
Owner

Closes MK-15. Parent: MK-5. Follow-up to MK-14.

What this does

Adds a just classify-fixtures recipe that replaces the ad-hoc shell loop used at the end of every classifier tuning iteration (MK-14 eta tuning, MK-9 graphic class, future tunes). The loop is:

  1. Build ./target/release/monkey.
  2. Walk tests/fixtures/classify/ one level deep. Each immediate subdirectory is the expected class label.
  3. For every file under that class (any depth), shell out to monkey image classify <file>, take the first tab-separated field, and compare to the parent directory name.
  4. Print one line per miss as MISS <class>/<basename> -> <got> and a <class>: <hits>/<total> per-class summary.
  5. Exit 1 if anything missed.

The fixture tree under tests/fixtures/classify/ is gitignored (per MK-14), so the recipe degrades gracefully on a fresh clone: prints a one-line hint that points at MK-14 and exits 0, short-circuiting the release build too.

Test plan

  • just --list shows classify-fixtures under a new validation group with the description above.
  • just classify-fixtures on a fresh clone with no fixtures prints no fixtures at tests/fixtures/classify; see MK-14 for the expected layout and exits 0 (no release build kicked off, no panic, no error: ...).
  • Reviewer with a local tests/fixtures/classify/ tree runs just classify-fixtures and confirms per-class lines + miss list match prior ad-hoc loop output.

Acceptance criteria

  • just classify-fixtures exists and follows the existing Nushell-recipe style.
  • Recipe builds the release binary, then iterates every file under tests/fixtures/classify/<class>/, comparing the emitted class to the directory name.
  • Per-class <class>: <hits>/<total> lines plus one miss line per failure printed to stdout.
  • Exits 0 on full pass (or empty tree), 1 on any miss.
  • No-fixtures case prints a one-line hint pointing at MK-14 and exits 0 (no panic, no error: ...).
  • justfile block documents the gitignored layout and links MK-14 in the recipe comment.
  • No new dependencies. No changes to Cargo.toml, no changes to source.
Closes MK-15. Parent: MK-5. Follow-up to MK-14. ## What this does Adds a `just classify-fixtures` recipe that replaces the ad-hoc shell loop used at the end of every classifier tuning iteration (MK-14 eta tuning, MK-9 graphic class, future tunes). The loop is: 1. Build `./target/release/monkey`. 2. Walk `tests/fixtures/classify/` one level deep. Each immediate subdirectory is the expected class label. 3. For every file under that class (any depth), shell out to `monkey image classify <file>`, take the first tab-separated field, and compare to the parent directory name. 4. Print one line per miss as `MISS <class>/<basename> -> <got>` and a `<class>: <hits>/<total>` per-class summary. 5. Exit 1 if anything missed. The fixture tree under `tests/fixtures/classify/` is gitignored (per MK-14), so the recipe degrades gracefully on a fresh clone: prints a one-line hint that points at MK-14 and exits 0, short-circuiting the release build too. ## Test plan - [x] `just --list` shows `classify-fixtures` under a new `validation` group with the description above. - [x] `just classify-fixtures` on a fresh clone with no fixtures prints `no fixtures at tests/fixtures/classify; see MK-14 for the expected layout` and exits 0 (no release build kicked off, no panic, no `error: ...`). - [ ] Reviewer with a local `tests/fixtures/classify/` tree runs `just classify-fixtures` and confirms per-class lines + miss list match prior ad-hoc loop output. ## Acceptance criteria - [x] `just classify-fixtures` exists and follows the existing Nushell-recipe style. - [x] Recipe builds the release binary, then iterates every file under `tests/fixtures/classify/<class>/`, comparing the emitted class to the directory name. - [x] Per-class `<class>: <hits>/<total>` lines plus one miss line per failure printed to stdout. - [x] Exits 0 on full pass (or empty tree), 1 on any miss. - [x] No-fixtures case prints a one-line hint pointing at MK-14 and exits 0 (no panic, no `error: ...`). - [x] `justfile` block documents the gitignored layout and links MK-14 in the recipe comment. - [x] No new dependencies. No changes to `Cargo.toml`, no changes to source.
feat(justfile): add classify-fixtures recipe for local validation
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 17s
Create release / Create release from merged PR (pull_request) Has been skipped
5887b94c6d
Replaces the ad-hoc shell loop pasted around every classifier tuning iteration (MK-14, MK-9, future) with a single `just classify-fixtures` recipe. Walks the gitignored `tests/fixtures/classify/<class>/` tree, treats each immediate subdirectory name as the expected label, classifies every file under it, prints a per-class hits/total line plus one MISS line per mismatch, and exits 1 on any miss. No-fixtures case prints a hint pointing at MK-14 and exits 0 so a fresh clone is a no-op; the early-exit short-circuits the release build too. No Rust changes; no new dependencies.

#MK-15 State Done
David merged commit df4aba1e21 into main 2026-05-24 05:38:14 +02:00
David deleted branch feat/justfile-classify-fixtures-MK-15 2026-05-24 05:38:14 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/monkey!33
No description provided.