Repository navigation
Description
Problem
config/constants.py and config/defaults.py declare 131 names (71 constants, 60 defaults) that only command modules use. Counted at 38517a8 (the release/v0.2.25 tip) by AST, with the method described in #1016: from-imports and attribute reads count, and re-exports do not. The counts are approximate (an independent count differs by up to about ten per item, mostly in how function-local imports and names that only build another config/ name are attributed); the baseline is the exact list.
- By package:
commands/105 andcommands/k8s/26. 38 command modules read them. The largest readers arecommands/k8s/networking.py(17),commands/devcontainer.py(12),commands/pr.py(12),commands/install_tools.py(8),commands/telemetry.py(7),commands/ai_gateway.py(7),commands/release.py(6) andcommands/k8s/stack_lifecycle.py(6). - Eight are read by two or more command modules. For example,
CONST_VSCODE_CLI(constants.py:26) is read byrepos.pyandworkspace.py, andCONST_DOCS_DIR_NAME(:70) bydocs.pyandrelease.py. These go to a newcommands/constants.py, so one command module never imports another. - Six test files import them from
config/:test_ci.py,test_devcontainer.py,test_gh_project_workflows.py,test_k8s.py,test_repos.pyandtest_tf.py.
The placement rule (#1016) puts each of these names next to the code that reads it. That item's baseline lists them under commands and commands.k8s, and its invariant fails once a listed name is moved and its entry is left behind, so this PR deletes those blocks.
Acceptance criteria
- Each name listed under
commandsandcommands.k8sintests/fixtures/config_placement_baseline.jsonis declared in the one module that reads it, or in its package'sconstants.pywhen two or more modules of the package read it. Its name, value and comment are unchanged, and it is annotatedFinal.config/constants.pyandconfig/defaults.pyno longer declare it, and its block is gone from the baseline. - Every importer imports the name from its new module, including the test files named above. Nothing in
config/re-exports it. - A name that only code deleted by an earlier item read is deleted, not moved.
- The two invariant tests from docs(agents): a matching table lives beside its one owner, and moves to config/ only when a second package imports it #1016 pass.
- Apart from the
Finalannotation added where a name lacked it, the PR only moves code:git diff --color-moved=zebrashows every other declaration line as moved. The diff touches onlyconfig/constants.py,config/defaults.py, the baseline,commands/and the tests that import the moved names. -
uv run devops cipasses.
Key questions
- Does a name go into the module that reads it, or into the package's
constants.py? (proposed) Into the module, when one module reads it. Into the package'sconstants.pywhen two or more do, as the rule says. That applies to eight names here, for exampleCONST_VSCODE_CLIandCONST_DOCS_DIR_NAME. - When does it land? (proposed) The items that changed
commands/release.pyandcommands/pr.py(fix(release): one fail-closed release path: cut branch from the remote release tip,uv.lockbump, draft flag, required label and milestone #982, feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743 and feat(github): current release admission, cap, descoping and stall rules (devops roadmap reprioritize) #740) are closed, and feat(release): release-please makes every release from main #1952 deletedcommands/release.py. It lands after refactor(github): pr readiness is one verdict module that the pr commands, the monitor and mcp consume #998 and refactor(github): board fields are written only through the roadmap store, and projects.py keeps provisioning #999 if those are scheduled first, because they movepr.py's andgh.py's rules into other packages and their tables go with them. refactor(cli): command help and messages live with their command, and shared option help stays in lang #1007 also sweeps every command module, so the two should land back to back, in a window with few open command PRs. - Can the move add an import cycle? (proposed) No. A moved table imports nothing new, and a package's
constants.pyimports nothing from its package.test_no_circular_imports_in_decoupled_subsystems(tests/test_architectural_invariants.py:308) is the check.
Depends on: #1016, #776.
Order: after #998 and #999 when those are scheduled first. Back to back with #1007.
Related: #1007, #997, #998, #999, #982, #743, #776.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 3, 2026
Lines cited at dcafadf.
At 132ecc5,
config/constants.py:2505is:2539and:2512-2518is:2546-2552.Leave
CONST_LOCAL_HOSTNAMES(config/constants.py:2505) andCONST_LOCAL_DOMAIN_SUFFIXES(:2512-2518) out of this move, even if the baseline lists either undercommands.k8sby then. #897 deletes the first: loopback is answered byipaddress, andlocalhostbydns.nameequality. #887 deletes the second: local names are classified with the Public Suffix List throughtldextract. Today both are also read byai/spend/pricing.py, so #1016's rule keeps them inconfig/anyway. No other table those items delete belongs tocommandsorcommands.k8s.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 single-owner tables out of
config/. Its acceptance criteria use the placement baseline and the invariant tests that #1016 planned.The owner decision of 2026-10-22 on #1016 replaced that plan:
core/config_placement.py, the baseline filetests/fixtures/config_placement_baseline.jsonand the two invariants are not built.#2492 (merged 2026-10-28) put the rule in
CONTRIBUTING.md: "When you change the owner of a table inconfig/that only one package reads, move the table to its owner in the same pull request."On origin/main (2026-10-28) the baseline file,
core/config_placement.pyand the placement tests do not exist, so the criteria of this item that use them cannot be met. A bulk move also conflicts with each open pull request that changesconfig/constants.pyorconfig/defaults.py. #1026, the sibling item, is closed with the same evidence.A table in
config/that only one package reads now moves to its owner in the pull request that next changes that owner.