# MCP + A2A — Execution Checklist

This is the “ready to start building” checklist that turns the docs in this folder into an executable plan.

## 1) Decisions to make (30–60 minutes)

- **MCP server placement** ✅ — `services/mcp-server/` (standalone Fastify service, port 4006)
- **Integration mode** ✅ — REST-only calls to `platform-service` and `extraction-service` for Phase 1
- **Auth strategy** ✅ — platform-service JWT (same `JWT_SECRET`), role-gated per tool
- **Where to store A2A handoffs** ✅ — Phase 1: structured log entries via `req.log`; Phase 2: Cosmos container

## 2) Must-fix dependency before MVP

- **Diagnostics client/server route mismatch** ✅ VERIFIED — `@bytelyst/diagnostics-client` already
  flushes to session-scoped endpoints (`/api/diagnostics/sessions/:id/logs|traces`). No change needed.
  - Confirmed in `packages/diagnostics-client/src/client.ts` flush() method, lines 430–453

## 3) Phase 1 build steps

### Milestone A + C (P0 slice) ✅ — [027e216](https://github.com/saravanakumardb1/learning_ai_common_plat/commit/027e216)

- [x] `platform.telemetry.*` — query, clusters, metrics (3 tools)
- [x] `platform.diagnostics.*` — sessions.list/create/get/update/getLogs/getTraces (6 tools)
- [x] `extraction.*` — run, models, cacheStats (3 tools)
- [x] `support.createDebugPack(productId, targetUserId?, from?, to?, reason?)`

### Milestone B (mutating tools + expiry + cluster status) ✅ — [26d3403](https://github.com/saravanakumardb1/learning_ai_common_plat/commit/26d3403)

- [x] `platform.telemetry.policies.*` — list, preview, create (expiresAt required), update, delete (5 tools)
- [x] `platform.telemetry.clusters.updateStatus` — resolve/ignore/reopen clusters
- [x] `platform.diagnostics.sessions.cancel` — dedicated cancel tool
- [x] `extraction.sidecarHealth` — Python sidecar health check
- [x] `expiresAt` enforced as **required** field on `telemetry.policies.create` at MCP layer
- [x] `productId` required in all query tools, forwarded as `x-product-id`
- [x] `x-request-id` propagated via `req.id` on every upstream call
- [x] default query caps (`QUERY_DEFAULT_LIMIT=20`) + hard caps (`QUERY_MAX_LIMIT=100`)
- [x] role gating (`viewer` / `admin` / `super_admin`) enforced in `requireRole()`
- [x] expiry for diagnostics sessions delegated to platform-service `maxDurationMinutes`

## 4) Phase 1 definition of done ✅ COMPLETE

- [x] Read-only tools work end-to-end against real services (proxy to platform-service + extraction-service)
- [x] Mutating tools are role-gated (`admin` minimum) and log audit entries via `req.log`
- [x] Compound debug pack produces a single structured artifact with cluster refs, session ref, markdown summary
- [x] Telemetry policy CRUD with mandatory `expiresAt` guardrail
- [x] Error cluster triage (resolve / ignore / reopen)
- [x] Python sidecar health visible via `extraction.sidecarHealth`
- [ ] End-to-end integration test with real platform-service (Phase 2)

## 5) Phase 2 — A2A orchestration ✅ COMPLETE

### Milestone D (A2A runner + handoff schemas) ✅ — d1d643f+

- [x] Handoff artifact schemas (Zod): `SupportIncidentBrief`, `TelemetryFindings`, `DiagnosticsSessionResult`, `FinalIncidentReport`
- [x] `DispatcherAgent` — validates brief, fills default 24h time window, decides which steps to run
- [x] `TelemetryAnalystAgent` — queries clusters, filters by platform, derives hypotheses + actions
- [x] `DiagnosticsOrchestratorAgent` — conditionally creates expiring session based on findings severity
- [x] `ReportWriterAgent` — assembles structured `FinalIncidentReport` + full markdown report
- [x] `runIncidentPipeline` runner — logs every step with stable `runId` + `stepId` (audit tracing)
- [x] `support.runIncidentPipeline` MCP tool — single callable entry point for the pipeline
- [x] `McpToolRequest.log` — structured logger added; `routes.ts` passes `req.log` to all tool calls
- [x] 6 Vitest tests covering: no-session run, session creation, skip when no target, upstream failure, log audit, time window defaulting

