Repository navigation
fix(registry): raise brand.json size cap to 2 MiB on all fetch paths - #8057
Conversation
Share one BRAND_JSON_MAX_RESPONSE_BYTES (2 MiB) between the registry validator and Addie's brand tools so large brand houses can be confirmed live. Document the 2 MiB / 256 KiB guidance in brand-json.mdx; the security.mdx signing-trust-root budgets are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — raises the brand.json registry live-read cap (256 KiB → 2 MiB) and centralizes the previously-duplicated constant into one shared BRAND_JSON_MAX_RESPONSE_BYTES in brand-resolution-cache-policy.ts.
Checked:
- Signing trust-root path is unaffected: the 256 KiB cap for key verification still lives in security.mdx step 4 (:1363), and the new doc note (brand-json.mdx:9) correctly directs operators carrying agents[]/keys there. Both raised usages (brand-manager.ts:497,652; brand-canonical-tools.ts:375) are registry/Addie resolution, not key verification.
- New brand-manager-response-cap.test.ts exercises 1 MiB accept / 3 MiB reject through the real safeFetchAxiosLike; the /exceeded/i assertion matches the live error string (url-security.ts:722).
- No schema change under static/schemas/source/, so no schema↔docs drift and no changeset required (docs/brand-protocol is non-normative, outside docs/reference/). Fetch retains its 10s timeout and streamed cap.
Decision rationale: brand-canonical-tools.ts is high-risk (modified, matches server/src/addie/**), but the reviewer surfaced no medium-or-higher findings, so row 5 does not fire. gated_paths is false and no no-auto-approve team match. With zero findings, none of rows 1–8 apply; falls through to row 9 → approve. (review_decision REVIEW_REQUIRED does not block since gated_paths is false.)
Raise the brand.json body cap from 256 KiB to 2 MiB in the signing trust-root fetches in security.mdx as well as the registry live read. JWKS and capabilities caps are unchanged. Specify the cap as a streaming limit and add depth, concurrency, and cheap-checks-first mitigations. Document the interop asymmetry in the 3.2 to 3.3 migration guide. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…lures Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — brand.json body cap raised from 256 KiB to 2 MiB.
Checked:
- Changeset correctness:
minorchangeset is correct — loosening a size cap is a non-breaking (backward-compatible) change, and the changeset documents the forward-compat asymmetry. - Docs↔constant consistency: 2,097,152 bytes used consistently across security.mdx, brand-json.mdx, the 3.2→3.3 migration guide, the trust-split spec, the server cache-policy constant comment, and the e2e resolution script.
assertStrictJsonscanner: correct per-object dedup and depth-32 enforcement.- Streaming-abort operability: byte-counting cancel plus a new endless-stream test covers the new branch.
- No schema (
static/schemas/source/**) changes, so schema↔docs coherence and oneOf discriminator rules do not apply. No released-artifact (dist/**) modifications.
High-risk flag is true only via (modified) entries (docs/reference migration guide and addie MCP tools), but the reviewer surfaced no critical/high/medium findings, so the modifications are presumed safe. No deletions. No no-auto-approve team match. gated_paths is false. No blocking triggers fired — falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Two editorial coherence fixes in docs/building/by-layer/L1/security.mdx: (1) reclassifies the 2 MiB brand.json body cap from "recommended" to normative to match the already-present "Verifiers MUST NOT read more than 2 MiB" MUST; (2) adds "nesting deeper than 32" to the request_signature_brand_json_malformed error row to match the step-4 MUST on max nesting depth. Both align table/budget wording with MUSTs already present in the prose — no new normative requirement, no schema change, no wire change, no docs/reference normative surface touched.
Checked:
- No critical/high/medium findings (reviewer reports none).
high_risk: truebut reasons are(modified)ondocs/reference/**andserver/src/addie/**; with no medium-or-higher finding on those modified files, row 5 does not fire. No(deleted)reason — row 3 does not fire.gated_paths: false— row 2 does not apply despitereview_decision: REVIEW_REQUIRED.- No no-auto-approve team match — row 7 does not apply.
- Prior decision was
approve, so sticky-escalation row 6 does not apply. - Editorial-class change (aligning docs to existing MUSTs), not a breaking-class change — the breaking-change hard gate does not trigger.
No row 1–8 condition fires; falls through to row 9.
Closes #7998
Maintainer decision: raise the brand.json size cap on all paths, including the signing trust-root fetches in
security.mdx, not only the registry live read.Evidence for the number
I probed real hosts:
pg.comserves a 9 KB document, and the AgenticAdvertising.org mirror ofnike.comis 851 bytes.nike.com/.well-known/brand.jsonitself returns a 404 HTML page of about 561 KB, not a brand.json. So I found no real brand.json over 256 KiB, and the 2 MiB figure rests on the maintainer's stated need, not on a measured file. Nothing I measured argues against 2 MiB.Changes
BRAND_JSON_MAX_RESPONSE_BYTES(2 MiB) used bybrand-manager.tsandaddie/mcp/brand-canonical-tools.ts.MAX_BRAND_JSON_BYTES. JWKS and capabilities caps are unchanged.Accept-Encoding: identity, node-count bound,ETagrevalidation, single-flight.secure-json-parseandDisallowUnknownFieldsdo not detect duplicate keys.agents[]/key documents small while peers are on 3.2.minor. The scope check passes.scripts/e2e-resolve-training-agent.tsnow streams with a byte cap and does a real duplicate-key and depth check.specs/brand-identity-trust-split.mdis reworded.Security review
The security-reviewer signed off after one round of changes. Open items it raised, deliberately not in this PR:
BrandManager.validationCacheretains parsedraw_datafor up to 200 entries; a bloated 2 MiB document could retain tens of MB each. Needs a size-aware cache, as a follow-up.@adcp/sdk14.2.0 clamps brand.json to 256 KiB, so those verifiers reject large files until an SDK release. Noted in the migration guide.🤖 Generated with Claude Code