Vitest gate (motir-core) — the public read contract, the anonymous posture per route, and both arms of the origin seam
Opened by Zhu Yue ·
Type: test · Executor: coding_agent · Repo: motir-core · ONE PR. The story's per-repo coverage + integration gate, run after its code cards merge because it measures their real, merged output.
⚠️ RE-SCOPED 2026-08-30 — and the body you may have read before this was the WRONG one
This card's title was updated to the scope below while its description was left describing the old one — "coverage floor over the moved surface, the host/origin seams, and a guard that every app/(public) segment has a declared host". That happened because a plan correction replaced a proposal's whole patch and silently dropped the new body (the same failure family as MOTIR-3934). The body is now rewritten to match the title. There is no moved surface here and no host to declare: motir-core serves no public pages, and app/(public) is deleted by MOTIR-3951.
The gate is over what this story actually ships: a public read contract, and the origin this application EMITS.
What it covers
-
The contract's shape. The subject route's response asserted against the fields the public project page renders, and the enumerated-from-the-filesystem guard that every
app/api/public/*route is versioned and documented — a route added later must not escape by being forgotten. MOTIR-3946 ships that guard; this card is where its adequacy is asserted. -
The anonymous posture, per route, derived not remembered. Every
app/api/public/*READ answers with no session, over a route set enumerated from the filesystem so it cannot drift.followis the one deliberate exception and is asserted as an exception rather than skipped — the idiomtests/navigation/proxy-matcher.test.tsandtests/seo/robots.test.tsboth use, and the onetests/api/two-factor-api-gate.test.tsalready applies to this directory. -
The origin seam, as MOTIR-3881 re-scoped it — read that card first. What stood here asserted "an unset public-site origin resolves to the APPLICATION origin … the deployed state until the cutover", and both halves are stale:
motir.coalready resolves tomotir-marketing, so there is no unconfigured production window to protect, and nearly every reader ofpublicSiteOrigin()lives in the pages being deleted. What survives, and what this card asserts:- exactly one module reads each origin variable (the tree grep, in the
appUrlSeamshape); - the follow-digest email's links resolve to the public site — the only shipped consumer left, and the only place this application puts a URL somewhere it cannot take back;
- an unset public-site origin has a stated, tested behaviour that never puts
localhostinto an email that leaves the building; app/sitemap.tslists nothing served by another host.
- exactly one module reads each origin variable (the tree grep, in the
-
The coverage floor on every file this story's pull requests touch, measured by CI rather than locally.
⚠️ What this card does NOT cover, and who does
The public journey and its acceptance video are not here. That walk happens on motir.co, rendered by another repository; MOTIR-3886 moved with it. A Playwright spec in motir-core could only walk the half that remains, which would be a receipt for the wrong thing.
The deletion is not here either. MOTIR-3951 removes app/(public) and carries its own assertions — the route manifest, the service-method caller sweep, and the /follow/* disposition.
Acceptance criteria
- Every
app/api/public/*read is asserted to answer with no session, over a route set derived from the filesystem;follow's 401 is asserted as the deliberate exception. - The subject route's response shape is asserted against the fields the public project page renders, so the contract cannot drift from its specification.
- The follow digest's rendered links resolve to the public site, and the unset-origin arm is exercised with a production-shaped configuration — the case a locally-configured developer never hits.
- The single-reader rule is asserted by a tree grep, in the existing
appUrlSeamshape. app/sitemap.tsis asserted to list nothing served by another host.- ≥90% branch/function/line coverage on every file this story's pull requests touch, measured by CI.
- No assertion in this card depends on a page this repository is about to stop serving — if one does, it belongs to MOTIR-3951 or to the rendering story, not here.
Context refs
motir-core/app/api/public/— the surface under testmotir-core/lib/services/publicFollowDigestService.ts— the surviving origin consumermotir-core/tests/hosting/appUrlSeam.test.ts— the single-reader idiommotir-core/tests/navigation/proxy-matcher.test.ts·tests/seo/robots.test.ts·tests/api/two-factor-api-gate.test.ts— the derive-from-the-filesystem idiom this card's guards followmotir-core/docs/decisions/public-surface-hosts.md— the arrangement being gated
Discussion
No comments yet.
Adding to this discussion signs you in on app.motir.co and brings you back to this request.