Repository navigation
feat(storyboard): any_of capability gates and object-subset contains - #3711
Merged
Merged
Conversation
Storyboard capability gates can now express an OR, and `contains` can match an open object by a subset of its keys. adcontextprotocol/adcp#8998 needs both to gate audience_buy_flow's member push on "supported_activation_methods is absent, or lists an entry whose pattern is sync_audiences". - requires_capability, phases[].requires_capability and each requires_all_capabilities entry may be an any_of group of two or more predicates. Groups nest; each entry keeps its own schema-default and no-raw-capabilities rules. The loader validates every any_of group. - contains / not_contains with an object value match an entry carrying every key of the value with an equal value. Scalars, arrays and governance task-mode matching are unchanged. - New exports evaluateCapabilityPredicateAgainstCapabilities, isAnyOfCapabilityPredicate and capabilityPathPredicates; the compliance rollup's compliance_testing exclusion reads flattened paths. - docs/guides/STORYBOARD-CAPABILITY-GATES.md documents the gate dialect and how older runners treat the new forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, additive change with no blocking or Medium findings.
This PR adds any_of capability predicates plus object-subset contains/not_contains for storyboard gates (adcp#8998). Checked:
- OR-composition is consistent across the three
any_ofevaluators (runner.ts:424, :445, :477): each returns null on the first passing alternative, else joins details; per-alternative no-raw-caps fallback and fail-closed behavior preserved by recursing through the same gate fn. Covered by the compound requires_all test. capabilityEntryMatches(runner.ts:369) correctly narrows object-subset to top level; scalar/array equality and governance task-mode matching unchanged.- Loader:
validateCapabilityPredicateShape/validateAnyOfGatefaithfully extract and extend prior inline validation; legacy singular path gates stay unvalidated as documented. - comply.ts:1152 flattens via
capabilityPathPredicates, fixing thecompliance_testingexclusion no longer reading a missing.pathoff an any_of gate. - Changeset present,
minor, accurately scoped; cross-runner-version behavior documented. - Witness-not-translator / official-transport constraints not implicated (testing-DSL change).
No no-auto-approve team match, gated_paths is false, high_risk is false, no findings. Falls through to row 9.
bokelley
added a commit
to adcontextprotocol/adcp
that referenced
this pull request
Nov 15, 2026
…support (#9013) From 3.3 a seller can declare media_buy.audience_targeting without accepting inline member pushes (#8996). audience_buy_flow pushed CRM members to every audience_targeting seller, so a conformant no-push seller failed at the push. The audience_binding, create_buy_with_audience and delivery_check phases now run only when supported_activation_methods is absent (the 3.2 meaning) or lists an entry whose pattern is sync_audiences. A no-push seller grades those phases not_applicable and still runs setup and the unbound-audience rejection. The gate uses the runner's any_of predicate and object-subset contains (adcontextprotocol/adcp-client#3711). The gate-shape lint accepts any_of, and a runner test pins the gating for no-push, push and 3.2-shaped sellers. Closes #8998 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runner support for adcontextprotocol/adcp#8998.
Why
adcontextprotocol/adcp#8996 lets a 3.3 seller declare
media_buy.audience_targetingwithout accepting inline member pushes. Such a seller listssupported_activation_methodswithout an entry whosepatternissync_audiences.media_buy_seller/audience_buy_flowshould run its member-push steps only when the seller accepts inline pushes:The runner couldn't express that. Gates had no OR, and
containsmatched objects by exact equality, while activation-method entries are open objects (additionalProperties: true).What changes
any_ofgroups.requires_capability,phases[].requires_capabilityand eachrequires_all_capabilitiesentry may be anany_oflist of two or more predicates. The group passes when one entry passes. Groups nest, and each entry keeps its own schema-default and no-raw-capabilities rules.any_ofcan't be combined withpathor a matcher on the same object.Object-subset
contains/not_contains. An object value matches an array entry that carries every key of the value with a structurally equal value. The entry may carry other keys. Scalars and arrays still match by structural equality, and governance task-mode matching (adcp.governance_enforcement.tasks) is unchanged. No storyboard in the current compliance source uses an objectcontainsoutside the governance path, so existing grades don't move.Loader. Every
any_ofgroup is validated: at least two entries, no sibling keys, and each entry is a well-formed predicate.requires_all_capabilitiesentries go through the same validator. Legacy singular path gates keep their historical, unvalidated loading.API. New exports from
@adcp/sdk/testing:evaluateCapabilityPredicateAgainstCapabilities(predicate, raw, adcpVersion?),isAnyOfCapabilityPredicateandcapabilityPathPredicates.evaluateCapabilityPredicate(predicate, actual)throws aTypeErrorfor anany_ofpredicate, because it has no single resolved value.describeStoryboardCapabilityGatesrenders a group as(a OR b). The compliance rollup'scompliance_testingexclusion reads flattened paths.Compatibility
Older runners keep working with older bundles, which use neither form. A bundle that uses them needs this release or later:
any_ofon an older runner. The predicate has nopath. With raw capabilities available, the runner throws inresolveCapabilityPath(undefined.split), so the storyboard errors. Without raw capabilities, it treats the gate as satisfied.containson an older runner. It matches objects only by exact equality, so an entry with extra keys doesn't match and the gate skips.The adcp storyboard change that uses this will pin the SDK release containing it.
docs/guides/STORYBOARD-CAPABILITY-GATES.mddocuments the dialect and this behavior.Tests
test/lib/storyboard-any-of-capability-gate.test.js(22 cases):contains/not_contains, nested-value equality, unchanged scalar, array and governance matching;any_ofpass/fail, nested groups, the detail naming every alternative, theTypeErrorguard;runStoryboard: a no-push seller's phase gradesnot_applicable, and 3.2-shaped andsync_audiencessellers run it;any_ofentry insiderequires_all_capabilitiesthat stays fail-closed;Locally: the new file passes, and the existing capability-gate suites pass (
storyboard-capability-gate,storyboard-compound-capability-gate,storyboard-phase-capability-cascade,storyboard-capability-rollup,capability-rollups,storyboard-requires-gate,storyboard-capability-discovery-terminal: 184/184).tsc --noEmit -p tsconfig.lib.jsonis clean.🤖 Generated with Claude Code