Repository navigation
refactor: make the source and tests consistent - #80
Merged
Merged
Conversation
Rename the internal input model base to InputModel, so "command" only means the registered function. Replace the exit code constants with an ExitCode enum. InputRejected and CommandError both expose report as a property, and InputRejected.from_parse replaces the rejected_input function. Each subparser stores one leaf record with the spec, the CLI source and the valid flags, computed when the parser is built. Cut each comment to one line that says why, and drop the module docstrings. Refs #79
conftest.py holds the run fixture and the shared notes app. The tests split into commands, rejected input, command errors and string errors. The example apps are now a generic notes and calc CLI. New tests cover registering a nameless callable and storing safety hints. Closes #79
edornd
force-pushed
the
79-coherence-pass
branch
from
October 31, 2026 19:48
312e112 to
b6804ab
Compare
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.
Summary
This PR is stacked on #78 and is a cleanup only. CLI output, exit codes and the public API stay the same.
Every comment in
src/is now one line that says why.The example apps are now a generic
notesandcalcCLI instead of a Slurm training tool.Evidence
After: 61 passed, 34 test functions. The new one checks that registering a
functools.partialraisesTypeError. The safety-hints test now checks the hints stored on the spec.Merge Danger
Door: two-way
Only internal names change.
AppandCommandErrorkeep their signatures.Blast Radius: none
Nothing outside
argdanticimportsCommand,rejected_inputor theEXIT_*constants.Closes #79