Closes the other half of I31 ("Direct ASSN v2 and Play RTDN in Mint") —
Apple App Store Server Notifications v2 was already built; this adds the
matching direct (no-aggregator) integration for Google Play.
New ProviderId::PlayStore in mint-payments, mirroring the AppStore adapter's
shape but necessarily async: an RTDN notification carries neither a price
nor the Mint account to credit, so a mintable delivery is re-confirmed
against the Play Developer API (OAuth2 service-account JWT, RS256 via the
already-vendored `ring` crate — no new dependency) before it mints.
Key correctness decisions, documented in the module:
- deposit_ref is keyed on the Developer API's own order id, not the purchase
token (which Play keeps stable across a subscription's own renewals) — a
renewal mints again instead of idempotently replaying the original
purchase, covered by a dedicated regression test.
- USD price comes from a static PLAYSTORE_PRICES_JSON catalog: neither the
v3 ProductPurchase nor SubscriptionPurchaseV2 Developer API resource
carries a price field.
- voidedPurchaseNotification (Google's refund signal) reverses by its own
orderId with no second network call; REVOKED/CANCELED on the primary
notification types are deliberately Ignored in favor of that cleaner,
orderId-bearing signal.
- the Pub/Sub push auth token travels as a `?token=` query parameter (push
subscriptions can't attach a custom static header); mint-server's
deposits.rs bridges it into a synthetic header so mint-payments itself
stays axum/query-string-free.
18 new unit tests in playstore.rs (the OAuth2 path signs with a real
synthetic RSA test key, not a mocked signer) plus 4 in mint-server's
deposits.rs for the query->header bridge. Full existing suites re-run green
with zero regressions: mint-payments 112+13+6+6+3, mint-server
22+13+14+3+3+6+8. cargo clippy --all-targets: zero warnings in any touched
file.
Also closes the gap in scripts/parity/recount.mjs: new wave-s.mjs moves I31
MISSING -> DONE on real evidence; infra now 30/10/4 (was 29/10/5),
--self-test still exits 0, recount.test.mjs extended with a Wave S test.
Not deployed: PLAYSTORE_SERVICE_ACCOUNT_KEY / CLIENT_EMAIL / PACKAGE_NAME /
WEBHOOK_TOKEN / PRICES_JSON all need a real Google Play Console service
account and a Pub/Sub push subscription, which is an owner-only step.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 2026-10-05 static parity recount still called A4 (native SDKs),
A22 (warehouse destinations) and A23 (CDP destinations/transforms)
PARTIAL, but the code that closes them landed on main the next day
(fba4dba7, 8cd06952, 0e611a19, b4612a4f, 41653aeb, aa25b536) and was
never folded back in. Add scripts/parity/wave-r.mjs on top of wave-q.mjs
(recount.mjs now merges waves, later wins) and regenerate
docs/parity/recount-2026-10-15.txt: analytics moves from 24/6/7 to
27/3/7 DONE/PARTIAL/MISSING. Verified before writing any of it: full
pnpm run test:all in apps/product-analytics (220 tests, 216 pass, 0
fail, 4 skipped for an uncached Chromium) and `swift test` in
packages/analytics-swift (6/6).
Add apps/product-analytics/docs/MIXPANEL-PARITY-CHECKLIST.md and
test/qy/mixpanel-compat.test.ts, which points the real `mixpanel` npm
client (not a mock) at this service. Findings: /track and /engage
($set/$set_once/$unset) are Mixpanel-compatible today; /groups is not
(the real SDK's $group_key/$group_id don't match this service's
$group_type/$group_key), the $add/$append/$union/$remove people ops are
accepted but silently dropped, there's no /import route, and a
non-verbose Mixpanel client treats this service's JSON response as a
failure. None of that ingestion-routing code is touched here; it's
scoped to docs and tests only.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI ran cargo for rago, mint and some relay crates only, without a database,
and no Node suite at all: the live money-path suites (rago pg-tests, mint's
ignored live tests, vend, abacus, turnstile, ledgerline, passport, relay
storage/traces, game-economy) never ran, nor did the console, product
analytics, insights-edge, the SDK packages or the Scribase bridge contract.
- scripts/ci/scratch-postgres.sh starts a throwaway cluster per job from the
runner's initdb (skips cleanly when Postgres is not installed) and exports
DATABASE_URL (plus TURNSTILE_/RELAY_TEST_DATABASE_URL); a stop script
removes it.
- The Rust matrix adds ledgerline, vend, abacus, turnstile, toolgate,
game-economy, agent-runtime, context-passport and relay-storage-postgres /
relay-traces; rago runs with pg-tests; mint runs its live suites.
- A node job runs the console, product analytics test:all, insights-edge, the
SDK packages (borrowing product analytics' pinned SDK install) and the
bridge contract.
- vend's Cargo.lock was stale (mint-payments gained ring), so
'cargo test --locked' failed for vend; refreshed.
Verified locally against a scratch database: vend 136, abacus 95, turnstile
92, toolgate 114, context-passport 58 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The QY1.0 recount printed only the static 2026-09-30 record, so the rows QY1.1
to QY1.5 closed still showed as open. scripts/parity/wave-q.mjs lists each
verified change with the test file that proves it; the recount applies a
change only when that file exists and keeps --baseline for the 26/12/6 and
20/9/8 record. Infra is now 29/10/5 and analytics 24/6/7. I6 stays PARTIAL
until the owner-run real-domain proof.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Static record of PARITY-RECOUNT-2026-09-30 section 5: I1-I44, A1-A26 and L1-L12.
recount.mjs prints DONE, PARTIAL or MISSING per row and reproduces infra 26/12/6
and analytics 20/9/8 (L11 n/a, not counted). G12 marked done in LIMRUN-GAPS.md.
Skipped: IB/CAPACITY.md and IB/stacks/scribase-etl are not in this worktree
(infra-box is a different repo; the etl stack also waits on QS1.3).
Skipped: GTM/policy denylist byte-equality was not verified, so policy files
were not edited.
Railyard side of PY1.5 (dispatch 5.3). Acceptance:
1. tests/contract/consumers/contract.json is the contract PM1.5, PR1.5 and
the Scribase carve-out test against: env names (RELAY_URL, RELAY_KEY,
RAGO_URL, RAGO_API_KEY, MINT_URL, MINT_API_KEY, RAILYARD_LIVE), the
RAILYARD_LIVE switch (default 0), every product's meters and one sample
event per meter with the <product>:<meter>:<source id> idempotency key.
2. apps/rago/seeds/portfolio/{scribase,menivor,rally}-portfolio.json define
exactly those meters (valid Rago aggregations, field names where summed)
under $0 mirror plans; consumers.test.ts checks seeds against the contract.
4. tools/reconcile-portfolio/reconcile.mjs compares each product's own counts
with Rago's totals per customer, meter and month; on the fixtures the
difference is 0, and dropped, extra or malformed rows are named (exit 1/2).
5. Nothing switches live in code: docs/CONSUMERS.md gains the Wave P switch
table. scripts/relay/provision-product-keys.mjs prints names and the box
steps only (no value is generated, read or printed).
3 (Mint stack, 128 MiB, /metrics scraped): infra-box stacks/mint; Mint's
/metrics handler exists since RY-MT1.
Not in this commit: Mint outbound event webhooks and the paid-event mirror
(see the lane report).
Tests: consumers 3/3, reconcile 2/2, provision 1/1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/dodo/portfolio-addon-products.mjs creates the Scribase Portfolio
add-on subscription product (price read from Scribase config/plans.json
addons.portfolio.priceUsd, $10 a month today) and the five Scribase meters of
the Railyard consumer contract (5.3). Dry run by default; --apply talks to the
Dodo test host; the live run needs --live and SCRIBASE_DODO_LIVE=1 (owner item
Y1). Idempotent (product matched by metadata or name, meters by event_name);
prints SCRIBASE_DODO_ADDON_PORTFOLIO_PRODUCT_ID=<id>; never prints the key.
Tests: scripts/dodo/test 5/5 (fake Dodo: created once, reused on re-run, live
refused without both switches, CLI refuses without --plans).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>