@mutagent/helix 0.1.0-alpha.14

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 (357) hide show
  1. package/.claude/skills/mutagent-helix/SKILL.md +113 -0
  2. package/.claude/skills/mutagent-helix/scripts/cli/codex-transcode.ts +143 -0
  3. package/.claude/skills/mutagent-helix/scripts/cli/doctor.ts +111 -0
  4. package/.claude/skills/mutagent-helix/scripts/cli/init.ts +382 -0
  5. package/.claude/skills/mutagent-helix/scripts/cli/run.sh +61 -0
  6. package/CLAUDE.md +193 -0
  7. package/LICENSE +201 -0
  8. package/NOTICE +22 -0
  9. package/README.md +209 -0
  10. package/assets/adl-loop.svg +162 -0
  11. package/assets/system-status.svg +422 -0
  12. package/bin/mutagent-cli.mjs +9950 -0
  13. package/bin/mutagent-helix.mjs +78 -0
  14. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/CLAUDE.md +28 -0
  15. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/SKILL.md +138 -0
  16. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/assets/templates/agentspec.yaml.tpl +247 -0
  17. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/references/frameworks/doc-pins.md +53 -0
  18. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/references/principles.md +91 -0
  19. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/references/requirements.yaml +295 -0
  20. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/references/workflows/orchestrator-protocol.md +302 -0
  21. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/cli/doctor.ts +116 -0
  22. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/cli/init.ts +230 -0
  23. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/cli/run.sh +60 -0
  24. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/config/resolve-spec-dir.ts +199 -0
  25. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/contract/agentspec.schema.ts +455 -0
  26. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/setup/detect.ts +67 -0
  27. package/mutagent-agentspec/.claude/skills/mutagent-agentspec/scripts/validate/validate-spec.ts +93 -0
  28. package/mutagent-agentspec/LICENSE +201 -0
  29. package/mutagent-agentspec/NOTICE +19 -0
  30. package/mutagent-agentspec/README.md +44 -0
  31. package/mutagent-builder/.claude/skills/mutagent-builder/SKILL.md +100 -0
  32. package/mutagent-builder/.claude/skills/mutagent-builder/assets/agents/ai-architect.md +312 -0
  33. package/mutagent-builder/.claude/skills/mutagent-builder/assets/agents/ai-engineer.md +357 -0
  34. package/mutagent-builder/.claude/skills/mutagent-builder/assets/templates/build-report.md.tpl +39 -0
  35. package/mutagent-builder/.claude/skills/mutagent-builder/references/principles.md +31 -0
  36. package/mutagent-builder/.claude/skills/mutagent-builder/references/workflows/build-protocol.md +61 -0
  37. package/mutagent-builder/.claude/skills/mutagent-builder/references/workflows/improve-handoff.md +23 -0
  38. package/mutagent-builder/.claude/skills/mutagent-builder/scripts/cli/run.sh +60 -0
  39. package/mutagent-builder/.claude/skills/mutagent-builder/scripts/handoff/validate-build-input.ts +72 -0
  40. package/mutagent-builder/.claude/skills/mutagent-builder/scripts/sync-spec/check-sync-spec.ts +499 -0
  41. package/mutagent-builder/.claude/skills/mutagent-builder/scripts/verify/spec-impl-coverage.ts +182 -0
  42. package/mutagent-builder/CLAUDE.md +25 -0
  43. package/mutagent-builder/README.md +26 -0
  44. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/README.md +192 -0
  45. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/SKILL.md +352 -0
  46. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/agents/ai-architect.md +256 -0
  47. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/agents/ai-engineer.md +344 -0
  48. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/agents/diagnostics-analyzer.md +576 -0
  49. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/agents/discovery.md +425 -0
  50. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/audit.json.tpl +24 -0
  51. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/audit.md.tpl +49 -0
  52. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/config.yaml.tpl +100 -0
  53. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/pr-body.md.tpl +56 -0
  54. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/report.html.tpl +327 -0
  55. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/README.md +27 -0
  56. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/iter-N-handover.md.tpl +125 -0
  57. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/self-diagnosis-contract.v0.1.0.yaml.tpl +234 -0
  58. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/spec.yaml.tpl +152 -0
  59. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/team.yaml.tpl +127 -0
  60. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/templates/shared/wave-N-dashboard.html.tpl +1712 -0
  61. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.1-nl-query.md +59 -0
  62. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.2-tier0-progress.md +58 -0
  63. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.3-analysis-progress.md +44 -0
  64. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.4-html-report.md +61 -0
  65. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.5-rca-detail.md +69 -0
  66. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/diagnostics/WF-2.6-stale-warning.md +53 -0
  67. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.1-welcome.md +60 -0
  68. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.2-source-platform-picker.md +41 -0
  69. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.3-source-auth.md +75 -0
  70. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.4-target-picker.md +48 -0
  71. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.5-ask-tool.md +43 -0
  72. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.6-config-review.md +57 -0
  73. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.7-filter-defaults.md +52 -0
  74. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/assets/wireframes/onboarding/WF-1.8-first-run.md +59 -0
  75. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/examples/sample-findings.json +92 -0
  76. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/examples/sample-meta.json +47 -0
  77. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/adapter-strategy.md +75 -0
  78. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/config-migration.md +84 -0
  79. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/config.md +159 -0
  80. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/filter-search-matrix.md +66 -0
  81. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/harness-knowledge.md +22 -0
  82. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/memory-format.md +78 -0
  83. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/onboarding-decisions.yaml +187 -0
  84. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/operation-inventory.md +59 -0
  85. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/overview.md +167 -0
  86. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/reference.md +119 -0
  87. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/script-index.md +101 -0
  88. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-adapter-contract.md +93 -0
  89. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/claude-code-transcripts.md +66 -0
  90. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/codex-transcripts.md +78 -0
  91. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/codex.md +145 -0
  92. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/install-paths.md +57 -0
  93. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/langfuse.md +178 -0
  94. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/local-jsonl.md +55 -0
  95. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/openobserve.md +102 -0
  96. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/source-platforms/otel.md +63 -0
  97. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/cloud-rest.md +84 -0
  98. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-claude.md +65 -0
  99. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-cloud-agent-sdk.md +92 -0
  100. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-codex.md +72 -0
  101. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-cursor.md +108 -0
  102. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-mastra.md +77 -0
  103. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/target-platforms/local-opencode.md +70 -0
  104. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/apply-pr-comment-format.md +82 -0
  105. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/diagnostics.md +35 -0
  106. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/handover-contract.md +247 -0
  107. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/onboarding.md +300 -0
  108. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/orchestrator-protocol.md +1861 -0
  109. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/rca.md +331 -0
  110. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/rendering-anatomy.md +314 -0
  111. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/schedule-prep.md +100 -0
  112. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/scope-model.md +128 -0
  113. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/references/workflows/verification-methodology.md +174 -0
  114. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/aggregate/sort-findings.ts +0 -0
  115. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/awareness/blind-spots.ts +167 -0
  116. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/awareness/llm-sample.ts +681 -0
  117. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/cli/doctor.ts +215 -0
  118. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/cli/init.ts +1013 -0
  119. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/cli/install-agents.ts +350 -0
  120. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/cli/run.sh +61 -0
  121. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/cli/shared-templates.ts +79 -0
  122. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/config/load.ts +392 -0
  123. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/config/resolve-credential.ts +120 -0
  124. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/config/schema.ts +641 -0
  125. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/config/validate.ts +134 -0
  126. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/context/build-diagnosis-context.ts +417 -0
  127. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/context/load-context.ts +105 -0
  128. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/contract/types.ts +166 -0
  129. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/enrich/build-render-input.ts +1964 -0
  130. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/enrich/corpus-severity.ts +172 -0
  131. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/enrich/dismissal-match.ts +270 -0
  132. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/enrich/rank-remedies.ts +75 -0
  133. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/hooks/install-hooks.sh +46 -0
  134. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/hooks/pre-push.sh +78 -0
  135. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/invocation/parse-brief.ts +188 -0
  136. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/library/match.ts +114 -0
  137. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/library/paths.ts +95 -0
  138. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/library/store.ts +535 -0
  139. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/library/types.ts +181 -0
  140. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/lint/template-inline-js.ts +267 -0
  141. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/memory/append.ts +188 -0
  142. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/memory/read.ts +218 -0
  143. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/normalize/platforms/entity-context.ts +686 -0
  144. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/normalize/read-unitf.ts +267 -0
  145. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/normalize/trace.ts +1078 -0
  146. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/normalize/unitf-adapter.ts +0 -0
  147. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/normalize/unitf-types.ts +213 -0
  148. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/report/persist-selections.ts +174 -0
  149. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/report/render.ts +3254 -0
  150. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/run/diagnose.ts +64 -0
  151. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/run/session.ts +167 -0
  152. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/sample/caps.ts +345 -0
  153. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/sample/deep-read-gate.ts +424 -0
  154. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/sample/representative.ts +584 -0
  155. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/scan/objection.ts +224 -0
  156. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/scan/trajectory.ts +489 -0
  157. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/self-diagnostics/dispatch.ts +135 -0
  158. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/self-diagnostics/probe.ts +170 -0
  159. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/setup/detect.ts +307 -0
  160. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/setup/ensure-cli.ts +315 -0
  161. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/setup/reconfigure.ts +77 -0
  162. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/setup/verify-agents.ts +207 -0
  163. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/slicer.ts +166 -0
  164. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/adapters/claude-code.ts +17 -0
  165. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/adapters/codex.ts +11 -0
  166. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/adapters/langfuse.ts +17 -0
  167. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/adapters/local-jsonl.ts +12 -0
  168. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/adapters/otel.ts +12 -0
  169. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/index.ts +54 -0
  170. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/registry.ts +45 -0
  171. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/source/types.ts +86 -0
  172. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/stale-detector.ts +74 -0
  173. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/test/render-playwright.cli.ts +477 -0
  174. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/tier0/claude-code.ts +133 -0
  175. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/tier0/langfuse.ts +143 -0
  176. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/tier0-scan.ts +423 -0
  177. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/completeness-check.ts +436 -0
  178. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/doc-refs.ts +190 -0
  179. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/finalize-gate.ts +417 -0
  180. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/findings-contract.ts +628 -0
  181. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/render-js-syntax.ts +188 -0
  182. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/report-checklist.yaml +217 -0
  183. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/trace-shape.ts +262 -0
  184. package/mutagent-diagnostics/.claude/skills/mutagent-diagnostics/scripts/validate/wave6-checklist.ts +326 -0
  185. package/mutagent-diagnostics/CLAUDE.md +41 -0
  186. package/mutagent-diagnostics/LICENSE +201 -0
  187. package/mutagent-diagnostics/NOTICE +18 -0
  188. package/mutagent-diagnostics/README.md +343 -0
  189. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/SKILL.md +548 -0
  190. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/agents/audit-executor.md +169 -0
  191. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/agents/dataset-builder.md +160 -0
  192. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/agents/discovery.md +425 -0
  193. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/agents/evaluator.md +1108 -0
  194. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/brand/theme.css +213 -0
  195. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/assets/brand/wordmark.html +9 -0
  196. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/lenses/context-flow-lens.md +85 -0
  197. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/lenses/data-lens.md +47 -0
  198. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/lenses/decision-lens.md +48 -0
  199. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/lenses/methodology-critic-lens.md +53 -0
  200. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/lenses/trajectory-lens.md +44 -0
  201. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/build-review-interface.md +83 -0
  202. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/edd-loop.md +134 -0
  203. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/error-analysis.md +113 -0
  204. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/eval-audit.md +154 -0
  205. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/eval-stage.md +168 -0
  206. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/generate-synthetic-data.md +81 -0
  207. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/grounded-adjudication.md +221 -0
  208. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/memory-format.md +65 -0
  209. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/methodology.md +201 -0
  210. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/operation-inventory.md +197 -0
  211. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/validate-evaluator.md +125 -0
  212. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/workflows/orchestrator-protocol.md +300 -0
  213. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/references/write-judge-prompt.md +123 -0
  214. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/behavior-tree.schema.yaml +73 -0
  215. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/dataset.schema.yaml +66 -0
  216. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/edd-change-request.schema.yaml +114 -0
  217. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/eval-matrix.schema.yaml +74 -0
  218. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/flow-graph.schema.yaml +69 -0
  219. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/flow-profile.schema.yaml +49 -0
  220. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/methodology-review.schema.yaml +40 -0
  221. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/schemas/scorecard.schema.yaml +85 -0
  222. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/agent-dispatch.ts +0 -0
  223. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/aggregate-discover.ts +543 -0
  224. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/artifact-paths.ts +115 -0
  225. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/assemble-scorecard.ts +172 -0
  226. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/build-dataset.ts +186 -0
  227. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/build-evals.ts +93 -0
  228. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/build-review-ui.ts +393 -0
  229. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/check-method-router.ts +170 -0
  230. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/aggregate.ts +112 -0
  231. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/audit-run.ts +182 -0
  232. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/doctor.ts +211 -0
  233. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/dogfood.ts +133 -0
  234. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/init.ts +601 -0
  235. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/methodology-review.ts +122 -0
  236. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/prep.ts +295 -0
  237. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/profile-subject.ts +165 -0
  238. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/run.sh +56 -0
  239. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cli/variance-check.ts +105 -0
  240. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/code-eval.ts +248 -0
  241. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/code-quality-verdict.ts +285 -0
  242. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/codegen-evals.ts +173 -0
  243. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cold-start-project.ts +151 -0
  244. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/cold-start-sampler.ts +267 -0
  245. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/config/load.ts +343 -0
  246. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/config/schema.ts +380 -0
  247. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/agentspec-evals.ts +85 -0
  248. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/dataset.ts +149 -0
  249. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/eval-engine.ts +118 -0
  250. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/eval-matrix.ts +577 -0
  251. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/eval-types.ts +1074 -0
  252. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/flow-graph.ts +194 -0
  253. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/types.ts +303 -0
  254. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/contracts/validation.ts +193 -0
  255. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/derive-dataset.ts +152 -0
  256. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/determine-outcome.ts +219 -0
  257. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/diff-discriminate.ts +160 -0
  258. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/discover-criteria.ts +348 -0
  259. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/edd/change-request.ts +232 -0
  260. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/edd/edd-types.ts +210 -0
  261. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/edd/variance-gate.ts +186 -0
  262. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/emit-completeness.ts +111 -0
  263. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/eval-engine.ts +160 -0
  264. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/evaluate.ts +333 -0
  265. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/flow-graph.ts +230 -0
  266. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/judge-prompt-template.ts +253 -0
  267. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/judge-provider.ts +135 -0
  268. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/lint-grounding.ts +229 -0
  269. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/lint-uniformity.ts +168 -0
  270. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/living-suite.ts +109 -0
  271. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/load-bundle.ts +203 -0
  272. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/load-profile-vocab.ts +64 -0
  273. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/load-profile.ts +106 -0
  274. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/mask.ts +138 -0
  275. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/materialize-dataset.ts +113 -0
  276. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/matrix-judge.ts +750 -0
  277. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/memory/append.ts +215 -0
  278. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/memory/read.ts +168 -0
  279. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/persist-eval-criteria.ts +232 -0
  280. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/prep-tasks.ts +125 -0
  281. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/profile-subject.ts +310 -0
  282. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/publish-report.ts +131 -0
  283. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/read-unitf-traces.ts +81 -0
  284. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/render-build-cards.ts +195 -0
  285. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/render-discover-report.ts +1640 -0
  286. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/render-eval-report.ts +3838 -0
  287. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/render-report.ts +212 -0
  288. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/resolve-credential.ts +110 -0
  289. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/resolve-ref.ts +98 -0
  290. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/result-verify.ts +129 -0
  291. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/route-failures.ts +330 -0
  292. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/run-deterministic.ts +367 -0
  293. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/run-evaluate.ts +719 -0
  294. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/run-judge.ts +155 -0
  295. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/run-pipeline.ts +175 -0
  296. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/sample-traces.ts +210 -0
  297. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/self-audit.ts +387 -0
  298. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/source-map.ts +106 -0
  299. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/subject-profile.ts +134 -0
  300. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/substrate.ts +162 -0
  301. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/sync-eval-criteria.ts +244 -0
  302. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/ui-slots.ts +119 -0
  303. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/unitf-to-evaltrace.ts +284 -0
  304. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/validate-judge.ts +358 -0
  305. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/scripts/variance-compare.ts +177 -0
  306. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/subjects/mutagent-diagnostics/behavior-tree.yaml +140 -0
  307. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/subjects/mutagent-diagnostics/eval-matrix.yaml +1270 -0
  308. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/subjects/mutagent-diagnostics/methodology-review.yaml +105 -0
  309. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/workflows/audit.workflow.js +82 -0
  310. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/workflows/data-leak.workflow.js +236 -0
  311. package/mutagent-evaluator/.claude/skills/mutagent-evaluator/workflows/variance.workflow.js +163 -0
  312. package/mutagent-evaluator/CLAUDE.md +45 -0
  313. package/mutagent-evaluator/LICENSE +201 -0
  314. package/mutagent-evaluator/NOTICE +23 -0
  315. package/mutagent-evaluator/README.md +88 -0
  316. package/mutagent-optimize/.claude/skills/mutagent-optimize/SKILL.md +287 -0
  317. package/mutagent-optimize/.claude/skills/mutagent-optimize/scripts/contracts/amend-request.ts +503 -0
  318. package/mutagent-optimize/.claude/skills/mutagent-optimize/scripts/improve-loop-run.ts +304 -0
  319. package/mutagent-optimize/.claude/skills/mutagent-optimize/scripts/loop-state-cli.ts +300 -0
  320. package/mutagent-optimize/.claude/skills/mutagent-optimize/scripts/loop-state.ts +440 -0
  321. package/mutagent-optimize/CLAUDE.md +49 -0
  322. package/mutagent-optimize/README.md +26 -0
  323. package/mutagent-orchestrator/CLAUDE.md +102 -0
  324. package/mutagent-orchestrator/README.md +20 -0
  325. package/mutagent-orchestrator/assets/agents/discovery.md +425 -0
  326. package/mutagent-orchestrator/assets/agents/dogfood-monitor.md +266 -0
  327. package/mutagent-orchestrator/assets/agents/monitor.md +258 -0
  328. package/mutagent-orchestrator/orchestrator.md +782 -0
  329. package/mutagent-orchestrator/references/MONITORING.md +209 -0
  330. package/mutagent-orchestrator/references/config-fields.md +132 -0
  331. package/mutagent-orchestrator/references/config-migration.md +132 -0
  332. package/mutagent-orchestrator/references/index-registry.md +92 -0
  333. package/mutagent-orchestrator/routing.yaml +391 -0
  334. package/mutagent-orchestrator/scripts/config-schema.ts +1010 -0
  335. package/mutagent-orchestrator/scripts/dispatch.ts +439 -0
  336. package/mutagent-orchestrator/scripts/dogfood/extract-feedback.ts +203 -0
  337. package/mutagent-orchestrator/scripts/dogfood/reconstruct-trajectory.ts +327 -0
  338. package/mutagent-orchestrator/scripts/dogfood/render-dogfood-report.ts +347 -0
  339. package/mutagent-orchestrator/scripts/dogfood/resolve-subagents.ts +160 -0
  340. package/mutagent-orchestrator/scripts/dogfood/run-report.ts +264 -0
  341. package/mutagent-orchestrator/scripts/dogfood/slack-thread.ts +106 -0
  342. package/mutagent-orchestrator/scripts/dogfood/types.ts +257 -0
  343. package/mutagent-orchestrator/scripts/eval-routing.ts +753 -0
  344. package/mutagent-orchestrator/scripts/gate.ts +219 -0
  345. package/mutagent-orchestrator/scripts/handover-contract.ts +362 -0
  346. package/mutagent-orchestrator/scripts/index/build-index.ts +351 -0
  347. package/mutagent-orchestrator/scripts/index/render-index.ts +110 -0
  348. package/mutagent-orchestrator/scripts/monitor/slack-notify.ts +111 -0
  349. package/mutagent-orchestrator/scripts/monitor/triggers.ts +162 -0
  350. package/mutagent-orchestrator/scripts/onboarding-check.ts +369 -0
  351. package/mutagent-orchestrator/scripts/render-roster.ts +308 -0
  352. package/mutagent-orchestrator/scripts/resolve-credential.ts +185 -0
  353. package/mutagent-orchestrator/scripts/resolve-paths.ts +114 -0
  354. package/mutagent-orchestrator/scripts/slack/format.ts +63 -0
  355. package/mutagent-orchestrator/scripts/slack/post.ts +115 -0
  356. package/mutagent-orchestrator/scripts/sync-index.ts +311 -0
  357. package/package.json +64 -0
