Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-4223Blocked

Vitest gate (motir-core) — the address store and services, the certificates adapter and job, the host-resolution contract, and the widened CORS / return-target

The story-level Vitest gate for motir-core — a coverage floor over the ten code cards' merged surface, the seams between them that their own units mock away, and the architecture guards coverage cannot see. It runs LAST among the motir-core cards (blocked_by every one of them) because it measures what actually merged; it does not pre-enumerate what those cards should have tested — "already covered by the per-subtask floor" is the expected normal it resolves at run time.

What it does at run time

  1. Coverage floorvitest --coverage over the changed surface: lib/publicAddresses/**, lib/repositories/publicAddressRepository.ts, lib/services/publicSubdomainService.ts · customDomainService.ts · publicAddressesService.ts · the entitlementsService addition, lib/jobs/definitions/publicAddressCertificateRefresh.ts, app/api/public/hosts/**, app/api/workspaces/[workspaceId]/public-subdomain/**, app/api/projects/[key]/public-addresses/**, lib/publicProjects/cors.ts · returnTarget.ts, and the two pane components. Wherever a file is under the project's per-file floor (≥90 % — CLAUDE.md § coverage), write the missing unit / branch tests.
  2. Integration seams, real Postgres — the writer → consumer paths the units mock: (a) claim a subdomain through the service → GET /api/public/hosts/{host} resolves it, rename it → the old host resolves as an alias with redirectTo; (b) add a custom domain → verify with a stubbed resolver and port → the status job (with the port stubbed to issued) → the lifecycle's list shows issuedmakePrimary → the subject DTO's addresses.primary is that host and GET /api/public/projects reports its primaryHost; (c) the entitlement cap inside the lifecycle's transaction under real concurrency; (d) CORS and the hand-off return target for a host that the store says is live, and for one it says is an alias.
  3. Architecture / contract guards — the Fly-adapter dependency guard and the tenant-domain single-reader guard exist (assert they RUN in CI, not merely exist); pg_policies for public_address; cross-tenant isolation: workspace A's admin cannot read or write workspace B's subdomain or a project's addresses in B through any of the new routes (404, no existence leak); the public host route answers identically with and without a session cookie (anonymous by construction); the four public-surface guard tests cover the new operation with no exemption; every Record<PublicAddressStatus, …> and Record<EntitlementKind, …> in the tree is total (typecheck is the proof — assert the build ran).

Acceptance criteria

  • Every file in the changed surface meets the per-file floor after this card, with the coverage report attached to the PR.
  • Seams (a)–(d) exist as real-Postgres tests driving real service and route code with only the platform port and the DNS resolver stubbed; (c) is genuinely concurrent.
  • The cross-tenant isolation test proves a 404 for every new route addressed at another workspace's or project's resources, and the anonymous-posture assertion holds for the host route.
  • No production code changes except test helpers; no file outside motir-core is touched.

Context refs