29 KiB
phase, verified, status, score, covered_files, covered_digest, behavior_unverified, overrides_applied, re_verification, human_verified, human_verification
| phase | verified | status | score | covered_files | covered_digest | behavior_unverified | overrides_applied | re_verification | human_verified | human_verification | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 18.1-payment-gateway-subscriptions | 2026-10-16T15:45:06Z | human_needed | 5/5 roadmap success criteria verified (plan must-haves 65/65 verified, 4 of them as amended by user-accepted fixes) |
|
v2:sha256:4d5014a3f2a0a899ec2e3ad3896b5355c8fd446b212d578575869422cd4560e8 | 0 | 0 |
|
|
|
Phase 18.1: Payment Gateway Subscriptions Verification Report
Phase goal: The generic core of Golem15.PaymentGatewaySubscriptions and pgstripe's subscription gateway and webhook run on SummerCMS. Horoskopia's subscription flow (plans, checkout, Stripe webhook, golem15.pgsub.* events, cancel and portal) works as it does on PHP. Exceptions are the user's recorded amendments: event ordering (D-21 amendment, 2026-10-14), the portal cancel_at mapping (D-21 amendment, 2026-10-16), and the re-review fixes the user accepted in UAT row 5 (canceled fires once on a deletion, incomplete no longer blocks checkout).
Mode: mvp. The ROADMAP goal is not in user-story form, so this report checks the goal text and its five success criteria, as the earlier verifications did.
Verified: 2026-10-16T15:45:06Z
Status: human_needed (one item: the release go-ahead)
Re-verification: Yes. The previous report (2026-10-16T14:45Z) had no gaps:. It went stale (covered_changed) after two quick tasks: 261016-myi (WR-01 to WR-07 and G-18.1-8) and 261016-nqk (G-18.1-7 and G-18.1-4). This run verifies both in full and regression-checks plans 01 to 09 through the full gate.
Goal Achievement
Observable Truths (roadmap success criteria)
| # | Truth | Status | Evidence |
|---|---|---|---|
| 1 | SC-1: Subscription and SubscriptionPlan on a squashed, idempotent v2.4.0 baseline; subscribers registered at build time; built-in user subscribable |
VERIFIED | TestBaselineSchema and TestUserSubscribable passed in this run's postgres stage. G-18.1-8: boot.go bootService now builds and publishes *classes.Service through lagoon.OnDatabase, so plugins can activate before a command opens the database (generated main.go order). TestBootBeforeDatabase passed here. UAT row 8 passed on a demo app built with summer build. The user resolver gained an optional ResolveMany (contracts.SubscriberBatchResolver). It still writes only stripe_customer_id. |
| 2 | SC-2: Stripe implementation of the gateway incl. syncPlanToGateway; both webhook routes verify, enqueue, process idempotently, fire the six events |
VERIFIED | subscriptions/job.go applySubscription is unchanged: marker check, then foreign-app claim, then WithSessionLock(SubscriptionLockKey), then retrieve outside a transaction, then claim and Apply in one transaction. G-18.1-7: every mapping path goes through subscriptionObject.args(): the snapshot (decode.go:222-226), the fresh retrieve (gateway.go:468-475) and Gateway.SyncSubscription (gateway.go:415-422). pendingCancel() (decode.go:162-167) maps Stripe's flag, or cancel_at on an active or trialing subscription, to cancel_at_period_end. WR-02: ApplyDeleted fires canceled only when the row was not already canceled (apply.go:241-243). Passed here: TestFreshStateSmoke incl. portal_cancel_at_only_then_uncancel (reactivated exactly once) and deleted_before_created (canceled == 1); TestEventOrdering incl. deleted_before_created (canceled == 1, ordering_test.go:152); TestDecodeSubscription/a_cancel_at_date…; TestHostSubscriptionFlow; TestSubscriptionWebhookSmoke; TestSubscriptionJob. UAT rows 6 and 7 passed against real Stripe test mode. |
| 3 | SC-3: admin screens, Go service API, headless customer API, layer components | VERIFIED | Admin: models/subscription/columns.yaml gains a subscriber column, filled per page by subscriptionsAdminController.ListExtendRecords. Type and id stay as invisible searchable columns. The preview title comes from FormRecordTitle, and the label element reads its value property (assets/js/fields.js). Framework: pact.ListExtendRecords and pact.FormRecordTitle (capabilities.go:737-763); the SPA uses meta.title; dist rebuilt and matching. Service API: Cancel takes SubscriptionLockKey (service.go:471-499). CheckoutGuarded refuses on CheckoutBlocker, cancels incomplete subscriptions and expires open sessions inside SubscriberLockKey (service.go:351-437). SyncPlan with a nil tx runs under PlanLockKey on a re-read plan (service.go:693-712). Customer API: 409 on CheckoutBlocker; 422 on CheckoutPriceID == "" and on contracts.ErrPriceUnavailable (api/subscription.go:93-171). Layer: unchanged at v0.2.1; 112/112 TAP. UAT row 4 passed in a browser, covering admin and layer, including Back from Checkout and the subscriber e-mail and title. |
| 4 | SC-4: host test proves checkout, activation, invoice.paid, past_due grace, cancel, duplicate idempotency against a Stripe fake | VERIFIED | TestHostSubscriptionFlow passed in this run (postgres stage, pgstripe ./subscriptions, 12 required tests). |
| 5 | SC-5: unit tests delivered in the phase's last plan | VERIFIED | Plan 09 is the last plan, and the gate requires its names by stage and package. The quick tasks are outside the phase's plan sequence. Each carries named tests in its fix commits: pgsub TestCheckoutIncompleteAndOpenSessions, TestCancelTakesSubscriptionLock, TestSyncPlanSerialised, TestCheckoutPriceUnavailable, TestBootBeforeDatabase, TestLabelElementValueProperty; pgstripe TestReviewFixesGateway (4 subtests) and the cancel_at subtests; cabana TestListUnstoredColumn, TestListExtendRecords, TestFormRecordTitle. All passed when run by name here, with 0 skips. The gate does not pin these names (see Anti-Patterns, INFO). |
Score: 5/5 roadmap truths verified (0 present, behavior-unverified).
Plan must-haves: changes since the previous report
The previous report verified plans 01 to 09 (65 truths). This run re-checked all of them through the full gate (below). The rows here are the truths whose status or wording changed.
| Plan | Truth | Status | Evidence |
|---|---|---|---|
| 07 | CR-01 seq 3: an older queued updated after Service.Cancel fires no reactivated | VERIFIED | Was coincidental-reliance. Service.Cancel now calls the gateway and writes the flag inside WithSessionLock(SubscriptionLockKey), so a job that has already retrieved Stripe's state finishes before the cancel starts. TestCancelTakesSubscriptionLock passed: Cancel blocks while another session holds the lock and makes no gateway call until the lock is released. TestFreshStateSmoke/stale_update_after_cancel_no_reactivated and TestEventOrdering/stale_cancel_flag_no_reactivated also passed |
| 08 | WR-07: bfcache restore re-enables the three components; listener removed on unmount | VERIFIED (human UAT, row 4) | Was PRESENT_BEHAVIOR_UNVERIFIED. UAT row 4: "playground subscribe, Back from Checkout and 409 pass". The layer's last commit (22368c5, 13:35+02:00) predates the UAT record (15:34Z) |
| 02 | ApplyDeleted sets canceled and ended_at and fires canceled unconditionally | VERIFIED (amended) | Changed by the user-accepted fix of review WR-02 (UAT row 5 note: "WR-02 now fires canceled once (deviation from PHP)"). It now fires only on the transition into canceled (apply.go:241). On the paths PHP could reach, the listener count is still one. The pgsub README states the deviation (README:36) |
| 03 | D-21: PHP's cancel_at_period_end mapping kept; prices for usd, eur and pln | VERIFIED (amended) | D-21 amendment of 2026-10-16 in 18.1-CONTEXT.md:69: cancel_at on active or trialing maps to the flag. COVERAGE.md row "subscription cancel_at" is INTEGRATE. Sync currencies are now usd, eur and pln plus every supported currency the plan prices (sync_plan.go:24-41, WR-05), a superset of the original. TestReviewFixesGateway/WR-05 passed |
| 04 | Subscriptions list with subscriber type, subscriber id, plan, status, period end… | VERIFIED (amended) | G-18.1-4: type and id are still columns, now invisible but searchable, and the visible subscriber column shows the e-mail. UAT row 4 retest passed ("subscriber e-mail column, title 'Subscription #1 (Pro)', Gateway/Status shown") |
| 08 | WR-03: 409 for any status but canceled/incomplete_expired (incl. incomplete); session idempotency key per subscriber/plan/currency | VERIFIED (amended) | Changed by the user-accepted fixes of review WR-07 and WR-04 (UAT row 5). incomplete no longer blocks checkout (models/subscription.go:133-135); the guarded checkout cancels it at the gateway first. The session idempotency key was replaced by expiring the customer's open subscription sessions inside the subscriber lock (gateway.go ExpireOpenCheckoutSessions), which is stronger: at most one payable session. TestCheckoutIncompleteAndOpenSessions, TestCheckoutGuarded and TestReviewFixesGateway/WR-04 passed |
| 08 | WR-01 residual (lost per-plan serialisation, review WR-03) | VERIFIED | SyncPlan with a nil tx holds PlanLockKey and re-reads the plan; V1Products.Create carries an idempotency key. TestSyncPlanSerialised (one product from two concurrent syncs) and TestReviewFixesGateway/WR-03 passed |
| 08 | CR-02 amount residual (review WR-06) | VERIFIED | checkPrice (gateway.go) retrieves the price before the session and refuses a missing, inactive, other-currency or other-amount price with ErrNoPriceForCurrency, which wraps contracts.ErrPriceUnavailable (gateway.go:33). The API answers that with 422. TestCheckoutPriceUnavailable and TestReviewFixesGateway/WR-06 passed |
| 09 | D-22 release | VERIFIED (for plan 09's scope) | The tags plan 09 recorded are still on origin. The quick-task commits that followed are unreleased: see the human item and the Anti-Patterns WARNING |
The amended rows follow the precedent set when D-21 was amended for ordering. A user decision recorded in UAT or CONTEXT changes the contract, and the code is checked against the amended contract. Two amendments are recorded only in UAT row 5 and the pgsub README, not in 18.1-CONTEXT.md § Amendments: WR-02 (canceled once) and WR-07 (incomplete no longer blocks). apply.go:205 says the deviation is "recorded next to the D-21 amendment", but CONTEXT does not record it (INFO).
Plan must-have score: 65/65 verified (4 as amended, 1 by human UAT). 0 present-behavior-unverified.
Requirements Coverage (phase-local IDs; REQUIREMENTS.md maps no IDs to 18.1)
| ID | Plans / tasks | Status | Evidence |
|---|---|---|---|
| SC-1 to SC-5 | 01-09 | SATISFIED | Truths 1-5 |
| D-01 to D-20, D-22 | 01-09 | SATISFIED | Decision coverage gate: 24/24 honored. D-06 re-run: go list -deps ./... in pgsub has 0 stripe-go packages |
| D-21 | 03, 07, quick nqk | SATISFIED (amended twice) | Ordering (2026-10-14) and cancel_at (2026-10-16), both in CONTEXT § Amendments |
| CR-01, CR-02 | 07-09 | SATISFIED | Unchanged; regression-checked by the gate |
| Re-review WR-01 to WR-07 | quick 261016-myi | SATISFIED | 18.1-REVIEW-DISPOSITION.md marks all "fixed"; code read above; named tests passed here |
| UAT G-18.1-4, G-18.1-7, G-18.1-8 | quick nqk, quick myi | SATISFIED | 18.1-UAT.md ## Gaps: all resolved, with retest passes in rows 4, 7 and 8 |
| First-review WR-05 (grace period from the advanced period end) | none | DEFERRED by user scope | deferred-items.md, unchanged |
No orphaned requirements.
Required Artifacts (changed since the previous report)
| Artifact | Status | Details |
|---|---|---|
sm-paymentgatewaysubscriptions-plugin/classes/service.go |
VERIFIED | Cancel under the subscription lock; CheckoutBlocker; cancelIncomplete; expireOpenSessions; SyncPlan under PlanLockKey with a re-read |
sm-paymentgatewaysubscriptions-plugin/classes/apply.go |
VERIFIED | Transition-only canceled in ApplyDeleted; warnDuplicateOpen at Error |
sm-paymentgatewaysubscriptions-plugin/boot.go |
VERIFIED | lagoon.OnDatabase; grace_period_days still validated at Boot |
sm-paymentgatewaysubscriptions-plugin/contracts/gateway.go, contracts/subscriber.go |
VERIFIED | CheckoutSessionExpirer, ErrPriceUnavailable, SubscriberBatchResolver (optional interfaces; Gateway keeps its methods) |
sm-paymentgatewaysubscriptions-plugin/controllers/subscriptions.go, models/subscription/columns.yaml, assets/js/fields.js |
VERIFIED | ListExtendRecords, FormRecordTitle, subscriber column, label value property |
sm-pgstripe-plugin/subscriptions/decode.go |
VERIFIED | CancelAt decoded, pendingCancel() used by args() |
sm-pgstripe-plugin/subscriptions/gateway.go, sync_plan.go |
VERIFIED | checkPrice, ExpireOpenCheckoutSessions, product idempotency key, planCurrencies |
summercms.go/modules/pact/capabilities.go, modules/cabana/{list_schema,query,crud,relation_field}.go, admin/src/views/{FormView,PreviewView}.vue |
VERIFIED | Generic hooks; unstored columns compile unsortable; meta.title; OpenAPI and dist checks clean |
Key Link Verification (new links)
| From | To | Via | Status |
|---|---|---|---|
api/subscription.go Checkout |
classes/service.go |
d.svc.CheckoutBlocker (409) then CheckoutGuarded; errors.Is(err, contracts.ErrPriceUnavailable) → 422 |
WIRED |
classes/service.go CheckoutGuarded |
pgstripe Gateway.ExpireOpenCheckoutSessions |
gw.(contracts.CheckoutSessionExpirer) |
WIRED (TestReviewFixesGateway/WR-04 through the fake) |
pgstripe ErrNoPriceForCurrency |
contracts.ErrPriceUnavailable |
fmt.Errorf("...: %w", contracts.ErrPriceUnavailable) (gateway.go:33) |
WIRED |
decode.go args() |
snapshot, fresh retrieve, legacy SyncSubscription | pendingCancel() |
WIRED (all three paths share args()) |
controllers/subscriptions.go |
framework cabana | var _ pact.ListExtendRecords, var _ pact.FormRecordTitle |
WIRED (TestAdminSubscriptionsSmoke, TestListExtendRecords, TestFormRecordTitle) |
classes/user_subscribable.go |
controllers/subscriptions.go |
contracts.SubscriberBatchResolver.ResolveMany |
WIRED (TestUserSubscribable) |
boot.go bootService |
lagoon.OnDatabase |
callback publishes *classes.Service |
WIRED (TestBootBeforeDatabase, UAT 8) |
Data-Flow Trace (Level 4)
| Artifact | Data | Source | Real data | Status |
|---|---|---|---|---|
| Webhook job → row | subscription state incl. pending cancel | V1Subscriptions.Retrieve → decodeSubscription → args() → Apply |
yes (UAT 6, 7 live) | FLOWING |
| POST /subscription/checkout | Stripe price | CheckoutPriceID → V1Prices.Retrieve check → session create |
yes | FLOWING |
| Admin subscriptions list | subscriber e-mail | ResolveMany (one query per alias) → Subscription.Subscriber (gorm:"-") |
yes (UAT 4 retest, demo API showed customer@example.test) |
FLOWING |
| Admin preview | meta.title |
FormRecordTitle → plan name query |
yes | FLOWING |
Behavioral Spot-Checks and Probe Execution
| Behavior | Command | Result | Status |
|---|---|---|---|
| Full phase gate, Postgres required | PHASE181_REQUIRE_POSTGRES=1 bash scripts/check-phase18.1.sh --all |
EXIT=0. PASS self-test, go, plugins, admin (vitest 1431 in 93 files), layers (112/112, 43 subscriptions:), docs (docs:build clean, OpenAPI and admin dist match), postgres (cabana 4, pgsub 21, pgstripe root 4, subscriptions 12). "Phase 18.1 gate passed" |
PASS |
| Quick-task tests, pgsub (Docker) | go test -count=1 -v -run '^(TestCheckoutIncompleteAndOpenSessions|TestCancelTakesSubscriptionLock|TestSyncPlanSerialised|TestCheckoutPriceUnavailable|TestBootBeforeDatabase|TestLabelElementValueProperty|TestUserSubscribable|TestAdminSubscriptionsSmoke|TestApplyEvents)$' . |
9/9 PASS, 0 SKIP | PASS |
| Quick-task tests, pgstripe (Docker) | go test -count=1 -v -run '^(TestReviewFixesGateway|TestDecodeSubscription|TestFreshStateSmoke|TestEventOrdering|TestJobArgsMinimal)$' ./subscriptions |
all PASS incl. portal_cancel_at_only_then_uncancel, the 4 WR subtests, deleted_before_created; 0 SKIP | PASS |
| Framework hooks (Docker) | go test -count=1 -v -run '^(TestListUnstoredColumn|TestListExtendRecords|TestFormRecordTitle)$' ./modules/cabana |
3/3 PASS | PASS |
| Framework | go vet ./...; go test -short ./... |
both exit 0, no failures | PASS |
| Plugins vet | go vet ./... in pgsub and pgstripe |
clean | PASS |
| D-06 | go list -deps ./... in pgsub, count stripe-go |
0 | PASS |
| Plugin build outside the workspace | GOWORK=off GOPROXY=off go build ./... in pgsub |
builds only because pgsub's own go.mod has replace .../summercms => ../summercms.go; go list -m resolves summercms "v0.2.1" to the local checkout |
INFO (see Anti-Patterns) |
Test Quality Audit (new tests)
| Test | Linked item | Skipped | Assertion level | Verdict |
|---|---|---|---|---|
| TestCancelTakesSubscriptionLock | WR-01 | no | behavioral (blocks on held lock, no gateway call before release, flag stored) | OK |
| TestCheckoutIncompleteAndOpenSessions | WR-04, WR-07 | no | behavioral | OK |
| TestSyncPlanSerialised | WR-03 | no | behavioral (one product from two syncs) | OK |
| TestCheckoutPriceUnavailable, TestReviewFixesGateway/WR-06 | WR-06 | no | value | OK |
ordering/fresh-state canceled == 1 |
WR-02 | no | value (event counts) | OK |
| TestFreshStateSmoke/portal_cancel_at_only_then_uncancel | G-18.1-7 | no | behavioral (no event on cancel, reactivated once on un-cancel) | OK |
| TestBootBeforeDatabase | G-18.1-8 | no | behavioral (activation before DB publish) | OK |
| TestLabelElementValueProperty | G-18.1-4 | skips only without node; ran here |
value | OK |
No disabled tests, no circular expected values. The Stripe fake's responses are hand-written, and UAT rows 6 and 7 back the mapping with real Stripe bodies.
Anti-Patterns Found
| File | Line | Pattern | Severity | Impact |
|---|---|---|---|---|
| sm-paymentgatewaysubscriptions-plugin/go.mod | 7, 149 | requires summercms v0.2.1, but HEAD calls pact.ListExtendRecords and pact.FormRecordTitle, which are in no framework tag; it builds only through its own replace ../summercms.go, which a consuming module ignores |
WARNING | pgsub HEAD cannot be consumed by tag or pseudo-version until the framework is tagged and the require bumped. This is the human release item |
| sm-paymentgatewaysubscriptions-plugin, tag v0.1.0 | n/a | released plugin lacks G-18.1-8 | WARNING | an app built with summer build on pgsub v0.1.0 fails every command ("database is not published"). Fixed on main (ab46d6f), unreleased |
| scripts/check-phase18.1.sh | required names | the quick-task tests (above) are not in the gate's required lists; 18.1-VALIDATION.md has no rows for them | INFO | the gate would not notice if they were skipped or removed. They passed here by name |
| .planning/phases/18.1-…/18.1-CONTEXT.md | § Amendments | WR-02 (canceled once) and WR-07 (incomplete no longer blocks) deviations not recorded; apply.go:205 claims they are "recorded next to the D-21 amendment" |
INFO | decision trail sits in UAT row 5 and the README only |
| docs/backend/forms.md | FormRecordTitle paragraph | the example title "Subscription #12 (Pro)" | INFO | generic concept, no application named; the framework rule holds |
No TBD, FIXME, XXX, TODO or HACK markers in the files these quick tasks changed: pgsub classes, api, models, contracts, controllers, boot and assets; pgstripe subscriptions gateway, decode, sync_plan and job; cabana list_schema, query, crud and relation_field; pact capabilities; FormView and PreviewView.
IN-01 to IN-05 of the re-review stay open as info. The disposition records them. IN-03 (502 instead of 422 on a gateway price refusal) is now closed in effect: the API maps ErrPriceUnavailable to 422.
Prohibitions (judgment tier, autonomous LLM verdict, non-authoritative)
| Source | Prohibition | Verdict |
|---|---|---|
| 02, 04, 07 | pgsub imports no stripe-go (D-06) | holds (0 deps, run here) |
| 01, 08 | Framework code and docs name no consuming application; generic additions only | holds. The bc5685e and 013890c diffs name no app or provider. One docs example uses "Subscription #12 (Pro)" as a sample title (INFO) |
| 07 | No Stripe call while a DB transaction is open in the job or SyncSubscription | holds by reading. The new Cancel and CheckoutGuarded Stripe calls also run under session locks with no transaction open |
| 02 | Built-in user subscribable writes no users column other than stripe_customer_id | holds. ResolveMany only reads (TestUserSubscribable) |
| 03, 06, 09 | No test calls the network; test-only secrets | holds per the fake (BackendOverride); the new subtests use the same fake. Not audited line by line. Flagged |
| 06, 09 | Gate never green on a skip or missing Docker | holds: PHASE181_REQUIRE_POSTGRES=1, 0 skip lines |
| 09, quick tasks | Nothing pushed or tagged without the user's reply | holds: sibling repos are ahead of origin (pgsub 4, pgstripe 2), and no new tags exist. Hence the human release item |
| 08 | Another session's uncommitted edits never staged | the working tree still holds other sessions' STATE.md and state.json edits, untouched. Flagged |
Decision Coverage
All trackable CONTEXT.md decisions are honored by shipped artifacts (24/24).
Human Verification Required
UAT evidence (Step 8b): 18.1-UAT.md is complete, recorded at 2026-10-16T15:34:36Z. verification.uat-evidence reports changed_since_uat: [] for the covered framework files. The sibling repos' last commits are also older than the record: pgsub 17:22+02, pgstripe 17:07+02, layer 13:35+02. Their working trees are clean. Rows 4, 5, 6, 7 and 8 passed on that code and settle every human item of the previous report (see human_verified). Rows 2 and 3 are skipped duplicates of 6 and 7. No row needs a retest.
One new item remains:
- Release go-ahead. Tag the framework v0.2.2, bump and tag pgsub, then pgstripe, and push all three. Until then the tagged pgsub v0.1.0 does not boot in a
summer buildapp, and pgsub main cannot be required by a consumer. This needs the user's go-ahead under the project rule. If the user defers it, record the reason (for example "released together with the Horoskopia port").
Gaps Summary
No success criterion and no plan must-have failed. The two quick tasks did what they claim:
- WR-01: Cancel is serialised with the webhook job.
- WR-02:
canceledfires once. - WR-03: plan syncs are serialised, and the product create is idempotent.
- WR-04: open checkout sessions are expired.
- WR-05: non-sync currencies stay sellable.
- WR-06: a stale price is refused with 422.
- WR-07:
incompleteno longer locks a user out. - G-18.1-7: a portal
cancel_atshows as will-cancel. - G-18.1-4: the admin shows the subscriber's e-mail and a record title.
- G-18.1-8: pgsub boots in a summer-built app.
Each fix has a named test that passed in this run, and the live UAT passed on the same code.
The status is human_needed only because the fixes are not released. The tagged plugins still carry the boot blocker, and pgsub main depends on framework hooks that no tag has. Releasing needs the user's go-ahead.
Verified: 2026-10-16T15:45:06Z Verifier: Claude (msd-verifier)