Skip to content

refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/ #1025

Closed as not planned

Description

@dan-petty

Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

Scope

Delivery

  1. One PR (M), opened once refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 3, docs(agents): a matching table lives beside its one owner, and moves to config/ only when a second package imports it #1016 and refactor(config): the config barrel and the unused config names go, and the package inits stop re-exporting #776's step 1 have merged. It recounts the three blocks at its base, using the baseline file as the exact list. It then moves or deletes each name, repoints the importers and tests, and deletes the three blocks from the baseline. Closes refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/ #1025.

Acceptance criteria (these replace the matching criteria in the body; the others stand)

  • Each name listed under ai.review, ai.review.stages and review in tests/fixtures/config_placement_baseline.json is declared in the one module that reads it. When two or more modules of its package read it, it is declared in that package's constants.py instead (ai/review/constants.py or review/constants.py). Its name, value and comment are unchanged, and it is annotated Final. config/constants.py and config/defaults.py no longer declare it, and all three blocks are gone from the baseline.
  • Every importer imports the name from its new module, including every test file found by a recount at the PR base. At 3dd7fa6 there are 12: tests/ai/review/test_cited_code.py, test_ai_review_pool.py, test_host_sandbox.py, test_k8s_llm_gateway.py, test_review_canary.py, test_review_group_analysis.py, test_review_path.py, test_review_path_classes.py, test_review_pipeline.py, test_review_prompt_consistency.py, test_review_reply_caps.py and test_review_runner.py. Nothing in config/ re-exports a moved name.
  • Apart from the Final annotation added where a name lacked it, git diff --color-moved=zebra shows every declaration line of a moved name as moved.

Current references (verified at 3dd7fa6)

Dependencies and order


Problem

config/constants.py and config/defaults.py declare 68 names (42 constants, 26 defaults) that only modules in ai/review/ 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.

  • 15 review modules read them: verification.py 20, pipeline.py 16, runner.py 8, review_environment.py 6, chunker.py 6, classification.py 5, and adjudication.py, common_hallucinations.py and pool.py 4 each.
  • Nine are read by two or more review modules. For example, CONST_REVIEW_CONVENTIONS_FILE (constants.py:286) is read by defects.py, review_environment.py and runner.py, and CONST_REVIEW_GENERATED_FILES (:582) by chunker.py, pipeline.py and runner.py.
  • Eight test files import them from config/: test_ai_review_pool.py, test_data_dir_worktrees.py, test_review_path.py, test_review_pipeline.py, test_review_prompt_consistency.py, test_review_reply_caps.py, test_review_runner.py and test_structural_positional_oracles.py.
  • The session file names (CONST_REVIEW_FINDINGS_FILENAME, CONST_REVIEW_CANDIDATES_FILENAME) are not in this set. commands/review.py also reads them, so they stay in config/ until refactor(review): review session store that owns layout, fingerprints and verdicts #771 makes them private to the session store.

The placement rule (#1016) puts each of these names next to the code that reads it. That item's baseline lists them under ai.review, 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.review in tests/fixtures/config_placement_baseline.json is declared in the one module that reads it, or in its package's constants.py when two or more modules of the package read it. Its name, value and comment are unchanged, and it is annotated Final. config/constants.py and config/defaults.py no 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 Final annotation added where a name lacked it, the PR only moves code: git diff --color-moved=zebra shows every other declaration line as moved. The diff touches only config/constants.py, config/defaults.py, the baseline, ai/review/ and the tests that import the moved names.
  • uv run devops ci passes.

Key questions

Depends on: #1016, #776 (the config/__init__.py re-exports go first, so a move does not edit them).
Order: after #995 when both are scheduled. It does not conflict with #996 or #1008, which take the moved tables with the code they move.
Related: #995, #996, #1008, #771, #776.

Activity

  1. added
    type/refactor
    scope/review
    scope/config
    priority/p3-low
    on Oct 2, 2026
  2. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Frozen by the evidence-first review redesign (#1137, owner direction of 2026-10-03): patches to the model generator and verifier stop, and tool-layer fixes continue. This item stays in the #1016 family (one PR per package, blocked by #1016 and #776) and is not closed: it moves only the review tables that survive #1150 and #1151. Labelled status/blocked until both land, so no table is moved just before it is deleted.

  3. added
    status/blocked
    on Oct 3, 2026
  4. changed the title [-]refactor(review): the review's single-owner tables move out of config/ into ai/review/[/-] [+]refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/[/+] on Oct 18, 2026
  5. added
    status/ready
    effort/low
    value/low
    and removed
    status/blocked
    on Oct 28, 2026
  6. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    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:

    • "No constant moves in this pull request. A constant moves when its module is next touched."
    • "No gate checks the placement. The project adds no new ratchet." The module core/config_placement.py, the baseline file tests/fixtures/config_placement_baseline.json and 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 in config/ 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.py and 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 changes config/constants.py or config/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.

  7. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/configscope/reviewtype/refactorvalue/low

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions