docs + lint(storyboards): test-kit flavors + bimodal-partition guard (closes #2721)#2747
Merged
Conversation
closes #2721) #2721 worried that three runner-style test kits (signed-requests, substitution-observer, webhook-receiver) have no auth: block and could produce ambiguous fingerprints if a storyboard composed them with a brand kit. The issue offered three schema changes (A, B, C). Investigation: none of the three are needed. The composition pattern already exists via step-level requires_contract: — used today by sales-catalog-driven and creative-generative to declare a brand kit in prerequisites.test_kit AND opt into the substitution- observer runner contract on specific expect_substitution_safe steps. Pure-harness storyboards (signed-requests/index, webhook-emission) point prerequisites.test_kit directly at the runner contract and use task_default: when $test_kit.operations.<name> resolves to null. `test_kit=<path>` in the contradiction-lint fingerprint separately discriminates brand kits from runner contracts, so auth=kit_default never collides across flavors. This PR: - Adds "Test kit flavors" section to storyboard-schema.yaml formalizing the bimodal partition, naming today's 5 brand kits and 3 runner contracts, documenting the requires_contract: composition seam, softening "runner contracts carry no credentials" to "carry no credentials today" (temporal, not structural — future branded runner is a legitimate shape), and noting that two-runner-contract composition would need requires_contract: to become a list. - Clarifies prerequisites.test_kit field description to explicitly state the single-path invariant. - Adds scripts/lint-storyboard-test-kits.cjs — a small enforcement lint that fails the build when a kit file declares neither auth.api_key nor applies_to. Tolerates both (future-branded-runner shape). Parameterized lint(dir) for synthetic-tree testing. Nine tests cover classify branch asymmetry (string-shape vs presence), hybrid tolerance, defensive null/non-object input, and synthetic- tree end-to-end aggregation. - Wires the lint into build:compliance after auth-shape, and into the aggregate npm test script. Fixes #2721's note that osei-natural "may have auth — verify": it does (demo-osei-natural-v1). 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
Closes #2721 — filed from protocol review of PR #2723 (the resolved-auth fingerprint shape).
The investigation
#2721 worried that three runner-style test kits (`signed-requests-runner`, `substitution-observer-runner`, `webhook-receiver-runner`) have no `auth:` block and could produce ambiguous fingerprints if a storyboard composed them with a brand kit. The issue offered three schema changes (A single-kit + separate `coordination_runner:` field, B array form of `prerequisites.test_kit`, C distinct top-level `coordination:` field).
None of the three are needed. The composition pattern already exists via step-level `requires_contract:` — used today by:
Pure-harness storyboards (`specialisms/signed-requests/index.yaml`, `universal/webhook-emission.yaml`) point `prerequisites.test_kit` directly at the runner contract and use `task_default:` when `$test_kit.operations.` refs resolve to null.
`test_kit=` in the contradiction-lint fingerprint separately discriminates brand kits from runner contracts, so `auth=kit_default` never collides across flavors.
What ships
Docs (primary):
Lint (enforcement, ~70 lines):
Also fixes #2721's "verify osei-natural auth" note: it does have auth (`demo-osei-natural-v1`).
Expert review
Two rounds pre-push:
One bug found + fixed during test authoring: the initial `classify()` used `doc && typeof doc === 'object' && ...` chains that returned `undefined` on short-circuit instead of `false`. Three tests failed on strict equality. Rewrote with an `isObject` gate and explicit boolean returns.
Test plan
🤖 Generated with Claude Code