Repository navigation
test(docs): pin the gated content route, route limiters and fail-closed tier defaults - #39
SaulBuilds wants to merge 2 commits into
Conversation
…ed tier defaults - /api/content commercial/academic branch: entitlement gate, org scope, expiry, embargo, disclosure acknowledgement and the 503 when a read cannot be logged. - Route-level limiter on /api/chat and /api/sandbox/relay (memory/provider mocked; relay fails closed with no URL, so no request leaves the process). - Repo-tier override merges over the declared map (visible with MEM_DEFAULT_TIER=public); an unlisted repo defaults to confidential. - Principal lookup refuses a gated tier for a non-verified KYC status. - The content generator, run on a temp-dir fixture corpus, keeps gated bodies out of the client module and in the server-only module; no client component imports the bodies. - Mermaid initialises with securityLevel "strict". Each guard was reverted on its own and the matching test went red; 124 -> 145 passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KGMeatV8UjtCB4CTbWuAv4
BerryManifold
left a comment
There was a problem hiding this comment.
Automated Codex static review of 106dd4831ed98382a43259c1b04e45459fa07e7a is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Matr0xshka
left a comment
There was a problem hiding this comment.
Automated Codex static review of 106dd4831ed98382a43259c1b04e45459fa07e7a is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
BerryManifold
left a comment
There was a problem hiding this comment.
Automated Codex static review of 6986c2062c9216a4ba41be3316733b25ce98e839 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Matr0xshka
left a comment
There was a problem hiding this comment.
Automated Codex static review of 6986c2062c9216a4ba41be3316733b25ce98e839 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
BerryManifold
left a comment
There was a problem hiding this comment.
Automated Codex static review of 6986c2062c9216a4ba41be3316733b25ce98e839 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Matr0xshka
left a comment
There was a problem hiding this comment.
Automated Codex static review of 6986c2062c9216a4ba41be3316733b25ce98e839 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Tests only. This adds three test files that pin access-control guards on the routes and on the content pipeline. Before this PR, removing any one of these guards left the suite green.
What is pinned
/api/content, commercial/academic branch: the entitlement gate, the org scope, entitlement expiry, the embargo (423), the disclosure acknowledgement (412), and the 503 that withholds a body when the read cannot be access-logged./api/chatand/api/sandbox/relay. Memory and the model provider are mocked. With no relay URL the relay fails closed, so no test request leaves the process.MEMORY_REPO_TIERSoverride is merged over the declared map. This is only visible withMEM_DEFAULT_TIER=public, so the test sets it. An unlisted repo with no default resolves to confidential.scripts/build-content.mjsruns against a temp-dir fixture corpus. Gated bodies stay out ofcontent.tsand go into theserver-onlycontent-bodies.ts, and no"use client"module imports the bodies. A fixture is needed because the committed corpus has no gated pages today.securityLevel: "strict".Standard: met
vitest runwent from 124 to 145 passing (4 skipped, unchanged).tsc --noEmitis clean.os.tmpdir()dir that it removes. No network calls.npx vitest run --maxWorkers=2,npx tsc --noEmit.setAccessSinkis never called. Durable persistence is a separate change and is not part of this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01KGMeatV8UjtCB4CTbWuAv4