DEV Community

Cover image for Every New Agent Session Starts Empty. I Wrote a Wiki Packer for That.

Every New Agent Session Starts Empty. I Wrote a Wiki Packer for That.

Vincent on November 26, 2026

This week's feed treated Karpathy's LLM wiki gist like a finished product. Drop-in repos. "Paste this markdown file into Claude Code." A circulatin...
Collapse
 
dosaygo profile image
dosaygo •

How do you detect when a packed decision has gone stale or conflicts with newer repository instructions?

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Good question — this is where a packed decision quietly becomes a liability. The mechanism I'd use is provenance on every packed item: record the source file paths and the commit it was derived from, plus a hash of the source text. On load, re-hash: if the source changed, the decision is marked stale and surfaces for review instead of being silently trusted. For conflicts, never let last-writer-wins decide — when a newer instruction contradicts a packed decision, surface both with their timestamps and let the human pick, because the conflict itself is information. I run a similar rule in a bot-management app I built (BotRoster): anything high-stakes or stale requires explicit re-approval rather than auto-applying. The pack is a cache of decisions, and caches need invalidation — otherwise you're just trusting an old snapshot of the repo.

Collapse
 
dosaygo profile image
dosaygo •

Thanks for the detail on tracking source file paths, commit hashes, and explicit human conflict resolution rather than letting stale packed decisions auto-apply, I'm building AI Lint as an in-repo pre-flight checklist and doctrine pack where architectural rules live directly in the repository and any conflict requires an explicit documented override with reason, risk, and mitigation: ai-lint.dosaygo.com/go/forum-20261...

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

That override record is the piece most doctrine packs skip — reason, risk and mitigation, all documented, makes the pack auditable later instead of just obeyed now. One check worth running early: pack a rule, change the source file it was derived from, and confirm the pack flags it stale before any decision from it applies. If a stale rule can still auto-apply once, the provenance is decoration. Happy to try the flow against a small repo of mine and tell you where it bites, if a second pair of eyes helps.

Thread Thread
 
dosaygo profile image
dosaygo •

Thanks, Kamal. Changing the source after packing is a good test of whether stale decisions can slip through. We build AI Lint as a checklist, doctrine and rejects catalog for coding agents; I cannot claim it automatically detects stale packed rules. If you try it on a small repo, I would welcome what you find: ai-lint.dosaygo.com/go/forum-20261...

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Thanks for the honest scope statement — saying plainly that AI Lint can't claim to auto-detect stale packed rules is exactly what makes a doctrine pack trustworthy: it tells the user where the automation ends and their judgment begins.

I'll take you up on the trial. I'll run it over a small repo of mine (pdf-slice, a Python CLI with a handful of real rules about extraction behaviour) and report back here what it flags — and, more usefully, what it misses. The sharpest test is the one you named: change a source file after packing and see whether the pack flags the rule stale before any decision applies. If it does, that's the falsifiable check the pack needs; if it doesn't, that's a concrete gap to work on.

One question while I'm at it: does the rejects catalog record why a rule was rejected, or just that it was? The reason is what stops the next agent from re-proposing it.

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

This is the right shape — a pack built for one query, with a floor and an audit list, is very different from stuffing the vault in the prompt. Two things I'd measure before trusting it. First, the "Excluded (not packed)" list leaks titles: a restricted page still tells the model the page exists, and for a passenger manifest or an incident report the title alone is the sensitive part. I'd redact excluded titles from the audit list, or drop them from it entirely — the audit is for you, but it travels in the same session.

Second, the 2.0 floor is a guess until you measure the pack's hit rate: over ~10 sessions, what fraction of packed pages actually get referenced? If half the pack is never read, the floor is too low; if a page you needed keeps missing, the scoring is wrong. Same with staleness — a policy from six months ago packs with the same weight as yesterday's decision, and there's no "last reviewed" decay. I run into the same tiering problem managing a team of AI bots (read-only auto-run, send/pay/delete approved): the question is never just "what goes in", it's "what can the packed content do once it's in".