freeharness 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +108 -0
  3. package/README.md +134 -0
  4. package/canonical/HARVEST.yaml +858 -0
  5. package/canonical/PROVENANCE.yaml +740 -0
  6. package/canonical/agents/README.md +95 -0
  7. package/canonical/agents/agentic-architect.md +18 -0
  8. package/canonical/agents/database-reviewer.md +41 -0
  9. package/canonical/agents/explorer-ai-engineer-analyst.md +65 -0
  10. package/canonical/agents/pr-reviewer.md +96 -0
  11. package/canonical/agents/python-reviewer.md +55 -0
  12. package/canonical/agents/report-formatter.md +19 -0
  13. package/canonical/agents/security-reviewer.md +53 -0
  14. package/canonical/agents/test-writer.md +34 -0
  15. package/canonical/commands/fh-context.md +37 -0
  16. package/canonical/evals/promptfoo.redteam.yaml +108 -0
  17. package/canonical/hooks/cost-prices.json +14 -0
  18. package/canonical/hooks/freeharness-auto-memory.mjs +158 -0
  19. package/canonical/hooks/freeharness-config-guard.mjs +162 -0
  20. package/canonical/hooks/freeharness-context-monitor.mjs +198 -0
  21. package/canonical/hooks/freeharness-converge.mjs +227 -0
  22. package/canonical/hooks/freeharness-cost-tracker.mjs +1027 -0
  23. package/canonical/hooks/freeharness-memory-guard.mjs +57 -0
  24. package/canonical/hooks/freeharness-output-pruner.mjs +333 -0
  25. package/canonical/hooks/freeharness-precompact.mjs +323 -0
  26. package/canonical/hooks/freeharness-repeat-tool.mjs +208 -0
  27. package/canonical/hooks/freeharness-security-guidance.mjs +164 -0
  28. package/canonical/hooks/freeharness-session-start +583 -0
  29. package/canonical/hooks/hooks.auto-memory.claude-code.json +16 -0
  30. package/canonical/hooks/hooks.claude-code.json +17 -0
  31. package/canonical/hooks/hooks.config-guard.claude-code.json +16 -0
  32. package/canonical/hooks/hooks.context-monitor.claude-code.json +15 -0
  33. package/canonical/hooks/hooks.converge.claude-code.json +15 -0
  34. package/canonical/hooks/hooks.cost-tracker.claude-code.json +37 -0
  35. package/canonical/hooks/hooks.memory-guard.claude-code.json +16 -0
  36. package/canonical/hooks/hooks.output-pruner.claude-code.json +16 -0
  37. package/canonical/hooks/hooks.precompact.claude-code.json +15 -0
  38. package/canonical/hooks/hooks.repeat-tool.claude-code.json +25 -0
  39. package/canonical/hooks/hooks.security-guidance.claude-code.json +16 -0
  40. package/canonical/mcp/servers.json +20 -0
  41. package/canonical/openspec/config.base.yaml +89 -0
  42. package/canonical/openspec/schema.spec-driven.yaml +277 -0
  43. package/canonical/openspec/templates/data-contract.md +36 -0
  44. package/canonical/openspec/templates/design.md +84 -0
  45. package/canonical/openspec/templates/eval-plan.md +33 -0
  46. package/canonical/openspec/templates/follow-ups.md +2 -0
  47. package/canonical/openspec/templates/proposal.md +45 -0
  48. package/canonical/openspec/templates/spec.md +42 -0
  49. package/canonical/openspec/templates/tasks.md +38 -0
  50. package/canonical/profiles/local-llamacpp.LOCAL-MODELS.md +47 -0
  51. package/canonical/profiles/local-llamacpp.json +27 -0
  52. package/canonical/profiles/local-ollama.json +20 -0
  53. package/canonical/profiles/mcp.json +91 -0
  54. package/canonical/rules/CLAUDE.md +78 -0
  55. package/canonical/rules/project-CLAUDE.template.md +62 -0
  56. package/canonical/rules/routing.md +20 -0
  57. package/canonical/rules/safety.md +41 -0
  58. package/canonical/settings/settings.cache-hygiene.claude-code.json +5 -0
  59. package/canonical/skills/agent-evaluation/SKILL.md +102 -0
  60. package/canonical/skills/agent-evaluation/assets/evaluation_report_template.md +206 -0
  61. package/canonical/skills/agent-evaluation/evals/cases.yaml +106 -0
  62. package/canonical/skills/agent-evaluation/references/dataset-preparation.md +351 -0
  63. package/canonical/skills/agent-evaluation/references/scorers-constraints.md +165 -0
  64. package/canonical/skills/agent-evaluation/references/scorers.md +431 -0
  65. package/canonical/skills/agent-evaluation/references/setup-guide.md +252 -0
  66. package/canonical/skills/agent-evaluation/references/tracing-integration.md +164 -0
  67. package/canonical/skills/agent-evaluation/references/troubleshooting.md +514 -0
  68. package/canonical/skills/agent-evaluation/scripts/analyze_results.py +462 -0
  69. package/canonical/skills/agent-evaluation/scripts/create_dataset_template.py +382 -0
  70. package/canonical/skills/agent-evaluation/scripts/list_datasets.py +273 -0
  71. package/canonical/skills/agent-evaluation/scripts/run_evaluation_template.py +309 -0
  72. package/canonical/skills/agent-evaluation/scripts/setup_mlflow.py +353 -0
  73. package/canonical/skills/agent-evaluation/scripts/utils/__init__.py +27 -0
  74. package/canonical/skills/agent-evaluation/scripts/utils/env_validation.py +123 -0
  75. package/canonical/skills/agent-evaluation/scripts/utils/tracing_utils.py +108 -0
  76. package/canonical/skills/agent-evaluation/scripts/validate_agent_tracing.py +148 -0
  77. package/canonical/skills/agent-evaluation/scripts/validate_auth.py +240 -0
  78. package/canonical/skills/agent-evaluation/scripts/validate_environment.py +185 -0
  79. package/canonical/skills/agent-evaluation/scripts/validate_tracing_runtime.py +318 -0
  80. package/canonical/skills/agentic-architecture/SKILL.md +41 -0
  81. package/canonical/skills/agentic-architecture/evals/cases.yaml +94 -0
  82. package/canonical/skills/agentic-architecture/reference/context-engineering.md +75 -0
  83. package/canonical/skills/agentic-architecture/reference/patterns.md +76 -0
  84. package/canonical/skills/agentic-architecture/reference/reliability-observability.md +94 -0
  85. package/canonical/skills/agentic-architecture/reference/review-framework.md +59 -0
  86. package/canonical/skills/code-review/SKILL.md +52 -0
  87. package/canonical/skills/code-review/evals/cases.yaml +197 -0
  88. package/canonical/skills/git-workflow/SKILL.md +41 -0
  89. package/canonical/skills/git-workflow/evals/cases.yaml +92 -0
  90. package/canonical/skills/local-code/SKILL.md +24 -0
  91. package/canonical/skills/local-code/evals/cases.yaml +85 -0
  92. package/canonical/skills/local-code/scripts/query_llama.py +68 -0
  93. package/canonical/skills/report-formatting/SKILL.md +62 -0
  94. package/canonical/skills/report-formatting/evals/cases.yaml +83 -0
  95. package/canonical/skills/report-formatting/reference/ARCHITECTURE.md +135 -0
  96. package/canonical/skills/report-formatting/reference/HELPERS.md +120 -0
  97. package/canonical/skills/report-formatting/reference/PPTX.md +136 -0
  98. package/canonical/skills/report-formatting/reference/RELEASE.md +99 -0
  99. package/canonical/skills/report-formatting/reference/TEMPLATES.md +48 -0
  100. package/canonical/skills/report-formatting/reference/authoring.md +66 -0
  101. package/canonical/skills/report-formatting/scripts/architecture-template.md +271 -0
  102. package/canonical/skills/report-formatting/scripts/assets/claro-logo.png +0 -0
  103. package/canonical/skills/report-formatting/scripts/assets/claro-wordmark.svg +1 -0
  104. package/canonical/skills/report-formatting/scripts/build-architecture.js +57 -0
  105. package/canonical/skills/report-formatting/scripts/build-md-claro.js +224 -0
  106. package/canonical/skills/report-formatting/scripts/build-release.js +51 -0
  107. package/canonical/skills/report-formatting/scripts/check-env.js +58 -0
  108. package/canonical/skills/report-formatting/scripts/docmodel.js +283 -0
  109. package/canonical/skills/report-formatting/scripts/example-build.js +119 -0
  110. package/canonical/skills/report-formatting/scripts/example_build_ArchitectureReview_docx.js +195 -0
  111. package/canonical/skills/report-formatting/scripts/example_build_ExecutiveReport_docx.js +114 -0
  112. package/canonical/skills/report-formatting/scripts/package.json +17 -0
  113. package/canonical/skills/report-formatting/scripts/pptx/example_build_StatusReport_pptx.py +223 -0
  114. package/canonical/skills/report-formatting/scripts/pptx/example_build_WeeklyStatus_pptx.py +245 -0
  115. package/canonical/skills/report-formatting/scripts/pptx/pptx_office.py +144 -0
  116. package/canonical/skills/report-formatting/scripts/pptx/requirements.txt +7 -0
  117. package/canonical/skills/report-formatting/scripts/pptx/status_report_blocks.py +193 -0
  118. package/canonical/skills/report-formatting/scripts/pptx/theme_claro_pptx.py +473 -0
  119. package/canonical/skills/report-formatting/scripts/release-template.md +80 -0
  120. package/canonical/skills/report-formatting/scripts/render-mermaid.js +105 -0
  121. package/canonical/skills/report-formatting/scripts/theme-claro.js +403 -0
  122. package/canonical/skills/subagent-driven-development/SKILL.md +60 -0
  123. package/canonical/skills/subagent-driven-development/evals/cases.yaml +208 -0
  124. package/canonical/skills/subagent-driven-development/reference/brief.md +91 -0
  125. package/canonical/skills/subagent-driven-development/reference/handoff.md +118 -0
  126. package/canonical/skills/subagent-driven-development/scripts/validate-handoff.mjs +850 -0
  127. package/canonical/skills/systematic-debugging/SKILL.md +44 -0
  128. package/canonical/skills/systematic-debugging/evals/cases.yaml +90 -0
  129. package/canonical/skills/test-driven-development/SKILL.md +42 -0
  130. package/canonical/skills/test-driven-development/evals/cases.yaml +86 -0
  131. package/canonical/skills/test-driven-development/reference/writing-good-tests.md +52 -0
  132. package/canonical/skills/verification-before-completion/SKILL.md +53 -0
  133. package/canonical/skills/verification-before-completion/evals/cases.yaml +107 -0
  134. package/dist/adapters/content/language-lint.d.ts +46 -0
  135. package/dist/adapters/content/language-lint.js +191 -0
  136. package/dist/adapters/harness/claude-code.d.ts +57 -0
  137. package/dist/adapters/harness/claude-code.js +385 -0
  138. package/dist/adapters/harness/index.d.ts +3 -0
  139. package/dist/adapters/harness/index.js +17 -0
  140. package/dist/adapters/harness/opencode.d.ts +7 -0
  141. package/dist/adapters/harness/opencode.js +166 -0
  142. package/dist/adapters/harness/plugin.d.ts +22 -0
  143. package/dist/adapters/harness/plugin.js +257 -0
  144. package/dist/adapters/memory/doctor.d.ts +480 -0
  145. package/dist/adapters/memory/doctor.js +1217 -0
  146. package/dist/adapters/memory/vendored.d.ts +150 -0
  147. package/dist/adapters/memory/vendored.js +487 -0
  148. package/dist/adapters/package/node.d.ts +9 -0
  149. package/dist/adapters/package/node.js +20 -0
  150. package/dist/adapters/prompt/readline.d.ts +19 -0
  151. package/dist/adapters/prompt/readline.js +53 -0
  152. package/dist/adapters/sync/diff.d.ts +43 -0
  153. package/dist/adapters/sync/diff.js +380 -0
  154. package/dist/cli/cleanup.d.ts +86 -0
  155. package/dist/cli/cleanup.js +382 -0
  156. package/dist/cli/cost.d.ts +304 -0
  157. package/dist/cli/cost.js +501 -0
  158. package/dist/cli/doctor.d.ts +205 -0
  159. package/dist/cli/doctor.js +654 -0
  160. package/dist/cli/executor.d.ts +5 -0
  161. package/dist/cli/executor.js +48 -0
  162. package/dist/cli/plugin-validate.d.ts +37 -0
  163. package/dist/cli/plugin-validate.js +256 -0
  164. package/dist/cli/prefix.d.ts +68 -0
  165. package/dist/cli/prefix.js +218 -0
  166. package/dist/cli/profile.d.ts +170 -0
  167. package/dist/cli/profile.js +285 -0
  168. package/dist/cli/runner.d.ts +10 -0
  169. package/dist/cli/runner.js +27 -0
  170. package/dist/cli/uninstall.d.ts +65 -0
  171. package/dist/cli/uninstall.js +147 -0
  172. package/dist/index.d.ts +8 -0
  173. package/dist/index.js +989 -0
  174. package/dist/infra/dogfood.d.ts +31 -0
  175. package/dist/infra/dogfood.js +51 -0
  176. package/dist/infra/fsutil.d.ts +40 -0
  177. package/dist/infra/fsutil.js +143 -0
  178. package/dist/infra/manifest.d.ts +76 -0
  179. package/dist/infra/manifest.js +92 -0
  180. package/dist/infra/paths.d.ts +19 -0
  181. package/dist/infra/paths.js +74 -0
  182. package/dist/infra/routing.d.ts +4 -0
  183. package/dist/infra/routing.js +7 -0
  184. package/node_modules/@freeharness/core/dist/context.d.ts +30 -0
  185. package/node_modules/@freeharness/core/dist/context.js +1 -0
  186. package/node_modules/@freeharness/core/dist/index.d.ts +5 -0
  187. package/node_modules/@freeharness/core/dist/index.js +6 -0
  188. package/node_modules/@freeharness/core/dist/planner.d.ts +13 -0
  189. package/node_modules/@freeharness/core/dist/planner.js +18 -0
  190. package/node_modules/@freeharness/core/dist/ports.d.ts +90 -0
  191. package/node_modules/@freeharness/core/dist/ports.js +1 -0
  192. package/node_modules/@freeharness/core/dist/registry.d.ts +41 -0
  193. package/node_modules/@freeharness/core/dist/registry.js +124 -0
  194. package/node_modules/@freeharness/core/dist/tiers.d.ts +30 -0
  195. package/node_modules/@freeharness/core/dist/tiers.js +99 -0
  196. package/node_modules/@freeharness/core/package.json +34 -0
  197. package/node_modules/@freeharness/sdd/PROVENANCE.yaml +175 -0
  198. package/node_modules/@freeharness/sdd/dist/src/bin/openspec.d.ts +2 -0
  199. package/node_modules/@freeharness/sdd/dist/src/bin/openspec.js +166 -0
  200. package/node_modules/@freeharness/sdd/dist/src/index.d.ts +14 -0
  201. package/node_modules/@freeharness/sdd/dist/src/index.js +11 -0
  202. package/node_modules/@freeharness/sdd/dist/src/init.d.ts +39 -0
  203. package/node_modules/@freeharness/sdd/dist/src/init.js +190 -0
  204. package/node_modules/@freeharness/sdd/dist/src/root-resolver.d.ts +8 -0
  205. package/node_modules/@freeharness/sdd/dist/src/root-resolver.js +32 -0
  206. package/node_modules/@freeharness/sdd/dist/src/shim/archive.d.ts +81 -0
  207. package/node_modules/@freeharness/sdd/dist/src/shim/archive.js +483 -0
  208. package/node_modules/@freeharness/sdd/dist/src/shim/context.d.ts +4 -0
  209. package/node_modules/@freeharness/sdd/dist/src/shim/context.js +48 -0
  210. package/node_modules/@freeharness/sdd/dist/src/shim/follow-up.d.ts +57 -0
  211. package/node_modules/@freeharness/sdd/dist/src/shim/follow-up.js +279 -0
  212. package/node_modules/@freeharness/sdd/dist/src/shim/instructions.d.ts +67 -0
  213. package/node_modules/@freeharness/sdd/dist/src/shim/instructions.js +460 -0
  214. package/node_modules/@freeharness/sdd/dist/src/shim/list.d.ts +5 -0
  215. package/node_modules/@freeharness/sdd/dist/src/shim/list.js +95 -0
  216. package/node_modules/@freeharness/sdd/dist/src/shim/new-change.d.ts +6 -0
  217. package/node_modules/@freeharness/sdd/dist/src/shim/new-change.js +150 -0
  218. package/node_modules/@freeharness/sdd/dist/src/shim/schemas.d.ts +4 -0
  219. package/node_modules/@freeharness/sdd/dist/src/shim/schemas.js +23 -0
  220. package/node_modules/@freeharness/sdd/dist/src/shim/shared.d.ts +56 -0
  221. package/node_modules/@freeharness/sdd/dist/src/shim/shared.js +140 -0
  222. package/node_modules/@freeharness/sdd/dist/src/shim/status.d.ts +8 -0
  223. package/node_modules/@freeharness/sdd/dist/src/shim/status.js +85 -0
  224. package/node_modules/@freeharness/sdd/dist/src/shim/validate.d.ts +6 -0
  225. package/node_modules/@freeharness/sdd/dist/src/shim/validate.js +229 -0
  226. package/node_modules/@freeharness/sdd/dist/src/validate-change.d.ts +40 -0
  227. package/node_modules/@freeharness/sdd/dist/src/validate-change.js +114 -0
  228. package/node_modules/@freeharness/sdd/dist/src/validate.d.ts +24 -0
  229. package/node_modules/@freeharness/sdd/dist/src/validate.js +72 -0
  230. package/node_modules/@freeharness/sdd/dist/vendor/openspec/apply/specs-apply.d.ts +130 -0
  231. package/node_modules/@freeharness/sdd/dist/vendor/openspec/apply/specs-apply.js +981 -0
  232. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-metadata.d.ts +46 -0
  233. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-metadata.js +128 -0
  234. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-status-policy.d.ts +26 -0
  235. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/change-status-policy.js +32 -0
  236. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/file-system.d.ts +50 -0
  237. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/file-system.js +394 -0
  238. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/global-config.d.ts +15 -0
  239. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/global-config.js +49 -0
  240. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/graph.d.ts +71 -0
  241. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/graph.js +164 -0
  242. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/index.d.ts +11 -0
  243. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/index.js +21 -0
  244. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/instruction-loader.d.ts +102 -0
  245. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/instruction-loader.js +230 -0
  246. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/outputs.d.ts +18 -0
  247. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/outputs.js +138 -0
  248. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/resolver.d.ts +82 -0
  249. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/resolver.js +333 -0
  250. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/schema.d.ts +12 -0
  251. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/schema.js +110 -0
  252. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/state.d.ts +11 -0
  253. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/state.js +32 -0
  254. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/task-progress.d.ts +33 -0
  255. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/task-progress.js +149 -0
  256. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/types.d.ts +39 -0
  257. package/node_modules/@freeharness/sdd/dist/vendor/openspec/engine/types.js +49 -0
  258. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/claude.d.ts +12 -0
  259. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/claude.js +31 -0
  260. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/index.d.ts +10 -0
  261. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/index.js +10 -0
  262. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/opencode.d.ts +12 -0
  263. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/adapters/opencode.js +26 -0
  264. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/generator.d.ts +28 -0
  265. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/generator.js +41 -0
  266. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/index.d.ts +23 -0
  267. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/index.js +25 -0
  268. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/invocation.d.ts +72 -0
  269. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/invocation.js +76 -0
  270. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/registry.d.ts +39 -0
  271. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/registry.js +53 -0
  272. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/types.d.ts +62 -0
  273. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/types.js +7 -0
  274. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/yaml.d.ts +35 -0
  275. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-generation/yaml.js +47 -0
  276. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-references.d.ts +33 -0
  277. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/command-references.js +55 -0
  278. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/allowed-tools.d.ts +11 -0
  279. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/allowed-tools.js +11 -0
  280. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/skill-generation.d.ts +48 -0
  281. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/shared/skill-generation.js +99 -0
  282. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/skill-templates.d.ts +19 -0
  283. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/skill-templates.js +18 -0
  284. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/types.d.ts +18 -0
  285. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/types.js +4 -0
  286. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/apply-change.d.ts +19 -0
  287. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/apply-change.js +207 -0
  288. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/archive-change.d.ts +12 -0
  289. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/archive-change.js +409 -0
  290. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/bulk-archive-change.d.ts +9 -0
  291. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/bulk-archive-change.js +673 -0
  292. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/continue-change.d.ts +9 -0
  293. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/continue-change.js +230 -0
  294. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/explore.d.ts +12 -0
  295. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/explore.js +550 -0
  296. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/feedback.d.ts +8 -0
  297. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/feedback.js +107 -0
  298. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/ff-change.d.ts +12 -0
  299. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/ff-change.js +228 -0
  300. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/new-change.d.ts +9 -0
  301. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/new-change.js +147 -0
  302. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/onboard.d.ts +9 -0
  303. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/onboard.js +571 -0
  304. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/propose.d.ts +12 -0
  305. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/propose.js +322 -0
  306. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/store-selection.d.ts +7 -0
  307. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/store-selection.js +7 -0
  308. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/sync-specs.d.ts +9 -0
  309. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/sync-specs.js +518 -0
  310. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/update-change.d.ts +9 -0
  311. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/update-change.js +176 -0
  312. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/verify-change.d.ts +9 -0
  313. package/node_modules/@freeharness/sdd/dist/vendor/openspec/generation/templates/workflows/verify-change.js +344 -0
  314. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/constants.d.ts +39 -0
  315. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/constants.js +54 -0
  316. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/delta-resolution.d.ts +35 -0
  317. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/delta-resolution.js +171 -0
  318. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/change-parser.d.ts +27 -0
  319. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/change-parser.js +210 -0
  320. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/code-fence.d.ts +14 -0
  321. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/code-fence.js +48 -0
  322. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/markdown-parser.d.ts +22 -0
  323. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/markdown-parser.js +186 -0
  324. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-blocks.d.ts +65 -0
  325. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-blocks.js +409 -0
  326. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-text.d.ts +55 -0
  327. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/requirement-text.js +98 -0
  328. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/spec-structure.d.ts +8 -0
  329. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/parsers/spec-structure.js +77 -0
  330. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/purpose-placeholder.d.ts +44 -0
  331. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/purpose-placeholder.js +116 -0
  332. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/base.schema.d.ts +12 -0
  333. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/base.schema.js +17 -0
  334. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/change.schema.d.ts +72 -0
  335. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/change.schema.js +30 -0
  336. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/index.d.ts +3 -0
  337. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/index.js +3 -0
  338. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/spec.schema.d.ts +17 -0
  339. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/schemas/spec.schema.js +14 -0
  340. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/spec-discovery.d.ts +39 -0
  341. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/spec-discovery.js +114 -0
  342. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-lines.d.ts +45 -0
  343. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-lines.js +105 -0
  344. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-numbering.d.ts +15 -0
  345. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/task-numbering.js +56 -0
  346. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/types.d.ts +17 -0
  347. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/types.js +1 -0
  348. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/validator.d.ts +94 -0
  349. package/node_modules/@freeharness/sdd/dist/vendor/openspec/validation/validator.js +756 -0
  350. package/node_modules/@freeharness/sdd/package.json +57 -0
  351. package/node_modules/@freeharness/sdd/vendor/openspec/LICENSE.upstream +22 -0
  352. package/node_modules/@freeharness/sdd/vendor/openspec/assets/schema.upstream.yaml +232 -0
  353. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/README.md +19 -0
  354. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-apply-change/SKILL.md +187 -0
  355. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-archive-change/SKILL.md +181 -0
  356. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-bulk-archive-change/SKILL.md +338 -0
  357. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-continue-change/SKILL.md +117 -0
  358. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-explore/SKILL.md +342 -0
  359. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-ff-change/SKILL.md +116 -0
  360. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-new-change/SKILL.md +76 -0
  361. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-onboard/SKILL.md +560 -0
  362. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-propose/SKILL.md +162 -0
  363. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-sync-specs/SKILL.md +261 -0
  364. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-update-change/SKILL.md +90 -0
  365. package/node_modules/@freeharness/sdd/vendor/openspec/assets/skills/openspec-verify-change/SKILL.md +174 -0
  366. package/package.json +70 -0
  367. package/provenance/canonical.PROVENANCE.yaml +740 -0
  368. package/provenance/claude-mem.LICENSE.upstream +202 -0
  369. package/provenance/memory.PROVENANCE.yaml +399 -0
  370. package/provenance/sdd.PROVENANCE.yaml +175 -0
  371. package/vendor-licenses/caveman.LICENSE +27 -0
  372. package/vendor-licenses/deepseek-harness.LICENSE +21 -0
  373. package/vendor-licenses/ecc.LICENSE +21 -0
  374. package/vendor-licenses/pi.LICENSE +21 -0
  375. package/vendor-licenses/superpowers.LICENSE +21 -0
@@ -0,0 +1,351 @@
1
+ # Evaluation Dataset Preparation Guide
2
+
3
+ Complete guide for creating and managing MLflow evaluation datasets for agent evaluation.
4
+
5
+ ## Read MLflow Documentation First
6
+
7
+ Before creating any dataset, follow the documentation protocol and read the MLflow GenAI dataset documentation:
8
+
9
+ - Query llms.txt for "evaluation datasets", "dataset schema", "mlflow.genai.datasets"
10
+ - Understand required record schema and APIs
11
+
12
+ ## Examine Your Agent's Function Signature
13
+
14
+ Before writing dataset code:
15
+
16
+ 1. Open your agent's entry point function
17
+ 2. Read its function signature to identify parameter names
18
+ 3. Note which parameters come from the dataset vs. your code
19
+
20
+ **Example:**
21
+
22
+ ```python
23
+ # Load config
24
+ config = load_config()
25
+
26
+ # Agent code
27
+ def run_agent(
28
+ query: str, llm_provider: LLMProvider, session_id: str | None = None
29
+ ) -> str:
30
+ ...
31
+
32
+ run_agent(query="what can you help me with", llm_provider=config.provider)
33
+ ```
34
+
35
+ **Parameter analysis:**
36
+
37
+ - `query` (str) → **FROM DATASET** - this goes in `inputs` dict
38
+ - `llm_provider` (LLMProvider) → **FROM CODE** - provided by agent's config in code, not needed in dataset
39
+ - `session_id` (str, optional) → **FROM CODE** - optional, not needed in dataset
40
+
41
+ **Therefore, your dataset inputs MUST be:**
42
+
43
+ ```python
44
+ {"inputs": {"query": "your question here"}} # ✅ CORRECT - matches parameter name
45
+ ```
46
+
47
+ **NOT:**
48
+
49
+ ```python
50
+ {"inputs": {"request": "..."}} # ❌ WRONG - no 'request' parameter
51
+ {"inputs": {"question": "..."}} # ❌ WRONG - no 'question' parameter
52
+ {"inputs": {"prompt": "..."}} # ❌ WRONG - no 'prompt' parameter
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Required Schema & APIs
58
+
59
+ ### Record Schema
60
+
61
+ Every dataset record represents a test case and has this structure:
62
+
63
+ ```python
64
+ {
65
+ "inputs": dict, # REQUIRED - parameters for your agent function
66
+ "expectations": dict, # OPTIONAL - ground truth for evaluation
67
+ "tags": dict, # OPTIONAL - metadata for filtering
68
+ }
69
+ ```
70
+
71
+ **CRITICAL**: The `inputs` dict keys MUST EXACTLY match your agent's function parameter names (as identified in Step 2 above).
72
+
73
+ ### Required APIs - NEVER/ALWAYS Rules
74
+
75
+ #### ❌ NEVER Use These:
76
+
77
+ - `mlflow.data.from_pandas()` - Wrong namespace, for non-GenAI datasets
78
+ - `mlflow.log_input()` - Wrong approach for evaluation datasets
79
+ - Manual DataFrame creation without GenAI APIs
80
+ - Searching MLflow runs to "recreate" datasets
81
+ - Hardcoding dataset queries in evaluation scripts
82
+
83
+ #### ✅ ALWAYS Use These:
84
+
85
+ **Core Operations:**
86
+
87
+ ```python
88
+ from mlflow.genai.datasets import create_dataset, search_datasets
89
+
90
+ # CREATE dataset
91
+ dataset = create_dataset(name="my-dataset", experiment_id=["1"])
92
+
93
+ # ADD records
94
+ records = [{"inputs": {"query": "test"}}]
95
+ dataset.merge_records(records)
96
+
97
+ # LOAD dataset
98
+ datasets = search_datasets(filter_string="name = 'my-dataset'")
99
+ dataset = datasets[0]
100
+
101
+ # USE in evaluation
102
+ results = mlflow.genai.evaluate(
103
+ data=dataset, predict_fn=predict_fn, scorers=[RelevanceToQuery()]
104
+ )
105
+ ```
106
+
107
+ **For complete workflows:**
108
+
109
+ - Check existing datasets: `python scripts/list_datasets.py` (auto-lists all)
110
+ - Create new dataset: `python scripts/create_dataset_template.py --test-cases-file test_cases.txt`
111
+
112
+ ---
113
+
114
+ ## Table of Contents
115
+
116
+ 1. [Understanding MLflow GenAI Datasets](#understanding-mlflow-genai-datasets)
117
+ 2. [Checking Existing Datasets](#checking-existing-datasets) (Use list_datasets.py script)
118
+ 3. [Creating New Datasets](#creating-new-datasets) (Use create_dataset_template.py script)
119
+ 4. [Databricks Unity Catalog Considerations](#databricks-unity-catalog-considerations)
120
+ 5. [Best Practices](#best-practices)
121
+
122
+ ## Understanding MLflow GenAI Datasets
123
+
124
+ **IMPORTANT**: MLflow has generic datasets, but **GenAI datasets for agent evaluation are different**.
125
+
126
+ ### What are GenAI Evaluation Datasets?
127
+
128
+ GenAI evaluation datasets are specialized datasets for evaluating language model applications and agents. They:
129
+
130
+ - Have a specific schema with `inputs` and optional `expectations`
131
+ - Are managed through the MLflow GenAI datasets SDK
132
+ - Can be associated with experiments
133
+ - Support pagination and search
134
+
135
+ ### Dataset Schema
136
+
137
+ See the [Required Schema & APIs](#required-schema--apis) section above for the complete record schema definition.
138
+
139
+ ## Checking Existing Datasets
140
+
141
+ Before creating a new dataset, check if suitable datasets already exist.
142
+
143
+ ### Use the Dataset Discovery Script
144
+
145
+ ```bash
146
+ uv run python scripts/list_datasets.py # Table format (default)
147
+ # Or for machine-readable output:
148
+ uv run python scripts/list_datasets.py --format json
149
+ ```
150
+
151
+ **This script automatically:**
152
+
153
+ - Lists all datasets in your experiment
154
+ - Calculates diversity metrics (record count, query length range)
155
+ - Shows sample queries from each dataset
156
+ - Recommends the best dataset based on size and diversity
157
+ - Allows interactive selection
158
+
159
+ **For manual dataset access**, use the APIs shown in [Required Schema & APIs](#required-schema--apis).
160
+
161
+ ## Creating New Datasets
162
+
163
+ If no suitable dataset exists, create a new one.
164
+
165
+ ### ⚠️ Before Creating Dataset ⚠️
166
+
167
+ **Complete these steps FIRST:**
168
+
169
+ 1. ✅ Read MLflow GenAI dataset documentation (see top of file)
170
+ 2. ✅ Examine your agent's function signature
171
+ 3. ✅ Know exact parameter names to use in `inputs` dict
172
+
173
+ ### Use the Dataset Template Generator
174
+
175
+ ```bash
176
+ uv run python scripts/create_dataset_template.py --test-cases-file test_cases.txt
177
+
178
+ # For Databricks Unity Catalog:
179
+ uv run python scripts/create_dataset_template.py \
180
+ --test-cases-file test_cases.txt \
181
+ --catalog main --schema ml --table eval_v1
182
+ ```
183
+
184
+ **The script will:**
185
+
186
+ 1. Detect your environment
187
+ 2. Guide you through naming conventions:
188
+ - **OSS**: Simple names like `mlflow-agent-eval-v1`
189
+ - **Databricks**: UC table names like `main.default.mlflow_agent_eval_v1`
190
+ 3. Help create 10+ diverse sample queries interactively
191
+ 4. Generate a complete Python script using correct APIs
192
+ 5. Optionally execute the script to create the dataset
193
+
194
+ **The generated script handles:**
195
+
196
+ - Correct API usage (`mlflow.genai.datasets` namespace)
197
+ - Environment-specific requirements (tags for OSS, UC tables for Databricks)
198
+ - Input validation and error handling
199
+
200
+ ### For Manual Creation
201
+
202
+ If you prefer manual creation, follow the API patterns in [Required Schema & APIs](#required-schema--apis):
203
+
204
+ 1. Use `create_dataset()` with correct name format
205
+ 2. Prepare records with `inputs` dict matching your agent parameters
206
+ 3. Add records with `dataset.merge_records()`
207
+ 4. Verify with `dataset.to_df()`
208
+
209
+ **See Databricks Unity Catalog Considerations section** if using Databricks.
210
+
211
+ ## Databricks Unity Catalog Considerations
212
+
213
+ When using Databricks as your tracking URI, special considerations apply.
214
+
215
+ ### Requirements
216
+
217
+ **1. Fully-Qualified Table Name**
218
+
219
+ - Format: `<catalog>.<schema>.<table>`
220
+ - Example: `main.default.mlflow_agent_eval_v1`
221
+ - Cannot use simple names like `my_dataset`
222
+
223
+ **2. Tags Not Supported**
224
+
225
+ - Do NOT include `tags` parameter in `create_dataset()`
226
+ - Tags are managed by Unity Catalog
227
+
228
+ **3. Search Not Supported**
229
+
230
+ - Cannot use `search_datasets()` API reliably
231
+ - Use Unity Catalog tools to find tables
232
+ - Access datasets directly by name with `get_dataset()`
233
+
234
+ ### Getting Unity Catalog Table Name
235
+
236
+ **Option 1: Use the script**
237
+
238
+ ```bash
239
+ uv run python scripts/create_dataset_template.py --test-cases-file test_cases.txt
240
+ ```
241
+
242
+ **Option 2: List with Databricks CLI**
243
+
244
+ List catalogs:
245
+
246
+ ```bash
247
+ databricks catalogs list
248
+ ```
249
+
250
+ List schemas in a catalog:
251
+
252
+ ```bash
253
+ databricks schemas list <catalog_name>
254
+ ```
255
+
256
+ **Option 3: Use Default**
257
+ Suggest the default location:
258
+
259
+ ```
260
+ main.default.mlflow_agent_eval_v1
261
+ ```
262
+
263
+ Where:
264
+
265
+ - `main`: Default catalog
266
+ - `default`: Default schema
267
+ - `mlflow_agent_eval_v1`: Your table name (include version)
268
+
269
+ ### Code Pattern
270
+
271
+ When creating datasets for Databricks:
272
+
273
+ ```python
274
+ # Use fully-qualified UC table name, no tags
275
+ dataset = create_dataset(
276
+ name="main.default.mlflow_agent_eval_v1",
277
+ experiment_id="<experiment_id>",
278
+ # Note: No tags parameter
279
+ )
280
+ ```
281
+
282
+ See [Required Schema & APIs](#required-schema--apis) for complete API examples.
283
+
284
+ ## Best Practices
285
+
286
+ ### Query Diversity
287
+
288
+ Create a **representative test set** covering different aspects:
289
+
290
+ **Variety dimensions:**
291
+
292
+ - **Complexity**: Simple ("What is X?") to complex ("How do I do X and Y while avoiding Z?")
293
+ - **Length**: Short (5-10 words) to long (20+ words, multi-part)
294
+ - **Topics**: Cover all agent capabilities and edge cases
295
+ - **Query types**: Questions, requests, comparisons, examples
296
+
297
+ **Example diverse set:**
298
+
299
+ ```python
300
+ [
301
+ {"inputs": {"query": "What is MLflow?"}}, # Simple, short, basic
302
+ {"inputs": {"query": "How do I log a model?"}}, # Action-oriented
303
+ {
304
+ "inputs": {"query": "What's the difference between experiments and runs?"}
305
+ }, # Comparison
306
+ {
307
+ "inputs": {"query": "Show me an example of using autolog with LangChain"}
308
+ }, # Example request
309
+ {
310
+ "inputs": {
311
+ "query": "How can I track hyperparameters, metrics, and artifacts in a single run?"
312
+ }
313
+ }, # Complex, multi-part
314
+ ]
315
+ ```
316
+
317
+ See generated script output for more examples.
318
+
319
+ ### Sample Size
320
+
321
+ - **Minimum**: 10 queries (for initial testing)
322
+ - **Recommended**: 20-50 queries (for comprehensive evaluation)
323
+ - **Balance**: Coverage vs execution time/cost
324
+
325
+ More queries = better coverage but longer evaluation time and higher LLM costs.
326
+
327
+ ### Versioning
328
+
329
+ - **Include version in name**: `mlflow_agent_eval_v1`, `mlflow_agent_eval_v2`
330
+ - **Document changes**: What's different in each version
331
+ - **Keep old versions**: For comparison and reproducibility
332
+ - **Use tags** (OSS only): `{"version": "2.0", "changes": "Added edge cases"}`
333
+
334
+ ### Quality Over Quantity
335
+
336
+ - **Realistic queries**: Match actual user questions
337
+ - **Clear questions**: Well-formed, unambiguous
338
+ - **Representative**: Cover production use cases
339
+ - **Avoid duplicates**: Each query should test something different
340
+
341
+ ### Iteration
342
+
343
+ 1. **Start small**: 10-15 queries for initial evaluation
344
+ 2. **Analyze results**: See what fails, what's missing
345
+ 3. **Expand**: Add queries to cover gaps
346
+ 4. **Refine**: Improve existing queries based on agent behavior
347
+ 5. **Version**: Create new version with improvements
348
+
349
+ ---
350
+
351
+ **For troubleshooting dataset creation issues**, see `references/troubleshooting.md`
@@ -0,0 +1,165 @@
1
+ # MLflow Judge Constraints & Requirements
2
+
3
+ Critical constraints when using `mlflow scorers register-llm-judge` CLI command.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Constraint 1: {{trace}} Variable is Mutually Exclusive](#constraint-1-trace-variable-is-mutually-exclusive)
8
+ 2. [Constraint 2: CLI Requires "yes"/"no" Return Values](#constraint-2-cli-requires-yesno-return-values)
9
+ 3. [Constraint 3: Instructions Must Include Template Variable](#constraint-3-instructions-must-include-template-variable)
10
+
11
+ ## Overview
12
+
13
+ The MLflow CLI for registering LLM judges has specific requirements. Follow these constraints to avoid registration errors.
14
+
15
+ ## Constraint 1: {{trace}} Variable is Mutually Exclusive
16
+
17
+ If you use `{{trace}}` in your instructions, it MUST be the ONLY variable.
18
+
19
+ **Cannot mix {{trace}} with:**
20
+
21
+ - ❌ `{{inputs}}`
22
+ - ❌ `{{outputs}}`
23
+
24
+ **Example - Correct:**
25
+
26
+ ```bash
27
+ uv run mlflow scorers register-llm-judge \
28
+ -n "ToolUsage" \
29
+ -i "Evaluate the trace: {{ trace }}. Did the agent use appropriate tools? Return yes or no."
30
+ ```
31
+
32
+ **Example - Wrong:**
33
+
34
+ ```bash
35
+ uv run mlflow scorers register-llm-judge \
36
+ -n "ToolUsage" \
37
+ -i "Given query {{ inputs }} and trace {{ trace }}, evaluate tools used." # ❌ Cannot mix!
38
+ ```
39
+
40
+ **Why this constraint exists:**
41
+
42
+ The `{{trace}}` variable contains everything:
43
+
44
+ - Input parameters (same as {{inputs}})
45
+ - Output responses (same as {{outputs}})
46
+ - All intermediate steps
47
+ - Tool calls
48
+ - LLM interactions
49
+
50
+ Since it includes inputs and outputs already, MLflow doesn't allow redundant variables.
51
+
52
+ **When to use {{trace}} vs {{inputs}}/{{outputs}}:**
53
+
54
+ Use `{{trace}}` when evaluating:
55
+
56
+ - ✅ Tool selection/usage
57
+ - ✅ Execution flow
58
+ - ✅ Intermediate reasoning
59
+ - ✅ Multi-step processes
60
+
61
+ Use `{{inputs}}`/`{{outputs}}` when evaluating:
62
+
63
+ - ✅ Final input/output quality only
64
+ - ✅ Response relevance
65
+ - ✅ Answer correctness
66
+
67
+ ## Constraint 2: Prefer "yes"/"no" Return Values for Better UI integration
68
+
69
+ ⚠️ **Use "yes"/"no" NOT "pass"/"fail"**
70
+
71
+ **Return values that are nicely integrated with the UI:**
72
+
73
+ - "yes" = criteria met
74
+ - "no" = criteria not met
75
+
76
+ **Return values that can still work but are not shown nicely in the UI:**
77
+
78
+ - "pass"/"fail"
79
+ - "true"/"false"
80
+ - "passed"/"failed"
81
+ - "1"/"0"
82
+
83
+ **Example - Good integration:**
84
+
85
+ ```bash
86
+ uv run mlflow scorers register-llm-judge \
87
+ -n "QualityCheck" \
88
+ -i "Evaluate if {{ outputs }} is high quality. Return 'yes' if high quality, 'no' if not."
89
+ ```
90
+
91
+ **Example - Still works but less nice integration:**
92
+
93
+ ```bash
94
+ uv run mlflow scorers register-llm-judge \
95
+ -n "QualityCheck" \
96
+ -i "Evaluate if {{ outputs }} is high quality. Return 'pass' if good, 'fail' if bad." # ❌ Wrong!
97
+ ```
98
+
99
+ **Why "yes"/"no"?**
100
+
101
+ MLflow's built-in judges use the binary yes/no format and the UI is optimized for this use case.
102
+
103
+ ## Constraint 3: Instructions Must Include Template Variable
104
+
105
+ Instructions must contain at least one template variable:
106
+
107
+ - `{{ inputs }}` - Evaluation inputs
108
+ - `{{ outputs }}` - Agent outputs
109
+ - `{{ trace }}` - Complete execution trace
110
+
111
+ The above can be combined with optional variables:
112
+ - `{{ expectations }}` - Ground truth (optional)
113
+
114
+ **Example - Wrong (no variables):**
115
+
116
+ ```bash
117
+ -i "Evaluate the quality. Return yes or no." # ❌ Missing variable!
118
+ ```
119
+
120
+ **Example - Correct:**
121
+
122
+ ```bash
123
+ -i "Evaluate if {{ outputs }} is high quality. Return yes or no." # ✅ Has variable
124
+ ```
125
+
126
+ **Remember**: If using `{{ trace }}`, it must be the ONLY variable (see Constraint 1).
127
+
128
+ ## Registration Example - All Constraints Met
129
+
130
+ ```bash
131
+ # ✅ Correct - has variable, uses yes/no, correct parameters
132
+ uv run mlflow scorers register-llm-judge \
133
+ -n "RelevanceCheck" \
134
+ -d "Checks if response addresses the query" \
135
+ -i "Given the response {{ outputs }}, determine if it directly addresses the query. Return 'yes' if relevant, 'no' if not."
136
+ ```
137
+
138
+ ```bash
139
+ # ✅ Correct - uses {{trace}} only (no other variables), yes/no, correct parameters
140
+ uv run mlflow scorers register-llm-judge \
141
+ -n "ToolUsageCheck" \
142
+ -d "Evaluates tool selection quality" \
143
+ -i "Examine the trace {{ trace }}. Did the agent use appropriate tools for the query? Return 'yes' if appropriate, 'no' if not."
144
+ ```
145
+
146
+ ## Common Mistakes
147
+
148
+ 1. **Mixing {{trace}} with {{inputs}} or {{outputs}}**
149
+
150
+ - Error: "Cannot use trace variable with other variables"
151
+ - Fix: Use only {{trace}} or only {{inputs}}/{{outputs}}
152
+
153
+ 2. **Using "pass"/"fail" instead of "yes"/"no"**
154
+
155
+ - Result: Scorer may not work correctly with evaluation
156
+ - Fix: Always use "yes"/"no" format
157
+
158
+ 3. **Missing template variables**
159
+
160
+ - Error: "Instructions must contain at least one variable"
161
+ - Fix: Include {{ outputs }}, {{ inputs }}, or {{ trace }}
162
+
163
+ 4. **Wrong parameter names**
164
+ - Check CLI help first: `mlflow scorers register-llm-judge --help`
165
+ - Common correct parameters: `-n` (name), `-i` (instructions), `-d` (description)