Repository navigation
Description
Context & Rationale
Nearly every help string and message has one consumer, yet all of them live in two central files that every new command edits. Checked at 9c879ae.
lang/en/help.py: 963 strings in 42 frozen dataclasses, bound at 1,123help=HELP.x.ysites, plus 375 inlinehelp="..."literals that bypass the catalog. Of 657 referenced attributes, 587 (89%) are referenced from exactly one module;HELP.options(42 modules) andHELP.k8s(10) are the shared core.lang/en/messages.py: 392 of 398 referenced attributes are single-module.lang/en/errors.py: 57 of 57.main.py_COMMAND_SPECSis a second hand-maintained registry (39 entries, two with inline literal help).- A new command edits
help.pytwice (class and catalog field),messages.pytwice,errors.py,_COMMAND_SPECSand the hand-picked asserts intests/test_language_catalogs.pybefore any feature file.help.pyis in 30 of the 63 release commits,messages.pyin 23. - One language pack exists (
en), so the localisation seam has one adapter.
Deletion test: delete help.py and 587 strings reappear in exactly one command module each; about 70 (options, shared k8s) reappear across 2 to 42 modules and earn the shared core.
Scope & Deliverables
- Deliverable: each command module owns a frozen
*Help/*Messagesdataclass for its own strings;devops_cli.langkeepsOptionHelp,GeneralMessagesand the persona titles. The localisation intent survives as the frozen-dataclass type plus one AST test ("everyhelp=is an attribute of a*Helpdataclass"), which also catches the 375 literals the current layout misses. - Tests:
test_language_catalogs.py(85 lines of hand-picked attribute asserts) is replaced by the structural test;test_all_commands_help_dryrun.pyalready exercises the real interface and stays. - Key questions (open):
- Is the centralised catalog a deliberate bet on a second language pack? If so, close this as not planned and record why.
- How do the generated docs (docs: hand-written docs name only commands, options and components that exist #921, fix(docs): generated reference docs fail closed and describe the real surface #854) read help after the move?
- Constraint: the same "next to its owner unless shared" rule change refactor(config): the config barrel and the unused config names go, and the package inits stop re-exporting #776 needs.
Strategic Alignment
- Design: none
- Depends on: none
- Related: refactor(config): the config barrel and the unused config names go, and the package inits stop re-exporting #776, docs: hand-written docs name only commands, options and components that exist #921, fix(docs): generated reference docs fail closed and describe the real surface #854
- Source: architecture review of 2026-10-02, config and language cross-cut
Scope added 2026-10-02: checked at 38517a8; the figures hold within a few percent. lang/en/help.py has 41 dataclasses, src has 1,129 help=HELP. sites and 375 help=" literals, and main.py's _COMMAND_SPECS has 38 entries. lang/__init__.py imports en with no locale selection, no setting selects a language, and no document names a localisation plan. The docs generator reads Click command metadata (docs/generator.py:255-260), not the catalog. _COMMAND_SPECS registers command groups lazily, so a group's help must be readable without importing its command module.
Acceptance criteria
- Each command module owns frozen
*Helpand*Messagesdataclasses for the strings only it uses.devops_cli.langkeeps the strings two or more modules use (HELP.options, the sharedk8shelp, general messages, persona titles) and the group help_COMMAND_SPECSneeds. - An AST test fails on a
help=literal in a Typer option, argument or command, and on adevops_cli.langattribute that only one module uses. It replaces the hand-picked asserts intests/test_language_catalogs.py. -
_COMMAND_SPECShas no inline help literal. -
devops docs generateoutput (docs/CLI_REFERENCE.md,docs/commands/*.md) is byte-identical before and after. -
tests/test_all_commands_help_dryrun.pypasses unchanged. -
docs/ROUTINE_TASKS.md:28and:104, which today send every user-facing string tolang/en/, state the placement rule: a string lives with its one consumer, or inlangonce two modules use it. AGENTS.md has no help-placement rule at 38517a8 and gains one only if #docs(agents): a matching table lives beside its one owner, and moves to config/ only when a second package imports it #1016 words its rule to coverlangtoo. - The new and changed tests run offline, with no model, network or cluster.
-
uv run devops cipasses.
Key questions
- Is the centralised catalog a deliberate bet on a second language pack? If so, close this as not planned and record why. (proposed) No evidence of one:
lang/__init__.pyimportsenunconditionally, and no setting or document names another locale. Proceed unless the owner says otherwise. - How do the generated docs (docs: hand-written docs name only commands, options and components that exist #921, fix(docs): generated reference docs fail closed and describe the real surface #854) read help after the move? (proposed) As today: from Click's command metadata, so the move does not change them. The byte-identical check above proves it.
- When does it land? (proposed) After #docs(agents): a matching table lives beside its one owner, and moves to config/ only when a second package imports it #1016, filed from the same review (which refactor(config): the config barrel and the unused config names go, and the package inits stop re-exporting #776's moves wait on), so the two rules read alike. Then in a window with few open PRs, because it touches about 1,500 help sites and every open command PR would have to rebase.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 28, 2026
Closed as not planned. The item conflicts with a more recent project direction. No code was written.
This item is a bulk move of help and message text out of
lang/en/into each command module, held by an AST test that fails when adevops_cli.langattribute has one consumer or when ahelp=is a literal. Its own key question says it must land "in a window with few open PRs, because it touches about 1,500 help sites and every open command PR would have to rebase".The owner decision of 2026-10-22 on #1016 rules out both parts of that mechanism:
On 2026-10-28 the same decision closed #1025 to #1032, the bulk moves of single-owner tables out of
config/, as not planned, for the same reason. #1016 itself names this item as "the same rule applied tolang/".Measured on origin/main d156ce7 (2026-10-28):
help=HELP.sites and 371help="literals undersrc/.lang/en/help.pyhas 43 dataclasses in 1,780 lines, andlang/en/messages.pyhas 2,157 lines.HELP.is read in 60 modules andMESSAGES.in 94.mainsince 2026-10-21 changedlang/en/help.pyorlang/en/messages.py, so a bulk move conflicts with most command work.The current documents still send user-facing strings to
lang/en/(docs/ROUTINE_TASKS.mdrows 28 and 90). If a person wants help text beside its command, the form that agrees with the #1016 decision is a rule change inCONTRIBUTING.mdanddocs/ROUTINE_TASKS.md: a string moves to its command when that command is next touched, with no gate. That is a person's decision, so this item builds no part of it.