Repository navigation
fix(tmp): partition context cache by request - #7397
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — docs-only Trusted Match fix, no blocking or medium findings.
This PR updates the Context Match cache key from placement-only to {provider_id, context_hash} (RFC 8785 JCS → SHA-256 over the forwarded request), closing a real cross-session cache-leak. Reviewer verified schema↔docs coherence (all enumerated request members exist; request_id/cache_ttl present in response schemas), correct per-call request_id rewrite on cache hit, and consistency with the existing Identity Match dedup-cache pattern. No changeset required (path outside declared published surface), no oneOf/dist/V1 issues, no governance-precedent conflict.
Decision-table walk: no critical/high findings (row 1 n/a); gated_paths=false (row 2 n/a); high_risk=false, no deletions (rows 3,5 n/a); no medium findings (rows 4,8 n/a); no prior escalation (row 6 n/a); no no-auto-approve team match (row 7 n/a). Falls through to row 9 → approve. review_decision is REVIEW_REQUIRED, but with gated_paths=false that does not block. The change is editorial/clarifying to docs, not a breaking-class protocol change, so the breaking-change hard gate does not apply.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean docs-only spec fix (#7395) with no blocking findings.
What I checked:
- Cache-key change: replaces the placement-only Context Match cache key with
{provider_id, context_hash}, withcontext_hashdefined as SHA-256 over RFC 8785 JCS of the forwarded request (excluding only$schemaandrequest_id), and therequest_idswap mandated on cache hit. - Schema↔docs coherence: all cited fields exist in
context-match-request.json;request_idis required in the response schema. No stale placement-only key remains. - The experimental
x-statusdowngrades classification, and no changeset is owed ondocs/trusted-match/**.
Gate checks:
- No no-auto-approve team match.
gated_paths: false— row 2 does not apply despitereview_decision: REVIEW_REQUIRED.high_risk: false; no deletions or modifications to sensitive files.- No critical/high/medium findings; nothing normative or breaking-class here (docs-only clarification, no schema source edits).
No findings triggered rows 1–8; falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — docs-only Context Match caching fix under docs/trusted-match/**.
Checked:
- No schema files (
static/schemas/source/**) touched — schema↔docs coherence not implicated;context_hashis router-internal, not a wire field. - No changeset required:
docs/trusted-match/**is out of published protocol scope. - The three doc pages are mutually consistent and every test assertion matches live doc text.
- The fix replaces an unsafe placement-only cache key with
{provider_id, context_hash}(SHA-256 over RFC 8785 JCS of the forwarded request minus$schema/request_id) and requires replacing cached correlation IDs on hit — closing a real cross-session response leak. Regression coverage added.
No Critical/High/Medium findings. No high-risk paths, no gated paths, no author-team gate. gated_paths is false, so the REVIEW_REQUIRED status does not force escalation. Falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — docs-only TMP security fix (#7397).
This PR partitions the Context Match response cache by {provider_id, context_hash} instead of the placement-only key, closing a cross-session response leak. Verified:
- Field names match context-match-request.json
- request_id is the sole per-call response field, so the cache-hit rewrite is complete
- JCS+SHA-256 cache-key construction mirrors the existing Identity Match pattern
- No changeset required — docs/trusted-match/** is out of protocol scope (published surface is static/schemas/source/, docs/reference/, etc.)
- Added test assertions match the shipped doc text
No blocking or Medium findings. high_risk is false, gated_paths is false, no no-auto-approve team match, and no prior decision. Rows 1–8 do not fire, so this falls through to row 9.
Note: review_decision is REVIEW_REQUIRED, but since gated_paths is false, the row-2 hard gate does not apply.
EvgenyAndroid
left a comment
There was a problem hiding this comment.
Reviewed. The key change is right: geo alone makes a placement-only key collide across sessions, and hashing the whole forwarded request with RFC 8785 JCS is the pattern the Identity Match dedup cache in the same section already uses. Three notes:
-
With
geoin the preimage, a geo-varying placement misses the cache on every distinct geo value; under the 5-minute default that is close to no caching. That is the safe direction, but the section should say it. The triage note thatcache_ttl: 0fits viewer-variable placements and the 5-minute default is sized for context-invariant ones did not make it into the text; the onlycache_ttl: 0guidance in the section today is for provider config propagation. -
The sharding note from triage (routers MAY prefix
context_hashwithproperty_ridfor storage sharding without changing the partition) also did not land. One line, so nobody foldsproperty_ridback into the key by hand. -
Same branch question as #7396: base is
main; the triage said 3.1.x first, forward-merge to main.
Approving; nothing here changes the wire.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean delta pass with no findings.
This PR adds a single clarifying paragraph in docs/trusted-match/specification.mdx (property_rid sharding-prefix guidance), a related doc touch in the trusted-match docs set, and two matching test assertions. The reviewer confirmed all terms are coherent with established definitions, the sharding prefix does not weaken the {provider_id, context_hash} partitioning, tests match the prose, and there is no schema/wire change and no changeset obligation.
Gate checks:
- No no-auto-approve team match.
- gated_paths: false — row 2 does not apply despite review_decision REVIEW_REQUIRED (the deterministic path gate is not triggered).
- high_risk: false — no deleted/modified sensitive-file triggers.
- No critical/high/medium findings.
- The docs touched are under
docs/trusted-match/**, notdocs/reference/**orstatic/schemas/source/**, so schema↔docs coherence and changeset obligations are not engaged. No breaking-class protocol change.
Prior decision was also approve with no findings; this delta remains clean. Rows 1–8 do not fire; falls through to row 9 → approve.
|
Thanks — addressed both operational notes in 64c3a4d: the caching section now says viewer-variable geo/session context can drive a low hit rate and makes For the branch question, #7425 is now open directly against |
|
Independent security and protocol review found one additional observability hardening gap, fixed in 1b0158f: deterministic The cache identity, JCS canonicalization, current-request |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, additive privacy-tightening delta.
This subsequent pass extends the cache-privacy MUST NOT in docs/trusted-match/specification.mdx to cover context_hash and any retained hash preimage in logs/metrics/traces, with a matching verbatim regression assertion in tests/trusted-match-offer-creative-data.test.cjs. The change is fail-closed and additive: no schema/wire change, no static/schemas/source/** edits (so no schema↔docs coherence concern), no oneOf discriminator impact, and no released-artifact mutation. Docs touched are under docs/trusted-match/**, outside docs/reference/**, so no changeset is required.
No Critical/High/Medium findings. Prior decision was approve with no findings; no prior blockers to re-surface.
Gate checks: gated_paths is false; high_risk is false; no no-auto-approve team match. Although review_decision is REVIEW_REQUIRED, row 2 only fires when gated_paths is true — it is not — so this falls through to row 9 (approve). No breaking-class protocol change is present.
1b0158f to
7b0d45b
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — docs-only trusted-match spec clarification with a supporting regression test.
Checked:
- No
static/schemas/source/**changes — no schema↔docs coherence risk and no oneOf discriminator concern. - Diff touches only
docs/trusted-match/**and a test file; reviewer confirmed the changeset-protocol-scope gate does not fire for these paths, so no changeset is required. - The clarification repartitions the Context Match cache key by {provider_id, context_hash} to close a cross-session cache-leak; reviewer verified hash-input completeness (only request_id/$schema excluded, no volatile per-call fields dropped/retained) and cross-doc consistency across specification/router-architecture/data-protection plus test↔docs coherence.
- Not a breaking-class wire change; no governance-precedent contradiction identified.
Gates: gated_paths=false; high_risk=false; no no-auto-approve team match. review_decision is REVIEW_REQUIRED, but with no gated paths that does not force escalation. No Critical/High/Medium findings.
Prior decision was also approve with no findings — this run confirms the clean pass. Rows 1–8 do not fire; falls through to row 9.
…rtition
The {provider_id, context_hash} partitioning shipped in v3.1.22 via #7397
without a changeset on main (3.2.0-rc.1 had already been cut when #7397
merged). This adds the release record so the 3.2 changelog captures the
prerequisite step that cache_namespace enforcement builds on. Companion
to the .changeset/correct-v3-1-22-context-cache-release-record.md added
on 3.1.x by #7451.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XXFNKsdZRbx3qxQgSD1vJK
…rtition
The {provider_id, context_hash} partitioning shipped in v3.1.22 via #7397
without a changeset on main (3.2.0-rc.1 had already been cut when #7397
merged). This adds the release record so the 3.2 changelog captures the
prerequisite step that cache_namespace enforcement builds on. Companion
to the .changeset/correct-v3-1-22-context-cache-release-record.md added
on 3.1.x by #7451.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XXFNKsdZRbx3qxQgSD1vJK
* fix(tmp): isolate context caches by evaluation namespace
* docs(tmp): notice breaking cache migration
* chore(changeset): record v3.1.22 request-aware Context Match cache partition
The {provider_id, context_hash} partitioning shipped in v3.1.22 via #7397
without a changeset on main (3.2.0-rc.1 had already been cut when #7397
merged). This adds the release record so the 3.2 changelog captures the
prerequisite step that cache_namespace enforcement builds on. Companion
to the .changeset/correct-v3-1-22-context-cache-release-record.md added
on 3.1.x by #7451.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XXFNKsdZRbx3qxQgSD1vJK
* docs(release): align TMP notice with RC.2
* fix(tmp): refresh evaluation-namespace isolation for 3.3
Integrate the once-pinned main df2446f. Focused/feature checks and typecheck pass. Broad local hooks were blocked by overloaded-host startup and worker timeouts. The named isolated replays still hit the unchanged hosted-compliance-echoed-release beforeAll timeout and governance-agent-credentials import/setup timeout. Per the release coordinator, record with --no-verify and publish for exact-head GitHub CI; do not change budgets or merge automatically.
---------
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Summary
{provider_id, context_hash}context_hashas SHA-256 over RFC 8785 JCS of the complete provider-forwarded request, excluding only$schemaandrequest_idrequest_idCloses #7395.
Validation
npm run test:schemasnpm run test:examplesnpm run test:docs-navnpm run test:owned-linksnode --test tests/trusted-match-offer-creative-data.test.cjsnpm run typecheckThe pre-commit unit phases passed. The full server-unit phase was not repeated to completion because the same three unrelated
server/tests/unit/addie-router.test.tsbaseline failures reproduced while preparing #7396; this PR does not change server implementation or Addie/router code.