Repository navigation
feat(conformance): add field_less_than and field_equals_context cross-step validators - #1141
Merged
bokelley merged 3 commits intoMay 1, 2026
Merged
Conversation
…-step validators Implements the runner side of adcp#2642. Storyboard authors can now assert relationships between the current step's response and a value captured from an earlier step, without leaving the context_outputs accumulator. https://claude.ai/code/session_01D5v3W3pZbs44KaMyCQ7iKV
…n cross-step validators - resolveContextComparand now treats explicit undefined in storyboardContext the same as absent (yields context_key_absent observation, not a comparand) - field_equals_context error message uses JSON.stringify(actual ?? null) so absent fields render as "null" not "undefined" in the error string https://claude.ai/code/session_01D5v3W3pZbs44KaMyCQ7iKV
Contributor
Author
Admin merge rationaleSame |
Contributor
Author
|
Acknowledged — pre-existing failures on #1178 noted. No action needed on this end. Generated by Claude Code |
This was referenced May 1, 2026
bokelley
added a commit
that referenced
this pull request
May 1, 2026
Reverts #1142. The field was preemptive surface with no consumer: - None of the bundled invariants (`status.monotonic`, `idempotency.conflict_no_payload_leak`, `context.no_secret_echo`, `governance.denial_blocks_mutation`) read `ctx.storyboardContext`. - Programmatic assertions already accumulate cross-step state through `ctx.state` (which is how `status.monotonic`'s `history` works). - Issue #1140 was about YAML validators (the `check:` clause), not assertion handlers — that scope is fully covered by #1141, which reads from `ValidationContext.storyboardContext` (a separate interface that already existed). The asymmetry is correct: declarative validators need context exposure, imperative assertions don't. Custom invariants that need cross-step state should continue using `ctx.state`. Breaking-shape change shipped as minor while 6.x is in its breaking phase. Window-of-removal is hours old — #1142 landed in 6.4.0, no docs advertised it, no third-party consumer has had time to depend. This reverts commit 7b804ea. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Merged
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.
Closes #1140
Summary
Implements the runner side of adcp#2642. The storyboard schema is gaining cross-step comparison primitives (
field_less_than,field_equals_context), but those check kinds are dead letters until the runner exposes the accumulator contract. This PR nails down option 2 (context-outputs style) and ships it.Design decision: captured values live in the existing
storyboardContextaccumulator passed throughValidationContext.storyboardContext. Validators read them viacontext_keyonStoryboardValidation. This matches the establishedrefs_resolveprecedent (which already readsctx.storyboardContextviaresolveRefsRoot('context', ctx)) and avoids forking the state channel.Acceptance criteria from #1140:
StoryboardValidationCheckstoryboardContext, populated byapplyContextOutputsWithProvenanceafter each step)context_key_absentobservation — not an error. The prior step may have been legitimately skipped on a branch-set path (same skip-with-observation pattern asvalidateA2AContextContinuity).Changes
src/lib/testing/storyboard/types.ts— addsfield_less_thanandfield_equals_contexttoStoryboardValidationCheck; addscontext_key?: stringtoStoryboardValidation(JSDoc scopes it to the two new checks)src/lib/testing/storyboard/validations.ts—resolveContextComparand()helper +validateFieldLessThan()+validateFieldEqualsContext()+ two new cases inrunValidation()switchtest/storyboard-cross-step-validators.test.js— 20 tests covering: pass/fail/observation paths,undefinedcontext values, both-comparand precedence, absent field, non-numeric type errors, missingpath/context_keyWhat was tested
npx tsc --project tsconfig.lib.json— pre-existingTS2688/TS5107errors only (confirmed identical onmainbefore this diff)npm run format:check— cleannode --test test/storyboard-cross-step-validators.test.js— 20/20 passNits (not fixed — surfaced for reviewer)
field_less_thanwith a stringvalue(e.g.value: "100") produces a runtime type failure rather than a storyboard-load error. The schema side (adcp#2642) should constrainvaluetonumberwhencheck === "field_less_than"via anif/thendiscriminant — the runner will emit the correct type error in the meantime.field_less_thanon an HTTP-probe step (whereresolveTargetfalls back tohttpResult.body). The sharedresolveTargetlogic is already tested by other checks; adding a probe-target test is a good follow-up.Pre-PR review
undefined-in-context guard andJSON.stringify(actual ?? null)fixes confirmedrefs_resolveprecedent; skip-with-observation correct per A2A check patterns; two nits: schema-sidevaluetype constraint (adcp#2642 scope), and precedence behavior when bothcontext_keyandvalueare set (now covered by test)Session: https://claude.ai/code/session_01D5v3W3pZbs44KaMyCQ7iKV
Generated by Claude Code