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 · Roadmap

MOTIR-4036Done

Derived-not-remembered totality guard — enumerate the gated public surface from the filesystem

Opened by Zhu Yue ·

A test that ENUMERATES the gated public surface from the filesystem, so a route or affordance added later cannot escape the gate by being forgotten — the derived-not-remembered idiom of tests/navigation/proxy-matcher.test.ts and tests/seo/robots.test.ts.

Approach: at test time, walk the app/api/public/ directory and collect every route file; for each, assert it returns 404 under MOTIR_CLOUD unset (driving the shared guard from the API-gate card). Separately assert that the publish path is gated: setAccessLevel rejects public and the selector omits it (the publish-gate card). A route or affordance added later that skips the gate fails this test — no hand-maintained list, so a remembered count cannot go stale.

Acceptance criteria

  • A test enumerates every route file under app/api/public/ from the filesystem (no hand-maintained list) and asserts each 404s when MOTIR_CLOUD is unset — a route added later that omits the gate fails.
  • The same test asserts the publish path is gated (service rejects public, selector omits it), so an affordance added later cannot escape.
  • The enumeration derives from the file tree at the ref the test runs against, not a remembered count (11 routes at authoring, origin/main).
  • ≥90% coverage on the test files.

Context refs

  • tests/navigation/proxy-matcher.test.ts — the derived-not-remembered idiom
  • tests/seo/robots.test.ts — the same idiom
  • app/api/public/ — the enumerated surface
  • the API-gate and publish-gate cards this asserts totality over

Discussion

No comments yet.

Adding to this discussion signs you in on app.motir.co and brings you back to this request.

Add a comment