symfonic.capabilities.memory.port_inspection¶
port_inspection ¶
A v1 MemoryCapability's writer and lifecycle must be ports the fence can see (CORE-194).
CORE-199 fences a turn by capturing an erase admission before it reads; only
memory_capabilities composes that capture, and every write the turn makes
presents it through the composition's own :class:GuardedMemory. A port the
fence cannot inspect -- a forwarding wrapper, a subclass, an object claiming
another class -- may hold raw graph-only PostgreSQL v1 memory where no type
check sees it, and a hand-built capability over the raw store itself captures
nothing. Either composes a turn whose writes no admission covers, so on a v1
scope each refuses at construction. Positional (v0) scopes, capabilities
without ports, and the factory over an exact shipped store are unchanged.
The admission covers what the composition's own hydrator reads. So a guard is
accepted only beside the hydrator and scope the factory issued it with
(:func:pair_guard): the factory's guard taken out and set beside an adopter
hydrator that reads another scope would write that scope's content after its
forget. dataclasses.replace of the factory's capability keeps the pair.
pair_guard ¶
Record the factory's guard with the hydrator and scope it composes beside; return it.
Source code in src/symfonic/capabilities/memory/port_inspection.py
refuse_uninspectable ¶
Refuse a v1 writer or lifecycle that is not an inspectable shipped port.