feat(justfile): colour classify-fixtures output and add summary (MK-22) #38

Merged
David merged 1 commit from feat/classify-fixtures-color-MK-22 into main 2026-05-24 20:33:58 +02:00
Owner

Implements MK-22.

Summary

  • ANSI colour added to recipe-emitted lines so MISS / per-class totals / summary stand out from the existing classify: stderr noise.
    • MISS lines: bold red.
    • Per-class totals: green on pass, red on fail, dim grey on empty class directory.
    • New closing line total: <hits>/<files> - <misses> misses: bold green on zero misses, bold red otherwise.
  • NO_COLOR honoured (https://no-color.org/): any non-empty NO_COLOR env var skips every ANSI escape so piped / scripted consumers see plain text.
  • monkey image classify's classify: stderr lines are deliberately left intact per user direction; per-file timing is useful when diagnosing a slow fixture.

Verification

just classify-fixtures            # ANSI escapes visible in MISS / totals / summary
NO_COLOR=1 just classify-fixtures # plain text, no escapes

Exit code behaviour unchanged: 0 on zero misses, 1 otherwise.

Test plan

  • Default invocation: ANSI escapes present in MISS / per-class totals / summary line.
  • NO_COLOR=1 invocation: no ANSI escapes.
  • Empty class directory still renders <class>: 0/0 in dim grey, not counted as a failure.
  • CI on Forgejo.
Implements MK-22. ## Summary - ANSI colour added to recipe-emitted lines so MISS / per-class totals / summary stand out from the existing `classify:` stderr noise. - MISS lines: bold red. - Per-class totals: green on pass, red on fail, dim grey on empty class directory. - New closing line `total: <hits>/<files> - <misses> misses`: bold green on zero misses, bold red otherwise. - `NO_COLOR` honoured (https://no-color.org/): any non-empty `NO_COLOR` env var skips every ANSI escape so piped / scripted consumers see plain text. - `monkey image classify`'s `classify:` stderr lines are deliberately left intact per user direction; per-file timing is useful when diagnosing a slow fixture. ## Verification ```sh just classify-fixtures # ANSI escapes visible in MISS / totals / summary NO_COLOR=1 just classify-fixtures # plain text, no escapes ``` Exit code behaviour unchanged: 0 on zero misses, 1 otherwise. ## Test plan - [x] Default invocation: ANSI escapes present in MISS / per-class totals / summary line. - [x] `NO_COLOR=1` invocation: no ANSI escapes. - [x] Empty class directory still renders `<class>: 0/0` in dim grey, not counted as a failure. - [ ] CI on Forgejo.
feat(justfile): colour MISS lines and add total summary in classify-fixtures
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 39s
Create release / Create release from merged PR (pull_request) Has been skipped
5bd6f47e37
`just classify-fixtures` interleaves three output streams: `monkey image classify`'s per-file `classify:` stderr line (one per fixture, ~50 lines on a typical corpus), the recipe's `MISS <class>/<file> -> <got>` lines on stdout, and the per-class `<class>: <hits>/<total>` totals on stdout. The MISS lines and totals visually drown in the stderr noise: a reader has to scroll and mentally `grep` for `MISS` to find what failed. There was also no closing summary, so the bottom line (total hits, total files, total misses) required mentally summing the per-class rows.

Adds ANSI colour to the recipe-emitted lines so the signal is visible amid the existing noise: MISS lines in bold red, passing class totals in green, failing class totals in red, empty class directories in dim grey, and the new closing `total: <hits>/<files> - <misses> misses` line in bold green when zero misses or bold red otherwise. The `classify:` stderr lines from monkey are deliberately left intact per user direction; per-file timing remains useful when diagnosing a slow fixture.

Honours `NO_COLOR` (https://no-color.org/): any non-empty `NO_COLOR` env var skips every ANSI escape so piped / scripted / colour-blind consumers see plain text. Verified locally with both default invocation (escapes emit) and `NO_COLOR=1 just classify-fixtures` (no escapes).

No new dependencies; uses Nushell's built-in `ansi` command. Exit code behaviour unchanged: 0 on zero misses, 1 otherwise.

#MK-22 State Done

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
David merged commit 3f44ac4eeb into main 2026-05-24 20:33:58 +02:00
David deleted branch feat/classify-fixtures-color-MK-22 2026-05-24 20:33:58 +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!38
No description provided.