Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Plaid Bank Feeds & Cash Position (Bank Reconciliation Phase 2)
Status: in-progress Author: Claude (with Brad Barbin) Date: 2026-07-02 Research notes:
.ai/research/plaid-bank-feeds.md(Plaid mechanics verified against plaid.com/docs 2026-07-02) Parent spec:.ai/specs/2026-07-02-bank-reconciliation.md(Phase 2 of its phasing table)
TLDR
Phase 1 gives Carbon bank reconciliation with manually uploaded statements; Phase 2 removes the manual step and adds daily cash visibility. A Plaid integration (following the Xero integration architecture exactly: packages/ee registry entry, companyIntegration row, webhook route, Inngest jobs) lets a controller connect their banks through Plaid Link, map each Plaid account to a Carbon bankAccount, and from then on statement lines flow in automatically: a webhook-driven bank-feed-sync job runs the /transactions/sync cursor loop (restart-on-mutation semantics, cursor committed only after a complete loop), inverts Plaid's outflow-positive sign, swaps pending lines for posted ones via pending_transaction_id, flags feed-removed-but-matched lines for review, snapshots balances into bankAccountBalance, and finishes by running the Phase 1 auto-matcher. Item health is managed end-to-end: ES256-JWT-verified webhooks, ITEM_LOGIN_REQUIRED/PENDING_EXPIRATION → a Requires Reauth banner → Link update mode (same access token, no re-exchange), plus a daily scheduled catch-up sync as webhook-loss insurance. Access tokens are stored Vault-backed per the parent spec's resolved decision — with an explicit environment probe and an app-layer AES-GCM fallback if Vault turns out to be absent from the self-hosted stack (it is currently unverified there). On top of the feed, a Cash Position page becomes the Banking landing: per account, the latest bank balance vs GL balance with the drift decomposed into unmatched statement lines, outstanding GL items, and an unexplained residual — the "your books are wrong" signal, daily instead of at month-end. Cross-account transfer detection proposes matches for opposite-signed equal-amount lines between own accounts and books the transfer JE on accept.
Problem Statement
With Phase 1 alone, a controller must log into each bank portal, download OFX/CSV files, and upload them — weekly at best, so unrecorded fees, duplicate ACHs, and failed deposits hide for days or weeks, and the reconcile workspace is only as fresh as the last upload. Concretely: a $12,400 customer wire lands Monday; nobody uploads a statement until Friday; the part shipment waiting on "payment received" sits five days. Meanwhile "how much cash do we have right now, and do the books agree?" still requires opening three bank portals and a trial balance side by side. Transfers between own accounts (operating → payroll) appear as two unmatched lines in two workspaces with no linkage, and each must be hand-coded as a JE.
NetSuite ships bank feeds through aggregators (Salt Edge named for Europe; US partner unnamed) on top of the same two-stage flow Carbon built in Phase 1; Xero/QBO treat feeds as the default and file upload as the fallback. Plaid is the natural aggregator for Carbon's mid-market US customer base, and the parent spec already resolved the decisions (Plaid SDK server-side, script-tag Link, Vault-backed tokens, 90-day default backfill).
Proposed Solution
Integration registration (Xero pattern, verbatim)
packages/ee/src/plaid/config.tsx: registry entry (idplaid, category Banking, logo, description); hidden unlessPLAID_CLIENT_ID+PLAID_SECRETenv vars are set. Added to theintegrationsarray inpackages/ee/src/index.ts.packages/ee/src/plaid/hooks.server.tsregistered inpackages/ee/src/hooks.server.ts:onInstall(no event-system subscriptions needed — the feed is inbound-only),onUninstall(remove webhooks is a no-op — Plaid webhook URL is per-Item; mark Items disconnected, clear connection status on mapped bank accounts, delete stored tokens),onHealthcheck(per Item:/accounts/get; anyITEM_LOGIN_REQUIRED→ unhealthy).packages/ee/src/plaid/client.ts: thin wrapper over theplaidNode SDK (new production dependency in@carbon/ee, resolved in the parent spec), constructed fromPLAID_CLIENT_ID/PLAID_SECRET/PLAID_ENV(sandbox|production).- If the
integrationregistry table requires a seeded row (verify how Xero's row exists), a one-line idempotent migration seedsplaid.
Connect flow
- Start (settings → integrations → Plaid, or "Connect bank" on the bank accounts page): action route
api+/integrations.plaid.link-token.tscalls/link/token/createwithproducts: ["transactions"],webhook: <app URL>/api/webhook/plaid,transactions.days_requestedfrom the user's backfill choice (90 default / 180 / 365 / 730 — immutable per Item after link, so it is chosen here),user.client_user_id = userId. - Link (client): Plaid Link loaded via script tag (no npm client dep); on success posts
public_token+ institution metadata toapi+/integrations.plaid.exchange.ts. - Exchange (server):
/item/public_token/exchange→access_token+item_id. Token goes to secret storage (below);companyIntegration('plaid', companyId).metadata.items[]gains{ itemId, tokenRef, institutionId, institutionName, daysRequested, cursor: null, status: "Connected", connectedBy, connectedAt }. The row is upsertedactive: trueon first connect. - Map accounts: the exchange response lists the Item's accounts (
/accounts/get); a mapping step shows each Plaid account (name, mask, type, currency) with three choices per account: create a newbankAccount(prefilled name/mask/type/currency — GL account picked by the user), link to an existing unmappedbankAccount(currency must match), or skip (not synced). Mapped accounts getplaidItemId/plaidAccountId/source = 'Plaid'/connectionStatus = 'Connected'. - Prime: fire
bank-feed-syncfor the Item immediately —SYNC_UPDATES_AVAILABLEonly starts firing after the first/transactions/synccall on an Item (verified), so priming is mandatory, and it also delivers the initial backfill without waiting for a webhook.
Token storage (Vault, with a probed fallback)
Parent-spec decision: Supabase Vault. Unverified in this stack (no vault/pgsodium anywhere in migrations or config.toml) — so:
- Implementation Task 1 probes
SELECT 1 FROM vault.secrets LIMIT 0on the local stack and the Docker/cloud deploy targets. - If present:
tokenRef = { kind: "vault", secretId }viavault.create_secret(access_token); reads happen server-side only (service role) throughvault.decrypted_secrets. - If absent anywhere we deploy: fallback is app-layer AES-256-GCM with a required
PLAID_TOKEN_ENCRYPTION_KEYenv secret (32 bytes, base64);tokenRef = { kind: "aes", ciphertext, iv, tag }stored in the metadata JSON. Same interface (getItemAccessToken(companyId, itemId)inpackages/ee/src/plaid/tokens.server.ts), so the storage backend is swappable and the Xero-token migration can follow either way. - Never the Xero plaintext pattern for bank credentials (fallback pre-approved; see resolved Open Question 1).
Sync job — bank-feed-sync
Inngest function (carbon/bank-feed-sync, registered in packages/lib/src/trigger.ts + events.ts), payload { companyId, itemId, trigger: "webhook" | "manual" | "scheduled" | "connect" }, concurrency-keyed on companyId:itemId so one Item never syncs twice concurrently:
- Load Item (metadata + token), resolve mapped
bankAccounts byplaidAccountId. - Cursor loop:
/transactions/syncfrom the stored cursor untilhas_more = false, buffering pages. OnTRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION, restart the whole loop from the stored cursor (verified requirement). Only after a complete loop: apply changes + persistnext_cursorto metadata. - Apply per mapped account (unmapped accounts' transactions are skipped):
added: insertbankTransaction(source: 'Plaid',externalId = transaction_id, amount = −plaid.amount,status = pending ? 'Pending' : 'Unmatched',pendingExternalId = pending_transaction_id,counterpartyfrommerchant_name ?? name,raw= trimmed payload) withON CONFLICT (bankAccountId, externalId) DO NOTHING.modified: update the same columns byexternalIdonly when the row is still Pending/Unmatched; a modified-but-Matched line getsneedsReview = trueinstead of silent mutation.removed: delete Pending/Unmatched rows; a removed-but-Matched/Reconciled row getsneedsReview = true(never deleted).- Pending→posted swap: when an
addedposted row carriespendingTransactionId, delete the matching Pending row (byexternalId = pending_transaction_id) in the same transaction.
- Balances:
/accounts/balance/get→ upsertbankAccountBalance(date = today,source = 'Plaid',balance = current, sign flipped for credit accounts so the stored balance is in Carbon's convention) — one snapshot per account per day (existing unique index). - Match:
run_bank_matching(bankAccountId, companyId, userId)per affected account (userId = the job's acting user: the Item'sconnectedBy). - Stamp
bankAccount.lastSyncedAt; clearconnectionStatustoConnectedon success.
Scheduled catch-up: a daily Inngest cron iterates all active plaid companyIntegration rows and fires bank-feed-sync per Item (webhook-loss insurance + keeps dev environments fresh where webhooks can't reach). "Sync now" button fires the same event with trigger: "manual".
Webhook route — api+/webhook.plaid.ts
Pure verify-and-dispatch (Xero webhook precedent):
- Verify the
Plaid-Verificationheader JWT:algmust be ES256; fetch the public key from/webhook_verification_key/getby the JWT'skid(cache keys bykidin module scope); rejectiatolder than 5 minutes; compare therequest_body_sha256claim to the SHA-256 of the raw body with a constant-time comparison. Any failure → 401, no processing. - Route by
webhook_type/webhook_code:TRANSACTIONS/SYNC_UPDATES_AVAILABLE→trigger("bank-feed-sync", { companyId, itemId, trigger: "webhook" })(company resolved by scanningcompanyIntegrationmetadata for theitem_id— add a smallgetCompanyByPlaidItemId(serviceRole, itemId)helper).ITEM/ERRORwithITEM_LOGIN_REQUIRED,PENDING_EXPIRATION,PENDING_DISCONNECT→ set the Item's metadatastatus: "Requires Reauth"andconnectionStatus = 'Requires Reauth'on its mapped bank accounts.ITEM/USER_PERMISSION_REVOKED→ Itemstatus: "Error", accountsconnectionStatus = 'Error'(bank account rows and history are always kept — resolved: keep-and-relink).- Everything else (legacy
INITIAL_UPDATE/HISTORICAL_UPDATE/DEFAULT_UPDATE/TRANSACTIONS_REMOVED) → 200, ignored (sync handles state).
- Always 200 fast; never do sync work inline.
Re-auth (Link update mode)
- Requires-Reauth banner on the bank accounts page and Cash Position (existing Phase 1 banner slot) with a "Reconnect" button →
api+/integrations.plaid.link-token.tswith the Item'saccess_token(update mode — no products); on Link success, no re-exchange is needed (verified: the access token is unchanged) — just reset Item + account statuses to Connected and fire a sync.
Cash Position page (Banking landing)
Route x+/accounting+/banking.tsx, sidebar "Cash Position" atop the Banking group. Per active bank account:
- Bank balance: latest
bankAccountBalance(badge shows source + as-of date). - GL balance: sum of posted journal lines on
glAccountId(reuses the trial-balance query path). - Drift decomposition (all as of the balance date, sign convention positive = inflow):
residual = bankBalance − glBalance + Σ(unmatched GL lines) − Σ(unmatched/pending bank lines)Displayed as: bank balance, GL balance, "explained by n statement lines awaiting match (Σx) and m outstanding GL items (Σy)", and Residual — green at 0, red otherwise (the misstatement signal). - Unmatched count (links to the reconcile workspace), days since last completed reconciliation, connection badge, last synced, 30-day balance sparkline from
bankAccountBalance(simple inline SVG — no charting dep). - Company-total header (base-currency accounts summed; foreign-currency accounts listed separately, unconverted, in v1).
Transfer detection
detectBankTransfers(client, companyId): pairs of Unmatched lines across two different active bank accounts with equal absolute amount, opposite signs, same currency, dates within ±3 days; excludes pairs where either line already has a pending proposal; returns proposals ranked by date proximity.- Surfaced as banners in the reconcile workspace (both sides) and a card on Cash Position. Accept → new server fn
createBankTransferFromTransactions(accounting.server.ts, Kysely tx): one postedjournal(sourceTypeManual, description "Transfer {from} → {to}") with two lines (debit receiving GL, credit sending GL, base currency — both accounts must be base-currency in v1, matching quick-create's FX restriction), plus two match groups, each pairing one bank line with its own journal line. Dismiss → records nothing (recomputed proposals naturally drop pairs whose lines got matched elsewhere).
Sandbox & testing strategy
PLAID_ENV=sandboxfor local/dev; credentialsuser_good/pass_good.- Automated tests bypass the Link UI entirely with
/sandbox/public_token/create→ exchange → prime sync (no browser needed);/sandbox/item/reset_logindrives the re-auth path;/sandbox/item/fire_webhookexercises the webhook route against a deployed environment — local*.devis unreachable from Plaid, so the local dev loop is "Sync now" + the scheduled catch-up, by design. - Sandbox Items auto-enter
ITEM_LOGIN_REQUIREDafter 30 days — dev banners appearing after a month are expected behavior, not a bug.
Non-goals (Phase 2)
Money movement of any kind (Plaid Auth/Transfer), investments/liabilities products, non-Plaid aggregators (Salt Edge etc.), cash-flow forecasting, converting foreign-currency balances in the Cash Position totals, and auto-accepting transfer proposals.
Design Decisions
| Decision | Choice | Rationale |
|---|---|---|
| New tables | None — Phase 1 schema carries everything (bankAccount linkage columns, bankTransaction.pendingExternalId/needsReview, bankAccountBalance); possible one-row integration registry seed |
Feed state (tokens, cursors, Item status) is integration state → companyIntegration.metadata, per Xero precedent |
| Multi-tenancy / RLS / service shape / forms | Inherited — no new tables, services follow (client, ...) → {data, error}, connect-flow routes under api+ use the Xero permission pattern, Cash Position under view: "accounting" |
Heuristics 1–6 satisfied by Phase 1 surfaces + Xero-precedent routes |
| Permission scoping | Connect/disconnect: update: "settings" (integration management, Xero precedent); sync-now / transfer-accept / re-auth: update: "accounting"; Cash Position: view: "accounting" |
Connecting a bank is company-integration admin; day-to-day feed actions are accounting work |
| Token storage | Vault-backed tokenRef with probed AES-256-GCM env-key fallback behind one getItemAccessToken interface |
Parent-spec decision, adapted to the fact Vault is unverified in this stack; interface makes the backend swappable |
| Cursor persistence | Buffer full loop, persist cursor only on loop completion; restart from stored cursor on TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION |
Verified Plaid requirement; partial-loop cursors lose data permanently |
| Sign & balance convention | Amount = −plaid.amount at ingest; credit-account balances flipped at snapshot | One inversion point per direction; everything downstream stays in Carbon's positive-=-inflow convention |
| Modified/removed on matched lines | needsReview = true, never mutate or delete |
Phase 1 lifecycle rule; evidential integrity of matched/reconciled lines |
| Webhook handling | Verify-and-dispatch route (ES256 JWT, body hash, 5-min replay window, key cache); all work in Inngest | Xero precedent; keeps the route fast and idempotent |
| Backfill window | Connect-time choice 90/180/365/730 days, stored per Item | days_requested is immutable per Item (verified) — must be chosen up front |
| Priming | Immediate sync on connect | SYNC_UPDATES_AVAILABLE never fires before the first sync call (verified) |
| Sync concurrency | Inngest concurrency key companyId:itemId, limit 1 |
Cursor loops must not interleave per Item |
| Job identity | run_bank_matching + row stamps use the Item's connectedBy user |
Deterministic attribution without a synthetic system user |
| Transfer accept | One JE + two match groups in one Kysely tx; base-currency accounts only | Reuses Phase 1 primitives; FX transfers deferred with quick-create's restriction |
| Sparkline | Inline SVG from bankAccountBalance |
No charting dependency for 30 points |
Data Model Changes
None, except (verify at implementation) a seed row if the integration registry table is migration-seeded:
-- Only if integration rows are seeded by migration (mirror however 'xero' exists):
INSERT INTO "integration" ("id", "name", "active")
VALUES ('plaid', 'Plaid', TRUE)
ON CONFLICT ("id") DO NOTHING;
companyIntegration('plaid').metadata documented shape (JSON, not schema):
{
"items": [{
"itemId": "item-abc",
"tokenRef": { "kind": "vault", "secretId": "..." }, // or { "kind": "aes", "ciphertext", "iv", "tag" }
"institutionId": "ins_109508",
"institutionName": "First Platypus Bank",
"daysRequested": 90,
"cursor": "AAAA...", // null until first completed loop
"status": "Connected", // Connected | Requires Reauth | Error
"connectedBy": "user_x",
"connectedAt": "2026-07-02T..."
}]
}
API / Service Changes
packages/ee/src/plaid/:config.tsx,hooks.server.ts,client.ts(SDK wrapper),tokens.server.ts(storeItemAccessToken,getItemAccessToken),sync.server.ts(the cursor-loop + apply logic, shared by job and connect-prime),index.ts.- Env (
packages/env/src/index.ts):PLAID_CLIENT_ID(public),PLAID_SECRET(secret),PLAID_ENV(defaultsandbox),PLAID_TOKEN_ENCRYPTION_KEY(secret; required only in AES fallback mode)..env.exampleupdated. - Routes (
apps/erp/app/routes/):api+/integrations.plaid.link-token.ts— action;update: "settings"for connect, orupdate: "accounting"whenitemIdpresent (update mode); returns{ linkToken }.api+/integrations.plaid.exchange.ts— action; exchanges token, stores secret, upserts metadata item, returns the Item's accounts for the mapping step.api+/integrations.plaid.map-accounts.ts— action; applies the account mapping (create/link/skip per Plaid account), then fires the priming sync.api+/webhook.plaid.ts— the verify-and-dispatch webhook (public, JWT-gated).x+/accounting+/banking.tsx— Cash Position loader (view: "accounting") + actions (intent: "sync" | "accept-transfer" | "dismiss-transfer").
- Services (
accounting.service.ts):getCashPosition(client, companyId)(balances + GL sums + drift terms per account),detectBankTransfers(client, companyId); (accounting.server.ts):createBankTransferFromTransactions(db, args). - Jobs (
packages/jobs/src/inngest/functions/integrations/):bank-feed-sync.ts(eventcarbon/bank-feed-sync) +bank-feed-scheduled.ts(daily cron fan-out). Registered inpackages/lib/src/trigger.ts/events.ts/ the jobs index.
UI Changes
- Integrations page: Plaid card (logo, description, Connected-items summary, Connect/Disconnect) — Xero card precedent.
- Connect modal: backfill-window select (90/180/365/730 days with "cannot be changed later" helper text) → Link (script-tag) → account-mapping step (per Plaid account: create new / link existing / skip, with currency-mismatch rows disabled) → done state showing the priming sync kicked off.
- Bank accounts page (Phase 1): "Connect bank" button goes live; Plaid rows show connection badge + "Sync now" + relink action when Requires Reauth; reauth banner wired to update-mode Link.
- Cash Position (
/x/accounting/banking, new sidebar entry "Cash Position"): per-account rows/cards with bank balance (as-of), GL balance, drift decomposition with green/red residual, unmatched-count link into the workspace, sparkline; transfer-proposal card with Accept/Dismiss; company-total header. ERPsize="md", plain numbers, Lingui throughout. - Reconcile workspace (Phase 1): transfer-proposal banner on lines that are one side of a detected pair.
Acceptance Criteria
- With
PLAID_*env unset, the Plaid card is absent and all Plaid routes 404/no-op; with sandbox env set, connect → Link (user_good/pass_good) → mapping step creates/links bank accounts withplaidItemId/plaidAccountIdand fires a priming sync that lands the backfilled lines (sign inverted: a Plaid-positive debit stores negative). -
SYNC_UPDATES_AVAILABLEdelivered toapi+/webhook.plaid.tswith a valid ES256 JWT triggers an incremental sync; an invalid signature, wrongalg, body-hash mismatch, oriat>5 min old each return 401 and trigger nothing. - A sync interrupted by
TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATIONrestarts from the stored cursor and applies the update exactly once (no duplicatebankTransactionrows — unique(bankAccountId, externalId)holds). - A pending line shows status Pending and is unmatchable; when its posted version arrives with
pending_transaction_id, the Pending row is gone and the posted row is Unmatched; a feedremovedon a Matched line setsneedsReviewand the workspace surfaces it. -
/sandbox/item/reset_loginflips the Item and its accounts to Requires Reauth with a banner; completing update-mode Link restores Connected without re-mapping accounts, and the same access token keeps syncing. - Daily scheduled catch-up syncs every active Item without webhooks; "Sync now" does the same on demand; two concurrent triggers for one Item never interleave (concurrency key).
- After each sync, balances land in
bankAccountBalance(one row per account/day) andrun_bank_matchinghas run — a payment posted before the sync auto-matches its feed line with no user action. - Cash Position shows, per account, bank balance vs GL balance with residual = bankBalance − glBalance + Σ(unmatched GL) − Σ(unmatched+pending bank lines); residual is 0 (green) on a fully explained account and red otherwise; sparkline renders 30 days of snapshots.
- Two opposite $5,000 Unmatched lines in two base-currency accounts within 3 days produce a transfer proposal; Accept books one JE and both lines flip to Matched (each in its own group); Dismiss leaves both Unmatched and the pair is not re-proposed while unchanged.
- Token storage: access tokens are never present in
companyIntegration.metadataplaintext (onlytokenRef); with Vault available, secrets live invault.secrets; in fallback mode, ciphertext decrypts only server-side withPLAID_TOKEN_ENCRYPTION_KEY. -
pnpm exec turbo run typecheck --filter=erp --filter=@carbon/ee --filter=@carbon/jobsandpnpm run lintpass.
Risks
| Risk | Severity | Mitigation |
|---|---|---|
| Vault absent in self-hosted/Docker deploys → token-storage decision blocked | Med | Probe first; AES-GCM env-key fallback pre-approved behind the same interface — the probe cannot block |
| Webhook endpoint is public and attacker-reachable | Med | Full verification chain (ES256 + kid key fetch + body hash constant-time + 5-min replay window); route does nothing but dispatch |
| Cursor loss/corruption in metadata JSON → re-ingest storm | Low | Unique (bankAccountId, externalId) makes re-ingest idempotent (duplicates skipped); worst case is wasted API calls |
| Item webhook → company resolution scans metadata JSON | Low | Items per company are few; add a metadata->items GIN index only if it ever shows up in traces |
| Plaid production approval/pricing not in place when Phase 2 lands | Med | Resolved: account created now, approval runs in parallel; sandbox works end-to-end without approval, so build/test isn't blocked |
| Local dev can't receive webhooks → devs think feeds are broken | Low | Scheduled catch-up + "Sync now" keep dev fresh; documented in the integration card copy and the research notes |
modified rewrites of Unmatched lines fight a user mid-match |
Low | Updates only touch Pending/Unmatched rows; Matched+ rows go to needsReview |
| Balance snapshot sign errors on credit accounts | Med | One flip point at snapshot write + acceptance criterion; class-aware convention already established in Phase 1 |
Open Questions
✅ All resolved 2026-07-02 — recommendations accepted verbatim by Brad ("let's go with the recommendations"). Implementation may proceed.
- Vault probe outcome & fallback approval — the parent spec chose Supabase Vault, but
vault/pgsodiumappear nowhere in this stack's migrations/config. If the probe finds Vault missing in any deploy target, is the AES-256-GCM +PLAID_TOKEN_ENCRYPTION_KEYfallback approved as the v1 storage (same interface, swappable later)? Matters because it gates the token-storage implementation and the Xero-migration follow-up. Answer: approved — if the probe finds Vault missing in any deploy target, ship the AES-256-GCM +PLAID_TOKEN_ENCRYPTION_KEYfallback behind the samegetItemAccessTokeninterface. - Webhook URL / environment reachability — webhooks need a public HTTPS URL per Item. Production uses the app URL; what should deployed dev/staging Items use, and do we accept "no webhooks locally, scheduled+manual sync only" as the permanent local-dev story? Matters for how the webhook path gets exercised before production. Answer: accepted — local dev is scheduled + manual sync only; the webhook path is verified on the deployed dev environment via
/sandbox/item/fire_webhook. - Plaid account ownership & production approval — who owns the Plaid dashboard account, and when do we start production access approval (it gates real banks + pricing)? Matters for launch sequencing, not build. Answer: Brad creates the Plaid dashboard account now and starts production approval in parallel; implementation proceeds entirely on sandbox.
- Retention on revocation — when
USER_PERMISSION_REVOKEDarrives (user cut access at the bank), keep thebankAccount+ all transactions and allow relinking a future Item to the same account (history preserved), never auto-delete? Matters because deletion would destroy reconciliation history. Answer: keep-and-relink, always — bank accounts and transaction history are never auto-deleted on revocation. - Scheduled catch-up cadence — daily (06:00 UTC) per Item, or twice daily? Plaid bills per connected account, not per API call, so frequency is about freshness vs job noise. Matters little; setting it once avoids churn. Answer: daily; webhooks are the real-time channel.
Changelog
- 2026-07-02: Created — Phase 2 of
.ai/specs/2026-07-02-bank-reconciliation.md. Plaid mechanics verified directly against plaid.com/docs (sync cursor/mutation-restart, webhook JWT verification chain, update mode,days_requestedimmutability, sandbox endpoints) after the Phase-1 research pass's verification outage; Vault availability flagged unverified in this stack. See.ai/research/plaid-bank-feeds.md. - 2026-07-02: All open questions resolved — recommendations accepted verbatim ("let's go with the recommendations"): AES-GCM fallback pre-approved pending the Vault probe; local-dev webhook story accepted; Plaid account + production approval started in parallel; keep-and-relink on revocation; daily catch-up cadence. Status → in-progress; ready for
/plan.