### Acceptance criteria ✅

- [x] "Support Debug Pack" runs end-to-end via Dispatcher → Telemetry Analyst → Diagnostics Orchestrator → Report Writer
- [x] Every handoff is logged with stable `runId` + `stepId` (Phase 1: logs; Phase 2+: Cosmos container)

## 6) Phase 3 — Product-specific MCP namespaces ✅ COMPLETE

### Milestone E (all 6 product backends) ✅ — f780f0b + fcb3bef

New files per product: `src/lib/<product>-client.ts` + `src/modules/<product>/<product>-tools.ts`

**MindLyst (port 4014) — 9 tools** ✅

- [x] `mindlyst.memory.list` — list memory items (brainId/filter/pagination)
- [x] `mindlyst.memory.retriage` — re-run extraction on item (updates triageResult)
- [x] `mindlyst.memory.patch` — mark_done / mark_undone / increment_nudge / set_reminder
- [x] `mindlyst.memory.reassign` — reassign item to different Brain
- [x] `mindlyst.brains.list` — list role-based brains
- [x] `mindlyst.briefs.getToday` — get today's Daily Brief
- [x] `mindlyst.briefs.list` — list past Daily Briefs
- [x] `mindlyst.streaks.get` — current/longest streak, freeze status
- [x] `mindlyst.reflections.list` — list reflection journal entries
- [x] `mindlyst.extractions.run` — run text through triage/memory-insight/reflection-enrichment

**LysnrAI (port 4015) — 7 tools** ✅

- [x] `lysnrai.transcripts.list` — list dictation transcripts
- [x] `lysnrai.transcripts.runExtraction` — populate extractions[] on a transcript
- [x] `lysnrai.stt.getBackendStatus` — azure/whisper/none health check
- [x] `lysnrai.sessions.list` — list dictation sessions (filter by status)
- [x] `lysnrai.orgs.list` — list organisations
- [x] `lysnrai.apiTokens.list` — list API tokens
- [x] `lysnrai.apiTokens.rotate` — rotate API token (returns new plaintext token once)

**JarvisJr (port 4012) — 7 tools** ✅

- [x] `jarvis.agents.list` — list coaching agents
- [x] `jarvis.agents.duplicate` — duplicate agent with (Copy) suffix
- [x] `jarvis.sessions.list` — list coaching sessions (filter by agentId)
- [x] `jarvis.sessions.stats` — total sessions, streak, per-agent breakdown
- [x] `jarvis.memory.list` — list agent memories (filter by type/minImportance)
- [x] `jarvis.memory.prune` — prune expired memories for an agent
- [x] `jarvis.memory.getContext` — top-N memories for session context

**ChronoMind (port 4011) — 4 tools** ✅

- [x] `chronomind.timers.list` — list cloud-synced timers (filter type/state)
- [x] `chronomind.timers.delete` — delete a timer
- [x] `chronomind.routines.list` — list routines (filter isTemplate)
- [x] `chronomind.syncStatus` — instant sync health (active/pending/unsynced counts)

**NomGap (port 4013) — 6 tools** ✅

- [x] `nomgap.fasting.sessions.list` — list fasting sessions (filter status/date range)
- [x] `nomgap.fasting.stats` — aggregated stats (streak, longestFast, completionRate)
- [x] `nomgap.fasting.stats.weekly` — this week's fasting summary
- [x] `nomgap.push.fire` — fire push notification (7 trigger types)
- [x] `nomgap.push.stats` — delivery stats by trigger type
- [x] `nomgap.push.pending` — list pending delivery backlog

