Repository navigation
Conversation
The payments safety rule matched payment, checkout, purchase and billing, but not refund, so an action like SHOPIFY_CREATE_REFUND passed without handing off to the person. Added refund to the keyword list. Also added a regression test locking in the other half of the issue: writing only an order note does not hand off. Co-authored-by: Saim Shafique <128062316+sx4im@users.noreply.github.com>
sx4im
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
October 30, 2026 15:17
This branch has not been deployed
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 this changes
SHOPIFY_CREATE_REFUNDmoves money but sailed through the safety policy: "refund" was not in the payments keyword list. Added it, so refunds hand off to the person like any other money movement. Also locked in the other half of #890 with a regression test: writing only an order note (SHOPIFY_UPDATE_ORDERwith id and note) does not hand off.Where it runs
No new state, no listeners, no schedules. The matcher is a pure function of the candidate, so every replica decides the same way.
Boundary and audit
approval.evaluatedlike every other safety hand-off.Changelog
CHANGELOG.mdunderUnreleased.Proof
bun test server/tests/approvals-policy.test.ts: 33 pass, 0 fail. The new test "refunds move money; writing an order note does not" fails before the fix (refund came back undefined) and passes after.tsc --noEmitclean on server. The DB-backed integration suite needs TEST_DATABASE_URL, not available here; the pure-policy suite covers this change.Fixes #890