Repository navigation
Closed as not planned
Labels
go:needs-researchNeeds investigationNeeds investigationpriority:p2Next sprintNext sprintshelvedParked — revisit when conditions changeParked — revisit when conditions changesquadSquad triage inbox — Lead will assign to a memberSquad triage inbox — Lead will assign to a membertype:spikeResearch/investigation — produces a plan, not codeResearch/investigation — produces a plan, not code
Description
Overview
Implement the core A2A (Agent-to-Agent) protocol server and client for Squad CLI, enabling cross-repo squad communication.
Reference
- PRD: See tamresearch1 repo, branch squad/296-cross-repo-a2a, file .squad/research/cross-repo-a2a-prd.md
- Related Issue: tamirdresher_microsoft/tamresearch1#296
Scope
- Embed A2A server in Squad CLI (JSON-RPC 2.0 over HTTP)
- Implement Agent Card generation (JSON schema)
- Core RPC endpoints: decisions, tasks, research
- A2A client library for outbound calls
- Protocol versioning and compatibility
Technical Requirements
- Stack: Node.js + Express + JSON-RPC middleware
- Endpoints:
- \POST /a2a/rpc\ — Main JSON-RPC endpoint
- \GET /a2a/card\ — Agent Card
- \GET /a2a/health\ — Health check
- Message Format: JSON-RPC 2.0
- Transport: HTTP/1.1 (Phase 1), optional gRPC (Phase 3)
- Security: Local-only binding (127.0.0.1) for MVP
Key Capabilities
- \squad.queryDecisions\ — Search decisions in .squad/decisions/\
- \squad.delegateTask\ — Create GitHub issue from remote squad
- \squad.shareResearch\ — Share research documents
Deliverables
- A2A server module (\src/a2a/server.ts)
- JSON-RPC handler (\src/a2a/rpc-handler.ts)
- Agent Card generator (\src/a2a/agent-card.ts)
- A2A client library (\src/a2a/client.ts)
- Unit tests (coverage >80%)
- Integration tests (2 squads communicating)
- API documentation
Dependencies
- A2A Protocol: https://a2a-protocol.org/latest/
- JSON-RPC 2.0: https://www.jsonrpc.org/specification
Success Criteria
- ✅ Two squads can communicate via A2A protocol
- ✅ Query decisions from remote squad <200ms
- ✅ Agent Card conforms to A2A spec
- ✅ All tests passing
Timeline
Phase 1 (MVP): 3 weeks
Notes
Align with A2A v0.3.0 specification for future interoperability with Google ADK, AWS, Azure agents.
Metadata
Metadata
Assignees
Labels
go:needs-researchNeeds investigationNeeds investigationpriority:p2Next sprintNext sprintshelvedParked — revisit when conditions changeParked — revisit when conditions changesquadSquad triage inbox — Lead will assign to a memberSquad triage inbox — Lead will assign to a membertype:spikeResearch/investigation — produces a plan, not codeResearch/investigation — produces a plan, not code
Activity
chore(squad): Phase 2 Wave 1 merged, Wave 2 launched
feat: ghost response detection and retry logic (github#355)
feat: rich progress indicators for agent work (github#357)
style: copy polish — human, fun, action-oriented (github#358)
feat: accessibility hardening and guidelines (github#359)
feat: terminal adaptivity 40-120 col range (github#360)
feat: breathtaking first-run wow moment (github#362)
test: E2E integration tests for REPL flow (github#379)
test: human journey E2E tests - 7 real user scenarios, 39 assertions (g…
Product Love: First 10 seconds that make you want the next 10 minutes (…
fix: correct ThinkingIndicator test assertion (github#415)
Fix github#422: Add context to thinking spinner (github#435)
Fix github#422: Add context to thinking spinner (github#436)
Fix github#420/github#425: Add SDK connection feedback (github#437)
Fix github#432: Show retry warnings earlier (github#441)
16 remaining items
chore: A2A architecture proposal for #332
bradygaster commentedon Mar 16, 2026
Status: Shelved (2026-03-16)
Decision: A2A is shelved for now. Too risky in the short term. The proposal, architecture work, and 5-agent UX impact analysis are preserved below and on branch
squad/332-a2a-core-protocol.We'd love community feedback on whether multi-squad orchestration is something you'd use. If you have thoughts, drop them here.
UX Impact Assessment (5-Agent Verdict)
The team ran a full impact analysis with Flight (architecture), EECOM (runtime), PAO (DevRel), FIDO (testing), and Network (security).
Consensus: GO with conditions — but the conditions are significant:
Key numbers: ~2,500 new lines of code, 200-300 new tests, +10-15% CI time, 5 new doc pages
The strategic question: Is multi-squad orchestration a core product pillar, or exploratory? If nobody builds on it within 6 months, archive it.
Preserved artifacts
squad/332-a2a-core-protocolbranch,.squad/proposals/a2a-core-protocol.mdWhat would unblock this
tamirdresher commentedon Mar 16, 2026
Squad, a few things to think about for the .squad/proposals/a2a-core-protocol.md.
1.now that aspire goes polyglot and AI friendly, should we adopt it to run the disturbated test g for multiple squads?
diberry commentedon Mar 22, 2026
🏗️ Flight's Architecture Proposal — Team-Reviewed
squad obo dina — Flight (Lead) wrote an A2A architecture proposal and the team reviewed it. Below are three review comments from EECOM (Core Dev), CONTROL (TypeScript), and RETRO (Security). Each contains findings that must be addressed before Phase 1 code is written.
Architecture Summary (Flight)
/a2a/card, optional Google format at/.well-known/agent-cardlater.Full proposal:
.squad/decisions/inbox/flight-a2a-protocol-architecture.mdon dev branch.diberry commentedon Mar 22, 2026
🔧 EECOM (Core Dev) — Runtime Feasibility Review
Must-Address Before Phase 1
active-squads.jsonneeds write-to-tmp + rename pattern. Two squad instances starting simultaneously will clobber each other's registration without this. (~50 lines, highest-risk item)active-squads.json. Ghost entries from crashed processes makesquad discoverunreliable. PID liveness check (process.kill(pid, 0)) on read handles stale entries.squadDir/.squad/.a2a-lockwith PID to verify the live process is actually a squad process.start()/stop()lifecycle methods. This is a prerequisite for testable integration tests — top-level scripts can't be tested without child processes.Corrections to the Proposal
DiscoveredSquadneedsa2aEndpointfield. Current type has no network address — onlycontact.repo(a GitHub URL). Adda2aEndpoint?: stringand a'runtime'source type.squad-registry.json(static file paths) vs newactive-squads.json(runtime PID+port) are different schemas solving different problems. Name them distinctly: call the new oneruntime-registry.tsto avoid confusion.node:http, not Express. RemoteBridge already usesnode:httpdirectly. Three endpoints don't justify adding Express (~50KB dependency). Follow the existing pattern.vscode-jsonrpc. That library is for bidirectional streams (LSP transport), not HTTP POST/response. The envelope is ~20 lines of TypeScript.Recommended Scope Changes
/.well-known/agent-cardfrom Phase 1. The capability→skill translation is lossy (Squad capabilities are string tags, Google skills need{id, name, description}). A technically incorrect Agent Card is worse than none. Defer to Phase 2.squad serveshould be a foreground blocking command (likesquad start), not a daemon. Register on start, deregister on SIGINT/SIGTERM.queryDecisionsneeds a scope limit.decisions.mdis 280KB+. Limit to last N bytes or max 5 matches per query. Keep response times under 200ms.delegateTaskneeds opt-in capability declaration in manifest:"a2aCapabilities": ["queryDecisions", "delegateTask"]. Only registered capabilities appear in RPC dispatch table. 5-line change that avoids a security footgun.Estimate Correction
Flight says 500–700 lines. Actual estimate: 800–1000 lines — registry write safety, process lifecycle, and tests are more code than the proposal accounts for. Still 1 week.
diberry commentedon Mar 22, 2026
⚙️ CONTROL (TypeScript) — Type System and SDK Surface Review
Must-Address Before Phase 1
AgentCardmust NOT extendSquadManifest. They are related by atoAgentCard()translation function, not type inheritance. Manifest is Squad-internal (versioned withmanifest.json). AgentCard is wire format (versioned withA2A_PROTOCOL_VERSION). They evolve independently.readonly, noany, arrays asreadonly T[], discriminated unions via string literal fields, no intersection types in wire shapes, JSDoc on every export. This makes Phase 2 TypeSpec migration mechanical, not a rewrite.A2A_PROTOCOL_VERSIONconstant must live inprotocol.ts, independent of SDK semver. Wire format breaking changes increment this version, not necessarily the package version.A2ARequestunion discriminated onmethodliteral field ('squad.queryDecisions' | 'squad.delegateTask'). Compiler enforces exhaustive handling.SDK Export Strategy (Decided)
"./a2a"subpath export topackages/squad-sdk/package.json. A2A types are optional — they should NOT go in the maintypes.tsbarrel. Import asimport type { AgentCard } from '@bradygaster/squad-sdk/a2a'.A2AServerConfigdoes NOT go inSquadSDKConfig. A2A config is a runtime concern (how the server binds), not a team topology concern (what agents exist). Separate lifetimes, separate owners.src/a2a/client.tsstays in the SDK. Extract to standalone package only if demonstrated demand exists.Concrete Type Definitions Provided
CONTROL wrote complete MVP type definitions ready for Phase 1 kickoff:
src/a2a/protocol.ts— JSON-RPC 2.0 envelopes (JsonRpcRequest,JsonRpcResponse,JsonRpcError), error codes (A2A_ERROR_CODES), method params/results (QueryDecisionsParams,DelegateTaskParams), typed request union, serialize/parse helperssrc/a2a/types.ts—AgentCard,A2AServerConfig,A2AClientConfig,ActiveSquadEntrysrc/a2a/index.ts— public barrel (runtime exports + type-only re-exports)src/a2a/agent-card.ts—toAgentCard(manifest)translation functionThese definitions follow
remote/protocol.tspatterns exactly (version constant, discriminated unions, serialize/parse helpers).Google A2A Compatibility (Decided)
AgentCardat/a2a/card(Phase 1)GoogleAgentCardtype insrc/a2a/google-compat.ts(Phase 2)toGoogleAgentCard()function — never merge the two card types into onediberry commentedon Mar 22, 2026
🔒 RETRO (Security) — Threat Model and Security Requirements
🚫 Phase 1 Hard Blockers (must ship with Phase 1)
squad servestartup. Store in registry. RequireAuthorization: Bearer {token}on ALL requests. Without this, any local process (including malicious npm postinstall scripts) can call the A2A server. ~20 lines of code.delegateTaskguards required. This endpoint callsgh issue create— it's the highest-severity item. Requires: label allowlist (only manifest-defined labels), body length cap (2000 chars), rate limit (max 5 calls/minute), target repo fixed to manifest repo (not caller-configurable).127.0.0.1:{port}orlocalhost:{port}. Reject all other Host headers with 403. This defeats DNS rebinding attacks (a documented, real attack class against localhost services).queryDecisionsscope limits. Only searchdecisions.md, NOTinbox/(contains unapproved proposals). Max 10KB response. Min 10-char query (preventsquery: ""full-dump). Max 5 results.~/.squad/registry/active-squads.jsonmust be0600on Unix (icaclsrestricted on Windows). A2A server must validate permissions at startup and refuse to operate if world-readable.GET /a2a/healthreturns a random UUID generated at startup. Client validates UUID matches registry entry before trusting it. This defeats PID reuse attacks..squad/log/a2a-access.log(timestamp, method, source IP).127.0.0.1binding doesn't isolate in these environments.--networkmode)--networkwithout--tlsmust be a startup error, not a warning.rejectUnauthorized: falseanywhere. CI lint rule to enforce.0400(owner read only), enforced at startup.🔴 Red Team Scenario: Malicious npm postinstall
RETRO walked through a complete attack:
postinstallscriptGET /a2a/card→ gets squad name, repo URL, capabilitiessquad.queryDecisionswith query"auth token secret credential"→ exfiltrates architecture decisionssquad.delegateTask→ creates 50 GitHub issues, exhaustsghtoken rate limit for 60 minutesThe Phase 1 security requirements above defeat this attack at Step 3 (bearer token required → 401). Even if token is somehow obtained, rate limiting and scope limits cap the blast radius.
What RETRO Is NOT Blocking
The architecture is sound. The phasing is correct. The stay-shelved recommendation is right. What RETRO requires is that these security acceptance criteria exist on the Phase 1 issue BEFORE that issue is opened for implementation. Specify auth before writing code, not after.
diberry commentedon Mar 31, 2026
🔄 Ralph status: A2A — core protocol implementation. Parent of #333-#336 suite. No PR. Long-term backlog.
bradygaster commentedon Apr 12, 2026
Shelving the A2A initiative for now. Agent-to-agent communication is something we want to get right — we need to take it really slowly and deliberately when we do tackle it. Not pursuing short-term, but we'll revisit when we have a clearer picture of the right patterns. Thanks for the thorough spike @tamirdresher!