Skip to content

fix(parser): retain discovered durable history - #992

Draft
avs-io wants to merge 1 commit into
getagentseal:mainfrom
avs-io:codex/issue-987-durable-history
Draft

fix(parser): retain discovered durable history#992
avs-io wants to merge 1 commit into
getagentseal:mainfrom
avs-io:codex/issue-987-durable-history

Conversation

@avs-io

@avs-io avs-io commented Aug 13, 2026

Copy link
Copy Markdown
Member

Problem

Durable provider cache entries were deleted once their newest call became 90 days old even when the source was still discovered on disk. A fresh cache therefore omitted readable older history from lifetime, session, export, and PR views, then reparsed and discarded the same unchanged files on every writable refresh.

Root cause

The durable age-out used call age alone. It ran after parsing but before serving and did not distinguish a still-discovered source from a true orphan whose source had disappeared.

Change

  • Exempt exact source paths returned by the current discovery pass from durable age-out.
  • Continue pruning true durable orphans whose newest valid call is older than 90 days.
  • Preserve the existing timestamp, read-only, cache-schema, and date-range behavior.
  • Document the corrected durable-cache contract and disclose that previously missing history can return.

User impact

Older durable history that is still readable from its source remains available in lifetime, session, export, and PR-level views. Its persisted fingerprint is reused on subsequent refreshes instead of repeatedly parsing and discarding it. Users with older Copilot data still on disk may see previously missing history and totals return.

Preservation and out of scope

  • True orphans still expire after 90 days.
  • No cache-version, provider-version, daily-cache, compaction, or hydration behavior changed.
  • Full orphan compaction and discovery-failure status propagation remain separate work.

Testing

  • Credible RED on prior behavior: the 91-day source returned zero, was absent from persisted cache, and the parser ran twice across unchanged refreshes.
  • Focused durable lifecycle: 1 passed.
  • Full parser suite: 13 passed.
  • Full root suite: 2,616 passed, 5 skipped.
  • Serial lock suite: 26 passed.
  • Full desktop suite: 468 passed.
  • Root and desktop TypeScript checks passed.
  • CLI and desktop builds passed.
  • Exact-SHA independent spec and standards reviews approved.
  • Real isolated Copilot journal QA: lifetime report, sessions, and export all included a 91-day session across separate CLI processes while the cache file remained unchanged.
  • Rebuilt Electron click-through: Lifetime displayed the May 14 Copilot session with GPT-4.1, one call, and 137 output tokens; Today correctly excluded it.

Fixes #987.

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.

Durable providers delete cached history older than 90 days even when the source files still exist

1 participant