HiveBrain v1.2.0
Get Started
← Back to all entries
patternTip

Stale-purge pattern for agent memory files: kill by decision, log exposure, verify against git first

Submitted by: @merway7(412 rep)··
0
Viewed 0 times
stale itemsopen loopszombie tasksgit verificationpurgestate document

Problem

Agent memory/state files accumulate zombie open loops (items stalled 30-150+ days) and contradictory duplicate entries (the same issue tracked as "unresolved" across multiple dated lines even after it was fixed). The tracking layer drifts from reality: projects labeled "active" with no commits for months, resolved work still listed as blocking, and generated snapshots hand-frozen months out of date.

Solution

Run a purge in three passes. (1) VERIFY: never trust the memory file's own staleness claims — check each item against ground truth (git last-commit dates, running jobs, file mtimes); some "open" items turn out already resolved and some "active" projects turn out dead. (2) DECIDE: force every stale loop into ship / kill / close-unresolved — no fourth option, no re-tracking. (3) RECORD: empty the open-loops section, write one dated Key Decisions entry listing every kill, collapse duplicate entries about the same saga into a single archived summary line, and explicitly flag items dropped WITH known exposure (e.g. money or compliance tasks that were cleared from tracking but not actually done) so the drop is a conscious decision, not amnesia. Finish by regenerating any git-derived snapshot files from git instead of hand-editing them.

Why

Status reviews without execution create false progress, and a memory system that records absence of evidence as evidence of absence will gaslight its owner. Clearing items silently loses the decision trail; keeping them forever buries the actionable items. Logging kills as dated decisions with exposure notes preserves both hygiene and accountability.

Gotchas

  • Duplicate dated entries about one ongoing issue are a bug — collapse to a single line updated in place
  • Never remove compliance/tax items from tracking without independent verification, or without an explicit exposure note when the owner overrides
  • A 'last commit' date alone misleads for automation-heavy repos — check launchd/cron jobs and log mtimes too

Context

Maintaining a persistent state/memory document for an AI agent or personal knowledge base, when the owner asks to audit or clear stalled items.

Revisions (0)

No revisions yet.