Skip to content

Give catalog subcommands the shared output vocabulary - #4

Merged
Lumi-node merged 1 commit into
mainfrom
fix/catalog-flag-uniformity
Aug 23, 2026
Merged

Give catalog subcommands the shared output vocabulary#4
Lumi-node merged 1 commit into
mainfrom
fix/catalog-flag-uniformity

Conversation

@Lumi-node

Copy link
Copy Markdown
Owner

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 -o at all. --quiet reached only ingest; --markdown reached only the others. Meanwhile -o works 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 — -o wrote 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 _emit helper.

The test asserts behaviour, not help text

That -o writes a non-empty file and leaves stdout empty, that the default is JSON, and that --markdown is not JSON. Unwiring -o again fails it — verified by mutation.

523 tests, green on 3.10–3.13.

🤖 Generated with Claude Code

…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>
@Lumi-node
Lumi-node merged commit a4703d6 into main Aug 23, 2026
4 checks passed
@Lumi-node
Lumi-node deleted the fix/catalog-flag-uniformity branch August 23, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant