← Back to Pull requests

feat(core): add A2A agent card, delegation endpoint, and MCP server card #266

Open
unknown opened this pull request with 231 lines diff across 2 files
View on GitHub
unknown unknown commented on Sep 19, 2026 14:21 UTC
Author

Description

Adds A2A discovery and delegation, plus the MCP Server Card, per the scope agreed in #183.

| Route | Auth |
|---|---|
| GET /.well-known/agent-card.json: A2A Agent Card | public |
| POST /a2a: JSON-RPC message/send delegation | bearer / JWT |
| GET /mcp/server-card: MCP Server Card (SEP-2127) | public |
| GET /.well-known/mcp-server-card: same card | public |

Key points

  • /a2a takes a structured {tool, arguments} payload in a DataPart. There's no natural-language parsing.

  • Persona gating, rate limiting, and audit logging are reused. /a2a gets the same filtered, audit-wrapped tools as MCP, so tools outside the persona return -32004.

  • The confirm gate still applies. Arguments pass through as sent, so fine_tune returns a preview unless confirmed: true is set.

  • Malformed input (arrays, null, scalars, bad parts) returns -32600 / -32602, never a 500.

  • Both cards list high-level capabilities only, never tool names or schemas.

  • The server card is derived from server.json and excludes tools, as SEP-2127 requires.

  • Stateless: results come back inline, with no SSE.
  • For review: SEP-2127's body and its current draft name different paths, so the server card is served at both. Happy to drop one.

    Also fixes the stale /.well-known/mcp.json references in ROADMAP and ARCHITECTURE.

    Related Issue

    Closes #183

    Checklist

  • I have read the CONTRIBUTING guide

  • Tests pass locally (make test-python)

  • Linting passes (make verify)

  • Documentation updated

  • Commits signed off
  • Testing

  • 55 new unit tests; full suite passes (726)

  • Manually tested against a live server:

  • - readonly is refused fine_tune over /a2a
    - data-scientist gets the preview, and the call shows up in the audit log

    Diff: 231 lines (+173 / -58) across 2 files Reviewer: myselfkunal Review duration: 85022m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 231 lines diff across 2 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.326
    Real PR Conversation Timeline
    1 comments
    "Review active on #266"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44% (MEDIUM) · Higher = larger blast radius
    44%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.3% · Safe to merge
    24.3%