Skip to content

fix: registry self-heal — serve unregisters vanished repo paths - #363

Merged
flupkede merged 4 commits into
developfrom
fix/reconcile-prune-stale-registry
Oct 28, 2026
Merged

flupkede merged 4 commits into
developfrom
fix/reconcile-prune-stale-registry

Conversation

@flupkede

Copy link
Copy Markdown
Owner

Why

A deleted repo/worktree used to linger forever in status kind=projects as a total_chunks 0 / not indexed ghost: reconcile_all_paths deliberately kept unrelocatable entries and only logged 'run codesearch index prune'. Worktree deletion fires no git hook and rm -rf bypasses every observer, so nothing could clean the registry event-side.

What

  • reconcile_all_paths completes with prune semantics: prune_stale() (relocate-first via git-remote identity) unregisters what cannot be relocated, evicts in-memory state (same shape as reload_if_changed), persists via persist_config.
  • Reconciliation now also runs on every background status-refresh pass (after the status pass — the statuses measure the config as-was; the ordering the empty-fleet test pins), not only at boot: a long-lived serve never reboots.
  • Pinned by reconcile_all_paths_unregisters_vanished_repos (config removal + live-repo survival + in-memory eviction + token cancelled; fails without the fix).
  • Docs: README prune section, CHANGELOG [1.7.3], AGENTS.develop.md highlight.

codesearch index prune stays as the manual trigger.

…ls the registry

A worktree deleted while the hub keeps running ghosted status kind=projects
forever: boot warmup prunes once, reconcile_all_paths only relocated and
logged 'run index prune'. Unrelocatable missing paths now unregister
(prune_stale), evict in-memory state (reload_if_changed eviction shape) and
persist; compute_status_snapshot runs the reconcile first, so the 2s
background pass is the periodic heal. Test pins the removal: fails against
the old keep-and-log behavior (verified by stash-run).

Review-fixes:
- [Important] the pinning test never executed the eviction branch -> test now seeds a RepoState::Write entry (real SharedStores + CancellationToken) for the vanished alias and asserts the map entry is gone and the token is cancelled
…ranch bookkeeping

README prune section: serve unregisters unrelocatable paths itself (startup + status refresh); index prune stays as manual trigger. CHANGELOG [1.7.3] Fixed entry + AGENTS.develop.md highlight.
reconcile's aliases() can trigger a config reload (override-less state + existing repos.json loads the real registry); the statuses must measure the config as-was, the order the read endpoints implicitly rely on — the empty-fleet test pinned exactly that ordering. Heal still runs every pass; a healed alias leaves the list one 2s pass later, harmless.
@flupkede
flupkede merged commit dd86918 into develop Oct 28, 2026
6 checks passed
@flupkede
flupkede deleted the fix/reconcile-prune-stale-registry branch October 28, 2026 16:34
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