Skip to content

manage_adr data loss on INCREMENTAL re-index (regression of #516) #1190

Open

Description

@eazene

Summary

manage_adr content is silently destroyed by an incremental re-index. This is a regression of the fix for #516: that fix preserves the ADR across the full re-index path, but the incremental path (taken whenever a prior DB + file hashes exist, i.e. after any edit) branches before the ADR snapshot and rebuilds the DB with no ADR capture.

Because the background watcher triggers an incremental re-index within ~5–60s of any git change, an ADR cannot survive normal development.

Reproduction (v0.9.0, darwin-arm64, official release binary)

$ index_repository (full)          -> creates DB + file hashes
$ manage_adr(mode=update, content="# ADR ... must survive")
$ manage_adr(get)                  -> {"content":"# ADR ... must survive"}   ✅
$ <append one line to any tracked file>
$ index_repository                 -> takes the INCREMENTAL route
$ manage_adr(get)                  -> {"content":"","status":"no_adr"}        ❌ lost

Self-contained script: https://github.com/ (available on request) — it inits a temp git repo, indexes, stores an ADR, appends one line, re-indexes, and shows no_adr.

Likely cause

The full-reindex path snapshots the ADR before deleting the DB (the #516 fix, pipeline.c:1137-1152). The incremental route branches earlier (pipeline.c:1125); dump_and_persist in pipeline_incremental.c unlinks and rebuilds the DB with no equivalent ADR snapshot/restore (grep -i adr pipeline_incremental.c returns nothing).

Suggested fix

Mirror the #516 snapshot/restore into the incremental dump_and_persist path (or hoist the ADR snapshot above the full/incremental branch so both routes are covered).

Impact

Silent, unrecoverable data loss of user-authored architecture notes during ordinary editing. Suggest either fixing the persistence or, until fixed, documenting that manage_adr is not durable.

Activity

  1. added
    bugSomething isn't working
    stability/performanceServer crashes, OOM, hangs, high CPU/memory
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 22, 2026
  2. added this to the 0.9.1-rc milestone on Jul 22, 2026
  3. DeusData commented on Jul 22, 2026

    @DeusData
    Owner

    Thanks for the deterministic incremental data-loss reproduction. This is a high-priority 0.9.1-rc durability bug under #391. PR #992 appears intended to address this exact incremental ADR path, but we will verify your RED sequence against that exact head before treating it as fixed or closing this issue.

  4. DeusData commented on Sep 26, 2026

    @DeusData
    Owner

    Thank you, @eazene, for the deterministic sequence! This is fixed since v0.10.0 (87a0e3f). The incremental path now captures and restores the ADR, guarded by pipeline_incremental_successful_publication_preserves_adr, and on current main an ADR survives an edit plus a re-index. Could you confirm on v0.11.0?

  5. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Sep 26, 2026
  6. github-actions commented on Sep 27, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

  7. DeusData commented on Oct 19, 2026

    @DeusData
    Owner

    Thank you for the incremental ADR reproduction. Following the fix reported above, the outstanding check is whether your ADR survives an edit and incremental re-index on v0.11.0 or newer. There is no need to resend the original reproduction.

  8. github-actions commented on Nov 10, 2026

    @github-actions

    This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.

  9. added
    staleNo activity after an info request; will be closed soon
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then closebugSomething isn't workingpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memorystaleNo activity after an info request; will be closed soonux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions