feat(moshpit): TLD aliases with per-name exemptions - #71
Merged
Conversation
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
ralyodio
force-pushed
the
feat/pit-bootstrap
branch
from
July 31, 2026 02:00
644b56c to
bb190db
Compare
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
force-pushed
the
feat/moshpit-tld-aliases
branch
from
July 31, 2026 02:01
f769e7f to
fd7cffb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Reddit-for-DNS bit: point one TLD at another you own, and hold individual names back
from the redirect.
Stacked on #70 (which is stacked on #69). Retargets to
masteras those merge.API
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
parseMoshpitNamerejectsa.b.crather than guessing which two parts were meant. Thenamespace 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 --noEmitcleannext buildsucceeds, all five routes in the tablebun test tests/— 46 pass, 0 fail🤖 Generated with Claude Code