Repository navigation
refactor: split the single-file CLI behind a package facade + enforced size lint + retry re-invocations (L4#10 SB, L4#25 share) - #44
Merged
Conversation
… lint + retry re-invocations (L4#10, L4#25) - tools/checkyourself.py (5,519 lines, 156 top-level defs/classes) becomes the tools/checkyourself/ package: 22 engine modules split by verb + a re-export-only facade (__init__.py) + a 24-line compatibility launcher at tools/checkyourself.py so every documented invocation keeps working. - Enforced size discipline: ruff.toml selects E5 (line-length 120 enforced), CI runs ruff check + format --check (ruff pinned 0.16.5) and the new tools/lint_sizes.py (facade <=600, module <=1,000, function <=250 lines). - Retry re-invocations on every user-facing error path (kinocut errors.py::retry_message pattern): errors.py maps each verb to concrete MCP tools/call + CLI commands; CLI stderr/JSON, argparse usage errors, and all MCP JSON-RPC errors + tool error results carry them. - npm files list ships tools/checkyourself/ alongside the launcher. - 1.8.0 release note staged in CHANGELOG (Unreleased); npm publish NOT done. Behavior receipts: suite 152 tests + 88 subtests green before and after; MCP tools/list byte-identical (11 tools); npx-packed bin handshake serves the same 11 tool names; validate_public green; every error path carries a retry.
simongonzalezdc
added a commit
that referenced
this pull request
Oct 27, 2026
…3/25) (#45) Follow-up to #44 (L4#10 split). The Unreleased 1.8.0 entry cited mid-iteration numbers: facade 404 lines / 24-line launcher. Merged reality at 2822013 is facade `__init__.py` = 573 lines, launcher = 25 lines (wc -l). Docs-truth only — no code change. Verified: ruff check rc=0, validate_public rc=0, full suite 152 tests + 88 subtests green. <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/KyaniteLabs/codesmith/checkyourself/pr/45?autoLogin=true&ref=codesmith_pr_footer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png" width="162" height="28"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1795661627&installation_model_id=20207&pr_number=45&ref=codesmith_pr_footer&repository=KyaniteLabs%2Fcheckyourself&return_to=https%3A%2F%2Fgithub.com%2FKyaniteLabs%2Fcheckyourself%2Fpull%2F45&signature=c8fd23cb2d7bb279c7121bdd9410fd465a73a598299e3c23ddf1304a7488ce70"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"></picture></a> <sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup> <!-- codesmith:autofix:disabled --> <!-- /codesmith:footer -->
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.
Closes the L4#10 ship-blocker (ranked gate #2) and the checkyourself share of L4#25 from the teknium-bar audit.
What changed
The 1-file dump is gone.
tools/checkyourself.py(5,519 lines, 156 top-level defs+classes) is now thetools/checkyourself/package:constants,errors,models,util,config,challenge_config,challenge_run,scanning,detectors,scan,report,coverage,receipts,jsonlite,validation,scoring,planning,describe,output,project,cli,mcp— largest is 624 lines.__init__.py(573 lines) exposing the complete original top-level surface (all 254 names, underscore helpers included).tools/checkyourself.pyso every documented invocation —python3 tools/checkyourself.py <verb>, the npm bin wrapper, CI smoke steps, and file-path module loaders (spec_from_file_location) — works verbatim.Enforced size discipline (kinocut standard):
ruff.toml: line-length 120 now enforced (E5 added to select); W added; ruff pinned to 0.16.5 in CI so runner and local agree.ruff check tools tests+ruff format --check+python tools/lint_sizes.py.tools/lint_sizes.py(stdlib-only): facade <= 600 lines, module <= 1,000 lines, function <= 250 lines, across all production Python.mcp_toolswas split into 11 per-tool builders andbuild_findings's env-file block extracted into a helper so the tree passes those gates.Retry re-invocations on every user-facing error path (kinocut
errors.py::retry_messagepattern):errors.pymaps each verb/tool to a concrete MCPtools/calland CLI command.CliError:retry:line on stderr +retrykey in the JSON error object; argparse usage errors append a retry line (CheckYourselfParser).mcp_error(-32700/-32600/-32602 x4/-32601) and tool-call error results carry the concrete re-invocation.npm packaging ships
tools/checkyourself/alongside the launcher. The 1.8.0 release note is staged under Unreleased in CHANGELOG.md; npm publish has NOT been done (external publish act, CEO-gated).Behavior receipts (all reproduced on this branch)
tools/listvs mainvalidate_public.pyimport tools.checkyourself+ path-loader parityThe 11-tool MCP surface names: describe, scan, coverage_emit, coverage_check, receipt_issue, score, backlog, next, diff, validate, schema.
Need help on this PR? Tag
@codesmith-botwith what you need.