@warpgogol/forge 6.3.6 → 8.0.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 (405) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +2 -1
  3. package/bin/cli.js +6 -12
  4. package/bin/resolve-entry.js +24 -0
  5. package/dist/os/compass/comment-safety.d.ts +83 -0
  6. package/dist/os/compass/comment-safety.d.ts.map +1 -0
  7. package/dist/os/compass/comment-safety.js +305 -0
  8. package/dist/os/compass/comment-safety.js.map +1 -0
  9. package/dist/os/compass/compass.module.d.ts.map +1 -1
  10. package/dist/os/compass/compass.module.js +47 -4
  11. package/dist/os/compass/compass.module.js.map +1 -1
  12. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts +2 -1
  13. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts.map +1 -1
  14. package/dist/os/compass/handlers/compass-change-summary-handler.js +34 -10
  15. package/dist/os/compass/handlers/compass-change-summary-handler.js.map +1 -1
  16. package/dist/os/compass/handlers/compass-docs-scaffold.d.ts.map +1 -1
  17. package/dist/os/compass/handlers/compass-docs-scaffold.js +54 -17
  18. package/dist/os/compass/handlers/compass-docs-scaffold.js.map +1 -1
  19. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts +14 -0
  20. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -0
  21. package/dist/os/compass/handlers/compass-header-scaffold-handler.js +261 -0
  22. package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -0
  23. package/dist/os/compass/handlers/compass-header-scaffold.d.ts +31 -0
  24. package/dist/os/compass/handlers/compass-header-scaffold.d.ts.map +1 -0
  25. package/dist/os/compass/handlers/compass-header-scaffold.js +739 -0
  26. package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -0
  27. package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
  28. package/dist/os/compass/handlers/compass-inventory-handler.js +8 -4
  29. package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
  30. package/dist/os/compass/handlers/compass-inventory.d.ts +6 -0
  31. package/dist/os/compass/handlers/compass-inventory.d.ts.map +1 -1
  32. package/dist/os/compass/handlers/compass-inventory.js +28 -13
  33. package/dist/os/compass/handlers/compass-inventory.js.map +1 -1
  34. package/dist/os/compass/handlers/compass-migrate-handler.d.ts.map +1 -1
  35. package/dist/os/compass/handlers/compass-migrate-handler.js +12 -26
  36. package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
  37. package/dist/os/compass/handlers/compass-migrate.d.ts +15 -2
  38. package/dist/os/compass/handlers/compass-migrate.d.ts.map +1 -1
  39. package/dist/os/compass/handlers/compass-migrate.js +58 -20
  40. package/dist/os/compass/handlers/compass-migrate.js.map +1 -1
  41. package/dist/os/compass/handlers/git-revision.d.ts +10 -0
  42. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  43. package/dist/os/compass/handlers/git-revision.js +58 -4
  44. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  45. package/dist/os/compass/handlers/summary-record.d.ts +20 -5
  46. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  47. package/dist/os/compass/handlers/summary-record.js +175 -44
  48. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  49. package/dist/os/compass/index.d.ts +1 -0
  50. package/dist/os/compass/index.d.ts.map +1 -1
  51. package/dist/os/compass/index.js +2 -0
  52. package/dist/os/compass/index.js.map +1 -1
  53. package/dist/os/compass/policy.d.ts +9 -0
  54. package/dist/os/compass/policy.d.ts.map +1 -1
  55. package/dist/os/compass/policy.js +11 -2
  56. package/dist/os/compass/policy.js.map +1 -1
  57. package/dist/os/core/core.module.js +1 -1
  58. package/dist/os/core/handlers/package-health.d.ts.map +1 -1
  59. package/dist/os/core/handlers/package-health.js +1 -6
  60. package/dist/os/core/handlers/package-health.js.map +1 -1
  61. package/dist/os/queue/types.d.ts +2 -0
  62. package/dist/os/queue/types.d.ts.map +1 -1
  63. package/dist/os/queue/types.js +3 -1
  64. package/dist/os/queue/types.js.map +1 -1
  65. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  66. package/dist/os/rfc/acceptance.js +66 -2
  67. package/dist/os/rfc/acceptance.js.map +1 -1
  68. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  69. package/dist/os/rfc/decision-log.js +21 -3
  70. package/dist/os/rfc/decision-log.js.map +1 -1
  71. package/dist/os/rfc/dna-trace.d.ts +2 -0
  72. package/dist/os/rfc/dna-trace.d.ts.map +1 -1
  73. package/dist/os/rfc/dna-trace.js +13 -4
  74. package/dist/os/rfc/dna-trace.js.map +1 -1
  75. package/dist/os/rfc/handlers/implement-stamp-origin.d.ts +37 -0
  76. package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -0
  77. package/dist/os/rfc/handlers/implement-stamp-origin.js +118 -0
  78. package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -0
  79. package/dist/os/rfc/handlers/implement-stamp.d.ts +41 -1
  80. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  81. package/dist/os/rfc/handlers/implement-stamp.js +645 -47
  82. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  83. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts +42 -0
  84. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -0
  85. package/dist/os/rfc/handlers/rfc-evidence-sync.js +147 -0
  86. package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -0
  87. package/dist/os/rfc/handlers/validate-rules.d.ts +9 -1
  88. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  89. package/dist/os/rfc/handlers/validate-rules.js +71 -10
  90. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  91. package/dist/os/rfc/reachable-symbol.d.ts +17 -0
  92. package/dist/os/rfc/reachable-symbol.d.ts.map +1 -0
  93. package/dist/os/rfc/reachable-symbol.js +376 -0
  94. package/dist/os/rfc/reachable-symbol.js.map +1 -0
  95. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  96. package/dist/os/rfc/rfc.module.js +99 -10
  97. package/dist/os/rfc/rfc.module.js.map +1 -1
  98. package/dist/os/rfc/types.d.ts +112 -14
  99. package/dist/os/rfc/types.d.ts.map +1 -1
  100. package/dist/os/rfc/types.js +27 -10
  101. package/dist/os/rfc/types.js.map +1 -1
  102. package/dist/os/rfc/verification-evidence.d.ts +25 -0
  103. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  104. package/dist/os/rfc/verification-evidence.js +244 -13
  105. package/dist/os/rfc/verification-evidence.js.map +1 -1
  106. package/dist/os/rfc/verification-origin.d.ts +58 -0
  107. package/dist/os/rfc/verification-origin.d.ts.map +1 -0
  108. package/dist/os/rfc/verification-origin.js +346 -0
  109. package/dist/os/rfc/verification-origin.js.map +1 -0
  110. package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
  111. package/dist/os/rfc/verification-refresh.js +11 -1
  112. package/dist/os/rfc/verification-refresh.js.map +1 -1
  113. package/dist/os/rfc/verify-workspace.d.ts +23 -0
  114. package/dist/os/rfc/verify-workspace.d.ts.map +1 -0
  115. package/dist/os/rfc/verify-workspace.js +278 -0
  116. package/dist/os/rfc/verify-workspace.js.map +1 -0
  117. package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
  118. package/dist/os/session/handlers/metrics-rfc.js +3 -0
  119. package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
  120. package/dist/os/spec/spec-status.d.ts.map +1 -1
  121. package/dist/os/spec/spec-status.js +5 -23
  122. package/dist/os/spec/spec-status.js.map +1 -1
  123. package/dist/os/spec/spec-validate.d.ts.map +1 -1
  124. package/dist/os/spec/spec-validate.js +30 -9
  125. package/dist/os/spec/spec-validate.js.map +1 -1
  126. package/dist/os/workflow/handlers.d.ts +0 -4
  127. package/dist/os/workflow/handlers.d.ts.map +1 -1
  128. package/dist/os/workflow/handlers.js +9 -36
  129. package/dist/os/workflow/handlers.js.map +1 -1
  130. package/dist/os/workflow/index.d.ts +2 -2
  131. package/dist/os/workflow/index.d.ts.map +1 -1
  132. package/dist/os/workflow/index.js +1 -1
  133. package/dist/os/workflow/index.js.map +1 -1
  134. package/dist/os/workflow/types.d.ts +0 -19
  135. package/dist/os/workflow/types.d.ts.map +1 -1
  136. package/dist/os/workflow/types.js +0 -2
  137. package/dist/os/workflow/types.js.map +1 -1
  138. package/dist/os/workflow/workflow.module.d.ts.map +1 -1
  139. package/dist/os/workflow/workflow.module.js +6 -15
  140. package/dist/os/workflow/workflow.module.js.map +1 -1
  141. package/dist/src/config/forge-config.d.ts +5 -0
  142. package/dist/src/config/forge-config.d.ts.map +1 -1
  143. package/dist/src/config/forge-config.js +5 -2
  144. package/dist/src/config/forge-config.js.map +1 -1
  145. package/dist/src/onboarding/agents-generate.js +1 -1
  146. package/dist/src/onboarding/doctor.js +3 -3
  147. package/dist/src/onboarding/doctor.js.map +1 -1
  148. package/dist/src/onboarding/init.js +2 -2
  149. package/dist/src/onboarding/nested-agents-templates.js +1 -1
  150. package/dist/src/onboarding/prettierignore.js +1 -1
  151. package/dist/src/onboarding/upgrade.js +2 -2
  152. package/dist/src/onboarding/workspace-discovery.js +1 -1
  153. package/dist/src/profiles/profile-schema.d.ts +2 -0
  154. package/dist/src/profiles/profile-schema.d.ts.map +1 -1
  155. package/dist/src/profiles/profile-schema.js +1 -0
  156. package/dist/src/profiles/profile-schema.js.map +1 -1
  157. package/dist/src/profiles/stack-profile.d.ts +1 -0
  158. package/dist/src/profiles/stack-profile.d.ts.map +1 -1
  159. package/dist/src/skill-schema.d.ts +2 -0
  160. package/dist/src/skill-schema.d.ts.map +1 -1
  161. package/dist/src/skill-schema.js +9 -1
  162. package/dist/src/skill-schema.js.map +1 -1
  163. package/dist/src/types.d.ts +23 -0
  164. package/dist/src/types.d.ts.map +1 -1
  165. package/dist/src/types.js +2 -1
  166. package/dist/src/types.js.map +1 -1
  167. package/docs/reference/cli.md +0 -1
  168. package/docs/reference/programmatic-api.md +1 -1
  169. package/os/adr/handlers/validate.test.ts +14 -0
  170. package/os/compass/comment-safety.ts +331 -0
  171. package/os/compass/compass.module.ts +50 -4
  172. package/os/compass/handlers/compass-change-summary-handler.ts +41 -11
  173. package/os/compass/handlers/compass-docs-scaffold.ts +59 -17
  174. package/os/compass/handlers/compass-game-extensions.test.ts +3 -7
  175. package/os/compass/handlers/compass-header-scaffold-handler.ts +352 -0
  176. package/os/compass/handlers/compass-header-scaffold.ts +847 -0
  177. package/os/compass/handlers/compass-inventory-handler.ts +9 -4
  178. package/os/compass/handlers/compass-inventory.ts +29 -13
  179. package/os/compass/handlers/compass-migrate-handler.ts +13 -27
  180. package/os/compass/handlers/compass-migrate.ts +77 -21
  181. package/os/compass/handlers/git-revision.ts +59 -4
  182. package/os/compass/handlers/resolve-scan-root-package.test.ts +14 -0
  183. package/os/compass/handlers/resolve-scan-root-workpiece.test.ts +14 -0
  184. package/os/compass/handlers/summary-record.ts +194 -41
  185. package/os/compass/handlers/tests/compass-audit-plan.test.ts +6 -0
  186. package/os/compass/handlers/tests/compass-audit-record.test.ts +6 -0
  187. package/os/compass/handlers/tests/compass-audit-validate.test.ts +6 -0
  188. package/os/compass/handlers/tests/compass-change-summary-handler.test.ts +131 -0
  189. package/os/compass/handlers/tests/compass-docs-validate.test.ts +6 -0
  190. package/os/compass/handlers/tests/compass-header-scaffold.test.ts +896 -0
  191. package/os/compass/handlers/tests/compass-ledger-scope.test.ts +6 -0
  192. package/os/compass/handlers/tests/compass-migrate.test.ts +87 -9
  193. package/os/compass/handlers/tests/compass-policy.test.ts +1 -1
  194. package/os/compass/handlers/tests/compass-text-safety.test.ts +271 -0
  195. package/os/compass/handlers/tests/compass-v2-contract.test.ts +52 -3
  196. package/os/compass/handlers/tests/summary-record.test.ts +324 -3
  197. package/os/compass/index.ts +15 -0
  198. package/os/compass/policy.ts +27 -2
  199. package/os/core/core.module.ts +1 -1
  200. package/os/core/handlers/invariant-engine.test.ts +3 -1
  201. package/os/core/handlers/note-frontmatter-validate.test.ts +6 -1
  202. package/os/core/handlers/note-link-validate.test.ts +6 -1
  203. package/os/core/handlers/note-orphan-detect.test.ts +6 -1
  204. package/os/core/handlers/package-health.test.ts +6 -0
  205. package/os/core/handlers/package-health.ts +1 -6
  206. package/os/mission/handlers/archive.test.ts +14 -0
  207. package/os/naming/naming-convention.test.ts +14 -0
  208. package/os/queue/decision-ledger.test.ts +27 -4
  209. package/os/queue/queue-validate.test.ts +14 -0
  210. package/os/queue/types.ts +3 -1
  211. package/os/rfc/acceptance-reachable.test.ts +146 -0
  212. package/os/rfc/acceptance.test.ts +136 -0
  213. package/os/rfc/acceptance.ts +71 -2
  214. package/os/rfc/decision-log.ts +22 -4
  215. package/os/rfc/dna-trace.ts +17 -5
  216. package/os/rfc/frontmatter-io.test.ts +14 -0
  217. package/os/rfc/handlers/implement-stamp-acceptance-verification.test.ts +81 -0
  218. package/os/rfc/handlers/implement-stamp-binding.test.ts +79 -0
  219. package/os/rfc/handlers/implement-stamp-origin.test.ts +132 -0
  220. package/os/rfc/handlers/implement-stamp-origin.ts +154 -0
  221. package/os/rfc/handlers/implement-stamp-stale.test.ts +285 -0
  222. package/os/rfc/handlers/implement-stamp.ts +783 -55
  223. package/os/rfc/handlers/lifecycle.test.ts +14 -0
  224. package/os/rfc/handlers/rfc-evidence-sync.ts +221 -0
  225. package/os/rfc/handlers/validate-rules-rfc0997.test.ts +14 -0
  226. package/os/rfc/handlers/validate-rules-rfc1006.test.ts +14 -0
  227. package/os/rfc/handlers/validate-rules-rfc1330.test.ts +120 -0
  228. package/os/rfc/handlers/validate-rules-rfc1334.test.ts +65 -0
  229. package/os/rfc/handlers/validate-rules.test.ts +56 -0
  230. package/os/rfc/handlers/validate-rules.ts +101 -10
  231. package/os/rfc/handlers/validate.test.ts +4 -3
  232. package/os/rfc/reachable-symbol.ts +441 -0
  233. package/os/rfc/rfc-0000-template.md +21 -1
  234. package/os/rfc/rfc-create-concurrent.test.ts +6 -0
  235. package/os/rfc/rfc-create-hint.test.ts +6 -0
  236. package/os/rfc/rfc-read-only-no-side-effects.test.ts +6 -0
  237. package/os/rfc/rfc.module.ts +106 -10
  238. package/os/rfc/types.ts +151 -14
  239. package/os/rfc/verification-emit-check.test.ts +215 -0
  240. package/os/rfc/verification-emit-freshness.test.ts +415 -0
  241. package/os/rfc/verification-emit.test.ts +14 -0
  242. package/os/rfc/verification-evidence.ts +301 -13
  243. package/os/rfc/verification-normalize.test.ts +75 -0
  244. package/os/rfc/verification-origin.test.ts +236 -0
  245. package/os/rfc/verification-origin.ts +417 -0
  246. package/os/rfc/verification-refresh.test.ts +14 -0
  247. package/os/rfc/verification-refresh.ts +12 -1
  248. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +78 -0
  249. package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +81 -0
  250. package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +50 -0
  251. package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +103 -0
  252. package/os/rfc/verify-workspace.test.ts +122 -0
  253. package/os/rfc/verify-workspace.ts +342 -0
  254. package/os/session/handlers/metrics-rfc.ts +3 -0
  255. package/os/spec/spec-status.test.ts +130 -0
  256. package/os/spec/spec-status.ts +5 -18
  257. package/os/spec/spec-validate.test.ts +76 -1
  258. package/os/spec/spec-validate.ts +26 -7
  259. package/os/workflow/handlers.ts +8 -42
  260. package/os/workflow/index.ts +1 -4
  261. package/os/workflow/types.ts +0 -22
  262. package/os/workflow/workflow.module.ts +6 -16
  263. package/package.json +1 -1
  264. package/skills/_shared/agent-operating-model.md +83 -0
  265. package/skills/_shared/fo-pipeline-conventions.md +1 -0
  266. package/skills/fo/fo-add-tests/SKILL.md +14 -0
  267. package/skills/fo/fo-fix/SKILL.md +2 -1
  268. package/skills/fo/fo-handoff/SKILL.md +1 -1
  269. package/skills/fo/fo-idea/SKILL.md +6 -3
  270. package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +8 -0
  271. package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +4 -2
  272. package/skills/fo/fo-idea-implement/SKILL.md +68 -53
  273. package/skills/fo/fo-idea-plan/SKILL.md +3 -1
  274. package/skills/fo/fo-review/SKILL.md +12 -0
  275. package/skills/fo/fo-session-save/learned-principles.md +13 -0
  276. package/skills/fo/fo-step-commit/SKILL.md +1 -1
  277. package/src/bin-entry.test.ts +37 -0
  278. package/src/compass/contract-registry.test.ts +14 -0
  279. package/src/compass/types.test.ts +14 -0
  280. package/src/config/__tests__/resolve-terminology.test.ts +14 -0
  281. package/src/config/forge-config.test.ts +14 -0
  282. package/src/config/forge-config.ts +7 -2
  283. package/src/forge-module.test.ts +14 -0
  284. package/src/knowledge/__tests__/promote.test.ts +14 -0
  285. package/src/knowledge/__tests__/serialize.test.ts +14 -0
  286. package/src/knowledge/__tests__/sync.test.ts +4 -1
  287. package/src/knowledge/budgets.test.ts +14 -0
  288. package/src/knowledge/compact.test.ts +14 -0
  289. package/src/knowledge/parse.test.ts +14 -0
  290. package/src/knowledge/schema.test.ts +14 -0
  291. package/src/migration-adapters/__tests__/ignored-files.test.ts +14 -0
  292. package/src/migration-adapters/__tests__/registry.test.ts +14 -0
  293. package/src/migration-adapters/__tests__/types.test.ts +14 -0
  294. package/src/onboarding/__tests__/workspace-discovery.test.ts +14 -0
  295. package/src/onboarding/agents-generate.ts +1 -1
  296. package/src/onboarding/compass-docs/semantic-layer-block.test.ts +6 -0
  297. package/src/onboarding/create.test.ts +14 -0
  298. package/src/onboarding/doctor-token-check.test.ts +3 -0
  299. package/src/onboarding/doctor.test.ts +14 -0
  300. package/src/onboarding/doctor.ts +3 -3
  301. package/src/onboarding/init.test.ts +14 -0
  302. package/src/onboarding/init.ts +2 -2
  303. package/src/onboarding/nested-agents-templates.ts +1 -1
  304. package/src/onboarding/prettierignore.ts +1 -1
  305. package/src/onboarding/scaffold.test.ts +14 -0
  306. package/src/onboarding/site-workshop-profile.test.ts +3 -0
  307. package/src/onboarding/templates/behavioral-layer-core.md +8 -0
  308. package/src/onboarding/upgrade.test.ts +14 -0
  309. package/src/onboarding/upgrade.ts +2 -2
  310. package/src/onboarding/workspace-discovery.ts +1 -1
  311. package/src/pipeline-status.test.ts +14 -0
  312. package/src/plugin/forge-plugin-manifest.test.ts +14 -0
  313. package/src/profiles/__tests__/profile-schema.test.ts +14 -0
  314. package/src/profiles/__tests__/stack-profile.test.ts +14 -0
  315. package/src/profiles/__tests__/terminology-utils.test.ts +14 -0
  316. package/src/profiles/profile-schema.ts +1 -0
  317. package/src/skill-schema.ts +9 -1
  318. package/src/tests/acceptance-criteria.test.ts +14 -0
  319. package/src/tests/acceptance-probe-kinds.test.ts +14 -0
  320. package/src/tests/adr-implement-stamp.test.ts +14 -0
  321. package/src/tests/agents-generate-domain.test.ts +3 -0
  322. package/src/tests/agents-generate.test.ts +3 -0
  323. package/src/tests/bindings-schema.test.ts +2 -0
  324. package/src/tests/budgets.test.ts +14 -0
  325. package/src/tests/compact.test.ts +14 -0
  326. package/src/tests/compass-docs-flag.test.ts +6 -0
  327. package/src/tests/compass-docs-scaffold.test.ts +6 -0
  328. package/src/tests/compass-docs-validate-scope.test.ts +6 -0
  329. package/src/tests/contract-registry.test.ts +14 -0
  330. package/src/tests/create.test.ts +3 -0
  331. package/src/tests/discover-pack-skills.test.ts +14 -0
  332. package/src/tests/doctor-autonomy.test.ts +3 -0
  333. package/src/tests/doctor-bindings.test.ts +6 -1
  334. package/src/tests/doctor-dist-freshness.test.ts +26 -2
  335. package/src/tests/doctor-domain.test.ts +6 -1
  336. package/src/tests/doctor-fix.test.ts +3 -0
  337. package/src/tests/doctor-nested-agents.test.ts +3 -0
  338. package/src/tests/doctor-profile-id-known.test.ts +3 -0
  339. package/src/tests/doctor-skills-unmanaged.test.ts +3 -0
  340. package/src/tests/doctor-version-sync.test.ts +4 -1
  341. package/src/tests/editable-generated-region.test.ts +6 -3
  342. package/src/tests/exploration-handlers.test.ts +14 -0
  343. package/src/tests/file-size-lint.test.ts +6 -1
  344. package/src/tests/fixtures/agents-generate-business-before.txt +8 -0
  345. package/src/tests/forge-autonomy-validate.test.ts +3 -1
  346. package/src/tests/forge-config.test.ts +6 -1
  347. package/src/tests/forge-validate-compass-docs.test.ts +6 -0
  348. package/src/tests/fs-atomic.test.ts +14 -0
  349. package/src/tests/fs.test.ts +14 -0
  350. package/src/tests/generated-marker.test.ts +14 -0
  351. package/src/tests/hash.test.ts +14 -0
  352. package/src/tests/implement-stamp.test.ts +476 -10
  353. package/src/tests/init-bindings.test.ts +6 -1
  354. package/src/tests/knowledge-parse.test.ts +14 -0
  355. package/src/tests/knowledge-pbt.test.ts +14 -0
  356. package/src/tests/markdown-table.test.ts +6 -3
  357. package/src/tests/memory-compact.test.ts +3 -0
  358. package/src/tests/memory-scaffold.test.ts +6 -1
  359. package/src/tests/metrics-rfc-1053.test.ts +14 -0
  360. package/src/tests/migration-adapters.test.ts +3 -0
  361. package/src/tests/package-files.test.ts +4 -1
  362. package/src/tests/package-health-lint-surface.test.ts +3 -0
  363. package/src/tests/pinned-check.test.ts +14 -0
  364. package/src/tests/pinned-init.test.ts +14 -0
  365. package/src/tests/pinned-validate.test.ts +14 -0
  366. package/src/tests/plugin-manifest.test.ts +14 -0
  367. package/src/tests/prettierignore-manage.test.ts +3 -0
  368. package/src/tests/profile-schema.test.ts +6 -1
  369. package/src/tests/profile-validate.test.ts +6 -1
  370. package/src/tests/program-lease.test.ts +3 -0
  371. package/src/tests/program-paths-extended.test.ts +3 -0
  372. package/src/tests/program-paths.test.ts +3 -0
  373. package/src/tests/program-property.test.ts +3 -0
  374. package/src/tests/program-schemas.test.ts +3 -0
  375. package/src/tests/program-spec-node.test.ts +3 -0
  376. package/src/tests/promote.test.ts +14 -0
  377. package/src/tests/public-surface.test.ts +6 -1
  378. package/src/tests/registry.test.ts +14 -0
  379. package/src/tests/rfc-evidence-sync.test.ts +347 -0
  380. package/src/tests/rfc-implement-stamp-governance.test.ts +403 -0
  381. package/src/tests/scaffold-project.test.ts +3 -0
  382. package/src/tests/session-handlers.test.ts +14 -0
  383. package/src/tests/session-pbt.test.ts +14 -0
  384. package/src/tests/skill-agents-sync.test.ts +3 -4
  385. package/src/tests/skill-schema.test.ts +53 -0
  386. package/src/tests/skill-sync-marker.test.ts +3 -0
  387. package/src/tests/skill-validate-knowledge.test.ts +14 -0
  388. package/src/tests/skill-validate.test.ts +14 -0
  389. package/src/tests/stack-profile.test.ts +6 -1
  390. package/src/tests/string-utils.test.ts +14 -0
  391. package/src/tests/upgrade.test.ts +6 -1
  392. package/src/tests/werkstatt-lock.test.ts +14 -0
  393. package/src/tests/workspace-discovery-domain.test.ts +6 -1
  394. package/src/tests/workspace-discovery.test.ts +6 -1
  395. package/src/types.test.ts +14 -0
  396. package/src/types.ts +30 -1
  397. package/src/utils/__tests__/fs-idempotent.test.ts +17 -0
  398. package/src/utils/__tests__/fs-trash.test.ts +17 -0
  399. package/src/utils/fs-atomic.test.ts +17 -0
  400. package/src/utils/fs-trash-sync.test.ts +17 -0
  401. package/src/utils/fs.test.ts +17 -0
  402. package/src/utils/generated-marker.test.ts +17 -0
  403. package/src/utils/hash.test.ts +17 -0
  404. package/src/utils/string-utils.test.ts +17 -0
  405. package/src/validators/__tests__/note-orphan-detect.test.ts +14 -0
