Skip to content

context_assembly: decomposer + active_retrieval have no call site #201

Description

@cdeust

What

Two modules in mcp_server/core/context_assembly/ have zero importers anywhere in the tree, and a third is reachable only through one of them:

Module Statements Importers
core/context_assembly/decomposer.py 71 0
core/context_assembly/active_retrieval.py ~60 0
core/context_assembly/warning.py 25 1 (decomposer.py only)

Surfaced while resolving #196's four zero-importer modules: condensers.py was resolved by wiring it into stage_assembler (via the new stage_phases.py), which is where the drop-instead-of-condense defect actually lived. decomposer.assemble_prompt — the caller stage_assembler's docstring names ("ready to be fed into decomposer.assemble_prompt") — still has none.

Why it is not resolved in #196

Same defect class as #196's four, but not in that issue's scope, and the resolution needs a judgement #196 does not settle: Cortex is an MCP server, so the LLM client composes prompts. A template-and-placeholder prompt assembler may have no legitimate consumer in-process, in which case the honest outcome is removal-with-proof, not a caller invented to justify the module.

Deliberately NOT covered by tests in the #196 PR: covering an unwired module raises the coverage number while leaving the §9 defect ("if it's built, it must be called") in place.

Reproduction

grep -rn "context_assembly.decomposer\|context_assembly.active_retrieval" --include='*.py' mcp_server/ tests_py/ benchmarks/ | grep -v "context_assembly/"
# → no output

Acceptance criteria

  1. For each of decomposer.py and active_retrieval.py: the intended call site is implemented and covered by contract tests, or the PR proves the behaviour lives elsewhere and removes the module. Never "left as is".
  2. If decomposer.py goes, warning.py goes with it (it has no other importer) — or its remaining consumer is named.
  3. The shared share rule (budget.proportional_share, added in Statement coverage to >=80%: finish the unwired modules, then hold the floor #196) keeps exactly one definition whichever way this lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions