feat(storyboard): field_contains validation — closes adcp#3803 item 2#1313
Merged
Conversation
…l/adcp#3803 item 2 Adds a wildcard-aware membership check to the storyboard validator. `path` may include `[*]` segments (resolved via the existing `resolvePathAll`), and the check passes when ANY resolved value matches `value` or any of `allowed_values`. Lets storyboards write: - check: field_contains path: creatives[0].errors[*].code value: PROVENANCE_VERIFIER_NOT_ACCEPTED instead of the brittle positional `errors[0].code` form, which breaks when a seller emits multiple errors or reorders the cascade. When the path has no wildcard segments the check reduces to scalar equality. Symmetric to field_value for missing-value/missing-path error paths and JSON pointer emission. 8 new test cases in test/lib/storyboard-validations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
4 tasks
…er assertion Apply prettier --write to satisfy CI formatting check and tighten the JSON-pointer assertion in the new field_contains tests to pin the literal `*` segment that toJsonPointer emits for `[*]` (per RFC 6901, `*` is not a forbidden character so it round-trips unescaped). Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Adds a wildcard-aware membership check to the storyboard validator.
pathmay include[*]segments (resolved via the existingresolvePathAll), and the check passes when any resolved value matchesvalueor any ofallowed_values.Lets storyboards write:
```yaml
path: creatives[0].errors[*].code
value: PROVENANCE_VERIFIER_NOT_ACCEPTED
```
instead of the brittle positional form
creatives[0].errors[0].code, which breaks when a seller emits multiple errors per creative or reorders the cascade. When the path has no wildcard segments the check reduces to scalar equality.What's new
StoryboardValidationCheckadds'field_contains'validateFieldContainsinvalidations.ts— symmetric tovalidateFieldValuefor missing-value / missing-path error paths and JSON pointer emissiontest/lib/storyboard-validations.test.jscovering wildcard match, allowed_values, no-match, empty resolution, scalar fallback, missing path, missing value, and JSON pointer correctnessTest plan
npm run build— cleannode --test test/lib/storyboard-validations.test.js— 30/30 pass (8 new)Refs
Closes adcontextprotocol/adcp#3803 item 2. Item 1 (required-clean allowlist) shipped in adcp#3837. Item 3 (storyboard run in pre-push hook) lands in a parallel adcp PR.
🤖 Generated with Claude Code