symfonic.memory.layers.procedural.dedup_audit¶
dedup_audit ¶
Destructive-audit port for bulk procedural deduplication (CORE-178).
The memory capability cannot reach the platform audit seam, so it declares
what it needs: an actor and a port that durably records intent before any
mutation. A missing actor or port refuses without graph I/O. The refusal is
an :class:AtomicDeduplicationUnavailable so every surface keeps its 503.
intent must raise when the record did not land. completed and
failed describe what already happened; their failure is logged and never
replaces the operation's own outcome.
DedupAuditContext
dataclass
¶
Who asked: an authenticated user or a configured service principal.
DedupAuditPort ¶
Bases: Protocol
Records one bulk pass; intent raises unless durably recorded.
DedupAuditUnavailable ¶
Bases: AtomicDeduplicationUnavailable
No actor or no working audit port; bulk dedup may not start.
require_dedup_audit ¶
require_dedup_audit(audit: DedupAuditPort | None, context: DedupAuditContext | None) -> tuple[DedupAuditPort, DedupAuditContext]
Refuse, without I/O, a pass that could not be attributed or recorded.
Source code in src/symfonic/memory/layers/procedural/dedup_audit.py
run_audited_dedup
async
¶
run_audited_dedup(audit: DedupAuditPort | None, context: DedupAuditContext | None, scope: TenantScope, operation: Callable[[], Awaitable[_T]]) -> _T
Await intent, run operation, then record its terminal outcome.
The scope key is derived from the exact scope being mutated, so a caller cannot attribute the pass to a different owner than the one it touches.