Repository navigation
feat(runner): conform storyboard output to adcp runner-output contract (#599) - #611
Conversation
ff8e311 to
bb8aa0a
Compare
…contract (#599) Implements the actionable-failure contract from adcontextprotocol/adcp#2364: every failed validation now carries RFC 6901 `json_pointer`, structured `expected`/`actual`, `schema_id`/`schema_url` on response_schema checks, and the exact request/response bytes — so buyers can self-diagnose agent failures without re-running the step by hand. Skip reasons migrate to the six spec-aligned values (`not_applicable`, `no_phases`, `prerequisite_failed`, `missing_tool`, `missing_test_controller`, `unsatisfied_contract`) with human-readable `detail`. Request/response payloads are redacted by key name; response headers run through a short allowlist to stop agent-controlled `set-cookie` / `x-internal-*` from landing in shared compliance reports. Agent-controlled `error` and `actual` strings are fenced in the terminal formatter so downstream LLM summarizers can't be hijacked. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bb8aa0a to
1584cd8
Compare
…gning grader (#600) main's new request-signing grader (#585) introduced grader-specific skip reasons (probe_skipped, rate_abuse_opt_out, missing_test_kit_contract, live_side_effect_opt_in_required, operator_skip, not_in_only_vectors, grader_skipped). Keep the six canonical RunnerSkipReason values as the contract-conformant set on skip.reason, and widen skip_reason to also accept RunnerDetailedSkipReason. A DETAILED_SKIP_TO_CANONICAL map projects grader reasons onto their spec equivalents so runner-output consumers see a stable enum regardless of which subsystem emitted the skip. The probe self-skip branch now populates the full set of contract-required fields (request, response_record, extraction, skip) alongside the detailed skip_reason. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Closes the loop on adcontextprotocol/adcp#2352 / adcontextprotocol/adcp#2364. Couple of notes from the spec side. Implementation lands the contract cleanly. Walked the diff of Backporting to the spec. Several of the security decisions here aren't in adcontextprotocol/adcp#2364 yet and should be, otherwise a third-party runner could legitimately claim contract conformance while leaking credentials:
I'll push updates to #2364 referencing #611 as the conforming implementation and backport items 1–4. Happy to cut a follow-up PR on this repo if anything falls out of spec once that lands. One small thing re `text_fallback`. The code note says it's reserved until extraction provenance is plumbed through LGTM on the substance. |
#619) Every StoryboardStepResult.extraction.path now reflects the actual unwrap branch instead of an inference. The response unwrapper tags the unwrapped AdCPResponse with a non-enumerable _extraction_path property; executeStoryboardTask reads it via readExtractionPath() and surfaces it on TaskResult; runner.extractionFromTaskResult prefers the stamped value. rawMcpProbe (which bypasses the unwrapper) sets the tag directly. All four contract values — structured_content, text_fallback, error, none — are now emitted in practice; text_fallback was previously unreachable because provenance was lost during unwrap. Non-enumerable so JSON.stringify, spread, and Object.keys all ignore it — only the runner reads it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…reasons (#617) The request-signing grader's MCP-transport mode (#617) adds a new grader-specific skip reason. Adopt it into RunnerDetailedSkipReason and route it through DETAILED_SKIP_TO_CANONICAL as `not_applicable` — the vector is skipped because the transport doesn't exercise URL-edge semantics, which is a scope gap (agent didn't opt into the vector) not a contract failure. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Closes #599. Conforms the storyboard runner and
comply()output to the universal runner-output contract in adcontextprotocol/adcp#2364 / issue #2352.Today a failed validation reads:
with no actionable detail. After this PR, the same failure carries RFC 6901
json_pointer, the exactschema_id+ fetchableschema_url, AJV-shaped error array, and the request/response bytes — so the buyer diagnoses their agent from the report instead of re-running the step by hand.What changes
Per-validation (on every failure):
json_pointer— RFC 6901 pointer to the failing fieldexpected/actual— machine-readable valuesschema_id/schema_url— onresponse_schemachecksrequest/response— exact bytes the runner sent + observedresponse_schemafailures now emit AJV-shaped{ instance_path, schema_path, keyword, message }[]instead of a flat message stringPer-step:
extraction: { path: "structured_content" | "text_fallback" | "error" | "none" }request/response_recordstoryboard_id— each step is self-describingskip: { reason, detail }— structured skip resultSpec skip reasons. The narrow
"not_testable" | "dependency_failed" | "missing_test_harness" | "missing_tool"enum is replaced by the six contract reasons, each with a human-readabledetailexplaining why (naming the missing tool, the prerequisite step id, the agent's advertised tool list, etc.).Top-level summary: gains
total_steps,steps_passed,steps_failed,steps_skipped, andschemas_used: Array<{ schema_id, schema_url }>.Formatter: terminal output now renders
At:/Expected:/Actual:/Schema:for each failure. Agent-controllederrorandactualstrings run through the existingfenceAgentText()nonce.Security hardening
/^(authorization|credentials?|token|api[_-]?key|password|secret|client[_-]secret|refresh[_-]token|access[_-]token|bearer|session[_-]token|offering[_-]token|cookie|set[_-]cookie)$/ibecome"[redacted]"before they're persisted. The contract spec calls for exactly this.content-type,content-length,content-encoding,www-authenticate,location,retry-after,x-request-id,x-correlation-id); everything else (includingset-cookie,authorization,x-internal-*,x-amz-*) is dropped. Without this a hostile agent could bait the runner into publishing internal breadcrumbs in a shared report.Authorization: Bearer <token>from auth-override probes.error+actualthroughfenceAgentText()so downstream summarizers can't be hijacked by hostile error messages.Tests
test/lib/storyboard-runner-contract.test.js— 14 new tests covering:json_pointeron field_present/field_value, allowed_values expected/actual, schema_id/schema_url on response_schema, AJV shape, no-schema-registered structuredactual, http_status expected/actual, request/response echo on failure (and omission on pass), JSON Pointer RFC 6901 escaping, redaction, header allowlist, skip-reason warnings.test/lib/storyboard-skip-counting.test.js— migratedmissing_test_harness→missing_test_controller.Breaking change
The
StoryboardStepResult.skip_reasonenum is renamed. Third-party automation reading the--jsonoutput needs to migrate from"not_testable"/"dependency_failed"/"missing_test_harness"to the six spec-aligned values. The bundled CLI (bin/adcp.js) is updated in-tree. Minor bump per the changeset.Review
code-reviewerandsecurity-reviewersubagents; all Must Fix and load-bearing Should Fix findings addressed in the committed diff (CLI skip-icon migration, AJVschema_pathcorrectness, structured actual on no-schema,no_phaseswired into the runner, response-header allowlist, request/response redaction, LLM fencing).Test plan
npm run typechecknpm run buildnode --test test/lib/storyboard-runner-contract.test.js test/lib/storyboard-skip-counting.test.js test/lib/storyboard-validations.test.js test/lib/storyboard-observations.test.js test/lib/compliance.test.js test/lib/storyboard-brand-invariant.test.js— all greennode --test test/lib/storyboard-security.test.js— all green (one pre-existing network-dependent test times out; identical behavior onmain)🤖 Generated with Claude Code