@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
@@ -12,7 +12,13 @@ import type { ForgeCommandInput, ForgeRuntimeContext } from "../../src/types.ts"
12
12
  RFC ids — the wx (exclusive-create) write + bounded retry on EEXIST
13
13
  replaces the old scan-then-write race.
14
14
  </purpose>
15
+ <non-goals>
16
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
17
+ </non-goals>
15
18
  </MODULE_CONTRACT>
19
+ <CHANGE_SUMMARY>
20
+ <item>RFC-1311: Compass header sweep — declares the rfc suite's contract for test-file scaffold coverage.</item>
21
+ </CHANGE_SUMMARY>
16
22
  */
17
23
 
18
24
  const RFC_TEMPLATE = `---
@@ -5,7 +5,13 @@
5
5
  executable command — correct binary (werkstatt, not forge), correct
6
6
  subcommand (run), and correct flags (--id, not --file).
7
7
  </purpose>
8
+ <non-goals>
9
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
10
+ </non-goals>
8
11
  </MODULE_CONTRACT>
12
+ <CHANGE_SUMMARY>
13
+ <item>RFC-1311: Compass header sweep — declares the rfc suite's contract for test-file scaffold coverage.</item>
14
+ </CHANGE_SUMMARY>
9
15
  */
10
16
 
11
17
  import { describe, expect, it, beforeEach, afterEach } from "vitest";
@@ -5,7 +5,13 @@
5
5
  no ambient regeneration of tracked generated files as a side effect.
6
6
  Guards against future read-path writers.
7
7
  </purpose>
8
+ <non-goals>
9
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
10
+ </non-goals>
8
11
  </MODULE_CONTRACT>
12
+ <CHANGE_SUMMARY>
13
+ <item>RFC-1311: Compass header sweep — declares the rfc suite's contract for test-file scaffold coverage.</item>
14
+ </CHANGE_SUMMARY>
9
15
  */
10
16
 
11
17
  import { describe, expect, it, beforeEach, afterEach } from "vitest";
@@ -7,14 +7,12 @@
7
7
  </non-goals>
8
8
  </MODULE_CONTRACT>
9
9
  <CHANGE_SUMMARY>
10
- <item>RFC-1097: sweep — werkstatt-engine clean
11
-
12
- Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
13
- <item>RFC-1173: declare mutatesState on all kernel commands — collectDeclarationDiagnostics emits error-severity MUTATES-STATE-DECLARED, command.manifest.validate is the blocking consumer in packages.check, sweep declares the flag on every command definition (factories hardcode false for read-only check specs)</item>
14
- <item>RFC-1231: rfc.verification.refresh gains acceptsAllFlag: true — the declared --all flag is now reachable via werkstatt run (consumed selector re-injected as flags.all after the gate).</item>
15
- <item>RFC-1237: honor dry-run via context.dryRun across kernel commands; verification envelopes keep emit-canonical ownership</item>
16
10
  <item>RFC-1249: wire werkstatt.commands.validate into packages.check + retire CMD-OUTPUT debt</item>
17
- <history>RFC-0260, RFC-0795, RFC-1097</history>
11
+ <item>RFC-1271: review wave — deep probe normalization, malformed-envelope fail-closed, post-stamp re-emit, honest repair hints</item>
12
+ <item>RFC-1306: register rfc.evidence.sync (coverage operator, mutatesState, EVIDENCE-SYNC-01/02 rules, generates:[] — artifacts stay owned by delegated steps); rfc.implement.stamp gains --sync.</item>
13
+ <item>RFC-1322: steps 1-3 — --check-criteria flag, auto-check pass, atomic flip+stamp</item>
14
+ <item>RFC-1333: steps 1-3 — report contract, rfc.verify.workspace export, RFC-IMP-12 gate, RFC-IMP-11 blocking</item>
15
+ <history>RFC-0260, RFC-0795, RFC-1097, RFC-1173, RFC-1231, RFC-1237</history>
18
16
  </CHANGE_SUMMARY>
19
17
  */
20
18
 
@@ -41,6 +39,8 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
41
39
  const { runRfcArchive } = await import("./handlers/archive.ts");
42
40
  const { runRfcPipelineStatus } = await import("./handlers/pipeline-status.ts");
43
41
  const { runRfcImplementStamp } = await import("./handlers/implement-stamp.ts");
42
+ const { runRfcEvidenceSync } = await import("./handlers/rfc-evidence-sync.ts");
43
+ const { runRfcVerifyWorkspace } = await import("./verify-workspace.ts");
44
44
  // ── rfc.list ─────────────────────────────────────────────────────────────;
45
45
  return {
46
46
  name: "rfc",
@@ -244,6 +244,32 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
244
244
  cacheable: false,
245
245
  execute: runRfcAcceptanceRun,
246
246
  },
247
+ {
248
+ name: "rfc.verify.workspace",
249
+ modulePath: "packages/forge/os/rfc/rfc.module.ts",
250
+ description:
251
+ "RFC-1333: export a committed candidate as a git-free tree under the OS temp dir for a " +
252
+ "clean-context acceptance verifier — implementer in-range tests, the RFC's plan/review/" +
253
+ "session/queue documents, and its evidence envelope are stripped; VERIFY-BUNDLE.md carries " +
254
+ "only the RFC's Context/Problem/Decision/Design/Acceptance criteria. Writes nothing in the repository.",
255
+ scope: "workspace",
256
+ mutatesState: false,
257
+ contract: "rfc",
258
+ rules: [],
259
+ coverage: "operator",
260
+ writes: [],
261
+ reads: ["docs/rfcs/**/*.md"],
262
+ cacheable: false,
263
+ flags: {
264
+ id: { kind: "string", required: true, description: "Target RFC id." },
265
+ candidate: {
266
+ kind: "string",
267
+ required: true,
268
+ description: "Committed candidate SHA to export.",
269
+ },
270
+ },
271
+ execute: runRfcVerifyWorkspace,
272
+ },
247
273
  {
248
274
  name: "rfc.verification.emit",
249
275
  modulePath: "packages/forge/os/rfc/rfc.module.ts",
@@ -268,6 +294,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
268
294
  kind: "boolean",
269
295
  description: "Run probes and report results without writing envelope files.",
270
296
  },
297
+ check: {
298
+ kind: "boolean",
299
+ description:
300
+ "RFC-1271: recompute evidence and compare the committed envelope against a fresh run on non-volatile fields (rfcFileHash, acceptanceHash, probes[].ok, probes.length, overall). Writes nothing; exits 1 on divergence or a missing envelope — detects forged/hand-edited evidence.",
301
+ },
271
302
  concurrency: {
272
303
  kind: "string",
273
304
  description:
@@ -456,15 +487,25 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
456
487
  description:
457
488
  "RFC-0476: the exclusive atomic path for accepted → implemented transitions. " +
458
489
  "Verifies preconditions (accepted status, checked+evidenced criteria, clean tree, " +
459
- "reachable RFC-referencing commit, passing probe evidence) then atomically sets " +
460
- "status: implemented, implementedAt, and updatedAt. Use --dry-run to preview. Required flags: `--id`.",
490
+ "reachable RFC-referencing commit, passing probe evidence, fresh evidence hashes — " +
491
+ "RFC-IMP-09 stale-evidence gate from RFC-1271) then atomically sets " +
492
+ "status: implemented, implementedAt, and updatedAt. For probe-bearing RFCs the " +
493
+ "evidence envelope is re-emitted post-mutation so it binds the implemented-state " +
494
+ "file (RFC-1271). --check-criteria flips evidenced unchecked criteria " +
495
+ "in the same atomic write and refreshes a missing/stale envelope in-process " +
496
+ "(RFC-1322). Use --dry-run to preview. Required flags: `--id`.",
461
497
  scope: "workspace",
462
498
  mutatesState: true,
463
- writes: ["docs/rfcs/**/*.md"],
499
+ writes: ["docs/rfcs/**/*.md", "docs/rfcs/verification/*.generated.yaml"],
464
500
  generates: [],
465
501
  reads: ["docs/rfcs/**/*.md", "docs/rfcs/verification/*.generated.yaml"],
466
502
  cacheable: false,
467
503
  flags: {
504
+ "waive-independent-verification": {
505
+ kind: "string",
506
+ description:
507
+ "RFC-1333: operator-only waiver for a non-subagent acceptance report on a verificationTier: high RFC (RFC-IMP-12); the reason is recorded as a stamp warning.",
508
+ },
468
509
  id: {
469
510
  kind: "string",
470
511
  required: true,
@@ -481,9 +522,64 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
481
522
  kind: "boolean",
482
523
  description: "Perform all checks without mutating the RFC file or emitting evidence.",
483
524
  },
525
+ sync: {
526
+ kind: "boolean",
527
+ description:
528
+ "RFC-1306: run the rfc.evidence.sync regeneration chain before the stale-evidence gate instead of failing on RFC-IMP-09. Requires a kernel host (context.invoke).",
529
+ },
530
+ "check-criteria": {
531
+ kind: "boolean",
532
+ description:
533
+ "RFC-1322: auto-check unchecked acceptance criteria whose (evidence: ...) " +
534
+ "annotation resolves (test:/file:/<path>:<line> exists; probe:AC-N passes in " +
535
+ "the evidence envelope), refreshing a missing/stale envelope in-process first. " +
536
+ "Unresolvable annotations abort with STAMP-CHECK-01 before any RFC mutation.",
537
+ },
484
538
  },
485
539
  execute: runRfcImplementStamp,
486
540
  },
541
+ {
542
+ name: "rfc.evidence.sync",
543
+ coverage: "operator" as const,
544
+ coverageNote:
545
+ "manual/runbook — pre-stamp evidence resync; also invoked by rfc.implement.stamp --sync",
546
+ modulePath: "packages/forge/os/rfc/rfc.module.ts",
547
+ description:
548
+ "RFC-1306: one-command evidence resync before stamp — runs the generated-manifest " +
549
+ "chain in dependency order (checks.commands.generate → command.manifest.generate → " +
550
+ "validator.inventory.generate → docs.commands.generate → ecosystem.manifest.generate), " +
551
+ "then rfc.verification.emit when --id is given. Delegates each step by name through " +
552
+ "the kernel host's invoke port — fails closed (EVIDENCE-SYNC-01) under the standalone " +
553
+ "forge CLI. Stops on the first failing step with its diagnostics verbatim " +
554
+ "(EVIDENCE-SYNC-02). --dry-run lists the steps without executing.",
555
+ scope: "workspace",
556
+ mutatesState: true,
557
+ rules: ["EVIDENCE-SYNC-01", "EVIDENCE-SYNC-02"],
558
+ flags: {
559
+ id: {
560
+ kind: "string",
561
+ description: "Target a single RFC by id — appends rfc.verification.emit for it.",
562
+ },
563
+ "dry-run": {
564
+ kind: "boolean",
565
+ description: "List the steps without executing (honors context.dryRun, DNA-110).",
566
+ },
567
+ },
568
+ reads: ["docs/rfcs/**/*.md"],
569
+ // The artifacts below stay owned by the delegated generators — sync
570
+ // orchestrates them by name, so generates is empty (OWN-DUP-01).
571
+ generates: [],
572
+ writes: [
573
+ "packages/werkstatt-site/src/checks/command-tables/index.generated.ts",
574
+ "docs/command-manifest.generated.yaml",
575
+ "docs/validator-inventory.generated.yaml",
576
+ "docs/COMMANDS.md",
577
+ "docs/ecosystem.generated.yaml",
578
+ "docs/rfcs/verification/*.generated.yaml",
579
+ ],
580
+ cacheable: false,
581
+ execute: runRfcEvidenceSync,
582
+ },
487
583
  ],
488
584
  pipelines: [],
489
585
  };
package/os/rfc/types.ts CHANGED
@@ -12,16 +12,12 @@
12
12
  * </non-goals>
13
13
  * </MODULE_CONTRACT>
14
14
  * * <CHANGE_SUMMARY>
15
- <item>RFC-0998: added TestProbe and JsonSchemaProbe to AcceptanceProbe union for test and json-schema acceptance probe kinds.</item>
16
- <item>RFC-0999: added lastRefreshedAt to VerificationEvidence; added RfcVerificationRefreshResult interface.</item>
17
- <item>RFC-1097: step 6 — compass.migrate codemod run
18
-
19
- Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
20
- <item>RFC-1097: sweep — packages/forge + services clean
21
-
22
- Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
23
- <item>RFC-1249: wire werkstatt.commands.validate into packages.check + retire CMD-OUTPUT debt</item>
24
- <history>RFC-0465, RFC-0478, RFC-0480, RFC-0795</history>
15
+ <item>RFC-1322: steps 1-3 — --check-criteria flag, auto-check pass, atomic flip+stamp</item>
16
+ <item>RFC-1322: fo-review fix pass — criteriaPendingRefresh/evidenceWouldRefresh dry-run fields</item>
17
+ <item>RFC-1330: origin contracts, RFC_ORIGIN_CUTOFF, RFC-IMP-10/11 rule ids, stamp warnings.</item>
18
+ <item>RFC-1333: steps 1-3 — report contract, rfc.verify.workspace export, RFC-IMP-12 gate, RFC-IMP-11 blocking</item>
19
+ <item>RFC-1334: step 4 — reachable acceptance probe (symbol and command modes) and V-45</item>
20
+ <history>RFC-0465, RFC-0478, RFC-0480, RFC-0795, RFC-0998, RFC-0999, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1320</history>
25
21
  </CHANGE_SUMMARY>
26
22
  ***************************************************************/
27
23
 
@@ -88,6 +84,36 @@ export const RFC_KINDS: readonly RfcKind[] = [
88
84
  export type RfcScope = "app" | "workspace";
89
85
 
90
86
  export const RFC_SCOPES: readonly RfcScope[] = ["app", "workspace"] as const; // ─── Frontmatter ─────────────────────────────────────────────────────────────
87
+
88
+ /**
89
+ * RFC-1271: optional verification rigor declaration — standard (default)
90
+ * checks, high (adds negative-path + independent verification where it
91
+ * genuinely reduces risk), formal (opt-in formal/property methods for
92
+ * precisely specifiable properties). Tier semantics live in
93
+ * `.agents/skills/_shared/agent-operating-model.md`.
94
+ */
95
+ export type RfcVerificationTier = "standard" | "high" | "formal";
96
+
97
+ export const RFC_VERIFICATION_TIERS: readonly RfcVerificationTier[] = [
98
+ "standard",
99
+ "high",
100
+ "formal",
101
+ ] as const;
102
+
103
+ /**
104
+ * RFC-1271: where a check's expected result originates. `self` is
105
+ * implementer-derived (diagnostic, not sole proof); `requirement` follows an
106
+ * accepted requirement; `independent` is fixed before/independently of the
107
+ * implementation; `external` comes from an authoritative external system.
108
+ */
109
+ export type RfcExpectationSource = "self" | "requirement" | "independent" | "external";
110
+
111
+ export const RFC_EXPECTATION_SOURCES: readonly RfcExpectationSource[] = [
112
+ "self",
113
+ "requirement",
114
+ "independent",
115
+ "external",
116
+ ] as const;
91
117
  /**
92
118
  * Tracks which OS commands this RFC adds, changes, or removes.
93
119
  * Used by rfc.validate to cross-check that proposed commands
@@ -269,7 +295,12 @@ export interface RfcFrontmatter {
269
295
  * site-kernel CLI itself (string must start with "site-kernel ") — no
270
296
  * arbitrary shell, keeping the probe surface auditable and platform-independent.
271
297
  */
272
- export type AcceptanceProbe =
298
+ export interface AcceptanceProbeMeta {
299
+ expectationSource?: RfcExpectationSource;
300
+ limitations?: string;
301
+ }
302
+
303
+ export type AcceptanceProbe = (
273
304
  | { probe: "run"; command: string; expect: { exitCode: number }; criterion?: string }
274
305
  | { probe: "file-exists"; path: string; criterion?: string }
275
306
  | { probe: "file-contains"; path: string; pattern: string; criterion?: string }
@@ -294,13 +325,19 @@ export type AcceptanceProbe =
294
325
  expect: { exitCode: number };
295
326
  criterion?: string;
296
327
  }
328
+ // RFC-1334: structural wiring — symbol mode (value-imported by a non-test
329
+ // module, optionally inside a root's import graph) or command mode (manifest reachableVia).
330
+ | { probe: "reachable"; symbol: string; module: string; root?: string; criterion?: string }
331
+ | { probe: "reachable"; command: string; criterion?: string }
297
332
  // RFC-0998: validate a JSON/YAML artifact against an inline JSON Schema using Ajv.
298
333
  | {
299
334
  probe: "json-schema";
300
335
  artifact: string;
301
336
  schemaInline: Record<string, unknown>;
302
337
  criterion?: string;
303
- };
338
+ }
339
+ ) &
340
+ AcceptanceProbeMeta;
304
341
 
305
342
  export interface ProbeResult {
306
343
  probe: AcceptanceProbe;
@@ -320,6 +357,52 @@ export interface VerificationEvidenceProbeRecord {
320
357
  ok: boolean;
321
358
  detail: string;
322
359
  durationMs: number;
360
+ /** RFC-1330: git-derived origin — present for RFCs created on or after RFC_ORIGIN_CUTOFF. */
361
+ origin?: ProbeOriginRecord;
362
+ }
363
+
364
+ /**
365
+ * RFC-1330: origin of a probe derived from git history of the RFC's
366
+ * implementation range (base = `status: accepted` transition, head = HEAD).
367
+ * `presence` marks structural probe kinds whose origin is not counted.
368
+ */
369
+ export type DerivedProbeOrigin = "self" | "verifier" | "unchanged" | "unresolved";
370
+
371
+ export interface ProbeOriginRecord {
372
+ declared: RfcExpectationSource | "undeclared";
373
+ derivedOrigin: DerivedProbeOrigin | "presence";
374
+ effective: RfcExpectationSource | "undeclared" | "presence";
375
+ /** Commit SHAs (short) that made the probe self, or the verifier report path. */
376
+ reason: string[];
377
+ }
378
+
379
+ /** RFC-1333: one minimized counterexample returned by the acceptance verifier. */
380
+ export interface AcceptanceCounterexample {
381
+ id: string; // CX-1, CX-2 …
382
+ criterion: string; // AC-N or "design:<heading>"
383
+ input: string;
384
+ expected: string; // quoted RFC text the expectation follows from
385
+ observed: string;
386
+ reproCommand: string;
387
+ triage?: "confirmed" | "disputed";
388
+ triageReason?: string;
389
+ }
390
+
391
+ /** RFC-1333: frontmatter of docs/reviews/acceptance/<rfc>/acceptance-<date>-r<round>.md. */
392
+ export interface AcceptanceVerificationReport {
393
+ rfcId: string;
394
+ candidateSha: string;
395
+ round: 0 | 1 | 2;
396
+ isolation: "subagent" | "isolated-inline" | "inline";
397
+ verifierModel: string | null;
398
+ verdict: "pass" | "counterexamples" | "inconclusive";
399
+ counterexamples: AcceptanceCounterexample[];
400
+ }
401
+
402
+ export interface ImplementationRange {
403
+ /** null ⇒ unresolved (no `status: accepted` transition in history). */
404
+ base: string | null;
405
+ head: string;
323
406
  }
324
407
 
325
408
  export interface VerificationEvidence {
@@ -354,9 +437,18 @@ export interface RfcVerificationEmitResult {
354
437
  overall: "pass" | "fail";
355
438
  previousOverall?: "pass" | "fail";
356
439
  }>;
357
- skipped: Array<{ rfcId: string; reason: "no-probes" }>;
440
+ // RFC-1320: "stale-generated-artifact" — EVIDENCE-FRESH-01 blocked the
441
+ // pre-probe freshness gate; "unknown-probe-kind" — EVIDENCE-FRESH-03, a
442
+ // probe kind outside the artifact map (fail-closed); no envelope either way.
443
+ skipped: Array<{
444
+ rfcId: string;
445
+ reason: "no-probes" | "stale-generated-artifact" | "unknown-probe-kind";
446
+ }>;
358
447
  diagnostics: Diagnostic[];
359
448
  delta?: VerificationDelta;
449
+ /** RFC-1271 `--check`: committed-vs-fresh comparison per RFC — populated
450
+ * only in check mode; `emitted` stays empty (nothing is written). */
451
+ check?: Array<{ rfcId: string; match: boolean; mismatches: string[] }>;
360
452
  }
361
453
 
362
454
  export interface RfcVerificationRefreshResult {
@@ -482,6 +574,8 @@ export interface DecisionLogResult {
482
574
  count: number;
483
575
  entries: DecisionLogEntry[];
484
576
  written?: string[];
577
+ /** RFC-1320: dry-run render surface for generated.drift.validate. */
578
+ renderedFiles?: Record<string, string>;
485
579
  }
486
580
 
487
581
  export interface ConsultedDecision {
@@ -558,7 +652,17 @@ export interface RfcImplementStampData {
558
652
  implementationCommit: string;
559
653
  stampedAt: string;
560
654
  criteriaChecked: number;
655
+ /** RFC-1322: criterion ids flipped `[ ]` → `[x]` by --check-criteria. */
656
+ criteriaAutoChecked?: string[];
657
+ /**
658
+ * RFC-1322 dry-run only: criterion ids whose `probe:` annotations await the
659
+ * envelope refresh a real run would perform — pending, not failures.
660
+ */
661
+ criteriaPendingRefresh?: string[];
662
+ /** RFC-1322 dry-run only: the missing/stale envelope would be refreshed first. */
663
+ evidenceWouldRefresh?: boolean;
561
664
  evidencePath?: string;
665
+ evidenceReEmitted?: boolean;
562
666
  metricsPath?: string;
563
667
  }
564
668
 
@@ -570,7 +674,26 @@ export type RfcImplementStampRule =
570
674
  | "RFC-IMP-05"
571
675
  | "RFC-IMP-06"
572
676
  | "RFC-IMP-07"
573
- | "RFC-IMP-08";
677
+ | "RFC-IMP-08"
678
+ | "RFC-IMP-09"
679
+ // RFC-1330: declared expectationSource contradicted by git-derived origin.
680
+ | "RFC-IMP-10"
681
+ // RFC-1330: verificationTier high WHEN/IF criterion without non-self evidence.
682
+ | "RFC-IMP-11"
683
+ // RFC-1333: verificationTier high needs a passing, subagent-isolated
684
+ // acceptance-verification report bound to the implementation commit.
685
+ | "RFC-IMP-12"
686
+ // RFC-1310: commit-time governance provenance — the implementation commit
687
+ // must carry the X-RFC trailer or an injected CHANGE_SUMMARY item.
688
+ | "STAMP-GOV-01"
689
+ // RFC-1306: --sync delegates to rfc.evidence.sync through ctx.invoke; the
690
+ // chain's own rule ids surface as stamp violations on host-less or
691
+ // mid-chain-failure paths.
692
+ | "EVIDENCE-SYNC-01"
693
+ | "EVIDENCE-SYNC-02"
694
+ // RFC-1322: --check-criteria — an unchecked criterion carries no resolvable
695
+ // (evidence: ...) annotation; the stamp refuses rather than blank-checking.
696
+ | "STAMP-CHECK-01";
574
697
 
575
698
  export interface RfcImplementStampViolation {
576
699
  rule: RfcImplementStampRule;
@@ -582,6 +705,8 @@ export interface RfcImplementStampResult {
582
705
  status: "pass" | "fail";
583
706
  data?: RfcImplementStampData;
584
707
  violations: RfcImplementStampViolation[];
708
+ /** RFC-1330: non-blocking gate findings (RFC-IMP-11 until RFC-1333). */
709
+ warnings?: RfcImplementStampViolation[];
585
710
  } // ─── Constants ───────────────────────────────────────────────────────────────
586
711
  export const RFC_DIR = "docs/rfcs";
587
712
  export const RFC_TEMPLATE_FILE = "docs/rfcs/rfc-0000-template.md";
@@ -630,6 +755,7 @@ export const RFC_KNOWN_KEYS: readonly string[] = [
630
755
  "satisfies",
631
756
  "specRef",
632
757
  "versionBump",
758
+ "verificationTier",
633
759
  "breaksC",
634
760
  "liveSpec",
635
761
  "dependsOn",
@@ -668,6 +794,17 @@ export const RFC_PROBE_BINDING_CUTOFF = "2026-09-01";
668
794
  */
669
795
  export const RFC_CRITERIA_CONTENT_CUTOFF = "2026-09-03";
670
796
 
797
+ /**
798
+ * RFC-1330: cutoff date for git-derived probe origin. RFCs created on or after
799
+ * this date get `origin` records in their evidence envelope and are subject to
800
+ * V-44 (presence-only behavioral criterion), RFC-IMP-10 (declared origin
801
+ * contradicted by git), and RFC-IMP-11 (HIGH tier needs non-self evidence).
802
+ */
803
+ export const RFC_ORIGIN_CUTOFF = "2026-10-18";
804
+
805
+ /** RFC-1334: cutoff for V-45 (proposed/added commands need a command-mode reachable probe). */
806
+ export const RFC_REACHABLE_CUTOFF = "2026-10-18";
807
+
671
808
  /**
672
809
  * RFC-0997: non-blocking probe coverage report per RFC.
673
810
  * Emitted in `rfc.validate --json` and `rfc.acceptance.run` outputs.