Derived-not-remembered totality guard — enumerate the gated public surface from the filesystem
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 whenMOTIR_CLOUDis 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 idiomtests/seo/robots.test.ts— the same idiomapp/api/public/— the enumerated surface- the API-gate and publish-gate cards this asserts totality over