Skip to content

docs: why the CLI is one file, and that its split is a date rather than a rule - #60

Merged
esamoun merged 2 commits into
mainfrom
decision-cli-is-one-file
Sep 8, 2026
Merged

esamoun merged 2 commits into
mainfrom
decision-cli-is-one-file

Conversation

@esamoun

@esamoun esamoun commented Sep 8, 2026

Copy link
Copy Markdown
Owner

src/darkvessel/cli.py is 2042 lines and 21 subcommands. That is the first thing a reader judges about the package, and nothing in the repository said anything about it. This adds one docs/decisions.md entry that measures the file rather than leaving the reader to assume either way, and names what its shape does not justify.

What it records, all of it measured on this branch:

  • 2042 lines against 10,040 in the rest of the package — 17% of the source
  • 54 functions; the longest is main at 178 lines and every line of it is the argparse table
  • the longest handler is _archive_run at 94, then _retrieve 84, _crops 78
  • 40 modules imported across 54 import lines: wide and shallow, the depth elsewhere
  • 7 of the 11 *_request_from builders in the file are imported directly by the tests; docs/training-runbook.md imports an eighth

What it admits rather than glosses over:

  • three functions compute instead of delegating (_span, _exclusion_over, _clustering_over)
  • eleven builders live in cli.py and three live beside the code they feed, and the only thing separating them is the date they were written: everything up to 2026-08-28 went into cli.py, everything from 2026-08-29 did not, and nobody went back. None of the three has a caller inside its own module, so the placement changes nothing that runs.

The decision: the eleven stay. The move is 339 lines across eleven modules plus a changed import path in thirteen test files, and no test can fail on reverting it — which is a fair description of its value. The two conditions that would change it are written down.

Documentation only. No code, no config, no run journal, no figure touched: the diff is 56 added lines in docs/decisions.md and nothing else.

make lint clean, make test 572 passed / 1 skipped — unchanged.

…an a rule

2042 lines and 21 subcommands is the first thing a reader judges about this
package. The entry measures it instead of leaving it to be assumed: 17% of the
source, a 178-line argparse table, no handler over 94 lines, 40 modules imported.

It also records what the file's shape does not justify. Eleven of the fourteen
`*_request_from` builders are in cli.py and three are beside the code they feed,
and the only thing separating them is when they were written — everything up to
2026-08-28 went in cli.py, everything from 2026-08-29 did not, and nobody went
back. None of the three has a caller inside its own module, so the placement
changes nothing that runs. The eleven stay, because no test can fail on
reverting the move, and the condition that would change that is written down.
The repository layout is where a reader decides whether to open cli.py, and it
said nothing about the file being the longest one here. Three lines after the
block, pointing at the entry rather than restating it: the counts live in one
place and cannot drift apart from each other.
@esamoun
esamoun merged commit 2fc0e57 into main Sep 8, 2026
3 of 6 checks passed
@esamoun
esamoun deleted the decision-cli-is-one-file branch September 8, 2026 18:10
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