Status: Superseded by ADR 0013 and ADR 0014 (2026-04-22)
Original date: 2026-04-22
Deciders: product owner (user), software-architect
Related: ADR 0002 (no stored credentials), ADR 0008 (OAuth integration mode), docs/architecture/multi-tenant-alpaca.md §3
Parent epic: #183
Supersede note (2026-04-22): This ADR documented the exception to invariant #1 for storing Alpaca OAuth access tokens for every user. Under the MBT reframe (ADR 0013), the vast majority of users (free + most Pro) have no broker token because MBT is Raxx's own paper engine. ADR 0014 re-scopes this exception to the narrow Pro+ live-broker-handoff subset only. The content below is preserved for historical traceability.
ADR 0002 says Raxx must be incapable of replaying a user secret. ADR 0008 committed Raxx to Alpaca OAuth 2.0 for all users. Alpaca's OAuth access token can be replayed for its validity window — so it is a credential in the replay sense. Retaining it between requests crossed invariant #1.
The Alpaca OAuth access token was declared a documented, bounded, audited exception to invariant #1, not a silent violation.
Four guardrails shipped together:
env=paper vs env=live separation).Schema sketch preserved below:
alpaca_connections
id TEXT PK
user_id TEXT FK -> users.id ON DELETE CASCADE
env TEXT NOT NULL -- 'paper' | 'live'
scopes TEXT NOT NULL
access_token_ciphertext BLOB NOT NULL
access_token_iv BLOB NOT NULL
access_token_wrapped_dek BLOB NOT NULL
kms_key_id TEXT NOT NULL
issued_at TIMESTAMP NOT NULL
expires_at TIMESTAMP NOT NULL
last_used_at TIMESTAMP NULL
needs_reauth BOOLEAN NOT NULL DEFAULT 0
revoked_at TIMESTAMP NULL
Under the MBT reframe:
alpaca_live_connections to make the narrower scope visible at the schema layer.The technical pattern was sound; its scope was too broad. ADR 0014 is the active record.
All prior checklist items carry over to ADR 0014 in narrower scope. This ADR itself is closed.
N/A — superseded. Amendments go on ADR 0014.