Skip to content

chore: delete the manual rebuild engine and the generic repair product - #4698

Merged
Sinity merged 19 commits into
masterfrom
lane/repair-engine-delete
Sep 6, 2026
Merged

Sinity merged 19 commits into
masterfrom
lane/repair-engine-delete

Conversation

@Sinity

@Sinity Sinity commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Delete the manual rebuild engine and the generic repair product. Raw
convergence keeps one owner, the storage/index FTS shim and the
declared-not-routed candidate-build operation contract go with them, and the
maintenance docs are rewritten for the sole surviving route.

Problem

Two retired build paths stayed in the tree behind the production daemon route:
a manual rebuild engine with its own daemon bulk-rebuild entry point, and a
generic "repair" product whose CLI verbs (preview, plan, run-preview,
run, blob-reference-closure) duplicated convergence semantics the daemon
already owns. Derived read models converge from durable evidence; a standing
repair concept is a second truth.

Solution

  • Remove the rebuild engine, the daemon bulk-rebuild route, the generic repair
    CLI surface, the FTS shim, and the candidate-build operation contract.
  • Rename the surviving entry point to converge_materialization and retarget
    every proof and doc reference at it.
  • Keep blob-disposition and its documentation: the command survives, and an
    earlier revision of this branch dropped its only doc section.
  • tests/unit/daemon/test_daemon_cli.py patches the global
    polylogue.config.load_polylogue_config seam. convergence_stages.py binds
    that name at module import, so a module first imported inside the patch
    window keeps a partial SimpleNamespace permanently — monkeypatch only
    restores polylogue.config. Deleting the bulk-rebuild tests changed which
    module imports first, so three daemon-startup tests began failing on
    sinex_mode. The stand-in now resolves a real PolylogueConfig through
    cli_overrides, so it answers every key. No production change: the stage
    builder and both of its call sites are byte-identical to master.

Verification

devtools verify --quick on the final merged tree, re-run by the pre-push
hook on the pushed commit c57680148 — 14/14 gates ok (format, lint, mypy,
generated-surfaces, layering, patterns, doc-commands, schema-manifest,
oracle-integrity, testmon-selection, consumer-reachability,
timestamp-doctrine, durable-enum-checks, schema-privacy).

devtools gate layering → "violations":[],"count":0,"baselined_count":288, "stale_baseline_count":0. devtools render all --check reports no
out of sync surface.

No focused pytest run executed against this head. Two attempts were
queued on the host's single pytest slot while the pytest pueue group was
paused under backpressure; the first (task 1719) ended as Killed without
running, the second was abandoned under quota pressure. The last focused run
on an earlier base gave 407 passed / 11 failed: four from the
converge_materialization rename and three from the config seam, all fixed
here; the remaining six were master's and landed on master as #4703.

Residuals

  • No pytest evidence at this head, as above.
  • Six other test files hold partial SimpleNamespace fakes at the same
    polylogue.config.load_polylogue_config seam and carry the same leak
    hazard. Out of scope here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid

Sinity and others added 12 commits September 5, 2026 03:58
…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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid
…delete

# Conflicts:
#	polylogue/maintenance/rebuild_index.py
#	tests/unit/maintenance/test_archive_verification.py
@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 22a426ff-f146-4284-b569-128c5295a1f4


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.

@Sinity
Sinity enabled auto-merge (squash) September 5, 2026 18:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-06T00:18:28.445057Z c576801 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread polylogue/mcp/server_cutover.py Resolved
Comment on lines 112 to +115
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread polylogue/cli/commands/check.py Resolved
Comment thread polylogue/mcp/declarations/registry.py Resolved
Sinity and others added 7 commits September 5, 2026 22:40
…delete

# Conflicts:
#	docs/maintenance.md
#	polylogue/daemon/convergence_stages.py
#	polylogue/maintenance/blob_reference_closure.py
#	polylogue/storage/raw_convergence.py
#	tests/unit/maintenance/test_archive_verification.py
#	tests/unit/maintenance/test_rebuild_index_candidate_promotion.py
#	tests/unit/storage/test_attachment_relink.py
@Sinity
Sinity merged commit cfc4c73 into master Sep 6, 2026
3 checks passed
@Sinity
Sinity deleted the lane/repair-engine-delete branch September 6, 2026 00:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c576801489

ℹ️ 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".

Comment thread polylogue/daemon/http.py Resolved
Comment thread devtools/verification_scenario.py Resolved
This was referenced Oct 1, 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