symfonic.capabilities.memory.work¶
work ¶
The two surfaces the write coordinator borrows, and what a write reports.
Both are declared here rather than imported, for the same reason and with different consequences:
- :class:
BackgroundWorkPortmirrorssymfonic.kernel.BackgroundRegistry.spawnexactly. The registry lives inkernel-runtimeand the dependency matrix givescapabilityno edge to it, so the capability declares the shape and a composition root passes the registry straight in — structurally, with no adapter.test_the_kernel_background_registry_satisfies_the_portis the proof that the two have not drifted. - :class:
MemoryDiscardPortis an optional capability of a lifecycle adapter: drop a scope's pending writes without committing them. The three declared memory ports cannot express a rollback —flushcommits andforgeterases the committed memories too — so an adapter that can do it says so by implementing this method, and one that cannot is not pretended to.
BackgroundWorkPort ¶
Bases: Protocol
Somewhere to put owned work — structurally, T2.3.4's registry.
spawn ¶
spawn(work: Coroutine[Any, Any, Any], *, owner: str, purpose: str, deadline_seconds: float | None = None) -> Any
Register and start one unit of run-owned work.
MemoryDiscardPort ¶
WriteOutcome
dataclass
¶
What one background write did, once it finished.