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,37 @@
1
+ {
2
+ "$comment": "FreeHarness cost-tracker for Claude Code (cost capability). Merged additively into settings.json. Stop fires at the end of every assistant turn and SessionEnd when the session closes; each run appends a cumulative snapshot of the session's token usage + estimated USD (cost-prices.json, editable) to ~/.claude/freeharness/cost/usage.jsonl, then backfills any subagent dispatch missing from .freeharness/sdd/<change>/ledger.jsonl as a late: true line. SubagentStop appends one ledger line per finished dispatch instead of a usage.jsonl snapshot. The SessionEnd entry carries timeout 10: Claude Code gives SessionEnd hooks a shared 1.5 s budget by default and raises it to the highest per-hook timeout in a settings file. The SubagentStop entry carries the same timeout so the ledger read and write fit. Never blocks, never writes to stdout. Report: `freeharness cost report`.",
3
+ "hooks": {
4
+ "Stop": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-cost-tracker.mjs\""
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "SessionEnd": [
15
+ {
16
+ "hooks": [
17
+ {
18
+ "type": "command",
19
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-cost-tracker.mjs\"",
20
+ "timeout": 10
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "SubagentStop": [
26
+ {
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-cost-tracker.mjs\"",
31
+ "timeout": 10
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$comment": "FreeHarness PreToolUse memory guard for Claude Code. Merged additively into <project>/.claude/settings.json. Denies hand-written memory .md writes (the free-mem plugin owns memory; saves output tokens).",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "Write|Edit|MultiEdit",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-memory-guard.mjs\""
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$comment": "FreeHarness output pruner for Claude Code (cost capability). Merged additively into settings.json. PostToolUse on Bash: when stdout exceeds --max-bytes (8 KB) or --max-lines (200), the full output is written to ~/.claude/freeharness/tool-output/<session>/<n>.txt and the model receives head + tail with `[freeharness: N lines pruned, full output at <path>]` markers via `updatedToolOutput` (the command is never rewritten, so permission rules and exit codes are untouched). Diff/patch previews pass through; pytest / node --test / vitest failure blocks stay whole; a {kind:\"pruned\"} line lands in the cost log for `freeharness cost report --sinks`. Disk copy failure = output passed through. Disable: FREEHARNESS_HOOK_OUTPUT_PRUNER=off or remove this entry.",
3
+ "hooks": {
4
+ "PostToolUse": [
5
+ {
6
+ "matcher": "Bash",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-output-pruner.mjs\" --max-bytes 8192 --max-lines 200"
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$comment": "FreeHarness PreCompact hook for Claude Code (rules capability; memory-independent). Merged additively into settings.json. Before /compact or auto-compaction it writes ~/.claude/freeharness/state/<session>.precompact.md (the eight-section checkpoint skeleton built from the transcript, identifiers verbatim) and <session>.fileops.json (Read/Edit/Write/MultiEdit/NotebookEdit list) for the SessionStart re-orientation, and asks a running memory worker to store a session summary (POST /api/sessions/summarize). Worker down = skipped; exit 0, no output. Disable: FREEHARNESS_HOOK_PRECOMPACT=off.",
3
+ "hooks": {
4
+ "PreCompact": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-precompact.mjs\""
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$comment": "FreeHarness repeat-tool reminder for Claude Code (rules capability; rewritten from the dsh repeat-tool-reminder guard, MIT). Merged additively into settings.json. PreToolUse on every tool: hashes (tool, key-sorted input), keeps the run length in ~/.claude/freeharness/state/<session>.json, counts denied calls, and returns an additionalContext reminder at --thresholds 3,5,8 consecutive identical calls (short at 3, detailed with a --preview-chars 500 argument preview at 5 and 8). Advisory only, never blocks. UserPromptSubmit runs the same script to reset the chain. Thresholds are validated at load (integers >= 2, ascending); an invalid list falls back to the defaults with a stderr line. Disable: FREEHARNESS_HOOK_REPEAT_TOOL=off or remove both entries.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-repeat-tool.mjs\" --thresholds 3,5,8 --preview-chars 500"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "hooks": [
17
+ {
18
+ "type": "command",
19
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-repeat-tool.mjs\" --thresholds 3,5,8 --preview-chars 500"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
25
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$comment": "FreeHarness PreToolUse security guidance for Claude Code (safety capability). Merged additively into settings.json. Warns (additionalContext, never blocks) when an Edit/Write introduces a known vulnerability sink: shell exec, eval, DOM XSS, unsafe deserialization, SQL string building, path traversal, hardcoded secrets, TLS off, weak crypto, Actions script injection, untrusted text in prompts, model output reaching an execution sink.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "Write|Edit|MultiEdit",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PROJECT_DIR}/.freeharness/hooks/freeharness-security-guidance.mjs\""
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$comment": "Neutral MCP server list. Each adapter registers its own way (claude mcp add, OpenCode config); targets says where to apply.",
3
+ "servers": [
4
+ {
5
+ "name": "context7",
6
+ "description": "Up-to-date library/framework docs (avoids hallucinated APIs).",
7
+ "type": "stdio",
8
+ "command": "npx",
9
+ "args": [
10
+ "-y",
11
+ "@upstash/context7-mcp"
12
+ ],
13
+ "targets": [
14
+ "claude-code",
15
+ "opencode"
16
+ ],
17
+ "optional": false
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,89 @@
1
+ # OpenSpec project config — base for the FreeHarness spec-driven override.
2
+ # Optional: copy to <project>/openspec/config.yaml only to add project-specific
3
+ # context. The house rules already travel with the schema, so this file is not
4
+ # required. `context` is injected into every artifact; `rules` only for the
5
+ # matching artifact id.
6
+
7
+ schema: spec-driven
8
+
9
+ context: |
10
+ Engineering profile: Software / AI / Data Engineering.
11
+ Stack: Python 3.11+, FastAPI, LangGraph, multi-agent systems, RAG pipelines,
12
+ PostgreSQL + pgvector, SQLite, Oracle (OCI), Docker. Pydantic v2 for models
13
+ and settings (BaseModel with extra="forbid"; BaseSettings only for secrets).
14
+
15
+ Conventions:
16
+ - PEP 8, full type hints, prefer editing existing files over new ones.
17
+ - Structured logging of agent decisions and RAG retrieval; no print() in
18
+ production code.
19
+ - Specs are the source of truth; code is a byproduct. Anti-over-specification:
20
+ define the WHAT, the WHY, and the architectural limits of the HOW. Do not
21
+ write final application code or exhaustive pseudo-code in artifacts.
22
+ - INVEST: thin, vertical, independent slices to avoid context overload.
23
+ - Always anticipate edge cases and failure modes explicitly.
24
+
25
+ AI Safety:
26
+ - Sanitize inputs against prompt injection.
27
+ - Version models and prompts; record eval thresholds.
28
+
29
+ Research discipline:
30
+ - Never hallucinate API signatures for fast-moving frameworks (LangGraph,
31
+ pgvector, OCI SDKs). Verify against current docs (Context7 / Gemini MCP)
32
+ before specifying exact APIs.
33
+
34
+ Formatting of generated artifacts:
35
+ - Do not use bold markdown markers. Use headers, lists, and code blocks only.
36
+ - LLM-to-LLM tone: no conversational filler.
37
+
38
+ rules:
39
+ proposal:
40
+ - State Intent (WHY) in 1-2 sentences and What Changes as a specific list.
41
+ - Scope MUST list in-scope, out-of-scope, and explicit non-goals.
42
+ - Include a Boundaries section with three tiers - Always do (mandatory
43
+ structural/security actions), Ask first (pause for human confirmation),
44
+ Never do (absolute prohibitions, anti-patterns, libraries to avoid).
45
+ - Keep implementation detail out; it belongs in design.
46
+
47
+ specs:
48
+ - Use delta sections - ADDED / MODIFIED / REMOVED Requirements.
49
+ - Requirement headers use "### Requirement:"; scenarios use exactly four
50
+ hashtags "#### Scenario:" with GIVEN/WHEN/THEN. Every requirement has at
51
+ least one scenario.
52
+ - Use RFC 2119 keywords SHALL/MUST for normative behavior; avoid should/may
53
+ for acceptance.
54
+ - Acceptance criteria MUST be binary (Pass/Fail) and translatable to an
55
+ automated test.
56
+ - Default to a lite spec; expand only for high-risk changes (contract/API
57
+ changes, migrations, security/privacy).
58
+
59
+ design:
60
+ - Record architecture decisions ADR-style - decision plus rationale plus
61
+ alternatives rejected.
62
+ - Define data models (Pydantic v2 / TypedDict), state and persistence
63
+ (PostgreSQL/pgvector, SQLite, Oracle/OCI), integrations, and data flow.
64
+ - Enumerate edge cases and failure modes explicitly with the expected
65
+ handling.
66
+
67
+ eval-plan:
68
+ - Define evaluation datasets and the metric thresholds as binary gates
69
+ (e.g. WER <= target, cosine >= target, exact-match, latency budget).
70
+ - Specify grader type (exact / semantic / LLM-judge) and pass@k where
71
+ relevant.
72
+ - Define regression gates and where results are logged/observed.
73
+
74
+ data-contract:
75
+ - Specify source and sink schemas, field types, and nullability.
76
+ - State idempotency and atomicity guarantees, partitioning, and lineage.
77
+ - Define SLAs and the behavior on contract violation (reject / quarantine).
78
+
79
+ tasks:
80
+ - Tasks MUST be atomic and INVEST-sliced; hierarchical numbering (1, 1.1)
81
+ under headings, with checkboxes.
82
+ - Each task MUST name its verification step (e.g. pytest target, mypy,
83
+ output validation).
84
+
85
+ operations:
86
+ archive:
87
+ guidance:
88
+ - "Compound step: one dogfood line in .freeharness/dogfood.md (the evidence log; committed), a rules or skill delta when a correction repeated during the change, and one memory observation with the change id and the verbatim identifiers. No new agent or skill."
89
+
@@ -0,0 +1,277 @@
1
+ # Override bundle: install this as the user-global "spec-driven" schema so that
2
+ # `openspec init` (which always defaults to spec-driven) resolves to THIS content
3
+ # in every project, with no per-project config copy required.
4
+ #
5
+ # Install: copy this file as schema.yaml plus the templates/ dir into
6
+ # ${XDG_DATA_HOME:-$HOME/.local/share}/openspec/schemas/spec-driven/
7
+ #
8
+ # House rules (stack, formatting, AI safety) are embedded in each artifact's
9
+ # instruction so they travel globally with the schema. openspec/config.yaml stays
10
+ # OPTIONAL — use it only to add project-specific context on top.
11
+
12
+ name: spec-driven
13
+ version: 1
14
+ description: >
15
+ Spec-driven workflow for Software / AI / Data Engineering (override of the
16
+ built-in spec-driven). Hybrid of the SDD format (SPECIFY / BOUNDARIES / PLAN /
17
+ ATOMIC TASKS) with OpenSpec delta specs, archive, and relevance-gated eval-plan
18
+ and data-contract artifacts. Stack: Python, FastAPI, LangGraph,
19
+ PostgreSQL/pgvector, SQLite, Oracle (OCI), multi-agent systems, RAG pipelines.
20
+
21
+ # Repeated at the top of every artifact instruction (one artifact is generated at
22
+ # a time, so the rules must live in each instruction to be reliably present).
23
+ # Keep edits here in sync across artifacts.
24
+ #
25
+ # Constitution (Spec Kit's term for the project's non-negotiable principles) is
26
+ # the project CLAUDE.md invariants block. It is referenced from the instructions
27
+ # below, never duplicated here: one source, read by every artifact.
28
+ #
29
+ # V4-P4 ports from OpenSpec 1.12 (e062b957, MIT): inspect-before-drafting (#1737)
30
+ # in proposal and design; per-task verification (#1660) in tasks. FreeHarness
31
+ # additions: supersession check, Consequences (cost and bought), EARS scenarios,
32
+ # Global Constraints and per-task annotation lines, scope/depth dial.
33
+
34
+ artifacts:
35
+ - id: proposal
36
+ generates: proposal.md
37
+ template: proposal.md
38
+ description: >
39
+ Intent (WHY), Scope (in / out / non-goals), Approach, and Boundaries
40
+ (Always do / Ask first / Never do). Maps the legacy SPECIFY + BOUNDARIES.
41
+ instruction: |
42
+ House rules (apply to every artifact): Specs are the source of truth; code
43
+ is a byproduct. Anti-over-specification - define the WHAT, the WHY, and the
44
+ architectural limits of the HOW; do not write final application code or
45
+ exhaustive pseudo-code. INVEST: thin, vertical, independent slices.
46
+ Anticipate edge cases and failure modes explicitly. Formatting: no bold
47
+ markdown markers - use headers, lists, and code blocks only; LLM-to-LLM
48
+ tone, no conversational filler. Stack: Python 3.11+, FastAPI, LangGraph,
49
+ Pydantic v2 (BaseModel extra="forbid"; BaseSettings only for secrets),
50
+ PostgreSQL+pgvector, SQLite, Oracle (OCI). Never hallucinate API signatures
51
+ for fast-moving frameworks - verify against current docs (Context7 / Gemini
52
+ MCP). AI safety: sanitize inputs against prompt injection; version models
53
+ and prompts.
54
+
55
+ Inspect the relevant project before drafting: read the project CLAUDE.md
56
+ (its invariants block is the constitution this change must respect - do
57
+ not restate it, cite it), openspec/specs and the closest similar feature,
58
+ then the relevant implementation, nearby tests, configuration and
59
+ documentation outside openspec/. Keep the inspection read-only and
60
+ proportional to the change; reuse the findings for later artifacts.
61
+ Ground scope, approach and tasks in what you find; distinguish observed
62
+ behavior from assumptions and proposed additions; surface conflicts with
63
+ existing specs instead of silently deciding which is correct. Do this
64
+ discovery now rather than leaving generic "explore the codebase" tasks.
65
+
66
+ Supersession check, before writing: search openspec/specs and
67
+ openspec/changes/archive for an existing decision or mechanism on the
68
+ same subject. When one exists, this change supersedes it explicitly and
69
+ cross-links both ways: the design names the superseded change in a
70
+ `Supersedes: <change-id>` line, and the archived record keeps its text.
71
+ Never edit a published decision in place into a different decision; a
72
+ partially superseded decision stays active and cross-linked.
73
+
74
+ Follow-ups: run `openspec follow-up list` before drafting and name every
75
+ item this change claims (`openspec follow-up claim <change-id> <index>
76
+ --by <this change>`); declare `depends_on` and `supersedes` in the
77
+ change's `.openspec.yaml` when the change waits on or replaces another.
78
+
79
+ This artifact: capture WHY this change is needed and WHAT changes at a high
80
+ level. Set the scope/depth dial line (lite: default, thin artifacts;
81
+ expanded: high-risk changes - contracts, migrations, security, privacy -
82
+ get full specs, design and data-contract). Define Scope with in-scope,
83
+ out-of-scope, and explicit non-goals.
84
+ Include a Boundaries section with three tiers - Always do (mandatory
85
+ structural/security actions), Ask first (scenarios where you must pause for
86
+ human confirmation), Never do (absolute prohibitions, anti-patterns,
87
+ libraries to avoid).
88
+
89
+ Research existing specs before listing Capabilities: run
90
+ `openspec list --specs` for the project's capability inventory, then
91
+ `openspec show "<spec-id>" --type spec --json --no-scenarios` for any that
92
+ look related - that returns a capability's purpose and requirement texts
93
+ without pulling whole spec files into context. Keep `--type spec`: a
94
+ change and a spec sharing a name is otherwise an ambiguous-item error.
95
+ `openspec list` without `--specs` lists in-flight changes, not specs - it
96
+ never shows what the project already covers. Reuse an existing
97
+ capability's exact path instead of introducing a near-duplicate name.
98
+ The filtered read is only an overview. Before deciding what is already
99
+ covered or what should change, read each relevant spec in full, including
100
+ scenarios, with `openspec show "<spec-id>" --type spec`.
101
+
102
+ List Capabilities (new and modified) - each new one
103
+ becomes specs/<name>/spec.md. Keep implementation detail out of the proposal.
104
+ requires: []
105
+
106
+ - id: specs
107
+ generates: "specs/**/*.md"
108
+ template: spec.md
109
+ description: >
110
+ Behavior contract as delta specs (ADDED / MODIFIED / REMOVED) with RFC 2119
111
+ requirements and GIVEN/WHEN/THEN scenarios. Binary acceptance criteria.
112
+ instruction: |
113
+ House rules (apply to every artifact): Specs are the source of truth.
114
+ Anti-over-specification. INVEST slices. Anticipate edge cases. No bold
115
+ markdown - headers/lists/code only; LLM-to-LLM tone, no filler. Never
116
+ hallucinate API signatures - verify via Context7 / Gemini MCP. AI safety:
117
+ sanitize prompt injection; version models and prompts.
118
+
119
+ This artifact: write behavior-first requirements. One spec file per
120
+ capability from the proposal. For a modified capability, use the exact
121
+ existing path from openspec/specs/<capability-path>/ when creating the
122
+ delta - run `openspec list --specs` to confirm that path before writing
123
+ the delta: a mistyped or invented path targets a capability that does
124
+ not exist rather than the one you meant. Do not move or rename the
125
+ capability. Use delta sections with "## " headers - ADDED
126
+ Requirements, MODIFIED Requirements (copy the ENTIRE requirement block and
127
+ edit; partial content loses detail at archive), REMOVED Requirements
128
+ (include Reason and Migration). Requirement header "### Requirement: <name>"
129
+ using SHALL/MUST (avoid should/may). Scenario header uses EXACTLY four
130
+ hashtags "#### Scenario: <name>" with GIVEN/WHEN/THEN bullets (3 hashtags or
131
+ bullets fail silently). The EARS form is accepted as an alternative:
132
+ "#### Scenario: WHEN <event> THE SYSTEM SHALL <behavior>" (also
133
+ WHILE/WHERE/IF), with the behavior in the header and an optional body;
134
+ GIVEN/WHEN/THEN stays the default. Every requirement has at least one
135
+ scenario.
136
+ Acceptance MUST be binary (Pass/Fail) and translatable to an automated test.
137
+ Default to a lite spec; expand only for high-risk changes (contract/API
138
+ changes, migrations, security/privacy). Keep implementation detail out.
139
+ requires: [proposal]
140
+
141
+ - id: design
142
+ generates: design.md
143
+ template: design.md
144
+ description: >
145
+ Technical approach: open questions resolved, candidate approaches compared
146
+ and one chosen, ADR-style decisions, file-level blueprint (files,
147
+ interfaces, data flow, test points), data models, state/persistence,
148
+ integrations, edge cases. Maps the legacy PLAN section.
149
+ instruction: |
150
+ House rules (apply to every artifact): Specs are the source of truth.
151
+ Anti-over-specification - architectural limits of the HOW, not final code.
152
+ INVEST slices. No bold markdown - headers/lists/code only; LLM-to-LLM tone.
153
+ Stack: Python 3.11+, FastAPI, LangGraph, Pydantic v2, PostgreSQL+pgvector,
154
+ SQLite, Oracle (OCI). Never hallucinate API signatures - verify via
155
+ Context7 / Gemini MCP. AI safety: sanitize prompt injection; version
156
+ models and prompts.
157
+
158
+ This artifact: before writing, list the underspecified points (edge
159
+ cases, error behavior, integration points, backward compatibility, scope
160
+ boundaries) and resolve them with the user; never bury an assumption in
161
+ the design. Inspect the relevant project before drafting: the project
162
+ CLAUDE.md invariants (the constitution), openspec/specs, the closest
163
+ similar feature, then implementation, tests, configuration and docs
164
+ outside openspec/ - read-only, proportional, findings reused from the
165
+ proposal. Ground the design in the existing codebase: name the
166
+ conventions and the closest similar feature with file:line citations
167
+ (dispatch explorer-ai-engineer-analyst for unknown or large areas).
168
+ Compare 2-3 candidate approaches (for example minimal change, clean
169
+ architecture, pragmatic balance) in a short table, pick one, and record
170
+ the rationale and the rejected alternatives. Document the key
171
+ architecture decisions ADR-style (decision + rationale + alternatives
172
+ rejected). Alternatives are recorded from what was actually considered,
173
+ never invented to fill the section; an empty alternatives line is
174
+ honest, a fabricated one is a defect. After Decisions, write a
175
+ "## Consequences (cost and bought)" section with one line per decision
176
+ stating what the decision costs and what it buys. When this change
177
+ supersedes a published decision (found by the proposal's supersession
178
+ check), add a `Supersedes: <change-id>` line (one or more archived
179
+ change ids, comma-separated) at the top of the design; archive prints
180
+ the link, writes the reverse link into the archived record, and refuses
181
+ a MODIFIED requirement that repeats the superseded text unchanged.
182
+ Then give a file-level blueprint: files to create or modify
183
+ with the concrete change per file, public interfaces (signatures) and
184
+ their dependencies respecting the dependency rule (infra -> core <-
185
+ entry), data flow naming the types at each hop, and the test points
186
+ (seams and the test cases that prove each slice; the slices become
187
+ tasks.md). Define data models (Pydantic v2 / TypedDict), state and
188
+ persistence (PostgreSQL/pgvector, SQLite, Oracle/OCI), and integrations.
189
+ Enumerate edge cases and failure modes explicitly with the expected
190
+ handling so the execution agent never has to guess. When the design
191
+ involves agent topology (agents, graphs, routing, tool boundaries),
192
+ apply the agentic-architecture skill and dispatch the agentic-architect
193
+ agent; fold its blueprint - pattern choice, context strategy,
194
+ reliability and observability plan - into this design.
195
+ requires: [proposal]
196
+
197
+ - id: eval-plan
198
+ generates: eval-plan.md
199
+ template: eval-plan.md
200
+ description: >
201
+ Evaluation plan for changes affecting LLM/model/RAG behavior. Datasets,
202
+ metric thresholds, grader, pass@k, regression gates, observability.
203
+ instruction: |
204
+ House rules (apply to every artifact): no bold markdown; LLM-to-LLM tone.
205
+ AI safety: sanitize prompt injection; version models and prompts. Never
206
+ hallucinate API signatures - verify via Context7 / Gemini MCP.
207
+
208
+ Create this artifact ONLY if the change affects LLM, model, agent, or RAG
209
+ behavior; otherwise skip it. Define evaluation datasets, metrics with binary
210
+ pass/fail thresholds (e.g. WER <= target, cosine >= target, exact-match,
211
+ latency budget), grader type (exact / semantic / LLM-judge), pass@k where
212
+ relevant, regression gates, and where results are logged/observed.
213
+ requires: [specs]
214
+
215
+ - id: data-contract
216
+ generates: data-contract.md
217
+ template: data-contract.md
218
+ description: >
219
+ Data interface contract for changes that create or alter a data interface.
220
+ Source/sink schemas, types, nullability, partitioning, lineage,
221
+ idempotency/atomicity, SLAs.
222
+ instruction: |
223
+ House rules (apply to every artifact): no bold markdown; LLM-to-LLM tone.
224
+ Stack persistence: PostgreSQL+pgvector, SQLite, Oracle (OCI). Anticipate
225
+ edge cases and failure modes explicitly.
226
+
227
+ Create this artifact ONLY if the change introduces or alters a data
228
+ interface (table, queue, file layout, API payload, external contract);
229
+ otherwise skip it. Specify source and sink schemas, field types and
230
+ nullability, partitioning, lineage, idempotency and atomicity guarantees
231
+ (e.g. tmp -> fsync -> os.replace), SLAs, and behavior on contract violation
232
+ (reject / quarantine / alert).
233
+ requires: [proposal]
234
+
235
+ - id: tasks
236
+ generates: tasks.md
237
+ template: tasks.md
238
+ description: >
239
+ Implementation checklist of atomic, INVEST-sliced tasks with hierarchical
240
+ numbering and a verification step per group. Maps the legacy ATOMIC TASKS.
241
+ instruction: |
242
+ House rules (apply to every artifact): Anti-over-specification. INVEST
243
+ slices. No bold markdown - headers/lists/code only; LLM-to-LLM tone.
244
+ Verify discipline: pytest, mypy, validate outputs.
245
+
246
+ This artifact: open with a Global Constraints block (the invariants from
247
+ the project CLAUDE.md that every task must respect, cited not copied,
248
+ plus the change-wide rules: write scopes, forbidden paths, required
249
+ gates). Then break the work into thin, vertical, independent tasks
250
+ (INVEST) small enough to implement and validate without losing context. Use
251
+ hierarchical numbering (1, 1.1, 1.2) grouped under headings, with
252
+ checkboxes. Each task MUST state how to verify completion (a test,
253
+ command, observable behavior, or delivered artifact): put the
254
+ verification in that task's checkbox description or in a `Verify:` line
255
+ directly under it; use a separate verification task only when it checks
256
+ broader integration spanning multiple tasks. Optional per-task lines,
257
+ indented under the checkbox and never checkboxes themselves:
258
+ `Verify: <test or command>`, `Interfaces: <signatures touched>`,
259
+ `Boundary: <write scope>`, `Depends: <task ids>`. The validator accepts
260
+ them without counting them as tasks; the converge hook reads `Verify:`.
261
+ requires: [specs, design]
262
+
263
+ apply:
264
+ requires: [tasks]
265
+ tracks: tasks.md
266
+
267
+ # Archive operation guidance (advisory; printed by `openspec instructions archive`).
268
+ # Compound step: the archive writes the change's learnings back into the harness so the
269
+ # next change starts from them; it never creates a new agent or skill.
270
+ archive:
271
+ guidance:
272
+ - "Compound step, before the specs fold: append the retrospective line to the change's proposal.md under `## Retrospective` (what worked | what wasted tokens | candidate eval case); the quantitative side is the project telemetry file `.freeharness/telemetry.jsonl` written by the cost tracker at session end, never typed by hand."
273
+ - "Compound step: when a correction repeated during the change (the same reviewer finding twice, the same user correction twice), write the rules or skill delta that prevents it (a line in the project CLAUDE.md, a checklist item in the owning skill, or an eval case under the skill's evals/cases.yaml); never a new agent or skill."
274
+ - "Compound step: record one memory observation naming the change id, the decision that mattered and the exact identifiers (paths, commands, error strings) a later session must find verbatim."
275
+ - "Supersession check: search openspec/specs and openspec/changes/archive for a decision on the same mechanism; when the design carries a `Supersedes: <change-id>` line, archive prints the link and writes `Superseded-by: <this change>` into the archived record; supersede and cross-link both ways, never edit a published decision in place; a partially superseded decision stays active and cross-linked."
276
+ - "Follow-ups: archive prints the change's unclaimed follow-ups; claim each one by a change or record it with `openspec follow-up add` before archiving; an unclaimed item never blocks."
277
+
@@ -0,0 +1,36 @@
1
+ <!--
2
+ Create this artifact ONLY if the change introduces or alters a data interface
3
+ (table, queue, file layout, API payload, external contract). Otherwise skip it.
4
+ -->
5
+
6
+ ## Scope
7
+
8
+ <!-- Which data interface is created or changed, and who the producers/consumers are. -->
9
+
10
+ ## Source Schema
11
+
12
+ <!-- Input schema: fields, types, nullability, units, example record. -->
13
+
14
+ ## Sink Schema
15
+
16
+ <!-- Output schema: fields, types, nullability, units, example record. -->
17
+
18
+ ## Partitioning and Layout
19
+
20
+ <!-- Partition keys, file/dir layout, naming, ordering guarantees. -->
21
+
22
+ ## Lineage
23
+
24
+ <!-- Upstream sources and downstream consumers. How a record is traced end to end. -->
25
+
26
+ ## Idempotency and Atomicity
27
+
28
+ <!-- Reprocessing semantics, dedup keys, atomic write guarantees (e.g. tmp -> fsync -> os.replace). -->
29
+
30
+ ## SLAs
31
+
32
+ <!-- Freshness, throughput, availability targets. -->
33
+
34
+ ## Violation Handling
35
+
36
+ <!-- Behavior on contract violation: reject, quarantine, alert. Exit/return semantics. -->
@@ -0,0 +1,84 @@
1
+ Supersedes: <!-- archived change id(s) this design replaces, comma-separated; delete the line when none. Found by the proposal's supersession check over openspec/specs and openspec/changes/archive. -->
2
+
3
+ ## Context
4
+
5
+ <!-- Background and current state relevant to this change. Existing conventions and the closest similar feature, with file:line citations (explorer-ai-engineer-analyst for unknown or large areas). -->
6
+
7
+ ## Goals / Non-Goals
8
+
9
+ Goals:
10
+ <!-- What this design aims to achieve. -->
11
+
12
+ Non-Goals:
13
+ <!-- Explicitly out of scope for this design. -->
14
+
15
+ ## Open Questions Resolved
16
+
17
+ <!-- Underspecified points (edge cases, error behavior, integration points, backward compatibility, scope) and the answer agreed with the user before writing. No assumption stays implicit. -->
18
+
19
+ ## Candidate Approaches
20
+
21
+ <!-- 2-3 candidates grounded in existing codebase patterns (e.g. minimal change / clean architecture / pragmatic balance). One row each: approach, diff size, reuse, testability, risk. -->
22
+
23
+ | Approach | Summary | Trade-offs |
24
+ |---|---|---|
25
+ | A | | |
26
+ | B | | |
27
+
28
+ Chosen: <!-- which one and why; rejected alternatives in one line each -->
29
+
30
+ ## Decisions
31
+
32
+ <!-- ADR style. One block per significant decision. -->
33
+
34
+ ### Decision: <!-- title -->
35
+ Decision: <!-- what was decided -->
36
+ Rationale: <!-- why -->
37
+ Alternatives rejected: <!-- only options that were actually considered, and why not; never invented to fill the line -->
38
+
39
+ ## Consequences (cost and bought)
40
+
41
+ <!-- One line per decision: what it costs (complexity, tokens, coupling, a phase that cannot close) and what it buys. -->
42
+
43
+ - <decision title>: costs <...>; buys <...>.
44
+
45
+ ## Blueprint
46
+
47
+ <!-- File-level plan for the chosen approach. Dependencies point inward (infra -> core <- entry); a new port names its adapter. -->
48
+
49
+ Files to create / modify:
50
+ <!-- path -> concrete change per file -->
51
+
52
+ Interfaces:
53
+ <!-- public signatures per component and their dependencies -->
54
+
55
+ Test points:
56
+ <!-- seams (injectable dependency, pure function, fake adapter) and the test cases that prove each slice; slices become tasks.md -->
57
+
58
+ ## Data Models
59
+
60
+ <!-- Pydantic v2 models / TypedDict / dataclasses. Names, fields, types, constraints (extra="forbid", etc.). -->
61
+
62
+ ## State and Persistence
63
+
64
+ <!-- Where state lives and how: PostgreSQL/pgvector, SQLite, Oracle/OCI. Tables/collections, keys, indexes, checkpointing. -->
65
+
66
+ ## Integrations
67
+
68
+ <!-- External services, APIs, queues, schedulers. Verify exact API signatures against current docs before fixing them here. -->
69
+
70
+ ## Data Flow
71
+
72
+ <!-- End-to-end flow naming the types at each hop. ASCII diagram or ordered steps. Inputs, transforms, outputs. -->
73
+
74
+ ## Edge Cases and Failure Modes
75
+
76
+ <!-- Enumerate abnormal conditions and the expected handling so the execution agent never has to guess. -->
77
+
78
+ ## Agent Topology
79
+
80
+ <!-- Only when the design involves agents, graphs, routing, or tool boundaries: apply the agentic-architecture skill, dispatch agentic-architect, and fold its blueprint here (pattern, context strategy, reliability, observability). Otherwise delete this section. -->
81
+
82
+ ## Risks / Trade-offs
83
+
84
+ <!-- Known risks, trade-offs, and mitigations. -->