Skip to content

feat(moshpit): TLD aliases with per-name exemptions - #71

Merged
ralyodio merged 1 commit into
masterfrom
feat/moshpit-tld-aliases
Jul 31, 2026
Merged

feat(moshpit): TLD aliases with per-name exemptions#71
ralyodio merged 1 commit into
masterfrom
feat/moshpit-tld-aliases

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

The Reddit-for-DNS bit: point one TLD at another you own, and hold individual names back
from the redirect.

.agentic          -> .agent            so foo.agentic  -> foo.agent
.financewizards   -> .financialadvice  so anyone.financewizards -> anyone.financialadvice
tonyrobbins.financewizards             ...except this one, which stays put

Stacked on #70 (which is stacked on #69). Retargets to master as those merge.

API

PUT    /api/moshpit/tlds/:tld/alias   { to }      point it
DELETE /api/moshpit/tlds/:tld/alias               stop pointing it
GET    /api/moshpit/tlds/:tld/exempt              names held back
POST   /api/moshpit/tlds/:tld/exempt  { label }   hold one back
DELETE /api/moshpit/tlds/:tld/exempt  { label }   let it follow again
GET    /api/moshpit/resolve?name=foo.agentic      the resolver lookup

Rules, and why

An alias requires owning both TLDs. Otherwise this becomes a land-grab — claim .agent,
absorb forty related words without registering any — and first-come-first-served stops
meaning anything.

Chains are rejected, not followed. A TLD is either a target or an alias, never both.
Resolution is a single hop and a cycle is impossible to construct, rather than something to
detect at read time forever. Checked in both directions: can't alias to something already
aliased, can't alias something that's already a target.

The label carries across. An alias redirects the namespace, not the name — everything
under it keeps its identity on the other side.

Exemptions are evaluated at resolve time, not baked in when the alias is set, so they
survive the alias being repointed. They can also be created before any alias exists — you
should be able to carve out what you're keeping before redirecting everyone, not redirect
first and repair after.

One parser detail worth flagging

parseMoshpitName rejects a.b.c rather than guessing which two parts were meant. The
namespace is one level deep, and a parser that guesses is a resolver that sends people
somewhere they never asked for. It reuses the TLD label rule instead of keeping a second copy
that can drift.

Verified

  • tsc --noEmit clean
  • next build succeeds, all five routes in the table
  • bun test tests/46 pass, 0 fail

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio force-pushed the feat/pit-bootstrap branch from 644b56c to bb190db Compare July 31, 2026 02:00
Lets an operator point one TLD at another they own -- .agentic -> .agent, so
foo.agentic resolves to foo.agent -- and hold individual names back from that
redirect: .financewizards -> .financialadvice as a rule, but
tonyrobbins.financewizards stays where it is.

  PUT    /api/moshpit/tlds/:tld/alias   { to }      point it
  DELETE /api/moshpit/tlds/:tld/alias               stop pointing it
  GET    /api/moshpit/tlds/:tld/exempt              names held back
  POST   /api/moshpit/tlds/:tld/exempt  { label }   hold one back
  DELETE /api/moshpit/tlds/:tld/exempt  { label }   let it follow again
  GET    /api/moshpit/resolve?name=foo.agentic      the resolver lookup

An alias requires owning BOTH TLDs. Aliasing a name you do not own would make
this a land-grab -- claim .agent, absorb forty related words without
registering any -- and first-come-first-served would stop meaning anything.

Chains are rejected rather than followed: a TLD is either a target or an alias,
never both. That makes resolution a single hop and makes a cycle impossible to
construct, rather than something to detect at read time forever after. Both
directions are checked -- you cannot alias to something already aliased, and
you cannot alias something that is already a target.

The label is carried across, not dropped. An alias redirects the namespace, not
the name, so everything under it keeps its own identity on the other side.

Exemptions are evaluated at resolve time rather than baked in when the alias is
set, so they survive the alias being repointed later. They can also be created
before any alias exists -- an operator should be able to carve out the names
they mean to keep BEFORE redirecting everyone, instead of redirecting first and
repairing afterwards.

parseMoshpitName rejects "a.b.c" instead of guessing which two parts were
meant: the namespace is one level deep, and a parser that guesses is a resolver
that sends people somewhere they never asked for. It reuses the TLD label rule
rather than keeping a second copy that can drift.

Verified: tsc --noEmit clean, next build succeeds with all five routes in the
table, 46 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio force-pushed the feat/moshpit-tld-aliases branch from f769e7f to fd7cffb Compare July 31, 2026 02:01
@ralyodio
ralyodio changed the base branch from feat/pit-bootstrap to master July 31, 2026 02:01
@ralyodio
ralyodio merged commit a08d22e into master Jul 31, 2026
4 checks passed
@ralyodio
ralyodio deleted the feat/moshpit-tld-aliases branch July 31, 2026 02:02
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