chore: delete the manual rebuild engine and the generic repair product - #4698
chore: delete the manual rebuild engine and the generic repair product#4698Sinity wants to merge 12 commits into
Conversation
…oute Ordinary daemon convergence (the raw-materialization drain) is the only build path. Removes maintenance/rebuild_index.py, sharded_rebuild.py, replay.py, reindex_canary.py, daemon/bulk_rebuild.py, the rebuild-index, rebuild-index-status and reindex-canary CLI verbs, the four daemon HTTP routes that served them, the daemon loop's bulk-rebuild routing, the devtools rebuild-safety scenario, and the writer-less active_rebuild_index_attempts readers; next-action prose points at `polylogued run`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
…wner storage/repair.py's daemon-path closure (raw materialization conveyor, whale pass, backlog census, raw-authority frontier strategies) moves to storage/raw_convergence.py with RepairResult renamed RawConvergenceResult and repair_raw_materialization renamed converge_raw_materialization. The generic framework goes: REPAIR_HANDLERS, run_selected_maintenance, empty-session/superseded-snapshot/session-insight mutators, archive-debt previews and readiness vocabulary, maintenance planner/targets/replay/ failure_routing/envelope/registry/preview/cost_backfill/scope, the doctor --repair/--cleanup/--target/--preview/--vacuum flags, the maintenance plan/run/run-preview/preview/status CLI verbs, the daemon HTTP maintenance plan/run/status/operations routes, MCP maintenance preview/execute/status/list, the failures.jsonl status projection, and the blob-reference-closure mutation half. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
… for the sole route storage/index.py had no production caller; tests reach the FTS lifecycle owner through tests/infra/fts.py. docs/maintenance.md, cost-model, security, daemon, configuration, onboarding, atlas/mcp and the design inventory describe daemon convergence as the only build path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
The inactive-candidate construction operation and its domain check plan existed only for the retired rebuild engine; nothing routed them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
The blob-reference-closure suite proved the deleted mutation half. Its two tests that outlive it move to their owners: the exact-hash predicate proof to test_archive_verification.py (reached through verify_archive) and the append-merge position proof to test_attachment_relink.py (reached through write_parsed_session_to_archive). The archive-debt readiness component and MaintenanceCategory died with the repair product, so their readiness case goes; ArchiveDebtStatus is no longer a legacy readiness source. raw_authority.repair_materialization is converge_materialization. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
Post-merge follow-through for the repair/rebuild deletion. The archive-debt operation reads the blob limit from storage/raw_convergence. The layering baseline ratchets 297 -> 288: entries for deleted files go, and the two status readers' baselined edge follows the storage/repair rename. The stuck- source runbook points at commands that exist. Tests pin the retirement: the maintenance MCP tool neither declares nor dispatches preview/execute/status/ list, and the nine retired `ops maintenance` verbs fail discovery. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
mypy resolves a missing attribute but silently ignores a missing module, so imports of the deleted modules survived every static gate. The Codex 804 proof keeps acquisition, append planning, raw authority and both converge_materialization passes, and reads the archive convergence built; its crash/resume/promotion half went with the engine that drove it. The maintenance CLI registration suite keeps operation-recovery, blob-conservation and blob-integrity. The single-basis cost backfill and the maintenance failure-sample status projection have no route left. operation_ids guarded a path lookup that no longer exists, and rebuild_receipt has no caller. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
get_type_hints resolves the handler's operation Literal; inspect.signature returns the unevaluated string under postponed annotations, so the retired- operation assertion read an empty set. The status payload counts no maintenance failures, so its key leaves the expected projection and the count test goes with the projection it measured. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
…delete # Conflicts: # polylogue/maintenance/rebuild_index.py # tests/unit/maintenance/test_archive_verification.py
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 253f99cd0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """Rebuild derived indexes and inspect or adjudicate operation recovery. | ||
|
|
||
| Destructive/full-effect operations require ``confirm=True``: | ||
| ``execute`` with ``dry_run=false``, ``rebuild_index``, and | ||
| ``rebuild_insights`` and ``recovery_adjudicate`` all fail closed without it (interim | ||
| mitigation, polylogue-jn40). | ||
| Full-effect operations require ``confirm=True``: ``rebuild_index``, | ||
| ``rebuild_insights`` and ``recovery_adjudicate`` fail closed without it. |
There was a problem hiding this comment.
Restore session_ids for retained maintenance operations
The retained update_index operation is now unusable: the MCP tool signature no longer accepts session_ids, and the forwarding payload never supplies it, while _dispatch_maintenance unconditionally rejects update_index when that key is absent. The same omission prevents callers from requesting a scoped rebuild_insights; a confirmed call silently rebuilds the entire archive instead. Keep session_ids in the tool contract and forward it for these two operations.
AGENTS.md reference: AGENTS.md:L124-L126
Useful? React with 👍 / 👎.
| if (root / ".index-active-pointer").exists(): | ||
| raise click.ClickException( | ||
| "reset --index is unsafe for a managed active generation; " | ||
| "use `polylogue ops maintenance rebuild-index` to create and promote a replacement" | ||
| "the pointer-managed index.db must not be deleted in place" |
There was a problem hiding this comment.
Provide a rebuild path for pointer-managed indexes
For an existing archive with .index-active-pointer whose active index has an older schema, both reset --index and reset --database now stop at this refusal, while daemon schema preflight classifies the mismatch as critical and parks the convergence loops. Since this commit also removes the only command that could create and promote a replacement generation, such archives have no supported way to reach the current schema without manually dismantling their topology. Preserve a daemon-owned replacement path before retiring the manual engine.
AGENTS.md reference: AGENTS.md:L76-L77
Useful? React with 👍 / 👎.
| schema_quarantine_malformed: bool, | ||
| ) -> None: | ||
| """Health check with optional maintenance and cleanup previews.""" | ||
| """Read-only health check over the archive, runtime, daemon, blobs, and schemas.""" |
There was a problem hiding this comment.
Retarget scenarios that still invoke retired doctor flags
The doctor command is read-only now, but polylogue/scenarios/operational_surfaces.py still defines the session-insight preview, session-insight repair, and maintenance memory-budget lanes with --repair, --cleanup, --preview, and --target. Building and executing any of those authored surfaces at this head produces a Click unknown-option error instead of exercising a production route, so the live and memory verification lanes no longer test what their names claim; remove or retarget those families together with this option removal.
AGENTS.md reference: AGENTS.md:L175-L179
Useful? React with 👍 / 👎.
| "polylogue.mcp.server_cutover.maintenance:inspect.signature", | ||
| (("operation", "list"),), | ||
| (("operation", "recovery_status"),), |
There was a problem hiding this comment.
Regenerate the agent maintenance contract for retained verbs
Although this declaration now advertises recovery_status, the separately published agent contract in polylogue/agent_integration/spec.py and its generated manual/data still teach maintenance(operation="preview", targets=["index"], dry_run=True) and list all of the removed planner arguments. An agent following that contract reaches the new handler with an unsupported operation and unexpected keywords rather than receiving the promised preview receipt. Update the agent-integration source contract and regenerate its tracked artifacts alongside the dispatcher change.
AGENTS.md reference: AGENTS.md:L124-L126
Useful? React with 👍 / 👎.
Summary
Daemon convergence becomes the only build path. Deletes the manual rebuild
engine, the generic repair product, the storage/index FTS shim and the
declared-not-routed candidate-build operation, with the commands, HTTP routes,
MCP operations, docs and tests they owned.
215 files, +1081 / -39861.
Problem
Two mechanisms built the same derived state. The manual rebuild engine
(
rebuild_index,sharded_rebuild,replay,reindex_canary, the daemonbulk_rebuildroute) and the generic repair framework (REPAIR_HANDLERS,run_selected_maintenance, the maintenance planner/registry/preview/envelope)duplicated the raw-materialization drain the
DaemonConvergeralready runs,each with its own resume, promotion and failure vocabulary.
storage/index.pyhad no production caller, and the candidate-build operation contract existed
only for the retired engine.
Solution
Deleted per file (largest first):
polylogue/maintenance/rebuild_index.pytests/unit/maintenance/test_rebuild_index_provenance_gate.pypolylogue/maintenance/replay.pypolylogue/storage/repair.pyraw_convergence.py)tests/unit/storage/test_incremental_rebuild_equivalence.pytests/unit/maintenance/test_resume.pytests/unit/storage/test_repair.pytests/unit/cli/test_archive_maintenance_cli.pytests/infra/rebuild_cost_model.pypolylogue/maintenance/planner.pytests/unit/maintenance/test_inactive_candidate_durable_barrier.pytests/unit/maintenance/test_blob_reference_closure.pypolylogue/daemon/bulk_rebuild.pydevtools/rebuild_safety_scenario.pytests/unit/daemon/test_bulk_rebuild.pypolylogue/maintenance/sharded_rebuild.pypolylogue/cli/commands/maintenance/_rebuild_index.pytests/infra/reindex_campaign.pypolylogue/operations/candidate_build.pypolylogue/maintenance/blob_reference_closure.pystorage/repair.py's daemon-path closure moves tostorage/raw_convergence.py;RepairResultisRawConvergenceResultandrepair_raw_materializationisconverge_materialization.Surviving proofs move to the owners that still reach them: the exact-hash
closure predicate to
test_archive_verification.pythroughverify_archive,and the append-merge attachment position to
test_attachment_relink.pythrough
write_parsed_session_to_archive. Retirement is pinned by tests: themaintenance MCP tool neither declares nor dispatches
preview/execute/status/list, and the nine retiredops maintenanceverbs fail discovery.The layering baseline ratchets 297 -> 288.
Verification
13 gates ok, exit 0.
gate layering:"count":0,"stale_baseline_count":0.devtools render all --checkreports nothing out of sync.288 passed, 1 failed (pueue 1661).
An earlier 14-file batch reported 649 passed / 15 failed. Eleven were
OSError: [Errno 24] Too many open filesin one xdist worker and passed onre-run. Three were real and are fixed here: the retired-operation assertion
read
inspect.signature, which returns the unevaluated string under postponedannotations, and two
test_status.pycases measured the maintenance failurecount this branch removes.
Residuals
test_archive_verification.py::test_empty_covered_table_without_stats_is_not_missing_coveragefails, inherited from master and not touched here: the test is byte-identical
to
origin/masterat f80542b, and running master's own copy against master'ssource fails identically. Its premise is wrong — ANALYZE writes one
sqlite_stat1row per index (3 foraction_pairs) on an empty indexed table.Bead filed.
Verification is focused, not a corpus run; it proves the selected scope only.
Beads: polylogue-hwwtq, polylogue-6kur.2, polylogue-6kur.3, polylogue-5vps8