spec(envelope): forbid task_status/response_status at schema level#3044
Merged
spec(envelope): forbid task_status/response_status at schema level#3044
Conversation
…loses #3041) PR #3021 added MUST NOT prose against dual-emitting legacy `task_status` and `response_status` alongside v3 `status`. Reviewer flagged that the rule was only human-discoverable. This lifts the prohibition into the JSON Schema itself via the existing `not: { anyOf: [{ required: [...] }] }` idiom (used by `core/catchment.json`). Any envelope containing `task_status` or `response_status` now fails draft-07 validation against `/schemas/core/protocol-envelope.json` — no runner-side primitive required. The prose MUST NOT in the `status` description remains for implementors reading the schema by eye; the `not` constraint is what validators act on. Verified with ajv: - clean envelope → valid - envelope with task_status → invalid - envelope with response_status → invalid - envelope with both → invalid - envelope with unrelated additional properties → valid (additionalProperties: true unchanged) Non-breaking: the prohibition targets behavior that was already incorrect per #3021. No conformant v3 agent emits these fields. Runtime conformance — a storyboard-level `field_absent` primitive plus @adcp/client implementation — is out of scope here and will be tracked as a follow-up on @adcp/client once the schema-level enforcement has shipped. 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.
Closes #3041
Summary
PR #3021 added normative MUST NOT prose against v3 agents dual-emitting
task_statusorresponse_statusalongsidestatus. Reviewer flagged on #3021 that the rule was only human-discoverable — worth a machine-checkable assertion.This lifts the prohibition into the envelope JSON Schema itself, using the existing
not: { anyOf: [{ required: [...] }] }idiom (the same patterncore/catchment.jsonuses for its mutually-exclusive field groups):Any envelope containing either legacy field now fails draft-07 validation against
/schemas/core/protocol-envelope.json. No runner-specific primitive, no storyboard changes, no client code required — every JSON Schema validator in the ecosystem enforces it.Verification
Ajv-compiled
protocol-envelope.jsonagainst five cases:{ status, payload }(clean){ status, payload, task_status: "completed" }{ status, payload, response_status: "ok" }{ status, payload, task_status, response_status }{ status, payload, custom_field }(unrelated extra)additionalProperties: trueis unchanged — buyers and sellers can still add non-protocol fields; the constraint is narrow to the two named legacy names.Non-breaking
Targets behavior that was already non-conformant per #3021 / the normative prose added to the
statusdescription. No conformant v3 agent emits these fields. No existing example envelope in the schema is affected.Out of scope
Runtime storyboard enforcement — a new storyboard primitive (
field_absent) plus the@adcp/clientimplementation needed to evaluate it would duplicate what schema validation already catches. If a compliance-runner-level hook is still wanted after this ships, I'll file a follow-up on@adcp/clientto wire the envelope schema into every storyboard'sresponse_schemapass — which is where envelope validation naturally belongs.Pre-PR checks
npm run build:schemas— cleannpx changeset status—adcontextprotocol: patchnpm run build— clean (all 10 universal / 6 protocols / 20 specialisms compliance bundles build; latest protocol tarball builds)npx vitest run— 820/820 passing🤖 Generated with Claude Code