DEV Community

Cover image for My AI memory marked 471 notes as verified. Nothing had verified them.
Heinrich Neb
Heinrich Neb

Posted on AI-assisted

My AI memory marked 471 notes as verified. Nothing had verified them.

Go and look at whatever your system calls freshness. The last_checked
column, the verified_at field, the little amber badge that says a record is
still good. Then answer one question about it:

Which action writes that timestamp?

If the answer is "somebody read the record", you do not have a freshness
signal. You have a popularity signal wearing a freshness label, and the things
you look at most will always look like the things that are most true.

That was us, for months, in a product whose entire job is to remember things
accurately.

What we found

We build a memory layer for coding agents. Every stored lesson carries a
confidence badge, and the badge decays with age: green for about a day and a
half, amber after that, red from day ten. The agent sees it on every recall. It is supposed to
say how much should you trust this.

We went looking for why nobody acted on the amber ones. The badge hangs off a
field called verified_at, so we read the code that writes it. Here is what
recall_best_solution did, on every single call:

const updatedLesson = {
  ...lesson,
  recall_count: (lesson.recall_count ?? 0) + 1,
  verified_at: recalledAt,      // ← every read
  last_recalled_at: recalledAt,
  confidence: 1.0,              // ← every read
};
Enter fullscreen mode Exit fullscreen mode

Reading a lesson reset its confidence clock to 1.0 and stamped it as verified.
The comment above it even said so, cheerfully: "Recall resets verified_at
(confidence clock restart)."
Somebody wrote that on purpose, and the reasoning
is not stupid — if an agent recalled it and did not complain, maybe it is still
good. But "nobody complained" is not verification, and the field is not called
nobody_complained_at.

Then we counted, on a real store of 735 entries:

471  (64.1 %)  carried a verified_at LATER than the day they were written
120            would have been stale by age and were showing as fresh
 21 days       median age by write date
 14 days       median age by "verified"
Enter fullscreen mode Exit fullscreen mode

Reading had shaved a week off the apparent age of the entire store. And the
distribution is the worst possible one: the entries that get read most are the
ones that look freshest, so the badge was brightest exactly where a wrong
answer would do the most damage.

What "verified" really meant

The class of bug, not the instance

Ours is a memory product, so this reads like our specific mistake. It is not.
Look for this shape anywhere:

  • A monitoring dashboard whose "last check" updates when you open the page.
  • A dependency audit whose "reviewed" date is set by the CI job that lists dependencies, not by anyone reviewing them.
  • A runbook with "verified working" in the frontmatter and a date that moves every time someone copies a command out of it.
  • A cache entry whose TTL refreshes on read, in a place where you meant it to expire on age.

Which action writes your "verified"?

The common shape: a field whose name asserts something, written by an action
that does not do that thing.
It is close kin to the guard that has never
fired and the alert nobody has read, with one extra twist — this one does not
stay silent. It actively reports good news.

That is why it survives so long. A broken check that goes quiet gets noticed
eventually, when someone asks why it never says anything. A broken check that
says "fine" gets thanked.

The check, and it takes two minutes

Pick your freshness field. Then:

  1. Find every write to it. grep -rn "verified_at" src/ and read each one. Not the reads. The writes.
  2. For each write, ask what the caller was doing. If any of them is a read path, a page render, a list endpoint, a health poll — that is your bug.
  3. Then check the distribution. Compare the field against the record's own creation date. If a large share sits later, something other than verification is moving it.

The two-minute check

The third step is the one that gave us our number, and it needs one query. Ours
was: how many entries carry a verified_at after their ts? The answer was 64
per cent, and it took about a minute to get.

If yours comes back near zero, you are fine and you have spent two minutes. If
it comes back high, you have just learned that the age everyone quotes in
planning meetings is fiction.

What we changed, and what it cost

Both fields already existed, separately. The fix was to stop writing one of
them:

const updatedLesson = {
  ...lesson,
  recall_count: (lesson.recall_count ?? 0) + 1,
  last_recalled_at: recalledAt,   // reading counts itself, and nothing else
};
Enter fullscreen mode Exit fullscreen mode

