symfonic.platform.procedure_review¶
procedure_review ¶
An explicit, audited policy seam for learned-procedure review.
The native default is deliberately not a policy: phase 12 writes a draft and
the public review service leaves it there until a person calls
MemoryAdminService.approve_procedure or reject_procedure. A deployment
that wants automation composes this service itself and supplies both a policy
and a durable audit sink. This keeps automatic review out of HTTP handlers
and out of the legacy engine configuration surface.
ProcedureApprovalDecision
dataclass
¶
ProcedureApprovalDecision(disposition: ProcedureDisposition, actor: str, reason: str, action_tool: str | None = None, precondition: Any = None)
One policy result, including the accountable actor and explanation.
ProcedureApprovalPolicy ¶
ProcedureCandidate
dataclass
¶
ProcedureCandidate(scope_path: str, procedure_id: str, source: object | None, source_present: bool, action_tool: str | None, action_tool_present: bool)
The bounded, non-content context available to a review policy.
Policies see stable provenance and the proposed tool binding, never the procedure's free-text body or a graph handle. A policy that needs richer evidence must fetch it through an authorised review workflow rather than receive tenant memory implicitly.
ProcedureReviewService ¶
ProcedureReviewService(admin: MemoryAdminService, policy: ProcedureApprovalPolicy, *, sink: AuditSink | None)
Apply an opt-in policy through the public memory-admin review door.
sink is mandatory because an automated decision that cannot be
attributed must not change a procedure's governing status. The service
records intent before mutation. That intent record is the fail-closed
boundary: if it cannot land, no mutation starts. Completion and failure
records are best-effort observations after that boundary; a store cannot
safely roll back a completed review merely because its later receipt was
unavailable. Backend exception text is never serialised because it may
contain stored content.
Source code in src/symfonic/platform/procedure_review.py
review
async
¶
Audit and apply a policy decision to one draft.
defer is a terminal result for this call, not a hidden retry: the
draft remains queued for a person or an explicitly scheduled policy.