Repository navigation
feat(conformance): add $generate:opaque_id and context_outputs[generate] for task ID threading - #1006
Merged
Merged
Conversation
…r context_outputs[generate] - validateContextOutputs: reject entries with neither path nor generate, and entries with both set (exact-one-of invariant, fails loud at parse time) - Runner comment: document that generate: entries fire on failed steps by design - applyContextOutputsWithProvenance JSDoc: clarify alias-cache coherence behavior when context is omitted https://claude.ai/code/session_019NLCMs7GRvm5oTud5i4WCb
…e path Independent reviewer findings on #1006: - Narrow ContextOutput.generate from string to literal union 'uuid_v4' | 'opaque_id'. Loader rejects unknown values at storyboard-load time so a typo (e.g. 'uuidv4') fails loud on build, not silently mints a UUID anyway. - applyContextOutputsWithProvenance throws when generate is set without context. Without context the alias-cache can't be populated, so a later step's $generate:opaque_id#<key> would mint an independent UUID that doesn't match. Loud error beats silent divergence. Runner always passes context so the throw is unreachable in practice — guards the public-API surface. Filed companion adcp#3216 for the upstream storyboard-schema.yaml docs update. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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 #1001
Summary
Storyboard authors exercising the
force_create_media_buy_arm→create_media_buy→force_task_completion→tasks/getlifecycle need to thread one deterministic task ID through 4–5 steps without hardcoding a magic string (which breaks parallel runs). This PR adds two complementary mechanisms:1.
$generate:opaque_idinline substitution — semantic alias for$generate:uuid_v4, sharing the same alias cache. Authors who want to signal "this is a task ID, not a correlation UUID" can write$generate:opaque_id#directive_task_idand it reuses the same cached value as$generate:uuid_v4#directive_task_id.2.
context_outputs[generate]YAML field — lets a step mint a value and immediately expose it as$context.<key>for subsequent steps:Subsequent steps use
$context.directive_task_idinsample_requestand assertion fields. The two forms are alias-coherent: if$generate:opaque_id#directive_task_idwas inline-substituted in the same step'ssample_request, thecontext_outputs[generate]entry reuses that value (not a fresh one).3. Loader validation —
validateContextOutputs(called fromvalidateStoryboardShape) rejects entries with neitherpathnorgenerate(silent no-op), and entries with both set (ambiguous), with a loud error at parse time.4. Type surface —
ContextOutput.pathis now optional (mutually exclusive withgenerate);source_kindonContextProvenanceEntryandContextValueRejectedHintgains'generator'for accurate diagnostic attribution.What was tested
npx tsc --project tsconfig.lib.json— clean (pre-existing config-deprecation warnings only)$generate:opaque_id, 8 forcontext_outputs[generate]), all pass alongside 11 pre-existing generate tests — 59/59 pass across the storyboard context + provenance + rejection-hints suitesvalidateContextOutputsfollows the established pattern ofvalidateBranchSet/validateFixtureForMutatingStep; TypeScript confirms type correctnessNits (not fixed in this PR)
applyContextOutputs(non-provenance export) silently ignoresgenerate:entries; this is documented in the JSDoc and is safe since it has no callers outside the module in practiceadcontextprotocol/adcpstoryboard-schema.yaml needs a companion PR to addgenerate:to thecontext_outputsitem schema so third-party validators don't reject YAML using the new fieldPre-PR review
output.key in cacheexistence check is correct; ReDoS risk niltask_idisz.string()with no format constraint so UUID v4 is valid; step-ordering semantics confirmed correct; upstream schema update noted as out of scope for this PRSession: https://claude.ai/code/session_019NLCMs7GRvm5oTud5i4WCb
Generated by Claude Code