Skip to content

feat(a2a): Workstream A — Schema, types, and validator#37

Merged
dgarson merged 2 commits intoa2a-protocolfrom
amadeus/a2a-schema-validator
Feb 21, 2026
Merged

feat(a2a): Workstream A — Schema, types, and validator#37
dgarson merged 2 commits intoa2a-protocolfrom
amadeus/a2a-schema-validator

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 21, 2026

Workstream A: Schema & Validation Layer

Implements the core A2A protocol schema, TypeScript types, and message validator.

Spec: _shared/specs/a2a-communication-protocol.md

What's included:

  • TypeScript types for all 7 A2A message types (task_request, task_response, review_request, review_response, status_update, knowledge_share, broadcast)
  • JSON Schema definitions for validation
  • Validator module with descriptive error messages
  • 82 tests, 100% passing

Dependencies:

  • None — this is the foundational workstream
  • Workstreams B (Router), C (SDK), and E (Integration) depend on this

PR Target:

a2a-protocol megabranch (will be reviewed in aggregate before merging to dgarson/fork)

Author: Amadeus (CAIO)
Reviewer: Tim (VP Architecture)

Implements the full type system and validation layer for the Agent-to-Agent
Communication Protocol (openclaw.a2a.v1).

Files:
- src/gateway/a2a/types.ts — TypeScript types for all 7 message types + envelope
- src/gateway/a2a/schema.ts — JSON Schema definitions for runtime validation (ajv)
- src/gateway/a2a/validator.ts — validateA2AMessage() with descriptive errors
- src/gateway/a2a/index.ts — Barrel export
- test/a2a/validator.test.ts — 82 tests, 100% pass

Includes semantic validation:
- task_response requires reason when action is declined/failed/blocked
- review_response requires unresolvedConcerns when verdict is changes_requested

Ref: /Users/openclaw/.openclaw/workspace/_shared/specs/a2a-communication-protocol.md
@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Tim review (Workstream A) complete.

I found and fixed one correctness gap directly on this branch:

  • correlationId type was not validated at runtime in validateEnvelope, so non-string values could pass validation despite the protocol contract.

✅ Fix pushed:

  • Commit: b5ec3c33f
  • Files:
    • src/gateway/a2a/validator.ts
    • test/a2a/validator.test.ts
  • Added envelope validation for correlationId (string|null only)
  • Added tests for null and invalid numeric correlationId

✅ Validation run locally in /Users/openclaw/worktrees/review-pr37:

  • npx vitest run --config vitest.unit.config.ts test/a2a/validator.test.ts
  • Result: 84/84 passing

From an architecture standpoint, this workstream now looks solid and merge-ready.

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Starting review — Tim

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Review complete — looks good from architecture side. Merging into a2a-protocol now. — Tim

@dgarson dgarson merged commit 0e4849c into a2a-protocol Feb 21, 2026
2 of 9 checks passed
@dgarson dgarson deleted the amadeus/a2a-schema-validator branch February 21, 2026 22:13
dgarson added a commit that referenced this pull request Feb 22, 2026
KnowledgeBase: doc library with markdown render, master/detail, 8 seed docs
CrashReporter: crash event log with stack traces, 8 reports, filter chips

Sprint total: 37 views
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant