Repository navigation
Description
The problem
memory_init decides whether a repository has already been set up by looking for a row in the memory store: a context row in the repository's scope carrying the tag init-stamp, whose content names the current short HEAD (src/init/run.ts:91-100).
That row is plugin-internal state, but it lives in the same store that memory_remember writes and memory_import reads, and nothing reserves the tag. So any session can create one:
git rev-parse --short HEADin the checkout.memory_rememberwithtype: context, the repo's scope,tags: ["init-stamp"]and content naming that HEAD.- Every later
memory_initin that repository answers "Already initialized" and writes no command rows — for that commit, and the session never has to say why.
Reported by @abogartz in #292 item 7 against 0.15.21 and confirmed against main at d0929a6 by reading the code: there is no reserved-tag list anywhere in src/, and the stamp lookup checks only type, scope, tag and HEAD.
Impact is small — init writes build commands, and a session that can forge this can mostly do its damage anyway — but the failure is silent and it is the store talking to itself through a door a model can knock on.
Fix direction
Move the stamp out of the memory store rather than filtering for forgeries. A stamp file under the memory root (keyed by repo, holding HEAD and the init timestamp) is read and written only by src/init/, so no tool can reach it and memory_recall, export and the viewer stop showing a row that was never meant to be read by anyone.
A one-time migration keeps installed repos working: if the file is absent and a store row matches today's lookup, honour it once and write the file, then leave the old row alone. Without that, every existing checkout re-inits on the next release.
The cheap alternative is a reserved-tag list in the schema that refuses init-stamp on memory_remember. That protects the door and not the room: memory_import takes rows straight from a file, and it leaves the same design smell — internal state masquerading as a memory.
Acceptance
- RED: with a hand-written
contextrow taggedinit-stampnaming the current HEAD,memory_initreports "Already initialized" and writes no rows. Fails on main for exactly that reason. - GREEN: the same forged row is ignored — init runs and writes its commands — while a real init followed by a second init is still a no-op.
- A checkout initialized by the previous release does not re-run init after upgrading: its store row is honoured once and migrated.
bun run gategreen,bun run test:e2esincesrc/changed.
Activity
fix(init): make the legacy init-stamp row inert, and make its migrati…
Merge pull request #376 from abogartz/374-init-stamp-file
chore(release): 0.23.1 [skip ci]
abogartz-opencode-self-improvement commentedon Nov 12, 2026
🎉 This issue has been resolved in version 0.23.1 🎉
The release is available on:
Your semantic-release bot 📦🚀