@@ -0,0 +1,247 @@
1
+ # Analyzer Dispatch Handover Contract
2
+
3
+ > **Authority**: W9-01 (PR-ND-1). Canonical for the analyzer INPUT envelope.
4
+ > On conflict between this file and an agent `operation_contract:` field, this file
5
+ > wins for inputs.
6
+ >
7
+ > **Who fills it**: the orchestrator (parent session), once per analyzer spawn
8
+ > (Step 6 of `orchestrator-protocol.md`). The same structured contract is rendered
9
+ > for EVERY parallel analyzer in a run — no ad-hoc prompts.
10
+ >
11
+ > **Audience**: CORE (internal — analyzer input wiring).
12
+
13
+ ---
14
+
15
+ ## `analyzer_dispatch` schema (v1.0)
16
+
17
+ ```yaml
18
+ analyzer_dispatch:
19
+ schema_version: "1.0"
20
+ run_id: "{run_id}" # shared across all slices of one run; artifact-namespace root
21
+ audience: "PRODUCT | META | CORE" # propagated onto every finding (PR-033)
22
+
23
+ slice: # one per spawned analyzer
24
+ slice_id: "{slice_id}"
25
+ trace_ids: ["{id}", "..."] # non-empty; on empty => on_missing_field.empty_slice
26
+ scope:
27
+ has_error: true|false
28
+ has_feedback: true|false
29
+ is_primary_signal: true|false
30
+ focus: "{parsedInvocation.focus | null}"
31
+
32
+ artifacts_in: # explicit, not implied
33
+ platform_reference: "references/source-platforms/{platform}.md" # REQUIRED
34
+ pattern_library: "references/workflows/rca.md#pattern-library" # REQUIRED (Tier 1/2)
35
+ library_priors: "{libraryMatches[] | null}" # null on fresh entity (W9-02 best-effort)
36
+ # W18-context: the GROUNDED LENS the analyzer MANDATORY-PRE-READs (its Step 0) BEFORE any
37
+ # trace analysis. Built deterministically at orchestrator Step 5.7
38
+ # (scripts/context/build-diagnosis-context.ts). The analyzer reads + understands it to set
39
+ # its failure-mode lens, then corroborates findings against extracted FACT (name · scope ·
40
+ # model · purpose · FULL system prompt · tools · source code). It carries NO hints to seed.
41
+ diagnosis_context: "/tmp/diagnosis-context.md" # REQUIRED — analyzer pre-reads before analyzing
42
+
43
+ required_finding_fields: # analyzer self-validates BEFORE return
44
+ # B1-fix: `assumptions` is a FINDING-level requirement — the gate
45
+ # (scripts/validate/findings-contract.ts) rejects any finding without
46
+ # ≥1 structured Assumption (AssumptionSchema). It was previously listed only on
47
+ # `required_remedy_fields` (remedy-level) + narrated in the field map below,
48
+ # while this SSoT list omitted it. Kept in lockstep with the gate.
49
+ # W18-problem: `problem` is a FINDING-level requirement — the gate's
50
+ # REQUIRED_FINDING_FIELDS includes it, AND the W18-gate (isTaskPhrasedProblem) RESENDS
51
+ # `problem(task-phrased)` when a present `problem` reads as a task/remedy. See the Finding
52
+ # schema + "Problem statement format" in diagnostics-analyzer.md / rca.md.
53
+ [findingId, actionable, problem, failureOrigin, whyChain, sourceTraceIds, referenceIds, audience, assumptions]
54
+ required_remedy_fields: # CC-09 / W12-08 / W13-C force-emit set — non-null each
55
+ # applyTarget HARD-required (every remedy links to a target); plus exactly one
56
+ # of diff (when source findable) OR diffStatus ∈ {source-unavailable,
57
+ # origin-unknown} — NEVER a fabricated diff (PR-052 proposed).
58
+ # W13-C (D-1): cost + correctness REQUIRED (low|medium|high) — they feed the
59
+ # renderer's header badges AND the enricher's deterministic rank derivation.
60
+ # `rank` is NOT listed: it is enricher-DERIVED from cost × correctness (§8 /
61
+ # scripts/enrich/rank-remedies.ts), never analyzer-supplied.
62
+ [applyTarget, targetClass, rationale, whyWorks, applyInstructions, assumptions, cost, correctness, diff-or-diffStatus]
63
+
64
+ artifacts_out:
65
+ evidence_file: ".mutagent/diagnostics/{run_id}/evidence/{slice_id}.md"
66
+ schema: "Finding[]"
67
+ dedup_key: [traceId, "failureOrigin.what", "failureOrigin.why", "failureOrigin.where"]
68
+ # W9-01: dedup is performed in-memory by the orchestrator at Step 7 (aggregate+deduplicate).
69
+ # NO new dedup script is created (R-SI-1).
70
+
71
+ file_access:
72
+ reads: ["references/**", "{materialized UniTF handover}", "/tmp/tier0-out.json"]
73
+ writes: [".mutagent/diagnostics/{run_id}/evidence/{slice_id}.md"] # no writes outside namespace
74
+
75
+ on_missing_field:
76
+ action: "RESEND finding {findingId} with missing fields: {list}"
77
+ max_redispatch: 2 # CC-09: after 2 failures, drop
78
+ on_exhaustion: "drop with marker INCOMPLETE_FIELDS; log runMeta.decisions"
79
+ on_missing_field.empty_slice: { action: "skip slice; log {sliceId, reason} to runMeta.decisions" }
80
+ budget:
81
+ # Per-analyzer slice read is bounded by the run-level tier (see orchestrator-protocol.md Step 6
82
+ # escalation loop); time_cap_seconds may scale with tier (operator sub-decision).
83
+ time_cap_seconds: 240
84
+ on_cap_exceed: "emit partial findings with note (partial-emit, NOT reject)"
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Usage notes
90
+
91
+ - `run_id` is the session-scoped identifier; all artifact paths under
92
+ `.mutagent/diagnostics/{run_id}/` share it.
93
+ - `library_priors` is `null` when the class-memory library returns no matches for
94
+ this entity. Per PR-037 best-effort clause: empty library is valid — proceed fresh,
95
+ no gate fires (W9-02).
96
+ - The `dedup_key` tuple `[traceId, failureOrigin.what, failureOrigin.why, failureOrigin.where]`
97
+ is applied in-memory by the orchestrator at Step 7. No separate script.
98
+ - `required_finding_fields` and `required_remedy_fields` are the SINGLE source of
99
+ truth. The analyzer `operation_contract:` mirrors them — not the other way round.
100
+
101
+ ---
102
+
103
+ ## Output schema — Finding / Remedy / Assumption (W13-C, D-7)
104
+
105
+ > **Why this section exists**: `required_*_fields` above lists field NAMES only.
106
+ > A names-only contract under-specifies the shapes — analyzers emitted boolean
107
+ > `actionable`, `status:"hypothesis"` with no `basis`, etc., and the Step-7.1 gate
108
+ > correctly rejected them. This section pins the TYPES + ENUMS + a worked example so
109
+ > the analyzer can produce contract-valid output on the first pass.
110
+ >
111
+ > **Authority**: these shapes MIRROR the canonical TypeScript interfaces in
112
+ > `scripts/normalize/trace.ts` and the runtime TypeBox schemas in
113
+ > `scripts/validate/findings-contract.ts`. On any drift, those files win.
114
+
115
+ ### Enums (closed value sets)
116
+
117
+ ```yaml
118
+ WhatCategory: [wrong-output, missing-output, loop, latency-spike, cost-overshoot,
119
+ format-violation, hallucination, user-complaint, low-score, missing-context]
120
+ WhyCategory: [prompt-underspec, prompt-overspec, tool-misuse, tool-missing,
121
+ context-overflow, provider-limit, data-staleness, handoff-loss, dependency-failure]
122
+ WhereCategory: [system-prompt, tool-definition, agent-config, routing-config,
123
+ upstream-data, provider-side, harness-side, user-input]
124
+ Confidence: [high, medium, low]
125
+ CostScale: [low, medium, high] # Remedy.cost
126
+ CorrectnessScale: [low, medium, high] # Remedy.correctness
127
+ AssumptionStatus: [verified, unverified, hypothesis-pending]
128
+ TargetClass: [local-agent-md, local-code-construct, cloud-rest]
129
+ DiffStatus: [source-unavailable, origin-unknown]
130
+ ```
131
+
132
+ ### `FailureOrigin` (object — REQUIRED on every finding)
133
+
134
+ ```jsonc
135
+ {
136
+ "what": "<WhatCategory>", // REQUIRED enum
137
+ "why": "<WhyCategory>", // REQUIRED enum
138
+ "where": "<WhereCategory>", // REQUIRED enum
139
+ "evidence": "string (non-empty)", // REQUIRED — file:line, trace msg slice, or code pointer
140
+ "whatHappened": "string (non-empty)", // REQUIRED (F-EV1) — plain-words narration of the event
141
+ // in the cited trace; companion to `evidence` (the pointer).
142
+ // e.g. "compose called the model 6x serially before returning"
143
+ "example": "string", // OPTIONAL (F-EV1) — verbatim excerpt from the trace body
144
+ // illustrating whatHappened; PII-sanitized by the consumer before emit
145
+ "confidence": "<Confidence>" // REQUIRED enum
146
+ }
147
+ ```
148
+
149
+ > **F-EV1 evidence-narration (required going forward).** `whatHappened` tells the
150
+ > operator WHAT happened in plain words; `evidence` stays as the WHERE (file:line /
151
+ > trace-message pointer / code pointer). The optional `example` carries a verbatim
152
+ > illustrative quote. Same two fields apply to every `WhyChainEntry` below.
153
+
154
+ ### `Assumption` (object — finding carries ≥1)
155
+
156
+ ```jsonc
157
+ {
158
+ "text": "string (non-empty, one objective sentence)", // REQUIRED
159
+ "status": "<AssumptionStatus>", // REQUIRED enum — NOT "hypothesis"; use "hypothesis-pending"
160
+ "basis": "string (non-empty)" // REQUIRED — the evidence basis OR the source still required
161
+ }
162
+ ```
163
+
164
+ ### `Remedy` (object — finding carries ≥1; analyzer-emitted fields)
165
+
166
+ ```jsonc
167
+ {
168
+ "remedyId": "string (non-empty)", // REQUIRED
169
+ "title": "string (non-empty)", // REQUIRED
170
+ "applyTarget": "string (non-empty)", // REQUIRED — file/construct the remedy edits
171
+ "targetClass": "<TargetClass>", // REQUIRED enum
172
+ "rationale": "string (non-empty)", // REQUIRED — comparative (why this finding is real)
173
+ "whyWorks": "string (non-empty)", // REQUIRED — causal (why the fix resolves it)
174
+ "applyInstructions": ["string", "..."], // REQUIRED — ≥1 ordered step
175
+ "cost": "<CostScale>", // REQUIRED enum (W13-C, D-1)
176
+ "correctness": "<CorrectnessScale>", // REQUIRED enum (W13-C, D-1)
177
+ // exactly ONE of the following two (never both, never neither — never a fabricated diff):
178
+ "diff": { "before": "string", "after": "string" }, // when source is findable
179
+ "diffStatus": "<DiffStatus>" // else — explicit absence marker
180
+ // NOTE: `rank` is NOT emitted by the analyzer — the enricher derives it from
181
+ // cost × correctness (scripts/enrich/rank-remedies.ts). Any emitted rank is overwritten.
182
+ }
183
+ ```
184
+
185
+ ### `Finding` (top-level object the analyzer emits)
186
+
187
+ ```jsonc
188
+ {
189
+ "findingId": "string (non-empty)", // REQUIRED — "F-{sliceId}-{n}"
190
+ "actionable": "string (non-empty SUMMARY)", // REQUIRED — a STRING, not a boolean
191
+ "problem": "string (non-empty DESCRIPTION)", // REQUIRED (W18-problem) — "<subject> <observed
192
+ // behavior> — <quantified impact + evidence>".
193
+ // A DESCRIPTION, NOT a task: no leading imperative
194
+ // verb; fix lives only in remedies. The W18-gate
195
+ // RESENDS problem(task-phrased) on violation.
196
+ "failureOrigin": { /* FailureOrigin */ }, // REQUIRED
197
+ "whyChain": [{ "why": "string", "evidence": "string", "whatHappened": "string", "isOrigin": true }], // REQUIRED ≥1 (whatHappened REQUIRED per F-EV1; optional "example")
198
+ "assumptions": [{ /* Assumption */ }], // REQUIRED ≥1 structured entry
199
+ "remedies": [{ /* Remedy */ }], // REQUIRED ≥1
200
+ "sourceTraceIds":["string", "..."], // REQUIRED ≥1
201
+ "referenceIds": { "traceId": "string", "sessionId": "string", "findingId": "string" }, // REQUIRED
202
+ "audience": "PRODUCT | META | CORE" // REQUIRED — set by dispatcher, propagated
203
+ }
204
+ ```
205
+
206
+ ### Worked example (contract-valid)
207
+
208
+ ```json
209
+ {
210
+ "findingId": "F-slice-0-1",
211
+ "actionable": "The compose tool issues 6 sequential model calls per draft, dominating p95 latency.",
212
+ "problem": "The compose tool issues 6 sequential model calls per draft — 4.2s p95, 3.1× the 1.4s session median, on 12/40 traces.",
213
+ "failureOrigin": {
214
+ "what": "latency-spike",
215
+ "why": "tool-misuse",
216
+ "where": "tool-definition",
217
+ "evidence": "trace tr_001 msgs 4-15: compose-tool called 6x serially before return",
218
+ "whatHappened": "the compose tool fired one model call per section, six in a row, before returning the draft",
219
+ "example": "compose-tool → model.call(section=1) … model.call(section=6) → return",
220
+ "confidence": "high"
221
+ },
222
+ "whyChain": [
223
+ { "why": "compose issues one model call per section", "evidence": "tr_001 msgs 4-15", "whatHappened": "each section triggered its own sequential model call instead of one batched call" },
224
+ { "why": "no batching guard in the tool definition", "evidence": "agent-def compose-tool spec", "whatHappened": "the tool spec had no batch/parallelism cap, so the calls ran serially", "isOrigin": true }
225
+ ],
226
+ "assumptions": [
227
+ { "text": "Section count drives the call count.", "status": "verified", "basis": "Confirmed across 40 sampled traces (msgs 4-15)." }
228
+ ],
229
+ "remedies": [
230
+ {
231
+ "remedyId": "R-slice-0-1-a",
232
+ "title": "Batch the compose model calls",
233
+ "applyTarget": "scripts/tools/compose.ts:42",
234
+ "targetClass": "local-code-construct",
235
+ "rationale": "Sequential per-section calls are the dominant latency sink; batching addresses the root cause directly.",
236
+ "whyWorks": "A single batched call removes the serial round-trips, so latency scales with one request not N.",
237
+ "applyInstructions": ["Open compose.ts", "Collect sections then issue one batched call", "Re-run the suite"],
238
+ "cost": "low",
239
+ "correctness": "high",
240
+ "diff": { "before": "for (s of sections) await model(s)", "after": "await model(sections)" }
241
+ }
242
+ ],
243
+ "sourceTraceIds": ["tr_001"],
244
+ "referenceIds": { "traceId": "tr_001", "sessionId": "s_xyz", "findingId": "F-slice-0-1" },
245
+ "audience": "PRODUCT"
246
+ }
247
+ ```
@@ -0,0 +1,300 @@
1
+ # Onboarding Workflow — 8 Phases
2
+
3
+ > Load this when `scripts/setup/detect.ts` returns `state: "missing"` or `state: "partial"`,
4
+ > or when `--reconfigure` flag is present.
5
+ >
6
+ > **v0.2.0 config shape (config-shape break — see `references/config-migration.md`).**
7
+ > Onboarding writes the UNIFIED `.mutagent/config.yaml` in the v0.2.0 shape:
8
+ > - The source is written to the **`global.sources[]`** catalog (bound BY ROLE — a
9
+ > source-consumer; no `source_ref`). The target is written to **`global.targets[]`**
10
+ > (bound BY ROLE — a target-writer, with an `apply.kind`).
11
+ > - The diagnostics skill's own knobs go under **`lifecycle.diagnostics`**
12
+ > (`apply`, `context[]`, `ask_tool`, `default_audience`, `self_diagnostics`).
13
+ > - Schedule / trigger rules / heartbeat live under top-level **`triggers.diagnose`**
14
+ > (ships DISABLED) — NOT in the diagnostics section.
15
+ > - There is **no `observability` block** and no inline `source:` / `target:`
16
+ > anymore — do NOT prompt for them under those names.
17
+ > - If `detect.ts` reports `migrationRequired`, run `references/config-migration.md`
18
+ > FIRST (rewrite the legacy config), then re-enter onboarding.
19
+
20
+ ## Phase map
21
+
22
+ ```
23
+ Phase 1: Source platform pick → global.sources[].platform
24
+ Phase 2: Source credential + CLI install → global.sources[].credential_ref
25
+ Phase 3: Connectivity probe (informational)
26
+ Phase 4: Target platform pick (incl. report-only) → global.targets[] / lifecycle.diagnostics.apply
27
+ Phase 5: Target credential + CLI install → global.targets[].credential_ref
28
+ Phase 6: Triggers (DISABLED — auto-write triggers.diagnose)
29
+ Phase 7: Final confirm → write global catalog + lifecycle.diagnostics + triggers
30
+ Phase 8: First-run pick (diagnose now OR halt)
31
+ ```
32
+
33
+ ## Platform-native ASK mechanism
34
+
35
+ | Runtime | ASK method |
36
+ |---------|-----------|
37
+ | Claude Code | `AskUserQuestion` tool (multi-select, preview attr) |
38
+ | Codex | Numbered chat-message multi-choice |
39
+ | Cursor | Numbered chat-message multi-choice |
40
+ | OpenCode | Numbered chat-message multi-choice |
41
+ | Generic | Numbered chat-message multi-choice |
42
+
43
+ Always use the `ask_tool.native_tool` from config if present. On first run, detect runtime via `scripts/cli/init.ts`.
44
+
45
+ ## Phase 1 — Source Platform
46
+
47
+ ```
48
+ Where do your agent traces live? Pick one:
49
+
50
+ 1. Langfuse (cloud or self-hosted)
51
+ 2. OpenTelemetry-compliant endpoint
52
+ 3. Local trace file (.jsonl / .ndjson)
53
+ 4. Claude Code local transcripts (~/.claude/projects/<encoded>/<session>.jsonl)
54
+ 5. Codex local transcripts (~/.codex/sessions/<session>.jsonl)
55
+ 6. Other — describe what you have
56
+ ```
57
+
58
+ Load `references/source-platforms/{chosen}.md` for CLI operation details.
59
+
60
+ ## Phase 2 — Source Credential + CLI Install (approve-to-install gate, PR-021)
61
+
62
+ > **Operator rule (Wave-6): NEVER auto-install.** Source platforms are usually
63
+ > driven via a CLI during onboarding, and most clients will NOT have it installed.
64
+ > Onboarding must (1) link the platform's official CLI docs, and (2) when the CLI
65
+ > is missing, OFFER to install it — but the install MUST be checked + approved by
66
+ > the user first. There is NO code path that installs a CLI silently/automatically.
67
+
68
+ **Mechanism** — a reusable `ensure-cli(platform)` helper:
69
+ - `scripts/setup/ensure-cli.ts` → `planCliEnsure(platform)` probes PATH (pure read,
70
+ never installs) and returns one of:
71
+ `not-required` (file-only / backend-specific — e.g. local-jsonl, claude-code, otel),
72
+ `present`, `missing-installable`, `missing-no-installer`.
73
+ - `scripts/cli/init.ts` → `ensureSourceCli(platform, approve)` drives the gate.
74
+
75
+ **Steps**
76
+
77
+ 1. Probe the CLI (pure — no install):
78
+ ```bash
79
+ bun scripts/cli/run.sh scripts/setup/detect.ts --cli <platform>
80
+ # → JSON plan: { status, installCommand, docsUrl, approvalRequired }
81
+ ```
82
+ 2. Show the platform's **official CLI docs link** (from the plan's `docsUrl`, mirrored
83
+ in `references/source-platforms/{platform}.md`). Per-platform links:
84
+ | Platform | Official CLI / tooling docs |
85
+ |---|---|
86
+ | Langfuse | https://langfuse.com/docs/api-and-data-platform/features/cli |
87
+ | OpenTelemetry | https://opentelemetry.io/docs/specs/otlp/ (no single CLI — backend-specific) |
88
+ | Codex | https://developers.openai.com/codex/cli |
89
+ | Claude Code transcripts | https://code.claude.com/docs/en/data-usage (file reads — no CLI) |
90
+ | Local JSONL | file reads — no CLI (see `references/source-platforms/local-jsonl.md`) |
91
+ 3. **If `status: missing-installable`** → ASK the user before installing, using the
92
+ platform-portable ASK mechanism (same table as Phase 1):
93
+ - **Claude Code**: `AskUserQuestion` — two options, each with a `preview`:
94
+ - `Install <CLI> now` → preview = the exact install command (`pip install langfuse`)
95
+ - `Skip — use REST/file fallback` → preview = the `fallbackNote` from the plan
96
+ Drive `ensureSourceCli(platform, approve)` where `approve` resolves the
97
+ AskUserQuestion result to a boolean.
98
+ - **Codex / Cursor / OpenCode / generic**: chat y/N fallback
99
+ (`promptInstallApprovalChat`, **default NO**), or run:
100
+ ```bash
101
+ bun scripts/cli/run.sh scripts/cli/init.ts --ensure-cli <platform>
102
+ ```
103
+ - **On approve** → the documented install command runs (the ONLY install path).
104
+ - **On decline** → continue with REST/file fallback; record the CLI as absent
105
+ (the `EnsureCliResult.note` is logged into the onboarding transcript).
106
+ 4. **If `status: missing-no-installer`** (e.g. otel) → surface docs + REST/file
107
+ fallback. Do NOT ask, do NOT install.
108
+ 5. **If `status: not-required` / `present`** → nothing to install; proceed.
109
+ 6. Prompt for `credential_ref` key name (for non-file sources).
110
+ 7. Write to `.mutagentrc` (gitignored).
111
+
112
+ ## Phase 3 — Connectivity Probe (informational)
113
+
114
+ Test that the source platform is reachable:
115
+ ```bash
116
+ Bash("<source-cli> health --json") # or platform-equivalent ping
117
+ ```
118
+ Display result to operator. Non-blocking if probe fails (operator may be offline).
119
+
120
+ ## Phase 4 — Target Platform (incl. report-only)
121
+
122
+ ```
123
+ Where do your agent definitions live?
124
+
125
+ 1. Claude Code agents (.claude/agents/*.md)
126
+ 2. Codex agents (.codex/agents/*.md)
127
+ 3. Cursor agents (cursor-equivalent dir)
128
+ 4. OpenCode agents (opencode-equivalent dir)
129
+ 5. Mastra code construct (source code: new Agent({...}))
130
+ 6. Anthropic Cloud Agent SDK (source code)
131
+ 7. Cloud REST API (HTTP GET/PUT)
132
+ 8. Report-only — produce the report, never apply a fix (NO target needed)
133
+ 9. Other — describe
134
+ ```
135
+
136
+ Load `references/target-platforms/{chosen}.md` for the apply recipe.
137
+
138
+ **v0.2.0 mapping:**
139
+ - Picks 1–7 → write a `global.targets[]` entry with the matching `platform`,
140
+ `mode`, and an `apply.kind` (`markdown` for local-agent markdown targets;
141
+ `code-pr` for code constructs / repos; `cloud-deploy` for cloud SDK/REST).
142
+ - **Pick 8 (report-only)** → set **`lifecycle.diagnostics.apply: report-only`** and
143
+ OMIT the `global.targets[]` entry entirely (a report-only run needs no target;
144
+ the apply gate is skipped). This is the `apply` field the orchestrator reads to
145
+ gate. (Equivalently you may write a single `report-only` target with
146
+ `apply.kind: report-only`, but the `lifecycle.diagnostics.apply` field is the
147
+ canonical report-only switch.)
148
+
149
+ ## Phase 5 — Target Credential + CLI Install
150
+
151
+ Same pattern as Phase 2. For local targets: confirm git and gh CLI are present. For remote: prompt for `rest_base_url` + `credential_ref`.
152
+
153
+ ## Phase 5b — Verify diagnostics-* agents (non-blocking check — W9-10)
154
+
155
+ > **W9-10 (lean onboarding):** Agent install is NOT a mandatory onboarding step.
156
+ > `pnpx @mutagent/diagnostics init` (i.e. `init --mode init`) is the install path
157
+ > and runs before onboarding. Onboarding's job is PLATFORM CONFIG only.
158
+ >
159
+ > This phase runs `verify-agents` as a non-blocking check:
160
+ > - If agents are **ready** → skip silently, proceed to Phase 6.
161
+ > - If agents are **missing** → OFFER install (not forced, not default); user may decline.
162
+ > - Phase 6 is NOT gated on agents being present — onboarding completes regardless.
163
+ >
164
+ > **Install scope (W9-fix):** `pnpx @mutagent/diagnostics init` installs PROJECT-LOCAL
165
+ > by default — skill + agents land in `<your project>/.claude/` (Claude Code) and
166
+ > `<your project>/.codex/` (Codex), i.e. the directory you ran init in. Pass `--global`
167
+ > to install into the home dir (`~/.claude`, `~/.codex`) instead. When checking for an
168
+ > existing install, project scope looks ONLY at `<project>/.claude/agents` — a global
169
+ > `~/.claude/agents` never counts as a project install, so the project install is never
170
+ > wrongly skipped. (`verify-agents --scope=project|user` checks one scope at a time.)
171
+
172
+ ```bash
173
+ bun scripts/cli/run.sh scripts/setup/verify-agents.ts "$PROJECT_ROOT" [--scope=project|user]
174
+ ```
175
+
176
+ **Verify outputs**:
177
+ - `analyzer: "ready"|"missing"|"invalid"|"pending-restart"`
178
+ - `applyWorker: ...`
179
+ - `harnessRestartRequired: boolean`
180
+
181
+ **Branch on the verify result:**
182
+
183
+ - **On `ready`** (both agents): skip silently, proceed to Phase 6. No prompt needed.
184
+ - **On `missing`** (one or more agents): OFFER install — do not install automatically.
185
+ Ask the operator:
186
+ ```
187
+ diagnostics-* agents are not installed. Install them now?
188
+ 1. Yes — install (pnpx @mutagent/diagnostics init --mode install)
189
+ 2. No — skip (you can install later with: pnpx @mutagent/diagnostics init)
190
+ ```
191
+ On Yes: run install. On No: record as absent, continue to Phase 6.
192
+ NOTE: If `pnpx init` was already run before onboarding (the recommended path),
193
+ agents should be present and this offer will never appear.
194
+ - **On `pending-restart`**: note that a restart is needed after onboarding completes.
195
+ Do NOT halt — continue to Phase 6. Surface the restart reminder in Phase 7.
196
+ - **On `invalid`**: offer re-install with `--force`. Non-blocking — continue to Phase 6.
197
+
198
+ **Integration with cli/init.ts**: `InitDescriptor.agentsBoundary` surfaces the state
199
+ after `init --mode init` completes, so the agent can check without re-running verify.
200
+
201
+ ## Phase 6 — Triggers (top-level `triggers.diagnose`, DISABLED)
202
+
203
+ > **v0.2.0 relocation.** Schedule / trigger rules / heartbeat NO LONGER live in the
204
+ > diagnostics section — they moved to the top-level **`triggers.diagnose`** block
205
+ > (orchestrator-owned; `{ enabled, rules, schedule?, heartbeat? }`). Onboarding does
206
+ > NOT prompt for any of them.
207
+
208
+ > **⏸ Schedule + auto-trigger questions are DISABLED (operator directive + v0.1).** The
209
+ > skill is **on-demand-only by design** (no cron, no auto-fire; invocation is always
210
+ > explicit `/mutagent-diagnostics`). Auto-write the disabled block silently:
211
+ > ```yaml
212
+ > triggers:
213
+ > diagnose:
214
+ > enabled: false
215
+ > rules: []
216
+ > ```
217
+ > Re-enable these questions when scheduled triggers are supported post-v0.1 (see
218
+ > `references/workflows/schedule-prep.md`).
219
+
220
+ Note: v0.1 ships `triggers.diagnose` DISABLED (`enabled: false`, `rules: []`) — on-demand only.
221
+
222
+ ## Phase 7 — Final Confirm
223
+
224
+ Display summary of all config fields. Ask:
225
+ ```
226
+ Ready to write .mutagent/config.yaml with these settings?
227
+ 1. Yes — write config
228
+ 2. Go back to Phase N (pick a phase)
229
+ 3. Cancel
230
+ ```
231
+
232
+ If confirmed: write `config.yaml` (committed, non-secrets) + update `.mutagentrc` (gitignored, secrets).
233
+
234
+ **Write shape (v0.2.0)** — render `assets/templates/config.yaml.tpl`:
235
+ ```yaml
236
+ config_version: "0.2.0"
237
+ global:
238
+ sources:
239
+ - { name: primary, platform: <chosen>, credential_ref: <KEY_NAME>, ... }
240
+ targets: # OMIT entirely for a report-only run (Phase 4 pick 8)
241
+ - { name: agents, platform: <chosen>, mode: <local|remote>, apply: { kind: <markdown|code-pr|cloud-deploy> } }
242
+ # context: [ { path, what, why, when } ] # optional project-wide links
243
+ lifecycle:
244
+ diagnostics:
245
+ apply: <report-only|apply> # report-only ⇒ no target
246
+ ask_tool: { runtime: <detected> }
247
+ default_audience: "client"
248
+ self_diagnostics: { enabled: false }
249
+ # context: [ { path, what, why, when } ] # optional stage triage runbook links
250
+ triggers:
251
+ diagnose: { enabled: false, rules: [] }
252
+ ```
253
+ Then re-run `scripts/setup/detect.ts $PROJECT_ROOT` — expect `state: complete`.
254
+
255
+ > **W13-D — `default_audience` (operator directive).** When writing the generated
256
+ > `config.yaml`, ALWAYS include `default_audience: client`. A published / client
257
+ > install must produce the **client-stripped** report by default; internal is
258
+ > opt-in (the operator can flip it to `internal` later, or pass `--audience internal`
259
+ > at render time per-run). This is the default emitted by `assets/templates/config.yaml.tpl`.
260
+ > The orchestrator threads this value as `--audience <config.default_audience>` at the
261
+ > Step-9 render call when the operator gave no explicit flag.
262
+ > **Self-diagnosis reports are ALWAYS internal regardless of this field (PR-022).**
263
+
264
+ > **If diagnostics-* agents were installed** (either via `pnpx init` before onboarding,
265
+ > or via the Phase 5b offer), restart your Claude Code session before running diagnostics.
266
+ > Claude Code's `subagent_type` registry is loaded once at session boot.
267
+ >
268
+ > **Fallback cases** (see I-005 — applies when agents cannot activate normally):
269
+ > - **Agent not registered**: Session restart required.
270
+ > - **Tool grant stripped**: The diagnostics-* agents require specific tool grants
271
+ > (Read, Write, Bash, Agent, etc.) that may be absent in some environments.
272
+ > If tool-grant-stripped, dispatch `subagent_type: general-purpose` with the
273
+ > analyzer instructions inlined into the prompt — see Phase 5b note.
274
+ > Tool grants are configured in `.claude/settings.json` (project) or
275
+ > `~/.claude/settings.json` (user). Add the required grants then restart.
276
+ > - **Both cases simultaneously**: Run `scripts/cli/run.sh scripts/setup/verify-agents.ts`
277
+ > — the output distinguishes `"missing"` (not installed) from `"invalid"` (wrong name/frontmatter)
278
+ > and `"pending-restart"` (installed but session not restarted yet).
279
+ >
280
+ > **Recommended install path (W9-10)**: run `pnpx @mutagent/diagnostics init` BEFORE
281
+ > starting onboarding. This installs skill+agents in one step and the restart can
282
+ > happen before onboarding begins.
283
+
284
+ ## Phase 8 — First-Run Pick
285
+
286
+ After config written, emit suggestions:
287
+ ```
288
+ Setup complete! Here are some things to try first:
289
+
290
+ 1. Diagnose traces from the last 24 hours
291
+ 2. Diagnose your most recently failing agent
292
+ 3. Diagnose all sessions with negative feedback this week
293
+ 4. Diagnose all high-latency sessions
294
+ 5. I'll invoke manually later
295
+
296
+ [Suggestions ranked by likely relevance based on source platform + trigger rules]
297
+ ```
298
+
299
+ If operator picks 1-4: proceed to `references/workflows/diagnostics.md`.
300
+ If operator picks 5: halt and confirm onboarding complete.