peaks-loop 4.1.3 → 4.1.5

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 (628) hide show
  1. package/.claude-plugin/marketplace.json +7 -2
  2. package/CHANGELOG.md +168 -0
  3. package/README-en.md +1 -1
  4. package/README.md +1 -1
  5. package/dist/cli/cli-helpers.d.ts +20 -0
  6. package/dist/cli/cli-helpers.js +34 -0
  7. package/dist/cli/commands/_register.js +2 -0
  8. package/dist/cli/commands/asset-command-shared.d.ts +12 -0
  9. package/dist/cli/commands/asset-command-shared.js +45 -0
  10. package/dist/cli/commands/asset-commands.d.ts +6 -1
  11. package/dist/cli/commands/asset-commands.js +11 -372
  12. package/dist/cli/commands/asset-crystallize-command.d.ts +3 -0
  13. package/dist/cli/commands/asset-crystallize-command.js +60 -0
  14. package/dist/cli/commands/asset-crystallize-payload.d.ts +47 -0
  15. package/dist/cli/commands/asset-crystallize-payload.js +85 -0
  16. package/dist/cli/commands/asset-crystallize-runner.d.ts +3 -0
  17. package/dist/cli/commands/asset-crystallize-runner.js +133 -0
  18. package/dist/cli/commands/asset-dispose-command.d.ts +3 -0
  19. package/dist/cli/commands/asset-dispose-command.js +99 -0
  20. package/dist/cli/commands/asset-status-command.d.ts +3 -0
  21. package/dist/cli/commands/asset-status-command.js +100 -0
  22. package/dist/cli/commands/baseline-audit-command.d.ts +3 -0
  23. package/dist/cli/commands/baseline-audit-command.js +64 -0
  24. package/dist/cli/commands/baseline-command-shared.d.ts +23 -0
  25. package/dist/cli/commands/baseline-command-shared.js +39 -0
  26. package/dist/cli/commands/baseline-commands.js +33 -313
  27. package/dist/cli/commands/baseline-freeze-commands.d.ts +4 -0
  28. package/dist/cli/commands/baseline-freeze-commands.js +81 -0
  29. package/dist/cli/commands/baseline-guard-command.d.ts +3 -0
  30. package/dist/cli/commands/baseline-guard-command.js +52 -0
  31. package/dist/cli/commands/baseline-read-commands.d.ts +5 -0
  32. package/dist/cli/commands/baseline-read-commands.js +72 -0
  33. package/dist/cli/commands/baseline-rollback-commands.d.ts +4 -0
  34. package/dist/cli/commands/baseline-rollback-commands.js +88 -0
  35. package/dist/cli/commands/classify-downgrade-command.d.ts +9 -0
  36. package/dist/cli/commands/classify-downgrade-command.js +21 -0
  37. package/dist/cli/commands/classify-run-command.d.ts +9 -0
  38. package/dist/cli/commands/classify-run-command.js +73 -0
  39. package/dist/cli/commands/classify-signals.d.ts +5 -0
  40. package/dist/cli/commands/classify-signals.js +104 -0
  41. package/dist/cli/commands/code-commands.d.ts +6 -4
  42. package/dist/cli/commands/code-commands.js +6 -4
  43. package/dist/cli/commands/code-emit-handoff-command.js +40 -3
  44. package/dist/cli/commands/code-gate-command.d.ts +5 -5
  45. package/dist/cli/commands/code-gate-command.js +49 -9
  46. package/dist/cli/commands/code-gate-step-08-command.js +25 -9
  47. package/dist/cli/commands/code-mode-gate-plan-command.d.ts +1 -1
  48. package/dist/cli/commands/code-mode-gate-plan-command.js +2 -2
  49. package/dist/cli/commands/codegraph-command-options.d.ts +22 -0
  50. package/dist/cli/commands/codegraph-command-options.js +22 -0
  51. package/dist/cli/commands/codegraph-commands.d.ts +2 -2
  52. package/dist/cli/commands/codegraph-commands.js +14 -397
  53. package/dist/cli/commands/codegraph-config-restore-command.d.ts +3 -0
  54. package/dist/cli/commands/codegraph-config-restore-command.js +200 -0
  55. package/dist/cli/commands/codegraph-proxy-commands.d.ts +10 -0
  56. package/dist/cli/commands/codegraph-proxy-commands.js +159 -0
  57. package/dist/cli/commands/codegraph-repair-commands.d.ts +3 -0
  58. package/dist/cli/commands/codegraph-repair-commands.js +94 -0
  59. package/dist/cli/commands/codegraph-status-command.d.ts +1 -1
  60. package/dist/cli/commands/codegraph-status-command.js +27 -214
  61. package/dist/cli/commands/codegraph-status-integrity.d.ts +44 -0
  62. package/dist/cli/commands/codegraph-status-integrity.js +121 -0
  63. package/dist/cli/commands/codegraph-status-json.d.ts +5 -0
  64. package/dist/cli/commands/codegraph-status-json.js +127 -0
  65. package/dist/cli/commands/container-command-shared.d.ts +60 -0
  66. package/dist/cli/commands/container-command-shared.js +52 -0
  67. package/dist/cli/commands/container-commands.d.ts +1 -1
  68. package/dist/cli/commands/container-commands.js +4 -216
  69. package/dist/cli/commands/container-release-command.d.ts +3 -0
  70. package/dist/cli/commands/container-release-command.js +105 -0
  71. package/dist/cli/commands/container-spawn-command.d.ts +3 -0
  72. package/dist/cli/commands/container-spawn-command.js +148 -0
  73. package/dist/cli/commands/context-check-command.d.ts +3 -0
  74. package/dist/cli/commands/context-check-command.js +81 -0
  75. package/dist/cli/commands/context-commands.d.ts +2 -7
  76. package/dist/cli/commands/context-commands.js +6 -276
  77. package/dist/cli/commands/context-layer-command.d.ts +3 -0
  78. package/dist/cli/commands/context-layer-command.js +34 -0
  79. package/dist/cli/commands/context-layer-fetchers.d.ts +15 -0
  80. package/dist/cli/commands/context-layer-fetchers.js +162 -0
  81. package/dist/cli/commands/context-status-command.d.ts +17 -0
  82. package/dist/cli/commands/context-status-command.js +41 -0
  83. package/dist/cli/commands/contract-write-command.d.ts +3 -0
  84. package/dist/cli/commands/contract-write-command.js +144 -0
  85. package/dist/cli/commands/core/doctor-bindings.d.ts +17 -0
  86. package/dist/cli/commands/core/doctor-bindings.js +30 -0
  87. package/dist/cli/commands/core/doctor-command.d.ts +4 -18
  88. package/dist/cli/commands/core/doctor-command.js +2 -323
  89. package/dist/cli/commands/core/doctor-logs.d.ts +8 -0
  90. package/dist/cli/commands/core/doctor-logs.js +32 -0
  91. package/dist/cli/commands/core/doctor-probes.d.ts +3 -0
  92. package/dist/cli/commands/core/doctor-probes.js +55 -0
  93. package/dist/cli/commands/core/doctor-run-command.d.ts +12 -0
  94. package/dist/cli/commands/core/doctor-run-command.js +172 -0
  95. package/dist/cli/commands/core/doctor-summary.d.ts +7 -0
  96. package/dist/cli/commands/core/doctor-summary.js +39 -0
  97. package/dist/cli/commands/core/memory-command-shared.d.ts +25 -0
  98. package/dist/cli/commands/core/memory-command-shared.js +20 -0
  99. package/dist/cli/commands/core/memory-command.d.ts +1 -1
  100. package/dist/cli/commands/core/memory-command.js +6 -227
  101. package/dist/cli/commands/core/memory-delegated-verbs.d.ts +4 -0
  102. package/dist/cli/commands/core/memory-delegated-verbs.js +178 -0
  103. package/dist/cli/commands/core/memory-extract-command.d.ts +3 -0
  104. package/dist/cli/commands/core/memory-extract-command.js +95 -0
  105. package/dist/cli/commands/core/memory-sync-command.d.ts +3 -0
  106. package/dist/cli/commands/core/memory-sync-command.js +38 -0
  107. package/dist/cli/commands/core/session-command.d.ts +1 -1
  108. package/dist/cli/commands/core/session-command.js +12 -206
  109. package/dist/cli/commands/core/session-info-command.d.ts +3 -0
  110. package/dist/cli/commands/core/session-info-command.js +142 -0
  111. package/dist/cli/commands/core/session-verb-commands.d.ts +5 -0
  112. package/dist/cli/commands/core/session-verb-commands.js +58 -0
  113. package/dist/cli/commands/core/standards-command.d.ts +1 -24
  114. package/dist/cli/commands/core/standards-command.js +33 -201
  115. package/dist/cli/commands/core/standards-init-command.d.ts +3 -0
  116. package/dist/cli/commands/core/standards-init-command.js +87 -0
  117. package/dist/cli/commands/core/standards-lint.d.ts +24 -0
  118. package/dist/cli/commands/core/standards-lint.js +57 -0
  119. package/dist/cli/commands/core/standards-migrate-command.d.ts +3 -0
  120. package/dist/cli/commands/core/standards-migrate-command.js +57 -0
  121. package/dist/cli/commands/cron-scheduler-commands.d.ts +5 -1
  122. package/dist/cli/commands/cron-scheduler-commands.js +36 -206
  123. package/dist/cli/commands/cron-scheduler-run-once-command.d.ts +7 -0
  124. package/dist/cli/commands/cron-scheduler-run-once-command.js +35 -0
  125. package/dist/cli/commands/cron-scheduler-shared.d.ts +6 -0
  126. package/dist/cli/commands/cron-scheduler-shared.js +48 -0
  127. package/dist/cli/commands/cron-scheduler-start-command.d.ts +7 -0
  128. package/dist/cli/commands/cron-scheduler-start-command.js +65 -0
  129. package/dist/cli/commands/cron-scheduler-status-command.d.ts +7 -0
  130. package/dist/cli/commands/cron-scheduler-status-command.js +46 -0
  131. package/dist/cli/commands/cron-scheduler-stop-command.d.ts +7 -0
  132. package/dist/cli/commands/cron-scheduler-stop-command.js +61 -0
  133. package/dist/cli/commands/dispatch-cli-invocation-check.d.ts +108 -0
  134. package/dist/cli/commands/dispatch-cli-invocation-check.js +87 -0
  135. package/dist/cli/commands/dispatch-cli-invocation-scan.d.ts +66 -0
  136. package/dist/cli/commands/dispatch-cli-invocation-scan.js +162 -0
  137. package/dist/cli/commands/dispatch-commands.js +12 -5
  138. package/dist/cli/commands/dispatch-dag-envelope.d.ts +41 -0
  139. package/dist/cli/commands/dispatch-dag-envelope.js +49 -0
  140. package/dist/cli/commands/dispatch-dag-failure.d.ts +18 -0
  141. package/dist/cli/commands/dispatch-dag-failure.js +16 -0
  142. package/dist/cli/commands/dispatch-dag-preflight.d.ts +51 -0
  143. package/dist/cli/commands/dispatch-dag-preflight.js +105 -0
  144. package/dist/cli/commands/dispatch-dag-runners.d.ts +48 -0
  145. package/dist/cli/commands/dispatch-dag-runners.js +73 -0
  146. package/dist/cli/commands/dispatch-from-dag.d.ts +27 -0
  147. package/dist/cli/commands/dispatch-from-dag.js +87 -257
  148. package/dist/cli/commands/dispatch-preflight.js +46 -0
  149. package/dist/cli/commands/dispatch-prompt-composition.d.ts +6 -0
  150. package/dist/cli/commands/dispatch-prompt-composition.js +29 -7
  151. package/dist/cli/commands/doc-commands.js +1 -1
  152. package/dist/cli/commands/feedback-commands-helpers.js +1 -1
  153. package/dist/cli/commands/final-review-command-envelopes.d.ts +44 -0
  154. package/dist/cli/commands/final-review-command-envelopes.js +100 -0
  155. package/dist/cli/commands/final-review-command-shared.d.ts +52 -0
  156. package/dist/cli/commands/final-review-command-shared.js +35 -0
  157. package/dist/cli/commands/final-review-commands.d.ts +7 -27
  158. package/dist/cli/commands/final-review-commands.js +13 -240
  159. package/dist/cli/commands/final-review-prepare-command.d.ts +3 -0
  160. package/dist/cli/commands/final-review-prepare-command.js +221 -0
  161. package/dist/cli/commands/gate-commands-enforce.js +3 -3
  162. package/dist/cli/commands/governance-classify-contract-commands.d.ts +23 -9
  163. package/dist/cli/commands/governance-classify-contract-commands.js +26 -269
  164. package/dist/cli/commands/hook-handle.js +41 -20
  165. package/dist/cli/commands/hooks-command-shared.d.ts +42 -0
  166. package/dist/cli/commands/hooks-command-shared.js +32 -0
  167. package/dist/cli/commands/hooks-commands.d.ts +20 -0
  168. package/dist/cli/commands/hooks-commands.js +75 -309
  169. package/dist/cli/commands/hooks-install-envelopes.d.ts +6 -0
  170. package/dist/cli/commands/hooks-install-envelopes.js +144 -0
  171. package/dist/cli/commands/hooks-status-command.d.ts +3 -0
  172. package/dist/cli/commands/hooks-status-command.js +93 -0
  173. package/dist/cli/commands/hooks-uninstall-command.d.ts +3 -0
  174. package/dist/cli/commands/hooks-uninstall-command.js +43 -0
  175. package/dist/cli/commands/lint-commands.js +3 -1
  176. package/dist/cli/commands/loop-command-shared.d.ts +31 -0
  177. package/dist/cli/commands/loop-command-shared.js +15 -0
  178. package/dist/cli/commands/loop-commands.d.ts +12 -17
  179. package/dist/cli/commands/loop-commands.js +56 -238
  180. package/dist/cli/commands/loop-eval-capture-index.js +2 -4
  181. package/dist/cli/commands/loop-export-command.d.ts +3 -0
  182. package/dist/cli/commands/loop-export-command.js +73 -0
  183. package/dist/cli/commands/loop-goal-compose-command.d.ts +3 -0
  184. package/dist/cli/commands/loop-goal-compose-command.js +36 -0
  185. package/dist/cli/commands/loop-import-command.d.ts +3 -0
  186. package/dist/cli/commands/loop-import-command.js +86 -0
  187. package/dist/cli/commands/loop-placeholder-commands.d.ts +3 -0
  188. package/dist/cli/commands/loop-placeholder-commands.js +52 -0
  189. package/dist/cli/commands/memory-command-shared.d.ts +59 -0
  190. package/dist/cli/commands/memory-command-shared.js +39 -0
  191. package/dist/cli/commands/memory-commands.d.ts +6 -79
  192. package/dist/cli/commands/memory-commands.js +19 -309
  193. package/dist/cli/commands/memory-ingest-command.d.ts +3 -0
  194. package/dist/cli/commands/memory-ingest-command.js +50 -0
  195. package/dist/cli/commands/memory-list-command.d.ts +16 -0
  196. package/dist/cli/commands/memory-list-command.js +129 -0
  197. package/dist/cli/commands/memory-reindex-command.d.ts +9 -0
  198. package/dist/cli/commands/memory-reindex-command.js +78 -0
  199. package/dist/cli/commands/memory-rotate-command.d.ts +3 -0
  200. package/dist/cli/commands/memory-rotate-command.js +55 -0
  201. package/dist/cli/commands/memory-search-command.d.ts +7 -0
  202. package/dist/cli/commands/memory-search-command.js +46 -0
  203. package/dist/cli/commands/openspec-archive-command.d.ts +3 -0
  204. package/dist/cli/commands/openspec-archive-command.js +55 -0
  205. package/dist/cli/commands/openspec-command-shared.d.ts +62 -0
  206. package/dist/cli/commands/openspec-command-shared.js +135 -0
  207. package/dist/cli/commands/openspec-commands.d.ts +1 -1
  208. package/dist/cli/commands/openspec-commands.js +33 -306
  209. package/dist/cli/commands/openspec-from-doctor-command.d.ts +3 -0
  210. package/dist/cli/commands/openspec-from-doctor-command.js +66 -0
  211. package/dist/cli/commands/openspec-init-command.d.ts +3 -0
  212. package/dist/cli/commands/openspec-init-command.js +49 -0
  213. package/dist/cli/commands/openspec-list-command.d.ts +3 -0
  214. package/dist/cli/commands/openspec-list-command.js +27 -0
  215. package/dist/cli/commands/openspec-render-command.d.ts +3 -0
  216. package/dist/cli/commands/openspec-render-command.js +33 -0
  217. package/dist/cli/commands/openspec-show-command.d.ts +3 -0
  218. package/dist/cli/commands/openspec-show-command.js +33 -0
  219. package/dist/cli/commands/openspec-to-rd-command.d.ts +3 -0
  220. package/dist/cli/commands/openspec-to-rd-command.js +33 -0
  221. package/dist/cli/commands/openspec-validate-command.d.ts +3 -0
  222. package/dist/cli/commands/openspec-validate-command.js +45 -0
  223. package/dist/cli/commands/perf-audit-commands.js +15 -5
  224. package/dist/cli/commands/playwright-browser-command.d.ts +8 -0
  225. package/dist/cli/commands/playwright-browser-command.js +61 -0
  226. package/dist/cli/commands/playwright-commands.d.ts +10 -62
  227. package/dist/cli/commands/playwright-commands.js +77 -400
  228. package/dist/cli/commands/playwright-envelope.d.ts +8 -0
  229. package/dist/cli/commands/playwright-envelope.js +29 -0
  230. package/dist/cli/commands/playwright-ls-stop-commands.d.ts +4 -0
  231. package/dist/cli/commands/playwright-ls-stop-commands.js +74 -0
  232. package/dist/cli/commands/playwright-session-store.d.ts +65 -0
  233. package/dist/cli/commands/playwright-session-store.js +189 -0
  234. package/dist/cli/commands/project-commands.d.ts +19 -0
  235. package/dist/cli/commands/project-commands.js +101 -259
  236. package/dist/cli/commands/project-context-command.d.ts +3 -0
  237. package/dist/cli/commands/project-context-command.js +44 -0
  238. package/dist/cli/commands/project-dashboard-command.d.ts +3 -0
  239. package/dist/cli/commands/project-dashboard-command.js +74 -0
  240. package/dist/cli/commands/project-knowledge-command.d.ts +3 -0
  241. package/dist/cli/commands/project-knowledge-command.js +48 -0
  242. package/dist/cli/commands/project-memories-show-command.d.ts +3 -0
  243. package/dist/cli/commands/project-memories-show-command.js +87 -0
  244. package/dist/cli/commands/project-memory-index-command.d.ts +3 -0
  245. package/dist/cli/commands/project-memory-index-command.js +31 -0
  246. package/dist/cli/commands/qa-archive-screenshots-command.d.ts +3 -0
  247. package/dist/cli/commands/qa-archive-screenshots-command.js +53 -0
  248. package/dist/cli/commands/qa-commands.d.ts +14 -87
  249. package/dist/cli/commands/qa-commands.js +17 -315
  250. package/dist/cli/commands/qa-context-prestep.d.ts +1 -0
  251. package/dist/cli/commands/qa-context-prestep.js +34 -0
  252. package/dist/cli/commands/qa-run-command.d.ts +3 -0
  253. package/dist/cli/commands/qa-run-command.js +105 -0
  254. package/dist/cli/commands/qa-run-options.d.ts +23 -0
  255. package/dist/cli/commands/qa-run-options.js +31 -0
  256. package/dist/cli/commands/qa-run-slice.d.ts +41 -0
  257. package/dist/cli/commands/qa-run-slice.js +145 -0
  258. package/dist/cli/commands/race-commands.d.ts +15 -0
  259. package/dist/cli/commands/race-commands.js +65 -0
  260. package/dist/cli/commands/race-pilot-gate-record-command.d.ts +3 -0
  261. package/dist/cli/commands/race-pilot-gate-record-command.js +81 -0
  262. package/dist/cli/commands/release-canary-command.d.ts +28 -0
  263. package/dist/cli/commands/release-canary-command.js +129 -0
  264. package/dist/cli/commands/release-command-shared.d.ts +13 -0
  265. package/dist/cli/commands/release-command-shared.js +18 -0
  266. package/dist/cli/commands/release-commands.d.ts +10 -18
  267. package/dist/cli/commands/release-commands.js +25 -298
  268. package/dist/cli/commands/release-done-command.d.ts +3 -0
  269. package/dist/cli/commands/release-done-command.js +64 -0
  270. package/dist/cli/commands/release-hotfix-command.d.ts +3 -0
  271. package/dist/cli/commands/release-hotfix-command.js +50 -0
  272. package/dist/cli/commands/release-plan-command.d.ts +3 -0
  273. package/dist/cli/commands/release-plan-command.js +33 -0
  274. package/dist/cli/commands/release-precheck-command.d.ts +3 -0
  275. package/dist/cli/commands/release-precheck-command.js +28 -0
  276. package/dist/cli/commands/release-promote-command.d.ts +3 -0
  277. package/dist/cli/commands/release-promote-command.js +34 -0
  278. package/dist/cli/commands/release-rollback-command.d.ts +3 -0
  279. package/dist/cli/commands/release-rollback-command.js +33 -0
  280. package/dist/cli/commands/release-watch-command.d.ts +3 -0
  281. package/dist/cli/commands/release-watch-command.js +44 -0
  282. package/dist/cli/commands/request-command-options.d.ts +8 -0
  283. package/dist/cli/commands/request-commands.js +2 -0
  284. package/dist/cli/commands/request-init-command.js +67 -12
  285. package/dist/cli/commands/request-retag-command.d.ts +3 -0
  286. package/dist/cli/commands/request-retag-command.js +50 -0
  287. package/dist/cli/commands/request-show-command.d.ts +8 -0
  288. package/dist/cli/commands/request-show-command.js +14 -1
  289. package/dist/cli/commands/request-transition-command.js +12 -4
  290. package/dist/cli/commands/request-transition-failures.d.ts +14 -0
  291. package/dist/cli/commands/request-transition-failures.js +45 -3
  292. package/dist/cli/commands/scan-scope-commands.js +2 -2
  293. package/dist/cli/commands/security-audit-commands.js +26 -6
  294. package/dist/cli/commands/sediment-argv-flags.d.ts +54 -0
  295. package/dist/cli/commands/sediment-argv-flags.js +116 -0
  296. package/dist/cli/commands/sediment-command-shared.d.ts +15 -0
  297. package/dist/cli/commands/sediment-command-shared.js +5 -0
  298. package/dist/cli/commands/sediment-commands.d.ts +35 -59
  299. package/dist/cli/commands/sediment-commands.js +36 -590
  300. package/dist/cli/commands/sediment-pool-commands.d.ts +9 -0
  301. package/dist/cli/commands/sediment-pool-commands.js +185 -0
  302. package/dist/cli/commands/sediment-query-commands.d.ts +4 -0
  303. package/dist/cli/commands/sediment-query-commands.js +94 -0
  304. package/dist/cli/commands/sediment-release-commands.d.ts +8 -0
  305. package/dist/cli/commands/sediment-release-commands.js +232 -0
  306. package/dist/cli/commands/sop-advance-command.d.ts +3 -0
  307. package/dist/cli/commands/sop-advance-command.js +160 -0
  308. package/dist/cli/commands/sop-check-command.d.ts +3 -0
  309. package/dist/cli/commands/sop-check-command.js +44 -0
  310. package/dist/cli/commands/sop-command-shared.d.ts +23 -0
  311. package/dist/cli/commands/sop-command-shared.js +18 -0
  312. package/dist/cli/commands/sop-commands.d.ts +15 -1
  313. package/dist/cli/commands/sop-commands.js +26 -240
  314. package/dist/cli/commands/sop-init-command.d.ts +3 -0
  315. package/dist/cli/commands/sop-init-command.js +51 -0
  316. package/dist/cli/commands/sop-lint-command.d.ts +3 -0
  317. package/dist/cli/commands/sop-lint-command.js +64 -0
  318. package/dist/cli/commands/sop-register-command.d.ts +3 -0
  319. package/dist/cli/commands/sop-register-command.js +48 -0
  320. package/dist/cli/commands/sop-registry-command.d.ts +3 -0
  321. package/dist/cli/commands/sop-registry-command.js +30 -0
  322. package/dist/cli/commands/statusline-command-shared.d.ts +73 -0
  323. package/dist/cli/commands/statusline-command-shared.js +90 -0
  324. package/dist/cli/commands/statusline-commands.d.ts +1 -19
  325. package/dist/cli/commands/statusline-commands.js +48 -287
  326. package/dist/cli/commands/statusline-compact-command.d.ts +4 -0
  327. package/dist/cli/commands/statusline-compact-command.js +54 -0
  328. package/dist/cli/commands/statusline-install-command.d.ts +3 -0
  329. package/dist/cli/commands/statusline-install-command.js +48 -0
  330. package/dist/cli/commands/statusline-render-command.d.ts +9 -0
  331. package/dist/cli/commands/statusline-render-command.js +55 -0
  332. package/dist/cli/commands/statusline-status-command.d.ts +3 -0
  333. package/dist/cli/commands/statusline-status-command.js +23 -0
  334. package/dist/cli/commands/statusline-uninstall-command.d.ts +3 -0
  335. package/dist/cli/commands/statusline-uninstall-command.js +23 -0
  336. package/dist/cli/commands/test-command-run-helpers.d.ts +27 -0
  337. package/dist/cli/commands/test-command-run-helpers.js +73 -0
  338. package/dist/cli/commands/test-command-runner-resolution.d.ts +57 -0
  339. package/dist/cli/commands/test-command-runner-resolution.js +183 -0
  340. package/dist/cli/commands/test-commands.d.ts +8 -56
  341. package/dist/cli/commands/test-commands.js +26 -249
  342. package/dist/cli/commands/vm-command-shared.d.ts +23 -0
  343. package/dist/cli/commands/vm-command-shared.js +23 -0
  344. package/dist/cli/commands/vm-commands.d.ts +1 -28
  345. package/dist/cli/commands/vm-commands.js +36 -270
  346. package/dist/cli/commands/vm-hypervisor-runtime.d.ts +15 -0
  347. package/dist/cli/commands/vm-hypervisor-runtime.js +64 -0
  348. package/dist/cli/commands/vm-release-command.d.ts +5 -0
  349. package/dist/cli/commands/vm-release-command.js +101 -0
  350. package/dist/cli/commands/vm-spawn-command.d.ts +5 -0
  351. package/dist/cli/commands/vm-spawn-command.js +177 -0
  352. package/dist/cli/commands/web-command-shared.d.ts +12 -0
  353. package/dist/cli/commands/web-command-shared.js +30 -0
  354. package/dist/cli/commands/web-commands.d.ts +7 -14
  355. package/dist/cli/commands/web-commands.js +6 -314
  356. package/dist/cli/commands/web-install-command.d.ts +10 -0
  357. package/dist/cli/commands/web-install-command.js +116 -0
  358. package/dist/cli/commands/web-lifecycle-commands.d.ts +9 -30
  359. package/dist/cli/commands/web-lifecycle-commands.js +14 -322
  360. package/dist/cli/commands/web-login-command.d.ts +14 -0
  361. package/dist/cli/commands/web-login-command.js +189 -0
  362. package/dist/cli/commands/web-op-payload.d.ts +22 -0
  363. package/dist/cli/commands/web-op-payload.js +89 -0
  364. package/dist/cli/commands/web-op-refusals.d.ts +37 -0
  365. package/dist/cli/commands/web-op-refusals.js +73 -0
  366. package/dist/cli/commands/web-op-runner.d.ts +14 -0
  367. package/dist/cli/commands/web-op-runner.js +166 -0
  368. package/dist/cli/commands/web-status-command.d.ts +4 -0
  369. package/dist/cli/commands/web-status-command.js +32 -0
  370. package/dist/cli/commands/web-stop-command.d.ts +10 -0
  371. package/dist/cli/commands/web-stop-command.js +59 -0
  372. package/dist/cli/commands/web-verb-specs.d.ts +18 -0
  373. package/dist/cli/commands/web-verb-specs.js +66 -0
  374. package/dist/cli/commands/workflow-command-shared.d.ts +102 -0
  375. package/dist/cli/commands/workflow-command-shared.js +74 -0
  376. package/dist/cli/commands/workflow-graph-commands.d.ts +3 -0
  377. package/dist/cli/commands/workflow-graph-commands.js +73 -0
  378. package/dist/cli/commands/workflow-init-command.d.ts +3 -0
  379. package/dist/cli/commands/workflow-init-command.js +68 -0
  380. package/dist/cli/commands/workflow-lifecycle-commands.d.ts +9 -59
  381. package/dist/cli/commands/workflow-lifecycle-commands.js +14 -348
  382. package/dist/cli/commands/workflow-node-commands.d.ts +3 -0
  383. package/dist/cli/commands/workflow-node-commands.js +154 -0
  384. package/dist/cli/commands/workflow-terminalize-command.d.ts +3 -0
  385. package/dist/cli/commands/workflow-terminalize-command.js +56 -0
  386. package/dist/cli/commands/worktree-lease-gc-command.js +1 -1
  387. package/dist/services/artifacts/artifact-contract-block.d.ts +53 -0
  388. package/dist/services/artifacts/artifact-contract-block.js +212 -0
  389. package/dist/services/artifacts/artifact-prerequisites.d.ts +27 -19
  390. package/dist/services/artifacts/artifact-prerequisites.js +63 -133
  391. package/dist/services/artifacts/artifact-templates.d.ts +1 -1
  392. package/dist/services/artifacts/artifact-templates.js +17 -10
  393. package/dist/services/artifacts/prerequisite-checks.d.ts +87 -0
  394. package/dist/services/artifacts/prerequisite-checks.js +198 -0
  395. package/dist/services/artifacts/prerequisite-transition-event.d.ts +20 -0
  396. package/dist/services/artifacts/prerequisite-transition-event.js +27 -0
  397. package/dist/services/artifacts/request-artifact-metadata.d.ts +31 -0
  398. package/dist/services/artifacts/request-artifact-metadata.js +44 -0
  399. package/dist/services/artifacts/request-artifact-service.d.ts +5 -0
  400. package/dist/services/artifacts/request-artifact-service.js +23 -51
  401. package/dist/services/artifacts/request-artifact-state-helpers.d.ts +12 -0
  402. package/dist/services/artifacts/request-artifact-state-helpers.js +28 -4
  403. package/dist/services/artifacts/request-retag-service.d.ts +68 -0
  404. package/dist/services/artifacts/request-retag-service.js +125 -0
  405. package/dist/services/artifacts/request-state-order.d.ts +38 -0
  406. package/dist/services/artifacts/request-state-order.js +99 -0
  407. package/dist/services/artifacts/request-type-demand.d.ts +44 -0
  408. package/dist/services/artifacts/request-type-demand.js +71 -0
  409. package/dist/services/audit/audit-goal-service.d.ts +7 -0
  410. package/dist/services/audit/enforcers/active-skill-resolver.d.ts +18 -0
  411. package/dist/services/audit/enforcers/active-skill-resolver.js +48 -1
  412. package/dist/services/audit/enforcers/code-ban.d.ts +11 -2
  413. package/dist/services/audit/enforcers/code-ban.js +21 -1
  414. package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.d.ts +17 -0
  415. package/dist/services/audit/red-line-catalog-p2-a-bee-runtime.js +24 -7
  416. package/dist/services/audit-independent/handoff-missing-refusal.d.ts +26 -0
  417. package/dist/services/audit-independent/handoff-missing-refusal.js +109 -0
  418. package/dist/services/audit-independent/handoff-readers.d.ts +37 -0
  419. package/dist/services/audit-independent/handoff-readers.js +81 -0
  420. package/dist/services/audit-independent/index.d.ts +6 -1
  421. package/dist/services/audit-independent/index.js +6 -1
  422. package/dist/services/audit-independent/judged-declaration-build.d.ts +48 -0
  423. package/dist/services/audit-independent/judged-declaration-build.js +73 -0
  424. package/dist/services/audit-independent/judged-declaration-check.d.ts +79 -0
  425. package/dist/services/audit-independent/judged-declaration-check.js +155 -0
  426. package/dist/services/audit-independent/judged-declaration.d.ts +94 -0
  427. package/dist/services/audit-independent/judged-declaration.js +218 -0
  428. package/dist/services/audit-independent/perf-audit-service.js +12 -14
  429. package/dist/services/audit-independent/security-audit-artifact.d.ts +28 -0
  430. package/dist/services/audit-independent/security-audit-artifact.js +90 -0
  431. package/dist/services/audit-independent/security-audit-service.d.ts +6 -53
  432. package/dist/services/audit-independent/security-audit-service.js +34 -178
  433. package/dist/services/capability-guard-runner/contracts/J05.js +60 -14
  434. package/dist/services/code/auto-compact-artifacts.d.ts +54 -0
  435. package/dist/services/code/auto-compact-artifacts.js +135 -0
  436. package/dist/services/code/auto-compact-attempt.d.ts +46 -0
  437. package/dist/services/code/auto-compact-attempt.js +88 -0
  438. package/dist/services/code/auto-compact-decision.d.ts +74 -0
  439. package/dist/services/code/auto-compact-decision.js +149 -0
  440. package/dist/services/code/auto-compact-dispatch-gate.d.ts +36 -0
  441. package/dist/services/code/auto-compact-dispatch-gate.js +86 -0
  442. package/dist/services/code/auto-compact-envelopes.d.ts +33 -0
  443. package/dist/services/code/auto-compact-envelopes.js +134 -0
  444. package/dist/services/code/auto-compact-history.d.ts +46 -0
  445. package/dist/services/code/auto-compact-history.js +17 -0
  446. package/dist/services/code/auto-compact-orchestrator.d.ts +11 -240
  447. package/dist/services/code/auto-compact-orchestrator.js +165 -686
  448. package/dist/services/code/auto-compact-run-types.d.ts +123 -0
  449. package/dist/services/code/auto-compact-run-types.js +1 -0
  450. package/dist/services/code/emit-handoff.d.ts +35 -1
  451. package/dist/services/code/emit-handoff.js +128 -7
  452. package/dist/services/code/step-08-gate.d.ts +28 -19
  453. package/dist/services/code/step-08-gate.js +92 -35
  454. package/dist/services/codegraph/codegraph-index-integrity.js +2 -0
  455. package/dist/services/config/config-coercion.d.ts +7 -0
  456. package/dist/services/config/config-coercion.js +156 -0
  457. package/dist/services/config/config-file-io.d.ts +11 -0
  458. package/dist/services/config/config-file-io.js +61 -0
  459. package/dist/services/config/config-get.d.ts +2 -0
  460. package/dist/services/config/config-get.js +36 -0
  461. package/dist/services/config/config-global-loader.d.ts +15 -0
  462. package/dist/services/config/config-global-loader.js +111 -0
  463. package/dist/services/config/config-nested-path.d.ts +3 -0
  464. package/dist/services/config/config-nested-path.js +53 -0
  465. package/dist/services/config/config-primitives.d.ts +16 -0
  466. package/dist/services/config/config-primitives.js +24 -0
  467. package/dist/services/config/config-service.d.ts +9 -33
  468. package/dist/services/config/config-service.js +16 -665
  469. package/dist/services/config/config-validation.d.ts +19 -0
  470. package/dist/services/config/config-validation.js +152 -0
  471. package/dist/services/config/config-workspace.d.ts +10 -0
  472. package/dist/services/config/config-workspace.js +158 -0
  473. package/dist/services/context/build-dispatch-system-prompt.d.ts +3 -3
  474. package/dist/services/context/build-dispatch-system-prompt.js +7 -7
  475. package/dist/services/context/collector.js +5 -1
  476. package/dist/services/dispatch/active-dispatch-index.d.ts +36 -0
  477. package/dist/services/dispatch/active-dispatch-index.js +118 -0
  478. package/dist/services/dispatch/batch-counter.js +1 -2
  479. package/dist/services/dispatch/dispatch-record-writer.d.ts +29 -16
  480. package/dist/services/dispatch/dispatch-record-writer.js +58 -100
  481. package/dist/services/dispatch/dispatch-sub-agent.js +1 -1
  482. package/dist/services/dispatch/karpathy-block.d.ts +55 -0
  483. package/dist/services/dispatch/karpathy-block.js +101 -0
  484. package/dist/services/dispatch/ledger-reaper.d.ts +80 -0
  485. package/dist/services/dispatch/ledger-reaper.js +131 -0
  486. package/dist/services/evidence/evidence-generator.js +15 -8
  487. package/dist/services/feedback/feedback-promotion-service.d.ts +8 -11
  488. package/dist/services/feedback/feedback-promotion-service.js +30 -35
  489. package/dist/services/feedback/promotion-artifact-json-evidence.d.ts +18 -0
  490. package/dist/services/feedback/promotion-artifact-missing.d.ts +22 -0
  491. package/dist/services/feedback/promotion-artifact-missing.js +63 -0
  492. package/dist/services/final-review/final-review-contract.d.ts +95 -4
  493. package/dist/services/final-review/final-review-contract.js +64 -0
  494. package/dist/services/final-review/final-review-delivery.d.ts +13 -0
  495. package/dist/services/final-review/final-review-delivery.js +26 -12
  496. package/dist/services/final-review/final-review-evidence-collect.js +8 -53
  497. package/dist/services/final-review/final-review-evidence-records.d.ts +21 -0
  498. package/dist/services/final-review/final-review-evidence-records.js +67 -0
  499. package/dist/services/final-review/final-review-evidence-sources.d.ts +22 -0
  500. package/dist/services/final-review/final-review-evidence-sources.js +28 -4
  501. package/dist/services/final-review/final-review-prompt.js +19 -6
  502. package/dist/services/final-review/final-review-runner.js +5 -0
  503. package/dist/services/final-review/final-review-service.d.ts +2 -2
  504. package/dist/services/final-review/index.d.ts +1 -1
  505. package/dist/services/final-review/pre-post-diff.d.ts +2 -75
  506. package/dist/services/final-review/pre-post-diff.js +60 -59
  507. package/dist/services/hooks/pre-tool-code-gate.d.ts +7 -1
  508. package/dist/services/hooks/pre-tool-code-gate.js +21 -2
  509. package/dist/services/hooks/worktree-authorization-gate.js +6 -31
  510. package/dist/services/hooks/worktree-refusal-messages.d.ts +74 -0
  511. package/dist/services/hooks/worktree-refusal-messages.js +102 -0
  512. package/dist/services/lint/eslint-runner-support.d.ts +1 -1
  513. package/dist/services/lint/eslint-runner-support.js +2 -1
  514. package/dist/services/lint/eslint-runner-types.d.ts +8 -0
  515. package/dist/services/lint/eslint-runner.js +17 -4
  516. package/dist/services/llm/anthropic-runner.js +24 -7
  517. package/dist/services/loop/loop-observability.d.ts +39 -0
  518. package/dist/services/loop/loop-observability.js +55 -0
  519. package/dist/services/loop/monotonic-guard.js +6 -9
  520. package/dist/services/loop/monotonic-runner.js +8 -7
  521. package/dist/services/loop/run-driver.js +18 -22
  522. package/dist/services/memory/project-memory-service/index/kind-dispatch.js +14 -1
  523. package/dist/services/memory/project-memory-service/index/project-memory-plan-exec.js +13 -2
  524. package/dist/services/memory/project-memory-service/index.d.ts +2 -2
  525. package/dist/services/memory/project-memory-service/index.js +1 -1
  526. package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.d.ts +36 -0
  527. package/dist/services/memory/project-memory-service/parsers/frontmatter-parse.js +48 -2
  528. package/dist/services/memory/project-memory-service/parsers/markdown-pure.d.ts +23 -1
  529. package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +37 -0
  530. package/dist/services/memory/project-memory-service/types.d.ts +32 -0
  531. package/dist/services/observability/observability-service.d.ts +7 -0
  532. package/dist/services/observability/observability-service.js +2 -1
  533. package/dist/services/prd/gate-evidence-derivation.d.ts +4 -3
  534. package/dist/services/prd/gate-evidence-derivation.js +4 -3
  535. package/dist/services/qa/bdd-test-style-verifier.js +22 -8
  536. package/dist/services/race/gate2-evaluator.d.ts +58 -0
  537. package/dist/services/race/gate2-evaluator.js +111 -0
  538. package/dist/services/race/gate2-policy.d.ts +17 -0
  539. package/dist/services/race/gate2-policy.js +31 -0
  540. package/dist/services/race/lane-phase.d.ts +19 -0
  541. package/dist/services/race/lane-phase.js +113 -0
  542. package/dist/services/race/pilot-gate-store.d.ts +67 -0
  543. package/dist/services/race/pilot-gate-store.js +227 -0
  544. package/dist/services/scan/file-size-baseline.d.ts +26 -0
  545. package/dist/services/scan/file-size-baseline.js +150 -0
  546. package/dist/services/scan/file-size-scan.d.ts +42 -3
  547. package/dist/services/scan/file-size-scan.js +58 -42
  548. package/dist/services/scan/type-sanity-service.js +13 -3
  549. package/dist/services/skill/resume-detector.js +3 -3
  550. package/dist/services/skills/hooks-codegate-superpowers.d.ts +5 -6
  551. package/dist/services/skills/hooks-codegate-superpowers.js +7 -8
  552. package/dist/services/skills/hooks-settings-deny-list.d.ts +61 -0
  553. package/dist/services/skills/hooks-settings-deny-list.js +173 -0
  554. package/dist/services/skills/hooks-settings-envelopes.d.ts +20 -0
  555. package/dist/services/skills/hooks-settings-envelopes.js +79 -0
  556. package/dist/services/skills/hooks-settings-file-shape.d.ts +43 -0
  557. package/dist/services/skills/hooks-settings-file-shape.js +207 -0
  558. package/dist/services/skills/hooks-settings-paths.d.ts +34 -0
  559. package/dist/services/skills/hooks-settings-paths.js +75 -0
  560. package/dist/services/skills/hooks-settings-read-installed.d.ts +39 -0
  561. package/dist/services/skills/hooks-settings-read-installed.js +60 -0
  562. package/dist/services/skills/hooks-settings-service.d.ts +13 -213
  563. package/dist/services/skills/hooks-settings-service.js +72 -658
  564. package/dist/services/skills/hooks-settings-types.d.ts +139 -0
  565. package/dist/services/skills/hooks-settings-types.js +1 -0
  566. package/dist/services/skills/presence-lease-order.d.ts +13 -0
  567. package/dist/services/skills/presence-lease-order.js +24 -0
  568. package/dist/services/skills/skill-conformance-service.js +1 -0
  569. package/dist/services/skills/skill-statusline-service.js +4 -7
  570. package/dist/services/slice/slice-check-service.js +8 -8
  571. package/dist/services/workflow/pipeline-verify-gate-support.js +2 -1
  572. package/dist/services/workflow/pipeline-verify-service.js +1 -1
  573. package/dist/services/workflow/workflow-skip-service.d.ts +0 -20
  574. package/dist/services/workflow/workflow-skip-service.js +3 -4
  575. package/dist/services/workspace/claude-settings-retirements.d.ts +54 -0
  576. package/dist/services/workspace/claude-settings-retirements.js +112 -0
  577. package/dist/services/workspace/claude-settings-template-merge.d.ts +109 -0
  578. package/dist/services/workspace/claude-settings-template-merge.js +223 -0
  579. package/dist/services/workspace/claude-settings-template.d.ts +79 -87
  580. package/dist/services/workspace/claude-settings-template.js +80 -235
  581. package/dist/services/workspace/migrate-1-4-1-service.js +3 -0
  582. package/dist/services/workspace/reconcile-service.js +0 -1
  583. package/dist/shared/incrementing-number.d.ts +10 -0
  584. package/dist/shared/incrementing-number.js +27 -0
  585. package/package.json +5 -5
  586. package/skills/bee/peaks-perf-audit/SKILL.md +1 -1
  587. package/skills/bee/peaks-prd/SKILL.md +1 -1
  588. package/skills/bee/peaks-qa/SKILL.md +1 -1
  589. package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +2 -2
  590. package/skills/bee/peaks-qa/references/qa-transition-gates.md +1 -1
  591. package/skills/bee/peaks-rd/SKILL.md +2 -2
  592. package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +1 -1
  593. package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +8 -4
  594. package/skills/bee/peaks-rd/references/rd-transition-gates.md +3 -3
  595. package/skills/bee/peaks-rd/references/v2-12-fanout-collapse.md +2 -2
  596. package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +1 -1
  597. package/skills/bee/peaks-reviewer/SKILL.md +1 -1
  598. package/skills/bee/peaks-sc/SKILL.md +1 -1
  599. package/skills/bee/peaks-security-audit/SKILL.md +10 -2
  600. package/skills/bee/peaks-txt/SKILL.md +4 -3
  601. package/skills/bee/peaks-ui/SKILL.md +3 -3
  602. package/skills/peaks-audit/SKILL.md +29 -1
  603. package/skills/peaks-code/SKILL.md +5 -2
  604. package/skills/peaks-code/references/fast-lane-norm.md +42 -0
  605. package/skills/peaks-code/references/fast-mode.md +3 -2
  606. package/skills/peaks-code/references/local-artifact-workspace.md +3 -3
  607. package/skills/peaks-code/references/micro-cycle.md +3 -3
  608. package/skills/peaks-code/references/resume-detection.md +1 -1
  609. package/skills/peaks-code/references/runbook.md +12 -6
  610. package/skills/peaks-code/references/step-11-memory-sediment.md +4 -0
  611. package/skills/peaks-code/references/sub-agent-dispatch.md +1 -1
  612. package/skills/peaks-code/references/swarm-dispatch-contract.md +40 -16
  613. package/skills/peaks-code/references/workflow-gates-and-types.md +6 -6
  614. package/skills/peaks-code/references/worktree-governance.md +4 -4
  615. package/skills/peaks-content/SKILL.md +1 -1
  616. package/skills/peaks-doctor/SKILL.md +1 -1
  617. package/skills/peaks-final-review/SKILL.md +31 -11
  618. package/skills/peaks-ide/SKILL.md +1 -1
  619. package/skills/peaks-issue-fix-orchestrator/SKILL.md +1 -1
  620. package/skills/peaks-race-code/SKILL.md +185 -0
  621. package/skills/peaks-resume/SKILL.md +1 -1
  622. package/skills/peaks-slice-decompose/SKILL.md +1 -1
  623. package/skills/peaks-solo/SKILL.md +1 -1
  624. package/skills/peaks-sop/SKILL.md +1 -1
  625. package/skills/peaks-status/SKILL.md +1 -1
  626. package/skills/peaks-test/SKILL.md +7 -4
  627. package/dist/services/audit/enforcers/lint-peaks-skill-runtime.d.ts +0 -23
  628. package/dist/services/audit/enforcers/lint-peaks-skill-runtime.js +0 -64
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "metadata": {
3
3
  "pluginRoot": ".",
4
- "version": "4.1.3"
4
+ "version": "4.1.5"
5
5
  },
