From 6f4810d1286da732f4ef3a650b1cd8bf4f91b570 Mon Sep 17 00:00:00 2001 From: Chris Guidry Date: Mon, 3 Aug 2026 17:59:45 -0400 Subject: [PATCH] Add the world lock and resolver seeding to the Archivist plan Two agents and a player share the world's files, so plan 0012 now names the rule: a play session and an Archivist pass each hold the world lock, note writes are atomic, and renames, merges, and record annotation happen only under the lock. The plan also closes a duplicate-entity gap: the session loads every note's address and aliases into the resolver at startup, so a bare name like [[Vera]] cannot re-establish an entity that already exists on disk. Co-Authored-By: Claude Fable 5 --- plans/0012-the-archivist.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plans/0012-the-archivist.md b/plans/0012-the-archivist.md index 9f14a63..c9856f2 100644 --- a/plans/0012-the-archivist.md +++ b/plans/0012-the-archivist.md @@ -166,6 +166,16 @@ Backfill stays cheap the same way. It is triggered by a new entity or a new alias, and it visits the places a search for those names turns up. It is not a standing re-read of all history. +One writer at a time. A play session and an Archivist pass each hold +the world lock, a lock file at the world root, for as long as they +run. Note writes are atomic regardless, a temp file renamed into +place, so injection can never read a half-written note. But renames, +merges, and record annotation change what other files point at, and +those happen only under the lock. Chris's hand edits stay +uncoordinated; the Archivist's conservative charter is what makes them +safe. This is also why live trailing waits: an Archivist inside a live +session needs finer locks than one world lock. + ## The guard on the record Backfilling means the Archivist touches the record, and that needs a @@ -305,8 +315,11 @@ before the agent that uses it, and the Archivist earns record access last. 1. **The note format.** Seeded stubs, frontmatter, alias-aware - resolution; the `## Mentions` stamp folds into the seed line. *You - can now: open a stub and read the scene that created it.* + resolution; the `## Mentions` stamp folds into the seed line. The + session loads every note's address and aliases into the resolver at + startup, so a bare name cannot re-establish an entity that already + exists on disk. *You can now: open a stub and read the scene that + created it.* 2. **Injection.** 0011 step 3 on the new format: referenced notes reach the next turn's prompt. *You can now: watch the DM keep an entity's facts straight two turns after naming it.* -- 2.51.2