Design and evidence
Which proofs link local posting and external settlement to the complete money path?
The final design reuses the complete runtime topology from step 6. Test markers connect key decisions to expected results and earlier steps to revisit. The following items form a test plan; measured evidence is still outstanding.
Starting point Pause outgoing instructions and reconcile them using external references.
Assumptions for the example case
Our own fictitious example draft: transfer in EUR with positive whole cent amounts; a debited customer account and an internal settlement account; external settlement with status query; reversal posting after proven rejection. Figures and quality goals are illustrative test assumptions. Outside are foreign exchange, interest, fees, regulatory approval check and a complete bank ledger.
Overall architecture with evidence
Runtime topology · a local commit before the external effect
- 1 · Release
- 2 · Commit ledger + outbox
- 3 · External processing
- 4 · Prove the result
Intra-bank accounting system
API and Worker share the relational journal store. The external settlement remains outside the system boundary.
Test plan with review loops
| Validation | Expected result | Return to an earlier step |
|---|---|---|
| Concurrency in both orders | Two different transfers of 7,000 cents each compete at 10,000 cents. In both commit sequences, exactly one wins; the final balance is 3,000 cents, the journal contains exactly their two lines. | Steps 3 and 5 |
| Identical and changed retries | Submit A-41 twice with the same payee and 7,000 cents: one external effect. The same key with 7,001 cents causes a conflict. After a reversal posting, an identical retry of the original command returns its historical record without posting again. | Step 4 |
| Exact value or time limit | 7,000 cents are to be rejected with available balance 6,999, booked at 7,000 and 7,001; the remainder 0 and 1 cent respectively. | Steps 2 and 5 |
| Lost response and restart | After external success, the response is lost. U-41 remains open; A-41 is queried. A time-out does not allow a reversal posting. Only a definitive rejection triggers exactly a reversal posting. | Steps 7 and 9 |
Concurrency in both orders
- Expected result
- Two different transfers of 7,000 cents each compete at 10,000 cents. In both commit sequences, exactly one wins; the final balance is 3,000 cents, the journal contains exactly their two lines.
- Return to an earlier step
- Steps 3 and 5
Identical and changed retries
- Expected result
- Submit A-41 twice with the same payee and 7,000 cents: one external effect. The same key with 7,001 cents causes a conflict. After a reversal posting, an identical retry of the original command returns its historical record without posting again.
- Return to an earlier step
- Step 4
Exact value or time limit
- Expected result
- 7,000 cents are to be rejected with available balance 6,999, booked at 7,000 and 7,001; the remainder 0 and 1 cent respectively.
- Return to an earlier step
- Steps 2 and 5
Lost response and restart
- Expected result
- After external success, the response is lost. U-41 remains open; A-41 is queried. A time-out does not allow a reversal posting. Only a definitive rejection triggers exactly a reversal posting.
- Return to an earlier step
- Steps 7 and 9
First end-to-end validation
- End-to-end path
- Implement an end-to-end test of U-41 with concurrency, response loss and definitive rejection. Ledger balance and at most one reversal posting are the test oracles.
- Open decision
- After passing the counterexample tests, partial returns are designed separately. Foreign exchange, interest, fees, regulatory approval check and a complete bank ledger require its own follow-up draft.
Test the first payment flow
Implement an end-to-end test of U-41 with concurrency, response loss and definitive rejection.
The biggest uncertainty lies between journal and external impact.
Balanced ledger entries and at most one reversal posting are the test oracles.
- Alternative considered
- Only a balance display does not check these commitments.
- Trade-off
- A simulated settlement service is needed early.
- Reassess
- After passing the counterexample tests, partial returns are designed separately.
Terms in this step
- Test the first payment flow
- Balanced ledger entries and at most one reversal posting are the test oracles.
Try it yourself
Assign contention and a lost settlement response to a module, an expected test result and a design step to revisit.
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- Posting API and Journal: two attempts of 7,000 cents each against 10,000 make exactly one winner and 3,000 cents remainder. Errors lead to step 3 and 5.
- Second part of the solution
- Settlement worker: response loss for A-41 preserves exactly one external effect and reconciles the same instruction. Failures lead back to steps 4 and 7.
Apply to your project
Which corresponding assumption in your project would you check first? Use as an occasion: After passing counter-examples, partial returns are designed separately.
Start your own design
Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.
Download design template (.md)Compare the ten tasks with the example case
Purpose and boundary
Which corresponding assumption in your project would you check first? Use as an occasion: An additional batch transfer model requires its own authorisation contract.
In the example: Bind authorisation evidence to the account, payee, amount and EUR. U-41 may produce only the authorised effect; changed payee details must stop validation.
Requirements
Which corresponding assumption in your project would you check first? Use as an occasion: Measured account lock times exceed the response target.
In the example: Check available funds in the same transaction as the debit. An invariant test must produce one winner for two attempts of 7,000 cents each.
Scale estimates
Which corresponding assumption in your project would you check first? Use as an occasion: A real pooled account exceeds the assumed contention profile.
In the example: Test overall load and competing debits separately. 20 transfers/s says nothing about 50 accesses to K-41.
Interfaces
Which corresponding assumption in your project would you check first? Use as an occasion: storage and external reference validity are changed contractually.
In the example: Persist the key with canonical content and the original result. An identical retry receives the same ledger record; a changed amount is rejected.
Data and states
Which corresponding assumption in your project would you check first? Use as an occasion: Partial returns extend the hitherto complete reversal posting case.
In the example: Create a referenced reversal posting with its own uniqueness guarantee. The ledger totals balance and the original decision remains auditable.
Overall architecture
Which corresponding assumption in your project would you check first? Use as an occasion: Independent journal teams or measured capacity limits establish a new limit.
In the example: The posting API and worker share a transactional ledger and outbox store. A crash after commit leaves A-41 discoverable; before commit, the balance remains unchanged.
Critical flow
Which corresponding assumption in your project would you check first? Use as an occasion: The external service no longer offers a persistent status reconciliation.
In the example: Query A-41 and retain abwicklung_offen until the outcome is evidenced. A lost response must neither debit again nor prematurely release funds.
Bottlenecks and trade-offs
Which corresponding assumption in your project would you check first? Use as an occasion: The load profile reaches the limit despite short transactions.
In the example: Measure lock duration and account distribution; keep network calls outside the transaction. A short local transaction protects funds with less waiting.
Operations and security
Which corresponding assumption in your project would you check first? Use as an occasion: A proven lossless replication changes the recovery assumption.
In the example: Pause outgoing instructions and reconcile them using external references. Payment operations confirm reconciliation; platform operations provide the data.
Final design
Which corresponding assumption in your project would you check first? Use as an occasion: After passing counter-examples, partial returns are designed separately.
In the example: Implement an end-to-end test of U-41 with concurrency, response loss and definitive rejection. Ledger balance and at most one reversal posting are the test oracles.