M4 behavior contract: one diagnosis for settled money (PR4_PLAN.md) - #2063
Merged
Conversation
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 this is
The behavior contract for milestone M4 ("One diagnosis for settled money — fail-closed cutovers only"), written per PR_WORKFLOW.md before any tests or implementation. This PR contains two documents and no code — the contract itself plus the matching PLAN.md sync (the M4 section, the M6 provider note, fault rows F6, F12, F13, and F53 gaining their M4 slices, and the new program-wide "Data laws" section). Approving it approves the contract; implementation starts only after that.
What the contract says
outcomeOf(adapted from the great-fermi reference) becomes the only classifier of settled money on the current path. All three of today's judges are replaced and deleted in the same merges: the callback verdicts (classifySession), the refund attempt ordering (tryRefund/refundReferenceAtProvider), and the admin refresh-payment route's boolean mapping. This closes F51.amount,currency, andamount_refunded. SumUp refund authority is the summed refund events PR3's sandbox contract proved, and a multi-child SumUp checkout routes through the same remedy map as Square. Every money decision reads each provider's complete declared observation — sibling tenders and children included, their refund evidence too, bounded everywhere by a named sibling-read cap (beyond it the observation parks for the owner rather than letting a provider-controlled list chase the request budget). Park-shaped conflicts evaluate before proceed-shaped ones, coherent parentage is a stated prerequisite of every automatic refund, and a booking whose charge carries partial-refund evidence parks for the operator's required choice.evidence_index, the replay fingerprint;protected_state, the plain live-work mirror;payment_reference_index, a one-way reference index that stops two records of one payment racing two refunds), all shipped in the first PR slice.Owner decisions (recorded in the document)
All five questions are answered and folded in: proceed-and-alert for multiple captures, the Stripe read widening (stated completely as amount + currency + amount_refunded), both new copy strings verbatim, the two-PR slicing, and owner review for every multi-charge observation.
Review state
Thirty-three bot review rounds (twenty-nine Codex, four CodeRabbit — about 190 threads) are absorbed; every finding was verified against the code first, then amended or declined with reasons, and every thread has a reply citing its fixing commit. A self-audit against the data laws also ran before the latest push — its seven findings (among them the staged row's key-boundary corner, the orphan-purge bypass, and cross-attendee duplicate references) were fixed in the same commit, before any bot raised them.
Evidence basis
Every claim in the current-production-evidence table was verified against
4879ae0d(file:line cited per row); the SumUp refund evidence is grounded in PR3's verified sandbox contract; the reference-module map covers the exact port list, what gets slimmed against already-merged modules, and what stays for M5.Generated by Claude Code
Summary by CodeRabbit