Repository navigation
chore(cleanup): delete re-verified dead-code kill-list from 9e5.15 audit - #3315
Conversation
Problem: the 2026-07-09 audit (polylogue-9e5.15) intersected vulture, coverage, and CLI/MCP affordance-usage telemetry to produce a ~30-symbol dead-code kill-list, manually call-site-verified at the time. polylogue-k7m7 tracks executing that list, but ~2.5 weeks and many PRs had landed since, so every symbol needed independent re-verification against the current tree rather than blind deletion. What changed: re-verified each symbol with fresh `rg` call-site searches, test/doc/generated-surface greps, and (for one ambiguous case) a full `mypy --strict` run with the symbol removed. Deleted: - `polylogue/cli/commands/agents.py`: self_command, current_command, conflicts_command, overlap_command, handoff_command (5 untested, uncalled CLI subcommand wrappers; `agents status`/`agents work-item` remain, and the underlying `CoordinationView` substrate/MCP surface is untouched — only the CLI aliasing wrappers are gone). - `polylogue/archive/semantic/models.py`: to_evidence_input on all 6 semantic-facts dataclasses (zero call sites; also dropped the now- unused `JSONDocument`/`json_document` import). - `polylogue/archive/query/plan.py`: 8 one-line `SessionQueryPlan` wrapper methods (_matches_referenced_path, _matches_action_terms, _matches_tool_terms, _matches_action_sequence, _matches_action_text_terms, _sort_generic, _candidate_record_query_for, _search_limit) that only forwarded to free functions already called directly by their real call sites (also dropped now-unused imports: candidate_record_query_for, search_limit, matches_*, sort_generic, SortKey). - `polylogue/archive/query/expression.py`: _merge_tuples, _canonicalize_with_units, _source_where_unit (zero callers; dropped the now-unused terminal_query_unit import). - `polylogue/archive/artifact_taxonomy/support.py`: path_only_sidecars (a one-line dict-returning wrapper with zero callers; path_only_sidecar_reason, which reads the same dict directly, stays). - `polylogue/storage/repository/archive/sessions.py`: get_eager. Skipped (found to have changed since the audit, not deleted): - The 3 `cli/query_verbs.py` mark-candidate commands (reject/defer/supersede_mark_candidate_command) no longer exist at all — already deleted by PR #3138 (2026-07-19), which consolidated the `mark candidates` subcommand group into the root `judge` command. No action needed. - `polylogue/api/archive.py`'s `get_eager` half of the audit's "get_eager pair" is likewise already gone (removed by the #2900 control-center decomposition). Only the `storage/repository/archive/sessions.py` half still existed. - `get_eager` is now declared as a required method on two `@runtime_checkable` Protocols (`SessionQueryRuntimeStore`, `SessionOutputStore` in `polylogue/core/protocols.py`), added by PR #2906 (2026-07-15, after the audit) when those protocols' methods were inlined from a deleted shared base. This looked like exactly the "grew a new reference since the audit" case the bead warned about, so it was verified empirically: a full-repo `mypy --strict` run with the concrete method removed reports zero errors, and grepping for `.get_eager(` call sites and getattr/ dynamic-dispatch patterns found none. The protocol declarations are left untouched (out of scope for this sweep) but now describe a method their only real implementer doesn't provide — worth revisiting if `plan_execution.py`/`query_actions.py` (themselves apparently production-unreferenced, test-only-exercised query scaffolding) are ever wired into a live call path. Verification: - `python -m mypy --strict polylogue` -> Success: no issues found in 1082 source files (run after every deletion step, including a throwaway pre-deletion probe for get_eager). - `ruff check polylogue` -> All checks passed!; `ruff format --check polylogue` -> 1082 files already formatted. - `devtools test` against the ~40 test files importing the touched modules (cli/commands/agents.py, archive/semantic/models.py, archive/query/plan.py, archive/query/expression.py, archive/artifact_taxonomy/support.py, storage/repository/archive/sessions.py): 11 failed, 291 passed, identical failing test names/assertions with and without this diff (confirmed by stashing the diff and re-running the same file set against origin/master) -> all 11 are pre-existing, unrelated to this change. - `devtools render all --check` -> exit 0, no "out of sync" entries. Ref polylogue-k7m7 Co-Authored-By: Claude <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…I aliases The agents self/current/conflicts/overlap/handoff CLI subcommands were deleted in this same PR (dead-code kill-list, polylogue-k7m7); their docs-coverage-baseline.yaml gap entries are now stale references to nonexistent surfaces. The baseline's own header explicitly asks for entries to be removed once no longer applicable, so leaving them would be new debt introduced by this cleanup itself.
Summary
Executes polylogue-k7m7: independently re-verify and delete the ~30-symbol dead-code kill-list produced by polylogue-9e5.15's 2026-07-09 vulture+coverage+affordance-usage audit. Every symbol was re-checked against the current tree (not blindly trusted from a ~2.5-week-old audit) before deletion.
Problem
polylogue-9e5.15 intersected three signals (vulture static analysis, coverage.py 0%-function data, CLI/MCP affordance-usage telemetry) and manually call-site-verified a ~30-symbol kill-list, documented in
.agent/handoffs/polylogue-deep-research-2026-07-09/2026-07-09-codebase-structure-audit.mdsection 2. That audit was explicitly split into an audit half (closed) and an execution half (this PR, polylogue-k7m7) because a lot can land between finding dead code and deleting it.Solution
For every symbol on the list: fresh
rgcall-site search acrosspolylogue/,tests/,docs/; check for test/CLI-registration/MCP-registration/generated-doc references; and for one ambiguous case (a Protocol-declared method), a full-repomypy --strictrun with the symbol removed to empirically confirm no structural-typing consumer exists.Deleted (still genuinely dead):
polylogue/cli/commands/agents.py:self_command,current_command,conflicts_command,overlap_command,handoff_command— 5 untested, uncalled CLI subcommand wrappers.agents status/agents work-itemremain; the underlyingCoordinationViewsubstrate and MCP surface are untouched, only these CLI aliasing wrappers are gone.polylogue/archive/semantic/models.py:to_evidence_inputon all 6 semantic-facts dataclasses (zero call sites anywhere) + the now-unusedJSONDocument/json_documentimport.polylogue/archive/query/plan.py: 8 one-lineSessionQueryPlanwrapper methods (_matches_referenced_path,_matches_action_terms,_matches_tool_terms,_matches_action_sequence,_matches_action_text_terms,_sort_generic,_candidate_record_query_for,_search_limit) that only forwarded to free functions already called directly by their real callers, plus the resulting unused imports (candidate_record_query_for,search_limit, thematches_*family,sort_generic,SortKey).polylogue/archive/query/expression.py:_merge_tuples,_canonicalize_with_units,_source_where_unit(zero callers) + the unusedterminal_query_unitimport.polylogue/archive/artifact_taxonomy/support.py:path_only_sidecars(one-line dict-returning wrapper, zero callers;path_only_sidecar_reason, which reads the same dict directly, stays).polylogue/storage/repository/archive/sessions.py:get_eager.Skipped — found to have changed since the 2026-07-09 audit (not deleted):
cli/query_verbs.pymark-candidate commands (reject/defer/supersede_mark_candidate_command) no longer exist at all — already deleted by PR feat(assertions): consolidate candidate judgment into root judge command #3138 (2026-07-19), which consolidated themark candidatessubcommand group into the rootjudgecommand. No action needed; this half of the audit's finding is stale in a "already resolved" direction.polylogue/api/archive.pyhalf of the audit's "get_eagerpair" is also already gone — removed by the refactor(architecture): sqlite leak sweep, staleness unify, control-center decomposition #2900 control-center decomposition. Only thestorage/repository/archive/sessions.pyhalf still existed and was deleted above.get_eageris now declared as a required method on two@runtime_checkableProtocols (SessionQueryRuntimeStore,SessionOutputStoreinpolylogue/core/protocols.py), added by PR chore(protocols): prune zero-consumer protocols, fix dangling cursor mapping #2906 (2026-07-15, after the audit) when those protocols' methods were inlined from a deleted shared base. This looked exactly like the "grew a new reference since the audit" case the bead warned about, so I verified it empirically rather than assuming either way: a full-repomypy --strictrun with the concretesessions.pymethod removed reports zero errors, and grepping for.get_eager(call sites and getattr/dynamic-dispatch patterns found none — the two Protocol declarations themselves are never structurally checked against a realSessionRepositoryinstance anywhere in production code today. I deleted the concrete method (documented above) but left the two Protocol declarations untouched (out of this sweep's scope). This leaves the Protocols describing a method their only real implementer no longer provides — worth revisiting ifplan_execution.py/query_actions.py(themselves apparently production-unreferenced, test-only-exercised query scaffolding using these exact Protocols) are ever wired into a live call path.Verification
python -m mypy --strict polylogue→Success: no issues found in 1082 source files(run after every deletion step, including a throwaway pre-deletion probe specifically for theget_eagerquestion).ruff check polylogue→All checks passed!;ruff format --check polylogue→1082 files already formatted.devtools testagainst the ~40 test files that import the touched modules: 11 failed, 291 passed. Confirmed viagit stash+ re-run againstorigin/masterwith the identical test-file set that all 11 failures are pre-existing and unrelated (same test names, same assertion messages, same line numbers, with or without this diff).devtools render all --check→ exit 0, noout of syncentries (grepped per the repo's own gotcha about the tail line lying).devtools verify --quick(pre-push hook) → all 16 steps green (ruff format/check, mypy, render all, topology, layering, closure-matrix, schema roundtrip, manifests, ci-workflows, doc-commands, docs-coverage, test-infra-currency, test-clock-hygiene, pytest-timeout-overrides, degrade-loudly).Ref polylogue-k7m7