6
6
  "plugins": [
7
7
  {
8
8
  "name": "peaks-loop",
9
9
  "description": "Loop Engineering CLI — workflow primitive / loop guards / evaluators / slice orchestration",
10
- "version": "4.1.3",
10
+ "version": "4.1.5",
11
11
  "author": {
12
12
  "name": "SquabbyZ"
13
13
  },
@@ -123,6 +123,11 @@
123
123
  "description": "QA and verification role for Peaks-Loop (LLM-only internal role; not user-invocable.\nTriggered by peaks-code via `peaks sub-agent dispatch --role qa`.)\nUse when a workflow needs unit-test coverage evidence, regression matrices,\nbaseline reports, validation reports, acceptance checks, or refactor verification gates.",
124
124
  "userInvocable": false
125
125
  },
126
+ {
127
+ "name": "peaks-race-code",
128
+ "path": "./skills/peaks-race-code",
129
+ "description": "Fast lane for code work — this window edits source directly, with no sub-agents and no paperwork. Use it when a code task is small enough that opening a second context window is the whole cost, i.e. trivial and everyday small features and bug fixes whose diff you can hold in your head. Not for a task that touches one of the risk surfaces the fast-lane norm names (`../peaks-code/references/fast-lane-norm.md`), and not for work that needs a durable audit trail — those belong to peaks-code; read the norm before you decide. Triggers on \"/peaks-race-code\", \"peaks race\", \"race this\", \"fast lane\", \"直接改,别走全流程\"."
130
+ },
126
131
  {
127
132
  "name": "peaks-rd",
128
133
  "path": "./skills/bee/peaks-rd",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,173 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.1.5 — 2026-10-14 (快车道从设计走到落地并带来一个新命令族;代码门与提交禁令第一次真的会拒绝;提交边界补齐三道门;派发提示第一次被自己的 CLI 校验;artifact 按 rid 落盘,两条切片停止互相覆写)
4
+
5
+ **版本级别**: 未发布区间 `v4.1.4..HEAD` 共 **125 个 commit**(**13 feat / 37 fix / 2 refactor / 5 chore / 3 test / 3 style** / 其余 62 docs+memory)。取 **patch**,依维护者 2026-07-22 的常设规则"默认版本新增采用最小的版本位"。
6
+
7
+ **此处必须如实记一笔,与 4.1.3 面对 `peaks mcp` 时是同一情形**:本版**确实新增了命令族**——`peaks race`(`pilot-status` 只读判定与 `pilot-gate record` 唯一写入者两个动词,`src/cli/commands/race-commands.ts`)与 `request retag`(`src/cli/commands/request-retag-command.ts`)。按严格语义化版本,新增用户可见命令应当取 **minor**。取 patch 是常设规则的默认,不是"没有新增命令"。4 个 workspace 包各 +1 patch(internal-runtime 0.0.44→**0.0.45**、mut 0.1.58→**0.1.59**、shared 0.0.93→**0.0.94**、shared-channel 0.0.61→**0.0.62**),`CLI_VERSION` 与 `RUNTIME_VERSION` 由 `scripts/sync-version.mjs` 同步。
8
+
9
+ ### 1. 快车道:从一份设计到一条真能开门的路径
10
+
11
+ `peaks-race-code` 是本版的核心新能力。它的设计先被写死、再被对抗性评审推翻重写过一次(`9da13bc0` 的设计记录、`304e4e2e` 评审后的重写、`8d3f2896` 拆成四个 slice),落地时 `9bad2be1` 把它交付为 `peaks-code` 的**兄弟**而不是模式——它去掉的正是让 peaks-code 开独立上下文窗口的那条红线:在这个车道里,编排的窗口同时就是改源码的窗口。技能树因此从 22 走到 **23**(14 个顶层 + 9 个 bee 级,`tests/unit/ide/` 的三条计数断言随之更新)。门槛只有一个事实:为会话解析出的 driver 读到 `peaks-race-code`,而这个事实是**自报的**,文档自己也这么说。
12
+
13
+ **但代码门此前在这条路径上是死的,这是本版最该被读到的一段。** `401b44f7` 之前 `peaks code-gate` 按 `tool` / `input` 读工具调用,而真实的 PreToolUse 投递的是 `tool_name` / `tool_input`;工具名到达时是 `undefined`,而 `decideGateAction` 的第一个判断放行任何不叫 Edit / Write / MultiEdit 的名字——**在读路径之前**,于是它对每一次调用都返回 allow。修法在命令层归一化顶层载荷,接受两种拼写(与既有 shell sibling `pre-tool-code-gate.sh` 一致),`GateInput` 与 `decideGateAction` 不动。
14
+
15
+ **这是一次会到达每一个既有安装的行为变更,故明写**:注册了 code-gate 条目的仓库会从"这门从不拒绝"变成"按路径族拒绝"——对 `src/`、`tests/unit/`、`tests/integration/`、`config/`、`bin/`、`scripts/` 的直接 Edit / Write / MultiEdit 会被 `PEAKS_CODE_PROHIBITED_DIRECT_EDIT` 拒绝,除非解析出的 driver 是快车道。用户没有理由预期这件事,因为这条条目**从未拒绝过一次调用**,它的第一次拒绝会是一次普通的 `src/**` 编辑。
16
+
17
+ 放行必须精确。`adff480b` 只认**精确匹配** `peaks-race-code`,无前缀匹配也不做大小写折叠,于是一个未来的 `peaks-race-<something>` 兄弟不会继承源码编辑权——顺带把这条钉死的是 `938b92a1`:唯一的负例 `peaks-code` 在 `startsWith('peaks-race')`、大小写折叠、`trim`/`contains` 三种放宽下**全都仍然通过**,所以四条新负例各对一种放宽。`f5612cde` 从 hook payload 读 caller identity(`caller_id`,回退 `session_id`),把 lease 查询**限定在该 caller**,再交给 `decideGateAction` 的第三个参数。
18
+
19
+ **提交禁令(AI 署名红线)有三处只存在于代码里的事实。** 它只有一个调用点,且只在 `peaks hook handle` 下运行——即 trae / cursor / codex;Claude Code、hermes 与 openclaw 拿到的是 `gate enforce`,其中**不含**禁令。它此前能被任意字符串解除:`79b20add` 证实任何带 `session_id: "anything"` 的载荷都会让一个本该被拒的提交通过,因为判别说的是"载荷里有没有非空字符串"而不是"那个字符串有没有指到一个 lease";`a8f94c89` 证实什么都没解析出来时,`if (skill !== null)` 会让整条禁令跳过自己。`023235e2` 补上最后一块:`callerId` 过滤器一直有效,但**没有任何生产调用点传它**,于是"谁在驱动"由 `readdirSync` 第一个产出回答——一个没有 peaks 技能的会话的 `git commit` 会被另一个窗口的 peaks-code lease 禁掉。而 `0c08be62` 让 driver 解析器与 statusline 读者对同一份 lease 集合给出同一答案(按 `lastHeartbeat` 再按 `startedAt` 的共享 comparator);此前它取 `readdirSync` 的第一个,在 Windows 上就是文件名顺序。
20
+
21
+ ### 2. gate 2 从"没有阈值"变成有策略的判定;车道相位搬进一个有语法的载体
22
+
23
+ `peaks-race-code` 的 pilot 信任门原先有四个可数量、零个阈值,于是"pilot 清关了吗"无法可复现地回答。`21304696` 补上 `src/services/race/gate2-policy.ts`、`gate2-evaluator.ts`、`pilot-gate-store.ts` 与两个动词:`peaks race pilot-status`(只读判定,fail 时 exit 1)与 `peaks race pilot-gate record`(唯一写入者,幂等 upsert)。策略 `race-gate2-policy-v1` 有七条阈值,其中 `taskCount >= 10` 取 rule-of-three(十次干净跑把失败率上界锁在约 26%);安全臂计入**全部**记录(含 escalated)而 `taskCount` 只计 landed,这条不对称是刻意的。覆盖面是**推导出来的**,永不自报:`filesChanged × HARD_BLOCKED_PATH_FAMILIES`(从 `src/services/hooks/pre-tool-code-gate.ts` import),或安全臂谓词。判定永远从策略常量重算,**从不**读 `.peaks/race/pilot-gate.json` 自己的 policy 块——否则削弱那个块就能洗白这道门。用五条真实的 2026-10-11 trace 播种,得到 `insufficient-evidence` 与两个缺口:**task 4 < 10、session 1 < 2**(core 3 与 safetyArm 1 达标)。
24
+
25
+ **车道相位从 markdown 搬进一个有语法的载体。** 相位此前是 `skills/peaks-audit/SKILL.md` 里的一句话加一个 HTML 注释标记;markdown 是自由文本,于是每一条"必须长得像 X"的守卫都能被一个人类仍读作相位声明的拼写变体绕开——**五轮修复产生了五种逃逸**(一行两个 token、一行两个 `phase=`、多一个空格、少一个空格、tab、NBSP、大写、缺前缀),没有一轮是最后一轮,而守卫已到 500 行帽的 495 行。`3b95e00a` 把它搬到 `.peaks/race/lane-phase.json`(`{ "phase": "name-only" }`),`src/services/race/lane-phase.ts` 是唯一读者:严格的 Zod 对象、恰好两个值的 enum、以及一个带标签的结果(ok / missing / invalid),**missing 拒绝而不是取默认**。**第一版没有做到这件事,记录如此**:JSON 的键可以用 unicode 转义书写,而 `JSON.parse` 会把转义解析回键名 `phase`,于是一个首条声明被转义的文件返回 ok 并采用**第二个**值——原始文本读者看到的是一个相位,守卫解析出的是另一个,而一条非法的首条声明被静默丢弃。修法是拒绝任何反斜杠。QA 对八条验收判据全部 PASS,含 80+ 条对抗输入(键与值里的 unicode 转义、任何位置的重复键、三个位置的 BOM、NUL、孤立代理、CRLF、NEL、一个 4 MB 的填充对象、载体路径上放目录与符号链接,以及为数组 / 字符串 / 数字 / null 的 root)。
26
+
27
+ `76830652` 把车道问题放到**每一次 peaks 工作流的入口**:一个以"端到端做这个"表述的诉求直达 peaks-code,所以住在 dispatcher 里的问题永远不会被问到。问题落在 peaks-audit 的契约处(任何 peaks-* 工作流的第一步),每个请求问一次;快车道是 pre-pilot,所以在 pilot 清关前它**只在用户点名时**可达。
28
+
29
+ ### 3. 提交边界上新增的三道门
30
+
31
+ CI 结构性地看不到这三样东西:artifact 住在 `.peaks/_runtime/`,那是 gitignored,所以**本地提交是它们唯一可见的边界**。
32
+
33
+ **artifact 契约在提交处被强制执行(`4a5d74b4`)。** 本仓此前对同一份工作有三种做法,按"artifact 的 state 值对该 role 是否合法"衡量:完整状态机(2026-09-10)、混合——33 条规范 state 行加 6 条手写、CLI 会拒绝的名字(2026-10-09)、以及完全没有(2026-10-11,零条 state 行)。**绕过的形式是模仿,不是拒绝。** 检查器早就存在(`peaks workflow verify-pipeline` 在 2026-10-11 那次会话上正确报 `complete:false / gateC:fail`),**只是没有任何东西运行它**。新增 `.husky/peaks-gate-pipeline.mjs`(pre-commit 腿)与 `.husky/pipeline/contract-verdict.mjs`(纯判定路径:无 fs、无 spawn、无时钟)。豁免是 `PEAKS_SKIP_PIPELINE_VERIFY=1` 且**大声**:它逐条列出跳过的 rid、说明读过的范围、并声明环境变量在 git 历史里不留痕——不像 `--allow-incomplete`,它的理由留在 artifact 里。**跑不起来的检查器一律拒绝**:一条崩溃的检查器不是"没有违规"。rid 枚举改按 **artifact** 键控而不是按 `rid-` 前缀,两个方向的错误在真实会话上量过:2026-10-11 是 8→4,2026-10-10 是 0→18。文件里也写明它**不是**完全强制:这条腿放行 `MUT_REPORT`,而它的 artifact 在这个构建里没有生产者。
34
+
35
+ **这条腿会验证一个有工作的会话,而不是它被绑定到的那个(`f9091db3`)。** 此前它解析 ACTIVE 会话并枚举该会话的 rid 载体;当 active 会话是新的、而工作属于另一个会话时,枚举为空,这条腿便以"no rid to verify … Nothing was refused"放行——那句话是真的,而检查从未运行。实测:job backlog-9x-drain 的最后一条切片从会话 `…-3cb9bc` 提交,而它全部六个 rid 载体住在 `…-2f9323` 下。**显然的修法(绑定会话为空而兄弟非空时拒绝)被量过后否决**:11 个会话目录里 6 个零 rid 载体,其中三个是当天建立的,拒绝会挡住那六个会话的每一次 docs / chore / memory 提交。落地的形状是验证**正确**的那个会话,而不是拒绝。`15def424` 收掉它留下的三条:平局判定从 `>=` 改成 `carrier mtime → session id` 的全序 `better()`(QA 把三个兄弟的所有六种排列都跑过,修复后收敛到**一个**目标,HEAD 下有**三个**);不可读的兄弟从静默丢弃改为**被点名**(审计者量到:40 棵指向这条路径的树里,HEAD 在 15 棵上打印 "0 NOT verified" 而确实丢了一个会话);注释里那串"87 + 47 + 19 + 18 + 14 rids"被删掉——它们是 request **文件**计数,真实枚举是 6 个载体会话上的 65 个 rid。
36
+
37
+ **staged 与 worktree 的分歧被抓住(`23d5de3d`)。** `git commit` 交付的是 INDEX,而本仓每一个测试、门和评审读的都是 WORKING TREE。两者分歧时"被验证的字节"和"被提交的字节"不是同一份,而没有东西说出来——一个会话里真实触发过两次:一轮修复编辑了受tracked 文件却没重新 `git add`,于是 STAGED 侧是修复前的弱守卫(22 例 / 16004 B)而 worktree 是 28 / 24168 B。比较**经过 git 的 filter**:staged 侧是 index blob,worktree 侧是 `git hash-object`。第一版直接比原始字节,在 `core.autocrlf=true`(本仓如此)下会把 git 判定为同步的文件拒绝,而且打印出的补救(`git add`)是可证明的空操作——**这是提交门唯一绝不能有的结局:它教人用 `--no-verify`**。不可比较的路径(gitlink、符号链接、未合并、不可读)一律拒绝。
38
+
39
+ **提交路径开始量 staged 文件尺寸(`8caa1901`)。** 在此之前 `node .husky/peaks-gate.mjs staged <over-cap file>` 对任何文件都打印 `NOTHING WAS COMPARED (staged) … every one of them is OUTSIDE the lint scope` 并 **exit 0**——337 行的测试文件和 600 行的一样,而 `peaks scan file-size` 与 transition 路径会拒绝同一个文件并给出 delta。新腿挂在门的 `all` scope 上而不是 lint-scoped 的 `files` 上,因为 `tests/**` 在 LINT scope 之外、却在 file-size 政策之内——挂在 `files` 上的腿会漏掉缺陷正是在其上被量到的那个文件;它跑在 empty-change-set 分支**之前**,因为那个分支正是本缺陷的签名。`scripts/lint/file-size-delta.ts` 调用 `scanFileSize`,与 `peaks scan file-size` 用的是**同一个**实现,新模块自己不含任何阈值、也没有"长大了"这个概念。**只有增长被拒绝**:已经超帽但没长大的文件保持绿,创建是另一个分支。
40
+
41
+ ### 4. 既有的几条判据被改成会失败
42
+
43
+ **尺寸判定按 delta 而不是绝对值(`435445dd`)。** `rd -> implemented` 的尺寸门扫描 `getChangedFiles` 并拒绝**任何**超帽的改动文件,而基线把 `fileSizeOverCap` **78** 当作可接受量棘轮着——同一个机制一边容忍 78 个超帽文件,一边不许任何切片碰其中一个。连续复现两次;第二次一个 767 行的文件因为改了 **2 行描述**被拒,两次会话都退回了 `--allow-incomplete`——那正是 artifact 契约存在来让它多余的旁路。状态机也开始强制它自己描述的顺序:`rd: draft -> handed-off` 此前能通过,而 `implemented` 与 `qa-handoff` 都被拒,于是一条切片可以越过每一道中间门宣称自己已交付。
44
+
45
+ **软通过的前提被真的报出来(`3059ac27`)。** 门为每一个缺失文件的 backCompat 前提构造一个 `warnings` 数组且不动 `missing`,于是 `ok` 保持 true——而调用方只在它自己的 `throw` 里读 `prerequisiteResult.warnings`。那个词在文件里只出现一次,就在那一行,所以成功路径上这个数组被构造、填满、一帧之后丢弃:一个软通过了两条前提的 transition 因此报 `warnings: []`,读者会断定每一条前提都通过了。实测:`data.prerequisiteWarnings: undefined` 与 `envelope.warnings: []` 变成了 **2 和 2**。顺带修掉一处"不会失败的门"——警告码是硬编码的字面量、指着 mut-report,却为**每一条** backCompat 前提发出,于是 third-party-review 前提被报在 mut-report 的码下面,而任何按那个码过滤 MUT_REPORT 问题的东西都会一并匹配到它。
46
+
47
+ **eslint 的行改成说出它们容忍什么(`d3684dbc`)。** `eslintFindings` 是一个**计数**的上界,而计数的上界意味着没有任何单条 finding 能迫使行动:ESM `require()` 家族的 16 个 error 级站点一直被报出来,却落在一个 1727 的计数里——约等于零。行现在是"包含 + 按量不增长",建立在 census 既有的 per-file map 上:1270 个文件里 478 个容忍 finding、792 个为零,artifact 精确复现 ceiling(**行之和 = 1727 findings / 573 errors**)。**提交路径调用同一条规则**,于是新实例在贡献者遇到它的地方**按名字**变红:
48
+
49
+ ```
50
+ count form: eslint findings (derived) 1 (ceiling 1) -> green, silent
51
+ table form: src/tidy.ts went from 0 to 1 lint finding(s) (+1) -> exit 1
52
+ ```
53
+
54
+ 一条关键情形也成立:对受容忍文件的**无关改动**在提交路径上保持绿——因为会拦住无辜提交的门正是教人用 `--no-verify` 的那一扇。这个切片交了六条 finding,最该记的一条是它自己赖以成立的理由**是假的,且来自编排者**:声称 eslint-disable 注释点名的 `no-var-requires` "在 ESLint v8 里不存在",实测 `@typescript-eslint/eslint-plugin` **8.66.0 定义了它**(`deprecatedSince` 8.0.0,`replacedBy` `no-require-imports`),而一条被弃用的规则**仍然会报**。真缺陷是"被抑制的规则"和"在报的规则"**不匹配**——一个更有意思的失败,被那个更弱的故事挤掉了。
55
+
56
+ **把每一个 `require()` 扫出源码,并防止它回来(`c3fe88b7`)。** 本仓每个 `package.json` 都声明 `"type": "module"`,所以 `require` 在运行时不存在。十六处分布在十四个文件里:十五处躲在函数体里当"惰性" require,只在各自的冷路径上抛;一处(`scripts/fix-dispatcher.js`)在顶层,让那个文件无法加载。**没有任何东西能在模式上失败,这正是它累积起来的原因**:tsc 接受 ESM 文件里的 require;没有测试走过那些路径;四处带着 `eslint-disable-next-line @typescript-eslint/no-var-requires`——一条**没有启用**的规则,而真正的拼写 `no-require-imports` 本来就在那些站点上报错,于是这些指令什么都没抑制。实测 before → after:`peaks loop run` 在干净会话上 `RUN_FAILED "require is not defined"` → exit 0 `RUN_OK`;`peaks security-audit run` 不带 `globalThis` shim 从 exit 1、只留一个 `.tmp` → exit 0、`.md` 落盘。新守卫 `tests/unit/standards/no-esm-require-mixing.test.ts` 目标为零、无 allowlist,其判别性对照是一个被转换文件**逐字的前修内容**——一条不可能失败的对照不是对照。
57
+
58
+ **一个名字可以给一行做键,不能判定一行(`e8e916e6`)。** 同一缺陷类的三个活实例,每一个都由测量而非检视确立:`pilot-gate-store` 拒绝任何不以 `rid-` 开头的 rid,而 `.peaks/_runtime/*/rd/requests/` 下 97 个不同 id 里有 **58 个**没有前缀——守卫在拒绝本仓实际铸造的多数 id;`type-sanity-service` 用 `/\b(?:tests?|…)\b/` 判断"这是不是测试文件",而词边界可以被 `-` 满足,于是 `src/services/test-cache/test-cache-service.ts` 被判成测试(在 `git ls-files` 上重测:3064 条 tracked 路径,**恰好 29 条判定改变**,全部单向——18 条变 `source`、11 条变 `unknown`);`context/collector` 把 `relative(root, full)`——在 win32 上以 `\` 分隔——喂给一个测试 `/__tests__/` 的分类器,于是那个分支在它被写成的平台上**永远不可能匹配**,而规范化的值就在四行之上已经算好了。
59
+
60
+ ### 5. 派发:提示词第一次被自己的 CLI 校验
61
+
62
+ 编排者手写一份共享 brief 交给一个 campaign 里的每个子代理,**没有任何东西校验它**,而它在一次会话里三次携带关于本仓 CLI 自身的假陈述:一个错 flag、一条范围错误的必需项、一条挂在错 artifact 上的必需项。三条都是子代理读 artifact 时发现的,**没有一条是门发现的**——这是工作流里唯一没有测试读过的 artifact。
63
+
64
+ `9894eab0` 加了检查器:从提示里抽出 `peaks …` 调用,对**注册的命令树**解析,报出被解析出的命令或它的祖先没有声明的 flag。解析来自 CLI 自己,永不来自一份名单。它**警告而不拒绝**,决定的数字是真实语料上的假阳性计数:本会话 **147 条派发记录、1772 次调用、176 条未声明 flag**,其中**恰好一条**是假阳性——一份正确的 brief 在一个记录该缺陷的表格里**引用了**那条错误命令。`--rid` 是整个语料里唯一的未声明 flag:147 次出现在被注入的一行上,29 次出现在手写的一行上——**第二组是真的,这正是本片的意义**。审查者给的二次输入关闭了一个真缺陷:一次每匹配都走到文末的扫描在 `composeDispatchPrompt` 里对一份 3.5 MB 提示耗时 **109.9 s**,按 run 上限定界后同一输入是 **98.6 ms**。
65
+
66
+ `f9ecb6fd` 把被注入的那一行修对:`L1_WORKTREE_GOVERNANCE_BLOCK` 里的两条 worktree 命令**都跑不起来**——`peaks worktree auth grant --rid … --reason … --ttl <5m>` 三处都错(没有 `--rid` 这个 flag,它是可选的 `--request-id`;必需的 `--operation` 被省略;`--ttl` 的单位是毫秒,`<5m>` 不是合法值形式),逐一逐字运行两者都答 `error: required option … not specified`。修完的守卫是重点:第一版只查 flag 是否存在、必需项是否出现、拼写是否声明过——评审证明它**看不见它刚刚移除的缺陷**:把 `--ttl 5m` 重新加回全部五个表面,它 8/8 全绿,而 CLI 接受那一行并写下一份 **5 毫秒** TTL 的 grant。它现在是逐次出现的形状走查,把每个选项对回注册声明,断言块里点名的字面值是声明 enum 的成员,并把未被消费的 token 当作游离操作数。
67
+
68
+ `b7056cdb` 让生产者知道它将被按什么评判:前提表靠字面量字符串判定 artifact 是否存在,而派发提示从不点名它们——于是做了工作的生产者被一个它从未被展示过的谓词拒绝,唯一出路是事后编辑别人的证据。实测:四个有真实内容、判定正确、证据可量的 artifact 因四条违规被拒,**每一条都是缺失的字面标题而非缺失的事实**。块从表里**生成**,永不从表里**转录**:改表会移动这个块,移除 surfacing 会让套件点名那个缺失的标记而变红。
69
+
70
+ ### 6. artifact 按 rid 落盘,两条切片停止互相覆写
71
+
72
+ 一个会话里两条同类型切片写同一个路径,第二条覆写第一条,**而两条 transition 都通过**——第二条切片被另一份 diff 的审查判定,artifact 和门里都没有任何东西说出来。本版把三类 artifact 改成按 rid:
73
+
74
+ - `BUG_ANALYSIS`(`6a394084`):`rd/bug-analysis.md` → 带 `<rid>` 占位符,`legacyRelativePath` 兜底,磁盘上已有的会话继续解析;`AUDIT_SECURITY` / `AUDIT_PERF` / `KARPATHY_REVIEW` 早已是这个形状。磁盘上实测:三个会话 95 份 request artifact 里,**每个会话恰好一份** `bug-analysis.md`。后果是**观察到的而不是推断的**:一个在修显然是 bugfix 的 RD 报称自己选了 `refactor`,因为那个文件"已经装着另一条切片的分析"——而声明一个自己不是的类型会选中**另一张**前提表,于是结构性碰撞转化为一条静默更轻的门。把表项回退,13 个用例里 9 个变红。
75
+ - `SECURITY_REVIEW`(`47863518`):`rd/security-review.md` 是同一碰撞里**硬且静默**的那个实例,它不声明 `mustContain`。七处读者分布于五个服务,八份 `skills/**` 文档一并跟过来。两轮 QA 修复各有产出:第一轮证伪了一条证据表断言(`workflow-gates-and-types.md:109` 不在 diff 里却仍然断言那个性质),第二轮证伪了清扫自己的完备性断言——模式以 artifact **名字**和 token "rid" 为键,而真正要紧的 `v2-12-fanout-collapse.md:12/:15` 把 `audit/security.md` 与 `audit/perf.md` 当作当前的写目标呈现,其中 `rid` 出现 **0 次**。所以第二轮不再清扫,而是落地 `tests/unit/services/artifacts/legacy-path-doc-contract.test.ts`:从前提表**推导**被降级的词干(七个名字,没有喂给扫描的字面名单),它的红跑取在真实的修复前文本上,1 failed / 15 passed,恰好点名那三处。
76
+ - `final-review` 消费的 rid 作用域证据路径(`ebb07c61`):门接受的 artifact 路径**其消费者从不读**——`peaks prepare-final-review` 从 `rd/code-review.md`、`rd/security-review.md` 拼装证据,而 transition 门与写侧统一在 `rd/code-review-<rid>.md` 与 `audit/security-<rid>.md`;写对了 rid 作用域路径的切片,其 no-new-bugs 维度仍然回到 `inconclusive`,评审报 `rd-code-review` ENOENT。
77
+
78
+ `0da35578` 把一条**写了却没人读**的声明变成会被读:`backCompatUntil` 落在两行前提上(`mut/mut-report.json` 在 v2.14.0、`rd/third-party-review.md` 在 v2.15.0)而没有任何东西读它,安装版本是 4.1.4,于是两个窗口都过期了约二十个 minor release,没有任何用户可见的输出把它们与按时的窗口区分开。软通过警告现在带一个附加的 `expiredWindow` 字段,拒绝打印机与成功打印机都渲染它。实测一次真实的 `rd -> qa-handoff`:两条软通过分别报 `v2.15.0 (installed 4.1.4)` 与 `v2.14.0 (installed 4.1.4)`,各带一句 "past expiry"。**它只观察**:一条 OPEN 窗口和一条**早于**窗口的构建都渲染不出这个从句,缺失前提仍然给 `ok: true`,`path`/`code`/`message` 逐字节不变。
79
+
80
+ `21016bbf` 让一条切片**声明它判定了什么**,而检查读那份声明(backlog 9.9 的第四次尝试):三次尝试都被建起来又撤回,因为此前没有机器可读的"这条切片动了什么",每个机制只能去**推断**,而每一种推断在本仓日常生成的输入上都是错的——从 git 状态推断会让干净树上的审计永久空转,从散文 `## Red-line scope` 解析会拒掉 15 份真实请求里的 14 份。现在 `security-audit run --judged <paths...>` 记录每条路径的内容哈希,`rd:qa-handoff` 重新哈希它们并拒绝,点名 artifact 与第一条移动的路径。
81
+
82
+ ### 7. 其余修复
83
+
84
+ - **`peaks workspace init` 把本仓自己的开发 hook 注册进下游项目(`09f8d043`)。** 模板用 `bash "${CLAUDE_PROJECT_DIR}/src/services/hooks/<script>.sh"` 展开两条 hook,而 `${CLAUDE_PROJECT_DIR}` 解析到**消费者**的项目根,脚本在本仓的 `src/` 里,`package.json#files` 也不发 `src/**`——于是每个下游项目都拿到两条无法解析的 Bash PreToolUse 条目。修法是 `TEMPLATE_VERSION` 1.9.0 → **1.10.0** 并把这些条目注册进本仓**被 tracked** 的 `.claude/settings.json`,fresh clone 才真的能拿到它们。这次搬迁又打断第二条门:反馈提升检查的 layer B 只读 `peaks workspace init` **生成**的那份快照,快照刷新后两条真的被提升的规则会被报成未提升——一个假阴性,因为强制**搬了家而不是消失了**。
85
+ - **仪表盘数了三类计数,而没有任何东西发出它们(`e6bcc39e`)。** `peaks dashboard summary` 报 `cycleCount` / `tokenCount` / `monotonicTriggerCount`,而它们的唯一生产者是三个**没有调用点**的 helper——三个计数按构造为零。实测 `{"cycleCount":0,"tokenCount":0,"dispatchCount":3,"compactCount":0,"monotonicTriggerCount":0}`:`dispatchCount` 非零,另外三个结构性地死。这类计数此前通过的验收是 `AC-F1: PASS - observability-service.ts exports 4 new emit helpers`——它测的是**导出**而不是**发出**,于是每个类别都未接线地发了出去。
86
+ - **`peaks memory extract` 报了一个它没有写下的数字(`97bb5e5c`)。** 一个 5 块的 capsule 给出 `extractedCount: 5`、`plannedWrites: 5`、`warnings: []` 而磁盘上只有**四个**文件:一个纯 CJK 标题被 slugify 成空,回退到通用的 `project-memory.md`,与一条已 tracked 的条目碰撞,于是那次写入被静默跳过。第一版修复**本身是一次回归**,由评审发现:派生名用十六进制、每字节两个字符,一个长标题产生 287 字符的文件名、ENOENT,并让**整个批次**中止。
87
+ - **`peaks request retag`,以及"默认类型"不再无声(`97bb5e5c`)。** 一个 hand-written artifact 的 request type 此前静默地就是默认的 `feature`——`rd:qa-handoff` 要求最多的那个类型。它现在在 `request show` 里同时以字段和警告的形式可读为 `declared` 或 `default`;`--type` 缺席时 `init` 不写 type 行,于是默认值永不被盖在那个区分之上;`retag` 负责改它,并且**往 artifact 里追加自己的注记**——那个唯一能改门禁适用表的操作不再不可见。`getPrerequisitesFor` 的默认值被删除,它的第三个参数现在是必需的。
88
+ - **四条只有散文在强制的义务有了执行者(`fae227a1`),每一条都先在野外被量到失败。** 强制的 Karpathy 块此前没有执行者,而 2026-10-12 的四份 RD 提示**全都不含它**(派发路径现在自己追加:一份已经带了它的草稿 14029 → 12055 字节,正好是 2 字节分隔符加 1758 字节的块);派发账本的回收器没有调用者(每个会话的每条记录都是 `queued`,39/39、2/2、9/9、23/23——终结动词在数字是 13 时写就,到 73 时已无人调用);一个看不见文件的扫描会报绿(`peaks-gate.mjs repo` 走 `git ls-files`,所以 `3b95e00a` 加进一个没有基线行的模块后门从那次提交起就是红的);审计拒绝点名了错误的路障(两个 CLI 都以 `handoff-missing` 拒绝而不说信封**已经通过**校验,于是四个独立审查者每人做完全部工作却无法落地)。
89
+ - **`peaks code lint` 的 `execution-failed` 不再把四件事说成一件(`adf63e1e`)**:不可构建的参数表、失败的 spawn、被杀的子进程、无法解析的 linter 输出,共用一个状态码且一个都不点名,而 hint 无论实际发生了什么都说 "restore the ESLint toolchain"——一个工具链好好的操作员被指去重建它。现在 `reason` 从 runner 带进消息,每个条件一个。
90
+ - **CI 的 capability 基线门现在说出**哪个**探针失败了(`adb3c67c`)。** 4.1.4 的发布在 `gate-capability-baseline` 上失败,CI 只给一行 `verdict=drifted degraded=false failing=[J03]`——J03 有六个探针,六个条件压缩成一个词。细节其实一直都在:`capability-audit-service/runner.ts` 从写下那天起就把失败契约的 `diff.reason` 放进 `dimensions[].evidence[].summary`,而工作流的内联脚本只读 `journeyId` 就把它丢了。测试**不读**工作流,而是**执行**它。
91
+ - **工具在说假话的那些散文(`48861a11`、`e84ef33e`、`cdbef65d`、`c0554c7a`、`f3a3c969`、`17183c8c`、`e4030eb1`)。** 一整族 fix 都在改**散文而不是代码**,因为代码是对的而承诺超了:`skills/peaks-race-code/SKILL.md` 引用了一份 `docs/` 下的设计记录,而 `docs/` 不在 `package.json#files` 里、安装器只拷贝技能目录,所以那条引用对每个消费者都是死的(引用守卫按仓根解析,对"是否会被发布"是盲的);快车道规范说"没有第二份拷贝能通过套件",而测试只查一个文件、两条陈述里的一条——**一条强于代码的断言,写在正是为阻止它而存在的规范里**;一趟以 `vitest … | head` 为模式、走全文匹配的 hook 拒绝了一条搜索模式为 `vitest` 的 `grep`,而本仓**自己规定**的命令 `timeout 300 pnpm vitest run 2>&1 | tail -100`(就写在 "If the exit code is 0, tests passed" 旁边)反而因为 `timeout` 起头而不受保护——被改的是文档,不是匹配器。
92
+
93
+ ### 8. 记录与记忆(62 docs + 3 test + 3 style + 2 chore)
94
+
95
+ 绝大多数 docs commit 是 backlog 与 memory 的沉淀,但它们记录的是本版反复撞上的同一类缺陷:**标题是一个断言,而没有东西检查它。** 实测:§9 的四条决定项**都已由用户裁定**,其中三条**已经实现**(9.1 在 `3b95e00a`、9.2 的裁定在 `3059ac27`、9.3 的两半在 `435445dd`、9.4 的前一半在 `d3684dbc`),而**每一条的标题都还写着 "needs the user's decision"**——信任标题的读者会重新实现已完成的工作(`80b14172`)。同一族里还有:一个以名字为键的清扫看不见由**位置**定义的类(真正要紧的文件里搜索键出现 **0 次**);一条被复制到四个载体里的错误理由(`9.4` 的 `no-var-requires` 故事,见 §4)在任何地方都不可校验,而其中一份是 sha256 锁定的、根本改不了。
96
+
97
+ `3 test` 与 `3 style` 里最该记的是**格式棘轮**:`b9b5ca69` 把 `node .husky/format-check-ratchet.mjs` 挪进 pre-push 并**放在最前**——理由不止是开销,而是该腿失败时的补救是 `pnpm format`,它会重写 tracked 源码,从而让另外两条腿作废。这正是一周 drift 一次浮出的地方:`2e8c8b6a` 面对的是**累积在主分支上的 61 个 commit**、两个未格式化文件落在允许集之外。两文件被判为**空白改动**的方式不是 `git diff -w`(prettier 在这里做的是**行重排**,`--ignore-whitespace` 无法规范化一个换行),而是把空白全部剥掉后与 HEAD **逐字节相同**(12309 字符 / sha256 `8759576b…`,9655 字符 / sha256 `ceccf1f1…`,修复前后一致)。`f50210ef` 把允许集从 12 个名字收缩到 **11** 个——**只减不增,这是这份棘轮唯一安全的方向**。
98
+
99
+ ### 9. 未验证(记录而非隐瞒)
100
+
101
+ - **快车道的 pilot 门判 `insufficient-evidence`,不是 pass**:五条真实 trace 给出两个缺口(task 4 < 10、session 1 < 2),所以快车道在 pilot 清关前**只在用户点名它时**可达。
102
+ - **第 3 节的三道门在 CI 上不可测**:artifact 住在 gitignored 的 `.peaks/_runtime/` 下,而这三条腿的存在理由正是"本地提交是它们唯一可见的边界"。
103
+ - **提交禁令(AI 署名红线)只在 trae / cursor / codex 上运行**。Claude Code、hermes、openclaw 拿到的是 `gate enforce`,其中不含禁令——所以这条红线在**这三个 harness 上仍然只有检测、没有执行**。
104
+ - **快车道完成的证明是自报的**,而强制的规范住在 `skills/peaks-code/references/fast-lane-norm.md`,在**任何车道里都没有执行者**;`src/services/hooks/` 下的 shell sibling 由一个全局作用域的安装拷贝、且**没有接线到任何东西**。
105
+ - **eslint 行表的键是名字,而名字不是身份**:一个文件被**重命名**到一个受容忍的名字上会洗白它的 findings,且无需任何重生成——旧路径离开被量过的 map、总量下降,那是一个被允许的方向。在 header 里连同探针一起写明,**未修**(身份追踪是另一次改动)。
106
+ - **`21016bbf` 的完备性不被强制**:一份声明是"关于它点名的路径"的断言,永远不是"那就是全部"(实测:磁盘上十个文件、声明一个,绿)。而该片还记录了一次代价——实现者为了追 `prettierUnformatted` ceiling 把一次 `prettier --write` 从自己拥有的文件扩大到两整棵树,重排了 65 个无关 fixture 和 6 个随包发布的模板;它们全部被回退。
107
+ - **尺寸 gate 的 subprocess 开销未优**:K 个超帽**改动**文件要 2+2K 次 git spawn,每次约 58 ms,已知的修法是单次 `cat-file --batch`——**未实现**,因为两个调用点都是每切片的人手命令,付 0.3–0.8 s。
108
+ - **本版记录的 ceiling 只降不升**,全部由受认可的生成器产出,nothing rose:
109
+
110
+ ```
111
+ eslintFindings 1760 -> 1722 fileSizeOverCap 78 -> 77
112
+ eslintErrors 590 -> 572 fileSizeExcessLines 22502 -> 22117
113
+ ```
114
+
115
+ ## 4.1.4 — 2026-10-10 (修掉推送门上的一个假绿;`src/cli/commands` 清空超帽;两条"BLOCKING 却拦不住任何东西"的步骤;以及一项被推迟的边界)
116
+
117
+ **版本级别**: 未发布区间 `v4.1.3..HEAD` 共 **17 个 commit**(1 feat / 5 fix / 6 refactor / 2 test / 其余 docs+memory)。取 **patch**,依维护者 2026-07-22 的常设规则"默认版本新增采用最小的版本位"。4 个 workspace 包各 +1 patch(internal-runtime 0.0.43→0.0.44、mut 0.1.57→0.1.58、shared 0.0.92→0.0.93、shared-channel 0.0.60→0.0.61),`CLI_VERSION` 与 `RUNTIME_VERSION` 由 `scripts/sync-version.mjs` 同步。**本版不新增命令族**,所以 4.1.3 那条"新增命令应取 minor"的注记不适用。
118
+
119
+ ### 1. 推送门上的一个假绿(1 fix,三轮交付)
120
+
121
+ **leg 2 的分类器会把"新增了 gated 文件却忘了重生成基线"的改动放过去。** 实测 `6a1938a8` 那次推送:leg 2 跑了 601 个测试,**其中没有一条**是钉"每个 in-scope 文件都在 `gate-baseline.json` 里有 `files[]` 行"的那个守卫——它住在 `tests/unit/standards/`,而分类器只把 `src/<area>` 映射到 `tests/unit/<area>`,**没有任何一条路径通向那里**。守卫直到**下一次**推送(改了 `.husky/` 触发全量)才变红,`0c5fe123` 就是那两次提交需要付的修。
122
+
123
+ 分类器现在是一个**纯模块**(`scripts/test-changed-classify.mjs`),三条规则旧映射表达不了:
124
+
125
+ - **R1** 基线**内容**动了 ⇒ 跑它的守卫套件(`tests/unit/standards/` + `tests/unit/lint/`),而不是 0 个测试
126
+ - **R2** 任何 `A`/`D`/`R`/`C` ⇒ 跑人口守卫(按 git **status** 判定,不重述 census 的策略目录)
127
+ - **R3** census 的**策略源文件**被改 ⇒ 同样跑(`M src/services/scan/file-size-policy.ts` 会让 44 个 `.md` 突然进 scope)
128
+
129
+ **只有 `generatedAt` 动了的重生成仍然是惰性的(0 测试)——但现在是建立在一个真命题上。** 旧豁免写的理由是"没有测试读它",那是**假的**:读者经由 `tests/unit/standards/_file-size-cap-scan.ts` 的 `BASELINE_PATH` 常量抵达它,而 2026-09-23 那次搜索找的是路径**字符串**,看不见常量间接引用。
130
+
131
+ **第一版实现被 5 路评审否决,而这是本版最有价值的一段记录。** 它把守卫加进**选择集**,于是"没映射到测试 ⇒ 跑全量"那张网永不触发:**新增一个 CI workflow 会一个读 `.github/` 的测试都不跑**(实测有 5 个)。四个来源独立撞上同一缺陷,而 AC5 的验收臂看不见它——**因为那条臂用的正是唯一还能漏下去的形状**(`M README.md`)。修完的形状是:**守卫是映射的加法,不是全量网的替代品**,且那张复现表变成了一组臂。
132
+
133
+ ### 2. `src/cli/commands` 清空超帽(6 refactor)
134
+
135
+ **30 个超帽文件 → 0**(目录从 300 走到 440 个跟踪文件)。配方是**拆分与压函数必须在同一次交付里完成**——只拆会把 `eslintFindings` 推高(本仓第一批就这样被拒过 +23/+19),一起做则下降。
136
+
137
+ 三个 `src/services` 顶层文件也一并处理(`hooks-settings-service` 1037→300、`auto-compact-orchestrator` 1030→285、`config-service` 1011→253)。
138
+
139
+ **四个 ceiling 全程只降不升**:
140
+
141
+ ```
142
+ fileSizeOverCap 112 -> 78
143
+ fileSizeExcessLines 30352 -> 22502
144
+ eslintFindings 1951 -> 1760
145
+ eslintErrors 709 -> 590
146
+ ```
147
+
148
+ ### 3. 两条"BLOCKING 却拦不住任何东西"的步骤(1 fix)
149
+
150
+ **由一次真实事故追出**:本会话的编排者跑完 4 个 slice、11 个提交,**从未执行 Step 11 的记忆沉淀**,而契约写着它 BLOCKING。追查后是两条可定位的缺陷:
151
+
152
+ - **Step 11 没有任何可执行的拒绝点。** `verify-pipeline` 查 QA 与 Gate H;`emit-handoff` 查 **job 账本**;`gate-step-08` 查 job 叙述——**没有一个查 memory**。唯一"可执行的" Step 11 相关物,断言的是 SKILL.md 里那个**标题**存在。
153
+ - **`gate-step-08` 在输入缺失时 fail-open**,并把"我没有能力判断"说成"我判断了,这不像 Job"。实测:整轮**一次 `Next: slice #N of M` 都没出现**。而这个真空本仓的 drift **D-003** 已记过(`JOB_SHAPE_NOT_DECIDED` 自 4.0.0-beta.6 起不再抛),它只是从另一个角度又咬了一次。
154
+
155
+ 修法:`emit-handoff` 增加 `block-no-sediment`(信号取自 `.peaks/memory/index.json`,**peaks 自己的状态,不是裸 mtime**;三值化且 **`unknown` 拒绝**);`gate-step-08` 三态化,**无决定但有账本 ⇒ 拒绝**。**两半都端到端验过**:把 `job-shape.json` 移开 ⇒ exit 2;让 memory index 不可读 ⇒ exit 1。**这里的 fail-closed 语义是"别再声称一个你没做出的判断",不是"拦下每一次 Bash 调用"**——该 hook 跑在每个会话的每次 Bash 上。
156
+
157
+ 同时把 5 条反馈记忆提升到强制层(3 条 Layer A 由 CLI 自行生成注册,2 条 Layer B 写成**真的** PreToolUse hook:一条拦会改全局状态的命令,一条拦"把测试运行器管进管道"——后者本会话被犯过两次)。**Layer B 的注册一度只存在于 gitignored 的生成文件里**,所以本版把两条条目加进生成器、**并把它从 475 行压到 299 行**(帽 300)以不抬 ceiling。**`shell` pin 是真正的坑**:照抄旁边那条的约定会让两个 hook 变成非阻断错误从而**静默放行**。
158
+
159
+ ### 4. 一项被推迟的边界(1 fix)
160
+
161
+ slice 1 当初**刻意推迟**了 git C-quoting:含非 ASCII/控制字节的路径会被加引号,于是匹配不上任何锚定正则。推迟的理由是它先于本版存在、且当时 0 个受影响路径。本版用 `git diff --name-status -z`(NUL 分隔、不加引号不转义)关掉它,`parseNameStatus` 按 status 字母隐含的字段数消费记录。**对照是真的**:同一份 diff 去掉 `-z` 确实带引号,而 HEAD 的解析器逐字返回那个带引号路径。
162
+
163
+ ### 5. 边界取证(2 test)
164
+
165
+ 三项"机制存在但从未端到端跑过"的欠账:`format:check` 在 CI runner 上**确实评过**(不是被跳过);PATH 上的 `peaks` 是**已安装构建**而非工作树,且**8 个未推送提交新增的 161 个 src 文件全部不在已安装 dist 里而两边都报 4.1.3**——本地 e2e 覆盖**看起来存在而实际为零**;棘轮唯一的联合判定例外 `COUPLED_SIZE_RISE`**确实能开,而且是有条件的**(双向实测)。
166
+
167
+ 审计另外补上了两处此前**没有任何东西能抓到**的行为(`docker rm --force` 的 argv、`docker run` 的 flags),方式是对未驱动路径做**注入式直接调用测试**——评审证明过:五个相同的注册表哈希是**一个维度重复五次**,而它**看不见函数体**。
168
+
169
+ ---
170
+
3
171
  ## 4.1.3 — 2026-10-09 (只读 MCP 能力面首次发布:把"只读"做成可证伪的东西;两处"工具在说假话"的修复;三批尺寸债,以及门禁自己被加固)
4
172
 
5
173
  **版本级别**: 未发布区间 `v4.1.2..HEAD` 共 **20 个 commit**(2 feat / 3 fix / 4 refactor / 2 chore(gate) / 2 merge / 其余 docs+memory)。取 **patch**,依维护者 2026-07-22 的常设规则"默认版本新增采用最小的版本位"。
package/README-en.md CHANGED
@@ -155,7 +155,7 @@ Every lane opens with **one slash command**.
155
155
 
156
156
  | | |
157
157
  | --- | --- |
158
- | **Latest** | [![npm](https://img.shields.io/npm/v/peaks-loop?style=for-the-badge&logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/peaks-loop) — 4.1.3 (2026-10-09) |
158
+ | **Latest** | [![npm](https://img.shields.io/npm/v/peaks-loop?style=for-the-badge&logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/peaks-loop) — 4.1.5 (2026-10-14) |
159
159
  | **Domains** | Code (`peaks-code`) · Content (`peaks-content`) · Project health (`peaks-doctor`) · Issue sweep (`peaks-issue-fix-orchestrator`) · Custom SOP (`peaks-sop`) · Cross-domain primitives (`peaks-solo` dispatcher · `peaks-resume` · `peaks-status` · `peaks-test` · `peaks-slice-decompose`) |
160
160
  | **Sediment pool** | `~/.peaks/` local pool · twice-clean runs auto-promote to a bee · broken runs come back for you to redefine · the bee grows with your taste |
161
161
  | **Test suite** | 285+ cases · 4 packages (peaks-loop / peaks-loop-mut / peaks-loop-shared-channel / peaks-loop-shared) · **0 timeouts** · 14 BDD caller-binding edge cases |
package/README.md CHANGED
@@ -175,7 +175,7 @@ npm i -g peaks-loop
175
175
 
176
176
  | | |
177
177
  | --- | --- |
178
- | **最新版本** | [![npm](https://img.shields.io/npm/v/peaks-loop?style=for-the-badge&logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/peaks-loop) — 4.1.3(2026-10-09) |
178
+ | **最新版本** | [![npm](https://img.shields.io/npm/v/peaks-loop?style=for-the-badge&logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/peaks-loop) — 4.1.5(2026-10-14) |
179
179
  | **覆盖域** | 代码(`peaks-code`) · 内容(`peaks-content`) · 项目健康(`peaks-doctor`) · 批量修 issue(`peaks-issue-fix-orchestrator`) · 自定义 SOP(`peaks-sop`) · 通用原语(`peaks-solo` 分诊 / `peaks-resume` 续 / `peaks-status` 看 / `peaks-test` 测 / `peaks-slice-decompose` 切片) |
180
180
  | **沉淀池** | `~/.peaks/` 本地池 · 跑两次自动晋升成 bee · 跑翻车让你重定义 · bee 跟着你的口味长 |
181
181
  | **测试套件** | 1096 cases · 4 packages (peaks-loop 1015 / runtime 39 / mut 22 / shared-channel 20) · **CI 首次全绿**(ubuntu + windows) · 14 BDD caller-binding coverage |
@@ -7,6 +7,26 @@ export type ProgramIO = {
7
7
  stdout: (text: string) => void;
8
8
  stderr: (text: string) => void;
9
9
  };
10
+ /**
11
+ * `warning` text as it may be PRINTED: control characters replaced with `?`,
12
+ * never truncated, so a reader sees that something was there and loses nothing.
13
+ *
14
+ * A warning's `path`/`message` can carry `gate-evidence-derivation`'s
15
+ * `gateEvidence.<key>`, whose key is parsed out of the handoff frontmatter — a
16
+ * quoted YAML key can decode to a newline and forge a line of this command's own
17
+ * output. Both branches (success, failure) call this, hence its home here.
18
+ *
19
+ * LIMITATION, so it is not read as a guarantee: `printResult` is not itself a
20
+ * sanitizer, so this holds per CALL SITE — a third warning-formatting site, or
21
+ * any caller passing unvetted text to `printResult`, is raw until it calls this.
22
+ * `printableToken` in `.husky/pipeline/contract-verdict.mjs` is the same defence.
23
+ * The two cannot share one implementation TODAY for a packaging reason, not in
24
+ * principle: `package.json#files` ships `dist/**`, `bin/**` and named `scripts/*`
25
+ * but not `.husky/**`, and `allowJs` is off — a shared module would have to be
26
+ * plain JS inside the shipped `src/` tree, which that boundary does not permit.
27
+ * Until it does, this copy is a latent drift.
28
+ */
29
+ export declare function printableWarningText(value: string): string;
10
30
  export declare function printResult<T>(io: ProgramIO, result: ResultEnvelope<T>, asJson?: boolean): void;
11
31
  export declare function printSuperCommandCatalog(io: ProgramIO): void;
12
32
  export declare function addJsonOption(command: Command): Command;
@@ -1,4 +1,38 @@
1
1
  import { fail, getErrorMessage, ok, redactSensitiveErrorMessage } from 'peaks-loop-shared/result';
2
+ /** The replaced range, by name: C0 … DEL … C1. */
3
+ const LAST_C0_CODE_POINT = 0x1f;
4
+ const DEL_CODE_POINT = 0x7f;
5
+ const FIRST_C1_CODE_POINT = 0x80;
6
+ const LAST_C1_CODE_POINT = 0x9f;
7
+ const isControlCodePoint = (code) => code <= LAST_C0_CODE_POINT ||
8
+ code === DEL_CODE_POINT ||
9
+ (code >= FIRST_C1_CODE_POINT && code <= LAST_C1_CODE_POINT);
10
+ /**
11
+ * `warning` text as it may be PRINTED: control characters replaced with `?`,
12
+ * never truncated, so a reader sees that something was there and loses nothing.
13
+ *
14
+ * A warning's `path`/`message` can carry `gate-evidence-derivation`'s
15
+ * `gateEvidence.<key>`, whose key is parsed out of the handoff frontmatter — a
16
+ * quoted YAML key can decode to a newline and forge a line of this command's own
17
+ * output. Both branches (success, failure) call this, hence its home here.
18
+ *
19
+ * LIMITATION, so it is not read as a guarantee: `printResult` is not itself a
20
+ * sanitizer, so this holds per CALL SITE — a third warning-formatting site, or
21
+ * any caller passing unvetted text to `printResult`, is raw until it calls this.
22
+ * `printableToken` in `.husky/pipeline/contract-verdict.mjs` is the same defence.
23
+ * The two cannot share one implementation TODAY for a packaging reason, not in
24
+ * principle: `package.json#files` ships `dist/**`, `bin/**` and named `scripts/*`
25
+ * but not `.husky/**`, and `allowJs` is off — a shared module would have to be
26
+ * plain JS inside the shipped `src/` tree, which that boundary does not permit.
27
+ * Until it does, this copy is a latent drift.
28
+ */
29
+ export function printableWarningText(value) {
30
+ let printable = '';
31
+ for (const char of value) {
32
+ printable += isControlCodePoint(char.codePointAt(0) ?? 0) ? '?' : char;
33
+ }
34
+ return printable;
35
+ }
2
36
  export function printResult(io, result, asJson = false) {
3
37
  if (asJson) {
4
38
  io.stdout(JSON.stringify(result, null, 2));
@@ -55,6 +55,7 @@ import { registerProjectCommands } from './project-commands.js';
55
55
  import { registerChangesetCommands } from './changeset-commands.js';
56
56
  import { registerQaBusinessReviewCommands } from './qa-business-review-commands.js';
57
57
  import { registerQaCommands } from './qa-commands.js';
58
+ import { registerRaceCommands } from './race-commands.js';
58
59
  import { registerReleaseCommands } from './release-commands.js';
59
60
  import { registerRequestCommands } from './request-commands.js';
60
61
  import { registerRetrospectiveCommands } from './retrospective-commands.js';
@@ -165,6 +166,7 @@ const REGISTRATIONS = [
165
166
  ['verdict-aggregate-command', registerVerdictAggregateCommands],
166
167
  ['log-commands', registerLogCommands],
167
168
  ['qa-commands', registerQaCommands],
169
+ ['race-commands', registerRaceCommands],
168
170
  ['test-commands', registerTestCommands],
169
171
  ['playwright-commands', registerPlaywrightCommands],
170
172
  ['code-commands', registerCodeCommands],
@@ -0,0 +1,12 @@
1
+ import { openStateDb } from '../../services/skillhub/sqlite-store.js';
2
+ import { CrystallizationService, type CrystallizationTrigger } from '../../services/crystallization/index.js';
3
+ export declare function collectRepeatable(value: string, previous: string[]): string[];
4
+ export declare const DISPOSE_MODES: readonly ["trace_only", "retain", "destroy"];
5
+ export type DisposeMode = (typeof DISPOSE_MODES)[number];
6
+ export declare function parseTriggerFlag(raw: string): CrystallizationTrigger | null;
7
+ /** `--project`, else the nearest project root above cwd, else cwd. */
8
+ export declare function resolveAssetProjectRoot(project: string | undefined): string;
9
+ /** Ensure `<projectRoot>/.peaks/` exists and open its `state.db`. */
10
+ export declare function openAssetDb(projectRoot: string): ReturnType<typeof openStateDb>;
11
+ /** The CrystallizationService wiring every asset verb repeats, built once. */
12
+ export declare function createCrystallizationService(db: ReturnType<typeof openStateDb>): CrystallizationService;
@@ -0,0 +1,45 @@
1
+ // src/cli/commands/asset-command-shared.ts
2
+ //
3
+ // The flag parsers, project/db bootstrap and service wiring the three
4
+ // `peaks asset` verbs share. Split out of `asset-commands.ts` so each verb can
5
+ // live in its own module without repeating the same twelve-line construction.
6
+ import { existsSync, mkdirSync } from 'node:fs';
7
+ import { join } from 'node:path';
8
+ import { openStateDb } from '../../services/skillhub/sqlite-store.js';
9
+ import { CrystallizationService, CRYSTALLIZATION_TRIGGERS } from '../../services/crystallization/index.js';
10
+ import { LoopReleaseSchema } from '../../services/loop/loop-release-types.js';
11
+ import { insertLoopRelease } from '../../services/loop/loop-release-store.js';
12
+ import { insertLoopBeeRelation } from '../../services/loop/loop-bee-relation-store.js';
13
+ import { LoopBeeRelationSchema } from '../../services/loop/loop-bee-relation-types.js';
14
+ import { findProjectRoot } from '../../services/config/config-safety.js';
15
+ export function collectRepeatable(value, previous) {
16
+ if (Array.isArray(previous))
17
+ return [...previous, value];
18
+ return [value];
19
+ }
20
+ export const DISPOSE_MODES = ['trace_only', 'retain', 'destroy'];
21
+ export function parseTriggerFlag(raw) {
22
+ return CRYSTALLIZATION_TRIGGERS.includes(raw)
23
+ ? raw
24
+ : null;
25
+ }
26
+ /** `--project`, else the nearest project root above cwd, else cwd. */
27
+ export function resolveAssetProjectRoot(project) {
28
+ return project ?? findProjectRoot(process.cwd()) ?? process.cwd();
29
+ }
30
+ /** Ensure `<projectRoot>/.peaks/` exists and open its `state.db`. */
31
+ export function openAssetDb(projectRoot) {
32
+ if (!existsSync(join(projectRoot, '.peaks'))) {
33
+ mkdirSync(join(projectRoot, '.peaks'), { recursive: true });
34
+ }
35
+ return openStateDb(join(projectRoot, '.peaks', 'state.db'));
36
+ }
37
+ /** The CrystallizationService wiring every asset verb repeats, built once. */
38
+ export function createCrystallizationService(db) {
39
+ return new CrystallizationService(db, {
40
+ loopReleaseSchema: LoopReleaseSchema,
41
+ loopBeeRelationSchema: LoopBeeRelationSchema,
42
+ insertLoopRelease: insertLoopRelease,
43
+ insertLoopBeeRelation: insertLoopBeeRelation
44
+ });
45
+ }
@@ -39,7 +39,12 @@
39
39
  * Defense in depth: the CrystallizationService enforces the
40
40
  * pre-run gate and the brief-section guard; the CLI only
41
41
  * translates flags into the service payload.
42
+ *
43
+ * The verb implementations live beside this file, one module per verb:
44
+ * `asset-crystallize-command.ts`, `asset-dispose-command.ts`,
45
+ * `asset-status-command.ts`, with their shared bootstrap in
46
+ * `asset-command-shared.ts`.
42
47
  */
43
48
  import type { Command } from 'commander';
44
- import { type ProgramIO } from '../cli-helpers.js';
49
+ import type { ProgramIO } from '../cli-helpers.js';
45
50
  export declare function registerAssetCommands(program: Command, io: ProgramIO): void;