@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,209 @@
1
+ # Monitoring — `*dogfood` (inward) + `*monitor` (outward) User Manual
2
+
3
+ > Helix ships **two** monitors that share the low-level Slack transport but keep **separate voices**:
4
+ >
5
+ > | | **Dogfood Monitor** (`*dogfood`) | **External Monitor** (`*monitor`) |
6
+ > |---|---|---|
7
+ > | Direction | INWARD — self-observation of a live session | OUTWARD — watches system conditions |
8
+ > | Watches | `config.dogfood.source_dir` (a live coding session) | `config.triggers` (evaluate/diagnose rules) |
9
+ > | On tick / match | re-render report + post a Slack **thread** reply | route a `HandoverBundle` + post a Slack **notification** |
10
+ > | Slack shape | a live THREAD (root + progress replies) | discrete one-shot NOTIFICATIONS |
11
+ > | Ships | live (watch-by-default) | **DISABLED** (no auto-fire until enabled) |
12
+ >
13
+ > §1–4 below cover `*dogfood`; **§5 covers `*monitor`**. Both post only when Slack is configured;
14
+ > unconfigured ⇒ no Slack, never an error.
15
+
16
+ ---
17
+
18
+ ## 1. What `*dogfood` is
19
+
20
+ `*dogfood` is Helix's **inward self-observation** monitor. It live-tails a Helix coding session and,
21
+ on every drift **and** at least every 3 minutes, reconstructs the ADL trajectory, extracts feedback +
22
+ signals, and re-renders a live status report.
23
+
24
+ - **Always live.** `*dogfood` is a monitor, not a one-shot: it watches by default (3-minute heartbeat
25
+ **+** on-drift re-render). There is no "just render once" operator mode (an internal `--once` exists
26
+ for tests only).
27
+ - **Start:** `*dogfood <sessionId>` — or `*dogfood` with no id to watch the latest session in the
28
+ configured `source_dir`.
29
+ - **Stop:** `*dogfood-stop` (it also stops on session inactivity).
30
+ - **Where the report lands:** `.mutagent/dogfood/<runId>/status.html` — a self-contained HTML page that
31
+ **auto-reloads** in the browser (Helix auto-opens it once). Sections: timeline · command usage ·
32
+ subagents · feedback · Call-Stack DAG.
33
+
34
+ > **Build project ≠ dogfood target.** `*dogfood` does NOT watch the project you're developing Helix in;
35
+ > it watches the dogfood TARGET project's Claude-Code session dir, set in `config.dogfood.source_dir`.
36
+
37
+ ---
38
+
39
+ ## 2. Config reference — `config.dogfood`
40
+
41
+ In `.mutagent/config.yaml`:
42
+
43
+ ```yaml
44
+ dogfood:
45
+ # The dogfood TARGET project's Claude-Code session dir (NOT the build project).
46
+ # Absolute by design (Claude encodes the project cwd by replacing "/" with "-").
47
+ source_dir: "~/.claude/projects/-Users-you-Desktop-your-DOGFOOD-project"
48
+
49
+ # Forced re-render cadence in seconds. Default 180 (3 min). The watch loop ALSO
50
+ # re-renders on drift (a new *command / ADL stage / [feedback] / subagent).
51
+ cadence_seconds: 180
52
+
53
+ # Resolve + ingest dispatched subagent session JSONLs too. Default true.
54
+ include_subagents: true
55
+
56
+ # OPTIONAL live Slack thread (see §3). Omit or set enabled:false ⇒ HTML report
57
+ # only, never an error.
58
+ slack:
59
+ enabled: true
60
+ channel: "C0123ABC" # a Slack channel id the bot is in
61
+ token_ref: "SLACK_BOT_TOKEN" # the ENV-VAR NAME holding the xoxb-… token (never the secret itself)
62
+ ```
63
+
64
+ | Key | Meaning | Default |
65
+ |---|---|---|
66
+ | `source_dir` | dogfood target's `~/.claude/projects/<enc(path)>/` dir | *(required)* |
67
+ | `cadence_seconds` | forced re-render cadence (seconds) | `180` |
68
+ | `include_subagents` | ingest dispatched subagent transcripts | `true` |
69
+ | `slack.enabled` | post a live Slack thread | `false` |
70
+ | `slack.channel` | Slack channel id | — |
71
+ | `slack.token_ref` | **name** of the env var holding the bot token | — |
72
+
73
+ ---
74
+
75
+ ## 3. Slack setup — the operator flow {#slack-setup}
76
+
77
+ The dogfood live thread posts a **root message on start** and **threaded replies** as the session moves
78
+ (stage change · agent dispatch · feedback · signal · progress heartbeat · stop). Threading requires the
79
+ Slack **Web API** (`chat.postMessage` + `thread_ts`) — a **bot token**, NOT an incoming webhook.
80
+
81
+ **Step by step:**
82
+
83
+ 1. **Create a Slack App.** Go to <https://api.slack.com/apps> → **Create New App** → **From scratch**.
84
+ Name it (e.g. "Helix Dogfood") and pick your workspace.
85
+ 2. **Add the bot scope.** In the app: **OAuth & Permissions** → **Scopes** → **Bot Token Scopes** → add
86
+ **`chat:write`**. If you'll post to a channel the bot hasn't been invited to, also add
87
+ **`chat:write.public`**.
88
+ 3. **Install to workspace.** **OAuth & Permissions** → **Install to Workspace** → Allow. Copy the
89
+ **Bot User OAuth Token** — it starts with `xoxb-…`.
90
+ 4. **Export the token as an env var.** The **name** (not the value) goes in `token_ref`:
91
+ ```bash
92
+ export SLACK_BOT_TOKEN=xoxb-your-token-here
93
+ ```
94
+ 5. **Invite the bot + get the channel id.** In the target channel run `/invite @YourApp`. Get the
95
+ channel **ID** (`C0…`) from the channel's *View channel details* (bottom of the popover) or the URL.
96
+ 6. **Set the config:**
97
+ ```yaml
98
+ dogfood:
99
+ slack: { enabled: true, channel: "C0123ABC", token_ref: "SLACK_BOT_TOKEN" }
100
+ ```
101
+ 7. **Run it.** `*dogfood <sessionId>` → a live thread appears in the channel (root + replies). Verify the
102
+ root posts and replies thread underneath as the session moves.
103
+
104
+ > **Unconfigured = no Slack.** With no token/channel, or `enabled:false`, `*dogfood` produces the HTML
105
+ > report only and posts nothing — it is **never** an error. A misconfigured or unreachable Slack likewise
106
+ > never breaks a render (the post silently no-ops).
107
+
108
+ ### Troubleshooting
109
+
110
+ | Slack error | Cause | Fix |
111
+ |---|---|---|
112
+ | `not_in_channel` | the bot isn't a member of `channel` | `/invite @YourApp` in that channel (or add `chat:write.public`) |
113
+ | `invalid_auth` | token missing/expired, or `token_ref` points at an unset/typo'd env var | re-check the exported env var name + value (`echo $SLACK_BOT_TOKEN`) |
114
+ | `missing_scope` | the app lacks `chat:write` | add the **Bot Token Scope** `chat:write`, then **reinstall** the app |
115
+ | *(nothing posts, no error)* | `slack.enabled:false` or `token_ref` env var unset | set `enabled:true` and export the token; disabled/unset ⇒ intentional no-op |
116
+
117
+ ---
118
+
119
+ ## 4. Quick reference
120
+
121
+ ```bash
122
+ # start watching the latest session in source_dir
123
+ *dogfood
124
+
125
+ # start watching a specific session
126
+ *dogfood d4e98196-926d-4602-965f-d5aed291a54c
127
+
128
+ # stop
129
+ *dogfood-stop
130
+
131
+ # the live report (auto-reloads in the browser)
132
+ .mutagent/dogfood/<runId>/status.html
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 5. The External Monitor — `*monitor` (outward)
138
+
139
+ `*monitor` is Helix's **outward** monitor. Where `*dogfood` looks INWARD at a live session,
140
+ `*monitor` watches **conditions** in `config.triggers` (the dormant evaluate/diagnose trigger rules).
141
+ When a trigger fires, it **routes** a `HandoverBundle` to the target ADL stage — the same dispatch
142
+ model as `*discover` — and posts a discrete Slack **notification**. It never runs the stage itself
143
+ and never edits a target; it hands off and notifies.
144
+
145
+ - **Notification vs dogfood thread (the distinction).** `*dogfood` posts a live THREAD (a root
146
+ message + progress replies under it) so coworkers follow one session in real time. `*monitor` posts
147
+ a discrete NOTIFICATION — one standalone message per fired trigger. Shared Slack transport
148
+ (`scripts/slack/*`), **separate emitters**: `dogfood/slack-thread.ts` vs `monitor/slack-notify.ts`.
149
+ - **Start / stop:** `*monitor` arms the watch; `*monitor-stop` disarms it. Both are internal
150
+ (maintainer/system) commands — invocable by name, hidden from the roster.
151
+
152
+ ### Ships DISABLED — how to enable
153
+
154
+ The condition source is `config.triggers`, which **ships DISABLED** (`enabled:false`, empty rules).
155
+ A disabled block fires **nothing**, so a fresh install never auto-fires. To enable a trigger, opt in
156
+ per stage:
157
+
158
+ ```yaml
159
+ # .mutagent/config.yaml
160
+ triggers:
161
+ diagnose:
162
+ enabled: true # ← opt-in (ships false)
163
+ rules:
164
+ - on: "trace-count>=100" # fire when ≥ 100 new traces arrive
165
+ run: "*diagnose" # the stage/command to route to
166
+ evaluate:
167
+ enabled: true
168
+ rules:
169
+ - on: "schedule" # fire on a scheduled wake
170
+ run: "*evaluate"
171
+ ```
172
+
173
+ **Event kinds** a rule's `on` can name: `trace-count` (optionally `trace-count>=N` / `trace-count>N`),
174
+ `schedule`, `ci`, `manual`. A rule fires only for its own event kind (and, for `trace-count` with a
175
+ threshold, only when the count satisfies the comparator).
176
+
177
+ ### The external notification sink — `config.monitor.slack`
178
+
179
+ `*monitor` uses its **own** Slack sink, separate from `dogfood.slack`:
180
+
181
+ ```yaml
182
+ # .mutagent/config.yaml
183
+ monitor:
184
+ slack: # OPTIONAL — omit / disable ⇒ no notifications, never an error
185
+ enabled: true
186
+ channel: "C0123ABC" # a Slack channel id the bot is a member of
187
+ token_ref: "SLACK_BOT_TOKEN" # the ENV-VAR NAME holding the xoxb-… bot token (never the secret)
188
+ ```
189
+
190
+ The Slack app setup is identical to §3 (`chat:write` bot token; `token_ref` is the env-var **name**).
191
+ Unconfigured / disabled `monitor.slack` ⇒ the monitor still **routes** the handover, it just posts no
192
+ Slack (the post no-ops; a broken Slack never blocks a route).
193
+
194
+ | Key | Meaning | Default |
195
+ |---|---|---|
196
+ | `triggers.<stage>.enabled` | arm this stage's rules | `false` (ships DISABLED) |
197
+ | `triggers.<stage>.rules[].on` | the event condition (`trace-count[>=N]` · `schedule` · `ci` · `manual`) | — |
198
+ | `triggers.<stage>.rules[].run` | the stage/command to route to on a match | — |
199
+ | `monitor.slack.enabled` | post a notification per fired trigger | `false` |
200
+ | `monitor.slack.channel` | Slack channel id | — |
201
+ | `monitor.slack.token_ref` | **name** of the env var holding the bot token | — |
202
+
203
+ ```bash
204
+ # arm the external watch on config.triggers
205
+ *monitor
206
+
207
+ # disarm it
208
+ *monitor-stop
209
+ ```
@@ -0,0 +1,132 @@
1
+ # `.mutagent/config.yaml` — Field Board (v0.2.0)
2
+
3
+ > The durable field map for the MutagentConfig contract. Every field · its block ·
4
+ > type · the consumer file(s) that READ it · its purpose · when it is required.
5
+ > Source of truth: `scripts/config-schema.ts` (the doc-comments there mirror this
6
+ > board). No field should read as "dead" — each row names a real consumer.
7
+ >
8
+ > **Consumer legend.** `onboarding-check.ts` / `gate.ts` / `resolve-credential.ts` /
9
+ > `resolve-paths.ts` / `dispatch.ts` live in this package (`mutagent-orchestrator`).
10
+ > `@mutagent/tools` is the shared trace layer (fetch + normalize). The SKILLS
11
+ > (evaluator / diagnostics / agentspec / builder) each read their own
12
+ > `lifecycle.<skill>` section + the shared `global` catalogs. RESERVED = shape is
13
+ > frozen but no current code path reads it (future Build/Improve or the future
14
+ > monitor).
15
+
16
+ ## Top level
17
+
18
+ | Field | Block | Type | Consumer | Purpose | Required-when |
19
+ |---|---|---|---|---|---|
20
+ | `config_version` | (root) | `"0.2.0"` literal | `config-schema.ts` (`validateConfig`, `detectLegacyConfig`) | The FROZEN contract version; wrong/absent ⇒ legacy or reject | ALWAYS |
21
+ | `global` | (root) | object | `onboarding-check.ts`, `gate.ts`, `resolve-credential.ts`, skills | Framework-wide shared resources | Optional (partial config validates) |
22
+ | `lifecycle` | (root) | object | `gate.ts`, `onboarding-check.ts`, each skill | Per-skill behavior, keyed by skill name | Optional |
23
+ | `triggers` | (root) | object | RESERVED — future monitor | The future always-on monitor (disabled) | Optional (ships disabled) |
24
+ | `dogfood` | (root) | object | `scripts/dogfood/*` (the `*dogfood` surface) | Watches a SEPARATE dogfood-target project's sessions | Optional |
25
+
26
+ ## `global` — framework-wide shared resources
27
+
28
+ | Field | Block | Type | Consumer | Purpose | Required-when |
29
+ |---|---|---|---|---|---|
30
+ | `providers[]` | `global` | `Provider[]` | `onboarding-check.ts` (provider floor), `resolve-credential.ts` | Provider credential REFS | evaluate + `judge_runtime: in-house` |
31
+ | `providers[].name` | `global.providers` | string | `resolve-credential.ts`, in-house judge wiring | Provider id (`anthropic`/`google`) | when a provider entry exists |
32
+ | `providers[].credentials_ref` | `global.providers` | `string \| {env,path}` | `onboarding-check.ts`, `resolve-credential.ts` | Env-var NAME (never a raw secret) | when a provider entry exists |
33
+ | `workspace.repo` | `global.workspace` | string | `onboarding-check.ts` (target floor), build/apply worktree | The target repo slug | target-writing stage (build/improve/diagnose-apply) |
34
+ | `workspace.path` | `global.workspace` | string (relative) | `resolve-paths.ts` | Locates the install/init dir | optional |
35
+ | `models.default` | `global.models` | string | `onboarding-check.ts` (default-model floor), evaluator run | Default execution model + JUDGE FALLBACK. **ASYMMETRY: diagnostics IGNORES it** (host-runtime agent-dispatch) | evaluate or a target-writing stage |
36
+ | `models.judge_model` | `global.models` | string | `onboarding-check.ts` (judge floor), evaluator scorecard stamp | C-PIN pinned judge (renamed from `pinned_judge`) | evaluate / audit (judging stages) |
37
+ | `brand.theme` | `global.brand` | string | evaluator/diagnostics HTML report renderers | REPORT STYLING only (cosmetic; no gating effect) | optional |
38
+ | `context[]` | `global` | `ContextLink[]` | the skills (loaded as stage context) | PROJECT-WIDE context links | optional |
39
+ | `context[].path/what/why/when` | `global.context` | string ×4 | loading skill's context banner | The doc + its WHAT/WHY/WHEN rationale | all four required per link |
40
+ | `sources[]` | `global` | `Source[]` | `onboarding-check.ts` (`resolveSourceByRole`), `@mutagent/tools` fetch | The SOURCES catalog (where traces come from) | diagnose (always) / evaluate (discover) |
41
+ | `targets[]` | `global` | `Target[]` | `onboarding-check.ts` (`resolveTargetByRole`), builder/diagnose-apply | The TARGETS catalog (where fixes go) | build / improve(apply) / diagnose(apply, non-report-only) |
42
+
43
+ ### `global.sources[]` — one catalog entry
44
+
45
+ | Field | Type | Consumer | Purpose | Required-when |
46
+ |---|---|---|---|---|
47
+ | `name` | string | `onboarding-check.ts`, run-time confirm/pick prompt | Catalog key | ALWAYS (per entry) |
48
+ | `platform` | enum `langfuse\|otel\|local-jsonl\|claude-code\|codex` | `@mutagent/tools` fetch (+ eval/diag ports) | Picks the per-platform reader | ALWAYS (per entry) |
49
+ | `default` | boolean | `onboarding-check.ts` `resolveByRole`, run-time prompt | SELECTION selector: one default among many ⇒ `resolved-default` | optional (only meaningful with multiple entries) |
50
+ | `project` | string | `@mutagent/tools` remote fetch | Remote project/workspace slug | remote platforms |
51
+ | `endpoint` | string | `@mutagent/tools` remote fetch | Remote base URL (mut. exclusive with `paths`) | remote (otel/rest) |
52
+ | `credential_ref` | `string \| {env,path}` | `resolve-credential.ts` → `@mutagent/tools` | Read token env-var NAME | remote platforms |
53
+ | `paths` | string[] | `@mutagent/tools` local-jsonl / unitf reader | File-source glob(s) (mut. exclusive with `endpoint`) | file sources |
54
+ | `format` | enum `langfuse-export\|claude-code\|codex\|raw\|unitf` | `@mutagent/tools` normalize path | How to parse records. **`unitf` (F1) ⇒ read jsonl direct, skip normalize** | optional (inferred otherwise) |
55
+ | `agent_field` | string | eval/diag agent-variance grouping | Which record field carries the agent name | optional |
56
+ | `latency_unit` | enum `auto\|ms\|s` | `@mutagent/tools` normalize (latency projection) | Latency-unit override (`auto` = infer) | optional |
57
+
58
+ ### `global.targets[]` — one catalog entry
59
+
60
+ | Field | Type | Consumer | Purpose | Required-when |
61
+ |---|---|---|---|---|
62
+ | `name` | string | `onboarding-check.ts`, run-time confirm/pick prompt | Catalog key | ALWAYS (per entry) |
63
+ | `platform` | enum (local-claude/codex/cursor/opencode/mastra/cloud-agent-sdk, **local-skill**, cloud-rest, report-only) | `mutagent-cli apply` adapter (+ builder) | Picks the fix writer / adapter | ALWAYS (per entry) |
64
+ | `subject` | enum `agent\|skill` | apply on-ramp (skill amends → skill-builder wave), `onboarding-check.ts` | D2 subject-kind: `skill` root = skill DIR, SSoT = `.meta/prd.yaml` (annexed skillspec), markdown transport | optional (absent ⇒ `agent`) |
65
+ | `default` | boolean | `onboarding-check.ts` `resolveByRole`, run-time prompt | SELECTION selector: one default among many ⇒ `resolved-default` | optional (only with multiple entries) |
66
+ | `mode` | enum `local\|remote` | diagnose-apply worker | Local-diff vs REST-PUT branch | ALWAYS (per entry) |
67
+ | `root` | string | diagnose-apply worker (local mode) | Local root dir the fix writes under | local mode |
68
+ | `rest_base_url` | string | diagnose-apply worker (remote mode) | Remote REST base URL | remote/cloud-rest |
69
+ | `repo_url` | string | diagnose-apply worker (local-git-over-remote) | Remote git repo clone source | git-over-remote |
70
+ | `code_refs[]` | `CodeRef[]` | **RESERVED — Build/Improve (future)** | Realized-implementation links a `*build`/`*improve` run records | never (reserved) |
71
+ | `code_refs[].path/why` | string ×2 | **RESERVED — Build/Improve (future)** | The impl file + why it realizes the spec | never (reserved) |
72
+ | `credential_ref` | `string \| {env,path}` | `resolve-credential.ts` → diagnose-apply | Target write token env-var NAME | remote mode |
73
+ | `apply` | `Apply` | `onboarding-check.ts`, diagnose-apply worker | HOW a fix is applied | ALWAYS (per entry) |
74
+ | `apply.kind` | enum `code-pr\|markdown\|cloud-deploy\|report-only` | `onboarding-check.ts` (`report-only` gates OUT the target floor), diagnose-apply | Apply strategy | ALWAYS (within `apply`) |
75
+ | `apply.versioning` | boolean | **RESERVED — Build/Improve (future)** | Bump a version stamp on apply | never (reserved) |
76
+ | `apply.pr` | boolean | **RESERVED — Build/Improve (future)** | Open a PR vs write in place | never (reserved) |
77
+
78
+ ## `lifecycle.<skill>` — per-skill sections (open objects; only typed fields shown)
79
+
80
+ | Field | Block | Type | Consumer | Purpose | Required-when |
81
+ |---|---|---|---|---|---|
82
+ | `agentspec.spec_dir` | `lifecycle.agentspec` | string | orchestrator + agentspec skill | Where `*spec` writes agentspec.yaml | optional |
83
+ | `builder.*` | `lifecycle.builder` | open | builder skill (passthrough) | Config-light (writes by role to a target) | optional |
84
+ | `evaluator.context[]` | `lifecycle.evaluator` | `ContextLink[]` | evaluator skill | Stage-specific context for evaluate | optional |
85
+ | `evaluator.judge_runtime` | `lifecycle.evaluator` | string | `gate.ts`/`onboarding-check.ts` (provider floor), evaluator judge wiring | HOW judges run (renamed from `substrate`); `in-house` ⇒ provider floor | optional |
86
+ | `evaluator.*` (other) | `lifecycle.evaluator` | open | evaluator skill (passthrough) | subject/datasets/etc. — the skill's opaque knobs | optional |
87
+ | `diagnostics.apply` | `lifecycle.diagnostics` | string | `onboarding-check.ts` (`diagnosticsIsReportOnly`), `gate.ts` | Report-only gate: `report-only` ⇒ skip the target floor | optional |
88
+ | `diagnostics.context[]` | `lifecycle.diagnostics` | `ContextLink[]` | diagnostics skill | Stage-specific context for diagnose | optional |
89
+ | `diagnostics.*` (other) | `lifecycle.diagnostics` | open | diagnostics skill (passthrough) | ask_tool/run_tags/audience/etc. — opaque knobs | optional |
90
+
91
+ ## `triggers.<stage>` — the future monitor (ALL RESERVED, ship disabled)
92
+
93
+ | Field | Block | Type | Consumer | Purpose | Required-when |
94
+ |---|---|---|---|---|---|
95
+ | `<stage>.enabled` | `triggers.<stage>` | boolean (default false) | RESERVED — future monitor | Master on/off per stage | never (ships false) |
96
+ | `<stage>.rules[]` | `triggers.<stage>` | `TriggerRule[]` (default []) | RESERVED — future monitor | The trigger rules | never (ships empty) |
97
+ | `<stage>.rules[].on` | `triggers.<stage>.rules` | string | RESERVED — future monitor | The event that fires the rule | never |
98
+ | `<stage>.rules[].run` | `triggers.<stage>.rules` | string | RESERVED — future monitor | Stage/command to run on fire | never |
99
+ | `<stage>.schedule.mode/at/timezone` | `triggers.<stage>.schedule` | string ×3 | RESERVED — future monitor | When the monitor wakes | never |
100
+ | `<stage>.heartbeat.notify_on_zero_matches` | `triggers.<stage>.heartbeat` | boolean | RESERVED — future monitor | Notify on empty scan | never |
101
+ | `<stage>.heartbeat.notify_on_matches` | `triggers.<stage>.heartbeat` | boolean | RESERVED — future monitor | Notify on match | never |
102
+ | `<stage>.heartbeat.max_diagnostics_per_day` | `triggers.<stage>.heartbeat` | integer ≥0 | RESERVED — future monitor | Per-day cost cap | never |
103
+
104
+ Stages keyed by the routing `AdlStage` enum: `build \| evaluate \| diagnose \| improve \| audit`.
105
+
106
+ ## `dogfood` — the hidden `*dogfood` observe surface
107
+
108
+ | Field | Block | Type | Consumer | Purpose | Required-when |
109
+ |---|---|---|---|---|---|
110
+ | `source_dir` | `dogfood` | string (ABSOLUTE by design) | `scripts/dogfood/*` | The DOGFOOD-target project's Claude-Code session dir (NOT the build project) | when `dogfood` block present |
111
+ | `session_glob` | `dogfood` | string | `scripts/dogfood/*` | Session glob (default `*.jsonl`) | optional |
112
+ | `include_subagents` | `dogfood` | boolean | `scripts/dogfood/*` | Also tail dispatched subagent JSONLs (default true) | optional |
113
+
114
+ ---
115
+
116
+ ## SELECTION contract — role binding (source + target)
117
+
118
+ Binding is BY ROLE (no `source_ref`/`target_ref`) over the `global.sources[]` /
119
+ `global.targets[]` catalog, under the `default` flag:
120
+
121
+ | Catalog shape | `resolveByRole` status | Bindable? | Run-time behavior |
122
+ |---|---|---|---|
123
+ | 0 entries | `none` | no | floor UNMET (`source/target-required`) |
124
+ | 1 entry | `resolved-single` | yes | auto-bind, NO prompt |
125
+ | many, exactly one `default: true` | `resolved-default` | yes | bind the default; run-time CONFIRMS (preselected, overridable) |
126
+ | many, no default | `needs-selection` | yes | operator PICKS at run time |
127
+ | many, >1 `default: true` | `multiple-defaults` | no | CONFIG ERROR (`source/target-config-error`) |
128
+
129
+ `resolved-single` and `resolved-default` (F2) are DISTINCT statuses but BOTH satisfy
130
+ the onboarding floor — the split only drives the run-time prompt (confirm vs
131
+ silent), never the gate. The confirm/pick prompts are a run-time skill concern, not
132
+ a `gate.ts` blocker.
@@ -0,0 +1,132 @@
1
+ # Config migration directive — `.mutagent/config.yaml` v0.1.0 → v0.2.0
2
+
3
+ > **This is a DIRECTIVE, not a script.** There is no static migrate tool (Fork B:
4
+ > hard-cut). When the orchestrator detects a legacy config it emits
5
+ > `migration-required`; a coding agent (or the operator, under the `*onboard`
6
+ > gate) then rewrites the file IN PLACE by following the steps below. The loader
7
+ > NEVER parses the old shape at runtime.
8
+
9
+ ## When this fires
10
+
11
+ `loadConfig` returns `{ ok: false, legacy: true }` — and `gateExecution` emits the
12
+ `migration-required` blocker — when the parsed config carries ANY legacy marker:
13
+
14
+ - `config_version` is absent or `"0.1.0"` (anything other than the frozen `"0.2.0"`), OR
15
+ - a legacy top-level key is present: `shared`, `stages`, a top-level `diagnostics`
16
+ section, or a top-level `evaluator` section, OR
17
+ - any `stages.<stage>.observability` block survives.
18
+
19
+ ## The v0.2.0 shape (target)
20
+
21
+ Three top-level blocks: **`global`** (shared resources + the sources/targets
22
+ catalogs) · **`lifecycle`** (per-skill, keyed by skill name) · **`triggers`**
23
+ (future monitor, per stage, disabled). The old `stages` map is GONE — every skill
24
+ IS a stage, so the config is keyed by skill, and "where traces come from" / "where
25
+ fixes go" live in a global catalog bound BY ROLE (no `source_ref` / `target_ref`).
26
+
27
+ ## The transform (apply all, in order)
28
+
29
+ 1. **`shared` → `global`.** Rename the top-level `shared:` block to `global:`.
30
+ Every field under it keeps its meaning.
31
+
32
+ 2. **`models.pinned_judge` → `models.judge_model`.** Rename the key under
33
+ `global.models`. Semantics unchanged — it is the C-PIN pinned judge model
34
+ (`agent-dispatch` judge runtime ⇒ the host model, no provider key).
35
+
36
+ 3. **Hoist the observability source → `global.sources[]`.** For each
37
+ `stages.<stage>.observability` you had (typically evaluate + diagnose, usually
38
+ the SAME source named in multiple places), create ONE entry under
39
+ `global.sources[]`:
40
+ ```yaml
41
+ global:
42
+ sources:
43
+ - name: primary-langfuse # a catalog id you choose
44
+ platform: langfuse # was observability.platform
45
+ project: mutagent-evals # was observability.project (optional)
46
+ # endpoint / credential_ref / paths / format / agent_field / latency_unit
47
+ # as applicable — endpoint_ref (env-var) becomes credential_ref
48
+ ```
49
+ De-duplicate: if evaluate + diagnose named the same source, emit it ONCE. A
50
+ source-consuming stage binds it BY ROLE under the SELECTION contract: one
51
+ entry ⇒ auto-bind; MANY entries ⇒ mark exactly ONE with `default: true` to
52
+ auto-select it (`resolved`), or leave all un-marked to pick at run time
53
+ (`needs-selection`). Setting `default: true` on MORE THAN ONE entry is a
54
+ config error (`multiple-defaults`) — the orchestrator surfaces it as a distinct
55
+ `source-config-error` blocker.
56
+
57
+ ```yaml
58
+ global:
59
+ sources:
60
+ - name: prod-langfuse # auto-selected when multiple exist
61
+ platform: langfuse
62
+ default: true # SELECTION selector (optional, boolean)
63
+ - name: local-jsonl-dump
64
+ platform: local-jsonl
65
+ paths: [traces/*.jsonl]
66
+ ```
67
+
68
+ 4. **Hoist the apply target → `global.targets[]`.** If the legacy config expressed
69
+ a fix target (a `diagnostics.target` / a `report-only` marker), create ONE
70
+ entry under `global.targets[]`:
71
+ ```yaml
72
+ global:
73
+ targets:
74
+ - name: local-agents
75
+ platform: local-claude # local-claude|…|cloud-rest|report-only
76
+ mode: local # local | remote
77
+ root: .claude/agents # local targets
78
+ # rest_base_url / repo_url / code_refs / credential_ref as applicable
79
+ apply:
80
+ kind: code-pr # code-pr|markdown|cloud-deploy|report-only
81
+ ```
82
+ A `report-only` legacy target becomes `lifecycle.diagnostics.apply: report-only`
83
+ (see step 6) — a report-only run needs NO target at all. As with sources, a
84
+ MULTI-target catalog uses the SELECTION contract: mark exactly one entry
85
+ `default: true` to auto-select it, or leave all un-marked to pick at run time.
86
+ More than one `default: true` is a config error (`target-config-error`).
87
+
88
+ 5. **Drop `stages` entirely.** After steps 3-4, delete the whole `stages:` map. Its
89
+ only real content was `observability` (now a global source) — the rest was a
90
+ false phase/skill axis that v0.2.0 collapses.
91
+
92
+ 6. **Move skill sections under `lifecycle.<skill>`.** A top-level `diagnostics:` /
93
+ `evaluator:` section moves under `lifecycle:`, keyed by skill name:
94
+ ```yaml
95
+ lifecycle:
96
+ agentspec: { spec_dir: .mutagent/specs } # optional
97
+ builder: {} # config-light
98
+ evaluator: { judge_runtime: agent-dispatch, context: [...] }
99
+ diagnostics:{ apply: report-only, context: [...] }
100
+ ```
101
+ The orchestrator TYPES only the gate-relevant fields per skill
102
+ (`spec_dir` / `context` / `apply` / `judge_runtime`); every other knob is the
103
+ skill's own opaque passthrough — leave it as-is under its skill section.
104
+
105
+ 7. **`substrate` → `judge_runtime`.** Under the evaluator section, rename
106
+ `substrate` to `judge_runtime`. Enum VALUES are unchanged
107
+ (`agent-dispatch` | `in-house` | `code-based` | `user-framework`).
108
+
109
+ 8. **Move `diagnostics.{schedule, trigger_rules, heartbeat}` → `triggers.<stage>`.**
110
+ These three no longer live under the diagnostics skill section. Fold them into
111
+ the top-level `triggers` block, keyed per stage:
112
+ ```yaml
113
+ triggers:
114
+ diagnose:
115
+ enabled: false # ships DISABLED (on-demand only)
116
+ rules: [] # was diagnostics.trigger_rules
117
+ schedule: { mode: on-demand, at: ..., timezone: ... } # was diagnostics.schedule
118
+ heartbeat: { notify_on_zero_matches: ..., max_diagnostics_per_day: ... } # was diagnostics.heartbeat
119
+ ```
120
+
121
+ 9. **Widen credential refs.** Any `credentials_ref` / `credential_ref` /
122
+ `endpoint_ref` that named a bare env var stays a string; where you need to pin
123
+ an explicit file, use the widened `{ env: NAME, path: FILE }` object form. Refs
124
+ are ALWAYS env-var NAMES — never a raw secret value.
125
+
126
+ 10. **Bump the version.** Set `config_version: "0.2.0"`.
127
+
128
+ ## After migrating
129
+
130
+ Re-run the orchestrator's onboarding check / `*onboard` gate. `loadConfig` now
131
+ returns `{ ok: true, config }`; the `migration-required` blocker clears and the
132
+ scoped source/target/provider floors take over.
@@ -0,0 +1,92 @@
1
+ # `.mutagent/index.md` — the ADL spec ↔ implementation registry
2
+
3
+ > Convention doc for the orchestrator-owned registry writer (`scripts/index/{build-index,render-index}.ts`).
4
+ > This is the ONLY place the update-point convention is documented (F4, PLAN §"FEATURE 4").
5
+
6
+ ## What it is
7
+
8
+ `.mutagent/index.md` is a **single markdown file that IS the record** — no sidecar JSON. It links
9
+ each registered AgentSpec to everything that realizes it, versioned + dated, so the spec ↔
10
+ implementation relationship stays traceable across the whole ADL loop.
11
+
12
+ The markdown IS the machine surface: section headers + markdown links are what downstream reads.
13
+ There is no parallel structured file to drift against.
14
+
15
+ ## HIGH-LEVEL ONLY (anti-drift — LOAD-BEARING)
16
+
17
+ The index carries **identity + stage/verdict + version/date + LINKS ONLY**:
18
+
19
+ - spec identity (`spec_id`, display name) + `spec_version`
20
+ - ADL `loop_state.stage` + `last_verdict`
21
+ - the build target (`target_framework` · `runtime`)
22
+ - markdown LINKS to: agent code · tooling/integrations · harness/framework code · context/product docs
23
+ - an injected `updated <YYYY-MM-DD>` stamp
24
+
25
+ It **NEVER** carries eval criteria, scenarios, dataset detail, or any other volatile field. That
26
+ lives in the evaluator's living-suite; duplicating it here is a drift + maintenance burden. **The
27
+ index only links; it never restates.** The renderer is guarded by a test that asserts no
28
+ `criteria` / `scenario` / `dataset` tokens ever appear.
29
+
30
+ ## Data sources
31
+
32
+ | Field(s) | Source | Notes |
33
+ |---|---|---|
34
+ | `spec_id` · `spec_version` · `stage` · `last_verdict` | each `agentspec.yaml` under `.mutagent/specs/*` (`meta` + `meta.loop_state`) | `last_verdict` absent ⇒ rendered as `—` |
35
+ | display name | `definition.identity.name` (falls back to the spec_id) | |
36
+ | build target · runtime | `build.{target_framework, runtime}` | absent build block ⇒ Build bullet omitted |
37
+ | implementation / code links | config `global.targets[].code_refs[]` (`{path, why}`) | flattened across targets, deduped + sorted by path |
38
+ | context / product docs | config `global.context[]` (`{path, what, why, when}`) | sorted by path |
39
+ | `updated <date>` | **INJECTED clock** (`nowIso.slice(0,10)`), NOT the spec's `updated_at` | see Determinism |
40
+
41
+ **Why config-sourced impl links (not per-spec):** per agentspec PR-013 the spec is
42
+ implementation-agnostic and never enumerates its own impls (backwards-only linking). So the config's
43
+ `global.targets[].code_refs` are the impl-link source of truth. They are shared across the install and
44
+ attached to each spec entry — exactly right for the dominant one-agent-per-install case; a multi-agent
45
+ install shows them as shared implementation/context, which is the correct high-level view (per-spec
46
+ target binding is a run-time role-binding concern, out of scope for the static index).
47
+
48
+ **Link resolution:** the index lives at `<root>/.mutagent/index.md`.
49
+ - Spec links are `.mutagent/`-relative: `specs/<id>/agentspec.yaml` (no prefix).
50
+ - Code + context paths are project-root-relative (config determinism rule), so they are hopped out of
51
+ `.mutagent/` with a `../` prefix: `src/foo.ts` → `[src/foo.ts](../src/foo.ts)`.
52
+
53
+ ## Determinism (mirrors the diagnostics `store.ts` `regenerateIndex` pattern)
54
+
55
+ `regenerateIndex(root, nowIso, io?)` regenerates the WHOLE file from on-disk state each call
56
+ (append-then-regenerate — never hand-patched line edits):
57
+
58
+ - entries sorted by `spec_id`; code + context links sorted (and deduped) by path
59
+ - the ONLY non-determinism — the `updated` date — is **injected** by the caller (`nowIso`), so tests
60
+ are byte-stable and a re-run with the same clock produces byte-identical output
61
+ - pure `buildIndexModel` (data → model, no I/O / no clock) + pure `renderIndex` (model → markdown)
62
+ - the fs is an **injected `IndexIo` seam** (live binding = `node:fs`; tests inject an in-memory fake)
63
+ - **fail-soft per entry:** a spec whose YAML fails to parse drops its own row rather than crashing the
64
+ whole regen
65
+
66
+ ## Owner + update points (orchestrator-owned — Fork C)
67
+
68
+ The **orchestrator** owns `.mutagent/index.md` because it is the only layer that sees every ADL stage.
69
+ It regenerates the file at each stage **finalize** — the per-stage skills emit the fields they own
70
+ (into their `agentspec.yaml` / config), and the orchestrator re-runs `regenerateIndex` to re-link:
71
+
72
+ | ADL stage | Finalize trigger | What the regen picks up |
73
+ |---|---|---|
74
+ | SPEC | `*spec` register | new `spec_id` · `spec_version` · `stage: spec` |
75
+ | BUILD | `*build` finalize | `build.{target_framework, runtime}` · realized `code_refs` |
76
+ | EVALUATE | `*evaluate` run-end | `loop_state.last_verdict` |
77
+ | DIAGNOSE | `*diagnose` finalize | (findings link — future; still high-level, link only) |
78
+ | IMPROVE | `*improve` finalize | re-linked impl paths after the fix |
79
+
80
+ Because the writer is a full regenerate (not an incremental patch), each finalize simply calls
81
+ `regenerateIndex` — the file always reflects the current on-disk truth. The orchestrator wires this
82
+ step into `orchestrator.md` / the orchestrator-protocol (owned by the orchestrator lane — NOT edited
83
+ from here).
84
+
85
+ ## CLI
86
+
87
+ ```bash
88
+ # Regenerate the index for the resolved (or supplied) `.mutagent/` install root.
89
+ bun run scripts/index/build-index.ts [root] [--now <ISO8601>]
90
+ ```
91
+
92
+ `--now` pins the clock (deterministic scripting / reproducing a stamp); default is the wall clock.