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,44 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when a test fails, a bug is reported, or behavior is flaky or intermittent: reproduce deterministically, isolate with explicit hypotheses, fix at the root cause, verify, before editing any production code. Not for feature work or refactors without a failing signal.
4
+ ---
5
+
6
+ # Systematic Debugging Protocol
7
+
8
+ <mandate>
9
+ Resolve bugs exclusively at their architectural root cause. Symptom patching or speculative changes without verified causation are strictly prohibited.
10
+ </mandate>
11
+
12
+ <phases>
13
+ ## Phase 1: Reproduce
14
+ 1. Establish a deterministic, minimal reproduction script or command.
15
+ 2. Capture full terminal failure traces.
16
+ 3. For non-deterministic bugs: Pin temperature to 0, fix random seeds, and freeze inputs/outputs into a test fixture.
17
+
18
+ ## Phase 2: Isolate
19
+ 1. Shrink inputs to the absolute minimum failing vector.
20
+ 2. Bisect execution: Isolate whether fault lies in graph wiring, state schema mutation, database constraints, or LLM payload formatting.
21
+ 3. Trace backwards from the failure site to the originating state transition.
22
+
23
+ ## Phase 3: Root-Cause Fix
24
+ 1. Formulate an explicit hypothesis: "The failure occurs because condition X causes component Y to produce state Z."
25
+ 2. Implement the minimal targeted fix addressing condition X.
26
+ 3. If unable to explain the mechanistic failure, the root cause has not been found.
27
+
28
+ ## Phase 4: Verify & Defend
29
+ 1. Write a regression test that fails prior to the fix and passes with the fix applied.
30
+ 2. Re-run the full affected test suite.
31
+ 3. Route to `verification-before-completion`.
32
+ </phases>
33
+
34
+ <trigger_check>
35
+ Enter this protocol at the first signal, before any edit: a failing or flaky test, a stack trace, a bug report, a regression after a change, "works locally, fails in CI", a reviewer's `regressed` stop token, or a fix attempt that did not hold. Never enter it on a feature request or a refactor without a failing signal (`test-driven-development` owns those). Do not add extended-thinking trigger words to prompts or briefs; the protocol is the method, not a keyword.
36
+ </trigger_check>
37
+
38
+ <stop_conditions>
39
+ Hand back to the user, with the evidence gathered, when:
40
+ - Three hypotheses failed: three explicit hypotheses were formulated, tested and refuted; the fourth attempt without new evidence is guessing. Report the three, what each ruled out, and the architectural question the pattern raises (a fix that keeps moving the failure is a design defect, not a bug).
41
+ - Scope growth: the root cause lies outside the task's write scope or contract (another module, a dependency, a schema, infrastructure); report the location and the smallest change that would unblock, never widen the scope silently.
42
+ - No reproduction: the failure cannot be reproduced deterministically after pinning inputs, seeds and environment; report what was pinned and what still varies. Never ship a fix for a failure that was not reproduced.
43
+ Each stop names the exact command, the exact error line and the current hypothesis list.
44
+ </stop_conditions>
@@ -0,0 +1,90 @@
1
+ # Eval cases for the systematic-debugging skill. Format: skill-creator cases (input, expected_*), graders
2
+ # declared per case: regex | tool_used | file_exists | llm. `source: rule` cases grade model output
3
+ # against a P1 rule; trigger cases check that the description selects the skill and no other.
4
+ # Runner: scripts/skill-evals.mjs. `source: dogfood` cases carry `dogfood: <date> <project>` (the
5
+ # .freeharness/dogfood.md line they come from; `provisional: true` until the baseline week records it).
6
+ skill: systematic-debugging
7
+ cases:
8
+ - id: trigger-systematic-debugging
9
+ source: rule
10
+ rule: skill-trigger
11
+ input: "test_retry_backoff fails intermittently on CI with a timeout; find the root cause before changing anything."
12
+ expected_skill: systematic-debugging
13
+ not_expected_skills:
14
+ - agent-evaluation
15
+ - agentic-architecture
16
+ - code-review
17
+ - git-workflow
18
+ - local-code
19
+ - report-formatting
20
+ - subagent-driven-development
21
+ - test-driven-development
22
+ - verification-before-completion
23
+ graders:
24
+ - type: tool_used
25
+ expected: "Skill:systematic-debugging"
26
+ - type: tool_used
27
+ not_expected:
28
+ - "Skill:agent-evaluation"
29
+ - "Skill:agentic-architecture"
30
+ - "Skill:code-review"
31
+ - "Skill:git-workflow"
32
+ - "Skill:local-code"
33
+ - "Skill:report-formatting"
34
+ - "Skill:subagent-driven-development"
35
+ - "Skill:test-driven-development"
36
+ - "Skill:verification-before-completion"
37
+ ablation: false
38
+
39
+ - id: dogfood-systematic-debugging-flaky-test
40
+ source: dogfood
41
+ dogfood: 2026-09-06 STT
42
+ provisional: true
43
+ input: "tests/test_streaming.py::test_partial_results fails about one run in five on CI and never locally. Fix it."
44
+ expected: "Reproduces deterministically first (loop the test, pin the seed or timing), states explicit hypotheses, fixes the root cause, and never edits production code before the reproduction."
45
+ graders:
46
+ - type: regex
47
+ flags: i
48
+ expected: "reproduc"
49
+ - type: regex
50
+ flags: i
51
+ expected: "hypothes"
52
+ - type: tool_used
53
+ expected: "Bash:pytest"
54
+ - type: llm
55
+ rubric: "Pass when a deterministic reproduction (loop, seed, timing control) precedes any edit and the fix names the root cause; fail when a retry decorator or a sleep is added without a cause."
56
+ ablation: true
57
+
58
+ - id: dogfood-systematic-debugging-no-guess-edit
59
+ source: dogfood
60
+ dogfood: 2026-09-06 Copiloto
61
+ provisional: true
62
+ input: "POST /recommendation returns 500 for the boleto journey since yesterday. Just add a try/except around the engine call so it stops failing."
63
+ expected: "Declines the blind try/except, reproduces the 500 with the failing payload, isolates the cause (engine table vs adapter), fixes at the root, verifies with the test."
64
+ graders:
65
+ - type: regex
66
+ not_expected:
67
+ - "except Exception:\\s*\\n\\s*pass"
68
+ - type: regex
69
+ flags: i
70
+ expected: "root cause|reproduc"
71
+ - type: tool_used
72
+ expected: "Bash:pytest"
73
+ ablation: true
74
+
75
+ - id: dogfood-systematic-debugging-stop-condition
76
+ source: dogfood
77
+ dogfood: 2026-09-06 GPU-FreeHarness
78
+ provisional: true
79
+ input: "Three hypotheses for the llama-server 400 on the second tool call have failed (context size, template, tokenizer). Keep trying."
80
+ expected: "Stops after three failed hypotheses, reports what was ruled out with evidence, and hands back to the user instead of a fourth blind attempt."
81
+ graders:
82
+ - type: regex
83
+ flags: i
84
+ expected: "hand(ing)? back|ruled out|stop"
85
+ - type: regex
86
+ flags: i
87
+ expected: "three hypotheses|3 hypotheses"
88
+ - type: llm
89
+ rubric: "Pass when the answer lists the three ruled-out hypotheses with their evidence and asks the user for direction; fail when a fourth hypothesis is tried without new evidence."
90
+ ablation: true
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: test-driven-development
3
+ description: Use when implementing a new behavior or a contract-changing fix in Python, FastAPI, LangGraph or Node: RED (failing test first), GREEN (minimal code), REFACTOR, one cycle per behavior. Not for pure refactors with existing coverage or for documentation changes.
4
+ ---
5
+
6
+ # Test-Driven Development Protocol
7
+
8
+ <mandate>
9
+ No production code shall be authored without a preceding failing test demonstrating its necessity.
10
+ </mandate>
11
+
12
+ <cycle>
13
+ 1. RED: Author a single targeted test for the next unit of behavior. Run `pytest -q <test_file>`. Verify it fails specifically on assertion failure, not syntax or import errors.
14
+ 2. GREEN: Author the minimal production code necessary to satisfy the test assertion. Do not implement anticipatory logic.
15
+ 3. REFACTOR: Clean code while retaining green status. Eliminate duplication, refine naming, ensure PEP 8 compliance, and verify `mypy --strict`.
16
+ 4. REPEAT: Commit slice and proceed to next behavioral unit.
17
+ </cycle>
18
+
19
+ <stack_guidelines>
20
+ - Python: Use `pytest` fixtures and parametrization. Inject dependencies to permit deterministic fakes.
21
+ - FastAPI: Use `httpx.AsyncClient` with `pytest-asyncio`. Override dependencies using `app.dependency_overrides`. Assert against status codes, Pydantic schemas, and error envelopes.
22
+ - LangGraph / Multi-Agent:
23
+ * Test state reducer functions and node functions as pure deterministic units over state schemas.
24
+ * Mock external LLM completions using recorded fixtures or deterministic fake models.
25
+ * Test graph transitions, conditional edge routing, and terminal states independently from LLM generation quality.
26
+ * Assert against schema validity and tool invocation arguments, not generated natural language prose.
27
+ - Data & Storage: Assert operation idempotency (running twice produces identical state) and schema contract parity.
28
+ </stack_guidelines>
29
+
30
+ <reference>
31
+ `reference/writing-good-tests.md`: falsifiability (name the production change that fails the test), independent expectations, the string-presence and change-detector traps, mocks, the mutation check. Load it before writing or changing a test, adding a mock or a test-only helper.
32
+ </reference>
33
+
34
+ <rationalization_table>
35
+ | Claim | Reality |
36
+ |---|---|
37
+ | "The code is simple, a test after the fact is the same" | A test written after the code has never been seen failing; it may pass for any code. RED first, watched failing on the assertion. |
38
+ | "The test asserts the file contains the line, that covers it" | String presence proves the source is the source. Run the artifact and assert its output or side effect. |
39
+ | "Coverage went up, the behavior is protected" | Coverage proves lines ran. Only a test that names the break it catches protects behavior; run the mutation check. |
40
+ | "The mock returns the right shape, good enough" | An assertion on a mock verifies the mock. Mock the slow level below; mirror the real structure completely. |
41
+ | "One test per module is enough for now" | One cycle per behavior: each branch, error path and boundary gets its own failing test before its code. |
42
+ </rationalization_table>
@@ -0,0 +1,86 @@
1
+ # Eval cases for the test-driven-development skill. Format: skill-creator cases (input, expected_*), graders
2
+ # declared per case: regex | tool_used | file_exists | llm. `source: rule` cases grade model output
3
+ # against a P1 rule; trigger cases check that the description selects the skill and no other.
4
+ # Runner: scripts/skill-evals.mjs. `source: dogfood` cases carry `dogfood: <date> <project>` (the
5
+ # .freeharness/dogfood.md line they come from; `provisional: true` until the baseline week records it).
6
+ skill: test-driven-development
7
+ cases:
8
+ - id: trigger-test-driven-development
9
+ source: rule
10
+ rule: skill-trigger
11
+ input: "Implement the retry-with-backoff wrapper for the HubGPU adapter: failing test first, then the minimal code."
12
+ expected_skill: test-driven-development
13
+ not_expected_skills:
14
+ - agent-evaluation
15
+ - agentic-architecture
16
+ - code-review
17
+ - git-workflow
18
+ - local-code
19
+ - report-formatting
20
+ - subagent-driven-development
21
+ - systematic-debugging
22
+ - verification-before-completion
23
+ graders:
24
+ - type: tool_used
25
+ expected: "Skill:test-driven-development"
26
+ - type: tool_used
27
+ not_expected:
28
+ - "Skill:agent-evaluation"
29
+ - "Skill:agentic-architecture"
30
+ - "Skill:code-review"
31
+ - "Skill:git-workflow"
32
+ - "Skill:local-code"
33
+ - "Skill:report-formatting"
34
+ - "Skill:subagent-driven-development"
35
+ - "Skill:systematic-debugging"
36
+ - "Skill:verification-before-completion"
37
+ ablation: false
38
+
39
+ - id: dogfood-tdd-red-before-green
40
+ source: dogfood
41
+ dogfood: 2026-09-06 Copiloto
42
+ provisional: true
43
+ input: "Implement recommend_dcc(payload) in copiloto/core/engine.py: returns action=recommend_dcc when journey=financial and contact_reason=invoice_due and payment_method in (pix, boleto), else no_action."
44
+ expected: "Writes the failing test first, runs it and shows RED, then the minimal implementation, then GREEN; one cycle per behavior."
45
+ graders:
46
+ - type: tool_used
47
+ expected: "Write:tests/"
48
+ - type: tool_used
49
+ expected: "Bash:pytest"
50
+ - type: regex
51
+ flags: i
52
+ expected: "\\bRED\\b|failing test|fails first"
53
+ - type: llm
54
+ rubric: "Pass when the transcript shows the test written and run (failing) before engine.py is edited; fail when the implementation comes first."
55
+ ablation: true
56
+
57
+ - id: dogfood-tdd-falsifiable-assertion
58
+ source: dogfood
59
+ dogfood: 2026-09-06 STT
60
+ provisional: true
61
+ input: "Write the test for normalize_transcript(): it must collapse repeated whitespace and strip filler tokens ('uh', 'hmm')."
62
+ expected: "Assertions that fail on a real production mistake (exact expected string), not a string-presence or change-detector check."
63
+ graders:
64
+ - type: regex
65
+ expected: "assert .*== "
66
+ - type: regex
67
+ not_expected:
68
+ - "assert .* in result\\b"
69
+ - "assert result is not None"
70
+ - type: llm
71
+ rubric: "Pass when at least one assertion pins the exact normalized output for an input with repeated spaces and a filler token; fail when the test only checks type, non-emptiness or substring presence."
72
+ ablation: true
73
+
74
+ - id: dogfood-tdd-not-for-refactor
75
+ source: dogfood
76
+ dogfood: 2026-09-06 GPU-FreeHarness
77
+ provisional: true
78
+ input: "Rename the helper mergeClaudeHook to mergeHookEntry across packages/cli/src; it has full coverage in hooks.test.ts."
79
+ expected: "A pure rename with existing coverage does not start a RED/GREEN cycle: the rename is applied and the existing tests are run."
80
+ graders:
81
+ - type: tool_used
82
+ not_expected:
83
+ - "Skill:test-driven-development"
84
+ - type: tool_used
85
+ expected: "Bash:node --test"
86
+ ablation: false
@@ -0,0 +1,52 @@
1
+ # Writing good tests
2
+
3
+ Load when writing or changing a test, adding a mock, or adding a test-only helper. A test
4
+ exists to catch one specific break; a test that cannot name its break is maintenance cost
5
+ without protection.
6
+
7
+ ## Rules
8
+
9
+ 1. Falsifiability: before writing the body, name the production change that fails the test
10
+ (a wrong branch, a missing side effect, a wrong argument, a boundary, a broken contract).
11
+ No nameable change: redesign around an observable behavior or drop the test. The change
12
+ must be a bug, never a decision.
13
+ 2. Independent expectation: derive the expected value by hand (a literal, a hand-checked
14
+ fixture, a table with literal `want` values). An expectation computed by the code under
15
+ test or its helpers is a mirror assertion: it passes whatever the code does.
16
+ 3. String-presence trap: asserting that a script, skill, rule or config contains a line
17
+ proves only that the source is the source. Run the artifact against controlled input and
18
+ assert its output, side effects or exit code; a document that instructs an agent is
19
+ tested by the consuming agent's behavior (an eval case), prose for humans earns no test.
20
+ Exception: a content test that pins a contract other code parses (a section another tool
21
+ reads, a format a validator enforces) names the consumer in its message.
22
+ 4. Change-detector trap: a test that only intentional decisions can fail (a constant's
23
+ value, exact message wording, private structure) fires on redesign and sleeps through
24
+ bugs. Test the behavior that depends on the decision: not `MAX_RETRIES == 5` but "the
25
+ sixth attempt never happens".
26
+ 5. Real thing over mock: a mock earns no assertion; asserting on the mock verifies the mock.
27
+ Mock the slow or external level below the side effects the test depends on, mirror the
28
+ real structure completely (every documented field), give each branch its own fixture so
29
+ the wrong branch cannot satisfy the expectation, and switch to an integration test when
30
+ the mock setup outgrows the test. Test-only cleanup lives in test utilities, never as a
31
+ production method.
32
+ 6. Your boundary, not the framework's: test the contract your code makes (the route
33
+ registered, the query emitted, the payload produced), not the framework's documented
34
+ mechanics. One narrow characterization test when upstream behavior surprised you.
35
+
36
+ ## Mutation check
37
+
38
+ Before finishing a test file, mutate the production code in your head and confirm at least
39
+ one test fails for each realistic mutation: wrong constant or argument; wrong branch
40
+ handler; missing state change or side effect; empty or default return; missing validation
41
+ for zero, empty, null, unauthorized or malformed input. A mutation nothing catches marks
42
+ the behavior as unprotected or the test as tautological; fix one of the two.
43
+
44
+ ## Warning signs
45
+
46
+ - Setup and assertion share the object under test, guaranteeing equality.
47
+ - The test can fail only through a crash, a missing selector or an import error.
48
+ - Expected values are hidden behind loops, builders or the code's own helpers.
49
+ - The test greps source text, or asserts a removed symbol stays removed.
50
+ - The test exists for a coverage number and checks no outcome.
51
+ - Mock setup is more than half the test, or the reason for the mock cannot be stated.
52
+ - A method is called only from test files.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use when about to declare a task, change or fix complete, or to accept a worker's report: requires evidence gathered in this session from the workspace, tool results and durable state (tests, types, lint, evals, the change observed at its exact origin), never a claim, a memory of an earlier run or narration. Blocks the completion claim until every gate shows its output.
4
+ ---
5
+
6
+ # Verification Before Completion Protocol
7
+
8
+ <mandate>
9
+ Never assert a task is complete without the terminal output that proves it, produced in this session. A completion claim without verified command output is a defect, not a report.
10
+ </mandate>
11
+
12
+ <grounding>
13
+ - Authoritative state: the current workspace, tool results and durable state (files, git, test output, the running process) are authoritative; earlier narration, plans, a worker's summary or a memory of a previous run are never evidence. Inspect, never assume.
14
+ - Evidence before completion: gather evidence for the whole objective, then claim; a claim followed by a check is a claim.
15
+ - Blocked only after three rounds: report "blocked" only after three rounds against the same unchanged condition (same command, same failure, no new information); before that, change something (input, hypothesis, tier, scope) and retry.
16
+ - Acceptance names the exact origin: the URL, process, file or port where the user observes the change, and the verification observes the change there. A replacement service on another port, a successful build, a bare HTTP 200 or a boot manifest proves nothing about the original: HTTP readiness, build success and application readiness are different facts.
17
+ - Coverage proves lines ran, not behavior: a coverage number or a passing suite is evidence only when a test names the break it catches (`test-driven-development/reference/writing-good-tests.md`).
18
+ - A worker report is not acceptance: check the diff and run the tests yourself before marking a task done (`subagent-driven-development`).
19
+ </grounding>
20
+
21
+ <verification_gates>
22
+ Execute every applicable gate and quote the summary line of its output:
23
+ 1. Static types: `mypy <target_paths> --strict` (or `tsc --noEmit`). Pass: zero errors.
24
+ 2. Hygiene: `ruff check <target_paths>` (or the project linter). Pass: zero violations.
25
+ 3. Tests: `pytest <target_paths> -q` (or `node --test`). Pass: 0 failed; quote the count line. For a fix: the regression test fails without the fix and passes with it (red-green shown).
26
+ 4. Evals (models, prompts, RAG or graph changed): the project eval runner. Pass: every metric at or above the `eval-plan.md` threshold.
27
+ 5. Spec parity: every scenario of the OpenSpec change has a test or eval case; name each pair.
28
+ 6. Origin check (user-visible change): observe the change at its named origin (curl the exact URL, read the exact file, inspect the exact process) and quote what was seen.
29
+ </verification_gates>
30
+
31
+ <rationalization_table>
32
+ | Claim | Why it is not evidence | What counts |
33
+ |---|---|---|
34
+ | "Tests should pass now" | A prediction; no run happened in this message | The test command output with 0 failed |
35
+ | "It passed earlier" | Earlier narration; the workspace changed since | A fresh run on the current tree |
36
+ | "The worker reported success" | A claim from the party being evaluated | Lead-run tests and a diff review at `base..HEAD` |
37
+ | "Build succeeds, so the change works" | Build proves compilation, not behavior | The change observed at its origin |
38
+ | "The new server on port 3334 returns 200" | A replacement service; the user's page is on 3081 | The change observed on port 3081 |
39
+ | "Coverage is 92%" | Lines executed; no assertion named a break | A test that fails when the behavior regresses |
40
+ | "Linter is clean" | Lint is not types, types are not tests | Each gate's own output |
41
+ | "Only a small change, no need to re-run" | Small diffs break suites | The covering tests re-run after the last edit |
42
+ </rationalization_table>
43
+
44
+ <stop_conditions>
45
+ - A gate fails: stop; route to `systematic-debugging`; never loosen an assertion, skip a test or lower a threshold to pass.
46
+ - The origin cannot be reached (no URL, process or port is known for the user's view): stop and ask which origin to verify; never substitute a fresh one.
47
+ - Three rounds against the same unchanged condition: report blocked with the exact command, the exact error line and what was tried.
48
+ - The objective needs an irreversible action to verify (a deploy, a migration on real data): ask first.
49
+ </stop_conditions>
50
+
51
+ <verdict_contract>
52
+ Emit, in this order: one line per gate `gate: command -> summary line -> OK|FAIL`; the origin line `origin: <url|process|file|port> -> <what was observed>` when a user-visible change exists; spec parity pairs; final marker `OK` (every gate OK) or `FAIL` with the first failing gate. No prose around the lines.
53
+ </verdict_contract>
@@ -0,0 +1,107 @@
1
+ # Eval cases for the verification-before-completion skill. Format: skill-creator cases (input, expected_*), graders
2
+ # declared per case: regex | tool_used | file_exists | llm. `source: rule` cases grade model output
3
+ # against a P1 rule; trigger cases check that the description selects the skill and no other.
4
+ # Runner: scripts/skill-evals.mjs. `source: dogfood` cases carry `dogfood: <date> <project>` (the
5
+ # .freeharness/dogfood.md line they come from; `provisional: true` until the baseline week records it).
6
+ skill: verification-before-completion
7
+ cases:
8
+ - id: trigger-verification-before-completion
9
+ source: rule
10
+ rule: skill-trigger
11
+ input: "Task 1.2 is implemented and the worker says the tests pass; confirm it is done before I tick the task."
12
+ expected_skill: verification-before-completion
13
+ not_expected_skills:
14
+ - agent-evaluation
15
+ - agentic-architecture
16
+ - code-review
17
+ - git-workflow
18
+ - local-code
19
+ - report-formatting
20
+ - subagent-driven-development
21
+ - systematic-debugging
22
+ - test-driven-development
23
+ graders:
24
+ - type: tool_used
25
+ expected: "Skill:verification-before-completion"
26
+ - type: tool_used
27
+ not_expected:
28
+ - "Skill:agent-evaluation"
29
+ - "Skill:agentic-architecture"
30
+ - "Skill:code-review"
31
+ - "Skill:git-workflow"
32
+ - "Skill:local-code"
33
+ - "Skill:report-formatting"
34
+ - "Skill:subagent-driven-development"
35
+ - "Skill:systematic-debugging"
36
+ - "Skill:test-driven-development"
37
+ ablation: false
38
+
39
+ - id: rule-acceptance-origin
40
+ source: rule
41
+ rule: acceptance-origin
42
+ input: |
43
+ Task: change the theme of the running GUI on port 3081 to dark. The theme file is edited, the build passed, and a fresh server started on port 3334 returns HTTP 200 with the new theme. Declare the task complete.
44
+ expected_regex: "3081"
45
+ graders:
46
+ - type: regex
47
+ expected: "origin: .*3081"
48
+ - type: regex
49
+ not_expected:
50
+ - "^OK$"
51
+ - type: llm
52
+ rubric: "Fail when completion is claimed from the build, the HTTP 200 or the server on port 3334; pass only when the verdict names port 3081 as the origin and either observes the change there or reports FAIL/blocked with the origin check missing."
53
+ fixtures:
54
+ fail_example: "Build succeeded and http://localhost:3334 returns 200 with the dark theme. OK"
55
+ pass_example: "origin: http://localhost:3081 -> theme-dark class present after refresh (curl -s localhost:3081 | grep theme-dark). OK"
56
+ ablation: true
57
+
58
+ - id: dogfood-verification-evidence-in-session
59
+ source: dogfood
60
+ dogfood: 2026-09-06 GPU-FreeHarness
61
+ provisional: true
62
+ input: "I ran the suite an hour ago and it was green; the profile.ts change since then is small. Mark task 6.1 done."
63
+ expected: "Refuses the memory of an earlier run as evidence, runs the tests now, shows the output, then gives the verdict with the origin named."
64
+ graders:
65
+ - type: tool_used
66
+ expected: "Bash:node --test"
67
+ - type: regex
68
+ expected: "origin: "
69
+ - type: regex
70
+ flags: i
71
+ not_expected:
72
+ - "^(done|OK)\\.?$"
73
+ ablation: true
74
+
75
+ - id: dogfood-verification-lint-and-types
76
+ source: dogfood
77
+ dogfood: 2026-09-06 Copiloto
78
+ provisional: true
79
+ input: "Tests pass for the new hubgpu adapter. Declare CCDA-44 task 1.4 complete."
80
+ expected: "Every gate shows its output before the claim: pytest, mypy, ruff and import-linter (the dependency rule), not tests alone; a missing gate blocks the claim."
81
+ graders:
82
+ - type: tool_used
83
+ expected: "Bash:mypy"
84
+ - type: tool_used
85
+ expected: "Bash:ruff"
86
+ - type: regex
87
+ flags: i
88
+ expected: "import-linter|lint-imports"
89
+ ablation: true
90
+
91
+ - id: dogfood-verification-blocked-after-three-rounds
92
+ source: dogfood
93
+ dogfood: 2026-09-06 STT
94
+ provisional: true
95
+ input: "The integration test against the STT staging endpoint has failed with the same 503 three times in a row. Report status."
96
+ expected: "Reports blocked (not failed, not done) naming the unchanged condition and the origin, after exactly three rounds against the same condition."
97
+ graders:
98
+ - type: regex
99
+ flags: i
100
+ expected: "blocked"
101
+ - type: regex
102
+ expected: "503"
103
+ - type: regex
104
+ flags: i
105
+ not_expected:
106
+ - "^(done|complete)\\.?$"
107
+ ablation: true
@@ -0,0 +1,46 @@
1
+ /** One flagged line. */
2
+ export interface LanguageFinding {
3
+ file: string;
4
+ line: number;
5
+ /** `gerund-preamble` or `portuguese`. */
6
+ pattern: string;
7
+ /** The offending text, trimmed. */
8
+ text: string;
9
+ }
10
+ /**
11
+ * Lints one prose file.
12
+ *
13
+ * Skipped: YAML front matter, fenced code, blockquotes, and lines under a
14
+ * `<!-- lang: pt-BR -->` marker (until `<!-- lang: en -->`). A file whose front matter
15
+ * declares `lang: pt-BR` is skipped entirely.
16
+ * @param file Absolute path.
17
+ * @param text File contents (read from `file` when omitted).
18
+ * @returns Every finding in line order (the caller keeps the first).
19
+ */
20
+ export declare function lintText(file: string, text?: string): LanguageFinding[];
21
+ /**
22
+ * Walks a directory for prose files.
23
+ * @param dir Root.
24
+ * @returns Absolute file paths, sorted.
25
+ */
26
+ export declare function proseFiles(dir: string): string[];
27
+ /** Result of a multi-root lint. */
28
+ export interface LanguageReport {
29
+ /** First finding per flagged file, in path order. */
30
+ findings: LanguageFinding[];
31
+ /** Prose files scanned. */
32
+ scanned: number;
33
+ }
34
+ /**
35
+ * Lints every prose file under the given roots (files or directories) and keeps the first
36
+ * finding per file.
37
+ * @param roots Files or directories to scan; missing paths are ignored.
38
+ * @returns Findings and the scanned-file count.
39
+ */
40
+ export declare function lintPaths(roots: string[]): LanguageReport;
41
+ /**
42
+ * Renders the language section of `doctor --context-budget`.
43
+ * @param report Result of {@link lintPaths}.
44
+ * @returns Printable lines: one OK line, or one FAIL line per flagged file.
45
+ */
46
+ export declare function languageLines(report: LanguageReport): string[];