**PeakPulse (port 4010) — 4 tools** ✅

- [x] `peakpulse.sessions.list` — list adventure sessions (filter activityType/status)
- [x] `peakpulse.sessions.export` — export session as portable JSON summary
- [x] `peakpulse.stats` — aggregated stats (distance, elevation, per-activity)
- [x] `peakpulse.routes.get` — GPS track points + haptic events for a session

### Config additions

- [x] 6 new env vars in `config.ts` + `.env.example`: `MINDLYST/LYSNRAI/JARVISJR/CHRONOMIND/NOMGAP/PEAKPULSE_BACKEND_URL`

## 7) Phase 3 Post-Audit — Bug Fixes & Gap Fill ✅ COMPLETE

### Commit c902266 — Critical bug fixes

- [x] **`/api` prefix missing on ALL 6 product clients** — every route was 404 in production
  - Root cause: all backends register routes with `{ prefix: '/api' }` but clients called paths without it
  - Fix: single-line change per client — `${BASE_URL}/api${path}` in all 6 fetch helpers
- [x] **LysnrAI client path `/organizations` → `/orgs`** — backend route is `GET /orgs` not `/organizations`
- [x] **LysnrAI `lysnraiOrgsList` / `lysnraiApiTokensList` had fake `total` field** — backend doesn't return it
- [x] **`lysnraiApiTokenRotate` calls non-existent endpoint** — `/api-tokens/:id/rotate` doesn't exist in backend; function and `lysnrai.apiTokens.rotate` tool both removed
- [x] **`server.ts` description** — updated to include chronomind/nomgap/peakpulse namespaces

### Commit 481760f — DOMAIN_PRODUCTS.md gap fill (+17 tools, total now 52)

| Product        | New tools                                                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **MindLyst**   | `mindlyst.memory.get` — single item + full TriageResult                                                                                            |
| **LysnrAI**    | `lysnrai.transcripts.get`, `lysnrai.orgs.get`                                                                                                      |
| **JarvisJr**   | `jarvis.agents.create`, `jarvis.marketplace.listPending`, `jarvis.marketplace.certify`, `jarvis.marketplace.suspend`, `jarvis.marketplace.feature` |
| **ChronoMind** | `chronomind.timers.create`, `chronomind.households.list`                                                                                           |
| **NomGap**     | `nomgap.protocols.list`, `nomgap.bodyStages.list`                                                                                                  |
| **PeakPulse**  | `peakpulse.sessions.get`                                                                                                                           |

All new client functions verified against actual backend route files before addition.

## 9) Phase 4 — Tracker namespace ✅ COMPLETE (commit 33dd530)

Added **tracker.\*** namespace (13 tools) backed by platform-service items/votes/comments/public modules.
Client functions appended to `platform-client.ts` (no new client file — tracker lives in platform-service).

| Namespace            | Tools                                          |
| -------------------- | ---------------------------------------------- |
| `tracker.items.*`    | stats, list, get, create, updateStatus, delete |
| `tracker.votes.*`    | toggle, list                                   |
| `tracker.comments.*` | list, add, delete                              |
| `tracker.public.*`   | roadmap, stats                                 |

MCP server total after this commit: **65 tools** across 12 namespaces.

## 10) Phase 5 — Platform ops namespaces ✅ COMPLETE (commit 0f57a48)

Added **19 tools** across 5 new namespaces, all backed by existing platform-service endpoints.

| Namespace       | Tools                                                                              | Count |
| --------------- | ---------------------------------------------------------------------------------- | ----- |
| `flags.*`       | list, get, upsert (create-or-update), delete, killSwitch                           | 5     |
| `jobs.*`        | list, get, trigger, listRuns                                                       | 4     |
| `maintenance.*` | getCurrent (admin full), set, scheduleWindow                                       | 3     |
| `settings.*`    | get, update, checkKillSwitch                                                       | 3     |
| `webhooks.*`    | listSubscriptions, create, get, update, delete, listDeliveries, test, rotateSecret | 8     |

