Skip to content

feat(resolve): mosh.<tld> opens the Pit to register names under that TLD - #51

Merged
ralyodio merged 1 commit into
mainfrom
feat-mosh-console
Jul 31, 2026
Merged

feat(resolve): mosh.<tld> opens the Pit to register names under that TLD#51
ralyodio merged 1 commit into
mainfrom
feat-mosh-console

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Typing mosh.eggs takes you to the console where .eggs is claimed and names under it are registered, instead of trying to resolve mosh.eggs as a name.

What changed

  • consoleUrlFor(hostname, consoleBase?) — maps mosh.<tld>https://app.moshcode.sh/pit?tld=<tld>. Returns null for anything that isn't a mosh.<tld> name.
  • decideResolution() gains a third outcome, 'register', carrying that URL in decision.url.
  • DEFAULT_CONSOLE_BASE is separate from DEFAULT_REGISTRY_BASE — the Pit is the human-facing console, pit.moshcode.sh is 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 .eggs and every name.eggs under it is yours") but it doesn't document a per-TLD URL syntax. ?tld=eggs degrades gracefully: a console that doesn't understand it still lands the user on a working registry page, where /pit/eggs would 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.org and mosh.com are real clearnet domains — mosh.org is the mobile-shell project. Swallowing them to show a registry page is precisely the hijack this module's default mode exists to prevent, so:

mode clearnet answers result
clearnet (default) yes clearnet — untouched
clearnet (default) no the Pit
moshpit either the Pit (user opted into the override)

The console label is reserved, so it also beats a registered name — otherwise whoever claims .eggs could register mosh.eggs and own the page people use to check who owns .eggs.

Scope

Pure policy plus tests, matching how the rest of moshpit-resolve.ts is 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 0
  • pnpm -r test — exit 0, 22 packages
  • pnpm lint — exit 0

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit c25c1a0 into main Jul 31, 2026
7 checks passed
@ralyodio ralyodio mentioned this pull request Jul 31, 2026
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>
@ralyodio
ralyodio deleted the feat-mosh-console branch August 4, 2026 04:29
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