feat(cli): --invariants flag to register storyboard assertion modules#697
Merged
Conversation
Adds `adcp storyboard run ... --invariants <module[,module...]>` so operators can dynamic-import assertion modules before `runStoryboard` resolves `storyboard.invariants`. Without this the registry from adcp#2639 has no external surface — YAMLs referencing invariant ids would fail at runner start because nothing ever called registerAssertion(). Wired at all three storyboard entry points (single-run, multi-instance, full-assessment/comply) and runs before the --dry-run gate so bad specifiers surface in preview. Relative paths resolve against cwd via pathToFileURL; bare specifiers pass through to dynamic import as packages. Uses path.isAbsolute for Windows parity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
CI "Test & Build" failure is pre-existing on main: same 2 failures in |
Upstream adcp compliance cache added `expect_substitution_safe` as a pseudo-task used by the sales-catalog-driven storyboard. Like the existing `expect_webhook*` family, it's a runner-observed assertion (delegates to the SubstitutionObserver primitive), not an agent tool, so it has no request builder, sample_request, or response schema. Pre-existing failure on main that was blocking CI across PRs. Runtime support for actually executing the step will land separately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Conflicts resolved: - test/lib/storyboard-completeness.test.js: both sides added `expect_substitution_safe` to HARNESS_TASKS with different comment wording. Took main's wording since it landed first (PR #698). - src/lib/types/core.generated.ts, schemas.generated.ts: took main's version and re-ran sync-schemas + generate-types to confirm no drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 21, 2026
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
Follow-up to #692 (storyboard assertion registry). Adds a CLI surface so operators can dynamic-import assertion modules before the runner resolves
storyboard.invariants: [...].adcp storyboard run ... --invariants ./my-invariants.js,@adcp/invariantsimports each specifier at CLI entry, triggering each module'sregisterAssertion(...)calls. Without this, storyboards that declare invariants would fail at runner start with "Storyboard references unregistered assertion" because nothing is wired to populate the registry.The framework intentionally keeps concrete assertions out of
@adcp/client(they ship fromadcontextprotocol/adcpalongside the specialisms that own them). This flag is the missing hook for that to happen.Shape
path.isAbsolutefor Windows parity.--dry-rungate so bad specifiers surface during preview, not after auth/agent resolution.handleStoryboardRun,handleMultiInstanceStoryboardRun, and thecomplypath throughrunFullAssessment.positionalArgsso module specifiers aren't mistaken for agent aliases.Test plan
\" , , \") → exit 2, not silent no-op--url ... --url ...) also loads modulesRelated
🤖 Generated with Claude Code