You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
manifest writes recreate a session folder that gc removed #196
A session manifest write that lands after gc removed the session folder brings the folder back, holding only session.json. list --all then shows that stub session until the next gc removes it.
Cause
writeTextFileAtomic in src/storage/manifests.ts runs mkdir(outputDirectory, { recursive: true }) before it writes. So every writeManifest to a removed session folder creates the folder again. Only allocateSession should create a session folder.
Run destroy --force with its second session.json read held, using the skill's hold script: REPLAY_HOLD='destroy:readFile:/session.json:2:3000' NODE_OPTIONS="--import $PWD/.agents/skills/verify-session-lifecycle/scripts/replay-hold.mjs".
Run gc --json during the hold. It removes the folder.
After the hold, destroy's final write recreates the folder with session.json reading destroyed, and list --all shows it.
Main has the same defect on other paths. With the hold on the reconcile read inside the old force path, main recreated a stub with status failed. The lifecycle model's Scope section already counts a write that lands after gc's removal as harm.
Direction
Write session manifests through a writer that fails when the session folder is gone, instead of creating it, and let each caller treat that failure as "the session was removed". Model it in .agents/skills/verify-session-lifecycle as a write that cannot recreate a removed folder.
Activity
fix(host): leave the folder check of recordDestroyed to #196
docs(skills): drop the folder rule and fix the run count
fix(storage): stop writeManifest from recreating a removed session fo…
style(storage): drop comments that the code and tests already state
docs(skills): model that a folder gc removed stays removed
docs(storage): describe writeManifest failing in a removed session fo…
docs(skills): narrow the host-write claim and name the rm race
fix(host): record destroyed on every destroy and model shutdown races (…
fix(storage): stop writeManifest from recreating a removed session fo…