Repository navigation
Description
Handed back by the #392 lane as adjacent, found by its own second review round. Filed rather than fixed there because the fix lives outside that issue's lane.
Symptom
For a store that was migrated from legacy (in-project) to external mode with git backup enabled, /remember:doctor's SessionEnd liveness check can never reach FAIL again. It WARNs forever: it never crashes and never false-FAILs, but it also never catches a genuine SessionEnd failure, which is the whole reason the check exists (#370).
Location
hooks.d/after_save/50-git-backup.sh deletes $REMEMBER_DIR/.gitignore as a one-time cleanup of the legacy bootstrap artifact.
scripts/doctor.sh (as of PR #400, closing #392) uses that same file's mtime as its install baseline: a transcript only counts as evidence about SessionEnd once it is at least as recent as the marker. The marker is written exactly once by scripts/bootstrap-dirs.sh, gated on it not already existing.
Mechanism
The two behaviours are individually correct and were written years apart. 50-git-backup.sh is removing an artifact that has no purpose in an external store; doctor.sh picked the one file in REMEMBER_DIR that ordinary hook activity does not rewrite. Composed, the cleanup removes the diagnostic's only baseline, and the diagnostic degrades to its safe fallback -- WARN -- with nothing announcing that it has stopped being able to answer.
Note what this is not: it does not regress anything #400 fixed, and the fallback direction is the safe one. The cost is a check that silently stops being a check on one class of store.
The #392 lane's first baseline attempt (REMEMBER_DIR's own mtime) was rejected because save-session.sh bumps it on every save. That constraint still applies to any replacement.
What would settle it
Three routes, all design decisions, none of them free:
- Stop
50-git-backup.shdeleting the marker, or have it recreate a substitute. Cheapest, but it keeps an artifact whose stated purpose is gone. - Give
doctor.sha baseline that survives that cleanup -- something written once, never rewritten by saves, and not a legacy artifact anybody is trying to remove. A dedicated install marker under the store is the obvious candidate and nothing currently writes one. - Accept it and say so -- document that migrated-and-backed-up stores get a WARN-only SessionEnd check, the same limitation fix: doctor.sh's SessionEnd check no longer FAILs on prior Claude Code history it never had a chance to service (#392) #400 already documents for a different path.
Route 2 is the only one that leaves the check able to answer on every store, and it is also the most code. Whichever is chosen, the test needs a fixture that performs the migration-with-backup path and then asserts the check can still reach FAIL -- paired with the existing must-fire case, or the guard is untested in the direction that matters.
Activity
fix: doctor.sh SessionEnd ordering, install baseline, and --json (#404,
fix: normalize PROJECT_DIR too in git-restore.sh's legacy guard (#519 …
fix: 2 more Windows backslash-blindness sites survive #517's sweep (#519