@@ -1,3 +1,17 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>
4
+ Unit tests for lifecycle covering RFC-CMD-02/03 cutoff behavior. It also guards the documented public contract and regression-sensitive edge cases.
5
+ </purpose>
6
+ <non-goals>
7
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
8
+ </non-goals>
9
+ </MODULE_CONTRACT>
10
+ <CHANGE_SUMMARY>
11
+ <item>RFC-1311: Compass header sweep — declares the lifecycle suite's contract for test-file scaffold coverage.</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
1
15
  import { test, expect, describe } from "vitest";
2
16
  import { collectRfcCommandLifecycleViolations } from "./lifecycle.ts";
3
17
  import type { ParsedRfc } from "../frontmatter-io.ts";
@@ -0,0 +1,221 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>
4
+ RFC-1306: rfc.evidence.sync — one-command evidence resync before stamp.
5
+ Runs the workspace's generated-manifest chain in dependency order and
6
+ finishes with rfc.verification.emit when --id is given, so a single
7
+ invocation attests "all generated artifacts + RFC evidence are current".
8
+ </purpose>
9
+ <non-goals>
10
+ <item>Does not reimplement generator logic — every step is delegated by name through the host's invocation port.</item>
11
+ <item>Does not run inside pipelines — sync is an explicit on-demand command like rfc.verification.emit.</item>
12
+ </non-goals>
13
+ </MODULE_CONTRACT>
14
+ <KEY_DECISIONS>
15
+ <item>Step order is contract: the ecosystem manifest hashes the other artifacts, so ecosystem.manifest.generate runs last among the manifest steps.</item>
16
+ <item>EVIDENCE_SYNC_STEPS is the canonical regen list</item>
17
+ </KEY_DECISIONS>
18
+ <CHANGE_SUMMARY>
19
+ <item>RFC-1306: initial — EVIDENCE_SYNC_STEPS chain + runRfcEvidenceSync via the ctx.invoke port; EVIDENCE-SYNC-01 fail-closed without a kernel host, EVIDENCE-SYNC-02 propagates a failed step's diagnostics verbatim; review-r1: try/catch maps thrown invokes into EVIDENCE-SYNC-02, dry-run exposes `planned` in data.</item>
20
+ <item>RFC-1306: review-r1 — io-native writes, cacheable off on chain generators, EVIDENCE-SYNC-02 on invoke throws</item>
21
+ </CHANGE_SUMMARY>
22
+ */
23
+
24
+ import type {
25
+ ForgeCommandInput,
26
+ ForgeCommandResult,
27
+ ForgeRuntimeContext,
28
+ } from "../../../src/types.ts";
29
+
30
+ /**
31
+ * The canonical RFC-evidence regen order (RFC-1306). The emit step is
32
+ * appended conditionally on --id — the chain ends at rfc.verification.emit,
33
+ * which never re-enters this command.
34
+ */
35
+ export const EVIDENCE_SYNC_STEPS: readonly string[] = [
36
+ "checks.commands.generate",
37
+ "command.manifest.generate",
38
+ "validator.inventory.generate",
39
+ "docs.commands.generate",
40
+ "ecosystem.manifest.generate",
41
+ ];
42
+
43
+ export const EVIDENCE_SYNC_EMIT_STEP = "rfc.verification.emit";
44
+
45
+ export interface RfcEvidenceSyncStepResult {
46
+ step: string;
47
+ flags?: Record<string, unknown>;
48
+ exitCode: number;
49
+ status: "pass" | "fail";
50
+ filesModified: string[];
51
+ summary?: string;
52
+ }
53
+
54
+ export interface RfcEvidenceSyncViolation {
55
+ rule: string;
56
+ message: string;
57
+ step?: string;
58
+ /** The failed step's diagnostics/violations payload, verbatim. */
59
+ stepDiagnostics?: unknown;
60
+ }
61
+
62
+ export interface RfcEvidenceSyncResult {
63
+ steps: RfcEvidenceSyncStepResult[];
64
+ rfcId?: string;
65
+ failedStep?: string;
66
+ /** Dry-run only — the ordered step list that would execute. */
67
+ planned?: Array<{ step: string; flags?: Record<string, string> }>;
68
+ }
69
+
70
+ interface SyncReport {
71
+ command: string;
72
+ status: "pass" | "fail";
73
+ violations: RfcEvidenceSyncViolation[];
74
+ data?: RfcEvidenceSyncResult;
75
+ }
76
+
77
+ function childDiagnostics(data: unknown): unknown {
78
+ if (data !== null && typeof data === "object") {
79
+ const record = data as Record<string, unknown>;
80
+ return record["diagnostics"] ?? record["violations"];
81
+ }
82
+ return undefined;
83
+ }
84
+
85
+ function syncResult(
86
+ status: "pass" | "fail",
87
+ violations: RfcEvidenceSyncViolation[],
88
+ data: RfcEvidenceSyncResult | undefined,
89
+ summary: string,
90
+ ): ForgeCommandResult<SyncReport> {
91
+ return {
92
+ data: { command: "rfc.evidence.sync", status, violations, ...(data ? { data } : {}) },
93
+ exitCode: status === "pass" ? 0 : 1,
94
+ summary,
95
+ };
96
+ }
97
+
98
+ export async function runRfcEvidenceSync(
99
+ input: ForgeCommandInput,
100
+ context: ForgeRuntimeContext,
101
+ ): Promise<ForgeCommandResult<SyncReport>> {
102
+ const { logger, outputFormat } = context;
103
+ const rfcId = input.flags["id"];
104
+ const rfcIdStr = typeof rfcId === "string" && rfcId !== "" ? rfcId : undefined;
105
+ const isDryRun = context.dryRun || input.flags["dry-run"] === true;
106
+
107
+ const plan: Array<{ step: string; flags?: Record<string, string> }> = [
108
+ ...EVIDENCE_SYNC_STEPS.map((step) => ({ step })),
109
+ ...(rfcIdStr ? [{ step: EVIDENCE_SYNC_EMIT_STEP, flags: { id: rfcIdStr } }] : []),
110
+ ];
111
+
112
+ if (isDryRun) {
113
+ const lines = plan.map((p) =>
114
+ p.flags
115
+ ? `${p.step} ${Object.entries(p.flags)
116
+ .map(([k, v]) => `--${k}=${v}`)
117
+ .join(" ")}`
118
+ : p.step,
119
+ );
120
+ if (outputFormat === "pretty") {
121
+ logger.info(`[dry-run] rfc.evidence.sync would run ${plan.length} steps:`);
122
+ for (const line of lines) logger.info(` ${line}`);
123
+ }
124
+ return {
125
+ data: {
126
+ command: "rfc.evidence.sync",
127
+ status: "pass",
128
+ violations: [],
129
+ data: { steps: [], planned: plan, ...(rfcIdStr ? { rfcId: rfcIdStr } : {}) },
130
+ },
131
+ exitCode: 0,
132
+ summary: `[dry-run] rfc.evidence.sync: ${plan.length} steps — ${lines.join(" → ")}`,
133
+ };
134
+ }
135
+
136
+ // EVIDENCE-SYNC-01: the orchestration port exists only under a kernel
137
+ // host — the standalone forge CLI has no executeKernelCommand behind it.
138
+ const invoke = context.invoke;
139
+ if (!invoke) {
140
+ const violations: RfcEvidenceSyncViolation[] = [
141
+ {
142
+ rule: "EVIDENCE-SYNC-01",
143
+ message:
144
+ "rfc.evidence.sync requires the werkstatt kernel host (context.invoke is absent). Run it via `pnpm exec werkstatt run rfc.evidence.sync`.",
145
+ },
146
+ ];
147
+ if (outputFormat === "pretty") {
148
+ logger.warn(`EVIDENCE-SYNC-01: ${violations[0]!.message}`);
149
+ }
150
+ return syncResult("fail", violations, undefined, "rfc.evidence.sync: no kernel host");
151
+ }
152
+
153
+ const steps: RfcEvidenceSyncStepResult[] = [];
154
+ for (const planned of plan) {
155
+ // A throwing invoke (unresolvable child, host/module failure) still maps
156
+ // into the EVIDENCE-SYNC-02 contract — fail closed, never a raw exception.
157
+ let report: Awaited<ReturnType<typeof invoke>>;
158
+ try {
159
+ report = await invoke(planned.step, planned.flags);
160
+ } catch (err) {
161
+ const violations: RfcEvidenceSyncViolation[] = [
162
+ {
163
+ rule: "EVIDENCE-SYNC-02",
164
+ message: `Step "${planned.step}" threw: ${err instanceof Error ? err.message : String(err)}. Partial sync — earlier steps were applied.`,
165
+ step: planned.step,
166
+ },
167
+ ];
168
+ return syncResult(
169
+ "fail",
170
+ violations,
171
+ { steps, failedStep: planned.step, ...(rfcIdStr ? { rfcId: rfcIdStr } : {}) },
172
+ `rfc.evidence.sync: step "${planned.step}" threw`,
173
+ );
174
+ }
175
+ const filesModified = report.filesModified ?? [];
176
+ const stepResult: RfcEvidenceSyncStepResult = {
177
+ step: planned.step,
178
+ ...(planned.flags ? { flags: planned.flags } : {}),
179
+ exitCode: report.exitCode,
180
+ status: report.exitCode === 0 ? "pass" : "fail",
181
+ filesModified,
182
+ ...(report.summary ? { summary: report.summary } : {}),
183
+ };
184
+ steps.push(stepResult);
185
+ if (outputFormat === "pretty") {
186
+ const changed = filesModified.length;
187
+ logger.info(
188
+ ` ${planned.step}: ${stepResult.status}${changed > 0 ? ` (${changed} file${changed === 1 ? "" : "s"} changed)` : ""}`,
189
+ );
190
+ }
191
+
192
+ // EVIDENCE-SYNC-02: stop on the first failing step — a partial sync is
193
+ // reported with the step's diagnostics verbatim, never silently tolerated.
194
+ if (report.exitCode !== 0) {
195
+ const violations: RfcEvidenceSyncViolation[] = [
196
+ {
197
+ rule: "EVIDENCE-SYNC-02",
198
+ message: `Step "${planned.step}" failed (exit ${report.exitCode})${report.summary ? `: ${report.summary}` : ""}. Partial sync — earlier steps were applied.`,
199
+ step: planned.step,
200
+ ...(childDiagnostics(report.data) !== undefined
201
+ ? { stepDiagnostics: childDiagnostics(report.data) }
202
+ : {}),
203
+ },
204
+ ];
205
+ return syncResult(
206
+ "fail",
207
+ violations,
208
+ { steps, failedStep: planned.step, ...(rfcIdStr ? { rfcId: rfcIdStr } : {}) },
209
+ `rfc.evidence.sync: failed at step "${planned.step}"`,
210
+ );
211
+ }
212
+ }
213
+
214
+ const changedFiles = [...new Set(steps.flatMap((s) => s.filesModified))];
215
+ return syncResult(
216
+ "pass",
217
+ [],
218
+ { steps, ...(rfcIdStr ? { rfcId: rfcIdStr } : {}) },
219
+ `rfc.evidence.sync: ${steps.length} steps clean, ${changedFiles.length} file${changedFiles.length === 1 ? "" : "s"} changed`,
220
+ );
221
+ }
@@ -1,3 +1,17 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>
4
+ Unit tests for validate rules rfc0997 covering evaluateAcceptanceCriteria: AC-N id parsing (RFC-0997); computeProbeCoverage (RFC-0997); V-35: probe→criterion referential integrity (RFC-0997).
5
+ </purpose>
6
+ <non-goals>
7
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
8
+ </non-goals>
9
+ </MODULE_CONTRACT>
10
+ <CHANGE_SUMMARY>
11
+ <item>RFC-1311: Compass header sweep — declares the validate suite's contract for test-file scaffold coverage.</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
1
15
  import { test, expect, describe } from "vitest";
