Skip to content

fix(tmp): backport request-aware context caching to 3.1 - #7425

Merged
bokelley merged 2 commits into
3.1.xfrom
backport/3.1-context-cache
Sep 13, 2026
Merged

bokelley merged 2 commits into
3.1.xfrom
backport/3.1-context-cache

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • backport fix(tmp): partition context cache by request #7397's request-aware Context Match cache partitioning to the 3.1 maintenance line
  • key provider responses by {provider_id, context_hash}, using SHA-256 over RFC 8785 JCS of the complete provider-forwarded request minus $schema and request_id
  • require current-request correlation IDs on cache hits and privacy controls for cached context data
  • document low hit rates for viewer-variable contexts, cache_ttl: 0, and optional property-based storage sharding

Closes #7395.

Relationship to main

#7397 is the forward port for main / 3.2. This PR is based directly on 3.1.x, matching the issue triage. No changeset is included because the repository's enforced release-surface policy excludes docs-only docs/trusted-match/** changes.

Validation

  • node --test tests/trusted-match-context-cache.test.cjs
  • npm run test:docs-nav
  • npm run typecheck

@bokelley bokelley added signals Issue concerns the signals protocol domain sponsored-intelligence Issue concerns the sponsored-intelligence protocol domain needs-wg-review Blocked on a working-group decision — surface in WG meeting agendas labels Sep 11, 2026 — with conductor.build App

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — docs-only backport of #7397's Context Match cache-partitioning to the 3.1.x line.

No blocking findings. No Medium findings.

Verified: the new context_hash construction cites real schema field names (artifact, artifact_refs, context_signals, geo, package_ids against context-match-request.json), the request_id-on-hit and privacy MUSTs survive the port, the test's nine assertions match the added text, and no other 3.1.x doc references the old placement-based key.

Non-blocking follow-up (not a finding): #7397 also updated router-architecture.mdx and data-protection-roles.mdx, which this backport omits — the companion docs trail the normative spec, but every MUST is in specification.mdx so the floor is intact.

Decision path: no critical/high findings, gated_paths false, high_risk false, no team gate, zero medium findings → falls through to row 9 (approve).

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean, correctly-scoped backport of #7397's Context Match cache-partitioning fix to the 3.1 line.

Checks performed:

  • docs/trusted-match/specification.mdx §Caching change is byte-identical to the forward port; every field named in the context_hash text resolves to a real Context Match request member (no spec drift).
  • Cache-hit request_id overwrite is sound.
  • tests/trusted-match-context-cache.test.cjs prose-guard assertions all match the shipped text.

No blocking or Medium findings. One non-blocking follow-up noted: #7397's router-architecture.mdx flow update was not carried to 3.1 — worth a look but not required for this change.

Gates: no author-team gate, gated_paths false, high_risk false. No findings fire rows 1–8 → row 9 approve.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve

Clean docs-only backport of #7397's Context Match cache partitioning to the 3.1.x line. The specification.mdx change is identical to the reviewed forward-port; all context_hash recipe field names resolve against the 3.1.x request schema, no internal contradiction is introduced, and the new test's assertions match the head spec text.

No blocking or Medium findings. No high-risk paths, no gated paths, no author team gate. Falls through to row 9.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — docs-only backport of #7397's Context Match cache-partitioning fix to 3.1.x.

Checked:

  • No blocking (critical/high) findings.
  • No medium findings.
  • gated_paths: false; no author team gate; high_risk: false.
  • Replaced §Caching block in specification.mdx is byte-identical to the forward port; named request members exist in the ContextMatchRequest schema; the new {provider_id, context_hash} key strictly refines the old placement-only key with no cross-doc contradiction on 3.1.x.
  • No changeset required (docs/trusted-match outside PROTOCOL_SCOPED_PATHS).

One non-blocking note: backport is narrower than #7397 (one doc vs three), which is defensible — the omitted paragraphs are duplicative narrative and the 3.1.x router-architecture doc diverged.

No escalation triggers fired; rows 1–8 all pass through to row 9.

Copy link
Copy Markdown
Contributor Author

Independent security and protocol review found one additional observability hardening gap, fixed in a04c03e: deterministic context_hash values and retained preimages must not appear in logs, metric labels, or traces, and receive the same access and retention controls as Context Match request data.

A regression assertion covers the new rule and keeps the normative cache paragraph aligned with 3.2.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve

Docs-only backport of #7397's request-aware Context Match cache partitioning to 3.1.x. The specification's ## Caching section is rewritten to key on {provider_id, context_hash} (SHA-256 over RFC 8785 JCS of the forwarded request minus $schema/request_id), mandate current-request correlation IDs on cache hits, and enforce privacy boundaries on cached data, with an accompanying doc-content test.

