Skip to content

fix(compliance): repair refine_frequency_cap_negotiation capability gate - #7795

Merged
bokelley merged 1 commit into
mainfrom
fix/refine-fcap-capability-gate
Sep 30, 2026
Merged

bokelley merged 1 commit into
mainfrom
fix/refine-fcap-capability-gate

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Problem

media_buy_seller/refine_frequency_cap_negotiation aborts on the /sales tenant before running any steps, with Cannot read properties of undefined (reading 'split'). This blocks the 3.2.1 GA freeze gate.

Stack: resolveCapabilityPath (@adcp/sdk/dist/lib/testing/storyboard/runner.mjs:251) ← evaluateRequiresCapabilityGate ← evaluateStoryboardCapabilityGates.

Root cause

The storyboard declared requires_capability: { all: [...] }. That shape isn't valid. Per universal/storyboard-schema.yaml, requires_capability is a single predicate with a path, and AND gates belong in requires_all_capabilities. The runner then called predicate.path.split('.') with path undefined. The storyboard is wrong here, not the SDK.

Fix

  • Move the predicates to requires_all_capabilities.
  • Change the refinement predicate from supported_dimensions present: true to contains: "criteria" plus contains: "product_changes", the dimensions the storyboard actually exercises. The capabilities schema says an empty list authoritatively means ask-only, and /sales (ask-only) declares []. So present: true would have graded an ask-only seller on typed refinement, which it correctly rejects with UNSUPPORTED_FEATURE. The sibling typed_proposal_negotiation already gates the same way (contains: "alternatives").
  • Training agent: remove_media_buy_frequency_cap now counts as a typed control. Before, a clear-cap refinement that included an ask fell into the "free-text only" branch and came back partial.
  • Add a corpus-wide shape check in tests/sdk-runner-capability-gates.test.cjs covering storyboard- and phase-level gates. It fails on the old YAML.

The compliance change is non-normative and ships with a patch changeset.

Verification (local, same env as CI)

  • /sales: before, ⚠ Cannot read properties of undefined (reading 'split'), 0 steps. After, storyboards: 1/1 clean, 0 failed; the storyboard is skipped as capability_unsupported because the seller declares [].
  • /sales/profiles/typed-negotiation (not in the CI gate): 6 passed, 1 failed. The remaining revise_exceed_constraints failure is a separate storyboard design gap. The fixtures: products (max_impressions max 10) never end up in the brief-seeded proposal mix, so a cap of 50 falls within the catalog's inherited seller maximum of 50. revise_include_non_participating passes only because no_fcap_native_q4 doesn't exist. This needs a follow-up.
  • Storyboard lint suite, test:sdk-runner-capability-gates, the proposal-negotiation unit tests, and server tsc all pass.

🤖 Generated with Claude Code

The storyboard declared `requires_capability: { all: [...] }`. That is not a
valid gate shape: `requires_capability` is a single predicate with `path`, and
the SDK runner's resolveCapabilityPath called `undefined.split('.')`, aborting
the storyboard with 0 steps on /sales.

- Use `requires_all_capabilities`, the schema's AND gate.
- Require supported_dimensions to contain `criteria` and `product_changes`
  (the dimensions the storyboard exercises) instead of `present: true`; an
  empty list authoritatively means ask-only, which /sales declares.
- Training agent: treat remove_media_buy_frequency_cap as a typed control so
  an accompanying ask no longer downgrades the outcome to `partial`.
- Add a corpus-wide shape check for storyboard/phase capability gates.

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 — clean, correctly scoped compliance fix.

The PR moves the storyboard's invalid requires_capability: { all: [...] } gate (which crashed the runner on undefined path.split) to the runner-evaluated requires_all_capabilities AND form using valid contains matchers. The applicability narrowing, training-agent typed-control guard, unit test, and corpus-wide shape check are all correct, and an in-scope patch changeset accompanies the change.

Checks performed:

  • No Critical/High/Medium findings from the reviewer.
  • No schema changes under static/schemas/source/** (compliance YAML + TS/tests only), so schema↔docs coherence and oneOf-discriminator gates do not apply.
  • No released dist/** artifacts modified.
  • Changeset present and in scope.
  • No no-auto-approve team match; gated_paths is false; high_risk is false.

No blocking issues; 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 and no prose hard gate applies, the approve stands.

@bokelley
bokelley merged commit ea768e3 into main Sep 30, 2026
53 checks passed
@bokelley
bokelley deleted the fix/refine-fcap-capability-gate branch September 30, 2026 12:10
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