Commit 034023c
feat(lifespan): auto-migrate Stop-hook checkpoints to recovery collection (Phase E)
Calls mempalace.migrate.migrate_checkpoints_to_recovery() during the
daemon's lifespan startup, after the HNSW quarantine pass and before
the ChromaDB warmup ping. Idempotent — re-runs return 0 once the
canonical palace has reorganized; the only one-time cost is the first
restart after deploy.
Closes Phase E of the checkpoint-collection-split spec
(docs/superpowers/specs/2026-04-25-checkpoint-collection-split.md
on jphein/mempalace). Phases A–D shipped on the mempalace fork on
2026-04-25/26 — the migrate function exists and is wired into
`mempalace repair --mode reorganize` for explicit operator runs.
This commit makes the daemon do it automatically on first startup
post-upgrade, so operators don't have to know about the manual command.
Gated behind PALACE_AUTO_MIGRATE_CHECKPOINTS=1 (default). Set =0
to skip auto-migrate in environments where the one-time cost is
unwanted; the manual `mempalace repair --mode reorganize` path
remains.
Defensive: ImportError if the mempalace fork-side function isn't
present (upstream-shaped installs); other exceptions logged as
non-fatal warnings so the daemon still starts.
After this lands and the canonical 151K-drawer palace migrates,
the predicted Cat 9 A/B convergence (kind=all ≈ kind=content
tokens-per-question) becomes testable — that's the empirical proof
the structural fix worked.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ed3a892 commit 034023c
1 file changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
324 | 353 | | |
325 | 354 | | |
326 | 355 | | |
| |||
0 commit comments