**Note on flags.upsert**: tries PUT first, falls back to POST on 404 — true upsert semantic.
**Note on webhooks.rotateSecret**: new secret returned once — same as creation behavior.

MCP server total after this commit: **84 tools** across 16 namespaces.

## 12) Phase 6 — Product A2A pipelines ✅ COMPLETE (commit 654de4e)

Built 4 A2A pipelines (each self-contained in `src/modules/a2a/<pipeline>.ts`).
Added 3 missing client functions: `mindlystBriefCreate`, `nomgapFastingSessionGet`, `jarvisMarketplaceGetListing`.

| Pipeline                           | Product   | MCP Tool(s)                                          | Agents                                                                                        |
| ---------------------------------- | --------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `DailyBriefGenerationPipeline`     | MindLyst  | `mindlyst.brief.generate`                            | MemoryCollector → Summary (memory-insight extraction) → BriefComposer → Delivery              |
| `MarketplaceCertificationPipeline` | JarvisJr  | `jarvis.marketplace.runCertification`                | SubmissionIngestion → ContentSafety (triage extraction) → QualityEval → CertificationDecision |
| `SafetyMonitorAgent`               | NomGap    | `nomgap.safety.check`, `nomgap.safety.getThresholds` | FastStateInspector → ThresholdEvaluator → SafetyNotification → ExtendedFastHandoff            |
| `SyncDiagnosticsAgent`             | PeakPulse | `peakpulse.sync.diagnose`                            | SyncFailureInspector → DiagnosticsSession → SyncRetryObserver → SyncDiagnosticReport          |

MCP server total after this commit: **91 tools** across 16 namespaces.

## 13) Phase 7 — SDK schemas + cross-product adoption tools ✅ COMPLETE (commit ea16f8d)

Added **6 tools** from `DOMAIN_PACKAGES_AND_SDKS.md` in `src/modules/platform/sdk-tools.ts`.

| Tool                                  | Role   | Description                                                       |
| ------------------------------------- | ------ | ----------------------------------------------------------------- |
| `platform.schemas.telemetryEvent`     | viewer | TelemetryEventDoc field schema + privacy rules                    |
| `platform.schemas.diagnosticsSession` | viewer | DebugSession schema + full endpoint map                           |
| `platform.sdks.swiftCapabilities`     | viewer | ByteLystPlatformSDK 13 modules with phase + description           |
| `platform.sdks.kotlinCapabilities`    | viewer | Android/KMP SDK feature inventory                                 |
| `platform.sdks.crossProductAdoption`  | viewer | 8 capabilities × 6 products adoption matrix + known gaps          |
| `platform.sdks.auditActivity`         | admin  | Live telemetry query — verifies SDK is wired + active per product |

MCP server total after this commit: **97 tools** across 16 namespaces.

## 14) Phase 8 — MCP gap fill + 3 more A2A pipelines ✅ COMPLETE (commit d7aa90b)

### MCP tool gaps filled (DOMAIN_PRODUCTS.md alignment)

| Tool                            | Product   | Route                                         |
| ------------------------------- | --------- | --------------------------------------------- |
| `jarvis.memory.create`          | JarvisJr  | POST `/jarvis/agents/:agentId/memory`         |
| `jarvis.teams.listMembers`      | JarvisJr  | GET `/jarvis/teams/:teamId/members`           |
| `nomgap.fasting.getSession`     | NomGap    | GET `/fasting/sessions/:id` (client existed)  |
| `peakpulse.weather.getSnapshot` | PeakPulse | Derived from `peakpulseSessionGet` `.weather` |

Client additions to `jarvis-client.ts`: `jarvisMemoryCreate`, `jarvisTeamsListMembers`, `JarvisTeamMemberDoc`.

