Skip to content

feat(compliance): document field_value_or_absent matcher + restore replayed assertions - #3037

Closed
bokelley wants to merge 3 commits into
mainfrom
claude/issue-3031-field-value-or-absent-replayed
Closed

bokelley wants to merge 3 commits into
mainfrom
claude/issue-3031-field-value-or-absent-replayed

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Closes #3030
Closes #3031

Summary

@adcp/client 5.16.0 (adcp-client#876) shipped a new storyboard check matcher field_value_or_absent — passes when the field is absent OR present with an allowed value; fails only when present with a disallowed value. This is the right tool for envelope-optional fields like replayed where the spec permits omission but prohibits true on fresh execution.

This PR does three things:

  1. Documents field_value_or_absent in static/compliance/source/universal/storyboard-schema.yaml (check enum + semantics prose) and runner-output-contract.yaml (expected/actual field contract for runner implementors). Closes Document field_value_or_absent in storyboard-schema.yaml check enum #3030.
  2. Restores the replayed assertion in universal/idempotency.yaml::create_media_buy_initial using the new matcher. The assertion was dropped in feat(training-agent): flip default to framework dispatch + envelope-spec fixes #3013 because field_value fires when the field is absent, penalising spec-correct agents that omit replayed on fresh execution. field_value_or_absent closes the gap. Closes Re-add replayed assertion on fresh create_media_buy using field_value_or_absent #3031.
  3. Adds the symmetric assertion to create_media_buy_fresh_key (the other fresh-execution step) for consistent coverage.
  4. Adds field_value_or_absent to lint-storyboard-contradictions.cjs hasPositiveAssertion allowlist so steps using this check are correctly classified as success-path assertions by the linter.

Non-breaking justification: adds new optional assertions to two storyboard steps and a new enum value to documentation. Agents that omit replayed on fresh execution (spec-correct) pass. Agents that set replayed: false explicitly pass. Only agents that set replayed: true on a fresh (non-replay) call fail — that is already a spec violation per PR #3013.

⚠️ Merge gate — SDK pin bump required

package.json currently pins @adcp/client at 5.15.0. The field_value_or_absent check ships in 5.16.0 (adcp-client#876). Runners that evaluate storyboards via the SDK will hit an unknown_check error on the two new assertions until the pin is bumped. A reviewer must bump package.json to @adcp/client >= 5.16.0 before merging. (The agent cannot edit package.json per repo policy.)

Pre-PR review

  • code-reviewer (round 1): approved after fixes — added symmetric assertion to create_media_buy_fresh_key, added field_value_or_absent to hasPositiveAssertion in contradiction linter, clarified value/allowed_values doc prose.
  • code-reviewer (round 2): approved after runner-output-contract.yaml check vocab and expected/actual entries were added; SDK pin noted as human gate.
  • ad-tech-protocol-expert: approved — field_value_or_absent with allowed_values: [false] is the correct encoding of "MAY be omitted but MUST NOT be true"; non-breaking per spec; SDK pin flagged for human action.

Session: https://claude.ai/code/session_01FquZ6MmTXxv9cMCB9r8nbi


Generated by Claude Code

claude added 3 commits April 24, 2026 14:37
…played assertion

Add `field_value_or_absent` to the storyboard-schema.yaml check enum
with full semantics documentation. Restore the fresh-path `replayed`
assertion in `universal/idempotency.yaml::create_media_buy_initial`
using the new matcher so spec-correct agents that omit `replayed` are
no longer penalised, while agents that set `replayed: true` on fresh
execution are caught.

Closes #3030, Closes #3031

NOTE: Requires @adcp/client >= 5.16.0 (adcp-client#876). Reviewer must
bump package.json pin from 5.15.0 before merging.

https://claude.ai/code/session_01FquZ6MmTXxv9cMCB9r8nbi
… prose

- Add field_value_or_absent assertion to create_media_buy_fresh_key step
  for symmetric fresh-path coverage (per pre-PR code review)
- Add field_value_or_absent to hasPositiveAssertion allowlist in
  lint-storyboard-contradictions.cjs so future uses are classified correctly
- Clarify field_value_or_absent semantics prose in storyboard-schema.yaml
- Remove process note from changeset (belongs in PR body only)

https://claude.ai/code/session_01FquZ6MmTXxv9cMCB9r8nbi
…yaml check vocab

Runner implementors reading runner-output-contract.yaml must know how to
populate expected/actual for field_value_or_absent failures. Also sync
the check enum comment to include refs_resolve which was already in
storyboard-schema.yaml but missing from the contract vocab list.

https://claude.ai/code/session_01FquZ6MmTXxv9cMCB9r8nbi
@bokelley

Copy link
Copy Markdown
Contributor Author

Closing as superseded.

Both referenced issues are already resolved on main:

The two items this PR still contributed beyond main — adding field_value_or_absent to the contradiction-lint hasPositiveAssertion allowlist and adding the symmetric replayed assertion on create_media_buy_fresh_key — are landed cleanly in #3074 (3.0.1) without the accumulated merge conflicts here.

Removing the milestone since the work is now tracked in #3074.

@bokelley bokelley closed this Apr 24, 2026
@bokelley bokelley removed this from the 3.0.1 milestone Apr 24, 2026
bokelley added a commit that referenced this pull request Apr 24, 2026
…layed assertion (#3074)

Follow-up to #3032 (documented the check) and #3034 (restored the
initial-step replayed assertion). Two small gaps remained, surfaced
while triaging superseded PR #3037:

1. scripts/lint-storyboard-contradictions.cjs — hasPositiveAssertion
   listed the older check kinds but not field_value_or_absent. Any
   storyboard using it as the only positive assertion was misclassified
   as "unspecified." Now classified correctly as "success."

2. static/compliance/source/universal/idempotency.yaml — the
   create_media_buy_fresh_key step is a non-replay call, so the same
   replayed tolerance #3034 restored on create_media_buy_initial applies:
   replayed MAY be omitted, but if present MUST NOT be true. Added the
   symmetric field_value_or_absent [false] assertion so fresh-key coverage
   matches initial-call coverage.

Both additions are purely additive. Agents that omit replayed on fresh
execution pass (spec-correct). Only agents setting replayed: true on a
fresh call fail — already a spec violation per PR #3013.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

Re-add replayed assertion on fresh create_media_buy using field_value_or_absent Document field_value_or_absent in storyboard-schema.yaml check enum

2 participants