2
16
  import {
3
17
  evaluateAcceptanceCriteria,
@@ -1,3 +1,17 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>
4
+ Unit tests for validate rules rfc1006 covering evaluateDocumentReadiness (RFC-1006); V-38: document readiness completeness (RFC-1006); V-39: non-atomic criterion (RFC-1006).
5
+ </purpose>
6
+ <non-goals>
7
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
8
+ </non-goals>
9
+ </MODULE_CONTRACT>
10
+ <CHANGE_SUMMARY>
11
+ <item>RFC-1311: Compass header sweep — declares the validate suite's contract for test-file scaffold coverage.</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
1
15
  import { test, expect, describe } from "vitest";
2
16
  import {
3
17
  evaluateAcceptanceCriteria,
@@ -0,0 +1,120 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>Unit tests for validate rules rfc1330 covering V-44: WHEN/IF behavioral criteria bound only to presence probes are rejected for post-cutoff RFCs.</purpose>
4
+ <non-goals>
5
+ <item>Not a contract source of truth — validate-rules.ts owns V-44; fixtures are minimal scaffolding only.</item>
6
+ </non-goals>
7
+ </MODULE_CONTRACT>
8
+ <CHANGE_SUMMARY>
9
+ <item>RFC-1330: V-44 tests.</item>
10
+ </CHANGE_SUMMARY>
11
+ */
12
+
13
+ import { describe, expect, test } from "vitest";
14
+ import { join } from "node:path";
15
+ import { tmpdir } from "node:os";
16
+ import {
17
+ findPresenceOnlyBehavioralCriteria,
18
+ type AddViolationFn,
19
+ validateSingleRfc,
20
+ } from "./validate-rules.ts";
21
+ import type { ParsedRfc } from "../frontmatter-io.ts";
22
+ import type { AcceptanceProbe } from "../types.ts";
23
+
24
+ const BODY = (criteria: string): string => `
25
+ # RFC-9998: Test RFC
26
+
27
+ ## Acceptance criteria
28
+
29
+ ${criteria}
30
+
31
+ ## Implementation notes for agents
32
+
33
+ Notes.
34
+ `;
35
+
36
+ async function v44(createdAt: string, criteria: string, probes: AcceptanceProbe[]) {
37
+ const parsed: ParsedRfc = {
38
+ frontmatter: {
39
+ id: "RFC-9998",
40
+ title: "Test RFC",
41
+ status: "draft",
42
+ kind: "command",
43
+ scope: "workspace",
44
+ owners: ["architecture"],
45
+ createdAt,
46
+ updatedAt: createdAt,
47
+ acceptance: probes,
48
+ },
49
+ body: BODY(criteria),
50
+ };
51
+ const found: string[] = [];
52
+ const add: AddViolationFn = (_id, _file, rule, message) => {
53
+ if (rule === "V-44") found.push(message);
54
+ };
55
+ await validateSingleRfc(
56
+ "rfc-9998-test.md",
57
+ parsed,
58
+ new Map(),
59
+ new Map(),
60
+ new Set(),
61
+ new Set(),
62
+ new Set(Object.keys(parsed.frontmatter)),
63
+ join(tmpdir(), "test-workspace-rfc1330"),
64
+ add,
65
+ );
66
+ return found;
67
+ }
68
+
69
+ const presence: AcceptanceProbe = {
70
+ probe: "file-contains",
71
+ criterion: "AC-1",
72
+ path: "packages/x/src/gate.ts",
73
+ pattern: "EC-99",
74
+ };
75
+
76
+ describe("V-44 (RFC-1330)", () => {
77
+ test("V-44 rejects an event criterion bound only to presence probes", async () => {
78
+ const found = await v44(
79
+ "2026-10-18",
80
+ "- [ ] AC-1: WHEN a commit weakens a test, THE gate SHALL block it.",
81
+ [presence],
82
+ );
83
+ expect(found).toHaveLength(1);
84
+ expect(found[0]).toContain("AC-1");
85
+ });
86
+
87
+ test("accepts an event criterion that also has an execution probe", async () => {
88
+ const found = await v44(
89
+ "2026-10-18",
90
+ "- [ ] AC-1: IF the input is empty, THEN the command SHALL fail.",
91
+ [presence, { probe: "test", criterion: "AC-1", file: "a.test.ts", expect: { exitCode: 0 } }],
92
+ );
93
+ expect(found).toEqual([]);
94
+ });
95
+
96
+ test("leaves invariant-form and doc-targeted criteria alone", () => {
97
+ const body = BODY(
98
+ "- [ ] AC-1: THE module SHALL export X.\n- [ ] AC-2: WHEN archived, THE index SHALL list it.",
99
+ );
100
+ const offenders = findPresenceOnlyBehavioralCriteria(body, [
101
+ presence,
102
+ { probe: "file-contains", criterion: "AC-2", path: "docs/index.md", pattern: "x" },
103
+ ]);
104
+ expect(offenders).toEqual([]);
105
+ });
106
+
107
+ test("treats uppercase checked boxes as criteria", () => {
108
+ const body = BODY("- [X] AC-1: WHEN a commit weakens a test, THE gate SHALL block it.");
109
+ expect(findPresenceOnlyBehavioralCriteria(body, [presence])).toEqual(["AC-1"]);
110
+ });
111
+
112
+ test("exempts RFCs created before the cutoff", async () => {
113
+ const found = await v44(
114
+ "2026-10-17",
115
+ "- [ ] AC-1: WHEN a commit weakens a test, THE gate SHALL block it.",
116
+ [presence],
117
+ );
118
+ expect(found).toEqual([]);
119
+ });
120
+ });
@@ -0,0 +1,65 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1334: V-45 tests — post-cutoff proposed/added commands without a command-mode reachable probe warn.</purpose>
4
+ <non-goals>
5
+ <item>Not a probe-execution suite.</item>
6
+ </non-goals>
7
+ </MODULE_CONTRACT>
8
+ <CHANGE_SUMMARY>
9
+ <item>RFC-1334: tests for AC-8.</item>
10
+ <item>RFC-1334: step 4 — reachable acceptance probe (symbol and command modes) and V-45</item>
11
+ </CHANGE_SUMMARY>
12
+ */
13
+
14
+ import { describe, expect, test } from "vitest";
15
+ import { join } from "node:path";
16
+ import { tmpdir } from "node:os";
17
+ import { type AddViolationFn, validateSingleRfc } from "./validate-rules.ts";
18
+ import type { ParsedRfc } from "../frontmatter-io.ts";
19
+
20
+ async function v45(acceptance: unknown[]): Promise<Array<{ message: string; severity: string }>> {
21
+ const parsed: ParsedRfc = {
22
+ frontmatter: {
23
+ id: "RFC-9997",
24
+ title: "T",
25
+ status: "draft",
26
+ kind: "command",
27
+ scope: "workspace",
28
+ owners: ["architecture"],
29
+ createdAt: "2026-10-18",
30
+ updatedAt: "2026-10-18",
31
+ commands: { proposed: ["demo.run"], added: [], changed: [], removed: [] },
32
+ acceptance,
33
+ },
34
+ body: "\n# RFC-9997: T\n\n## Acceptance criteria\n\n- [ ] AC-1: THE x SHALL y.\n",
35
+ };
36
+ const out: Array<{ message: string; severity: string }> = [];
37
+ const add: AddViolationFn = (_id, _f, rule, message, severity = "error") => {
38
+ if (rule === "V-45") out.push({ message, severity });
39
+ };
40
+ await validateSingleRfc(
41
+ "rfc-9997-t.md",
42
+ parsed,
43
+ new Map(),
44
+ new Map(),
45
+ new Set(),
46
+ new Set(),
47
+ new Set(Object.keys(parsed.frontmatter)),
48
+ join(tmpdir(), "ws-1334"),
49
+ add,
50
+ );
51
+ return out;
52
+ }
53
+
54
+ describe("V-45 (RFC-1334)", () => {
55
+ test("V-45 warns when a proposed command has no reachable probe", async () => {
56
+ const found = await v45([]);
57
+ expect(found).toHaveLength(1);
58
+ expect(found[0]?.severity).toBe("warning");
59
+ expect(found[0]?.message).toContain("demo.run");
60
+ });
61
+
62
+ test("stays quiet when a command-mode reachable probe covers the command", async () => {
63
+ expect(await v45([{ probe: "reachable", command: "demo.run", criterion: "AC-1" }])).toEqual([]);
64
+ });
65
+ });
@@ -1,3 +1,17 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>
4
+ Unit tests for validate rules covering V-26: implemented RFCs must have all acceptance criteria checked; V-27: checked criteria must carry inline evidence; V-31: filename-number uniqueness and filename/id consistency.
5
+ </purpose>
6
+ <non-goals>
7
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
8
+ </non-goals>
9
+ </MODULE_CONTRACT>
10
+ <CHANGE_SUMMARY>
11
+ <item>RFC-1311: Compass header sweep — declares the validate suite's contract for test-file scaffold coverage.</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
1
15
  import { test, expect, describe } from "vitest";
2
16
  import {
3
17
  validateSingleRfc,
@@ -760,6 +774,48 @@ describe("RFC-DIR-01: directory structure convention (RFC-0722)", () => {
760
774
  expect(dir01).toHaveLength(0);
761
775
  });
762
776
 
777
+ test("V-23 fires on non-archived implemented RFC with missing evidence", async () => {
778
+ const parsed = makeParsed("implemented", BASE_BODY, {
779
+ createdAt: "2026-10-01",
780
+ acceptance: [{ probe: "file-exists", path: "x.ts", criterion: "AC-1" }],
781
+ });
782
+ const { add, violations } = makeViolationsCollector();
783
+ await validateSingleRfc(
784
+ "rfc-9999-test.md",
785
+ parsed,
786
+ new Map(),
787
+ new Map(),
788
+ new Set(),
789
+ new Set(),
790
+ new Set(Object.keys(parsed.frontmatter)),
791
+ testWorkspace,
792
+ add,
793
+ );
794
+ const v23 = filterRule(violations, "V-23");
795
+ expect(v23).toHaveLength(1);
796
+ });
797
+
798
+ test("V-23 skips archived implemented RFCs (RFC-1271 — historical evidence drift is not debt)", async () => {
799
+ const parsed = makeParsed("implemented", BASE_BODY, {
800
+ createdAt: "2026-10-01",
801
+ acceptance: [{ probe: "file-exists", path: "x.ts", criterion: "AC-1" }],
802
+ });
803
+ const { add, violations } = makeViolationsCollector();
804
+ await validateSingleRfc(
805
+ "archive/implemented/rfc-9999-test.md",
806
+ parsed,
807
+ new Map(),
808
+ new Map(),
809
+ new Set(),
810
+ new Set(),
811
+ new Set(Object.keys(parsed.frontmatter)),
812
+ testWorkspace,
813
+ add,
814
+ );
815
+ const v23 = filterRule(violations, "V-23");
816
+ expect(v23).toHaveLength(0);
817
+ });
818
+
763
819
  test("no warning when RFC file is in verification/ subdirectory", async () => {
764
820
  const parsed = makeParsed("accepted", BASE_BODY);
765
821
  const { add, violations } = makeViolationsCollector();