Repository navigation
feat(db): add dormant atomic capture financial application - #18
Merged
Merged
Conversation
Apply the reviewed R2-B2-B SQL-owned first-capture effects with immediate and deferred finality. Preserve dormant authority, exact source clearance, legacy contracts and B2-C boundaries. Approved-source-SHA256: db7a502aa1d011bc1e2c4ee1d2335253ef4628ee244905946816e51fa1e03d58 Approved-plan-SHA256: e5c1303362f50c01bda16a2ac5100a0b742eede1383fe1d7ea9a4abb9434c81b Codex-security-review-SHA256: 319324e32802936321a320a51591bc37bd29a7f968134b90c47ba5e9aeb8c05c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Complete the dormant first-capture preparation from PR #17 with SQL-owned atomic financial application in forward migration 0016. A supported capture now commits its exact journal/entries, lot, cumulative payment, successful attempt, audit, effect links, application, own inbox claim CAS, covered source dispositions and one guarded revision together; independent immediate/deferred checks reject incomplete groups.
B2-C acknowledgment/replay/recovery, subsequent shared-PI captures, capture-failure finality, runtime enrollment, operational LOGIN grants, activation and F01/F04/F05/F06 closure remain out of scope.
Review guide
0016_capture_financial_application.sqleffect/completion reconstruction, permit issuance/ownership, exact row guards, deferred missing-group checks, source admission and timestamp-only normalization. Account creation/locking follows the existing legacy capture account order.Task size
T2 / HIGH_RISK. One PostgreSQL transaction owns exact balanced currency-isolated immutable journal/entries, NEW_CAPTURE lot, cumulative totals, successful attempt, financial audit, effect links, application and own-inbox finalization. Permits bind transaction/backend/session principal and SQL-issued manifest; source clearance is limited to independently proven original obligations; financial revision advances exactly once. Deferred validation also checks the independent reverse direction and missing whole groups. Historical migrations, accounting/rounding policy, REFUND, legacy and P-B/P-C boundaries remain intact.
Checks
Local finalization uses Node24.22.1 and pinned pnpm10.26.0;
RUN_DB_TESTS=0for workspace units, separate fresh Docker PostgreSQL17 for database tests. These local results are distinct from hosted CI.pnpm lintRUN_DB_TESTS=0 pnpm testpnpm buildpnpm typecheckpnpm test:verificationnode scripts/sync-agent-skills.mjs --checknode scripts/check-engineering-workflow.mjsgit diff --check;git diff --check origin/main HEADpnpm test:integration:dockerfintech-verify-710114ec-eaf2-4d5c-b68a-6da821a08a44cleanednode scripts/check-migration-history.mjs origin/main HEADnode scripts/check-pr-review-signals.mjs origin/main HEADt2-areaappliedUnverified boundaries
No production installation, scope activation, operational credential fencing, real Stripe calls, RabbitMQ/Redis runtime or browser testing is claimed. B2-C and F01/F04/F05/F06 remain open. Docker fixtures use placeholder providers and isolated resources; no shared database is used.
Review
Human accepted the reviewed dormant source and final Codex-native security review. No blocking P0/P1/P2 findings remain; automatic correction budget is exhausted (2/2), with no additional correction/rebaseline authorized.
db7a502aa1d011bc1e2c4ee1d2335253ef4628ee244905946816e51fa1e03d58.e5c1303362f50c01bda16a2ac5100a0b742eede1383fe1d7ea9a4abb9434c81b.code-review-2.md, REVIEW_APPROVED; original timestamp P1 corrected/reviewed before acceptance. SHA-2560923c3f7e75691552d5286eb15c3615874f76cef456937d69fafed6b1e8a0b74./root/r2_b2_b_codex_security_review,security-review-3.md, SECURITY_APPROVED. SHA-256319324e32802936321a320a51591bc37bd29a7f968134b90c47ba5e9aeb8c05c.security-review-3.mdis the accepted final security evidence.r2-b2-b: immutable HUMAN_APPROVAL ledger validated READY before publication; human acceptance granted. Publication does not rebaseline that reviewed dirty-tree snapshot.df104339429ef77f2d207083a50829a6f3589c23870c89cfcbba924910d51f48; matched after commit, binding published bytes to acceptance.Docs and temporary files
Updated owning
docs/concurrency.md,docs/database-design.mdanddocs/payment-lifecycle.md. Consulted accepted H01–H12, approved B1 accounting contract, approved R2 application design and capture preflight.All eleven existing workflow files remain unchanged under ignored
.tmp/agent-workflows/r2-b2-b/:state.json,plan.md,plan-review-1.md,plan-review-2.md,code-review-1.md,code-review-2.md,security-review-1.md,security-review-2.md,security-review-3.md,verification.json,final-checks.json. This single newhandoff.mdserves as the publication evidence/PR body. Original approved design artifacts in parent.tmp/r2-b2-b/(plan.md,review-brief.md,review-1.md,review-2.md,verification.md), the isolated task worktree and earlier failed-run diagnostics remain until human merge/finalization. Ignored API/web build outputs and compiler caches remain local. No evidence is included in the commit. Passing run-owned database resources/byproducts are removed by their runner; no global cleanup.Publication commit:
735e3da83361b99d73f1ce5faad8a0dd246e9342; treec54712ea59c148165b66f3ab8bdfc6c2d193ece0; branchchore/r2-b2-b-design, basemainat654572ce103eee1ce1768d5abff7fba2479a58df. Exactly19 approved files committed (5 new/14 modified); all593 source-file bytes/modes match the approved content digest after commit, with a clean worktree. Commit/index/status metadata necessarily differs from the accepted dirty-tree fingerprint; the original ledger is preserved without rebaseline. All11 prior artifact digests match, including the final Codex-native security report. Direct project-label inspection found zero containers/volumes/networks and no remaining fresh-run files. PR #18 is open and unmerged. Hosted CI run41839147563, attempt1, completed successfully at the exact published head on 2026-11-04T13:40:31Z: all5 jobs passed. The CI checkout mergef86a53e1f605c62200ec9511c7c9eaa7ce438df8has the exact published source treec54712ea59c148165b66f3ab8bdfc6c2d193ece0, independently checked through GitHub Git data and checkout logs. No rerun, source correction, rebaseline, activation or merge performed. Do not merge automatically.