Skip to content

feat(pit): the operator sets the price, not the form - #170

Merged
ralyodio merged 1 commit into
mainfrom
feat/seller-sets-price
Aug 1, 2026
Merged

feat(pit): the operator sets the price, not the form#170
ralyodio merged 1 commit into
mainfrom
feat/seller-sets-price

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

$2 a name and $5 an ending are defaults, not ceilings. The server already knew this — setTldPrice deliberately does not enforce MAX_CHILD_PRICE_USD, which is why .love sits at $10,000 in prod today.

The claim form did not know it. It shipped max="2" on the price input, so the UI refused what the API would happily accept. That read as policy while being a typo's worth of markup.

What changed

  • The claim form no longer caps the price at the default. value="$2" stays — it's still the right starting point.
  • The remaining server bound was $1,000,000, low enough to be a policy decision nobody actually made. It's now MAX_LISTING_PRICE_USD at $1e9, documented as what it is: an overflow guard keeping Infinity, NaN and 1e300 out of a column that later gets charged. Not a price ceiling.
  • MAX_CHILD_PRICE_USD is untouched — it's part of the vendored namespace rules that must match the published @moshcoder/moshpit-name in behaviour (there's a drift test), and it's still the right default. It just isn't a limit.

Testing

  • Updated moshpit-sales.test.mjs: the old test asserted 5_000_000 was refused, which is now legal — it asserts 5_000_000_000 instead, so the guard is still pinned.
  • New test: an operator can ask $1,000,000 for a name and a buyer gets quoted exactly that.
  • apps/pwa: 324 pass, 0 fail. Repo root: 763 pass, 0 fail, 2 skipped.

Not in this PR

Selling or auctioning the ending itself (/buy, /sell, /bid) is a separate piece of work — this only covers what names under an ending cost.

🤖 Generated with Claude Code

$2 a name and $5 an ending are defaults, not ceilings. The server already
knew that -- setTldPrice deliberately does not enforce MAX_CHILD_PRICE_USD,
which is why .love sits at $10,000 today. The claim form did not: it shipped
max="2" on the price input, so the UI refused what the API would have
accepted and looked like policy while being a typo's worth of markup.

The remaining bound was $1,000,000, low enough to be a policy decision nobody
made. It is now MAX_LISTING_PRICE_USD, a named overflow guard at $1e9 whose
only job is keeping Infinity, NaN and 1e300 out of a column that later gets
charged.

MAX_CHILD_PRICE_USD is untouched: it is part of the vendored namespace rules
that must match the published package byte for byte in behaviour, and it is
still the right default. It just is not a limit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio marked this pull request as ready for review August 1, 2026 03:15
@ralyodio
ralyodio merged commit 990d173 into main Aug 1, 2026
3 checks passed
@ralyodio
ralyodio deleted the feat/seller-sets-price branch August 1, 2026 03:15
@ralyodio ralyodio mentioned this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant