Repository navigation
Description
Problem
config/constants.py and config/defaults.py declare 94 names (14 constants, 80 defaults) that only one of these packages uses. 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:
ai/agents/36,ai/rag/31,ai/benchmark/17,ai/spend/4,ai/analyze/3,ai/harness/2 andai/spec/1. 21 modules read them. The largest readers areai/agents/capabilities.py(18),ai/benchmark/embedding_runner.py(17),ai/rag/embeddings.py(14) andai/agents/guardrails.py(8). - Three are read by two or more modules of one package:
DEFAULT_RAG_CACHE_DIR(defaults.py:211,rag/drift.pyandrag/indexer.py),DEFAULT_AGENT_MAX_TURNS(:231,agents/agent.pyandagents/pipeline.py) andDEFAULT_QDRANT_DISTANCE(:363,rag/library_store.pyandrag/qdrant.py). - Four test files import them from
config/:test_data_dir_worktrees.py,test_library_vector_tier.py,test_rag_aimd.pyandtest_rag_embeddings.py. ai/harness/constants.pyalready holds that package's ownDEFAULT_*tables, the shape this item extends to the other packages.
The placement rule (#1016) puts each of these names next to the code that reads it. That item's baseline lists them under ai.agents, ai.rag, ai.benchmark, ai.spend, ai.analyze, ai.harness and ai.spec, 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
ai.agents,ai.rag,ai.benchmark,ai.spend,ai.analyze,ai.harnessandai.specintests/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, those seven packages 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 three names here, for exampleDEFAULT_RAG_CACHE_DIRandDEFAULT_QDRANT_DISTANCE. - When does it land? (proposed) After refactor(ai): one agent runtime behind one construction point, with no silent fallback #1005 (one agent runtime), refactor(ai): delete the pass-through package facades and the two stagepipeline protocols nothing implements #1002 (deletes
ai/agents/__init__.py's re-exports andai/agents/pydantic_agent.py) and refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001 (puts embeddings on the model adapters), when those are scheduled first. - 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 #1005 and #1002 when those are scheduled first. It shares no module with #1027, so the two can land in either order.
Related: #1005, #1002, #1001, #945, #776.
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 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.