Skip to content

The argparse flag set is not complete for a command built with typer - #26

Merged
melbinjp merged 2 commits into
mainfrom
argparse-set-is-not-complete-for-a-typer-cli
Aug 19, 2026
Merged

The argparse flag set is not complete for a command built with typer#26
melbinjp merged 2 commits into
mainfrom
argparse-set-is-not-complete-for-a-typer-cli

Conversation

@melbinjp

Copy link
Copy Markdown
Owner

parsers.py promises this in its own docstring:

when it says no, a flag it has not seen is unjudged, and the reason given is the incompleteness itself

It said yes, from the wrong parsers.

The case

unslothai/unsloth declares unsloth = unsloth_cli:app, a typer application. Its README shows:

unsloth start claude --as-subagent --model unsloth/model-GGUF:quant

--as-subagent is declared at unsloth_cli/commands/start.py:340:

_AS_SUBAGENT_OPTION = typer.Option(
    False,
    "--as-subagent",
    ...
)

docproof reported it BROKEN, with "no parser in this project defines it" and a list of 153 flags. Those came from the backend, the tests and the scripts elsewhere in the monorepo. seen_a_parser is repository-wide, and a monorepo is not one program.

The datasette rule above already catches a project with no argparse. It cannot catch one that has plenty, none of it behind the command being documented.

What changed

Completeness is asked of the command, not the repository. The console script names its module; if that package imports typer, click, cleo, docopt or fire, the argparse set cannot describe it. The package's own files only, because a framework imported by a sibling tool says nothing about this command.

Measured, over 44 clones that declare a console script

count
newly abstaining 12
of those, already incomplete under the datasette rule (0 argparse found) 7
genuinely changing 5: openmed, opensre, nanobot, unsloth, mitmproxy

In all five the complete verdict was false, so this is not a recall cost.

HKUDS/nanobot is the size of it. 93 findings, 90 of them cli-flag, console script nanobot.cli.entry:main, every option a typer.Option. Two spot-checked: --refresh and --wizard, both declared at nanobot/cli/commands.py:119-120, both reported BROKEN. With this change nanobot goes from 93 findings to zero.

93 of the 455 findings on disk across every sweep corpus were this one defect.

docproof itself stays complete at 6 flags. rigout stays incomplete for the reason it already was, a parser handed to helpers.

Two tests, one per direction. 203 tests.

This file's docstring promises the one thing that just happened cannot happen:

    when it says no, a flag it has not seen is unjudged, and the reason given is the
    incompleteness itself

It said yes, from the wrong parsers. `unslothai/unsloth` declares
`unsloth = unsloth_cli:app`, a typer application, and its README shows
`unsloth start claude --as-subagent`. That option is declared at
`unsloth_cli/commands/start.py:340` as `typer.Option(False, "--as-subagent", ...)`.
docproof reported it BROKEN with "no parser in this project defines it", because the
backend, tests and scripts elsewhere in the monorepo contain enough argparse for 153
flags and a complete verdict.

The datasette rule above catches a project with NO argparse. It cannot catch a monorepo
that has plenty, none of it behind the command being documented. So completeness is now
asked of the COMMAND rather than of the repository: the console script names its module,
and if that package imports typer, click, cleo, docopt or fire, the argparse set cannot
describe it.

Reads the package's own files only. A framework imported by a sibling tool in the same
repository says nothing about this command, and widening it to the whole tree would
silence the verifier on every repository that vendors an example.

docproof itself stays complete at 6 flags. rigout stays incomplete for the reason it
already was, a parser handed to helpers.

201 tests.
…osts

Measured over 44 clones that declare a console script: 12 newly abstain, and SEVEN of
those were already incomplete under the datasette rule with zero argparse found, so the
new reason only makes theirs specific. Five genuinely change: openmed, opensre, nanobot,
unsloth, mitmproxy.

In those five the "complete" verdict was false, so this is not a recall cost. HKUDS/nanobot
alone produced 93 findings, 90 of them cli-flag, and its console script is
`nanobot.cli.entry:main` with every option declared as `typer.Option`. Spot-checked two:
`--refresh` and `--wizard`, both at `nanobot/cli/commands.py:119-120`, both reported BROKEN.
With the fix nanobot goes from 93 findings to ZERO.

93 of the 455 findings on disk across every corpus were this one defect.

Two tests, one per direction: a typer console script beside plenty of argparse abstains,
and an argparse console script keeps judging.

203 tests.
@melbinjp
melbinjp merged commit 59ad696 into main Aug 19, 2026
21 checks passed
@melbinjp
melbinjp deleted the argparse-set-is-not-complete-for-a-typer-cli branch August 19, 2026 12:37
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