Fold per-command run-logic into commands/<cmd>/ packages#148
Merged
Conversation
Each command that owns private run-logic becomes a package instead of a flat module plus a sibling *_exec.py at the package root: __init__.py holds the Typer app + SPEC, and its support modules sit beside it underscore- prefixed (_exec.py for the run_<cmd> body, plus _select/_data/_hf_api/_listen helpers). This colocates a command's exec with the command file and follows the Prefect/spaCy convention (flat file by default; promote to a folder only when a command has earned multiple modules; underscore-prefix private modules, which also dodges the webhooks `listen` command-vs-module name collision). 13 commands folded: stream, agent, speak, llm, clip, dictate, caption, dub, evaluate, deploy, dev, share, webhooks. transcribe and init stay at the root alongside doctor_checks/setup_exec because the onboarding wizard (onboard/sections.py) reuses transcribe_exec/render/batch and init_exec, so they are shared beyond a single command. command_registry already discovers packages (pkgutil.iter_modules), so registration, help ordering, and the snapshot partition are unchanged. import-linter contract 1 drops the folded execs (now covered by contract 2's independence rule) and contract 3 points at the new _select/_data paths; all three contracts stay green. AGENTS.md documents the module-or-package rule. https://claude.ai/code/session_01XfcMSCxZPLJgg2UQBy8a4v
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.
Each command that owns private run-logic becomes a package instead of a
flat module plus a sibling *_exec.py at the package root: init.py holds
the Typer app + SPEC, and its support modules sit beside it underscore-
prefixed (exec.py for the run body, plus _select/_data/_hf_api/_listen
helpers). This colocates a command's exec with the command file and follows
the Prefect/spaCy convention (flat file by default; promote to a folder only
when a command has earned multiple modules; underscore-prefix private modules,
which also dodges the webhooks
listencommand-vs-module name collision).13 commands folded: stream, agent, speak, llm, clip, dictate, caption, dub,
evaluate, deploy, dev, share, webhooks. transcribe and init stay at the root
alongside doctor_checks/setup_exec because the onboarding wizard
(onboard/sections.py) reuses transcribe_exec/render/batch and init_exec, so
they are shared beyond a single command.
command_registry already discovers packages (pkgutil.iter_modules), so
registration, help ordering, and the snapshot partition are unchanged.
import-linter contract 1 drops the folded execs (now covered by contract 2's
independence rule) and contract 3 points at the new _select/_data paths; all
three contracts stay green. AGENTS.md documents the module-or-package rule.
https://claude.ai/code/session_01XfcMSCxZPLJgg2UQBy8a4v