### New A2A pipelines (DOMAIN_PRODUCTS.md priority table — entries 3, 6, 7)

| Pipeline                            | Product    | MCP Tool                                    | Agents                                                                      |
| ----------------------------------- | ---------- | ------------------------------------------- | --------------------------------------------------------------------------- |
| `transcript-extraction-pipeline.ts` | LysnrAI    | `lysnrai.transcripts.runExtractionPipeline` | TranscriptCollector → ExtractionBatch → ExtractionReport (dryRun support)   |
| `sync-conflict-pipeline.ts`         | ChronoMind | `chronomind.sync.diagnoseConflicts`         | ConflictDetector → SyncStateInspector → DiagnosticsSession → ConflictReport |
| `route-safety-pipeline.ts`          | PeakPulse  | `peakpulse.sessions.assessSafety`           | SessionData → RouteProfile → SafetyAnalysis (extraction) → SafetyReport     |

MCP server total after this commit: **93 tools** across 17 namespaces.

## 15) Phase 9 — A2A batch-1: MemoryCurationAgent + EngagementAgent + TriageQualityAgent ✅ COMPLETE

| Pipeline                      | Product  | MCP Tool                        | Agents                                                                           |
| ----------------------------- | -------- | ------------------------------- | -------------------------------------------------------------------------------- |
| `memory-curation-pipeline.ts` | JarvisJr | `jarvis.memory.curate`          | AgentInventory → MemoryScanner → MemoryCurationReport (dryRun support)           |
| `engagement-pipeline.ts`      | NomGap   | `nomgap.engagement.recover`     | AtRiskUserDetector → PushNotificationDispatch → EngagementReport                 |
| `triage-quality-pipeline.ts`  | MindLyst | `mindlyst.memory.triageQuality` | LowConfidenceScanner → RetrageAndReassign → TriageQualityReport (dryRun support) |

MCP server total after this commit: **100 tools** across 17 namespaces.

## 16) Phase 10 — A2A batch-2: STTFallbackMonitorAgent + ProgressAnalystAgent + BrainOverflowAgent ✅ COMPLETE

| Pipeline                           | Product  | MCP Tool                        | Agents                                                                             |
| ---------------------------------- | -------- | ------------------------------- | ---------------------------------------------------------------------------------- |
| `stt-fallback-monitor-pipeline.ts` | LysnrAI  | `lysnrai.stt.monitorFallback`   | TelemetryScanAgent → ThresholdEvalAgent → DiagnosticsSessionAgent → FallbackReport |
| `progress-analyst-pipeline.ts`     | JarvisJr | `jarvis.progress.analyze`       | SessionHistoryAgent → SkillPlateauDetector → PlateauReportAgent                    |
| `brain-overflow-pipeline.ts`       | MindLyst | `mindlyst.brains.checkOverflow` | BrainInventoryAgent → OverflowScanAgent → OverflowReportAgent (dryRun support)     |

MCP server total after this commit: **103 tools** across 17 namespaces.

## 17) Phase 11 — A2A batch-3: ReflectionSynthesisAgent + KeyboardDiagnosticsAgent + NLParserEvalAgent ✅ COMPLETE

| Pipeline                           | Product    | MCP Tool                          | Agents                                                               |
| ---------------------------------- | ---------- | --------------------------------- | -------------------------------------------------------------------- |
| `reflection-synthesis-pipeline.ts` | MindLyst   | `mindlyst.reflections.synthesize` | ReflectionCollector → ThemeExtraction (extraction) → SynthesisReport |
| `keyboard-diagnostics-pipeline.ts` | LysnrAI    | `lysnrai.keyboard.diagnose`       | KeyboardErrorScanner → DiagnosticsSessionAgent → BugReportDraftAgent |
| `nl-parser-eval-pipeline.ts`       | ChronoMind | `chronomind.nlParser.eval`        | PhraseSampler → ParseEvalAgent (extraction) → RegressionReport       |

MCP server total after this commit: **106 tools** across 17 namespaces.

## 18) Phase 12 — A2A batch-4: RoutineQualityAgent + SocialFastCoordinatorAgent + TeamProvisioningAgent ✅ COMPLETE

| Pipeline                              | Product    | MCP Tool                           | Agents                                                                                     |
| ------------------------------------- | ---------- | ---------------------------------- | ------------------------------------------------------------------------------------------ |
| `routine-quality-pipeline.ts`         | ChronoMind | `chronomind.routines.checkQuality` | RoutineInventory → QualityCheck (4 issue types) → QualityReport                            |
| `social-fast-coordinator-pipeline.ts` | NomGap     | `nomgap.social.coordinateFast`     | GroupMemberResolver → NotificationDispatch (social_invite + stage) → CoordinationReport    |
| `team-provisioning-pipeline.ts`       | JarvisJr   | `jarvis.teams.provision`           | NewMemberDetector → OnboardingAgent (role-based agents + memory seed) → ProvisioningReport |

MCP server total after this commit: **109 tools** across 17 namespaces.

## 19) Phase 13 — A2A batch-5: GoalCoachingAgent + SkiRunAnalystAgent + OrgProvisioningAgent + ProtocolTuningAgent + CalendarImportAgent ✅ COMPLETE

| Pipeline                       | Product    | MCP Tool                     | Agents                                                                                       |
| ------------------------------ | ---------- | ---------------------------- | -------------------------------------------------------------------------------------------- |
| `goal-coaching-pipeline.ts`    | PeakPulse  | `peakpulse.goals.coach`      | SessionHistory → GoalAnalysis (trends + level classify) → GoalReport (4-metric suggestions)  |
| `ski-run-analyst-pipeline.ts`  | PeakPulse  | `peakpulse.ski.analyze`      | SkiSessionCollector → RunQualityAnalyst (density/ratio/vertical) → SkiReport + anomaly flags |
| `org-provisioning-pipeline.ts` | LysnrAI    | `lysnrai.orgs.provision`     | OrgInspector → ProvisioningAction (tokens + sessions) → OrgReport (3 status levels)          |
| `protocol-tuning-pipeline.ts`  | NomGap     | `nomgap.protocols.tune`      | ProtocolStatsCollector → AbandonmentAnalysis (extraction) → TuningReport (prioritized recs)  |
| `calendar-import-pipeline.ts`  | ChronoMind | `chronomind.calendar.import` | EventValidator → ConflictDetector (vs existing timers) → ImportReport (dryRun support)       |

MCP server total after this commit: **114 tools** across 17 namespaces.

**All A2A agents from DOMAIN_PRODUCTS.md are now implemented.** Total A2A pipelines: 14 files across all 6 products.

## 20) Phase 14 — Systematic audit: 1 bug fix + 12 DOMAIN_PRODUCTS.md gap tools ✅ COMPLETE

### Bug fixed

| File                                  | Bug                                                                                                                                      | Fix                                                                                                           |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `social-fast-coordinator-pipeline.ts` | `stage_transition` never fired — accessed non-existent `currentStage` field on `FastingSessionDoc` (actual field is `stages: unknown[]`) | Check `session.stages.length > 0`; derive stage label from array length; fix `protocolId` to use direct field |

### New client functions (9 added across 4 client files)

| File                   | Functions added                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| `nomgap-client.ts`     | `nomgapFastingCreateSession`, `nomgapProtocolGet`, `nomgapSocialListGroupFasts` + `GroupFastDoc` |
| `peakpulse-client.ts`  | `peakpulseRoutesList`, `peakpulseSyncStatus`                                                     |
| `lysnrai-client.ts`    | `lysnraiApiTokenCreate`, `lysnraiSessionsStats`, `lysnraiTranscriptsExportBatch`                 |
| `chronomind-client.ts` | `chronomindRoutineGet`, `chronomindSharedTimerShare`                                             |

### New MCP tools (12 added — fills all DOMAIN_PRODUCTS.md spec gaps)

| Tool                              | Namespace  | Description                                                       |
| --------------------------------- | ---------- | ----------------------------------------------------------------- |
| `mindlyst.briefs.generate`        | MindLyst   | Trigger daily brief creation for a date via `mindlystBriefCreate` |
| `mindlyst.memory.getTriageResult` | MindLyst   | Return TriageResult sub-doc only (lighter than full memory.get)   |
| `nomgap.fasting.createSession`    | NomGap     | Start a new fasting session with a protocolId                     |
| `nomgap.protocols.get`            | NomGap     | Fetch a single protocol by ID                                     |
| `nomgap.social.listGroupFasts`    | NomGap     | List group fast sessions (active/completed/cancelled)             |
| `peakpulse.routes.list`           | PeakPulse  | List GPS route documents (track points + bounding box)            |
| `peakpulse.syncStatus`            | PeakPulse  | Offline upload queue depth + last sync timestamp                  |
| `lysnrai.sessions.stats`          | LysnrAI    | Aggregated session stats (total, composed, avg word count)        |
| `lysnrai.transcripts.exportBatch` | LysnrAI    | Batch export transcripts as JSON or TXT                           |
| `lysnrai.apiTokens.rotate`        | LysnrAI    | Atomic revoke + re-issue (returns raw token once)                 |
| `chronomind.sharedTimers.share`   | ChronoMind | Share timer with household/user targets                           |
| `chronomind.routines.validate`    | ChronoMind | Structural validation — step count, duration cap, per-step check  |

**All DOMAIN_PRODUCTS.md MCP tool spec entries are now implemented.**

MCP server total after this commit: **126 tools** across 17 namespaces.

## 21) Phase 15 — Highest-ROI next steps: 7 extraction async jobs tools + 2 A2A pipelines ✅ COMPLETE

### Extraction async jobs tools (7 added)

| Tool                                   | Description                                 |
| -------------------------------------- | ------------------------------------------- |
| `extraction.extractBatch`              | Batch extraction with shared configuration  |
| `extraction.submitJob`                 | Async job submission with webhook callbacks |
| `extraction.getJob`                    | Get job status/results by ID                |
| `extraction.listJobs`                  | List recent async jobs                      |
| `extraction.getProductRateLimitStatus` | Per-product or summary rate limits          |
| `extraction.resetProductRateLimit`     | Admin rate limit reset                      |
| `extraction.sidecarMonitoringState`    | Detailed sidecar circuit breaker state      |

All tools map to existing extraction-service endpoints and require admin role.

### A2A pipelines (2 added)

| Pipeline              | Tool                      | Description                                               |
| --------------------- | ------------------------- | --------------------------------------------------------- |
| Regression Watch      | `a2a.regressionWatch`     | Monitor error clusters → auto-create diagnostics sessions |
| Post-Incident Cleanup | `a2a.postIncidentCleanup` | Resolve clusters + delete policies + export audit logs    |

Both pipelines support `dryRun` mode and use existing platform-service endpoints.

### Implementation notes

- Added 7 client functions to `extraction-client.ts`
- Fixed TypeScript optional parameter error in `extractionGetProductRateLimitStatus`
- Created pipeline files with proper Zod schemas and error handling
- Fixed platform-client function names (`telemetryClusters` not `telemetryListClusters`)
- Used correct `TelemetryCluster` interface properties (`id` not `clusterId`)
- Both pipelines registered in `server.ts` via `a2a-tools.ts`

MCP server total after this commit: **135 tools** across 18 namespaces.

## 11) Phase 5+ quick sanity checks

- If you make telemetry policy-aware clients:
  - ensure `GET /api/telemetry/config` consumption is cached (ETag) and privacy-safe.
- If you add direct Cosmos reads:
  - enforce product scoping at query layer and add explicit auditing for sensitive reads.
