MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-3884

301 app.motir.co/{explore,docs,legal}/* and / to motir.co — plus the in-code sweep of every absolute-URL reader

Blocked
Description

Type: code · Executor: coding_agent · Repo: motir-core · ONE PR.

The four public paths now answer on the public site. This card makes their OLD addresses redirect, and sweeps the places in this repository that still print the old one.

1 — The redirects

Permanent redirects on the application host, path and query preserved, for:

  • / → the public site root
  • /explore and /explore/topic/*, including the ?rank= variants the sitemap publishes
  • /docs and every surface beneath it
  • /legal and every document beneath it

proxy.ts already runs on this application with a matcher enumerated from the filesystem by tests/navigation/proxy-matcher.test.ts, so the redirect belongs there rather than in a second mechanism — and its matcher gains these segments through the same filesystem-derived guard, never as a hand-maintained list. The /admin exclusion that test asserts as deliberate stays exactly as it is.

/p/* is NOT redirected by this card. Those pages are still served here.

2 — The MIGRATION sweep: every caller of the old address

The card's verb is move, so the referrers are call sites rather than cards. grep this repository for the literal app.motir.co and give every hit one of two dispositions — in this card's scope, or a named sibling card. There is no third option, and "the rest later" without a card is the orphan. The hits on origin/main today fall into groups, and each needs a verdict written into the PR:

  • Content that a reader followscontent/legal/*.md (privacy, terms, DPA, cookies, subprocessors, acceptable-use) and docs/*.md. A legal document naming an address that redirects is not wrong, but it is now imprecise about where the service is provided; decide per document and say why.
  • Tests that assert the addresstests/baseUrl.test.ts, tests/hosting/appUrlSeam.test.ts, tests/rootMetadata.test.ts, tests/emailDeliveryRecord.test.ts, tests/brand/emailBrandHeader.test.tsx, the API-docs and OpenAPI registry tests. These encode the CURRENT contract and must move with it, not be deleted.
  • Design notesdesign/brand/design-notes.md, design/mcp-server/design-notes.md.
  • Decision recordsdocs/decisions/*.md. These are HISTORY and are not rewritten; where one states a fact that is no longer true, the amendment the ADR card wrote is what a reader is pointed at.

And the abandoned path is itself a deliverable. After the redirects land, ask of each moved route whether anything still SERVES it here — a stale route file, a leftover (public) entry — and delete it in this PR rather than leaving a live invitation to re-adopt.

3 — What is NOT in this card, and who owns it

The values that live outside this repository move on the cutover card: the MOTIR_BASE_URL secret, Google's OAuth redirect URIs, Better-Auth trustedOrigins as deployed, the Search Console sitemap submission, and NEXT_PUBLIC_MOTIR_APP_ORIGIN in motir-marketing. Those are console and platform actions, not a diff — and putting them here would straddle two repositories and a dashboard.

Acceptance criteria

  • Every path in §1 returns 308/301 with the destination on the public origin, path and query intact — one test per path family, including a topic page and a ?rank= variant.
  • /p/* returns 200 on the application host, asserted explicitly so the next story's boundary is protected by a test rather than by intent.
  • proxy.ts's matcher covers the redirected segments, and tests/navigation/proxy-matcher.test.ts still derives its expectations from app/'s filesystem — no hand-listed segment is introduced, and /admin still has none.
  • The PR body carries the full grep -rn 'app.motir.co' result with a per-hit disposition, and every hit is either changed here or names the card that owns it.
  • No route that was moved is still served by this application; the sweep for leftovers is recorded.
  • Signed-in application journeys are unaffected: /home, /settings and the item surfaces do not redirect.
  • ≥90% coverage on the files this PR touches.

Context refs

  • motir-core/proxy.ts · tests/navigation/proxy-matcher.test.ts — the mechanism and its guard
  • motir-core/lib/baseUrl.ts · lib/publicProjects/urls.ts — the origins, split by the robots/sitemap card
  • motir-core/content/legal/*.md · docs/*.md · design/*/design-notes.md · docs/decisions/*.md — the sweep's population
  • motir-core/tests/{baseUrl,rootMetadata,emailDeliveryRecord}.test.ts · tests/hosting/appUrlSeam.test.ts — the assertions that encode the old contract
  • The cutover card — owns every value outside this repository