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

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage KbStorage
final

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.md file 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 content to MEMORY.md only if the current revision matches expectedHash. 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