Give catalog subcommands the shared output vocabulary - #4
Merged
Conversation
…g else Found by cold-installing the repo into a fresh virtualenv and typing the commands a new user would type, in order. The ninth one failed. No catalog subcommand accepted `-o` at all, `--quiet` reached only `ingest`, and `--markdown` reached only the others -- while `-o` works on all ten analyzers. The earlier uniformity check only covered analyzers, so the split went unseen. Applied once, after every subparser is built, rather than inside each one. Adding them per-subcommand is precisely how they drifted apart. The first attempt at this fix added the flags to the parsers and stopped there, so `-o` parsed cleanly and wrote nothing -- the dead-flag bug this project keeps producing, and worse than not offering the flag, because the caller believes a file was written. Every payload now goes through one `_emit` helper. The test asserts behaviour rather than help text: that `-o` writes a non-empty file AND leaves stdout empty, that the default is JSON, and that `--markdown` is not. Unwiring `-o` again fails it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by cold-installing the repo into a fresh virtualenv and typing the commands a new user would type, in order. The ninth one failed.
The gap
No catalog subcommand accepted
-oat all.--quietreached onlyingest;--markdownreached only the others. Meanwhile-oworks on all ten analyzers — so a user meets the inconsistency in their first minute.The earlier uniformity check only covered analyzers, which is why this went unseen.
Two bugs, not one
Applying the flags per-subcommand is how they drifted, so they are now applied once after every subparser is built.
More importantly: the first version of this fix added the flags and stopped there. They parsed cleanly and did nothing —
-owrote no file and the payload still went to stdout. That is the dead-flag bug this project keeps producing, and it is worse than not offering the flag at all, because the caller believes a file was written. Every payload now routes through one_emithelper.The test asserts behaviour, not help text
That
-owrites a non-empty file and leaves stdout empty, that the default is JSON, and that--markdownis not JSON. Unwiring-oagain fails it — verified by mutation.523 tests, green on 3.10–3.13.
🤖 Generated with Claude Code