HIGH — the reversal clamp no longer erases the alerting/audit trail: a
reversal that applies nothing (already fully reversed, or clamped to zero)
now records a 'clamped_reversal' adjustment row with zero applied amount
and the provider-claimed cumulative, and partial clamps store the
provider-claimed cumulative on the refund row, so provider-side
over-refunds are queryable instead of silently absorbed (migration 0024
extends the adjustment_type/amount CHECKs accordingly).
MEDIUM — persistProviderCheckoutSession now throws on a zero-row UPDATE
instead of returning nulls, so a missing checkout intent fails the request
rather than handing the buyer an unsettleable provider session.
LOW — launch-notify origin check uses the configured appUrl (same policy
as checkout); repository URLs are stored WHATWG-normalized (parsed.href);
the launch_notifications email CHECK now mirrors the application regex.
Integration: +1 over-refund audit scenario; refund-after-dispute now
asserts the no-op refund id is recorded (8/8 green vs real Postgres 16).
While CHECKOUT_ENABLED=false (payment provider approval pending) a founder
who completed the bid form hit a dead-end 503. Now the form swaps in an
'email me when checkout opens' capture:
- launch_notifications table (migration 0025): one row per email, DB-level
CHECK constraints on normalization/source, first attribution preserved
via ON CONFLICT DO NOTHING
- POST /api/launch-notify: origin + content-type checks, edge and DB rate
limits, strict validation (lib/launch-notify), identical response for
new and duplicate emails so the list cannot be enumerated
- bid-board: checkout_disabled response renders the notify capture with
the intended repository attached, instead of a plain error
- 5 unit tests + 1 Postgres integration scenario
- Send stable per-checkout Idempotency-Key headers to Creem and Dodo so
concurrent retries converge on one payable provider session
- State-guarded provider-session persistence: a late provider response can
no longer clobber a checkout a webhook already settled/reversed
- Key refund/dispute idempotency on the provider adjustment id (not the
webhook event id) with ON CONFLICT claim, preventing double-subtraction
when the same refund replays under a new event id
- Surface a conflicting second capture on an already-fulfilled checkout as
an incident instead of silently swallowing it
- Clamp reversals to the settled contribution so post-dispute refunds are
zero-delta no-ops instead of jamming the webhook forever
- Unique indexes: (provider, provider_adjustment_id) on payment_adjustments,
partial (provider, provider_transaction_id) on bids (migration 0024)
- 4 new unit tests + 5 new Postgres integration scenarios (all green vs
real Postgres 16)
publicHostname() applied the IPv6 ULA (fc00::/7) and link-local
(fe80::/10) prefix checks to every hostname, so legitimate public
domains whose names merely begin with fc/fd/fe80 (fd.io, fdroid.org,
fda.gov, fcbarcelona.com) were wrongly rejected at destination
normalization. Guard those prefix checks with a colon test so they
apply only to actual IPv6 literals; private IPv6 hosts stay rejected.
Reframe the paid product as upvote tokens at a fixed $5.00 each (amountCents =
quantity * 500) so pricing is unmistakably visible for Creem review.
- Homepage hero now shows a prominent "$5 per upvote" pricing callout and
reframed money-boundary copy; visible regardless of CHECKOUT_ENABLED.
- Replace the placement-budget dollar input with an upvote quantity selector:
preset buttons (1/5/20/100/200 = $5/$25/$100/$500/$1,000), custom quantity,
and a live total = quantity x $5. Enforces min 1, max 10,000 upvotes ($50k).
- Fix JSON-LD offer: AggregateOffer, unit price 5.00 USD (was price "0").
- Reframe bid/placement/budget copy to upvote-token framing on the homepage,
/bids pricing page, and Terms; error messages updated in lib/market.ts.
- Add transparent inclusive platform fee: PLATFORM_FEE_BPS=2000 (+ platformFeeCents
helper) in lib/market.ts, disclosed as "each $5 upvote includes a 20% bidstage
platform fee" in pricing UI and Terms. Bidstage stays sole seller; no payouts.
tsc --noEmit clean; next build compiled successfully.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>