metaharness 0.3.1 → 0.3.2

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 (384) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -74
  3. package/dist/bin.js +0 -0
  4. package/dist/completions-cmd.js +94 -94
  5. package/dist/diag.d.ts +8 -0
  6. package/dist/diag.d.ts.map +1 -1
  7. package/dist/diag.js +79 -15
  8. package/dist/diag.js.map +1 -1
  9. package/dist/export-config.d.ts.map +1 -1
  10. package/dist/export-config.js +3 -12
  11. package/dist/export-config.js.map +1 -1
  12. package/dist/genome.d.ts.map +1 -1
  13. package/dist/genome.js +3 -12
  14. package/dist/genome.js.map +1 -1
  15. package/dist/harness-bin.js +0 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +84 -74
  18. package/dist/index.js.map +1 -1
  19. package/dist/meta-proxy.d.ts +57 -0
  20. package/dist/meta-proxy.d.ts.map +1 -0
  21. package/dist/meta-proxy.js +325 -0
  22. package/dist/meta-proxy.js.map +1 -0
  23. package/dist/publish-cmd.d.ts.map +1 -1
  24. package/dist/publish-cmd.js +5 -0
  25. package/dist/publish-cmd.js.map +1 -1
  26. package/dist/publish.d.ts +6 -0
  27. package/dist/publish.d.ts.map +1 -1
  28. package/dist/publish.js +9 -0
  29. package/dist/publish.js.map +1 -1
  30. package/dist/redact.d.ts +25 -0
  31. package/dist/redact.d.ts.map +1 -0
  32. package/dist/redact.js +62 -0
  33. package/dist/redact.js.map +1 -0
  34. package/dist/score.d.ts +9 -0
  35. package/dist/score.d.ts.map +1 -1
  36. package/dist/score.js +20 -14
  37. package/dist/score.js.map +1 -1
  38. package/dist/threat-model.d.ts.map +1 -1
  39. package/dist/threat-model.js +3 -12
  40. package/dist/threat-model.js.map +1 -1
  41. package/dist/with-wasm.js +43 -43
  42. package/dist/witness-client.d.ts +7 -0
  43. package/dist/witness-client.d.ts.map +1 -1
  44. package/dist/witness-client.js +5 -1
  45. package/dist/witness-client.js.map +1 -1
  46. package/genomes/README.md +23 -23
  47. package/genomes/genome-promoted-cand6-edit-by-midpoint.json +26 -26
  48. package/package.json +126 -126
  49. package/templates/catalog.def.mjs +542 -542
  50. package/templates/catalog.json +1274 -1274
  51. package/templates/minimal/.claude/settings.json.tmpl +18 -18
  52. package/templates/minimal/.claude-plugin/plugin.json.tmpl +13 -13
  53. package/templates/minimal/CLAUDE.md.tmpl +26 -23
  54. package/templates/minimal/README.md.tmpl +20 -20
  55. package/templates/minimal/__tests__/smoke.test.ts.tmpl +37 -37
  56. package/templates/minimal/bin/cli.js.tmpl +100 -100
  57. package/templates/minimal/manifest.json +20 -20
  58. package/templates/minimal/package.json.tmpl +31 -31
  59. package/templates/minimal/src/init.ts.tmpl +21 -21
  60. package/templates/minimal/tsconfig.json.tmpl +19 -19
  61. package/templates/minimal/vitest.config.ts.tmpl +23 -23
  62. package/templates/vertical_advertising/.claude/commands/doctor.md.tmpl +12 -12
  63. package/templates/vertical_advertising/.claude/settings.json.tmpl +33 -33
  64. package/templates/vertical_advertising/.claude/skills/media-plan/SKILL.md.tmpl +13 -13
  65. package/templates/vertical_advertising/.claude-plugin/plugin.json.tmpl +23 -23
  66. package/templates/vertical_advertising/CLAUDE.md.tmpl +30 -30
  67. package/templates/vertical_advertising/README.md.tmpl +29 -29
  68. package/templates/vertical_advertising/__tests__/smoke.test.ts.tmpl +37 -37
  69. package/templates/vertical_advertising/bin/cli.js.tmpl +100 -100
  70. package/templates/vertical_advertising/manifest.json +101 -101
  71. package/templates/vertical_advertising/package.json.tmpl +30 -30
  72. package/templates/vertical_advertising/src/agents/copywriter.ts.tmpl +7 -7
  73. package/templates/vertical_advertising/src/agents/media-planner.ts.tmpl +7 -7
  74. package/templates/vertical_advertising/src/agents/performance-analyst.ts.tmpl +7 -7
  75. package/templates/vertical_advertising/src/init.ts.tmpl +21 -21
  76. package/templates/vertical_advertising/tsconfig.json.tmpl +19 -19
  77. package/templates/vertical_advertising/vitest.config.ts.tmpl +23 -23
  78. package/templates/vertical_agentics/.claude/commands/doctor.md.tmpl +12 -12
  79. package/templates/vertical_agentics/.claude/settings.json.tmpl +33 -33
  80. package/templates/vertical_agentics/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  81. package/templates/vertical_agentics/.claude/skills/run-swarm/SKILL.md.tmpl +14 -14
  82. package/templates/vertical_agentics/.claude-plugin/plugin.json.tmpl +23 -23
  83. package/templates/vertical_agentics/CLAUDE.md.tmpl +32 -32
  84. package/templates/vertical_agentics/README.md.tmpl +30 -30
  85. package/templates/vertical_agentics/__tests__/smoke.test.ts.tmpl +37 -37
  86. package/templates/vertical_agentics/bin/cli.js.tmpl +100 -100
  87. package/templates/vertical_agentics/manifest.json +111 -111
  88. package/templates/vertical_agentics/package.json.tmpl +30 -30
  89. package/templates/vertical_agentics/src/agents/critic.ts.tmpl +7 -7
  90. package/templates/vertical_agentics/src/agents/orchestrator.ts.tmpl +7 -7
  91. package/templates/vertical_agentics/src/agents/planner.ts.tmpl +7 -7
  92. package/templates/vertical_agentics/src/agents/worker.ts.tmpl +7 -7
  93. package/templates/vertical_agentics/src/init.ts.tmpl +21 -21
  94. package/templates/vertical_agentics/tsconfig.json.tmpl +19 -19
  95. package/templates/vertical_agentics/vitest.config.ts.tmpl +23 -23
  96. package/templates/vertical_ai/.claude/commands/doctor.md.tmpl +12 -12
  97. package/templates/vertical_ai/.claude/settings.json.tmpl +35 -35
  98. package/templates/vertical_ai/.claude/skills/eval-report/SKILL.md.tmpl +13 -13
  99. package/templates/vertical_ai/.claude-plugin/plugin.json.tmpl +23 -23
  100. package/templates/vertical_ai/CLAUDE.md.tmpl +31 -31
  101. package/templates/vertical_ai/README.md.tmpl +30 -30
  102. package/templates/vertical_ai/__tests__/smoke.test.ts.tmpl +37 -37
  103. package/templates/vertical_ai/bin/cli.js.tmpl +100 -100
  104. package/templates/vertical_ai/manifest.json +106 -106
  105. package/templates/vertical_ai/package.json.tmpl +30 -30
  106. package/templates/vertical_ai/src/agents/data-curator.ts.tmpl +7 -7
  107. package/templates/vertical_ai/src/agents/deployer.ts.tmpl +7 -7
  108. package/templates/vertical_ai/src/agents/evaluator.ts.tmpl +7 -7
  109. package/templates/vertical_ai/src/agents/trainer.ts.tmpl +7 -7
  110. package/templates/vertical_ai/src/init.ts.tmpl +21 -21
  111. package/templates/vertical_ai/tsconfig.json.tmpl +19 -19
  112. package/templates/vertical_ai/vitest.config.ts.tmpl +23 -23
  113. package/templates/vertical_business/.claude/commands/doctor.md.tmpl +12 -12
  114. package/templates/vertical_business/.claude/settings.json.tmpl +33 -33
  115. package/templates/vertical_business/.claude/skills/quarterly-plan/SKILL.md.tmpl +13 -13
  116. package/templates/vertical_business/.claude-plugin/plugin.json.tmpl +23 -23
  117. package/templates/vertical_business/CLAUDE.md.tmpl +30 -30
  118. package/templates/vertical_business/README.md.tmpl +29 -29
  119. package/templates/vertical_business/__tests__/smoke.test.ts.tmpl +37 -37
  120. package/templates/vertical_business/bin/cli.js.tmpl +100 -100
  121. package/templates/vertical_business/manifest.json +101 -101
  122. package/templates/vertical_business/package.json.tmpl +30 -30
  123. package/templates/vertical_business/src/agents/analyst.ts.tmpl +7 -7
  124. package/templates/vertical_business/src/agents/ops-coordinator.ts.tmpl +7 -7
  125. package/templates/vertical_business/src/agents/strategist.ts.tmpl +7 -7
  126. package/templates/vertical_business/src/init.ts.tmpl +21 -21
  127. package/templates/vertical_business/tsconfig.json.tmpl +19 -19
  128. package/templates/vertical_business/vitest.config.ts.tmpl +23 -23
  129. package/templates/vertical_coding/.claude/commands/doctor.md.tmpl +12 -12
  130. package/templates/vertical_coding/.claude/commands/review-diff.md.tmpl +10 -10
  131. package/templates/vertical_coding/.claude/settings.json.tmpl +40 -40
  132. package/templates/vertical_coding/.claude/skills/plan-change/SKILL.md.tmpl +15 -15
  133. package/templates/vertical_coding/.claude-plugin/plugin.json.tmpl +23 -23
  134. package/templates/vertical_coding/CLAUDE.md.tmpl +32 -32
  135. package/templates/vertical_coding/README.md.tmpl +30 -30
  136. package/templates/vertical_coding/__tests__/smoke.test.ts.tmpl +37 -37
  137. package/templates/vertical_coding/bin/cli.js.tmpl +100 -100
  138. package/templates/vertical_coding/manifest.json +111 -111
  139. package/templates/vertical_coding/package.json.tmpl +30 -30
  140. package/templates/vertical_coding/src/agents/architect.ts.tmpl +7 -7
  141. package/templates/vertical_coding/src/agents/implementer.ts.tmpl +7 -7
  142. package/templates/vertical_coding/src/agents/reviewer.ts.tmpl +7 -7
  143. package/templates/vertical_coding/src/agents/test-writer.ts.tmpl +7 -7
  144. package/templates/vertical_coding/src/init.ts.tmpl +21 -21
  145. package/templates/vertical_coding/tsconfig.json.tmpl +19 -19
  146. package/templates/vertical_coding/vitest.config.ts.tmpl +23 -23
  147. package/templates/vertical_crm/.claude/commands/doctor.md.tmpl +12 -12
  148. package/templates/vertical_crm/.claude/settings.json.tmpl +33 -33
  149. package/templates/vertical_crm/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  150. package/templates/vertical_crm/.claude-plugin/plugin.json.tmpl +23 -23
  151. package/templates/vertical_crm/CLAUDE.md.tmpl +30 -30
  152. package/templates/vertical_crm/README.md.tmpl +29 -29
  153. package/templates/vertical_crm/__tests__/smoke.test.ts.tmpl +37 -37
  154. package/templates/vertical_crm/bin/cli.js.tmpl +100 -100
  155. package/templates/vertical_crm/manifest.json +101 -101
  156. package/templates/vertical_crm/package.json.tmpl +30 -30
  157. package/templates/vertical_crm/src/agents/account-manager.ts.tmpl +7 -7
  158. package/templates/vertical_crm/src/agents/churn-watcher.ts.tmpl +7 -7
  159. package/templates/vertical_crm/src/agents/lead-qualifier.ts.tmpl +7 -7
  160. package/templates/vertical_crm/src/init.ts.tmpl +21 -21
  161. package/templates/vertical_crm/tsconfig.json.tmpl +19 -19
  162. package/templates/vertical_crm/vitest.config.ts.tmpl +23 -23
  163. package/templates/vertical_devops/.claude/settings.json.tmpl +36 -36
  164. package/templates/vertical_devops/.claude-plugin/plugin.json.tmpl +23 -23
  165. package/templates/vertical_devops/CLAUDE.md.tmpl +34 -34
  166. package/templates/vertical_devops/README.md.tmpl +27 -27
  167. package/templates/vertical_devops/__tests__/smoke.test.ts.tmpl +37 -37
  168. package/templates/vertical_devops/bin/cli.js.tmpl +100 -100
  169. package/templates/vertical_devops/manifest.json +100 -100
  170. package/templates/vertical_devops/package.json.tmpl +27 -27
  171. package/templates/vertical_devops/runbooks/README.md.tmpl +32 -32
  172. package/templates/vertical_devops/src/agents/escalator.ts.tmpl +19 -19
  173. package/templates/vertical_devops/src/agents/postmortem.ts.tmpl +23 -23
  174. package/templates/vertical_devops/src/agents/responder.ts.tmpl +14 -14
  175. package/templates/vertical_devops/src/agents/runbook-runner.ts.tmpl +17 -17
  176. package/templates/vertical_devops/src/init.ts.tmpl +23 -23
  177. package/templates/vertical_devops/tsconfig.json.tmpl +19 -19
  178. package/templates/vertical_devops/vitest.config.ts.tmpl +23 -23
  179. package/templates/vertical_education/.claude/commands/doctor.md.tmpl +12 -12
  180. package/templates/vertical_education/.claude/commands/mastery-report.md.tmpl +12 -12
  181. package/templates/vertical_education/.claude/settings.json.tmpl +45 -45
  182. package/templates/vertical_education/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  183. package/templates/vertical_education/.claude/skills/teach-next/SKILL.md.tmpl +16 -16
  184. package/templates/vertical_education/.claude-plugin/plugin.json.tmpl +23 -23
  185. package/templates/vertical_education/CLAUDE.md.tmpl +33 -33
  186. package/templates/vertical_education/README.md.tmpl +30 -30
  187. package/templates/vertical_education/__tests__/smoke.test.ts.tmpl +37 -37
  188. package/templates/vertical_education/bin/cli.js.tmpl +100 -100
  189. package/templates/vertical_education/manifest.json +116 -116
  190. package/templates/vertical_education/package.json.tmpl +30 -30
  191. package/templates/vertical_education/src/agents/explainer.ts.tmpl +7 -7
  192. package/templates/vertical_education/src/agents/grader.ts.tmpl +7 -7
  193. package/templates/vertical_education/src/agents/quiz-master.ts.tmpl +7 -7
  194. package/templates/vertical_education/src/agents/tutor.ts.tmpl +7 -7
  195. package/templates/vertical_education/src/init.ts.tmpl +21 -21
  196. package/templates/vertical_education/tsconfig.json.tmpl +19 -19
  197. package/templates/vertical_education/vitest.config.ts.tmpl +23 -23
  198. package/templates/vertical_exotic/.claude/commands/doctor.md.tmpl +12 -12
  199. package/templates/vertical_exotic/.claude/settings.json.tmpl +44 -44
  200. package/templates/vertical_exotic/.claude/skills/evolve/SKILL.md.tmpl +14 -14
  201. package/templates/vertical_exotic/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  202. package/templates/vertical_exotic/.claude-plugin/plugin.json.tmpl +23 -23
  203. package/templates/vertical_exotic/CLAUDE.md.tmpl +31 -31
  204. package/templates/vertical_exotic/README.md.tmpl +29 -29
  205. package/templates/vertical_exotic/__tests__/smoke.test.ts.tmpl +37 -37
  206. package/templates/vertical_exotic/bin/cli.js.tmpl +100 -100
  207. package/templates/vertical_exotic/manifest.json +106 -106
  208. package/templates/vertical_exotic/package.json.tmpl +30 -30
  209. package/templates/vertical_exotic/src/agents/experimenter.ts.tmpl +7 -7
  210. package/templates/vertical_exotic/src/agents/federator.ts.tmpl +7 -7
  211. package/templates/vertical_exotic/src/agents/hypothesizer.ts.tmpl +7 -7
  212. package/templates/vertical_exotic/src/init.ts.tmpl +21 -21
  213. package/templates/vertical_exotic/tsconfig.json.tmpl +19 -19
  214. package/templates/vertical_exotic/vitest.config.ts.tmpl +23 -23
  215. package/templates/vertical_gaming/.claude/commands/design-doc-diff.md.tmpl +13 -13
  216. package/templates/vertical_gaming/.claude/commands/doctor.md.tmpl +12 -12
  217. package/templates/vertical_gaming/.claude/settings.json.tmpl +45 -45
  218. package/templates/vertical_gaming/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  219. package/templates/vertical_gaming/.claude/skills/playtest-recap/SKILL.md.tmpl +16 -16
  220. package/templates/vertical_gaming/.claude-plugin/plugin.json.tmpl +23 -23
  221. package/templates/vertical_gaming/CLAUDE.md.tmpl +33 -33
  222. package/templates/vertical_gaming/README.md.tmpl +30 -30
  223. package/templates/vertical_gaming/__tests__/smoke.test.ts.tmpl +37 -37
  224. package/templates/vertical_gaming/bin/cli.js.tmpl +100 -100
  225. package/templates/vertical_gaming/manifest.json +116 -116
  226. package/templates/vertical_gaming/package.json.tmpl +30 -30
  227. package/templates/vertical_gaming/src/agents/balance-critic.ts.tmpl +7 -7
  228. package/templates/vertical_gaming/src/agents/economy-modeler.ts.tmpl +7 -7
  229. package/templates/vertical_gaming/src/agents/narrative-keeper.ts.tmpl +7 -7
  230. package/templates/vertical_gaming/src/agents/playtest-reader.ts.tmpl +7 -7
  231. package/templates/vertical_gaming/src/init.ts.tmpl +21 -21
  232. package/templates/vertical_gaming/tsconfig.json.tmpl +19 -19
  233. package/templates/vertical_gaming/vitest.config.ts.tmpl +23 -23
  234. package/templates/vertical_health/.claude/commands/doctor.md.tmpl +12 -12
  235. package/templates/vertical_health/.claude/settings.json.tmpl +33 -33
  236. package/templates/vertical_health/.claude/skills/wellness-intake/SKILL.md.tmpl +15 -15
  237. package/templates/vertical_health/.claude-plugin/plugin.json.tmpl +23 -23
  238. package/templates/vertical_health/CLAUDE.md.tmpl +30 -30
  239. package/templates/vertical_health/README.md.tmpl +29 -29
  240. package/templates/vertical_health/__tests__/smoke.test.ts.tmpl +37 -37
  241. package/templates/vertical_health/bin/cli.js.tmpl +100 -100
  242. package/templates/vertical_health/manifest.json +101 -101
  243. package/templates/vertical_health/package.json.tmpl +30 -30
  244. package/templates/vertical_health/src/agents/care-coordinator.ts.tmpl +7 -7
  245. package/templates/vertical_health/src/agents/intake.ts.tmpl +7 -7
  246. package/templates/vertical_health/src/agents/triage.ts.tmpl +7 -7
  247. package/templates/vertical_health/src/init.ts.tmpl +21 -21
  248. package/templates/vertical_health/tsconfig.json.tmpl +19 -19
  249. package/templates/vertical_health/vitest.config.ts.tmpl +23 -23
  250. package/templates/vertical_legal/.claude/settings.json.tmpl +10 -10
  251. package/templates/vertical_legal/.claude-plugin/plugin.json.tmpl +23 -23
  252. package/templates/vertical_legal/CLAUDE.md.tmpl +24 -24
  253. package/templates/vertical_legal/README.md.tmpl +21 -21
  254. package/templates/vertical_legal/__tests__/smoke.test.ts.tmpl +37 -37
  255. package/templates/vertical_legal/bin/cli.js.tmpl +100 -100
  256. package/templates/vertical_legal/manifest.json +90 -90
  257. package/templates/vertical_legal/package.json.tmpl +14 -14
  258. package/templates/vertical_legal/src/agents/citation-checker.ts.tmpl +7 -7
  259. package/templates/vertical_legal/src/agents/redline.ts.tmpl +7 -7
  260. package/templates/vertical_legal/src/agents/risk-rater.ts.tmpl +8 -8
  261. package/templates/vertical_legal/src/init.ts.tmpl +13 -13
  262. package/templates/vertical_legal/tsconfig.json.tmpl +19 -19
  263. package/templates/vertical_legal/vitest.config.ts.tmpl +23 -23
  264. package/templates/vertical_marketing/.claude/commands/doctor.md.tmpl +12 -12
  265. package/templates/vertical_marketing/.claude/settings.json.tmpl +33 -33
  266. package/templates/vertical_marketing/.claude/skills/campaign-brief/SKILL.md.tmpl +13 -13
  267. package/templates/vertical_marketing/.claude-plugin/plugin.json.tmpl +23 -23
  268. package/templates/vertical_marketing/CLAUDE.md.tmpl +30 -30
  269. package/templates/vertical_marketing/README.md.tmpl +29 -29
  270. package/templates/vertical_marketing/__tests__/smoke.test.ts.tmpl +37 -37
  271. package/templates/vertical_marketing/bin/cli.js.tmpl +100 -100
  272. package/templates/vertical_marketing/manifest.json +101 -101
  273. package/templates/vertical_marketing/package.json.tmpl +30 -30
  274. package/templates/vertical_marketing/src/agents/content-creator.ts.tmpl +7 -7
  275. package/templates/vertical_marketing/src/agents/seo-analyst.ts.tmpl +7 -7
  276. package/templates/vertical_marketing/src/agents/strategist.ts.tmpl +7 -7
  277. package/templates/vertical_marketing/src/init.ts.tmpl +21 -21
  278. package/templates/vertical_marketing/tsconfig.json.tmpl +19 -19
  279. package/templates/vertical_marketing/vitest.config.ts.tmpl +23 -23
  280. package/templates/vertical_repo-maintainer/.claude/commands/doctor.md.tmpl +12 -12
  281. package/templates/vertical_repo-maintainer/.claude/commands/release-check.md.tmpl +13 -13
  282. package/templates/vertical_repo-maintainer/.claude/commands/repo-triage.md.tmpl +16 -16
  283. package/templates/vertical_repo-maintainer/.claude/settings.json.tmpl +44 -44
  284. package/templates/vertical_repo-maintainer/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  285. package/templates/vertical_repo-maintainer/.claude/skills/plan-change/SKILL.md.tmpl +15 -15
  286. package/templates/vertical_repo-maintainer/.claude-plugin/plugin.json.tmpl +23 -23
  287. package/templates/vertical_repo-maintainer/CLAUDE.md.tmpl +34 -34
  288. package/templates/vertical_repo-maintainer/README.md.tmpl +30 -30
  289. package/templates/vertical_repo-maintainer/__tests__/smoke.test.ts.tmpl +37 -37
  290. package/templates/vertical_repo-maintainer/bin/cli.js.tmpl +100 -100
  291. package/templates/vertical_repo-maintainer/manifest.json +121 -121
  292. package/templates/vertical_repo-maintainer/package.json.tmpl +30 -30
  293. package/templates/vertical_repo-maintainer/src/agents/benchmarker.ts.tmpl +7 -7
  294. package/templates/vertical_repo-maintainer/src/agents/maintainer.ts.tmpl +7 -7
  295. package/templates/vertical_repo-maintainer/src/agents/release.ts.tmpl +7 -7
  296. package/templates/vertical_repo-maintainer/src/agents/security.ts.tmpl +7 -7
  297. package/templates/vertical_repo-maintainer/src/init.ts.tmpl +21 -21
  298. package/templates/vertical_repo-maintainer/tsconfig.json.tmpl +19 -19
  299. package/templates/vertical_repo-maintainer/vitest.config.ts.tmpl +23 -23
  300. package/templates/vertical_research/.claude/settings.json.tmpl +9 -9
  301. package/templates/vertical_research/.claude-plugin/plugin.json.tmpl +23 -23
  302. package/templates/vertical_research/CLAUDE.md.tmpl +33 -33
  303. package/templates/vertical_research/README.md.tmpl +17 -17
  304. package/templates/vertical_research/__tests__/smoke.test.ts.tmpl +37 -37
  305. package/templates/vertical_research/bin/cli.js.tmpl +100 -100
  306. package/templates/vertical_research/manifest.json +105 -105
  307. package/templates/vertical_research/package.json.tmpl +14 -14
  308. package/templates/vertical_research/src/agents/citer.ts.tmpl +8 -8
  309. package/templates/vertical_research/src/agents/fact-checker.ts.tmpl +8 -8
  310. package/templates/vertical_research/src/agents/scout.ts.tmpl +7 -7
  311. package/templates/vertical_research/src/agents/source-grader.ts.tmpl +10 -10
  312. package/templates/vertical_research/src/agents/synthesizer.ts.tmpl +8 -8
  313. package/templates/vertical_research/src/agents/web-searcher.ts.tmpl +6 -6
  314. package/templates/vertical_research/src/init.ts.tmpl +13 -13
  315. package/templates/vertical_research/tsconfig.json.tmpl +19 -19
  316. package/templates/vertical_research/vitest.config.ts.tmpl +23 -23
  317. package/templates/vertical_ruview/.claude/commands/doctor.md.tmpl +12 -12
  318. package/templates/vertical_ruview/.claude/settings.json.tmpl +33 -33
  319. package/templates/vertical_ruview/.claude/skills/index-and-ask/SKILL.md.tmpl +15 -15
  320. package/templates/vertical_ruview/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  321. package/templates/vertical_ruview/.claude-plugin/plugin.json.tmpl +23 -23
  322. package/templates/vertical_ruview/CLAUDE.md.tmpl +31 -31
  323. package/templates/vertical_ruview/README.md.tmpl +29 -29
  324. package/templates/vertical_ruview/__tests__/smoke.test.ts.tmpl +37 -37
  325. package/templates/vertical_ruview/bin/cli.js.tmpl +100 -100
  326. package/templates/vertical_ruview/manifest.json +106 -106
  327. package/templates/vertical_ruview/package.json.tmpl +30 -30
  328. package/templates/vertical_ruview/src/agents/indexer.ts.tmpl +7 -7
  329. package/templates/vertical_ruview/src/agents/retriever.ts.tmpl +7 -7
  330. package/templates/vertical_ruview/src/agents/reviewer.ts.tmpl +7 -7
  331. package/templates/vertical_ruview/src/init.ts.tmpl +21 -21
  332. package/templates/vertical_ruview/tsconfig.json.tmpl +19 -19
  333. package/templates/vertical_ruview/vitest.config.ts.tmpl +23 -23
  334. package/templates/vertical_sales/.claude/commands/doctor.md.tmpl +12 -12
  335. package/templates/vertical_sales/.claude/commands/pipeline-report.md.tmpl +13 -13
  336. package/templates/vertical_sales/.claude/settings.json.tmpl +45 -45
  337. package/templates/vertical_sales/.claude/skills/memory-inspect/SKILL.md.tmpl +14 -14
  338. package/templates/vertical_sales/.claude/skills/qualify-lead/SKILL.md.tmpl +15 -15
  339. package/templates/vertical_sales/.claude-plugin/plugin.json.tmpl +23 -23
  340. package/templates/vertical_sales/CLAUDE.md.tmpl +33 -33
  341. package/templates/vertical_sales/README.md.tmpl +30 -30
  342. package/templates/vertical_sales/__tests__/smoke.test.ts.tmpl +37 -37
  343. package/templates/vertical_sales/bin/cli.js.tmpl +100 -100
  344. package/templates/vertical_sales/manifest.json +116 -116
  345. package/templates/vertical_sales/package.json.tmpl +30 -30
  346. package/templates/vertical_sales/src/agents/closer.ts.tmpl +7 -7
  347. package/templates/vertical_sales/src/agents/demo-coach.ts.tmpl +7 -7
  348. package/templates/vertical_sales/src/agents/prospector.ts.tmpl +7 -7
  349. package/templates/vertical_sales/src/agents/qualifier.ts.tmpl +7 -7
  350. package/templates/vertical_sales/src/init.ts.tmpl +21 -21
  351. package/templates/vertical_sales/tsconfig.json.tmpl +19 -19
  352. package/templates/vertical_sales/vitest.config.ts.tmpl +23 -23
  353. package/templates/vertical_support/.claude/settings.json.tmpl +25 -25
  354. package/templates/vertical_support/.claude-plugin/plugin.json.tmpl +23 -23
  355. package/templates/vertical_support/CLAUDE.md.tmpl +34 -34
  356. package/templates/vertical_support/README.md.tmpl +16 -16
  357. package/templates/vertical_support/__tests__/smoke.test.ts.tmpl +37 -37
  358. package/templates/vertical_support/bin/cli.js.tmpl +100 -100
  359. package/templates/vertical_support/kb/README.md.tmpl +23 -23
  360. package/templates/vertical_support/manifest.json +100 -100
  361. package/templates/vertical_support/package.json.tmpl +25 -25
  362. package/templates/vertical_support/src/agents/escalator.ts.tmpl +6 -6
  363. package/templates/vertical_support/src/agents/kb-searcher.ts.tmpl +6 -6
  364. package/templates/vertical_support/src/agents/responder.ts.tmpl +7 -7
  365. package/templates/vertical_support/src/agents/triager.ts.tmpl +6 -6
  366. package/templates/vertical_support/src/init.ts.tmpl +16 -16
  367. package/templates/vertical_support/tsconfig.json.tmpl +19 -19
  368. package/templates/vertical_support/vitest.config.ts.tmpl +23 -23
  369. package/templates/vertical_trading/.claude/settings.json.tmpl +20 -20
  370. package/templates/vertical_trading/.claude-plugin/plugin.json.tmpl +23 -23
  371. package/templates/vertical_trading/CLAUDE.md.tmpl +24 -24
  372. package/templates/vertical_trading/README.md.tmpl +17 -17
  373. package/templates/vertical_trading/__tests__/smoke.test.ts.tmpl +37 -37
  374. package/templates/vertical_trading/bin/cli.js.tmpl +100 -100
  375. package/templates/vertical_trading/manifest.json +100 -100
  376. package/templates/vertical_trading/package.json.tmpl +14 -14
  377. package/templates/vertical_trading/src/agents/executor.ts.tmpl +8 -8
  378. package/templates/vertical_trading/src/agents/market-watcher.ts.tmpl +7 -7
  379. package/templates/vertical_trading/src/agents/postmortem.ts.tmpl +8 -8
  380. package/templates/vertical_trading/src/agents/risk-checker.ts.tmpl +11 -11
  381. package/templates/vertical_trading/src/agents/signal-gen.ts.tmpl +8 -8
  382. package/templates/vertical_trading/src/init.ts.tmpl +20 -20
  383. package/templates/vertical_trading/tsconfig.json.tmpl +19 -19
  384. package/templates/vertical_trading/vitest.config.ts.tmpl +23 -23
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 RuvNet (https://ruv.io)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RuvNet (https://ruv.io)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,81 +1,118 @@
1
- # metaharness
2
-
3
- Scaffold your own focused AI agent harness — like [ruflo](https://github.com/ruvnet/ruflo), uniquely yours.
4
-
5
- > **Proven at the cost-Pareto frontier.** Same "evolve the harness" thesis, measured: the Darwin harness resolves
6
- > real **SWE-bench Lite** issues at **34.0%** single-trajectory (~$0.005/inst) and **39.7%** Best-of-3
7
- > (~$0.015/inst) — conformant, official harness. Live
8
- > **[Cost–Performance leaderboard](https://ruvnet.github.io/agent-harness-generator/cost-pareto.html)** ·
9
- > [`@metaharness/darwin`](https://www.npmjs.com/package/@metaharness/darwin).
10
-
11
- > Published as **`metaharness`** (the `metaharness` and `harness` CLIs). Earlier versions were published as `create-agent-harness`.
12
-
13
- ## Quick start
1
+ # metaharness
2
+
3
+ Scaffold your own focused AI agent harness — like [ruflo](https://github.com/ruvnet/ruflo), uniquely yours.
4
+
5
+ > **Proven at the cost-Pareto frontier.** Same "evolve the harness" thesis, measured: the Darwin harness resolves
6
+ > real **SWE-bench Lite** issues at **34.0%** single-trajectory (~$0.005/inst) and **39.7%** Best-of-3
7
+ > (~$0.015/inst) — conformant, official harness. Live
8
+ > **[Cost–Performance leaderboard](https://ruvnet.github.io/agent-harness-generator/cost-pareto.html)** ·
9
+ > [`@metaharness/darwin`](https://www.npmjs.com/package/@metaharness/darwin).
10
+
11
+ > Published as **`metaharness`** (the `metaharness` and `harness` CLIs). Earlier versions were published as `create-agent-harness`.
12
+
13
+ ## Quick start
14
+
15
+ ```bash
16
+ npx metaharness my-bot
17
+ ```
18
+
19
+ You'll be prompted for template, host, description. Out comes a complete npm package ready to `npm publish`.
20
+
21
+ ## Non-interactive
22
+
23
+ ```bash
24
+ npx metaharness my-legal-bot \
25
+ --template vertical:legal \
26
+ --host claude-code \
27
+ --description "Contract redline + risk rating"
28
+ ```
29
+
30
+ ## Templates
31
+
32
+ | Template | Best for |
33
+ |---|---|
34
+ | `minimal` | Custom starter — kernel only |
35
+ | `vertical:devops` | Incident response, on-call workflows |
36
+ | `vertical:support` | Customer support, KB-RAG, escalation |
37
+ | `vertical:trading` | Quant trading (paper-default, circuit breakers) |
38
+ | `vertical:legal` | Contract review with citation checking |
39
+ | `vertical:research` | Multi-source dossier with evidence grading |
40
+
41
+ ## Hosts
42
+
43
+ `--host` selects which host adapter ships with your harness:
44
+
45
+ | Host | What you get |
46
+ |---|---|
47
+ | `claude-code` | `.claude/settings.json` with MCP + hooks |
48
+ | `codex` | `~/.codex/config.toml` with `[mcp_servers.*]` |
49
+ | `pi-dev` | Pi extension (TypeScript, no MCP by design) |
50
+ | `hermes` | `cli-config.yaml` + `optional-mcps/*.yaml` |
51
+ | `openclaw` | `~/.openclaw/openclaw.json` + workspace SKILL.md + install runbook |
52
+ | `rvm` | RVM partition manifest + capability table + wasm-guest + install runbook (hardware-isolated) |
53
+
54
+ Multi-host: pass `--host` multiple times.
55
+
56
+ ## Also ships the `harness` CLI
57
+
58
+ ```bash
59
+ harness sign # produce/update the witness manifest
60
+ harness verify # check signature
61
+ harness doctor # smoke-check a scaffolded harness
62
+ harness score # runtime-readiness badges for a local repo
63
+ harness help
64
+ ```
65
+
66
+ ### `harness score` vs `metaharness score` — two different scorecards (#15)
67
+
68
+ The two CLIs both accept `score` but emit **different, purpose-specific JSON** — so check the schema
69
+ discriminator before parsing:
70
+
71
+ | Command | Purpose | JSON discriminator |
72
+ |---|---|---|
73
+ | `harness score <dir> --json` | Runtime-readiness **badges** (score + mcpRisk / releaseReady / testsDetected / sbom / witnessSigned) | `"schema": "harness-quickcheck-v1"` (string) |
74
+ | `metaharness score <dir> --json` | 5-dimension harness-fit **scorecard** (harnessFit / compileConfidence / …) | `"schema": 1` (number) |
75
+
76
+ They are **not interchangeable**. A consumer wiring one into a pipeline expecting the other should
77
+ branch on `schema` (`typeof out.schema === 'string'` ⇒ harness badges; `=== 1` ⇒ metaharness
78
+ scorecard) and refuse the wrong shape rather than silently defaulting missing fields to `0`.
79
+
80
+ ## Optional Cognitum Meta-Proxy sidecar
81
+
82
+ Meta-Proxy is an optional local Rust sidecar, not an npm dependency and not part
83
+ of normal harness scaffolding. Install it only when you want a locally bound,
84
+ Claude-compatible routing endpoint with Meta-Proxy's own Cognitum OAuth flow:
14
85
 
15
86
  ```bash
16
- npx metaharness my-bot
87
+ npx metaharness proxy install --yes # signed v0.3.0 download; checksum + Ed25519 verified
88
+ npx metaharness proxy login # browser or headless Cognitum OAuth, owned by Meta-Proxy
89
+ npx metaharness proxy start
90
+ npx metaharness proxy status
17
91
  ```
18
92
 
19
- You'll be prompted for template, host, description. Out comes a complete npm package ready to `npm publish`.
20
-
21
- ## Non-interactive
22
-
23
- ```bash
24
- npx metaharness my-legal-bot \
25
- --template vertical:legal \
26
- --host claude-code \
27
- --description "Contract redline + risk rating"
28
- ```
29
-
30
- ## Templates
31
-
32
- | Template | Best for |
33
- |---|---|
34
- | `minimal` | Custom starter — kernel only |
35
- | `vertical:devops` | Incident response, on-call workflows |
36
- | `vertical:support` | Customer support, KB-RAG, escalation |
37
- | `vertical:trading` | Quant trading (paper-default, circuit breakers) |
38
- | `vertical:legal` | Contract review with citation checking |
39
- | `vertical:research` | Multi-source dossier with evidence grading |
40
-
41
- ## Hosts
42
-
43
- `--host` selects which host adapter ships with your harness:
44
-
45
- | Host | What you get |
46
- |---|---|
47
- | `claude-code` | `.claude/settings.json` with MCP + hooks |
48
- | `codex` | `~/.codex/config.toml` with `[mcp_servers.*]` |
49
- | `pi-dev` | Pi extension (TypeScript, no MCP by design) |
50
- | `hermes` | `cli-config.yaml` + `optional-mcps/*.yaml` |
51
- | `openclaw` | `~/.openclaw/openclaw.json` + workspace SKILL.md + install runbook |
52
- | `rvm` | RVM partition manifest + capability table + wasm-guest + install runbook (hardware-isolated) |
93
+ `proxy install` downloads the platform archive from the public
94
+ [`meta-proxy-dist`](https://github.com/cognitum-one/meta-proxy-dist) release
95
+ channel only after explicit `--yes` consent. The CLI verifies the signed
96
+ `SHA256SUMS` manifest against a public key pinned in MetaHarness before it
97
+ extracts or replaces a binary. The sidecar is installed under
98
+ `~/.metaharness/meta-proxy/`; credentials remain in Meta-Proxy's own storage.
53
99
 
54
- Multi-host: pass `--host` multiple times.
55
-
56
- ## Also ships the `harness` CLI
57
-
58
- ```bash
59
- harness sign # produce/update the witness manifest
60
- harness verify # check signature
61
- harness doctor # smoke-check a scaffolded harness
62
- harness help
63
- ```
100
+ Other commands: `proxy stop`, `proxy path`, and `proxy logout`.
64
101
 
65
102
  ## Eject from ruflo
66
-
67
- If you've been using ruflo and want your own focused harness from it:
68
-
69
- ```bash
70
- npx metaharness --from-existing ./
71
- ```
72
-
73
- Lifts agents/skills/commands, rewrites every `ruflo` / `claude-flow` reference, preserves attribution blocks marked with `<!-- ruflo-attribution-block -->`.
74
-
75
- ## Full walkthrough
76
-
77
- See [USAGE.md](https://github.com/ruvnet/agent-harness-generator/blob/main/docs/USAGE.md).
78
-
79
- ## License
80
-
81
- MIT
103
+
104
+ If you've been using ruflo and want your own focused harness from it:
105
+
106
+ ```bash
107
+ npx metaharness --from-existing ./
108
+ ```
109
+
110
+ Lifts agents/skills/commands, rewrites every `ruflo` / `claude-flow` reference, preserves attribution blocks marked with `<!-- ruflo-attribution-block -->`.
111
+
112
+ ## Full walkthrough
113
+
114
+ See [USAGE.md](https://github.com/ruvnet/agent-harness-generator/blob/main/docs/USAGE.md).
115
+
116
+ ## License
117
+
118
+ MIT
package/dist/bin.js CHANGED
File without changes
@@ -34,107 +34,107 @@ const SECRETS_SUBSUBS = ['check', 'fetch', 'validate-token', 'help'];
34
34
  const MCP_SUBSUBS = ['ls', 'invoke', 'help'];
35
35
  const FEDERATE_SUBSUBS = ['init', 'add', 'remove', 'list', 'status', 'help'];
36
36
  function bashCompletion() {
37
- return `# bash completion for harness
38
- _harness_completion() {
39
- local cur prev cmd
40
- COMPREPLY=()
41
- cur="\${COMP_WORDS[COMP_CWORD]}"
42
- prev="\${COMP_WORDS[COMP_CWORD-1]}"
43
- cmd="\${COMP_WORDS[1]:-}"
44
-
45
- # Top-level subcommands
46
- if [ $COMP_CWORD -eq 1 ]; then
47
- COMPREPLY=( $(compgen -W "${SUBCOMMANDS.join(' ')}" -- "$cur") )
48
- return 0
49
- fi
50
-
51
- case "$cmd" in
52
- secrets)
53
- [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${SECRETS_SUBSUBS.join(' ')}" -- "$cur") )
54
- ;;
55
- mcp)
56
- [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${MCP_SUBSUBS.join(' ')}" -- "$cur") )
57
- ;;
58
- federate)
59
- [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${FEDERATE_SUBSUBS.join(' ')}" -- "$cur") )
60
- ;;
61
- completions)
62
- [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "bash zsh fish" -- "$cur") )
63
- ;;
64
- esac
65
- return 0
66
- }
67
- complete -F _harness_completion harness
37
+ return `# bash completion for harness
38
+ _harness_completion() {
39
+ local cur prev cmd
40
+ COMPREPLY=()
41
+ cur="\${COMP_WORDS[COMP_CWORD]}"
42
+ prev="\${COMP_WORDS[COMP_CWORD-1]}"
43
+ cmd="\${COMP_WORDS[1]:-}"
44
+
45
+ # Top-level subcommands
46
+ if [ $COMP_CWORD -eq 1 ]; then
47
+ COMPREPLY=( $(compgen -W "${SUBCOMMANDS.join(' ')}" -- "$cur") )
48
+ return 0
49
+ fi
50
+
51
+ case "$cmd" in
52
+ secrets)
53
+ [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${SECRETS_SUBSUBS.join(' ')}" -- "$cur") )
54
+ ;;
55
+ mcp)
56
+ [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${MCP_SUBSUBS.join(' ')}" -- "$cur") )
57
+ ;;
58
+ federate)
59
+ [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "${FEDERATE_SUBSUBS.join(' ')}" -- "$cur") )
60
+ ;;
61
+ completions)
62
+ [ $COMP_CWORD -eq 2 ] && COMPREPLY=( $(compgen -W "bash zsh fish" -- "$cur") )
63
+ ;;
64
+ esac
65
+ return 0
66
+ }
67
+ complete -F _harness_completion harness
68
68
  `;
69
69
  }
70
70
  function zshCompletion() {
71
- return `#compdef harness
72
- # zsh completion for harness
73
-
74
- _harness() {
75
- local -a subcommands
76
- subcommands=(
77
- 'sign:produce or update the witness manifest'
78
- 'verify:verify the witness manifest signature'
79
- 'doctor:smoke-check a scaffolded harness'
80
- 'federate:manage federation peers (init/add/remove/list/status)'
81
- 'secrets:GCP Secret Manager: check / fetch / validate-token'
82
- 'validate:umbrella: doctor + verify + path-guard + mcp + secrets'
83
- 'mcp:list MCP servers / dispatch a tool through the claim check'
84
- 'publish:pin the harness manifest to IPFS via Pinata (dry-run default)'
85
- 'upgrade:re-render template + drift plan (--apply to apply)'
86
- 'completions:emit shell completion scripts (bash/zsh/fish)'
87
- 'sbom:emit SPDX-2.3 SBOM for the harness'
88
- 'audit:npm audit per-harness with structured output'
89
- 'mcp-scan:security-scan the harness MCP surface (policy + perms + deps)'
90
- 'analyze-repo:recommend a harness from a local repo'
91
- 'diag:kernel-version skew check (ADR-027 diagnostic)'
92
- 'export-config:emit MCP servers + claims + permissions as a single JSON'
93
- 'compare:diff two harnesses (manifest + per-file fingerprints, ADR-031 --bundle)'
94
- 'genome:7-section readiness scorecard for a local repo (--json/--bundle, iter 110)'
95
- 'score:5-dimension harness scorecard 0–100 with badges (--json/--bundle, iter 111)'
96
- 'threat-model:MCP threat-model artifact for PR/compliance review (--json/--bundle, iter 112)'
97
- 'oia-manifest:emit .harness/oia-manifest.json — OIA v0.1 layer alignment (ADR-034, iter 121)'
98
- 'help:show help'
99
- )
100
-
101
- if (( CURRENT == 2 )); then
102
- _describe -t commands 'harness command' subcommands
103
- return
104
- fi
105
-
106
- case "$words[2]" in
107
- secrets)
108
- (( CURRENT == 3 )) && compadd ${SECRETS_SUBSUBS.join(' ')}
109
- ;;
110
- mcp)
111
- (( CURRENT == 3 )) && compadd ${MCP_SUBSUBS.join(' ')}
112
- ;;
113
- federate)
114
- (( CURRENT == 3 )) && compadd ${FEDERATE_SUBSUBS.join(' ')}
115
- ;;
116
- completions)
117
- (( CURRENT == 3 )) && compadd bash zsh fish
118
- ;;
119
- esac
120
- }
121
-
122
- _harness "$@"
71
+ return `#compdef harness
72
+ # zsh completion for harness
73
+
74
+ _harness() {
75
+ local -a subcommands
76
+ subcommands=(
77
+ 'sign:produce or update the witness manifest'
78
+ 'verify:verify the witness manifest signature'
79
+ 'doctor:smoke-check a scaffolded harness'
80
+ 'federate:manage federation peers (init/add/remove/list/status)'
81
+ 'secrets:GCP Secret Manager: check / fetch / validate-token'
82
+ 'validate:umbrella: doctor + verify + path-guard + mcp + secrets'
83
+ 'mcp:list MCP servers / dispatch a tool through the claim check'
84
+ 'publish:pin the harness manifest to IPFS via Pinata (dry-run default)'
85
+ 'upgrade:re-render template + drift plan (--apply to apply)'
86
+ 'completions:emit shell completion scripts (bash/zsh/fish)'
87
+ 'sbom:emit SPDX-2.3 SBOM for the harness'
88
+ 'audit:npm audit per-harness with structured output'
89
+ 'mcp-scan:security-scan the harness MCP surface (policy + perms + deps)'
90
+ 'analyze-repo:recommend a harness from a local repo'
91
+ 'diag:kernel-version skew check (ADR-027 diagnostic)'
92
+ 'export-config:emit MCP servers + claims + permissions as a single JSON'
93
+ 'compare:diff two harnesses (manifest + per-file fingerprints, ADR-031 --bundle)'
94
+ 'genome:7-section readiness scorecard for a local repo (--json/--bundle, iter 110)'
95
+ 'score:5-dimension harness scorecard 0–100 with badges (--json/--bundle, iter 111)'
96
+ 'threat-model:MCP threat-model artifact for PR/compliance review (--json/--bundle, iter 112)'
97
+ 'oia-manifest:emit .harness/oia-manifest.json — OIA v0.1 layer alignment (ADR-034, iter 121)'
98
+ 'help:show help'
99
+ )
100
+
101
+ if (( CURRENT == 2 )); then
102
+ _describe -t commands 'harness command' subcommands
103
+ return
104
+ fi
105
+
106
+ case "$words[2]" in
107
+ secrets)
108
+ (( CURRENT == 3 )) && compadd ${SECRETS_SUBSUBS.join(' ')}
109
+ ;;
110
+ mcp)
111
+ (( CURRENT == 3 )) && compadd ${MCP_SUBSUBS.join(' ')}
112
+ ;;
113
+ federate)
114
+ (( CURRENT == 3 )) && compadd ${FEDERATE_SUBSUBS.join(' ')}
115
+ ;;
116
+ completions)
117
+ (( CURRENT == 3 )) && compadd bash zsh fish
118
+ ;;
119
+ esac
120
+ }
121
+
122
+ _harness "$@"
123
123
  `;
124
124
  }
125
125
  function fishCompletion() {
126
126
  const subs = SUBCOMMANDS.map(s => `complete -c harness -f -n '__fish_use_subcommand' -a ${s}`).join('\n');
127
- return `# fish completion for harness
128
- ${subs}
129
-
130
- # secrets sub-subs
131
- complete -c harness -f -n '__fish_seen_subcommand_from secrets' -a '${SECRETS_SUBSUBS.join(' ')}'
132
- # mcp sub-subs
133
- complete -c harness -f -n '__fish_seen_subcommand_from mcp' -a '${MCP_SUBSUBS.join(' ')}'
134
- # federate sub-subs
135
- complete -c harness -f -n '__fish_seen_subcommand_from federate' -a '${FEDERATE_SUBSUBS.join(' ')}'
136
- # completions sub-subs
137
- complete -c harness -f -n '__fish_seen_subcommand_from completions' -a 'bash zsh fish'
127
+ return `# fish completion for harness
128
+ ${subs}
129
+
130
+ # secrets sub-subs
131
+ complete -c harness -f -n '__fish_seen_subcommand_from secrets' -a '${SECRETS_SUBSUBS.join(' ')}'
132
+ # mcp sub-subs
133
+ complete -c harness -f -n '__fish_seen_subcommand_from mcp' -a '${MCP_SUBSUBS.join(' ')}'
134
+ # federate sub-subs
135
+ complete -c harness -f -n '__fish_seen_subcommand_from federate' -a '${FEDERATE_SUBSUBS.join(' ')}'
136
+ # completions sub-subs
137
+ complete -c harness -f -n '__fish_seen_subcommand_from completions' -a 'bash zsh fish'
138
138
  `;
139
139
  }
140
140
  export function completionsCmd(args) {
package/dist/diag.d.ts CHANGED
@@ -7,6 +7,8 @@ export type SubcommandResult = {
7
7
  /** Compute the skew verdict between two semvers. */
8
8
  export type SkewVerdict = 'match' | 'patch-diff' | 'minor-diff' | 'major-diff' | 'unparseable';
9
9
  export declare function skewVerdict(manifestVer: string | undefined, localVer: string | undefined): SkewVerdict;
10
+ /** GH #22: the kernel backend that actually answered on this machine. */
11
+ export type KernelBackendTier = 'native' | 'wasm' | 'js';
10
12
  export interface DiagReport {
11
13
  dir: string;
12
14
  surface: string | undefined;
@@ -17,6 +19,12 @@ export interface DiagReport {
17
19
  manifestGeneratorVersion: string | undefined;
18
20
  localGeneratorVersion: string | undefined;
19
21
  generatorVerdict: SkewVerdict;
22
+ kernelBackend: KernelBackendTier | undefined;
23
+ requestedBackend: string | null;
24
+ backendReasons: {
25
+ native?: string;
26
+ wasm?: string;
27
+ };
20
28
  }
21
29
  export declare function buildDiagReport(harnessDir: string): Promise<DiagReport>;
22
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"diag.d.ts","sourceRoot":"","sources":["../src/diag.ts"],"names":[],"mappings":"AAuBA;uEACuE;AACvE,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAejE,oDAAoD;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AAE/F,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAStG;AAiED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAO/B,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,WAAW,CAAC;CAC/B;AAED,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA2C7E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAgErE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAQzE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IACF,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC;IAC7D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,GAAG,EAAE;QACH,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAgBD,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA8DnF;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuBvE"}
1
+ {"version":3,"file":"diag.d.ts","sourceRoot":"","sources":["../src/diag.ts"],"names":[],"mappings":"AAwBA;uEACuE;AACvE,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAejE,oDAAoD;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AAE/F,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAStG;AAED,yEAAyE;AACzE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;AA6HzD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAO/B,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,WAAW,CAAC;IAK9B,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA+C7E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAiFrE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAQzE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IACF,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC;IAC7D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,GAAG,EAAE;QACH,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAWD,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA8DnF;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuBvE"}
package/dist/diag.js CHANGED
@@ -19,7 +19,8 @@ import { createRequire } from 'node:module';
19
19
  import { readFile } from 'node:fs/promises';
20
20
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
21
21
  import { dirname, join, resolve } from 'node:path';
22
- import { fileURLToPath } from 'node:url';
22
+ import { fileURLToPath, pathToFileURL } from 'node:url';
23
+ import { redactSecretsDeep } from './redact.js';
23
24
  const __dirname = dirname(fileURLToPath(import.meta.url));
24
25
  /**
25
26
  * Parse "X.Y.Z[-pre]" into a tuple. Returns null on unrecognised input
@@ -47,6 +48,58 @@ export function skewVerdict(manifestVer, localVer) {
47
48
  return 'patch-diff';
48
49
  return 'match';
49
50
  }
51
+ /**
52
+ * GH #22: resolve WHICH kernel backend the harness actually loads on this
53
+ * machine (native > wasm > js), the backend explicitly requested via
54
+ * METAHARNESS_KERNEL_BACKEND (if any), and the reason each higher tier was
55
+ * unavailable. The version diagnostic above answers "is the kernel the right
56
+ * VERSION?"; this answers "am I getting the FAST kernel, and if not, why not?"
57
+ * — the #1 support question after version skew (silent js fallback, GH #22).
58
+ *
59
+ * Never throws — consistent with the rest of diag. Two ways the fast path is
60
+ * absent are BOTH captured: (a) auto mode fell through to js → `kernelDiagnostics`
61
+ * carries the per-tier reasons; (b) a specific backend was REQUESTED but can't
62
+ * load → `loadKernel` throws, and we surface that throw under the requested tier
63
+ * (that throw message IS the diagnostic the operator asked for).
64
+ */
65
+ async function resolveKernelBackend(harnessDir) {
66
+ const requested = (process.env.METAHARNESS_KERNEL_BACKEND || '').trim().toLowerCase() || null;
67
+ const entry = resolveKernelEntry(harnessDir);
68
+ if (!entry)
69
+ return { backend: undefined, requested, reasons: {} };
70
+ try {
71
+ const mod = (await import(pathToFileURL(entry).href));
72
+ if (typeof mod.kernelDiagnostics === 'function') {
73
+ const d = await mod.kernelDiagnostics();
74
+ return { backend: d.resolved, requested: d.requested ?? requested, reasons: d.reasons ?? {} };
75
+ }
76
+ // Kernel present but predates kernelDiagnostics() (GH #22) — can't report the backend.
77
+ return { backend: undefined, requested, reasons: {} };
78
+ }
79
+ catch (e) {
80
+ // A REQUESTED-but-unavailable backend makes loadKernel throw — capture that
81
+ // reason under the requested tier so the operator sees exactly why.
82
+ const reasons = {};
83
+ if (requested === 'native' || requested === 'wasm')
84
+ reasons[requested] = e.message;
85
+ return { backend: undefined, requested, reasons };
86
+ }
87
+ }
88
+ /**
89
+ * Resolve the @metaharness/kernel entry module the same way we resolve its
90
+ * version — from the harness's own node_modules first, then the workspace
91
+ * checkout — so the reported backend matches the kernel the harness loads.
92
+ */
93
+ function resolveKernelEntry(harnessDir) {
94
+ try {
95
+ const require = createRequire(join(harnessDir, 'package.json'));
96
+ return require.resolve('@metaharness/kernel');
97
+ }
98
+ catch {
99
+ const wsEntry = resolve(__dirname, '..', '..', 'kernel-js', 'dist', 'index.js');
100
+ return existsSync(wsEntry) ? wsEntry : undefined;
101
+ }
102
+ }
50
103
  /**
51
104
  * Resolve the locally-installed @metaharness/kernel version. Uses createRequire
52
105
  * so it follows real Node resolution from the harness's package.json. We
@@ -135,6 +188,7 @@ export async function buildDiagReport(harnessDir) {
135
188
  const verdict = skewVerdict(manifestKernelVersion, localKernelVersion);
136
189
  const localGeneratorVersion = resolveLocalGeneratorVersion();
137
190
  const generatorVerdict = skewVerdict(manifestGeneratorVersion, localGeneratorVersion);
191
+ const kb = await resolveKernelBackend(harnessDir);
138
192
  let actionable;
139
193
  if (verdict === 'major-diff') {
140
194
  actionable = `Run: npm install @metaharness/kernel@${manifestKernelVersion} (major skew — APIs may break)`;
@@ -158,6 +212,9 @@ export async function buildDiagReport(harnessDir) {
158
212
  manifestGeneratorVersion,
159
213
  localGeneratorVersion,
160
214
  generatorVerdict,
215
+ kernelBackend: kb.backend,
216
+ requestedBackend: kb.requested,
217
+ backendReasons: kb.reasons,
161
218
  };
162
219
  }
163
220
  /**
@@ -177,6 +234,23 @@ export function formatDiagReport(report) {
177
234
  lines.push(` surface: ${report.surface ?? '(unknown — pre-iter-56 manifest)'}`);
178
235
  lines.push(` manifest kernel: ${report.manifestKernelVersion ?? '(unset — pre-iter-58 manifest)'}`);
179
236
  lines.push(` installed kernel: ${report.localKernelVersion ?? '(not installed)'}`);
237
+ // GH #22: which backend actually answers + (if a specific one was requested) that request.
238
+ const reqSuffix = report.requestedBackend ? ` [requested: ${report.requestedBackend}]` : '';
239
+ // When no backend resolved, the reason differs: a REQUESTED tier that threw
240
+ // (kernel is installed, that tier just isn't) vs. the kernel not resolving at all.
241
+ const unresolvedLabel = report.requestedBackend
242
+ ? '(requested backend unavailable — see below)'
243
+ : '(not loadable — kernel not installed?)';
244
+ lines.push(` kernel backend: ${report.kernelBackend ?? unresolvedLabel}${reqSuffix}`);
245
+ // GH #22: WHY the faster tiers didn't answer — the whole point of the issue
246
+ // (a silent js fallback with no explanation). Only show a tier that failed
247
+ // AND isn't the one that ended up answering.
248
+ if (report.backendReasons.native && report.kernelBackend !== 'native') {
249
+ lines.push(` native unavailable — ${report.backendReasons.native}`);
250
+ }
251
+ if (report.backendReasons.wasm && report.kernelBackend !== 'wasm') {
252
+ lines.push(` wasm unavailable — ${report.backendReasons.wasm}`);
253
+ }
180
254
  lines.push(` manifest generator: ${report.manifestGeneratorVersion ?? '(unset)'}`);
181
255
  lines.push(` installed generator: ${report.localGeneratorVersion ?? '(not installed)'}`);
182
256
  lines.push('');
@@ -248,21 +322,11 @@ export function formatDiagReportJson(report) {
248
322
  };
249
323
  }
250
324
  const REDACT_KEY_RE = /^(secret|token|key|password|api[-_]?key)/i;
325
+ // GH #4 (HIGH-2): redact by KEY name AND by VALUE shape — a secret-shaped value in a non-secret-named
326
+ // field (e.g. a token pasted into a `vars` entry) must not survive into a bundle a user pastes into an
327
+ // issue. Value-aware detection lives in redact.ts (single source of truth, finding #7).
251
328
  function sanitiseManifest(m) {
252
- if (m === null || typeof m !== 'object')
253
- return m;
254
- if (Array.isArray(m))
255
- return m.map(sanitiseManifest);
256
- const out = {};
257
- for (const [k, v] of Object.entries(m)) {
258
- if (REDACT_KEY_RE.test(k))
259
- out[k] = '<redacted>';
260
- else if (typeof v === 'string' && REDACT_KEY_RE.test(k))
261
- out[k] = '<redacted>';
262
- else
263
- out[k] = sanitiseManifest(v);
264
- }
265
- return out;
329
+ return redactSecretsDeep(m, { keyRe: REDACT_KEY_RE, replacement: '<redacted>' });
266
330
  }
267
331
  export async function buildSupportBundle(harnessDir) {
268
332
  const report = await buildDiagReport(harnessDir);