@dommaker/harness 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +4 -2
  3. package/dist/cli/commands/check.js +3 -3
  4. package/dist/cli/commands/check.js.map +1 -1
  5. package/dist/cli/commands/constraints-disable.d.ts +48 -0
  6. package/dist/cli/commands/constraints-disable.d.ts.map +1 -0
  7. package/dist/cli/commands/constraints-disable.js +156 -0
  8. package/dist/cli/commands/constraints-disable.js.map +1 -0
  9. package/dist/cli/commands/constraints-pack-proposal.d.ts +1 -1
  10. package/dist/cli/commands/constraints-pack-proposal.js +1 -1
  11. package/dist/cli/commands/constraints-reactivate.d.ts.map +1 -1
  12. package/dist/cli/commands/constraints-reactivate.js +4 -2
  13. package/dist/cli/commands/constraints-reactivate.js.map +1 -1
  14. package/dist/cli/commands/constraints-retire.d.ts +14 -4
  15. package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
  16. package/dist/cli/commands/constraints-retire.js +10 -6
  17. package/dist/cli/commands/constraints-retire.js.map +1 -1
  18. package/dist/cli/commands/constraints.d.ts +1 -1
  19. package/dist/cli/commands/constraints.js +1 -1
  20. package/dist/cli/commands/definitions.d.ts.map +1 -1
  21. package/dist/cli/commands/definitions.js +16 -1
  22. package/dist/cli/commands/definitions.js.map +1 -1
  23. package/dist/cli/commands/knowledge-view.d.ts +3 -3
  24. package/dist/cli/commands/knowledge-view.js +4 -4
  25. package/dist/cli/commands/knowledge-view.js.map +1 -1
  26. package/dist/cli/commands/release.d.ts +2 -2
  27. package/dist/cli/commands/release.js +2 -2
  28. package/dist/cli/commands/sync-docs/agents-syncer.js +2 -4
  29. package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
  30. package/dist/cli/commands/sync-docs/head-gate.d.ts +34 -0
  31. package/dist/cli/commands/sync-docs/head-gate.d.ts.map +1 -0
  32. package/dist/cli/commands/sync-docs/head-gate.js +86 -0
  33. package/dist/cli/commands/sync-docs/head-gate.js.map +1 -0
  34. package/dist/cli/commands/sync-docs/index.d.ts +7 -0
  35. package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
  36. package/dist/cli/commands/sync-docs/index.js +51 -1
  37. package/dist/cli/commands/sync-docs/index.js.map +1 -1
  38. package/dist/completion-checkers/contract-presence.d.ts +1 -1
  39. package/dist/completion-checkers/contract-presence.js +1 -1
  40. package/dist/core/app-constraints-loader.d.ts +5 -3
  41. package/dist/core/app-constraints-loader.d.ts.map +1 -1
  42. package/dist/core/app-constraints-loader.js +20 -7
  43. package/dist/core/app-constraints-loader.js.map +1 -1
  44. package/dist/core/constraints/capabilities-parser.js +1 -1
  45. package/dist/core/constraints/check-cache.d.ts +1 -1
  46. package/dist/core/constraints/check-cache.js +1 -1
  47. package/dist/core/constraints/checker.d.ts +5 -3
  48. package/dist/core/constraints/checker.d.ts.map +1 -1
  49. package/dist/core/constraints/checker.js +31 -10
  50. package/dist/core/constraints/checker.js.map +1 -1
  51. package/dist/core/constraints/checkers/capability-sync.d.ts +1 -1
  52. package/dist/core/constraints/checkers/capability-sync.d.ts.map +1 -1
  53. package/dist/core/constraints/checkers/capability-sync.js +22 -9
  54. package/dist/core/constraints/checkers/capability-sync.js.map +1 -1
  55. package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +1 -1
  56. package/dist/core/constraints/checkers/context-doc-sync.js +7 -1
  57. package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -1
  58. package/dist/core/constraints/checkers/docs-freshness.d.ts.map +1 -1
  59. package/dist/core/constraints/checkers/docs-freshness.js +41 -26
  60. package/dist/core/constraints/checkers/docs-freshness.js.map +1 -1
  61. package/dist/core/constraints/checkers/governance-presence.d.ts +4 -1
  62. package/dist/core/constraints/checkers/governance-presence.d.ts.map +1 -1
  63. package/dist/core/constraints/checkers/governance-presence.js +8 -11
  64. package/dist/core/constraints/checkers/governance-presence.js.map +1 -1
  65. package/dist/core/constraints/checkers/index.d.ts +6 -6
  66. package/dist/core/constraints/checkers/index.d.ts.map +1 -1
  67. package/dist/core/constraints/checkers/index.js +16 -11
  68. package/dist/core/constraints/checkers/index.js.map +1 -1
  69. package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +34 -0
  70. package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +1 -0
  71. package/dist/core/constraints/checkers/no-completion-without-verification.js +157 -0
  72. package/dist/core/constraints/checkers/no-completion-without-verification.js.map +1 -0
  73. package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +14 -4
  74. package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +1 -1
  75. package/dist/core/constraints/checkers/no-hardcoded-credentials.js +134 -30
  76. package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +1 -1
  77. package/dist/core/constraints/checkers/no-test-simplification.d.ts +16 -2
  78. package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +1 -1
  79. package/dist/core/constraints/checkers/no-test-simplification.js +115 -15
  80. package/dist/core/constraints/checkers/no-test-simplification.js.map +1 -1
  81. package/dist/core/constraints/checkers/templated/exec.d.ts +19 -0
  82. package/dist/core/constraints/checkers/templated/exec.d.ts.map +1 -0
  83. package/dist/core/constraints/checkers/templated/exec.js +124 -0
  84. package/dist/core/constraints/checkers/templated/exec.js.map +1 -0
  85. package/dist/core/constraints/checkers/templated/index.d.ts +1 -0
  86. package/dist/core/constraints/checkers/templated/index.d.ts.map +1 -1
  87. package/dist/core/constraints/checkers/templated/index.js +3 -1
  88. package/dist/core/constraints/checkers/templated/index.js.map +1 -1
  89. package/dist/core/constraints/checkers/templates-registry.d.ts +2 -1
  90. package/dist/core/constraints/checkers/templates-registry.d.ts.map +1 -1
  91. package/dist/core/constraints/checkers/templates-registry.js +3 -1
  92. package/dist/core/constraints/checkers/templates-registry.js.map +1 -1
  93. package/dist/core/constraints/checkers/types.d.ts +68 -7
  94. package/dist/core/constraints/checkers/types.d.ts.map +1 -1
  95. package/dist/core/constraints/checkers/types.js +52 -7
  96. package/dist/core/constraints/checkers/types.js.map +1 -1
  97. package/dist/core/constraints/context-builder.d.ts.map +1 -1
  98. package/dist/core/constraints/context-builder.js +0 -17
  99. package/dist/core/constraints/context-builder.js.map +1 -1
  100. package/dist/core/constraints/definitions/guidelines.d.ts +1 -0
  101. package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -1
  102. package/dist/core/constraints/definitions/guidelines.js +5 -1
  103. package/dist/core/constraints/definitions/guidelines.js.map +1 -1
  104. package/dist/core/constraints/definitions/iron-laws.d.ts +1 -0
  105. package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -1
  106. package/dist/core/constraints/definitions/iron-laws.js +8 -3
  107. package/dist/core/constraints/definitions/iron-laws.js.map +1 -1
  108. package/dist/core/constraints/definitions.d.ts +8 -1
  109. package/dist/core/constraints/definitions.d.ts.map +1 -1
  110. package/dist/core/constraints/definitions.js +11 -1
  111. package/dist/core/constraints/definitions.js.map +1 -1
  112. package/dist/core/constraints/git-evidence.d.ts +10 -0
  113. package/dist/core/constraints/git-evidence.d.ts.map +1 -1
  114. package/dist/core/constraints/git-evidence.js +2 -0
  115. package/dist/core/constraints/git-evidence.js.map +1 -1
  116. package/dist/core/constraints/index.d.ts +3 -1
  117. package/dist/core/constraints/index.d.ts.map +1 -1
  118. package/dist/core/constraints/index.js +8 -1
  119. package/dist/core/constraints/index.js.map +1 -1
  120. package/dist/core/constraints/run-env.d.ts +3 -2
  121. package/dist/core/constraints/run-env.d.ts.map +1 -1
  122. package/dist/core/constraints/run-env.js +5 -4
  123. package/dist/core/constraints/run-env.js.map +1 -1
  124. package/dist/core/constraints/usage-report.d.ts +0 -5
  125. package/dist/core/constraints/usage-report.d.ts.map +1 -1
  126. package/dist/core/constraints/usage-report.js +3 -12
  127. package/dist/core/constraints/usage-report.js.map +1 -1
  128. package/dist/core/effective-constraints.d.ts +1 -1
  129. package/dist/core/effective-constraints.js +1 -1
  130. package/dist/core/index.d.ts +2 -2
  131. package/dist/core/index.d.ts.map +1 -1
  132. package/dist/core/index.js +6 -1
  133. package/dist/core/index.js.map +1 -1
  134. package/dist/core/retired-constraints.d.ts +66 -0
  135. package/dist/core/retired-constraints.d.ts.map +1 -0
  136. package/dist/core/retired-constraints.js +52 -0
  137. package/dist/core/retired-constraints.js.map +1 -0
  138. package/dist/core/validators/checkpoint.d.ts +4 -2
  139. package/dist/core/validators/checkpoint.d.ts.map +1 -1
  140. package/dist/core/validators/checkpoint.js +4 -2
  141. package/dist/core/validators/checkpoint.js.map +1 -1
  142. package/dist/core/validators/passes-gate.d.ts +2 -2
  143. package/dist/core/validators/passes-gate.d.ts.map +1 -1
  144. package/dist/core/validators/passes-gate.js +4 -3
  145. package/dist/core/validators/passes-gate.js.map +1 -1
  146. package/dist/gates/checker-gate.d.ts +8 -4
  147. package/dist/gates/checker-gate.d.ts.map +1 -1
  148. package/dist/gates/checker-gate.js +13 -6
  149. package/dist/gates/checker-gate.js.map +1 -1
  150. package/dist/gates/index.d.ts +1 -1
  151. package/dist/gates/index.js +1 -1
  152. package/dist/index.d.ts +5 -1
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +18 -5
  155. package/dist/index.js.map +1 -1
  156. package/dist/knowledge/audit-scoring.js +1 -1
  157. package/dist/knowledge/audit-scoring.js.map +1 -1
  158. package/dist/monitoring/trace-analyzer.d.ts +2 -2
  159. package/dist/monitoring/trace-analyzer.js +2 -2
  160. package/dist/monitoring/traces.d.ts +1 -1
  161. package/dist/monitoring/traces.js +4 -4
  162. package/dist/monitoring/traces.js.map +1 -1
  163. package/dist/pretool-use-hook.d.ts +1 -1
  164. package/dist/pretool-use-hook.d.ts.map +1 -1
  165. package/dist/pretool-use-hook.js +5 -5
  166. package/dist/pretool-use-hook.js.map +1 -1
  167. package/dist/release/integrity.d.ts +4 -4
  168. package/dist/release/integrity.js +4 -4
  169. package/dist/test-setup/mkdtemp-cleanup.js +1 -1
  170. package/dist/tools/definitions/core/notification/notify.yml +0 -1
  171. package/dist/tools/definitions/ext/browser/browser-close.yml +0 -1
  172. package/dist/tools/definitions/ext/browser/browser-start.yml +0 -1
  173. package/dist/tools/definitions/std/evolution/implement.yml +0 -1
  174. package/dist/tools/definitions/std/evolution/prioritize.yml +0 -1
  175. package/dist/tools/definitions/std/evolution/report-gap.yml +0 -1
  176. package/dist/tools/definitions/std/governance/aggregate-opinions.yml +0 -1
  177. package/dist/tools/definitions/std/governance/audit-task.yml +0 -1
  178. package/dist/tools/definitions/std/governance/cast-vote.yml +0 -1
  179. package/dist/tools/definitions/std/governance/create-voting-session.yml +0 -1
  180. package/dist/tools/definitions/std/governance/define-stance.yml +0 -1
  181. package/dist/tools/definitions/std/governance/impeach.yml +0 -1
  182. package/dist/tools/definitions/std/governance/multi-stance-review.yml +0 -1
  183. package/dist/tools/definitions/std/governance/rollback.yml +0 -1
  184. package/dist/tools/definitions/std/governance/stance-review.yml +0 -1
  185. package/dist/tools/definitions/std/governance/track-effect.yml +0 -1
  186. package/dist/tools/definitions/std/governance/vote-tally.yml +0 -1
  187. package/dist/tools/definitions/std/planning/split-batch.yml +0 -1
  188. package/dist/tools/definitions/std/planning/split-tasks.yml +0 -1
  189. package/dist/types/constraint.d.ts +32 -9
  190. package/dist/types/constraint.d.ts.map +1 -1
  191. package/dist/types/constraint.js +6 -1
  192. package/dist/types/constraint.js.map +1 -1
  193. package/dist/types/passes-gate.d.ts +7 -0
  194. package/dist/types/passes-gate.d.ts.map +1 -1
  195. package/dist/types/passes-gate.js +8 -0
  196. package/dist/types/passes-gate.js.map +1 -1
  197. package/dist/types/trace.d.ts +7 -0
  198. package/dist/types/trace.d.ts.map +1 -1
  199. package/dist/utils/detect-source-roots.d.ts +1 -1
  200. package/dist/utils/detect-source-roots.d.ts.map +1 -1
  201. package/dist/utils/detect-source-roots.js +2 -21
  202. package/dist/utils/detect-source-roots.js.map +1 -1
  203. package/package.json +1 -2
  204. package/src/CONTEXT.md +3 -3
  205. package/src/__tests__/app-constraints-loader.test.ts +86 -3
  206. package/src/__tests__/checker-extra.test.ts +110 -11
  207. package/src/__tests__/checker-primitives-sdk.test.ts +70 -0
  208. package/src/__tests__/checker.test.ts +16 -14
  209. package/src/__tests__/detect-source-roots.test.ts +5 -4
  210. package/src/__tests__/exec-checker-full-chain.test.ts +118 -0
  211. package/src/__tests__/iron-laws.test.ts +13 -20
  212. package/src/__tests__/no-studio-references.test.ts +54 -0
  213. package/src/__tests__/passes-gate-check.test.ts +1 -1
  214. package/src/__tests__/pretool-use-hook.test.ts +2 -2
  215. package/src/__tests__/public-exports.test.ts +6 -0
  216. package/src/__tests__/public-type-surface.test.ts +24 -2
  217. package/src/__tests__/public-value-surface.test.ts +5 -0
  218. package/src/__tests__/retired-constraints.test.ts +99 -0
  219. package/src/__tests__/skip-semantics.test.ts +16 -33
  220. package/src/__tests__/usage-report-public-export.test.ts +3 -3
  221. package/src/cli/commands/CONTEXT.md +7 -6
  222. package/src/cli/commands/__tests__/check-read-count.test.ts +3 -0
  223. package/src/cli/commands/__tests__/check-skip-output.test.ts +4 -4
  224. package/src/cli/commands/__tests__/check.test.ts +35 -6
  225. package/src/cli/commands/__tests__/constraints-disable.test.ts +229 -0
  226. package/src/cli/commands/__tests__/constraints-report-json-flag.test.ts +1 -1
  227. package/src/cli/commands/__tests__/constraints-report.test.ts +4 -4
  228. package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +1 -1
  229. package/src/cli/commands/__tests__/knowledge.test.ts +3 -3
  230. package/src/cli/commands/__tests__/project-path-anchoring.test.ts +4 -1
  231. package/src/cli/commands/__tests__/project-path-convention.test.ts +1 -1
  232. package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +1 -1
  233. package/src/cli/commands/__tests__/sync-docs-agents.test.ts +1 -24
  234. package/src/cli/commands/__tests__/sync-docs-gate.test.ts +154 -0
  235. package/src/cli/commands/__tests__/sync-docs-table-layout.test.ts +1 -1
  236. package/src/cli/commands/__tests__/sync-docs.test.ts +3 -3
  237. package/src/cli/commands/check.ts +3 -3
  238. package/src/cli/commands/constraints-disable.ts +145 -0
  239. package/src/cli/commands/constraints-pack-proposal.ts +1 -1
  240. package/src/cli/commands/constraints-reactivate.ts +4 -2
  241. package/src/cli/commands/constraints-retire.ts +11 -8
  242. package/src/cli/commands/constraints.ts +1 -1
  243. package/src/cli/commands/definitions.ts +16 -1
  244. package/src/cli/commands/knowledge-view.ts +4 -4
  245. package/src/cli/commands/release.ts +2 -2
  246. package/src/cli/commands/sync-docs/agents-syncer.ts +2 -4
  247. package/src/cli/commands/sync-docs/head-gate.ts +87 -0
  248. package/src/cli/commands/sync-docs/index.ts +62 -1
  249. package/src/completion-checkers/contract-presence.ts +1 -1
  250. package/src/core/CONTEXT.md +9 -8
  251. package/src/core/app-constraints-loader.ts +23 -8
  252. package/src/core/constraints/__tests__/capabilities-reconcile.test.ts +1 -1
  253. package/src/core/constraints/__tests__/check-cache.test.ts +1 -1
  254. package/src/core/constraints/__tests__/collect-constraints.test.ts +42 -18
  255. package/src/core/constraints/__tests__/git-evidence.test.ts +20 -0
  256. package/src/core/constraints/__tests__/run-env.test.ts +9 -7
  257. package/src/core/constraints/__tests__/trace-injection.test.ts +8 -2
  258. package/src/core/constraints/capabilities-parser.ts +1 -1
  259. package/src/core/constraints/check-cache.ts +1 -1
  260. package/src/core/constraints/checker.ts +35 -12
  261. package/src/core/constraints/checkers/__tests__/capability-sync.test.ts +21 -3
  262. package/src/core/constraints/checkers/__tests__/context-doc-sync.test.ts +20 -12
  263. package/src/core/constraints/checkers/__tests__/docs-freshness-degraded.test.ts +89 -0
  264. package/src/core/constraints/checkers/__tests__/docs-freshness.test.ts +4 -2
  265. package/src/core/constraints/checkers/__tests__/exec-checker.test.ts +99 -0
  266. package/src/core/constraints/checkers/__tests__/fixtures/public-repo-sanitization.mjs +40 -0
  267. package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +24 -3
  268. package/src/core/constraints/checkers/__tests__/input-contract.test.ts +135 -0
  269. package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +208 -0
  270. package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +127 -5
  271. package/src/core/constraints/checkers/__tests__/no-test-simplification.test.ts +144 -21
  272. package/src/core/constraints/checkers/__tests__/three-state-consistency.test.ts +6 -2
  273. package/src/core/constraints/checkers/capability-sync.ts +25 -11
  274. package/src/core/constraints/checkers/context-doc-sync.ts +8 -1
  275. package/src/core/constraints/checkers/docs-freshness.ts +44 -26
  276. package/src/core/constraints/checkers/governance-presence.ts +8 -9
  277. package/src/core/constraints/checkers/index.ts +23 -13
  278. package/src/core/constraints/checkers/no-completion-without-verification.ts +126 -0
  279. package/src/core/constraints/checkers/no-hardcoded-credentials.ts +153 -29
  280. package/src/core/constraints/checkers/no-test-simplification.ts +128 -17
  281. package/src/core/constraints/checkers/templated/exec.ts +138 -0
  282. package/src/core/constraints/checkers/templated/index.ts +1 -0
  283. package/src/core/constraints/checkers/templates-registry.ts +4 -2
  284. package/src/core/constraints/checkers/types.ts +107 -10
  285. package/src/core/constraints/context-builder.ts +0 -18
  286. package/src/core/constraints/definitions/guidelines.ts +5 -1
  287. package/src/core/constraints/definitions/iron-laws.ts +8 -3
  288. package/src/core/constraints/definitions.ts +11 -1
  289. package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +3 -3
  290. package/src/core/constraints/git-evidence.ts +13 -0
  291. package/src/core/constraints/index.ts +22 -1
  292. package/src/core/constraints/run-env.ts +6 -5
  293. package/src/core/constraints/usage-report.ts +2 -12
  294. package/src/core/effective-constraints.ts +1 -1
  295. package/src/core/index.ts +16 -1
  296. package/src/core/retired-constraints.ts +77 -0
  297. package/src/core/validators/checkpoint.ts +4 -2
  298. package/src/core/validators/passes-gate.ts +4 -3
  299. package/src/gates/CONTEXT.md +3 -2
  300. package/src/gates/__tests__/checker-gate.test.ts +20 -3
  301. package/src/gates/checker-gate.ts +14 -7
  302. package/src/gates/index.ts +1 -1
  303. package/src/hooks/CONTEXT.md +2 -2
  304. package/src/index.ts +35 -3
  305. package/src/knowledge/CONTEXT.md +2 -2
  306. package/src/knowledge/__tests__/audit.test.ts +1 -1
  307. package/src/knowledge/__tests__/flywheel-metrics.test.ts +1 -1
  308. package/src/knowledge/audit-scoring.ts +1 -1
  309. package/src/monitoring/CONTEXT.md +2 -2
  310. package/src/monitoring/__tests__/skipped-lines-report.test.ts +2 -2
  311. package/src/monitoring/__tests__/traces.test.ts +1 -1
  312. package/src/monitoring/trace-analyzer.ts +2 -2
  313. package/src/monitoring/traces.ts +4 -4
  314. package/src/pretool-use-hook.ts +5 -5
  315. package/src/release/CONTEXT.md +3 -3
  316. package/src/release/integrity.ts +4 -4
  317. package/src/test-setup/__tests__/mkdtemp-cleanup.test.ts +1 -1
  318. package/src/test-setup/mkdtemp-cleanup.ts +1 -1
  319. package/src/tools/CONTEXT.md +3 -3
  320. package/src/tools/__tests__/registry.test.ts +3 -3
  321. package/src/tools/definitions/core/notification/notify.yml +0 -1
  322. package/src/tools/definitions/ext/browser/browser-close.yml +0 -1
  323. package/src/tools/definitions/ext/browser/browser-start.yml +0 -1
  324. package/src/tools/definitions/std/evolution/implement.yml +0 -1
  325. package/src/tools/definitions/std/evolution/prioritize.yml +0 -1
  326. package/src/tools/definitions/std/evolution/report-gap.yml +0 -1
  327. package/src/tools/definitions/std/governance/aggregate-opinions.yml +0 -1
  328. package/src/tools/definitions/std/governance/audit-task.yml +0 -1
  329. package/src/tools/definitions/std/governance/cast-vote.yml +0 -1
  330. package/src/tools/definitions/std/governance/create-voting-session.yml +0 -1
  331. package/src/tools/definitions/std/governance/define-stance.yml +0 -1
  332. package/src/tools/definitions/std/governance/impeach.yml +0 -1
  333. package/src/tools/definitions/std/governance/multi-stance-review.yml +0 -1
  334. package/src/tools/definitions/std/governance/rollback.yml +0 -1
  335. package/src/tools/definitions/std/governance/stance-review.yml +0 -1
  336. package/src/tools/definitions/std/governance/track-effect.yml +0 -1
  337. package/src/tools/definitions/std/governance/vote-tally.yml +0 -1
  338. package/src/tools/definitions/std/planning/split-batch.yml +0 -1
  339. package/src/tools/definitions/std/planning/split-tasks.yml +0 -1
  340. package/src/types/constraint.ts +35 -10
  341. package/src/types/passes-gate.ts +8 -0
  342. package/src/types/trace.ts +8 -0
  343. package/src/utils/detect-source-roots.ts +2 -20
  344. package/bin/harness-knowledge-track.sh +0 -47
  345. package/bin/harness-sensitive-check.sh +0 -67
  346. package/dist/core/constraints/checkers/iron-flags.d.ts +0 -12
  347. package/dist/core/constraints/checkers/iron-flags.d.ts.map +0 -1
  348. package/dist/core/constraints/checkers/iron-flags.js +0 -16
  349. package/dist/core/constraints/checkers/iron-flags.js.map +0 -1
  350. package/src/core/constraints/checkers/__tests__/iron-flags.test.ts +0 -30
  351. package/src/core/constraints/checkers/iron-flags.ts +0 -17
  352. package/templates/nextjs-app/.github/workflows/ci.yml +0 -39
  353. package/templates/node-api/.github/workflows/ci.yml +0 -36
  354. package/templates/node-api/package.json +0 -23
  355. package/templates/node-api/src/index.ts +0 -2
  356. package/templates/node-api/tsconfig.json +0 -19
  357. package/templates/python-api/.github/workflows/ci.yml +0 -39
@@ -171,7 +171,6 @@ outputs:
171
171
 
172
172
  # 元数据
173
173
  metadata:
174
- author: Agent Studio
175
174
  tags:
176
175
  - governance
177
176
  - audit
@@ -122,7 +122,6 @@ errors:
122
122
 
123
123
  # 元数据
124
124
  metadata:
125
- author: Agent Studio
126
125
  tags:
127
126
  - governance
128
127
  - voting
@@ -95,7 +95,6 @@ outputs:
95
95
 
96
96
  # 元数据
97
97
  metadata:
98
- author: Agent Studio
99
98
  tags:
100
99
  - governance
101
100
  - voting
@@ -74,7 +74,6 @@ execute:
74
74
 
75
75
  # 元数据
76
76
  metadata:
77
- author: Agent Studio
78
77
  tags:
79
78
  - governance
80
79
  - stance
@@ -172,7 +172,6 @@ protections:
172
172
 
173
173
  # 元数据
174
174
  metadata:
175
- author: Agent Studio
176
175
  tags:
177
176
  - governance
178
177
  - impeachment
@@ -145,7 +145,6 @@ max_parallel: 3
145
145
 
146
146
  # 元数据
147
147
  metadata:
148
- author: Agent Studio
149
148
  tags:
150
149
  - governance
