test(payments): pin which mint output lands in which provision field - #240
Merged
Merged
Conversation
|
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.



The last untested seam: which mint output lands in which provision field
A pure extraction plus a five-case unit test. No behaviour change —
tsc0, eslint 0, all tests green.The gap
openProvisioningPrcould never be reached in tests: it needs aPROVISION_GITHUB_TOKEN, andsofra-staginghas none (measured — prod has the variable, staging does not).mintForProposalandbuildTenantRegistryEntryare both thoroughly tested on either side, but the five lines that decide WHICHof the mint's three outputs lands in WHICH field sat inline between them:
stripe_account:receiving a URL is a registry entry that provisions a tenant pointed at an account thatdoes not exist — and nothing downstream would notice, since
provision-tenant.shchecks the pairing, not theshape.
The fix
applyMintToProvisionInput(lib/provisioning-mint.ts) — pure, so the mapping is testable without a token.The conditional spreads are deliberate:
buildTenantRegistryEntrydistinguishes an absent key from onepresent-and-undefined, so
{ stripeAccount: undefined }can emit a blankstripe_account:line thatprovision-tenant.shreads as configured-but-empty.Measured with two mutants, both landed and compiled first
stripeAccountandpaymentsLinkUrlswappedstripeAccount: mint.stripeAccount as string)Assertions are field-by-field rather than
toEqualon the whole object, because a swap is exactly the failurebeing guarded and
toEqualdoes not name which pair moved.Context
The e2e proof of this chain lives in #238 (
tests/e2e/connect-mint.spec.ts), which needs only the Stripe testkey.
openProvisioningPritself still needs aPROVISION_GITHUB_TOKENto be exercised — see BACKLOG, "TheMINT half now runs end to end".
REVIEW PROVENANCE. The gate's claude CLI is org-blocked ("Your organization has disabled Claude's subscription access"), and the documented GLM fallback cannot drive it (GLM +
--tools ""stops ontool_use, unparseable verdict — twice). Per the owner's instruction, this diff was reviewed by the parent agent (glm-5.3-flash) against the gate's own prompts: pure extraction, conditional spreads deliberate, two mutants red on exactly the right assertions, positive control present.RUMI_REVIEW_FAIL_OPEN=1was used for this push only, with the substantive review done as above. CI + threads + Sonar still enforced by the merge gate.