Skip to content

[MCP code mode] Persist API run and effect receipts with atomic replay protection #144

Backlog

Description

@sidneyswift

Part of the Recoup MCP autonomy epic. Technical specification and amendments.

Proposed owner — Database and API

Depends on — recoupable/api#1304 · recoupable/api#1305

Deliverable

Add Supabase storage for API run/effect keys, authenticated account attribution, leases, atomic admission, scoped status, reconciliation and independent readback. Preserve domain-owned transaction and idempotency behavior. An action authorized by the Recoup API can complete with zero approval rows. Link an optional parked intent to a decision only when the owning API requires interaction.

Acceptance and evidence

  • Persist the initiating Recoup account, organization and applicable artist/workspace/resource, operation/revision, effect digest, business key, run/effect keys and only the existing authorization reference needed for audit. Store no bearer, refresh or service credentials. Identical key/content recovers the receipt; different content conflicts. Atomically claim an effect and any outbox work.
  • Enforce account and tenant isolation on run, status and readback. Clients cannot write protected dispatch, approval or receipt states. Test allow with zero approval rows, deny with zero effects and required interaction with zero dispatch until an API-owned decision arrives. A linked decision must match the authorized account, scope and immutable intent.
  • Exercise concurrent workers, expiry and revoked resource access, restarts before dispatch, uncertain completion, reconciliation and rollback. Support an API-owned accepted job continuing after chat closes; trading a client token for a separate worker credential is unnecessary. Resolve ambiguity through the domain idempotency key or independent outcome read. Preserve old receipts through rollback.
  • Run disposable PostgreSQL concurrency, isolation and migration replay tests for overlapping records in two organizations. Bound storage, retention, purge and retry windows and avoid recording private result payloads that are unnecessary for audit. API #1314 supplies optional signed-in confirmation.

Activity

  1. changed the title [-][MCP code mode] Persist actor-bound approval decisions and effect receipts atomically[/-] [+][MCP code mode] Persist company-agent effect claims and receipts with atomic replay protection[/+] on Nov 27, 2026
  2. changed the title [-][MCP code mode] Persist company-agent effect claims and receipts with atomic replay protection[/-] [+][MCP code mode] Persist API run and effect receipts with atomic replay protection[/+] on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions