@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,100 @@
1
+ # Schedule Prep — How to Wire Scheduling Post-v0.1
2
+
3
+ > v0.1 ships `schedule.mode: on-demand` ONLY.
4
+ > This document prepares the operator to add scheduling via their host runtime after v0.1.
5
+
6
+ ## Why no schedules in v0.1
7
+
8
+ Scheduling is host-runtime-specific. v0.1 ships the structure (config fields, trigger_rules, heartbeat config) but no schedule wiring. The operator can ask their coding agent to wire scheduling at any time using the playbook below.
9
+
10
+ ---
11
+
12
+ ## How to ask your coding agent to set up scheduling
13
+
14
+ Tell your coding agent:
15
+ ```
16
+ Set up daily diagnostics at 09:00 using mutagent-diagnostics.
17
+ Source: langfuse. Trigger rule: has_feedback + score_below threshold.
18
+ ```
19
+
20
+ The coding agent will follow the appropriate procedure for your host runtime:
21
+
22
+ ---
23
+
24
+ ## Claude Code — native /loop + CronCreate
25
+
26
+ ```bash
27
+ # Claude Code has native scheduling primitives (confirmed in docs)
28
+ # 1. Update config.yaml: schedule.mode = daily-batch, at = "09:00"
29
+ # 2. Register with Claude Code's scheduler:
30
+ # CronCreate({ cron: "0 9 * * *", command: "invoke mutagent-diagnostics" })
31
+ # OR use /loop for interactive polling:
32
+ # /loop 24h <diagnose my agents>
33
+ ```
34
+
35
+ Reference: [code.claude.com/docs](https://code.claude.com/docs/en/)
36
+
37
+ ---
38
+
39
+ ## Codex CLI — external cron + codex exec
40
+
41
+ ```bash
42
+ # Codex has no native scheduler — use OS cron
43
+ # 1. Update config.yaml: schedule.mode = daily-batch, at = "09:00"
44
+ # 2. Add crontab entry:
45
+ crontab -e
46
+ # Add line:
47
+ # 0 9 * * * codex exec --ephemeral "invoke mutagent-diagnostics for daily batch"
48
+ ```
49
+
50
+ Reference: [developers.openai.com/codex](https://developers.openai.com/codex/cli)
51
+
52
+ ---
53
+
54
+ ## Cursor — Background Agents (2025+)
55
+
56
+ ```bash
57
+ # Verify Background Agents support scheduling in your Cursor version
58
+ # If supported: register a recurring task via Background Agents UI
59
+ # If not: fall back to OS cron (see Codex pattern above)
60
+ ```
61
+
62
+ Reference: [cursor.com/docs](https://cursor.com/docs)
63
+
64
+ ---
65
+
66
+ ## Headless / CI (GitHub Actions)
67
+
68
+ ```yaml
69
+ # .github/workflows/mutagent-diagnostics-daily.yml
70
+ name: Daily Diagnostics
71
+ on:
72
+ schedule:
73
+ - cron: '0 9 * * *'
74
+ jobs:
75
+ diagnose:
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+ - name: Run diagnostics
80
+ run: pnpx @mutagent/diagnostics run --non-interactive
81
+ env:
82
+ LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
83
+ ```
84
+
85
+ ---
86
+
87
+ ## config.yaml schedule fields
88
+
89
+ ```yaml
90
+ schedule:
91
+ mode: daily-batch # Change from on-demand → daily-batch
92
+ at: "09:00" # Local time
93
+ timezone: "America/New_York"
94
+
95
+ heartbeat:
96
+ notify_on_matches: true # Notify operator when triggers fire
97
+ max_diagnostics_per_day: 3 # Cost guardrail
98
+ ```
99
+
100
+ **Important**: scheduled runs produce a report + notification. HITL apply gate still fires — operator must confirm apply on next interactive session.
@@ -0,0 +1,128 @@
1
+ # Scope Model — Skill vs Agent + Agent-ID Identity
2
+
3
+ > **W11-07** — documents the scope-picker decision model and the agent-identity
4
+ > resolution system introduced in Wave-11.
5
+ >
6
+ > **Authority**: orchestrator-protocol.md Step 3a (runtime procedure) references
7
+ > this file for the full model.
8
+
9
+ ---
10
+
11
+ ## Scope Types
12
+
13
+ The diagnostic run has three scope modes:
14
+
15
+ | Scope | When to use | Config resolution |
16
+ |---|---|---|
17
+ | `skill` | Diagnosing a skill's operational traces (e.g. `mutagent-diagnostics`) | Looks up `config.agents[name=<entity>]` |
18
+ | `agent` | Diagnosing a named runtime agent (e.g. `search-agent`, `orchestrator`) | Looks up `config.agents[name=<entity>]` |
19
+ | `all-traces` | No named entity — run across all available traces | No identity lookup; name-based filter only |
20
+
21
+ ---
22
+
23
+ ## Invocation-Aware Scope Resolution
24
+
25
+ The orchestrator determines scope using this **decision tree** at Step 3a:
26
+
27
+ ```
28
+ parse-brief result
29
+
30
+ ├── scopeType = "skill" → use scope: skill directly (no AskUserQuestion)
31
+
32
+ ├── scopeType = "agent" → use scope: agent directly (no AskUserQuestion)
33
+
34
+ └── scopeType = null → AskUserQuestion: skill | agent | all-traces
35
+ (see orchestrator-protocol.md Step 3a for template)
36
+ ```
37
+
38
+ **Named → direct**: when parse-brief extracts a `scopeType`, use it immediately.
39
+ No AskUserQuestion for scopes that are already resolvable from the brief.
40
+
41
+ **Null → ask**: when scope cannot be inferred, present the three-option picker
42
+ with concrete preview blocks (per `feedback_ask_user_question_with_previews`).
43
+
44
+ ---
45
+
46
+ ## Agent-ID Identity Map
47
+
48
+ The `config.agents[]` field (added W11-07) is an optional cross-platform identity
49
+ map that tells the skill HOW to find a named entity's traces on each observability
50
+ platform.
51
+
52
+ ### Why this is needed
53
+
54
+ A single code-level agent may appear as:
55
+ - `"search-agent"` in application code
56
+ - `"search-v2"` as `trace.name` in Langfuse (due to versioned naming)
57
+ - `"search-svc"` as `service.name` in OpenTelemetry (due to service naming conventions)
58
+
59
+ Without an identity map, the skill falls back to name-based matching which may
60
+ miss traces or return traces from a different agent.
61
+
62
+ ### Config shape
63
+
64
+ ```yaml
65
+ # .mutagent/config.yaml
66
+ agents:
67
+ - name: search-agent # canonical code-level name (matches parse-brief.entity)
68
+ langfuse:
69
+ traceName: "search-v2" # Langfuse trace.name override
70
+ tags: ["production"] # additional tag filter
71
+ agentIdField: "metadata.agent_id" # custom field override
72
+ otel:
73
+ serviceName: "search-svc" # OTEL service.name
74
+ resourceAttrs:
75
+ deployment.env: "prod" # additional resource attr filter
76
+ ```
77
+
78
+ See `scripts/config/schema.ts` → `AgentIdentitySchema` for the TypeBox definition.
79
+
80
+ ### Resolution Step (Step 3.7)
81
+
82
+ ```typescript
83
+ import { resolveEntityIdentity } from "scripts/normalize/platforms/entity-context.ts";
84
+
85
+ // After parse-brief and scope picker (Step 3a):
86
+ const identity = resolveEntityIdentity(parsedInvocation.entity, config.agents);
87
+ if (identity) {
88
+ entityContext.identity = identity;
89
+ }
90
+ ```
91
+
92
+ `resolveEntityIdentity` performs a case-insensitive name lookup. When the entity is
93
+ not declared in `config.agents`, it returns `undefined` and the run proceeds with
94
+ name-based matching (no behavioral change from pre-W11-07).
95
+
96
+ ### How identity pointers are used
97
+
98
+ After `EntityContext.identity` is populated:
99
+
100
+ | Platform | How identity is used |
101
+ |---|---|
102
+ | Langfuse | `identity.langfuse.traceName` overrides the trace name filter; `identity.langfuse.tags` added to query; `identity.langfuse.agentIdField` overrides the JSON field used for `agentId` extraction |
103
+ | OTel | `identity.otel.serviceName` filters by `service.name` resource attr; `identity.otel.resourceAttrs` added to span query |
104
+
105
+ When `identity` is absent: existing name-based matching behavior (backward-compatible).
106
+
107
+ ---
108
+
109
+ ## Escape Hatch: all-traces
110
+
111
+ When the operator selects `all-traces` (or explicitly passes `--scope all`):
112
+ - No entity identity lookup.
113
+ - No `skillAgentScope` filter applied.
114
+ - TraceFilter.skill_agent_scope remains empty.
115
+ - The run is an unfocused exploratory sweep.
116
+
117
+ Use this for initial investigations before a named entity is known.
118
+
119
+ ---
120
+
121
+ ## Backward Compatibility
122
+
123
+ - `config.agents` is OPTIONAL. Configs without it continue to work unchanged.
124
+ - `EntityContext.identity` is OPTIONAL. All downstream consumers that read
125
+ `EntityContext` but do not use `identity` are unaffected.
126
+ - `ParsedInvocation.scopeType` + `entity` are new fields with TypeScript default
127
+ `scopeType: null` — existing callers that deconstruct only the original fields
128
+ continue to compile without changes.
@@ -0,0 +1,174 @@
1
+ # Verification Methodology — Background Investigator (finding false-positive audit)
2
+
3
+ > Audience: CORE. Sits beside [`rca.md`](rca.md) and [`handover-contract.md`](handover-contract.md).
4
+ > Status: **documentation, on-demand**. This wave it is invoked manually for a one-shot audit of a
5
+ > finished report. It is written to be **repeatable and improvable** — a future orchestrator step can
6
+ > consume it verbatim (see "Future wiring" at the end). It does NOT edit `references/principles.md`
7
+ > (operator-LOCKED); it only PROPOSES.
8
+
9
+ ## 0. Why this exists
10
+
11
+ The producer-side gates enforce **shape, not truth**: `findings-contract.ts` checks fields are
12
+ present and well-formed, the problem-statement format gate rejects task-phrasing, and the Wave-18
13
+ analyzer rule "[Never infer cache/cost — read the field](../../assets/agents/diagnostics-analyzer.md)"
14
+ forces cache *detection* to come from real token fields. None of those re-validate that a finding's
15
+ **asserted mechanism** is consistent with the grounded evidence. A finding can be perfectly shaped,
16
+ honestly hedged in its assumptions, and still ship a **false positive** because its `failureOrigin`
17
+ or `whyChain` states — *as fact* — a mechanism that the trace data does not confirm.
18
+
19
+ The Background Investigator is the **independent, evidence-first audit pass** that closes that gap. It
20
+ re-derives each finding's claims from the raw trace evidence and the run's `diagnosis-context.md`,
21
+ and assigns a verdict. It is fed **raw data, never the orchestrator's conclusions** (peer-verification
22
+ discipline): seeding it with the hypothesis it is meant to test would make it corroborate the error.
23
+
24
+ ## 1. Equipment (what the investigator must read FIRST)
25
+
26
+ Before auditing a single finding, the investigator reads, in order:
27
+
28
+ 1. **`diagnosis-context.md`** — the run's grounded lens (entity identity · operator-stated purpose ·
29
+ FULL untruncated system prompt · tool inventory · source code when accessible). This is the same
30
+ Step-5.7 artifact the analyzers pre-read; it is how the investigator gets "full skill knowledge"
31
+ of *what the entity was supposed to do*, so it can tell intended behavior from a real deviation.
32
+ 2. **This methodology** — the five tiers + the verdict rubric.
33
+ 3. **The per-source cache-detection reference** (§5) + the relevant
34
+ [`references/source-platforms/<platform>.md`](../source-platforms/) — so it knows *where cache
35
+ tokens live for this platform* and where a *false* `cacheStatus="unknown"` can arise.
36
+ 4. **The raw evidence** — the sampled trace bodies and per-slice evidence files the findings cite,
37
+ plus the run's mechanical artifacts (trajectory corroborations, the `wave6/*.json` methodology
38
+ stamps, tier-0 output). These are the ground truth a citation is checked against.
39
+
40
+ If a required pointer's raw source is **not retained** (e.g. trace bodies were not persisted), the
41
+ investigator marks the affected citation **"unresolvable — needs raw-trace re-fetch"**. It never
42
+ guesses, and never upgrades an unresolvable citation to "confirmed".
43
+
44
+ ## 2. The verdict — `AuditVerdict`
45
+
46
+ Each finding (and, where relevant, each remedy) gets one or more verdict rows:
47
+
48
+ ```
49
+ AuditVerdict = {
50
+ findingId: string
51
+ remedyId?: string
52
+ verdict: "CONFIRMED" | "DOWNGRADE" | "RETRACT"
53
+ tier: "citation-truth" | "mechanism-consistency" | "corroboration-alignment"
54
+ | "assumption-integrity" | "prevalence-honesty"
55
+ reason: string // plain-words why, ≤2 sentences
56
+ contradictingEvidence: string // the exact field/pointer that contradicts (e.g. "tr_7c1 cacheStatus=unknown")
57
+ caveat?: string // REQUIRED when verdict=DOWNGRADE — the SECONDARY caveat to render
58
+ }
59
+ ```
60
+
61
+ A finding's overall disposition is the **most severe** verdict across its rows
62
+ (`RETRACT` > `DOWNGRADE` > `CONFIRMED`).
63
+
64
+ ## 3. Handling rubric (operator-chosen: retract fabricated, downgrade unconfirmed)
65
+
66
+ | Condition | Verdict | Report effect |
67
+ |---|---|---|
68
+ | A **load-bearing** citation is fabricated or unresolvable, OR the origin claim is contradicted outright by the grounded evidence | **RETRACT** | Finding removed from the active set **with a visible ledger note** (Methodology tab) — never silent-dropped. |
69
+ | Finding is **plausible** but a load-bearing claim rests on an **unverified / unknown** mechanism (e.g. cache state unknown), or the WHAT/WHY is LLM-asserted-only with no mechanical corroboration, or a prevalence figure is inflated | **DOWNGRADE** | Severity capped to **SECONDARY**; the `caveat` is rendered; any "RECOMMENDED / RANK-1" emphasis on the dependent remedy is removed. |
70
+ | Claims dereference cleanly and are consistent with grounded fields | **CONFIRMED** | No change. |
71
+
72
+ **Visible, never silent** (Wave-17 discipline): a RETRACT writes a ledger note; a DOWNGRADE writes a
73
+ caveat. The operator can always see *what the audit changed and why*.
74
+
75
+ ## 4. The five audit tiers
76
+
77
+ Run cheapest-first; a single finding may collect verdicts from several tiers.
78
+
79
+ ### (i) Citation-truth resolution
80
+ For every `failureOrigin.evidence` and every `whyChain[].evidence` pointer (`trace-id#msg[range]`,
81
+ `file:line`, or a named run artifact), dereference it against the real trace body / source in
82
+ `diagnosis-context.md`. The dereferenced content must **support** the paired `whatHappened`.
83
+ - Unresolvable **load-bearing** pointer → **RETRACT** (or "unresolvable — needs raw-trace re-fetch"
84
+ when the raw source simply was not retained; flag, do not retract on absence alone).
85
+ - Resolves but **does not support** the narration → **DOWNGRADE**.
86
+
87
+ ### (ii) Mechanism-consistency — *priority tier: the caching class*
88
+ Flag any `failureOrigin` / `whyChain` step that asserts a **mechanism contradicted by a grounded
89
+ field**. The caching specialization (the motivating class):
90
+
91
+ > A **cache-dependent mechanism** asserted as fact — "the static prefix is re-sent / re-processed
92
+ > every step", "uncached", "no caching benefit", "per-step token re-pay" — while the grounded
93
+ > `cacheStatus` for the finding's `sourceTraceIds` is **`unknown`** or **`miss`-claimed-as-`off`**,
94
+ > **OR** while an `assumptions[]` entry about caching is **`unverified` / `hypothesis-pending`**.
95
+
96
+ → **DOWNGRADE** to SECONDARY with caveat: *"cache state UNKNOWN — mechanism unverified; the rising
97
+ per-step latency may be the growing transcript, not the static prefix."* If the **entire** finding
98
+ rests on the uncached premise, escalate toward RETRACT.
99
+
100
+ This is the consistency check the analyzer's detection rule cannot make about itself: detection says
101
+ *"read the field, don't infer"*; the investigator says *"and don't ASSERT a mechanism the field
102
+ leaves unknown."*
103
+
104
+ ### (iii) Corroboration alignment
105
+ A **PRIMARY** finding's `failureOrigin.what` / `why` must resolve against the run's mechanical
106
+ trajectory corroborations (retry-loop → loop/latency · tool-error → tool-misuse · abandoned-call →
107
+ handoff-loss · oscillation → prompt-underspec). LLM-asserted-only, with no mechanical corroboration
108
+ → **DOWNGRADE** to SECONDARY (surface the same evidence-floor reason the enricher would).
109
+
110
+ ### (iv) Assumption-status integrity
111
+ A load-bearing claim in `problem` / `failureOrigin` / `whyChain` cannot rest on an assumption marked
112
+ `unverified` / `hypothesis-pending` while being stated **declaratively as fact**. The contradiction
113
+ between a confident origin and its own hedged assumption → **DOWNGRADE**. (The caching FP is the
114
+ common instance of this general rule.)
115
+
116
+ ### (v) Prevalence honesty
117
+ Any `k/n`, "N traces", or "X% of the population" claim is checked against `sourceTraceIds.length` and
118
+ the sampled denominator (`sampledCount`). A figure larger than the evidence supports → **DOWNGRADE**
119
+ with the corrected `seen in k/n sampled` in the caveat.
120
+
121
+ ## 5. Per-source cache-detection reference
122
+
123
+ "Different ways depending on the trace source." Where cache tokens live, and where a **false**
124
+ `cacheStatus="unknown"` (which then licenses a caching FP under tier ii) can arise:
125
+
126
+ | Source | Where the cache signal lives | Easy-to-miss / false-`unknown` risk |
127
+ |---|---|---|
128
+ | **Langfuse** | per-GENERATION `usageDetails.input_cached_tokens` (cache read), `cache_creation_input_tokens` (cache write); Anthropic-shape `usage.cache_read_input_tokens` / `cache_creation_input_tokens`; flattened top-level aliases | Cache tokens on a **non-doGenerate** GENERATION span, or at **trace-level** `usageDetails`, are not seen if only leaf `doGenerate` spans are scanned. A flat export that omitted `usageDetails` ⇒ genuine `unknown` (do not read it as "uncached"). |
129
+ | **OTel** | span attrs `gen_ai.usage.cache_read_input_tokens` / `input_cached_tokens`, `gen_ai.usage.cache_creation_input_tokens`, `llm.usage.*` variants | Vendor-specific attribute names (`anthropic.*`, `bedrock.*`) and **baggage**-propagated usage are not in the standard key set ⇒ `unknown`. |
130
+ | **Claude-Code / Codex / local-JSONL** | no native cache-token reporting in the transcript format | `cacheStatus` is **always `unknown` / absent**. *Every* cache or per-step-cost claim on these sources is a hypothesis — tier (ii) downgrades any that are asserted as fact. |
131
+
132
+ Cross-reference: the analyzer's "Never infer cache/cost — read the field (W18-cache)" section is the
133
+ **detection** rule; this table tells the investigator where detection can legitimately fail to a
134
+ `unknown`, so it can tell *"unknown because the field was absent"* (a real hypothesis) from
135
+ *"unknown because the normalizer didn't look in the right place"* (flag for a normalizer follow-up).
136
+
137
+ ## 6. Worked example (synthetic)
138
+
139
+ > **Finding F-syn-lat-2** (PRIMARY, RANK-1 RECOMMENDED remedy).
140
+ > `problem`: *"The agent runs ~6 serial reasoning calls per trace; per-step latency climbs from 2.2s
141
+ > to 5.6s because the 18k-token system prompt is re-sent and re-processed on every step."*
142
+ > `failureOrigin.whyChain[origin]`: *"system prompt re-sent every step inflates per-step cost."*
143
+ > `assumptions[]`: *"Rising per-step latency reflects growing input, not throttling — UNVERIFIED;
144
+ > `input_cached_tokens` not present in the export so caching state could not be confirmed."*
145
+ > Source platform: Langfuse export; `cacheStatus = "unknown"` for all source traces.
146
+
147
+ **Audit:**
148
+ - Tier (ii) mechanism-consistency: origin asserts "re-sent **and re-processed** every step" *as fact*
149
+ → but re-*processing* only holds if the prefix is **uncached**, and `cacheStatus="unknown"`.
150
+ `contradictingEvidence: "all sourceTraceIds cacheStatus=unknown; caching assumption UNVERIFIED"`.
151
+ - Tier (iv) assumption-integrity: the same assumption block marks caching unverified while the origin
152
+ states it declaratively.
153
+
154
+ **Verdict:** `DOWNGRADE`, tier `mechanism-consistency`,
155
+ `caveat: "cache state UNKNOWN — the prefix may already be cached (~typical for static system
156
+ prompts); rising per-step latency may be the growing transcript, not prefix re-processing. Confirm
157
+ input_cached_tokens on live traces before prioritizing a prefix-caching fix."` → severity SECONDARY,
158
+ RANK-1/RECOMMENDED emphasis removed from the "enforce prompt caching" remedy. The *other* legitimate
159
+ driver (serial-chain depth) is unaffected and stays.
160
+
161
+ ## 7. Future wiring (improve-loop)
162
+
163
+ This methodology is built to be promoted from on-demand to in-pipeline without rewrite:
164
+ - A `diagnostics-investigator` agent (sibling of `diagnostics-analyzer`) would take the inputs in §1
165
+ and emit `AuditVerdict[]`.
166
+ - An orchestrator **Step 7.5** (post-`findings-contract`, pre-RCA) would run it and apply §3:
167
+ DOWNGRADE → SECONDARY + caveat (reuse the enricher's existing SECONDARY caveat surface);
168
+ RETRACT → remove + `RunMeta.decisions[]` ledger note.
169
+ - A deterministic backstop (`cache-consistency.ts`) could front-run tier (ii) for free.
170
+
171
+ To **improve** the methodology: when a new false-positive class is observed, add a tier (or a cue to
172
+ an existing tier) here with a synthetic worked example, the same way §4(ii) was seeded from the
173
+ prompt-caching class. Keep cues conservative — match explicit mechanism tokens, never any bare
174
+ mention of the topic — so the audit never manufactures its own false positives.
@@ -0,0 +1,167 @@
1
+ /**
2
+ * scripts/awareness/blind-spots.ts
3
+ * R2.2 — blind-spots derivation for the Methodology Step 1.5 widget.
4
+ * Type A — Pure Script (deterministic; NO clock/random/LLM/I-O).
5
+ *
6
+ * A "blind spot" is a signal that Tier-0 CANNOT measure (so it would never become
7
+ * the auto-picked primary signal) but which the awareness LLM mini-sample (R2.2)
8
+ * CAN surface. The blind-spots table makes the measurement gap HONEST (design
9
+ * philosophy §2.3): for each candidate signal we state whether Tier-0 can measure
10
+ * it, who checked it, and what was found.
11
+ *
12
+ * The canonical Tier-0-MEASURABLE set is derived from what tier0-scan.ts actually
13
+ * computes: error spike, latency spike, feedback cluster, low score, api exhaustion,
14
+ * skill-behavior deviation. EVERYTHING ELSE in the WHAT taxonomy is a Tier-0
15
+ * blind spot — only the LLM awareness layer can see it.
16
+ */
17
+
18
+ import type { WhatCategory } from "../normalize/trace.ts";
19
+
20
+ /** WHAT-categories Tier-0 can MEASURE deterministically (from tier0-scan.ts). */
21
+ export const TIER0_MEASURABLE: ReadonlySet<WhatCategory> = new Set<WhatCategory>([
22
+ "latency-spike",
23
+ "low-score",
24
+ "user-complaint", // feedback cluster
25
+ "cost-overshoot", // token totals are countable
26
+ ]);
27
+
28
+ /**
29
+ * WHAT-categories that are Tier-0 BLIND SPOTS — only the LLM awareness layer
30
+ * (or a deep-read) can surface them. The complement of TIER0_MEASURABLE over the
31
+ * full WhatCategory union.
32
+ */
33
+ export const TIER0_BLIND_SPOTS: ReadonlyArray<WhatCategory> = [
34
+ "wrong-output",
35
+ "missing-output",
36
+ "loop",
37
+ "format-violation",
38
+ "hallucination",
39
+ "missing-context",
40
+ ];
41
+
42
+ export interface BlindSpotRow {
43
+ /** Signal / failure-mode name. */
44
+ signal: string;
45
+ /** Whether Tier-0 can MEASURE this signal. */
46
+ measurable: "Tier-0" | "No";
47
+ /** Who checked it ("tier-0 scan" | "awareness LLM sample" | "—"). */
48
+ checkedBy: string;
49
+ /** What the check found. */
50
+ result: string;
51
+ }
52
+
53
+ export interface BlindSpotsInput {
54
+ /**
55
+ * Signals the awareness LLM mini-sample DISCOVERED (free-form labels from the
56
+ * analyzer). Used to fill the "result" column for blind-spot signals.
57
+ */
58
+ awarenessFindings: string[];
59
+ /**
60
+ * Whether the awareness layer actually fired. When false (library priors), the
61
+ * blind-spots table renders a single placeholder row.
62
+ */
63
+ awarenessFired: boolean;
64
+ }
65
+
66
+ /**
67
+ * Build the blind-spots table rows. Deterministic: iterates the canonical
68
+ * Tier-0-measurable list (marked measurable) then the blind-spot list (marked No),
69
+ * attributing the awareness LLM as the checker for blind spots when it fired.
70
+ *
71
+ * A blind-spot signal whose name appears (case-insensitive substring) in the
72
+ * awarenessFindings is marked "DISCOVERED"; otherwise "not observed".
73
+ */
74
+ export function buildBlindSpots(input: BlindSpotsInput): BlindSpotRow[] {
75
+ if (!input.awarenessFired) {
76
+ return [
77
+ {
78
+ signal: "(all)",
79
+ measurable: "No",
80
+ checkedBy: "—",
81
+ result: "Awareness layer skipped (library priors exist) — see Step 1.5 placeholder.",
82
+ },
83
+ ];
84
+ }
85
+
86
+ const rows: BlindSpotRow[] = [];
87
+
88
+ // Tier-0-measurable signals first (these are NOT blind spots).
89
+ for (const sig of TIER0_MEASURABLE) {
90
+ rows.push({
91
+ signal: sig,
92
+ measurable: "Tier-0",
93
+ checkedBy: "tier-0 scan",
94
+ result: "Measured deterministically (no LLM needed).",
95
+ });
96
+ }
97
+
98
+ // Blind spots — only the awareness LLM can see these.
99
+ const lowered = input.awarenessFindings.map((f) => f.toLowerCase());
100
+ for (const sig of TIER0_BLIND_SPOTS) {
101
+ const discovered = lowered.some((f) => f.includes(sig.toLowerCase()));
102
+ rows.push({
103
+ signal: sig,
104
+ measurable: "No",
105
+ checkedBy: "awareness LLM sample",
106
+ result: discovered ? "DISCOVERED by awareness sample" : "not observed in awareness sample",
107
+ });
108
+ }
109
+
110
+ return rows;
111
+ }
112
+
113
+ /**
114
+ * True when the awareness sample surfaced at least one Tier-0 blind spot — i.e.
115
+ * the measurement layer caught something Tier-0 would have missed. Used to mark
116
+ * "discovered" badges on the R2.4 selection-rule cards.
117
+ */
118
+ export function awarenessDiscoveredBlindSpot(rows: BlindSpotRow[]): boolean {
119
+ return rows.some((r) => r.measurable === "No" && r.result.startsWith("DISCOVERED"));
120
+ }
121
+
122
+ // ── SO-05 CLI entrypoint ──────────────────────────────────────────────────────
123
+
124
+ if (import.meta.main) {
125
+ const args = process.argv.slice(2);
126
+ const get = (flag: string): string | undefined => {
127
+ const idx = args.indexOf(flag);
128
+ return idx !== -1 ? args[idx + 1] : undefined;
129
+ };
130
+
131
+ // Accept awareness findings as a JSON array string or a file path
132
+ const findingsArg = get("--findings");
133
+ const firedStr = get("--awareness-fired");
134
+ const outputPath = get("--output");
135
+
136
+ if (!findingsArg) {
137
+ process.stderr.write(
138
+ "Usage: bun scripts/awareness/blind-spots.ts --findings '[\"signal1\",\"signal2\"]' [--awareness-fired true|false] [--output <file>]\n"
139
+ );
140
+ process.exit(1);
141
+ }
142
+
143
+ const { writeFileSync } = await import("fs");
144
+
145
+ let awarenessFindings: string[];
146
+ try {
147
+ awarenessFindings = JSON.parse(findingsArg) as string[];
148
+ } catch {
149
+ process.stderr.write(`--findings must be a JSON array string\n`);
150
+ process.exit(1);
151
+ }
152
+
153
+ const awarenessFired = firedStr !== "false";
154
+ const rows = buildBlindSpots({ awarenessFindings, awarenessFired });
155
+ const discovered = awarenessDiscoveredBlindSpot(rows);
156
+
157
+ const result = { rows, discoveredBlindSpot: discovered };
158
+ const out = JSON.stringify(result, null, 2);
159
+
160
+ if (outputPath) {
161
+ writeFileSync(outputPath, out, "utf8");
162
+ process.stderr.write(`Blind-spots table written to ${outputPath}\n`);
163
+ } else {
164
+ process.stdout.write(out + "\n");
165
+ }
166
+ process.exit(0);
167
+ }