feat(resolve): mosh.<tld> opens the Pit to register names under that TLD - #51
Merged
Conversation
Typing `mosh.eggs` should take you to the console where `.eggs` is claimed and names under it are registered, rather than trying to resolve `mosh.eggs` as a name. - consoleUrlFor() maps a `mosh.<tld>` hostname to app.moshcode.sh/pit?tld=<tld>. The TLD rides in a query param, not a path segment: a console that doesn't understand `?tld=` still lands on a working page, where an unknown path segment would 404. - decideResolution() gains a third outcome, 'register', carrying that URL. The console label is reserved, so it beats a registered name — otherwise whoever claims `.eggs` could register `mosh.eggs` and own the page people use to check who owns `.eggs`. It obeys the SAME clearnet precedence as any other Moshpit answer instead of taking an exemption: `mosh.org` and `mosh.com` are real clearnet domains, and swallowing them to show a registry page is exactly the hijack the default mode exists to prevent. So in clearnet mode it only fires where DNS came up empty; in moshpit mode the user has opted into the override. Pure policy + tests, matching the rest of the module — nothing intercepts navigation yet, so this changes no browsing behaviour on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
Merged
ralyodio
added a commit
that referenced
this pull request
Jul 31, 2026
Ships Moshpit name resolution actually working in the browser (#52): the settings were written to storage and never read, and the policy module had no callers, so no registry setting could make california.oranges resolve. Unclaimed and unpointed names now park instead of dead-ending on a DNS error. Also mosh.<tld> opening the Pit for that TLD (#51). Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Typing
mosh.eggstakes you to the console where.eggsis claimed and names under it are registered, instead of trying to resolvemosh.eggsas a name.What changed
consoleUrlFor(hostname, consoleBase?)— mapsmosh.<tld>→https://app.moshcode.sh/pit?tld=<tld>. Returns null for anything that isn't amosh.<tld>name.decideResolution()gains a third outcome,'register', carrying that URL indecision.url.DEFAULT_CONSOLE_BASEis separate fromDEFAULT_REGISTRY_BASE— the Pit is the human-facing console,pit.moshcode.shis the resolver API the browser talks to. Overridable alongside a self-hosted registry.Two design calls worth reviewing
The TLD rides in a query param, not a path segment. I checked
app.moshcode.sh/pit— it's the registry page ("Hold.eggsand everyname.eggsunder it is yours") but it doesn't document a per-TLD URL syntax.?tld=eggsdegrades gracefully: a console that doesn't understand it still lands the user on a working registry page, where/pit/eggswould 404. If the Pit has a real per-TLD route, point me at it and I'll switch.It does NOT get an exemption from clearnet precedence.
mosh.organdmosh.comare real clearnet domains —mosh.orgis the mobile-shell project. Swallowing them to show a registry page is precisely the hijack this module's default mode exists to prevent, so:clearnet(default)clearnet(default)moshpitThe console label is reserved, so it also beats a registered name — otherwise whoever claims
.eggscould registermosh.eggsand own the page people use to check who owns.eggs.Scope
Pure policy plus tests, matching how the rest of
moshpit-resolve.tsis staged. Nothing intercepts navigation yet — the module still has no callers — so this changes no browsing behaviour on its own. Wiring it into the address bar is a separate piece of work.Verification
apps/desktop— 24 tests pass (11 new)pnpm -r build— exit 0pnpm -r test— exit 0, 22 packagespnpm lint— exit 0🤖 Generated with Claude Code