Docs

justin-napolitano/jayburd-bookkeeping / docs/runbooks/production-source-sql.md

Production source SQL — #311

Synced 2026-11-04 · Updates are made in the source repository.

Production source SQL — #311

Status and boundary

PRODUCTION311-SQL through2026-10-25T05:00Z, dedicated feat/311-production-source-authority from mainc843315. Sole SQL writer; owner313 owns private credential/runtime work. No secret values, real records, provider/ cloud calls, managed migration, deployment or live activation.

Stage ledger

StageEvidence / limit
Resume308/312 merged and closed, current311/65/main checked, prior leases released; original checkout preserved
Inventory12/13/18/20/22/25/26/28/29/32/33 current functions and wrappers, source namespace/Item/credential checks and current restricted test runner reviewed
ContractPhysical scope table, owner-only configuration, session-user environment checks, credential resource matching, immutable provenance, preflight for313 and guarded down specified before DDL
SourcesOfficial Plaid host/storage and PG17 safe SECURITY DEFINER/constraints selections refreshed; no financial mapping/version or actual resource choice inferred
DDL reviewExact pre-DDL contract hash recorded under311/65 before reserving34; later one-Item/one-binding pilot refinement documented before its wrapper/limit change
ImplementationAdditive34 pair/checksum, immutable scope/operator configuration, current session-login checks, private preflight, exact key resources, attempt/Item/namespace/credential environment, guarded down and closed Go execution context implemented; no previous SQL edits
Restricted matrixNew real-login Production origin/privilege/key/permission/revocation/replay, immutable Sandbox origin, explicit Sandbox and one-account pilot cases PASS; no actual provider or KMS I/O
BookkeepingIndependently fixed USD50 acquisition creates zero journals; explicit granted balanced post/replay creates one journal/outbox and exact debit/credit50, stale/revoked rights deny; provider scope pause does not prohibit authorized local receipt recovery
Corrections during verificationCorrected test-only outbox table/permission SQLSTATE/current book-revision assumptions. An explicit Sandbox configuration test found ledger.keys forbids nullable key fields; replaced only the new operator input validation with exact closed-key/type checks allowing null keys only for Sandbox. Unknown login now fails with a fixed denial before role lookup. No money, timeout, source consent or expected scope weakened
RegressionCore/vet/race/build, acquisition/connection/service/provider-flow/owned-repair, migration forward/down/roundtrip and ledger gates PASS. Final pilot-limit/SQL and browser→Next→Go→PostgreSQL recovery PASS; test-only synthetic identity does not prove real MFA/provider/cloud. Cached local Go1.26.5 external modfile, tracked1.26.10/dependencies unchanged
Credential SQL completionActual restricted worker lookup derives the exact Production environment/reference/envelope from the current lease. New Hosted Link handoff accepts only the separately approved Link key, rejects the bank key, and replays its immutable winner. All final connection-state cases PASS; actual AEAD/KMS execution remains313

Current evidence

Source implementation and synthetic SQL evidence only. No hosted Production capability, actual credential/AAD decryption, signed Production receiver or live bank reconciliation claimed. Full current permissions, consent, generation, lease and balanced immutable ledger invariants remain required. Existing Sandbox regressions retain their original expected behavior.

Remaining work

Publish a reviewable PR with exact-head CI/human security review before merge. 313 private crypto/runtime/credential integration remains separately owned and blocked until311 actually merges.314 receiver,315 qualification,337 actual resource/ pilot decision and316 release remain open. No managed apply/deploy/provider scope.

PR handoff

Refs311/90/308/312/313/314/315/337. Stage runbook and staged check each commit. No managed apply or rollout from source merge; actual qualification/release separate.