MemoryRevisionService class
Manages optimistic concurrency for the top-level MEMORY.md summary file.
The revision hash mixes in a generation counter stored in generationFile. Deletion of memory records bumps the generation, so a consolidation that started before the delete fails its conditional write instead of writing a summary that resurrects the deleted record.
Constructors
- MemoryRevisionService(KbStorage storage)
Properties
Methods
-
bump(
) → Future< void> - Increments the revision generation, invalidating any expected hash that was read before this call.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
) → Future< MemoryRevision> -
Reads the current
MEMORY.mdfile and returns its revision hash along with the content. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String content, String expectedHash) → Future< bool> -
Writes
contenttoMEMORY.mdonly if the current revision matchesexpectedHash. Returns true when the write succeeded, false if the file was modified concurrently (or a record was deleted in the meantime).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- generationFile → const String