151
150
  - review
@@ -179,7 +179,6 @@ errors:
179
179
 
180
180
  # 元数据
181
181
  metadata:
182
- author: Agent Studio
183
182
  tags:
184
183
  - governance
185
184
  - rollback
@@ -141,7 +141,6 @@ execute:
141
141
 
142
142
  # 元数据
143
143
  metadata:
144
- author: Agent Studio
145
144
  tags:
146
145
  - governance
147
146
  - review
@@ -192,7 +192,6 @@ outputs:
192
192
 
193
193
  # 元数据
194
194
  metadata:
195
- author: Agent Studio
196
195
  tags:
197
196
  - governance
198
197
  - effect-tracking
@@ -137,7 +137,6 @@ decision_priority:
137
137
 
138
138
  # 元数据
139
139
  metadata:
140
- author: Agent Studio
141
140
  tags:
142
141
  - governance
143
142
  - voting
@@ -458,7 +458,6 @@ examples:
458
458
  # ============================================================================
459
459
 
460
460
  metadata:
461
- author: Agent Studio
462
461
  version: 2.0.0
463
462
  changelog:
464
463
  - version: 2.0.0
@@ -343,7 +343,6 @@ examples:
343
343
  # ============================================================================
344
344
 
345
345
  metadata:
346
- author: Agent Studio
347
346
  version: 1.0.0
348
347
  changelog:
349
348
  - version: 1.0.0
@@ -2,11 +2,16 @@
2
2
  * 约束类型定义
3
3
  *
4
4
  * severity 显式模型(ADR-0029,取代 ADR-0001 的三层命名与 kind 二元模型):
5
- * - 全部约束 kind='check':必须带真实 checker,参与运行时检查与 trace 统计
6
5
  * - severity 直接写死在定义上:error = 违规即阻断;warning = 违规告警不阻断;
7
6
  * info = 仅记录
8
7
  * - 纯文本提示层(kind='prompt' / promptInjection / 注入段渲染)已整体关停,
9
8
  * 文本规则由消费方手写治理段承接
9
+ *
10
+ * channel 通道模型(ADR-0035,两轴:channel=后果轴、checker 来源=判定轴):
11
+ * - gate(缺省):硬门禁,必须带真实 checker,参与运行时检查与 trace 统计
12
+ * - workflow:流程机制承载,无 checker,不进检查分发
13
+ * - discipline:拦不住但数得出的登记记录,无 checker,harness 不渲染、不注入、
14
+ * 不执行,供消费方做信号计数;晋升毕业后原地翻 channel 回 gate
10
15
  */
11
16
 
12
17
  /**
@@ -24,6 +29,17 @@ export type ConstraintKind = 'check';
24
29
  */
25
30
  export type ConstraintSeverity = 'error' | 'warning' | 'info';
26
31
 
32
+ /**
33
+ * 约束通道(ADR-0035,后果轴;与探测器来源的判定轴正交)
34
+ *
35
+ * - gate:硬门禁——带 checker、违规按 severity 阻断/告警(缺省通道,现有行为)
36
+ * - workflow:流程机制承载——无 checker,由 CI/拆票等流程结构兜住,不进检查分发
37
+ * - discipline:拦不住但数得出——无 checker 的登记记录,harness 永不渲染、
38
+ * 永不注入、永不执行,仅供消费方做代理信号计数;
39
+ * 超阈值晋升毕业后原地翻回 gate(补上 checker)
40
+ */
41
+ export type ConstraintChannel = 'gate' | 'workflow' | 'discipline';
42
+
27
43
  /**
28
44
  * 约束触发条件(开放扩展)
29
45
  *
@@ -49,11 +65,19 @@ export interface Constraint {
49
65
  id: ConstraintId;
50
66
 
51
67
  /**
52
- * 约束类别(ADR-0029):恒为 'check'——必须带真实 checker,参与运行时检查;
68
+ * 约束类别(ADR-0029):恒为 'check';
53
69
  * 纯文本提示(kind='prompt')已随文本注入层一并关停
54
70
  */
