-
Notifications
You must be signed in to change notification settings - Fork 0
Add approval binding and replay-protection tests #6
Copy link
Copy link
Open
Labels
area:evidenceAudit ledger, attestations, and proof artifactsAudit ledger, attestations, and proof artifactsarea:policyPolicy schema, decisions, and enforcement behaviorPolicy schema, decisions, and enforcement behaviorrelease:v0.3.0Work targeted for v0.3.0 production alphaWork targeted for v0.3.0 production alpha
Milestone
Metadata
Metadata
Assignees
Labels
area:evidenceAudit ledger, attestations, and proof artifactsAudit ledger, attestations, and proof artifactsarea:policyPolicy schema, decisions, and enforcement behaviorPolicy schema, decisions, and enforcement behaviorrelease:v0.3.0Work targeted for v0.3.0 production alphaWork targeted for v0.3.0 production alpha
Goal
Finish residual approval binding and replay-protection hardening after the v0.2.1 fixes.
Status update
This issue is partially resolved on
mainas ofv0.2.1. Already landed; do not redo:_state_lockover propose, approve, execute, and reset.vmga_approval_already_used.proposal_hashplusbinding_hashover proposal fields and expiry; mismatches deny.proposal_id:proposal_hash:approver_id:time_windowwith a five-minute window and one grace window.This issue now tracks only the residual gaps below.
Residual 1: Multi-process and cross-restart approval consumption
The adapter state lock is in-process only. Multiple broker processes against one state database, or a crash between execution and used-state persistence, can still create ambiguous approval-consumption semantics.
Recommended governance default: prefer at-most-once for kinetic actions. A lost draft/send attempt fails safer than a replayed mailbox side effect, but this choice must be explicit and documented.
Acceptance:
SQLiteStateStore, for example an atomicUPDATE ... WHERE used=0operation; treatrowcount == 0as already consumed.SQLiteStateStoreinstances racing execution against one DB file; exactly one path may consume the approval.Residual 2: Binding-mutation and fuzz coverage
Current tests cover hash mismatch and binding mismatch paths, but field-level persisted approval tampering should be broader.
Acceptance:
ApprovalRecordfields after approval, such as recipients, content, action, approver_id, parameters, and expires_at, denies withvmga_approval_binding_mismatchor the correct stricter error.binding_hashin strict mode denies withvmga_approval_binding_missing.approver_allowlistdenies withvmga_approver_unauthorized.Out of scope
docs/deployment_runbook.mdas ofv0.2.1.