Skip to content

50-git-backup.sh deletes $REMEMBER_DIR/.gitignore, which permanently disables doctor.sh's SessionEnd FAIL path for that store #401

Closed

Description

@fdaviddpt

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:

  1. Stop 50-git-backup.sh deleting the marker, or have it recreate a substitute. Cheapest, but it keeps an artifact whose stated purpose is gone.
  2. Give doctor.sh a 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.
  3. 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

  1. added
    priority:low
    cohort-2
    on Aug 28, 2026
  2. self-assigned this
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cohort-2priority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions