mpfaffenberger / mpfaffenberger/code_puppy
13 command_line/ files exceed the 600-line hard cap (add_model_menu.py is 1412 lines)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Description
Problem
CONTRIBUTING.md rule 3 states a 600-line hard cap — split into submodules. Issue #397 covers the core runtime layer; the UI layer (code_puppy/command_line/) violates the cap 13 more times:
| File | Lines |
|---|---|
command_line/add_model_menu.py |
1412 |
command_line/model_settings_menu.py |
994 |
command_line/prompt_toolkit_completion.py |
960 |
command_line/uc_menu.py |
908 |
command_line/diff_menu.py |
865 |
command_line/judges_menu.py |
809 |
command_line/config_commands.py |
734 |
command_line/autosave_menu.py |
717 |
command_line/agent_menu.py |
716 |
command_line/mcp/install_menu.py |
705 |
command_line/mcp/custom_server_form.py |
701 |
command_line/core_commands.py |
656 |
command_line/model_picker_completion.py |
609 |
Why it matters
add_model_menu.pyat 1412 lines is 2.35x the cap and mixes provider catalog fetching, TUI rendering, key bindings, and config writing in one module.prompt_toolkit_completion.py(960 lines) contains seven unrelatedCompleterclasses, aProcessor, history sanitization, clipboard paste handling for three platforms, and the main input loop — at least four separable concerns.- The
set_menu*family shows the right pattern already (set_menu.py+_catalog,_render,_schema,_settings,_shims,_values) — these menus just never got the same treatment.
Suggested fix
Split along the same seams used for set_menu_*:
- Menus: separate
*_state.py(selection/pagination state),*_render.py(formatted-text building), and the thinApplicationwiring. prompt_toolkit_completion.py: move the completer classes intocompleters.py(most already have sibling modules —mcp_completion.py,skills_completion.py, etc., so the convention exists), paste/clipboard key bindings intopaste_bindings.py.
Filed by Zen Reviewer C (code-puppy-60635a)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CONTRIBUTING.md rule 3 and the existing set_menu.py split pattern, then inspect the 13 listed modules under code_puppy/command_line/. Separate the menus by state, rendering, and application wiring, and split prompt_toolkit_completion.py into completers and paste bindings where appropriate. Done means the listed files are under the 600-line cap without changing their behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100