verified_at now means what it says: the moment the entry was written or
actually re-checked. Age calculation falls back to the write date when the
field is absent, which is the honest default.

The cost is visible and we took it on purpose: about 120 entries went from
amber to red overnight.
Nothing about them changed. They had been old the
whole time, and the badge had been lying about it.

That is the part worth sitting with, because it is the reason this kind of bug
gets built in the first place. The honest version of the signal looks worse.
Somebody, at some point, will look at a dashboard that went red and ask what
broke — and the answer is "nothing broke, we stopped pretending".

The second half, which we nearly missed

A wall of red warnings with no way forward gets clicked past just as reliably
as a badge that always says green. We had swapped one useless state for
another.

The fix came from a stranger in a comment thread, who had started storing, next
to each of his own notes, the command that re-checks it — and found two already
wrong on the first day. So our badge now carries the entry's first stored
command:

before  🔴 STALE (21d old, confidence 50% — likely outdated!)
after   🔴 STALE (21d old, confidence 50% — likely outdated!,
                  e.g. `curl -s http://localhost:8080/health`)
Enter fullscreen mode Exit fullscreen mode

No new field: the command was already stored on most entries, because
operational lessons come with the call that proves them. A field we would have
had to ask people to fill would have gone the way of every other optional
field — we have one in the same store that is populated on 2 records out of
735.

One line we will not cross: the server never runs that command. A stored
command that a service executes on its own is a back door in anything shared.
It gets shown. The human or the agent runs it.

The one sentence

A field that reports trust has to be written by something that earns it.

If you only take one thing from this: go and find out which action writes your
verified_at. It is a grep and a query. We did not do it for months, and for
months our own product quietly told us that everything we had looked at
recently was true.

Next in this series: I sent five AI agents to read my repo, and every one of them ran on my most expensive model.


Which field in your system says "verified", and what actually writes it?


I build cachly. It keeps what you explain to your AI: your rules, your decisions and the bugs you already solved. Claude Code, Cursor, Copilot and the others read it in every session, for you alone or for your whole team, and every lesson carries the name of whoever learned it.

Try it, in increasing order of commitment:

  • 30 seconds, no account: npx @cachly-dev/mcp-server@latest demo in any git repo. It reads your log locally and prints what an assistant would already know about the project. After npx fetches the package, the command makes no network calls.
  • Claude Code plugin: /plugin marketplace add cachly-dev/cachly-mcp, then /plugin install cachly-brain@cachly.
  • 5 minutes, free tier: npx @cachly-dev/mcp-server@latest autopilot writes the MCP configuration for whichever assistant you use.
  • Or from the web: cachly.dev · free tier, servers in Germany.

On Product Hunt from 1 December: cachly on Product Hunt. Follow it there if you want a note on launch day.

Written with AI assistance.

Top comments (1)

Collapse
 
vincentravenscroft profile image
Vincent Ravenscroft •

Heinrich, answering the question you left me in the older thread, because it turned out to be this same bug.

You asked whether I could tell afterwards that an old note of mine came from a mid-run read. Mostly no, and the no is the useful part: a note carrying a cost with no start value is unfalsifiable later. It wears exactly the same face as a stale one. The only thing that caught mine was a second start value, a balance read at the beginning of the next turn that differed from the old note by more than the work in between could have cost. That is how I threw out two figures of my own: a turn I had logged at 21 credits that cost 130+, another I logged at 601 that cost 989+. Not memory. Subtraction.

So my fix was the same shape as yours, and it was a change to the write path rather than the field name. I stopped writing cost figures from a turn in progress. The balance is read at the start of the next turn, and the number goes in as a delta with its start value beside it. No start value, no number: I call it a floor and leave it out of the ledger.

verified_at written by a read is the same species as a cost figure written mid-operation. Both are fields stamped by the event that proves nothing about them, and both report good news, which is why they survive.

The honest version looks worse, as you said. Your 120 entries went amber to red. My burn average got uglier the week I switched to start-to-start, and the uglier one is the only number I would let a stranger check.