55
71
  kind: ConstraintKind;
56
72
 
73
+ /**
74
+ * 约束通道(ADR-0035):缺省 'gate'
75
+ *
76
+ * gate 通道必须带 checker(注册表闭环收窄后的口径);workflow/discipline
77
+ * 通道允许无 checker——不进入检查分发、不触发闭环抛错、harness 不渲染不注入
78
+ */
79
+ channel?: ConstraintChannel;
80
+
57
81
  /** 约束规则(英文) */
58
82
  rule: string;
59
83
 
@@ -84,7 +108,7 @@ export interface Constraint {
84
108
  source?: ConstraintSource;
85
109
 
86
110
  /**
87
- * 填空式 checker 模板 id(仅 source='app' 使用)
111
+ * 填空式 checker 模板 id(仅 source='app' 使用;仅 channel='gate' 必填)
88
112
  *
89
113
  * 内置约束省略 = checker 按约束 id 在内置注册表查找;应用层约束按模板 id
90
114
  * 在模板注册表(checkers/index.ts TEMPLATES)查找并带 params 实例化
@@ -116,6 +140,14 @@ export interface ConstraintResult {
116
140
  * 但不计入 pass/fail 统计;trace 记录为 result: 'skip'。
117
141
  */
118
142
  skipped?: boolean;
143
+
144
+ /**
145
+ * 跳过原因(harness#182:「检查器失效 ≠ 对象合规」必须显式、可统计)
146
+ *
147
+ * 仅 skipped=true 时可能携带(旧路径的裸 'skip' 无原因);
148
+ * 进 CLI 跳过清单与 ExecutionTrace.skipReason。
149
+ */
150
+ skipReason?: string;
119
151
 
120
152
  /** 约束定义 */
121
153
  constraint?: Constraint;
@@ -188,9 +220,6 @@ export interface ConstraintContext {
188
220
  /** 是否已通过诊断→修复闸门(设计方案已确认) */
189
221
  hasPlanApproval?: boolean;
190
222
 
191
- /** 是否有验证证据 */
192
- hasVerificationEvidence?: boolean;
193
-
194
223
  /** 是否有测试 */
195
224
  hasTest?: boolean;
196
225
 
@@ -245,7 +274,3 @@ export interface ConstraintCheckResult {
245
274
  warningCount: number;
246
275
  }
247
276
 
248
- /**
249
- * studio 兼容别名(P0 护栏):等价于 ConstraintContext
250
- */
251
- export type IronLawContext = ConstraintContext;
@@ -2,6 +2,14 @@
2
2
  * 测试门控类型定义
3
3
  */
4
4
 
5
+ /**
6
+ * 验证证据的约定落点(项目根相对路径)
7
+ *
8
+ * 写方 = PassesGate.runTests(真实跑测试命令后落盘)与消费方外部验证事件;
9
+ * 读方 = no_completion_without_verification checker(harness#183)。路径真相只此一处。
10
+ */
11
+ export const EVIDENCE_DIR_REL = '.harness/evidence';
12
+
5
13
  /**
6
14
  * 测试门控配置
7
15
  */
@@ -61,6 +61,14 @@ export interface ExecutionTrace {
61
61
  */
62
62
  evidence?: string[];
63
63
 
64
+ /**
65
+ * 跳过原因(harness#182;仅 result='skip' 时可能携带)
66
+ *
67
+ * 「未评估」必须可统计:降级跳过(输入不可得/检查器失效)与约定未采用
68
+ * 在结果面上靠本字段区分,失效计数由此可聚合成代理信号。
69
+ */
70
+ skipReason?: string;
71
+
64
72
  // ========================================
65
73
  // 用户响应(可选,用于诊断)
66
74
  // ========================================
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 统一所有源码目录发现逻辑:
5
5
  * 1. monorepo: packages/下各包的 src 或 lib 子目录
6
- * 2. monorepo: apps/下各应用的 src/modules 子目录
6
+ * 2. monorepo: apps/下各应用的 src 子目录
7
7
  * 3. 单 repo: src/ lib/ 目录
8
8
  *
9
9
  * 返回相对 projectPath 的路径数组。全都不存在时返回空数组。
@@ -49,28 +49,10 @@ export function detectSourceRoots(projectPath: string): string[] {
49
49
  if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name.startsWith('__')) continue;
50
50
  const appDir = join(appsDir, entry.name);
51
51
 
52
- // apps/api/src/modules/* 的子目录
53
- const modulesDir = join(appDir, 'src', 'modules');
54
- if (existsSync(modulesDir)) {
55
- try {
56
- const modEntries = readdirSync(modulesDir, { withFileTypes: true });
57
- for (const mod of modEntries) {
58
- if (!mod.isDirectory() || mod.name.startsWith('.') || mod.name.startsWith('__')) continue;
59
- const modPath = join(modulesDir, mod.name);
60
- if (hasSourceFiles(modPath)) {
61
- roots.push(`apps/${entry.name}/src/modules/${mod.name}`);
62
- }
63
- }
64
- } catch { /* skip */ }
65
- }
66
-
67
52
  // apps/xxx/src 本身
68
53
  const appSrcDir = join(appDir, 'src');
69
54
  if (existsSync(appSrcDir) && hasSourceFiles(appSrcDir)) {
70
- // 避免重复(modules 已覆盖子目录)
71
- if (!roots.some(r => r.startsWith(`apps/${entry.name}/src/`))) {
72
- roots.push(`apps/${entry.name}/src`);
73
- }
55
+ roots.push(`apps/${entry.name}/src`);
74
56
  }
75
57
  }
76
58
  } catch { /* skip */ }
@@ -1,47 +0,0 @@
1
- #!/bin/bash
2
- # PostToolUse hook — track deep analysis + session metrics
3
- # Matcher: EnterPlanMode|Agent|Read|Write|Edit|Bash (broad coverage)
4
- # DailyReflection: enriched session:summary events for behavioral analysis
5
-
6
- STATE_FILE=/tmp/claude-knowledge-capture-state.json
7
- INPUT=$(cat)
8
-
9
- tool_name=$(echo "$INPUT" | jq -r '.tool_name // ""')
10
- file_path=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
11
-
12
- # Init state file if missing (tool: claude|codex|opencode|etc)
13
- _tool=$(echo "${CLAUDE_CODE_TOOL_NAME:-claude}" | tr '[:upper:]' '[:lower:]')
14
- [ -f "$STATE_FILE" ] || echo "{\"planned\":false,\"explored\":false,\"readDirs\":[],\"captured\":false,\"turnCount\":0,\"startTime\":$(date +%s)000,\"tool\":\"$_tool\"}" > "$STATE_FILE"
15
-
16
- # Always increment turn counter on substantive tools
17
- case "$tool_name" in
18
- EnterPlanMode)
19
- jq '.planned = true | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
20
- ;;
21
- Agent)
22
- # Agent(Explore) spawned → deep analysis signal
23
- _agent_type=$(echo "$INPUT" | jq -r '.tool_input.subagent_type // ""')
24
- if [ "$_agent_type" = "Explore" ]; then
25
- jq '.explored = true | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
26
- fi
27
- ;;
28
- Read)
29
- if [ -n "$file_path" ]; then
30
- dir=$(dirname "$file_path")
31
- if [ "$dir" != "." ] && [ "$dir" != "/" ]; then
32
- jq --arg d "$dir" '.readDirs += [$d] | .readDirs |= unique | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
33
- fi
34
- fi
35
- ;;
36
- Write|Edit)
37
- jq '.turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
38
- case "$file_path" in
39
- *.harness/knowledge-docs/*|*.harness/knowledge/*|*/memory/*.md|*/docs/*.md)
40
- jq '.captured = true' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
41
- ;;
42
- esac
43
- ;;
44
- Bash)
45
- jq '.turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
46
- ;;
47
- esac
@@ -1,67 +0,0 @@
1
- #!/bin/bash
2
- # PostToolUse hook — check for operations on sensitive files without prior Read
3
- #
4
- # Detects: Bash(mv/rm), Edit, or Write targeting files in bin/, .harness/, or
5
- # package.json — and checks whether those files were Read earlier in this session.
6
- #
7
- # State file is maintained by harness-knowledge-track.sh which tracks all Read calls.
8
-
9
- STATE_FILE=/tmp/claude-knowledge-capture-state.json
10
- SENSITIVE_DIRS="bin/ .harness/"
11
-
12
- INPUT=$(cat)
13
- tool_name=$(echo "$INPUT" | jq -r '.tool_name // ""')
14
- file_path=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
15
- content=$(echo "$INPUT" | jq -r '.tool_input.content // ""')
16
- command=$(echo "$INPUT" | jq -r '.tool_input.command // ""')
17
-
18
- # Check if this operation targets a sensitive file
19
- is_sensitive=false
20
- for dir in $SENSITIVE_DIRS; do
21
- case "$file_path" in
22
- *$dir*) is_sensitive=true; break ;;
23
- esac
24
- done
25
-
26
- # For Bash, check if the command involves mv/rm on sensitive paths
27
- if [ "$tool_name" = "Bash" ] && [ -n "$command" ]; then
28
- for dir in $SENSITIVE_DIRS; do
29
- if echo "$command" | grep -qE "(mv|rm|cp|git rm).*$dir"; then
30
- is_sensitive=true
31
- # Extract target from command for checking
32
- file_path=$(echo "$command" | grep -oE "$dir[^ ]*" | head -1)
33
- break
34
- fi
35
- done
36
- fi
37
-
38
- # Only check sensitive operations
39
- if [ "$is_sensitive" != "true" ] || [ -z "$file_path" ]; then
40
- exit 0
41
- fi
42
-
43
- # Check if this file was Read earlier in the session
44
- if [ -f "$STATE_FILE" ]; then
45
- read_dirs=$(jq -r '.readDirs // [] | join(" ")' "$STATE_FILE" 2>/dev/null || echo "")
46
-
47
- # Check if any read_dir is an ancestor of file_path
48
- verified=false
49
- file_dir=$(dirname "$file_path")
50
- for dir in $read_dirs; do
51
- case "$file_dir" in
52
- "$dir"|"$dir/"*) verified=true; break ;;
53
- esac
54
- done
55
-
56
- if [ "$verified" != "true" ]; then
57
- # Also check if the file itself was explicitly Read (file_path matches a read path)
58
- # The track hook only records directories, not individual files — conservative check
59
-
60
- # Emit warning via state file for Stop hook to pick up
61
- jq --arg op "$tool_name" --arg fp "$file_path" \
62
- '.sensitiveOps += [{"tool":$op,"file":$fp,"verified":false}]' \
63
- "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
64
- fi
65
- fi
66
-
67
- exit 0
@@ -1,12 +0,0 @@
1
- /**
2
- * error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
3
- *
4
- * harness#174 后仅存活的 flag:hasVerificationEvidence
5
- *(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
6
- *
7
- * 三态语义(ADR-0001 防爆措施):
8
- * - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
9
- * - 显式 false → fail;true → pass
10
- */
11
- export declare const noCompletionWithoutVerification: import("./types").ConstraintCheck;
12
- //# sourceMappingURL=iron-flags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iron-flags.d.ts","sourceRoot":"","sources":["../../../../src/core/constraints/checkers/iron-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,+BAA+B,mCAG3C,CAAC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- /**
3
- * error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
4
- *
5
- * harness#174 后仅存活的 flag:hasVerificationEvidence
6
- *(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
7
- *
8
- * 三态语义(ADR-0001 防爆措施):
9
- * - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
10
- * - 显式 false → fail;true → pass
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.noCompletionWithoutVerification = void 0;
14
- const types_1 = require("./types");
15
- exports.noCompletionWithoutVerification = (0, types_1.contextEvidenceFlag)('no_completion_without_verification', ctx => ctx.hasVerificationEvidence);
16
- //# sourceMappingURL=iron-flags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iron-flags.js","sourceRoot":"","sources":["../../../../src/core/constraints/checkers/iron-flags.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,mCAA8C;AAEjC,QAAA,+BAA+B,GAAG,IAAA,2BAAmB,EAChE,oCAAoC,EACpC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CACnC,CAAC"}
@@ -1,30 +0,0 @@
1
- /**
2
- * 铁律层 flag 检查旁测(架构评审候选4,ADR-0009 同模式)
3
- *
4
- * 唯一存活的 flag 铁律为 contextEvidenceFlag 构造,真实 bug 面 = 读错上下文字段
5
- * 与三态语义(undefined→skip / false→fail / true→pass)。直接喂不同字段组合
6
- * 钉死映射,不再经 engine facade(旧测在 skip-semantics/checker.test 间接打)。
7
- *
8
- * harness#174 删除 incremental_progress / no_implementation_without_requirement,
9
- * 对应用例一并移除。
10
- */
11
-
12
- import { describe, it, expect } from '@jest/globals';
13
- import { noCompletionWithoutVerification } from '../iron-flags';
14
- import { buildCheckEnv } from '../types';
15
- import type { ConstraintContext } from '../../../../types/constraint';
16
-
17
- const evaluate = (
18
- check: { evaluate: (env: any) => unknown },
19
- ctx: Partial<ConstraintContext>
20
- ) => check.evaluate(buildCheckEnv({ ...ctx, operation: 'code_implementation' }, 'none'));
21
-
22
- describe('iron flags — 三态与字段映射', () => {
23
- it('no_completion_without_verification → 读 hasVerificationEvidence', async () => {
24
- expect(await evaluate(noCompletionWithoutVerification, {})).toBe('skip');
25
- expect(await evaluate(noCompletionWithoutVerification, { hasVerificationEvidence: false })).toBe(false);
26
- expect(await evaluate(noCompletionWithoutVerification, { hasVerificationEvidence: true })).toBe(true);
27
- // 相邻字段不串台:hasTest 不能顶替
28
- expect(await evaluate(noCompletionWithoutVerification, { hasTest: true })).toBe('skip');
29
- });
30
- });
@@ -1,17 +0,0 @@
1
- /**
2
- * error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
3
- *
4
- * harness#174 后仅存活的 flag:hasVerificationEvidence
5
- *(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
6
- *
7
- * 三态语义(ADR-0001 防爆措施):
8
- * - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
9
- * - 显式 false → fail;true → pass
10
- */
11
-
12
- import { contextEvidenceFlag } from './types';
13
-
14
- export const noCompletionWithoutVerification = contextEvidenceFlag(
15
- 'no_completion_without_verification',
16
- ctx => ctx.hasVerificationEvidence
17
- );
@@ -1,39 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
8
-
9
- jobs:
10
- test:
11
- name: Test
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - name: Setup Node.js
18
- uses: actions/setup-node@v4
19
- with:
20
- node-version: '20'
21
- cache: 'npm'
22
-
23
- - name: Install dependencies
24
- run: npm ci
25
-
26
- - name: Run linter
27
- run: npm run lint
28
-
29
- - name: Run tests
30
- run: npm test
31
-
32
- - name: Build
33
- run: npm run build
34
-
35
- harness:
36
- name: Harness Check
37
- uses: kww/harness/.github/workflows/harness-check.yml@v1
38
- with:
39
- preset: standard
@@ -1,36 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
8
-
9
- jobs:
10
- test:
11
- name: Test
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - name: Setup Node.js
18
- uses: actions/setup-node@v4
19
- with:
20
- node-version: '20'
21
- cache: 'npm'
22
-
23
- - name: Install dependencies
24
- run: npm ci
25
-
26
- - name: Run tests
27
- run: npm test
28
-
29
- - name: Build
30
- run: npm run build
31
-
32
- harness:
33
- name: Harness Check
34
- uses: kww/harness/.github/workflows/harness-check.yml@v1
35
- with:
36
- preset: standard
@@ -1,23 +0,0 @@
1
- {
2
- "name": "{{project_name}}",
3
- "version": "0.1.0",
4
- "description": "",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "scripts": {
8
- "build": "tsc",
9
- "dev": "tsc --watch",
10
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
11
- "lint": "eslint src --ext .ts"
12
- },
13
- "devDependencies": {
14
- "@types/node": "^20.11.0",
15
- "typescript": "^5.3.0",
16
- "jest": "^29.7.0",
17
- "@types/jest": "^29.5.0",
18
- "ts-jest": "^29.1.0"
19
- },
20
- "dependencies": {
21
- "@dommaker/harness": "^0.1.0"
22
- }
23
- }
@@ -1,2 +0,0 @@
1
- // 入口文件
2
- export {};
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Node",
6
- "lib": ["ES2022"],
7
- "outDir": "./dist",
8
- "rootDir": "./src",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "declaration": true,
14
- "declarationMap": true,
15
- "sourceMap": true
16
- },
17
- "include": ["src/**/*"],
18
- "exclude": ["node_modules", "dist", "__tests__"]
19
- }
@@ -1,39 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
8
-
9
- jobs:
10
- test:
11
- name: Test
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - name: Setup Python
18
- uses: actions/setup-python@v5
19
- with:
20
- python-version: '3.11'
21
- cache: 'pip'
22
-
23
- - name: Install dependencies
24
- run: |
25
- pip install -r requirements.txt
26
- pip install pytest pytest-cov
27
-
28
- - name: Run tests
29
- run: pytest --cov=src --cov-report=xml
30
-
31
- - name: Upload coverage
32
- uses: codecov/codecov-action@v4
33
-
34
- harness:
35
- name: Harness Check
36
- uses: kww/harness/.github/workflows/harness-check.yml@v1
37
- with:
38
- preset: standard
39
- skip-tests: true # Python 项目使用 pytest