Skip to content

fix(compliance): populate governance_agent_url in 3.0 governance storyboards - #7801

Merged
bokelley merged 1 commit into
3.0.xfrom
fix/7797-3-0-governance-agent-url
Sep 30, 2026
Merged

bokelley merged 1 commit into
3.0.xfrom
fix/7797-3-0-governance-agent-url

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Fixes #7797

Summary

Backport (Option A per the #7797 triage) so a 3.0.27 bundle is correct. On 3.0.x, five governance storyboards reference $context.governance_agent_url in sync_governance but never seed it. This PR adds the root default that 3.1.x and main already carry:

context:
  governance_agent_url: "https://test-agent.adcontextprotocol.org"

Files:

  • protocols/media-buy/scenarios/governance_approved.yaml
  • protocols/media-buy/scenarios/governance_conditions.yaml
  • protocols/media-buy/scenarios/governance_denied.yaml
  • protocols/media-buy/scenarios/governance_denied_recovery.yaml
  • specialisms/brand-rights/scenarios/governance_denied.yaml

specialisms/signal-marketplace/scenarios/governance_denied.yaml already has the block on 3.0.x, so it is unchanged. (The triage's count of 10 includes the generated domains/ alias copies in the bundle, which come from these same sources.) Main's later seller_agent_url default is not backported because nothing on 3.0.x references it. Released dist/compliance/3.0.* artifacts are not touched.

Release safety

This change only adds scenario data. It adds no protocol fields and changes no schemas. It includes a patch changeset for adcontextprotocol, following #6743.

Validation

  • Ran locally against the 3.0.x tree: build:compliance (the built bundle now carries the default); test:storyboard-{scoping,branch-sets,provides-state-for,contradictions,context-entity,auth-shape,test-kits,sample-request-schema,response-schema,doc-parity}; test:substitution-vector-names; test:immutable-release-artifacts. All pass.
  • The full unit, typecheck, and training-agent suites rely on this branch's CI. The sandbox didn't have enough disk for 3.0.x's own npm ci.

🤖 Generated with Claude Code

…yboards

The four media-buy governance scenarios and the brand-rights
governance_denied specialism reference $context.governance_agent_url in
sync_governance but never seed it, so 3.0.x bundles block those steps on
an unresolved substitution. Add the same root context default that 3.1.x
and main already carry (signal-marketplace already had it on 3.0.x).

Fixes #7797

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@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.

Minimal 3.0.x backport seeding the top-level context.governance_agent_url default into five governance storyboards, resolving the previously-unset $context.governance_agent_url reference in each sync_governance step. The added block matches the canonical shape/value already carried by the untouched signal-marketplace scenario, a patch changeset is present, and the change is scenario-data-only (no schemas, workers, or wire surface).

No blocking findings. No medium findings. No author-team gate, no gated paths, high_risk false. Falls through to row 9 → approve.

@bokelley
bokelley merged commit 914307b into 3.0.x Sep 30, 2026
10 checks passed
@bokelley
bokelley deleted the fix/7797-3-0-governance-agent-url branch September 30, 2026 14:33
bokelley added a commit that referenced this pull request Oct 19, 2026
…token unresolved (#8327)

The storyboard runner substitutes `$context.<key>` only when the key is in the
run context. When it isn't, the step comes back skipped with
`prerequisite_failed` and a failed `unresolved_substitution` validation — the
storyboard can never pass, but it reports as a skip, which is also what
legitimate capability gating produces.

That is how #7797 shipped: the 3.0.x governance scenarios registered the
governance agent with `url: "$context.governance_agent_url"` and never declared
the key, so `sync_governance` could only ever skip. On the 3.0-compat tenants
that step already skips on `missing_tool`, hiding the difference entirely, and
the defect rode every released 3.0 bundle up to 3.0.26 until #7801 added the
default.

Adds `scripts/lint-storyboard-context-resolution.cjs`, which replays the real
`injectContext()` in step order over every `sample_request` and reports any
token with no writer. It runs as a hard gate in `npm run build:compliance` —
`dist/**` is immutable, so the build is the last place a bad bundle can be
stopped — and `npm run test:storyboard-context-resolution` re-checks the source
tree plus every bundled release against a frozen table of the defects already
frozen into released artifacts.

The lint also rejects a `context_outputs` capture of `governance_agent_url` or
the `*_agent_url` keys hosted grading seeds from server config: the seed is not
a per-step guard, so a capture would let the agent under test redirect the
governance agent it is told to trust.

Fixes one live instance it found: `buyer_monitoring` polls delivery for a buy
no step creates, so `$context.media_buy_id` had no writer. It now seeds the id
from `fixtures.fixture_publisher.active_buy`.

Closes #8317

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Oct 22, 2026
… comparand fixes to 3.2.x (#8327, #8334) (#8411)

* test(compliance): fail the build when a storyboard leaves a $context token unresolved (#8327)

The storyboard runner substitutes `$context.<key>` only when the key is in the
run context. When it isn't, the step comes back skipped with
`prerequisite_failed` and a failed `unresolved_substitution` validation — the
storyboard can never pass, but it reports as a skip, which is also what
legitimate capability gating produces.

That is how #7797 shipped: the 3.0.x governance scenarios registered the
governance agent with `url: "$context.governance_agent_url"` and never declared
the key, so `sync_governance` could only ever skip. On the 3.0-compat tenants
that step already skips on `missing_tool`, hiding the difference entirely, and
the defect rode every released 3.0 bundle up to 3.0.26 until #7801 added the
default.

Adds `scripts/lint-storyboard-context-resolution.cjs`, which replays the real
`injectContext()` in step order over every `sample_request` and reports any
token with no writer. It runs as a hard gate in `npm run build:compliance` —
`dist/**` is immutable, so the build is the last place a bad bundle can be
stopped — and `npm run test:storyboard-context-resolution` re-checks the source
tree plus every bundled release against a frozen table of the defects already
frozen into released artifacts.

The lint also rejects a `context_outputs` capture of `governance_agent_url` or
the `*_agent_url` keys hosted grading seeds from server config: the seed is not
a per-step guard, so a capture would let the agent under test redirect the
governance agent it is told to trust.

Fixes one live instance it found: `buyer_monitoring` polls delivery for a buy
no step creates, so `$context.media_buy_id` had no writer. It now seeds the id
from `fixtures.fixture_publisher.active_buy`.

Closes #8317

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit 8c262e3)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(compliance): resolve $context comparands in storyboard assertions (#8334)

The storyboard runner substitutes `validations[].value` and
`validations[].allowed_values[]` and resolves `validations[].context_key`
against the context as it stood *before* the step, and substitutes a webhook
step's `filter` the same way. A step's own `context_outputs` land after its
validations run, so a step cannot assert against a key it captures itself —
and unlike `sample_request`, nothing guards this surface. An unresolved
`value` silently becomes the comparand, an absent `context_key` makes the
check *pass* with a `context_key_absent` observation, and a token left in a
`filter` yields a selector no delivery can match.

Two storyboards read a key their own step captures, so the assertion graded
something other than what it claimed:

- `geo_place_targeting` asserted "current_version is included in
  supported_versions" against `$context.place_system_version`, captured by the
  same `get_adcp_capabilities` step. The check compared the seller's
  `supported_versions` against the literal token, so the capability step could
  not pass for any seller and the scenario could never go green. It now
  captures `supported_versions` too and settles the
  `geo-place-catalog-capability.json` `x-adcp-validation.member_of` invariant
  on a second, stateless capabilities read — directly, at capability scope,
  before any product or buy state exists to make it conditional.
- `vendor_metric_accountability` asserted the day-1 `committed_at` equals
  `confirmed_at` against `$context.confirmed_at`, captured by the same
  `create_media_buy` step, so no seller could satisfy it. Every day-1
  `committed_at` on both packages is now captured on create and settled on a
  `get_media_buys` read-back that pins the buy under test — "each such entry's
  `committed_at` MUST equal `confirmed_at`", not just the first entry.

Both scenarios are capability-gated out of the training-agent matrix (it
declares neither `media_buy.features.committed_metrics_supported` nor GeoNames
NL), so no floor moves; the grading impact lands on third-party sellers graded
against a 3.2 bundle, all 14 of which are registered in
static/compliance/published-versions.json.

`scripts/lint-storyboard-context-resolution.cjs` gains a
`context_assertion_unresolved` rule over all four comparand surfaces, using
the before-own-capture ordering the request rule already uses, so
`npm run build:compliance` rejects the class. Released bundles are immutable,
so 3.2.0-beta.6 through 3.2.5 keep both defects under the frozen table in
tests/lint-storyboard-context-resolution.test.cjs.

Closes #8328

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit 4fe0876)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(compliance): adapt the context-resolution lint backport to 3.2.x

The #8327 test reads server/src/compliance/hosted-multi-agent-routing.ts and
the 3.0.27/3.0.28 bundles, none of which exist on 3.2.x: hosted grading of
governance-aware sellers (#7808) is 3.3-only, and the fixed 3.0 bundles are
registered on main.

- Pin RUNNER_PINNED_CONTEXT_KEYS against GOVERNED_AGENT_CONTEXT_KEYS in
  server/src/compliance/storyboard-runner-options.ts (plus
  governance_agent_url, which main's hosted grader pins for every 3.2 bundle).
- Drop the "published 3.0 bundles from 3.0.27 on are clean" test and the
  3.0.27 side of the #7797 bracket; 3.0.26 still reproduces the defect.
- Reword the #8327 changeset's pinned-key sentence for this line.

The lint script itself is byte-identical to main.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@aao-release-bot aao-release-bot Bot mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant