symfonic.capabilities.memory.journal¶
journal ¶
Defer a consolidation cycle's graph writes until its atomic commit.
The context-bound journal reads from an overlay, then replays mutations under commit authority. Unbound calls pass through to the durable backend.
CycleJournal ¶
One cycle's deferred mutations, and the scope they are read against.
Keyed by durable backend, because a deployment may compose more than one and a cycle that mixed their operations into one ordered list would replay them against the wrong store.
Source code in src/symfonic/capabilities/memory/journal.py
apply
async
¶
Write every recorded mutation to its store, in order. Returns the count.
The caller is responsible for having checked authority, and for doing
it close enough to this call that nothing can intervene -- see
:func:symfonic.capabilities.memory.commit.commit_cycle, which does
both inside one database transaction where the store offers one.
Source code in src/symfonic/capabilities/memory/journal.py
discard ¶
Throw the batch away. Returns how many mutations never happened.
Source code in src/symfonic/capabilities/memory/journal.py
read
async
¶
Answer a read from the overlay, seeding it from durable first.
Source code in src/symfonic/capabilities/memory/journal.py
seal ¶
Freeze queued writes before receipt validation or any await.
stage_guarded ¶
Queue a guarded native operation against the durable graph domain.
Source code in src/symfonic/capabilities/memory/journal.py
stores ¶
The durable backends this cycle touched, for the commit to lock.
write
async
¶
Apply a mutation to the overlay and record it for the commit.
Applied to the overlay first so its return value is the one the durable store would have produced -- the persisted node, the upserted edge with its incremented weight -- and so the next phase reads the result rather than the input.
Source code in src/symfonic/capabilities/memory/journal.py
JournalledGraph ¶
Bases: JournalCreateOnly
The graph backend a deployment composes once, for everything.
Wraps rather than subclasses: the backends are protocol implementations
with surfaces this module has no business restating, and anything outside
:data:GRAPH_MUTATIONS and :data:GRAPH_READS is forwarded exactly as it
was.
Composed at the root rather than around the phases, so that everything a
cycle writes through goes into the same journal -- including the layers.
ProceduralLayer.store_skill writes through a GraphMemoryStore, and
a journal wrapped around only the phase factory's graph= argument would
have left the one mutation an adopter is most likely to notice, the
promoted draft skill, durable on its own.
Source code in src/symfonic/capabilities/memory/journal.py
current_journal ¶
journalled
async
¶
Defer this task's graph mutations into journal for the duration.