Skip to content

Commit a1a0bde

Browse files
committed
docs(runtime): endpoint-policy's anonymous 401 comment names the dispatcher envelope, not "the platform's" (#5800)
`anonymousDenial()`'s docstring claimed "same code, same message, same envelope". The first two hold; the third does not: `apiErrorResponse` builds the dispatcher wrapper `{ success: false, error: { code, message, httpStatus } }`, while the REST seam (`@objectstack/rest` `enforceAuth` → `ANONYMOUS_DENY_BODY`) answers the flat `{ error, message }`. Two live, sanctioned envelopes per ADR-0112's 2026-07-30 amendment (#4007). This is the same false claim #5632 narrowed on `ANONYMOUS_DENY_BODY`, surviving on the side that PRODUCES the wrapper — where a reader (especially an AI author) takes it as authoritative. Comment only; the wire body is untouched, and the two-envelope table stays single-sourced in `security/anonymous-deny.ts`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wbxm29qPKnLf44AbSxizqW
1 parent 108db0f commit a1a0bde

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

packages/runtime/src/endpoint-policy.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,23 @@ export function computeCacheControl(
270270
return `private, max-age=${Math.floor(ttl)}`;
271271
}
272272

273-
/** The 401 every seam on this platform answers — same code, same message, same envelope. */
273+
/**
274+
* The anonymous 401 this seam answers: the same DECISION, {@link ANONYMOUS_DENY_CODE}
275+
* and {@link ANONYMOUS_DENY_MESSAGE} as every other seam — in the **dispatcher's**
276+
* envelope, `{ success: false, error: { code, message, httpStatus } }`, which is
277+
* what `apiErrorResponse` builds.
278+
*
279+
* NOT the platform's only 401 body, and this comment used to say it was ("same
280+
* code, same message, same envelope"). The REST seam — `@objectstack/rest`'s
281+
* `enforceAuth`, writing `ANONYMOUS_DENY_BODY` — answers the flat
282+
* `{ error, message }`. Both envelopes are live and sanctioned by ADR-0112's
283+
* 2026-07-30 amendment (#4007); converging them is a breaking wire change owned
284+
* by the envelope-convergence line (#3843 family), not by this function. The
285+
* full two-envelope table lives on `ANONYMOUS_DENY_BODY`
286+
* (`@objectstack/core`, `security/anonymous-deny.ts`), narrowed there by #5632
287+
* — this was the same claim surviving on the side that PRODUCES the wrapper,
288+
* where it reads as authoritative (#5800).
289+
*/
274290
function anonymousDenial(): EndpointPolicyVerdict {
275291
const { status, body } = apiErrorResponse({
276292
code: ANONYMOUS_DENY_CODE,

0 commit comments

Comments
 (0)