No blocking findings. No critical/high/medium findings surfaced. Reviewer confirmed the partitioning closes the prior placement-only fail-open, correlation-ID replay is handled correctly, and the construction is consistent with the sibling Identity Match cache treatment.

Gate checks: no no-auto-approve team match; gated_paths false; high_risk false; review_decision APPROVED. Prior decision was also approve. None of decision rows 1–8 fire → row 9 approve.

@bokelley
bokelley merged commit 251df51 into 3.1.x Sep 13, 2026
9 checks passed
@bokelley
bokelley deleted the backport/3.1-context-cache branch September 13, 2026 11:43
bokelley added a commit that referenced this pull request Sep 16, 2026
* fix(protocol): scope idempotency replay to mutations (#7383) (#7384)

* fix(protocol): scope idempotency replay to mutations

* fix(protocol): preserve legacy get_products key optionality

(cherry picked from commit 245108f)

* Version Packages (#7385)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(schema): backport legacy format asset variants (#7423)

* fix(tmp): backport single-user context privacy to 3.1 (#7424)

* fix(tmp): backport single-user context privacy

* fix(tmp): close expert-reviewed context privacy gaps

* fix(tmp): backport request-aware context caching to 3.1 (#7425)

* fix(tmp): backport request-aware context caching

* fix(tmp): keep context hashes out of observability

* Version Packages (#7426)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* docs(release): correct v3.1.22 Context Match record (#7451)

* fix(compliance): backport required_tools OR-gate fixes to 3.1.x (#6774 subset + canonical_format_validate_input) (#7406)

* fix(compliance): drop get_adcp_capabilities from required_tools across 17 storyboards (OR-gate bug) (#6774)

* fix(compliance): drop get_adcp_capabilities from required_tools in billing_gate_dispatch and agent_notification_configs

required_tools uses OR semantics in the adcp-client SDK. Listing
get_adcp_capabilities alongside a capability-specific tool made the
storyboard-level gate trivially satisfied for every conformant agent,
causing billing_gate_dispatch and agent_notification_configs to run
against agents that lack sync_accounts / sync_agent_notification_configs
and fail at the first assertion instead of receiving a clean
coverage-gap skip.

Closes #6773

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3evZsz4Y3971B5RZVxhKh

* fix(compliance): sweep remaining 15 storyboards for get_adcp_capabilities OR-gate bug

Same pattern as billing_gate_dispatch (issue #6773): required_tools uses
OR semantics, so listing get_adcp_capabilities alongside a capability-
specific tool made the gate trivially satisfied for every conformant agent.

Affected: billing_out_of_band, canonical_supported_formats, evaluator_auth,
native_localization (creative); account_timezone_{seller_fixed,buyer_selected,
seller_assigned}, budget_cap_timezone_{account,fixed,override_rejected},
geo_{region_all_values_support,region_targeting,region_exclusion_support,
place_targeting}, portfolio_routing_scope (media-buy).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3evZsz4Y3971B5RZVxhKh

---------

Co-authored-by: Claude <[email protected]>
(cherry picked from commit a1e72ec)

* fix(compliance): drop comply_test_controller from canonical_format_validate_input required_tools (OR-gate)

The per-storyboard gate (runner.js) admits a storyboard when any listed tool
is present, while the suite selector (comply.js) requires all of them. With
comply_test_controller in the list, every agent exposing the universal test
controller was selected for this storyboard and then failed all 17 steps on
the missing validate_input — on the hosted grader, 17 spurious failures on
each of two registered agents (#7404). Same shape as #6774.

Refs #7404 (bug 1 only).

(cherry picked from commit 40c59b1)

* fix(compliance): correct 3.1 backport changeset scope

Name only the four #6774 storyboards present on 3.1.x and keep the remaining hosted service work open.

Refs #7404 (bug 1 only).

---------

Co-authored-by: Brian O'Kelley <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: evgen <evgen@SCIS-TE-IPSUM>

* Version Packages (#7486)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(compliance): backport creative format-kind assertions to 3.1.x (#7554)

* fix(compliance): backport governance storyboard routing to 3.1.x (#7555)

* fix(jobs): backport heartbeat timeout to 3.1.x (#7557)

* fix(release): preserve main schema discovery index

* fix(release): preserve main changelog history

* test(release): register forward-merged regressions

---------

Co-authored-by: aao-release-bot[bot] <280565558+aao-release-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ev <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: evgen <evgen@SCIS-TE-IPSUM>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-wg-review Blocked on a working-group decision — surface in WG meeting agendas signals Issue concerns the signals protocol domain sponsored-intelligence Issue concerns the sponsored-intelligence protocol domain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant