@jaggerxtrm/specialists 3.17.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +268 -134
  2. package/config/mandatory-rules/executor-delivery.md +4 -0
  3. package/config/mandatory-rules/json-only-final-output.md +13 -0
  4. package/config/mandatory-rules/service-skills-diff-scan-mandatory.md +26 -0
  5. package/config/mandatory-rules/service-skills-gitnexus-triage.md +5 -0
  6. package/config/mandatory-rules/test-runner-execution-scope.md +4 -0
  7. package/config/skills/setup-specialists/SKILL.md +556 -0
  8. package/config/skills/specialists-creator/SKILL.md +132 -4
  9. package/config/skills/specialists-creator/scripts/audit-spec-uniformity.mjs +1 -1
  10. package/config/skills/using-specialists-v3/SKILL.md +80 -20
  11. package/config/specialists/bare.specialist.json +3 -3
  12. package/config/specialists/changelog-drafter.specialist.json +5 -4
  13. package/config/specialists/changelog-keeper.specialist.json +7 -6
  14. package/config/specialists/debugger.specialist.json +2 -2
  15. package/config/specialists/executor.specialist.json +2 -2
  16. package/config/specialists/explorer.specialist.json +4 -4
  17. package/config/specialists/memory-processor.specialist.json +3 -3
  18. package/config/specialists/node-coordinator.specialist.json +3 -3
  19. package/config/specialists/obligations-scanner.specialist.json +67 -17
  20. package/config/specialists/overthinker.specialist.json +3 -3
  21. package/config/specialists/planner.specialist.json +4 -4
  22. package/config/specialists/quant-methodologist.specialist.json +145 -0
  23. package/config/specialists/quant-researcher.specialist.json +144 -0
  24. package/config/specialists/researcher.specialist.json +5 -5
  25. package/config/specialists/reviewer.specialist.json +1 -1
  26. package/config/specialists/seconder.specialist.json +2 -2
  27. package/config/specialists/security-auditor.specialist.json +2 -2
  28. package/config/specialists/service-skills-sync.specialist.json +90 -75
  29. package/config/specialists/specialists-creator.specialist.json +4 -4
  30. package/config/specialists/sync-docs.specialist.json +4 -4
  31. package/config/specialists/test-engineer.specialist.json +3 -3
  32. package/config/specialists/test-runner.specialist.json +7 -7
  33. package/config/specialists/transcriber.specialist.json +3 -3
  34. package/config/specialists/xt-merge.specialist.json +4 -4
  35. package/dist/asset-contract.json +22 -3
  36. package/dist/index.js +28711 -18517
  37. package/dist/lib.js +10020 -6150
  38. package/dist/types/cli/console/components.d.ts +83 -0
  39. package/dist/types/cli/console/components.d.ts.map +1 -0
  40. package/dist/types/cli/console/config-source.d.ts +58 -0
  41. package/dist/types/cli/console/config-source.d.ts.map +1 -0
  42. package/dist/types/cli/console/forensic.d.ts +11 -0
  43. package/dist/types/cli/console/forensic.d.ts.map +1 -0
  44. package/dist/types/cli/console/git.d.ts +28 -0
  45. package/dist/types/cli/console/git.d.ts.map +1 -0
  46. package/dist/types/cli/console/help.d.ts +2 -0
  47. package/dist/types/cli/console/help.d.ts.map +1 -0
  48. package/dist/types/cli/console/log.d.ts +13 -0
  49. package/dist/types/cli/console/log.d.ts.map +1 -0
  50. package/dist/types/cli/console/repo-config.d.ts +26 -0
  51. package/dist/types/cli/console/repo-config.d.ts.map +1 -0
  52. package/dist/types/cli/console/repo-discovery.d.ts +12 -0
  53. package/dist/types/cli/console/repo-discovery.d.ts.map +1 -0
  54. package/dist/types/cli/console/runtime.d.ts +12 -0
  55. package/dist/types/cli/console/runtime.d.ts.map +1 -0
  56. package/dist/types/cli/console/subscribe-prototype.d.ts +18 -0
  57. package/dist/types/cli/console/subscribe-prototype.d.ts.map +1 -0
  58. package/dist/types/cli/console/theme.d.ts +91 -0
  59. package/dist/types/cli/console/theme.d.ts.map +1 -0
  60. package/dist/types/cli/console/types.d.ts +231 -0
  61. package/dist/types/cli/console/types.d.ts.map +1 -0
  62. package/dist/types/cli/console/view-model.d.ts +252 -0
  63. package/dist/types/cli/console/view-model.d.ts.map +1 -0
  64. package/dist/types/cli/console.d.ts +2 -0
  65. package/dist/types/cli/console.d.ts.map +1 -0
  66. package/dist/types/cli/db.d.ts.map +1 -1
  67. package/dist/types/cli/doctor.d.ts.map +1 -1
  68. package/dist/types/cli/edit.d.ts.map +1 -1
  69. package/dist/types/cli/epic.d.ts.map +1 -1
  70. package/dist/types/cli/feed.d.ts.map +1 -1
  71. package/dist/types/cli/forensic.d.ts +2 -0
  72. package/dist/types/cli/forensic.d.ts.map +1 -0
  73. package/dist/types/cli/format-helpers.d.ts +4 -2
  74. package/dist/types/cli/format-helpers.d.ts.map +1 -1
  75. package/dist/types/cli/help.d.ts.map +1 -1
  76. package/dist/types/cli/init.d.ts +10 -0
  77. package/dist/types/cli/init.d.ts.map +1 -1
  78. package/dist/types/cli/list.d.ts.map +1 -1
  79. package/dist/types/cli/log.d.ts.map +1 -1
  80. package/dist/types/cli/merge.d.ts.map +1 -1
  81. package/dist/types/cli/metrics.d.ts +2 -0
  82. package/dist/types/cli/metrics.d.ts.map +1 -0
  83. package/dist/types/cli/ps.d.ts.map +1 -1
  84. package/dist/types/cli/result.d.ts.map +1 -1
  85. package/dist/types/cli/run.d.ts +20 -0
  86. package/dist/types/cli/run.d.ts.map +1 -1
  87. package/dist/types/cli/script.d.ts +3 -0
  88. package/dist/types/cli/script.d.ts.map +1 -1
  89. package/dist/types/cli/serve.d.ts.map +1 -1
  90. package/dist/types/cli/setup.d.ts +19 -1
  91. package/dist/types/cli/setup.d.ts.map +1 -1
  92. package/dist/types/cli/status.d.ts.map +1 -1
  93. package/dist/types/cli/version-check.d.ts +1 -0
  94. package/dist/types/cli/version-check.d.ts.map +1 -1
  95. package/dist/types/index.d.ts +1 -1
  96. package/dist/types/pi/session.d.ts +12 -1
  97. package/dist/types/pi/session.d.ts.map +1 -1
  98. package/dist/types/server.d.ts +15 -0
  99. package/dist/types/server.d.ts.map +1 -1
  100. package/dist/types/specialist/benchmarks.d.ts +37 -0
  101. package/dist/types/specialist/benchmarks.d.ts.map +1 -0
  102. package/dist/types/specialist/chain-identity.d.ts +7 -1
  103. package/dist/types/specialist/chain-identity.d.ts.map +1 -1
  104. package/dist/types/specialist/control.d.ts.map +1 -1
  105. package/dist/types/specialist/dead-job-audit.d.ts +20 -0
  106. package/dist/types/specialist/dead-job-audit.d.ts.map +1 -0
  107. package/dist/types/specialist/forensic-events.d.ts +138 -0
  108. package/dist/types/specialist/forensic-events.d.ts.map +1 -0
  109. package/dist/types/specialist/forensic-renderer.d.ts +34 -0
  110. package/dist/types/specialist/forensic-renderer.d.ts.map +1 -0
  111. package/dist/types/specialist/git-diff-evidence.d.ts +28 -0
  112. package/dist/types/specialist/git-diff-evidence.d.ts.map +1 -0
  113. package/dist/types/specialist/global-config.d.ts +389 -0
  114. package/dist/types/specialist/global-config.d.ts.map +1 -0
  115. package/dist/types/specialist/launch.d.ts +9 -0
  116. package/dist/types/specialist/launch.d.ts.map +1 -1
  117. package/dist/types/specialist/live-aggregates.d.ts +46 -0
  118. package/dist/types/specialist/live-aggregates.d.ts.map +1 -0
  119. package/dist/types/specialist/loader.d.ts +50 -1
  120. package/dist/types/specialist/loader.d.ts.map +1 -1
  121. package/dist/types/specialist/model-chain.d.ts +7 -0
  122. package/dist/types/specialist/model-chain.d.ts.map +1 -0
  123. package/dist/types/specialist/model-probes.d.ts +28 -0
  124. package/dist/types/specialist/model-probes.d.ts.map +1 -0
  125. package/dist/types/specialist/node-contract.d.ts +18 -18
  126. package/dist/types/specialist/node-supervisor.d.ts.map +1 -1
  127. package/dist/types/specialist/observability-db.d.ts +1 -1
  128. package/dist/types/specialist/observability-db.d.ts.map +1 -1
  129. package/dist/types/specialist/observability-sqlite.d.ts +101 -0
  130. package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
  131. package/dist/types/specialist/pr-drift-refresh.d.ts +17 -0
  132. package/dist/types/specialist/pr-drift-refresh.d.ts.map +1 -0
  133. package/dist/types/specialist/preset-resolver.d.ts +56 -0
  134. package/dist/types/specialist/preset-resolver.d.ts.map +1 -0
  135. package/dist/types/specialist/prometheus-projection.d.ts +25 -0
  136. package/dist/types/specialist/prometheus-projection.d.ts.map +1 -0
  137. package/dist/types/specialist/runner.d.ts +29 -1
  138. package/dist/types/specialist/runner.d.ts.map +1 -1
  139. package/dist/types/specialist/schema.d.ts +163 -54
  140. package/dist/types/specialist/schema.d.ts.map +1 -1
  141. package/dist/types/specialist/script-runner.d.ts +5 -1
  142. package/dist/types/specialist/script-runner.d.ts.map +1 -1
  143. package/dist/types/specialist/snapshot-diff.d.ts +8 -0
  144. package/dist/types/specialist/snapshot-diff.d.ts.map +1 -0
  145. package/dist/types/specialist/source-queue.d.ts +13 -0
  146. package/dist/types/specialist/source-queue.d.ts.map +1 -0
  147. package/dist/types/specialist/status-load.d.ts.map +1 -1
  148. package/dist/types/specialist/supervisor.d.ts +25 -1
  149. package/dist/types/specialist/supervisor.d.ts.map +1 -1
  150. package/dist/types/specialist/timeline-events.d.ts +70 -1
  151. package/dist/types/specialist/timeline-events.d.ts.map +1 -1
  152. package/dist/types/tools/specialist/resume_specialist.tool.d.ts +4 -4
  153. package/dist/types/tools/specialist/specialist_status.tool.d.ts +1 -1
  154. package/dist/types/tools/specialist/steer_specialist.tool.d.ts +4 -4
  155. package/dist/types/tools/specialist/use_specialist.tool.d.ts +16 -16
  156. package/docs/ARCHITECTURE.md +1176 -0
  157. package/docs/TODO.md +9 -0
  158. package/docs/architecture.md +11 -0
  159. package/docs/archive/2026-03-13-bd-decision-context-template-plan.md +96 -0
  160. package/docs/archive/AGENT-HANDOFF.md +351 -0
  161. package/docs/archive/PARITY-ANALYSIS.md +296 -0
  162. package/docs/archive/SPECIALISTS_REFACTOR.md.md +30 -0
  163. package/docs/archive/cc-programmatic.md +216 -0
  164. package/docs/archive/claude-agent-sdk.md +594 -0
  165. package/docs/archive/decision-specialist-directory.md +41 -0
  166. package/docs/archive/discoveries.md +148 -0
  167. package/docs/archive/executor-benchmark-protocol.md +198 -0
  168. package/docs/archive/future-features.md +66 -0
  169. package/docs/archive/gzrx-completion-critique.md +183 -0
  170. package/docs/archive/gzrx-research-notes.md +401 -0
  171. package/docs/archive/gzrx-tool-catalog.md +760 -0
  172. package/docs/archive/iron-review-hardening-qa-chain-substrate.md +322 -0
  173. package/docs/archive/iron-review-hardening.html +1004 -0
  174. package/docs/archive/issuetracking.md +312 -0
  175. package/docs/archive/qa-v3.0.2.md +220 -0
  176. package/docs/archive/restructure.md +231 -0
  177. package/docs/archive/script-specialists.md +1254 -0
  178. package/docs/archive/spec-v3.md +792 -0
  179. package/docs/archive/specialist-stats.md +127 -0
  180. package/docs/archive/specialists-friction-audit.md +1347 -0
  181. package/docs/archive/specialists-runtime-critique.md +170 -0
  182. package/docs/archive/specialists-service-evaluation.md +713 -0
  183. package/docs/archive/specialists-substrate-alignment.md +255 -0
  184. package/docs/archive/substrate-review.md +1288 -0
  185. package/docs/archive/test-writer-specialist.md +254 -0
  186. package/docs/archive/using-specialists-v3-improvements-2026-05-09.md +600 -0
  187. package/docs/archive/xtrm-specialists-analysis.md +314 -0
  188. package/docs/authoring.md +701 -0
  189. package/docs/background-jobs.md +203 -0
  190. package/docs/bare-specialists.md +83 -0
  191. package/docs/benchmarks/executor-benchmark-runner.md +66 -0
  192. package/docs/bootstrap.md +161 -0
  193. package/docs/cli-reference.md +1645 -0
  194. package/docs/deploying-alongside.md +155 -0
  195. package/docs/design/README.md +36 -0
  196. package/docs/design/darth-feedor-migration.md +290 -0
  197. package/docs/design/roadmap/README.md +32 -0
  198. package/docs/design/roadmap/chain-templates/README.md +146 -0
  199. package/docs/design/roadmap/chain-templates/code-quick.formula.json +27 -0
  200. package/docs/design/roadmap/chain-templates/code-standard.formula.json +126 -0
  201. package/docs/design/roadmap/chain-templates/code-with-advisors.formula.json +128 -0
  202. package/docs/design/roadmap/chain-templates/code-with-tests.formula.json +76 -0
  203. package/docs/design/roadmap/chain-templates/debug.formula.json +128 -0
  204. package/docs/design/roadmap/chain-templates/doc-sync.formula.json +28 -0
  205. package/docs/design/roadmap/chain-templates/memory-hygiene.formula.json +27 -0
  206. package/docs/design/roadmap/chain-templates/planning.formula.json +27 -0
  207. package/docs/design/roadmap/chain-templates/premortem.formula.json +26 -0
  208. package/docs/design/roadmap/chain-templates/release-prep.formula.json +36 -0
  209. package/docs/design/roadmap/chain-templates/research-only.formula.json +28 -0
  210. package/docs/design/roadmap/chain-templates/restitch.formula.json +125 -0
  211. package/docs/design/roadmap/chain-templates/security-deep.formula.json +161 -0
  212. package/docs/design/roadmap/chain-templates/test-only.formula.json +52 -0
  213. package/docs/design/roadmap/chain-templates/triage.formula.json +35 -0
  214. package/docs/design/roadmap/history/handoff-from-substrate-design.md +87 -0
  215. package/docs/design/roadmap/history/substrate-reconciliation.md +105 -0
  216. package/docs/design/roadmap/specialists-roadmap.md +1261 -0
  217. package/docs/design/sp-console-subscribe-via-materializer.md +231 -0
  218. package/docs/design/sp-console-tui-mock-v2.html +293 -0
  219. package/docs/design/sp-console-tui-mock.html +120 -0
  220. package/docs/design/sp-console-tui.md +340 -0
  221. package/docs/design/specialist-agentops-suite.md +323 -0
  222. package/docs/design/substrate/channels.md +14 -0
  223. package/docs/design/substrate/devops-platform-engineering-prd.md +446 -0
  224. package/docs/design/substrate/html-design-example.md +339 -0
  225. package/docs/design/xtrm-tiers-architecture.svg +132 -0
  226. package/docs/devops/dependency-verdict-materialization.md +46 -0
  227. package/docs/epic-readiness.md +75 -0
  228. package/docs/examples/mercury-atomic-summarizer.specialist.json +26 -0
  229. package/docs/examples/smoke-echo-text-expected-keys.specialist.json +25 -0
  230. package/docs/examples/smoke-echo.specialist.json +25 -0
  231. package/docs/features.md +1577 -0
  232. package/docs/hooks.md +81 -0
  233. package/docs/installation.md +142 -0
  234. package/docs/manifest.md +184 -0
  235. package/docs/mcp-servers.md +73 -0
  236. package/docs/mcp-tools.md +71 -0
  237. package/docs/nodes.md +231 -0
  238. package/docs/observability-metrics.md +152 -0
  239. package/docs/operator/sp-console-v2-walkthrough.md +410 -0
  240. package/docs/overrides-guide.md +306 -0
  241. package/docs/pi-rpc-boundary.md +118 -0
  242. package/docs/pi-session.md +195 -0
  243. package/docs/release.md +22 -0
  244. package/docs/skills.md +132 -0
  245. package/docs/specialists/handoff-schema.md +181 -0
  246. package/docs/specialists-catalog.md +99 -0
  247. package/docs/specialists-service-install.md +226 -0
  248. package/docs/specialists-service.md +363 -0
  249. package/docs/surface-ownership.md +138 -0
  250. package/docs/upgrade-notes/kan-90-global-user-config.md +114 -0
  251. package/docs/upgrade-notes/kan-91-expanded-overrides.md +261 -0
  252. package/docs/workflow.md +114 -0
  253. package/docs/worktree.md +71 -0
  254. package/docs/worktrees.md +309 -0
  255. package/package.json +7 -4
@@ -0,0 +1,446 @@
1
+ # PRD (DRAFT) — DevOps / Platform Engineering for xtrm + Mercury
2
+
3
+ > **Status:** DRAFT · living document · started 2026-05-30 · operator-driven.
4
+ > **Provenance:** grew out of research epic `unitAI-544sf` (AWS Bedrock AgentCore,
5
+ > AWS DevOps Agent learned-skills, observability, HexStrike) + grounding in
6
+ > `~/dev/gitboard` (Omniforge console) + operator vision notes (2026-05-29/30).
7
+ > **Tracking:** `unitAI-ia1xw` (this doc). Future interactions (transcripts, researcher
8
+ > runs, design passes) build on top of this doc. No devops work-beads filed yet —
9
+ > operator gates that.
10
+ > **Related beads (not yet re-scoped):** `unitAI-rgu4q` (observability, reframed),
11
+ > `unitAI-x84i8` (security-tester), `unitAI-4urhs` (AgentCore eval → Phase 7 R-checks),
12
+ > `unitAI-mg5sm` (SkillOpt pilot), `unitAI-of6dw` (agent-browser hardening).
13
+
14
+ ---
15
+
16
+ ## 0. Cross-repo ownership and source map
17
+
18
+ This document owns the **specialists/substrate/devops** side of the design: agent
19
+ roles, learned operating loops, job/runtime semantics, specialist observability,
20
+ and how a devops specialist acts on infrastructure telemetry. It deliberately
21
+ does not own the platform stack or the console UI.
22
+
23
+ Repo boundaries:
24
+
25
+ - `~/projects/mercury/infra` owns Prometheus, Grafana, Loki, Alertmanager, exporters, Traefik, platform Docker networks/volumes, Terraform/IaC, and the concrete Mercury monitoring stack. See `MONITORING.md` and `docs/AGENT_MONITORING.md`.
26
+ - `~/dev/specialists` owns specialist runtime telemetry and devops/platform-agent semantics. Current telemetry implementation contracts live in `docs/telemetry/{forensic-event-contract,agentops-event-catalog,prometheus-projection-contract}.md`; `docs/observability-metrics.md` is historical/supporting context. See also `docs/specialists-service.md`.
27
+ - `~/dev/gitboard` owns the xtrm operational console/product surface. See `docs/xtrm-observability-prd.md` and `docs/xtrm-console-visual-contract.md`.
28
+
29
+ Research inputs from `/home/dawid/second-mind/1-projects/xtrm/research/` (absolute paths are intentional; future agents should read these exact notes):
30
+
31
+ - `devops-specialists.md` — source/index note for the AWS DevOps Agent video/research thread.
32
+ - `devops-specialists-research.md` — AWS DevOps Agent reference architecture and xtrm/Mercury role split.
33
+ - `sre-telemetry-patterns-for-mercury.md` — what a production SRE telemetry contract needs beyond container status.
34
+ - `agentops-telemetry-for-specialists.md` — token/tool/model/job metrics emitted by the specialists runtime.
35
+ - `devops-query-surfaces-mcp-architecture.md` — Grafana MCP, Prometheus MCP, and custom query facade options.
36
+ - `terraform-first-steps.md` — Terraform boundaries; specialists may propose/validate plans, but human-approved infra owns apply authority.
37
+ - `aws-devops-agent-official-docs.md` — official AWS DevOps Agent evidence: Agent Spaces, Agent Instructions, Skills/Learned Skills, journals, recommendations, EventBridge/API/MCP/ACP/webhook surfaces.
38
+ - `aws-agentcore-observability-official-docs.md` — official AgentCore observability evidence: CloudWatch + OTEL/ADOT, runtime/gateway/identity/policy/eval telemetry, trace/span/session propagation.
39
+
40
+ Design rule: the devops specialist should **consume and compose** infra telemetry;
41
+ it should not fork a parallel monitoring definition. When it needs a missing
42
+ signal, it proposes the metric in the owning repo and then teaches gitboard how
43
+ to display or act on it. The proposal must preserve provenance back to the
44
+ second-mind research note that motivated it.
45
+
46
+ ### 0.1 Integration point with `substrate.md`
47
+
48
+ This PRD is not a parallel workflow system. It is a domain-specific interpretation
49
+ of the substrate model in `docs/design/substrate/substrate.md`. Any designer
50
+ picking this up should read, at minimum, substrate §6.2.1 (`class | type | role`),
51
+ §6.4 (issue birth paths), §6.7 (relationship runtime effects), §6.8
52
+ (channels vs persisted evidence), §6.9.2 (step-issues), §6.10 (close/followup),
53
+ and §10.2 (memory access/distillation).
54
+
55
+ The key design hint is that a DevOps agent should not behave like today's
56
+ orchestrator manually creating flat beads whenever it notices something. In
57
+ substrate terms, it should emit **`proposal`** or **`escalation`** messages into
58
+ the container channel, backed by evidence. Substrate/orchestrator then
59
+ materializes the right issue shape:
60
+
61
+ - **Non-blocking operational recommendation** → `class: followup`, related by
62
+ `discovered-from` to the root. It preserves the finding without blocking the
63
+ current chain.
64
+ - **Current-chain safety blocker** → unsatisfied `class: gate` evidence or an
65
+ escalation that inserts a required step. This blocks because the runtime effect
66
+ is genuinely gate-like.
67
+ - **Accepted standalone work** → promoted to `class: root`, with `type` chosen by
68
+ content: `bug` for incidents/broken behavior, `task` for instrumentation or
69
+ runbooks, `chore` for maintenance, `research`/`spike` for uncertainty, and
70
+ `design` for unresolved architecture.
71
+ - **Pre-work operational advice** → `class: advisor`; **post-work operational
72
+ validation** → `class: gate`. The same `role: devops-*` can occupy both
73
+ classes, just as substrate allows the same role to appear as advisor and gate
74
+ in different positions.
75
+
76
+ AWS DevOps Agent's journal/recommendation model maps well onto substrate's
77
+ channel + evidence split: live investigation notes belong in the channel, while
78
+ recommendations, mitigation plans, trace links, evaluation results, and close-time
79
+ lessons must be persisted as structured evidence or followup/root issues. The
80
+ further design work should therefore specify not only a specialist persona, but
81
+ also the evidence schemas and issue-class materialization rules that let gitboard
82
+ render DevOps journals/recommendations without inventing a second work graph.
83
+
84
+ ### 0.2 Current telemetry bridge status (2026-06-04)
85
+
86
+ The specialists-side AgentOps telemetry bridge is now concrete enough for DevOps
87
+ planning to consume instead of re-inventing telemetry semantics:
88
+
89
+ - `docs/telemetry/forensic-event-contract.md` defines the shipped `xtrm.forensic.v1`
90
+ envelope, 5-layer participant identity, redaction, forbidden-label discipline,
91
+ session/trace/conversation correlation, and implementation status.
92
+ - `docs/telemetry/agentops-event-catalog.md` is the implementation-ready event-name
93
+ catalog for job/turn/model/tool/MCP/service-skills/pulse/identity/policy/eval
94
+ and evidence events.
95
+ - `docs/telemetry/prometheus-projection-contract.md` defines the shipped low-cardinality
96
+ projection: `sp metrics --prometheus` and `sp serve` `GET /metrics`.
97
+
98
+ Shipped surfaces in `~/dev/specialists` now include SQLite forensic rows
99
+ (`specialist_forensic_events`), `sp forensic <job-id> --json`, additive
100
+ `forensic_event` payloads in `sp feed --json` / `sp log --json`, a token-first
101
+ Prometheus projection, full forbidden-label tests, and Pi `session_id` propagation
102
+ into forensic correlation.
103
+
104
+ Boundary: MCP is **not live yet**. MCP telemetry currently has normalization and
105
+ metric-projection pre-wiring only: future `type:"mcp"` timeline events will map to
106
+ canonical `mcp.*` events and keep `mcp_session_id` / `jsonrpc_request_id` /
107
+ trace/span ids in correlation, but there is no real MCP emitter or cross-process
108
+ `_meta` propagation yet. That follow-up is tracked as `unitAI-dl02w`.
109
+
110
+ ---
111
+
112
+ ## 1. Problem & motivation
113
+
114
+ The specialists roster has **no devops/platform agent**. Operating the Mercury
115
+ stack (50+ independently deployable services: agent runtimes, specialist services,
116
+ MCP servers, Dolt, shared LSP, schedulers, APIs, workers) is today **terminal-only +
117
+ a light `gitboard` app**. There is no standardized telemetry, no agentic
118
+ detect→triage→RCA→mitigation loop, no deploy automation behind a stable interface,
119
+ and IaC (Terraform) has been consistently ignored and is not well understood.
120
+
121
+ AWS recently shipped the **AWS DevOps Agent** — a powerful, well-scoped pipeline
122
+ with a full UI/UX and an agent-type family (Generic / On-demand / Incident Triage /
123
+ Incident RCA / Incident Mitigation / Evaluation) plus learned-skills auto-generated
124
+ from telemetry. It is both a **tool** we can wire to our VPS stack and a **reference
125
+ architecture** for the devops capability we want.
126
+
127
+ ---
128
+
129
+ ## 2. Strategic framing — two separate tracks
130
+
131
+ These must NOT be conflated. They run in parallel and inform each other.
132
+
133
+ ### Track A — Product / SDK (the long game)
134
+ 1. Use **specialists/substrate** to build an **"SDK"** for integrating easily into Mercury.
135
+ 2. Dogfooding Mercury surfaces **gaps, bugs, UX problems** → feed them back to improve specialists.
136
+ 3. Harden xtrm into a **product for customers** — become their partner and integrate it
137
+ into their systems reliably.
138
+
139
+ > Mercury is the proving ground that turns xtrm from internal tooling into a sellable platform.
140
+
141
+ ### Track B — Infra / telemetry (actionable now, operator-led)
142
+ 1. **Scan `~/projects/mercury/infra`** to detect what telemetry is missing.
143
+ 2. Use specialists to **map every Mercury repo** and **rebuild better Grafana dashboards now**.
144
+ 3. Decide whether to integrate **beyond Prometheus / Grafana / OpenTelemetry**.
145
+
146
+ > This is what the operator can work on immediately, independent of the product track.
147
+
148
+ ---
149
+
150
+ ## 3. Core principle — coexist & integrate, do NOT rebuild
151
+
152
+ We do **not** recreate Grafana inside the console. We **make the systems coexist**:
153
+ - **Import** Grafana dashboards; **build on top of** Grafana / Prometheus / OpenTelemetry / Terraform.
154
+ - gitboard becomes the **agentic, xtrm-native layer on top of** standard infra (via **MCP + custom tools**), surfacing — not replacing — Prometheus/Grafana.
155
+ - IaC (Terraform-like) is adopted, not reinvented.
156
+
157
+ > Correction to an earlier framing: it is NOT "gitboard vs Grafana." gitboard is the
158
+ > agentic console that *integrates* Grafana/Prometheus/Terraform and adds the agent layer.
159
+
160
+ ---
161
+
162
+ ## 4. The DevOps capability — two operating contexts
163
+
164
+ A single agent spanning both becomes unfocused. Treat as two contexts (likely → distinct
165
+ specialists or one persona with two skill-packs — **open decision §9**).
166
+
167
+ ### 4a. Platform / internal (the specialists/substrate/core stack itself) — *immediately actionable*
168
+ - Automatic agent deployment; server provisioning
169
+ - CPU / RAM / **token usage** monitoring
170
+ - Worktree & job-runner management
171
+ - Alerting on critical services
172
+ - Backup & disaster recovery
173
+ - Platform scalability
174
+ - Full observability of pipeline, MCP, databases
175
+ - `sp ps` verification, cleanup, orphan-process / serena-lsp / dolt monitoring
176
+
177
+ > This context maps directly onto gitboard's existing event-bus + the specialists `observability.db`.
178
+
179
+ ### 4b. Cloud / VPS / AWS (the infra frontier) — *less charted; IaC gap lives here*
180
+ - Build CI/CD pipelines
181
+ - Manage Kubernetes
182
+ - Configure AWS / Azure / GCP
183
+ - Write Terraform
184
+ - Automate deployment
185
+ - Monitor systems; manage alerts
186
+ - Optimize reliability & cost
187
+ - Implement pipeline security
188
+ - Support developers in delivery
189
+
190
+ ---
191
+
192
+ ## 5. Roles & roster additions
193
+
194
+ ### Delivery vs. monitoring — *separable roles, joined at the deploy boundary*
195
+ - **`deployer` specialist (delivery / CI-CD / IaC)** — build → test → scan → publish →
196
+ deploy → health-check. **Per-repo configured.** Owns CI/CD + Terraform.
197
+ - **`devops` / SRE specialist (ops / observability)** — runtime observability, anomaly
198
+ detection, incident triage → RCA → mitigation, capacity & cost.
199
+ - **Handoff = the pulse:** a deploy event fires → Ops watches **pre/post** performance +
200
+ error rates → **pushes back** to Dev on regression. (The Dev↔Ops post-deploy loop.)
201
+
202
+ > Open: one `devops` persona with delivery+ops skill-packs, or two specialists? (§9)
203
+
204
+ ### Deploy-via-specialist (governance primitive)
205
+ - Instead of dev agents running `docker compose up` directly, a correctly per-repo-configured
206
+ devops/deployer specialist is invoked via e.g. **`make spdeploy`**.
207
+ - Dev agents are **instructed** to use it.
208
+ - A **hook + extension forbids direct `docker` commands** (enforcement).
209
+ - Matches the DX principle: complex infra abstracted behind stable interfaces (`mercury deploy`).
210
+
211
+ ---
212
+
213
+ ## 6. AWS DevOps Agent — dual role
214
+
215
+ - **As a tool:** wire it to the VPS stack first (powerful, immediate leverage).
216
+ - **As a reference:** mirror its pipeline + UI/UX + agent-type family (Triage / RCA /
217
+ Mitigation / Evaluation) + learned-skills-from-telemetry for our own specialist(s).
218
+ - Then decide integration shape (§9): wire it into the specialists-service container, vs.
219
+ a dedicated **devops-specialist container** (with a clone of the repo under investigation +
220
+ access to Prometheus metrics).
221
+
222
+ ---
223
+
224
+ ## 6.1 Grounded reference architecture (from re:Invent COP362 + "Introducing" + Tech Tales GA demos)
225
+
226
+ Transcript analyses live in `~/second-mind/inbox/transcripts/*.analysis.md`. They confirm the
227
+ agent is mechanically **LLM reasoning over MCP tools, grounded by a continuously-built topology
228
+ graph** — *"there's nothing special… about GitHub Actions… it's an LLM frankly"* (COP362 30:34);
229
+ *"the key unlock… is thanks to LLMs and MCP"* (33:14). We already have the pieces (specialists =
230
+ LLM reasoning; MCP; GitNexus = code graph; gitboard scanner + event-bus). **What's missing is
231
+ narrow:** an infra topology graph + an MCP query server over our telemetry + a skill encoding the
232
+ RCA loop.
233
+
234
+ **Operating model to mirror:**
235
+ - **Two lanes.** *Reactive* — alarm/ticket/page → pull logs/metrics/traces → build/use topology →
236
+ RCA + mitigation (prepare→pre-validate→apply→post-validate→rollback) → report. *Proactive* —
237
+ background scan of past incidents → clustered posture recommendations (autoscaling safety, IAM
238
+ hardening, health-check rollback, pre-prod test gates). → **Maps onto the pulse primitive:
239
+ event-pulse drives reactive; scheduled-pulse drives prevention. The pulse is the spine.**
240
+ - **Topology / knowledge graph as reasoning substrate.** Built from account resources (IAM-visible
241
+ relations) + telemetry service maps + CI/CD deployment entities; it *limits* the investigation
242
+ search space. → We need an **infra topology graph** (distinct from GitNexus's code graph), fed by
243
+ gitboard's UnifiedScanner + telemetry + deploy events.
244
+ - **Agent space = blast-radius boundary.** IAM-scoped, **read-only by default (get/list/describe,
245
+ no edit)**, segmented by ownership (team/division). Setup ≈ "2 seconds". → Maps to our
246
+ **per-repo/per-source scope + permission tiers**.
247
+ - **Trust-first, staged autonomy.** GA is recommendation-only; action-taking is roadmap, gated by
248
+ the safe-change envelope + human approval ("trust first… then keys to the castle"). →
249
+ **Resolves the autonomy question (§9):** devops specialist starts READ_ONLY/recommend (like
250
+ `security-auditor`), graduates to action behind `make spdeploy` + prepare→validate→rollback.
251
+ - **Team-member embedding.** Triggered by alarms/tickets/pages; writes findings back to
252
+ Slack/ServiceNow; works with other agents; one-click human escalation. → Maps to handoff-notes +
253
+ Dev↔Ops pulse collaboration + operator escalation.
254
+ - **MCP-centric, BYO MCP.** Built-ins (CloudWatch, Dynatrace, Datadog, New Relic, Splunk) + **BYO
255
+ MCP for OSS (Grafana/Prometheus/Loki) and custom** (demo: AgentCore MCP Gateway + Lambda + S3,
256
+ built in ~20–40 min). → **Validates coexist-not-rebuild (§3): AWS itself integrates
257
+ Grafana/Prometheus via MCP, doesn't replace them.** Confirms §7's MCP query server.
258
+ - **Skills / runbooks / steering.** Skills encode triage/RCA *format* (uploadable templates);
259
+ runbooks encode ops micro-hints (log-ingest delay, grep context lines); steering redirects
260
+ in-flight. → **Direct reuse of our skills + mandatory-rules + steering.**
261
+ - **CI/CD correlation.** GitHub/GitLab/CloudFormation → deployments mapped as entities → symptom
262
+ onset correlated to recent change. → Validates the **Dev↔Ops post-deploy pulse**.
263
+ - **Incident → permanent fix.** Mitigation spec handed to Kiro (spec-driven) → property-based
264
+ tests. → Maps to devops → executor/debugger → test-runner; an incident spawns a follow-up bead.
265
+ - **Investigation = parallel subagents**, multi-hypothesis, **documents ruled-out paths**
266
+ (transparency). → Maps to debugger hypotheses + reviewer evidence matrices + workflow parallelism.
267
+ - **Partial-outage interpretation** (old task serving while new tasks fail; deployment stuck) — a
268
+ nuance our monitor must capture, not just green/red.
269
+
270
+ **Benchmarks to mirror for our eval (ties `unitAI-4urhs`):** 1000+ internal incidents, **86% RCA
271
+ success**; Commonwealth Bank **5h→15m** RCA; agent-space quotas (20 agents/acct, 20h investigate +
272
+ 15h prevent/mo in preview); per-second billing offset by AWS support credits. **The gaps they never
273
+ showed** — confidence scoring, false-positive cost, action-stage governance — are exactly the
274
+ R-checks we'd own.
275
+
276
+ ---
277
+
278
+ ## 7. Architecture — design the query path from the get-go
279
+
280
+ A devops agent is only useful if it has a **clear way to analyze** Prometheus, logs, etc.
281
+ This must be accounted for in the **substrate API design from the start**, including:
282
+
283
+ - **An MCP server that lets the devops agent query** — Prometheus metrics, logs, infra state.
284
+ - **Substrate API** surfaces telemetry/query primitives as first-class (not bolted on later).
285
+ - **gitboard devops page** — a dedicated page connected to the infra side, with the devops
286
+ agent integrated; embeds Grafana, surfaces Prometheus, shows incident/triage state.
287
+ - Telemetry is **expanded + standardized** across repos (current Prometheus coverage is
288
+ decent but incomplete and non-uniform).
289
+ - **The MCP query server lives in `mercury/infra` and grows with the telemetry.** As the
290
+ telemetry-standardization pass adds metrics/log streams, the infra MCP exposes them —
291
+ so the devops agent's query surface expands in lockstep with coverage. (Operator point,
292
+ 2026-05-30.) Mirrors AWS's AgentCore MCP Gateway pattern (§6.1) but home-rooted in infra.
293
+ - **Current shipped query substrate:** specialists already exposes AgentOps evidence through
294
+ `sp forensic`, `sp feed/log --json`, and Prometheus metrics. DevOps query-answer work should
295
+ first consume those surfaces, then explicitly mark missing signals as follow-up requests in
296
+ the owning repo. Do not assume live MCP query telemetry until `unitAI-dl02w` and infra-side
297
+ MCP work land.
298
+
299
+ ### 7.1 Per-service knowledge substrate — service skills (gitnexus-enhanced)
300
+
301
+ The devops agent needs per-service operational knowledge, not just raw metrics. We already
302
+ have it: **service skills** (`.xtrm/skills/.../packs/<pack>/<service>/SKILL.md`) are
303
+ expert-persona docs per service — **Architecture, Data Flows, Cross-Service Health Check
304
+ (runnable bash), Failure Modes (symptom/cause/fix), Troubleshooting** — wired to `explorer`
305
+ + `executor` for navigation. This is the direct analogue of the AWS agent's **runbooks +
306
+ per-service topology context** (§6.1).
307
+
308
+ - The **`service-skills-sync` librarian** (`.specialists/user/service-skills-sync.specialist.json`
309
+ in market-data) already keeps these in sync with code drift using **gitnexus**
310
+ (`detect_changes`/`impact`/`context`) + Serena, gated by a `drift_detector.py` pre-scan and
311
+ PostToolUse/pre-commit/pre-push hooks (the `service-skills-set` "Trinity").
312
+ - **Proposal:** propagate gitnexus-awareness into the **default `service-skills-set`**
313
+ (creating/using/updating skills), not just the market-data user override, so every service's
314
+ skill is graph-navigable — and run the librarian as standard maintenance. The devops agent
315
+ then **reads service skills as its per-service runbook/topology layer**; the health-check
316
+ commands + failure-mode tables are exactly what the RCA loop consumes.
317
+ - Reference: example finished pack
318
+ `~/projects/mercury/market-data/.xtrm/skills/user/packs/market-data/ingesting-pipeline/SKILL.md`
319
+ (stack skill: members table, data-flow diagram, cross-service health check, failure-mode table).
320
+
321
+ > **Filed (2026-05-30):** `xtrm-tkqjn` (xtrm-tools) — make the default `service-skills-set`
322
+ > devops-aware + gitnexus-aware (the four workflow skills + registry/hooks), so every install
323
+ > inherits it. Paired with `mercury-market-data-5qts` (market-data) — a spike for a
324
+ > **script-specialist that auto-syncs service skills on master commit/PR-merge**, devops-aware
325
+ > and gitnexus-deep (semantic drift via detect_changes/impact, not mtime).
326
+
327
+ ---
328
+
329
+ ## 8. Foundations / prerequisites (must precede a useful agent)
330
+
331
+ 1. **Telemetry standardization pass** — specialists-side AgentOps telemetry now has a concrete
332
+ forensic/Prometheus bridge (`docs/telemetry/*`), but Mercury infra still needs a first
333
+ exploration pass over **all Mercury repos** (start: `~/projects/mercury/infra`) to inventory
334
+ service metrics/logs and define a **standard emission contract**. The process must be
335
+ standardized, not per-repo ad hoc. → **Filed: `infra-bnh`** (mercury/infra project) — also
336
+ covers the devops query-MCP (grows with telemetry), the OpenTelemetry eval, and the
337
+ Terraform/IaC eval. Infra agents implement.
338
+ 2. **Pulse-emitter primitive** — wake on **events** + **scheduled intervals**. Prototype this
339
+ *now*, ahead of substrate-as-long-running-node landing in the xtrm project group. (When
340
+ substrate lands, this expands into a long-running node.)
341
+ 3. **IaC / Terraform literacy** — close the operator's knowledge gap; underpins provisioning,
342
+ the cloud context, and reproducibility.
343
+ 4. **MCP query server + substrate API hooks** — see §7.
344
+
345
+ ---
346
+
347
+ ## 9. Decisions
348
+
349
+ ### Resolved by the transcript analysis (§6.1)
350
+ - **Autonomy / act-vs-recommend:** devops specialist starts **READ_ONLY / recommend-first** (like
351
+ `security-auditor`), graduates to action behind `make spdeploy` + the
352
+ prepare→pre-validate→apply→post-validate→rollback envelope + human approval. (AWS trust-first path.)
353
+ - **CI/CD vs monitoring:** separable roles (delivery vs ops), joined by the pulse. CI/CD-build is a
354
+ different role, same lifecycle.
355
+ - **Coexist vs rebuild:** coexist — integrate Grafana/Prometheus/Loki via MCP (AWS does exactly this).
356
+ - **Reactive vs proactive:** two lanes, both driven by the pulse primitive (event vs scheduled).
357
+
358
+ ### Still open
359
+ - One `devops` persona (delivery + ops skill-packs) **or** two specialists (`deployer` + `devops`)?
360
+ *(Leaning two: a read-only `devops`/SRE for RCA+prevention, a `deployer` for safe-change delivery.)*
361
+ - Integration shape for AWS DevOps Agent: specialists-service container vs dedicated
362
+ devops-specialist container (repo clone + Prometheus access)?
363
+ - Is the deployer **per-repo export** (like security-pipeline) the right model?
364
+ - Beyond Prometheus / Grafana / OpenTelemetry — integrate more (Datadog-like)? Decide after the
365
+ telemetry pass.
366
+ - IoT / Terraform: scope of IaC adoption.
367
+ - **Infra topology graph** (new primitive, §6.1): build standalone, or extend GitNexus / gitboard's
368
+ scanner? Where does it live and how is it kept fresh?
369
+ - MCP query server: where it lives + auth/permission model (scoped, read-only by default).
370
+
371
+ ---
372
+
373
+ ## 10. Research backlog (run on operator go — `--no-beads` / untracked)
374
+
375
+ - ✅ **DONE — Transcribed + analyzed** (operator-provided; folded into §6.1). Analysis docs in the Obsidian vault (`~/second-mind/inbox/transcripts/`):
376
+ - re:Invent 2025 COP362 "Move beyond reactive: Transform cloud ops with AWS DevOps Agent" — [`AWS-reInvent-2025-Move-beyond-reactive-Transform-cloud-ops-with-AWS-DevOps-Agent-COP362.analysis.md`](~/second-mind/inbox/transcripts/AWS-reInvent-2025-Move-beyond-reactive-Transform-cloud-ops-with-AWS-DevOps-Agent-COP362.analysis.md) · [youtube.com/watch?v=JajBEYle67I](https://www.youtube.com/watch?v=JajBEYle67I)
377
+ - "Introducing AWS DevOps Agent" — [`Introducing-AWS-DevOps-Agent-Amazon-Web-Services.analysis.md`](~/second-mind/inbox/transcripts/Introducing-AWS-DevOps-Agent-Amazon-Web-Services.analysis.md) · [youtube.com/watch?v=fMQfzwS0prQ](https://www.youtube.com/watch?v=fMQfzwS0prQ)
378
+ - "Diving Deep on AWS DevOps Agent | AWS Tech Tales" — [`Diving-Deep-on-AWS-DevOps-Agent-AWS-Tech-Tales.analysis.md`](~/second-mind/inbox/transcripts/Diving-Deep-on-AWS-DevOps-Agent-AWS-Tech-Tales.analysis.md) · [youtube.com/watch?v=uFgGARWSCWk](https://www.youtube.com/watch?v=uFgGARWSCWk)
379
+ - **Researcher (docs):** AWS DevOps Agent official docs — `docs.aws.amazon.com/devopsagent/latest/userguide/about-aws-devops-agent.html`
380
+ - **Researcher (broad scope):** *what a devops agent should be an expert of* — rubric = the
381
+ Responsibilities spec in §11.
382
+ - **Researcher (tech landscape):** **detect what technologies are used in devops** (the stack
383
+ a devops persona must know).
384
+ - **Researcher:** Terraform / IaC from zero — `developer.hashicorp.com/terraform/tutorials/docker-get-started`.
385
+ - **Researcher:** Prometheus + Grafana querying / embedding via MCP + custom tools.
386
+ - **Explorer (READ_ONLY):** Mercury telemetry inventory across repos (`~/projects/mercury/*`).
387
+
388
+ ---
389
+
390
+ ## 11. Reference — DevOps / Platform Engineering Responsibilities for Mercury
391
+
392
+ > Operator-authored rubric. Used as the scope for `researcher` runs and as the
393
+ > capability checklist for the devops specialist(s).
394
+
395
+ **Mission.** DevOps within Mercury is not feature development — it is *enabling developers
396
+ to build, test, deploy, operate, and scale the platform safely, efficiently, repeatably.*
397
+ DevOps owns the platform layer between software engineering and infrastructure; the goal is
398
+ to maximize developer velocity while maintaining reliability, observability, security, and
399
+ operational control. (DevOps → **Platform Engineering**.)
400
+
401
+ **CI/CD.** Fully automated. Every change triggers a standardized pipeline:
402
+ Git Push → Automated Validation → Docker Build → Security Scanning → Artifact Publishing →
403
+ Deployment → Health Verification. Manual deploys are the exception.
404
+
405
+ **Platform & container infra.** Container orchestration, service discovery, secrets mgmt,
406
+ network config, resource allocation, restart policies, environment mgmt, scalability —
407
+ predictable, resilient operation (Compose / Swarm / Nomad / k8s; objective identical).
408
+
409
+ **Observability** (first-class). Real-time visibility into system health, agent execution,
410
+ queue depth, resource consumption, token utilization, failure rates, latency, infra state.
411
+ Central metrics via Prometheus, visualized via Grafana. Examples: active specialists, running
412
+ / waiting jobs, LSP instance counts, Dolt server counts, token consumption, memory, CPU, API
413
+ latency, queue growth.
414
+
415
+ **Alerting.** Detect abnormal states and route to operators before user impact:
416
+ `dolt_servers > expected_count`, `queue_depth > threshold`, `memory_usage > threshold`,
417
+ `token_consumption > budget`, `specialist_failure_rate > threshold`, duplicate infra
418
+ processes, MCP connectivity failures, DB unavailability.
419
+
420
+ **Reliability engineering.** Graceful failure: automatic restarts, health checks, retries,
421
+ failure isolation, backups, recovery & DR — no single-component failure cascades platform-wide.
422
+
423
+ **Capacity planning.** Continuously answer: how many specialists/LSP instances concurrently;
424
+ peak memory; bottleneck services; marginal cost of workload; throughput limits.
425
+
426
+ **Cost management.** Track token consumption, model usage, compute, storage growth, network,
427
+ and per-service cost. For specialists/xtrm LLM usage, the reliable current signal is token
428
+ usage by direction/category; per-run USD is deferred until direct API billing or versioned
429
+ pricing provenance exists. Determine: most expensive agents/workflows, cost proxies per
430
+ job/user/workflow-category, and where real infra billing data is available. Operational
431
+ visibility includes **financial** visibility without inventing misleading cost attribution.
432
+
433
+ **Developer experience (DX).** Reduce friction; devs shouldn't need deep ops knowledge.
434
+ Expose simple workflows: `mercury new-specialist`, `mercury test`, `mercury deploy`,
435
+ `mercury logs`, `mercury debug`. Abstract infra behind stable interfaces.
436
+
437
+ **Security.** Embedded in the platform lifecycle: secret mgmt, credential rotation, dependency
438
+ & container-image scanning, access control, audit logging, supply-chain validation — automated
439
+ wherever possible.
440
+
441
+ **Summary.** The real objective is not deploying 50+ services — it's providing immediate answers:
442
+ why is a workflow delayed; which agent is consuming excessive tokens; why are extra LSP instances
443
+ spawning; which component is failing; current operational cost; where the platform bottleneck is.
444
+ A successful Mercury platform lets developers focus on building agents/features while the system
445
+ provides deployment automation, observability, reliability, scalability, security, and
446
+ operational insight **by default**.