Skip to content

chore(cleanup): delete re-verified dead-code kill-list from 9e5.15 audit - #3315

Merged
Sinity merged 2 commits into
masterfrom
feature/chore/kill-list-9e5-15-execution
Jul 27, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/chore/kill-list-9e5-15-execution

Conversation

@Sinity

@Sinity Sinity commented Jul 27, 2026

Copy link
Copy Markdown
Owner

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.md section 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 rg call-site search across polylogue/, tests/, docs/; check for test/CLI-registration/MCP-registration/generated-doc references; and for one ambiguous case (a Protocol-declared method), a full-repo mypy --strict run 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-item remain; the underlying CoordinationView substrate and MCP surface are untouched, only these CLI aliasing wrappers are gone.
  • polylogue/archive/semantic/models.py: to_evidence_input on all 6 semantic-facts dataclasses (zero call sites anywhere) + 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 callers, plus the resulting unused imports (candidate_record_query_for, search_limit, the matches_* family, sort_generic, SortKey).
  • polylogue/archive/query/expression.py: _merge_tuples, _canonicalize_with_units, _source_where_unit (zero callers) + the unused terminal_query_unit import.
  • 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):

  • The 3 cli/query_verbs.py mark-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 the mark candidates subcommand group into the root judge command. No action needed; this half of the audit's finding is stale in a "already resolved" direction.
  • The polylogue/api/archive.py half of the audit's "get_eager pair" is also already gone — removed by the refactor(architecture): sqlite leak sweep, staleness unify, control-center decomposition #2900 control-center decomposition. Only the storage/repository/archive/sessions.py half still existed and was deleted above.
  • get_eager is now declared as a required method on two @runtime_checkable Protocols (SessionQueryRuntimeStore, SessionOutputStore in polylogue/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-repo mypy --strict run with the concrete sessions.py method 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 real SessionRepository instance 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 if plan_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 the get_eager question).
  • ruff check polylogue → All checks passed!; ruff format --check polylogue → 1082 files already formatted.
  • devtools test against the ~40 test files that import the touched modules: 11 failed, 291 passed. Confirmed via git stash + re-run against origin/master with 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, no out of sync entries (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

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]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 41637b65-21f0-42a7-9db2-65dec7ba6b36

📥 Commits

Reviewing files that changed from the base of the PR and between 0394316 and fb53ced.

📒 Files selected for processing (7)
  • docs/plans/docs-coverage-baseline.yaml
  • polylogue/archive/artifact_taxonomy/support.py
  • polylogue/archive/query/expression.py
  • polylogue/archive/query/plan.py
  • polylogue/archive/semantic/models.py
  • polylogue/cli/commands/agents.py
  • polylogue/storage/repository/archive/sessions.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/chore/kill-list-9e5-15-execution

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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.
@Sinity
Sinity merged commit 95a260b into master Jul 27, 2026
3 checks passed
@Sinity
Sinity deleted the feature/chore/kill-list-9e5-15-execution branch July 27, 2026 10:11
Sinity added a commit that referenced this pull request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant