peaks-loop 4.0.0-beta.9 → 4.0.1

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 (552) hide show
  1. package/CHANGELOG.md +910 -141
  2. package/README-en.md +26 -7
  3. package/README.md +75 -6
  4. package/agents/karpathy-reviewer.md +33 -0
  5. package/bin/peaks.js +0 -0
  6. package/dist/cli/cli-helpers.d.ts +31 -6
  7. package/dist/cli/cli-helpers.js +48 -25
  8. package/dist/cli/commands/_register.d.ts +3 -0
  9. package/dist/cli/commands/_register.js +139 -0
  10. package/dist/cli/commands/_super.d.ts +10 -0
  11. package/dist/cli/commands/_super.js +97 -0
  12. package/dist/cli/commands/adapter-commands-s2a.js +1 -1
  13. package/dist/cli/commands/asset-commands.js +33 -16
  14. package/dist/cli/commands/audit-commands.js +2 -2
  15. package/dist/cli/commands/autonomous-swarm-commands.d.ts +12 -0
  16. package/dist/cli/commands/autonomous-swarm-commands.js +120 -0
  17. package/dist/cli/commands/bee-commands.js +1 -1
  18. package/dist/cli/commands/capability-commands.js +1 -1
  19. package/dist/cli/commands/capability-worker-config-sc-commands.js +0 -2
  20. package/dist/cli/commands/changeset-commands.d.ts +13 -0
  21. package/dist/cli/commands/changeset-commands.js +46 -0
  22. package/dist/cli/commands/code-commands.d.ts +11 -1
  23. package/dist/cli/commands/code-commands.js +19 -699
  24. package/dist/cli/commands/code-job-shape-commands.d.ts +9 -0
  25. package/dist/cli/commands/code-job-shape-commands.js +164 -0
  26. package/dist/cli/commands/code-mode-gate-commands.d.ts +9 -0
  27. package/dist/cli/commands/code-mode-gate-commands.js +223 -0
  28. package/dist/cli/commands/code-review-commands.js +2 -2
  29. package/dist/cli/commands/code-run-command.d.ts +12 -0
  30. package/dist/cli/commands/code-run-command.js +68 -0
  31. package/dist/cli/commands/code-runtime-commands.d.ts +11 -0
  32. package/dist/cli/commands/code-runtime-commands.js +391 -0
  33. package/dist/cli/commands/codegraph-commands.js +1 -1
  34. package/dist/cli/commands/compact-command.js +53 -1
  35. package/dist/cli/commands/complexity-commands.js +1 -1
  36. package/dist/cli/commands/config-commands.js +4 -75
  37. package/dist/cli/commands/container-commands.d.ts +28 -0
  38. package/dist/cli/commands/container-commands.js +221 -0
  39. package/dist/cli/commands/context-commands.js +3 -2
  40. package/dist/cli/commands/core/artifacts-command.js +1 -1
  41. package/dist/cli/commands/core/binding-commands.js +1 -1
  42. package/dist/cli/commands/core/doctor-command.js +63 -3
  43. package/dist/cli/commands/core/memory-command.js +1 -1
  44. package/dist/cli/commands/core/profile-command.js +1 -1
  45. package/dist/cli/commands/core/proxy-command.js +1 -1
  46. package/dist/cli/commands/core/session-command.js +9 -7
  47. package/dist/cli/commands/core/skill-command.js +7 -4
  48. package/dist/cli/commands/core/standards-command.js +1 -1
  49. package/dist/cli/commands/cron-commands.d.ts +57 -0
  50. package/dist/cli/commands/cron-commands.js +257 -0
  51. package/dist/cli/commands/cron-scheduler-commands.d.ts +47 -0
  52. package/dist/cli/commands/cron-scheduler-commands.js +284 -0
  53. package/dist/cli/commands/dashboard-commands.d.ts +4 -0
  54. package/dist/cli/commands/dashboard-commands.js +10 -0
  55. package/dist/cli/commands/dashboard-long-run.d.ts +25 -0
  56. package/dist/cli/commands/dashboard-long-run.js +122 -0
  57. package/dist/cli/commands/dashboard-summary.d.ts +12 -0
  58. package/dist/cli/commands/dashboard-summary.js +58 -0
  59. package/dist/cli/commands/dispatch-commands.d.ts +0 -7
  60. package/dist/cli/commands/dispatch-commands.js +372 -8
  61. package/dist/cli/commands/dispatch-from-dag.js +4 -1
  62. package/dist/cli/commands/doc-commands.js +1 -1
  63. package/dist/cli/commands/ecc-commands.d.ts +30 -0
  64. package/dist/cli/commands/ecc-commands.js +119 -0
  65. package/dist/cli/commands/evolution-commands.js +1 -1
  66. package/dist/cli/commands/feedback-commands.js +1 -1
  67. package/dist/cli/commands/final-review-commands.js +1 -1
  68. package/dist/cli/commands/fixture-commands.js +1 -1
  69. package/dist/cli/commands/fork-commands.js +1 -1
  70. package/dist/cli/commands/gate-commands.js +128 -6
  71. package/dist/cli/commands/governance-classify-contract-commands.d.ts +21 -0
  72. package/dist/cli/commands/governance-classify-contract-commands.js +273 -0
  73. package/dist/cli/commands/heartbeat-commands.js +76 -5
  74. package/dist/cli/commands/heartbeat-watch-command.d.ts +31 -0
  75. package/dist/cli/commands/heartbeat-watch-command.js +146 -0
  76. package/dist/cli/commands/hook-handle.js +1 -1
  77. package/dist/cli/commands/hooks-commands.js +126 -10
  78. package/dist/cli/commands/ide-commands.js +1 -1
  79. package/dist/cli/commands/impact-commands.js +1 -1
  80. package/dist/cli/commands/job-commands.js +34 -1
  81. package/dist/cli/commands/lease-metrics-commands.d.ts +67 -0
  82. package/dist/cli/commands/lease-metrics-commands.js +231 -0
  83. package/dist/cli/commands/lease-stats-commands.d.ts +65 -0
  84. package/dist/cli/commands/lease-stats-commands.js +107 -0
  85. package/dist/cli/commands/legacy-commands.js +1 -1
  86. package/dist/cli/commands/log-commands.js +1 -1
  87. package/dist/cli/commands/loop-commands.js +1 -1
  88. package/dist/cli/commands/loop-eval-commands.js +1 -1
  89. package/dist/cli/commands/memory-commands.js +1 -1
  90. package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
  91. package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +1 -1
  92. package/dist/cli/commands/mut-commands.d.ts +1 -1
  93. package/dist/cli/commands/mut-commands.js +1 -5
  94. package/dist/cli/commands/observability-commands.js +1 -1
  95. package/dist/cli/commands/openspec-commands.js +65 -4
  96. package/dist/cli/commands/perf-audit-commands.js +3 -3
  97. package/dist/cli/commands/perf-commands.js +1 -1
  98. package/dist/cli/commands/polyrepo-commands.js +1 -1
  99. package/dist/cli/commands/prd-blocks-commands.js +1 -1
  100. package/dist/cli/commands/prd-commands.js +4 -2
  101. package/dist/cli/commands/preferences-commands.js +23 -3
  102. package/dist/cli/commands/project-commands.js +1 -1
  103. package/dist/cli/commands/qa-business-review-commands.js +1 -1
  104. package/dist/cli/commands/qa-commands.d.ts +1 -1
  105. package/dist/cli/commands/qa-commands.js +39 -3
  106. package/dist/cli/commands/release-commands.d.ts +15 -0
  107. package/dist/cli/commands/release-commands.js +113 -21
  108. package/dist/cli/commands/request-commands.js +1 -1
  109. package/dist/cli/commands/retrospective-commands.js +1 -1
  110. package/dist/cli/commands/reviewer-commands.js +1 -1
  111. package/dist/cli/commands/role-commands.js +1 -1
  112. package/dist/cli/commands/runtime-commands-helpers.d.ts +7 -0
  113. package/dist/cli/commands/runtime-commands-helpers.js +24 -0
  114. package/dist/cli/commands/runtime-commands.js +1 -2
  115. package/dist/cli/commands/sc-commands.js +4 -2
  116. package/dist/cli/commands/scan-commands.js +1 -1
  117. package/dist/cli/commands/security-audit-commands.js +3 -3
  118. package/dist/cli/commands/sediment-commands.js +10 -1
  119. package/dist/cli/commands/session-24h-mode.d.ts +26 -0
  120. package/dist/cli/commands/session-24h-mode.js +196 -0
  121. package/dist/cli/commands/share-commands.d.ts +19 -0
  122. package/dist/cli/commands/share-commands.js +121 -2
  123. package/dist/cli/commands/skill-conformance-commands.js +1 -1
  124. package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +1 -1
  125. package/dist/cli/commands/skill-search-commands.js +4 -1
  126. package/dist/cli/commands/slice-commands.js +1 -1
  127. package/dist/cli/commands/slice-integrate-commands.js +1 -1
  128. package/dist/cli/commands/slice-review-commands.js +1 -1
  129. package/dist/cli/commands/smoke-commands.js +1 -1
  130. package/dist/cli/commands/sop-commands.js +1 -1
  131. package/dist/cli/commands/spill-demo-command.d.ts +7 -0
  132. package/dist/cli/commands/spill-demo-command.js +29 -0
  133. package/dist/cli/commands/statusline-commands.d.ts +12 -0
  134. package/dist/cli/commands/statusline-commands.js +79 -17
  135. package/dist/cli/commands/sub-agent-commands.js +2 -1
  136. package/dist/cli/commands/sub-agent-shared.d.ts +10 -0
  137. package/dist/cli/commands/sub-agent-shared.js +24 -1
  138. package/dist/cli/commands/swarm-commands.d.ts +13 -0
  139. package/dist/cli/commands/swarm-commands.js +77 -0
  140. package/dist/cli/commands/tech-commands.d.ts +64 -0
  141. package/dist/cli/commands/tech-commands.js +195 -0
  142. package/dist/cli/commands/understand-commands.js +1 -1
  143. package/dist/cli/commands/upgrade-commands.d.ts +2 -0
  144. package/dist/cli/commands/upgrade-commands.js +40 -5
  145. package/dist/cli/commands/user-touchpoint-commands.js +1 -1
  146. package/dist/cli/commands/verdict-aggregate-command.js +1 -1
  147. package/dist/cli/commands/vm-commands.d.ts +31 -0
  148. package/dist/cli/commands/vm-commands.js +274 -0
  149. package/dist/cli/commands/workflow-commands.js +24 -1
  150. package/dist/cli/commands/workflow-plan-commands.js +1 -1
  151. package/dist/cli/commands/workspace/init-command.js +1 -1
  152. package/dist/cli/commands/workspace/migrate-command.js +1 -1
  153. package/dist/cli/commands/workspace/reconcile-command.js +1 -1
  154. package/dist/cli/commands/worktree-auth-commands.d.ts +29 -0
  155. package/dist/cli/commands/worktree-auth-commands.js +652 -0
  156. package/dist/cli/index.js +58 -13
  157. package/dist/cli/program.d.ts +2 -2
  158. package/dist/cli/program.js +86 -281
  159. package/dist/services/24h-mode/decider.d.ts +103 -0
  160. package/dist/services/24h-mode/decider.js +144 -0
  161. package/dist/services/24h-mode/index.d.ts +12 -0
  162. package/dist/services/24h-mode/index.js +12 -0
  163. package/dist/services/24h-mode/state.d.ts +48 -0
  164. package/dist/services/24h-mode/state.js +51 -0
  165. package/dist/services/24h-mode/store.d.ts +27 -0
  166. package/dist/services/24h-mode/store.js +119 -0
  167. package/dist/services/artifacts/artifact-prerequisites.js +1 -1
  168. package/dist/services/artifacts/request-artifact-service.js +1 -1
  169. package/dist/services/artifacts/workspace-service.js +1 -1
  170. package/dist/services/audit/enforcers/lint-bee-runtime-contract.d.ts +25 -0
  171. package/dist/services/audit/enforcers/lint-bee-runtime-contract.js +91 -0
  172. package/dist/services/audit/enforcers/lint-peaks-code-runtime.d.ts +16 -0
  173. package/dist/services/audit/enforcers/lint-peaks-code-runtime.js +31 -0
  174. package/dist/services/audit/enforcers/lint-peaks-skill-runtime.d.ts +23 -0
  175. package/dist/services/audit/enforcers/lint-peaks-skill-runtime.js +59 -0
  176. package/dist/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.d.ts +28 -0
  177. package/dist/services/audit/enforcers/lint-peaks-ui-sc-txt-runtime.js +86 -0
  178. package/dist/services/audit/enforcers/lint-prd-artifact-handoff.d.ts +16 -0
  179. package/dist/services/audit/enforcers/lint-prd-artifact-handoff.js +41 -0
  180. package/dist/services/audit/enforcers/lint-prd-source-snapshot.d.ts +27 -0
  181. package/dist/services/audit/enforcers/lint-prd-source-snapshot.js +47 -0
  182. package/dist/services/audit/enforcers/lint-qa-gateguard-and-runtime.d.ts +19 -0
  183. package/dist/services/audit/enforcers/lint-qa-gateguard-and-runtime.js +47 -0
  184. package/dist/services/audit/enforcers/lint-rd-handoff-coverage.d.ts +18 -0
  185. package/dist/services/audit/enforcers/lint-rd-handoff-coverage.js +70 -0
  186. package/dist/services/audit/enforcers/lint-skill-presence-mandatory.d.ts +25 -0
  187. package/dist/services/audit/enforcers/lint-skill-presence-mandatory.js +53 -0
  188. package/dist/services/audit/red-line-catalog-p2-a.d.ts +0 -6
  189. package/dist/services/audit/red-line-catalog-p2-a.js +230 -1
  190. package/dist/services/audit/static-service.d.ts +32 -25
  191. package/dist/services/audit/static-service.js +30 -109
  192. package/dist/services/audit-independent/index.d.ts +2 -0
  193. package/dist/services/audit-independent/index.js +2 -0
  194. package/dist/services/autonomous-swarm/autonomous-swarm-service.d.ts +127 -0
  195. package/dist/services/autonomous-swarm/autonomous-swarm-service.js +446 -0
  196. package/dist/services/changeset/changeset-check-service.d.ts +22 -0
  197. package/dist/services/changeset/changeset-check-service.js +47 -0
  198. package/dist/services/code/auto-compact-modes.d.ts +30 -0
  199. package/dist/services/code/auto-compact-modes.js +38 -0
  200. package/dist/services/code/auto-compact-orchestrator.d.ts +43 -5
  201. package/dist/services/code/auto-compact-orchestrator.js +101 -21
  202. package/dist/services/code/dag-orchestrator.d.ts +30 -1
  203. package/dist/services/code/dag-orchestrator.js +106 -1
  204. package/dist/services/code/status-line-renderer.d.ts +2 -0
  205. package/dist/services/code/status-line-renderer.js +21 -3
  206. package/dist/services/code-review/ocr-service.d.ts +1 -1
  207. package/dist/services/code-review/ocr-service.js +6 -3
  208. package/dist/services/compact-history/compact-history-service.d.ts +41 -0
  209. package/dist/services/compact-history/compact-history-service.js +62 -0
  210. package/dist/services/compact-statusline/compact-statusline-service.d.ts +16 -0
  211. package/dist/services/compact-statusline/compact-statusline-service.js +83 -0
  212. package/dist/services/config/config-service.d.ts +1 -12
  213. package/dist/services/config/config-service.js +3 -72
  214. package/dist/services/config/config-types.d.ts +2 -4
  215. package/dist/services/config/config-types.js +1 -1
  216. package/dist/services/container/container-lease.d.ts +67 -0
  217. package/dist/services/container/container-lease.js +135 -0
  218. package/dist/services/context/auto-compact-dispatcher.d.ts +40 -5
  219. package/dist/services/context/auto-compact-dispatcher.js +32 -102
  220. package/dist/services/context/auto-compact-reader.js +1 -1
  221. package/dist/services/context/auto-compact-types.d.ts +27 -2
  222. package/dist/services/context/auto-compact-types.js +8 -1
  223. package/dist/services/context/build-dispatch-system-prompt.d.ts +75 -0
  224. package/dist/services/context/build-dispatch-system-prompt.js +117 -0
  225. package/dist/services/context/collector.d.ts +2 -2
  226. package/dist/services/context/context-builder.d.ts +4 -4
  227. package/dist/services/context/context-schema.d.ts +48 -48
  228. package/dist/services/context/ide-detect.d.ts +4 -0
  229. package/dist/services/context/ide-detect.js +24 -0
  230. package/dist/services/context/main-session-monitor.d.ts +1 -4
  231. package/dist/services/context/main-session-monitor.js +1 -24
  232. package/dist/services/context/memory-index-reader.d.ts +8 -0
  233. package/dist/services/context/memory-index-reader.js +57 -0
  234. package/dist/services/context/memory-lru-cache.d.ts +12 -0
  235. package/dist/services/context/memory-lru-cache.js +60 -0
  236. package/dist/services/context/memory-preflight-config.d.ts +19 -0
  237. package/dist/services/context/memory-preflight-config.js +25 -0
  238. package/dist/services/context/memory-preflight-service.d.ts +19 -0
  239. package/dist/services/context/memory-preflight-service.js +120 -0
  240. package/dist/services/context/spillover-store.d.ts +23 -0
  241. package/dist/services/context/spillover-store.js +155 -0
  242. package/dist/services/context/spillover-types.d.ts +18 -0
  243. package/dist/services/context/spillover-types.js +1 -0
  244. package/dist/services/crystallization/crystallization-service.d.ts +22 -5
  245. package/dist/services/crystallization/crystallization-service.js +8 -14
  246. package/dist/services/crystallization/crystallization-types.d.ts +6 -6
  247. package/dist/services/crystallization/evidence-brief-builder.d.ts +1 -1
  248. package/dist/services/crystallization/index.d.ts +13 -0
  249. package/dist/services/crystallization/index.js +13 -0
  250. package/dist/services/dashboard/project-dashboard-service.js +2 -2
  251. package/dist/services/dispatch/await-batch.d.ts +70 -0
  252. package/dist/services/dispatch/await-batch.js +272 -0
  253. package/dist/services/dispatch/batch-counter.js +1 -1
  254. package/dist/services/dispatch/dispatch-record-writer.d.ts +126 -4
  255. package/dist/services/dispatch/dispatch-record-writer.js +239 -9
  256. package/dist/services/dispatch/slice-dag.d.ts +46 -0
  257. package/dist/services/dispatch/slice-dag.js +6 -0
  258. package/dist/services/dispatch/stage-enum.d.ts +27 -0
  259. package/dist/services/dispatch/stage-enum.js +48 -0
  260. package/dist/services/dispatch/startup-timeout.d.ts +86 -0
  261. package/dist/services/dispatch/startup-timeout.js +97 -0
  262. package/dist/services/dispatch/sub-agent-dispatcher.js +40 -89
  263. package/dist/services/dispatch/test-tool-detection.d.ts +25 -1
  264. package/dist/services/dispatch/test-tool-detection.js +80 -0
  265. package/dist/services/doctor/doctor-service/checks/check-id-schema.d.ts +18 -0
  266. package/dist/services/doctor/doctor-service/checks/check-id-schema.js +64 -0
  267. package/dist/services/doctor/doctor-service/checks/codegraph-capability.d.ts +14 -0
  268. package/dist/services/doctor/doctor-service/checks/codegraph-capability.js +69 -0
  269. package/dist/services/doctor/doctor-service/checks/dist-source-version.d.ts +32 -0
  270. package/dist/services/doctor/doctor-service/checks/dist-source-version.js +110 -0
  271. package/dist/services/doctor/doctor-service/checks/gateguard-conflict.d.ts +24 -0
  272. package/dist/services/doctor/doctor-service/checks/gateguard-conflict.js +164 -0
  273. package/dist/services/doctor/doctor-service/checks/l3-memory-health.d.ts +16 -0
  274. package/dist/services/doctor/doctor-service/checks/l3-memory-health.js +57 -0
  275. package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.d.ts +19 -0
  276. package/dist/services/doctor/doctor-service/checks/l3-orphan-sessions.js +66 -0
  277. package/dist/services/doctor/doctor-service/checks/schema-validity.d.ts +10 -0
  278. package/dist/services/doctor/doctor-service/checks/schema-validity.js +33 -0
  279. package/dist/services/doctor/doctor-service/checks/skill-apply-note.d.ts +20 -0
  280. package/dist/services/doctor/doctor-service/checks/skill-apply-note.js +85 -0
  281. package/dist/services/doctor/doctor-service/checks/skill-existence.d.ts +13 -0
  282. package/dist/services/doctor/doctor-service/checks/skill-existence.js +30 -0
  283. package/dist/services/doctor/doctor-service/checks/skill-name-match.d.ts +10 -0
  284. package/dist/services/doctor/doctor-service/checks/skill-name-match.js +25 -0
  285. package/dist/services/doctor/doctor-service/checks/skill-parse.d.ts +10 -0
  286. package/dist/services/doctor/doctor-service/checks/skill-parse.js +19 -0
  287. package/dist/services/doctor/doctor-service/checks/skill-presence.d.ts +21 -0
  288. package/dist/services/doctor/doctor-service/checks/skill-presence.js +75 -0
  289. package/dist/services/doctor/doctor-service/checks/skill-runbook.d.ts +14 -0
  290. package/dist/services/doctor/doctor-service/checks/skill-runbook.js +47 -0
  291. package/dist/services/doctor/doctor-service/checks/statusline-install.d.ts +14 -0
  292. package/dist/services/doctor/doctor-service/checks/statusline-install.js +32 -0
  293. package/dist/services/doctor/doctor-service/checks/statusline-runtime.d.ts +13 -0
  294. package/dist/services/doctor/doctor-service/checks/statusline-runtime.js +30 -0
  295. package/dist/services/doctor/doctor-service/checks/user-config.d.ts +11 -0
  296. package/dist/services/doctor/doctor-service/checks/user-config.js +27 -0
  297. package/dist/services/doctor/doctor-service/checks/workspace-init.d.ts +16 -0
  298. package/dist/services/doctor/doctor-service/checks/workspace-init.js +34 -0
  299. package/dist/services/doctor/doctor-service/checks/workspace-layout.d.ts +33 -0
  300. package/dist/services/doctor/doctor-service/checks/workspace-layout.js +180 -0
  301. package/dist/services/doctor/doctor-service/index.d.ts +48 -0
  302. package/dist/services/doctor/doctor-service/index.js +254 -0
  303. package/dist/services/doctor/doctor-service/plugin-registry.d.ts +41 -0
  304. package/dist/services/doctor/doctor-service/plugin-registry.js +77 -0
  305. package/dist/services/doctor/doctor-service/report/final-summary.d.ts +20 -0
  306. package/dist/services/doctor/doctor-service/report/final-summary.js +29 -0
  307. package/dist/services/doctor/doctor-service/types.d.ts +245 -0
  308. package/dist/services/doctor/doctor-service/types.js +15 -0
  309. package/dist/services/doctor/doctor-service.d.ts +15 -146
  310. package/dist/services/doctor/doctor-service.js +22 -926
  311. package/dist/services/doctor/index.d.ts +22 -0
  312. package/dist/services/doctor/index.js +22 -0
  313. package/dist/services/env/shell-probe.d.ts +71 -0
  314. package/dist/services/env/shell-probe.js +161 -0
  315. package/dist/services/evolution/evolution-types.d.ts +39 -39
  316. package/dist/services/final-review/final-review-service.d.ts +11 -1
  317. package/dist/services/final-review/index.d.ts +2 -0
  318. package/dist/services/final-review/index.js +1 -0
  319. package/dist/services/hooks/auto-compact-hook-install.d.ts +4 -5
  320. package/dist/services/hooks/auto-compact-hook-install.js +4 -5
  321. package/dist/services/hooks/worktree-authorization-gate.d.ts +205 -0
  322. package/dist/services/hooks/worktree-authorization-gate.js +492 -0
  323. package/dist/services/ide/adapters/claude-code-adapter.js +2 -2
  324. package/dist/services/ide/adapters/qoder-adapter.d.ts +25 -0
  325. package/dist/services/ide/adapters/qoder-adapter.js +57 -0
  326. package/dist/services/ide/adapters/tongyi-lingma-adapter.d.ts +16 -0
  327. package/dist/services/ide/adapters/tongyi-lingma-adapter.js +45 -0
  328. package/dist/services/ide/ide-registry.js +6 -0
  329. package/dist/services/ide/ide-types.d.ts +1 -1
  330. package/dist/services/job/job-types.d.ts +56 -56
  331. package/dist/services/job-snapshot/index.d.ts +8 -0
  332. package/dist/services/job-snapshot/index.js +7 -0
  333. package/dist/services/{job/job-resource-snapshot.d.ts → job-snapshot/snapshot.d.ts} +1 -1
  334. package/dist/services/job-snapshot/types.d.ts +7 -0
  335. package/dist/services/job-snapshot/types.js +1 -0
  336. package/dist/services/karpathy-cost/karpathy-cost-check-service.d.ts +67 -0
  337. package/dist/services/karpathy-cost/karpathy-cost-check-service.js +108 -0
  338. package/dist/services/log/retention.d.ts +16 -0
  339. package/dist/services/log/retention.js +17 -0
  340. package/dist/services/loop/loop-bee-relation-types.d.ts +6 -6
  341. package/dist/services/loop/loop-release-types.d.ts +24 -24
  342. package/dist/services/loop/monotonic-runner.d.ts +17 -11
  343. package/dist/services/loop/monotonic-runner.js +118 -79
  344. package/dist/services/memory/project-memory-service/index/kind-dispatch.d.ts +8 -0
  345. package/dist/services/memory/project-memory-service/index/kind-dispatch.js +253 -0
  346. package/dist/services/memory/project-memory-service/index/ranking.d.ts +6 -0
  347. package/dist/services/memory/project-memory-service/index/ranking.js +171 -0
  348. package/dist/services/memory/project-memory-service/index/search.d.ts +34 -0
  349. package/dist/services/memory/project-memory-service/index/search.js +194 -0
  350. package/dist/services/memory/project-memory-service/index.d.ts +9 -0
  351. package/dist/services/memory/project-memory-service/index.js +24 -0
  352. package/dist/services/memory/project-memory-service/parsers/frontmatter.d.ts +9 -0
  353. package/dist/services/memory/project-memory-service/parsers/frontmatter.js +106 -0
  354. package/dist/services/memory/project-memory-service/parsers/markdown-pure.d.ts +7 -0
  355. package/dist/services/memory/project-memory-service/parsers/markdown-pure.js +96 -0
  356. package/dist/services/memory/project-memory-service/store/atomic-write.d.ts +5 -0
  357. package/dist/services/memory/project-memory-service/store/atomic-write.js +56 -0
  358. package/dist/services/memory/project-memory-service/store/paths.d.ts +8 -0
  359. package/dist/services/memory/project-memory-service/store/paths.js +116 -0
  360. package/dist/services/memory/project-memory-service/types.d.ts +128 -0
  361. package/dist/services/memory/project-memory-service/types.js +9 -0
  362. package/dist/services/memory/project-memory-service.d.ts +1 -167
  363. package/dist/services/memory/project-memory-service.js +19 -816
  364. package/dist/services/migrate-skill-name/schema.d.ts +2 -2
  365. package/dist/services/observability/aggregation.d.ts +27 -0
  366. package/dist/services/observability/aggregation.js +72 -0
  367. package/dist/services/observability/observability-service.d.ts +73 -7
  368. package/dist/services/observability/observability-service.js +87 -1
  369. package/dist/services/openspec/artifact-boundary.d.ts +138 -0
  370. package/dist/services/openspec/artifact-boundary.js +150 -0
  371. package/dist/services/openspec/coverage-evidence-reader.d.ts +191 -0
  372. package/dist/services/openspec/coverage-evidence-reader.js +386 -0
  373. package/dist/services/openspec/openspec-archive-service.d.ts +70 -0
  374. package/dist/services/openspec/openspec-archive-service.js +320 -8
  375. package/dist/services/openspec/openspec-bridge-service.js +1 -1
  376. package/dist/services/openspec/openspec-init-service.js +1 -1
  377. package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
  378. package/dist/services/openspec/openspec-render-service.js +7 -4
  379. package/dist/services/openspec/openspec-scan-service.js +1 -1
  380. package/dist/services/openspec/openspec-validate-service.js +5 -4
  381. package/dist/services/preferences/preferences-service.js +10 -0
  382. package/dist/services/preferences/preferences-types.d.ts +13 -0
  383. package/dist/services/preferences/preferences-types.js +11 -0
  384. package/dist/services/qa/screenshot-archive-service.d.ts +51 -0
  385. package/dist/services/qa/screenshot-archive-service.js +134 -0
  386. package/dist/services/rd/rd-service.js +10 -11
  387. package/dist/services/rd/types.d.ts +32 -32
  388. package/dist/services/rd-swarm/rd-swarm-service.d.ts +60 -0
  389. package/dist/services/rd-swarm/rd-swarm-service.js +93 -0
  390. package/dist/services/recommendations/capability-seed-items.js +0 -1
  391. package/dist/services/recommendations/capability-seed-mappings.js +0 -1
  392. package/dist/services/recommendations/capability-seed-sources.js +0 -1
  393. package/dist/services/release/version-precheck-service.d.ts +51 -0
  394. package/dist/services/release/version-precheck-service.js +257 -0
  395. package/dist/services/scan/acceptance-coverage-service.js +1 -1
  396. package/dist/services/scan/archetype-service.js +1 -1
  397. package/dist/services/scan/existing-system-service.js +1 -1
  398. package/dist/services/scan/libraries-service.js +1 -1
  399. package/dist/services/sediment/json-schema.d.ts +40 -40
  400. package/dist/services/share/bundle-types.d.ts +12 -12
  401. package/dist/services/share/run-state-contract.d.ts +2 -2
  402. package/dist/services/skill/skill-search-service.d.ts +12 -7
  403. package/dist/services/skill/skill-search-service.js +8 -4
  404. package/dist/services/skillhub/migrations/001-initial.sql +71 -0
  405. package/dist/services/skillhub/migrations/002-loop-release.sql +32 -0
  406. package/dist/services/skillhub/migrations/003-loop-bee-relation.sql +35 -0
  407. package/dist/services/skillhub/migrations/004-loop-bee-extension.sql +65 -0
  408. package/dist/services/skillhub/migrations/005-evolution-evaluation.sql +81 -0
  409. package/dist/services/skillhub/migrations/006-crystallization-event.sql +92 -0
  410. package/dist/services/skills/hooks-settings-service.d.ts +75 -0
  411. package/dist/services/skills/hooks-settings-service.js +230 -2
  412. package/dist/services/skills/skill-registry.d.ts +1 -0
  413. package/dist/services/skills/skill-registry.js +6 -4
  414. package/dist/services/skills/skill-runbook-service.js +1 -1
  415. package/dist/services/slice/slice-check-service.js +1 -1
  416. package/dist/services/standards/main-session-monitor-ban-hook.d.ts +14 -0
  417. package/dist/services/standards/main-session-monitor-ban-hook.js +19 -0
  418. package/dist/services/standards/missing-standards-detector.d.ts +25 -0
  419. package/dist/services/standards/missing-standards-detector.js +43 -12
  420. package/dist/services/tech/tech-change-id-service.d.ts +82 -0
  421. package/dist/services/tech/tech-change-id-service.js +117 -0
  422. package/dist/services/understand/understand-hybrid-service.js +1 -1
  423. package/dist/services/understand/understand-scan-service.js +2 -2
  424. package/dist/services/upgrade/upgrade-service.js +4 -3
  425. package/dist/services/verdict/envelopes.d.ts +2 -2
  426. package/dist/services/verdict/envelopes.js +2 -2
  427. package/dist/services/verdict/verdict-aggregator.d.ts +3 -3
  428. package/dist/services/vm/vm-lease.d.ts +40 -0
  429. package/dist/services/vm/vm-lease.js +137 -0
  430. package/dist/services/workflow/autonomous-resume-writer.js +1 -1
  431. package/dist/services/workflow/pipeline-verify-gate-support.d.ts +47 -0
  432. package/dist/services/workflow/pipeline-verify-gate-support.js +194 -0
  433. package/dist/services/workflow/pipeline-verify-service.d.ts +17 -81
  434. package/dist/services/workflow/pipeline-verify-service.js +42 -218
  435. package/dist/services/workflow/pipeline-verify-types.d.ts +90 -0
  436. package/dist/services/workflow/pipeline-verify-types.js +10 -0
  437. package/dist/services/workflow/plan-reader.d.ts +1 -1
  438. package/dist/services/workflow/plan-reader.js +1 -1
  439. package/dist/services/workflow/plan-refresher.d.ts +1 -1
  440. package/dist/services/workflow/plan-refresher.js +1 -1
  441. package/dist/services/workflow/plan-trigger-detector.d.ts +1 -1
  442. package/dist/services/workflow/plan-trigger-detector.js +1 -1
  443. package/dist/services/workflow/workflow-autonomous-resume-helpers.d.ts +1 -1
  444. package/dist/services/workflow/workflow-autonomous-service.d.ts +2 -98
  445. package/dist/services/workflow/workflow-autonomous-types.d.ts +114 -0
  446. package/dist/services/workflow/workflow-autonomous-types.js +21 -0
  447. package/dist/services/workflow/workflow-router-service.js +18 -16
  448. package/dist/services/workflow/workflow-spec-lint.d.ts +13 -0
  449. package/dist/services/workflow/workflow-spec-lint.js +75 -0
  450. package/dist/services/workflow/workflow-spec-types.d.ts +100 -0
  451. package/dist/services/workflow/workflow-spec-types.js +13 -0
  452. package/dist/services/workflow/workflow-spec-yaml.d.ts +17 -0
  453. package/dist/services/workflow/workflow-spec-yaml.js +88 -0
  454. package/dist/services/workflow/workflow-spec.d.ts +11 -91
  455. package/dist/services/workflow/workflow-spec.js +16 -145
  456. package/dist/services/workspace/migrate-service.js +1 -1
  457. package/dist/services/workspace/workspace-service.js +1 -1
  458. package/dist/services/worktree/worktree-lease.d.ts +170 -0
  459. package/dist/services/worktree/worktree-lease.js +242 -0
  460. package/package.json +47 -51
  461. package/scripts/clean-dist.mjs +31 -1
  462. package/scripts/copy-templates.mjs +16 -0
  463. package/scripts/sync-version.mjs +53 -2
  464. package/skills/bee/peaks-perf-audit/SKILL.md +17 -0
  465. package/skills/bee/peaks-prd/SKILL.md +16 -0
  466. package/skills/bee/peaks-prd/test-prompts.json +12 -0
  467. package/skills/bee/peaks-qa/SKILL.md +16 -1
  468. package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +22 -0
  469. package/skills/bee/peaks-qa/test-prompts.json +12 -0
  470. package/skills/bee/peaks-rd/SKILL.md +29 -20
  471. package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +39 -0
  472. package/skills/bee/peaks-rd/test-prompts.json +12 -0
  473. package/skills/bee/peaks-reviewer/SKILL.md +17 -0
  474. package/skills/bee/peaks-sc/SKILL.md +16 -0
  475. package/skills/bee/peaks-security-audit/SKILL.md +17 -0
  476. package/skills/bee/peaks-txt/SKILL.md +16 -0
  477. package/skills/bee/peaks-txt/test-prompts.json +12 -0
  478. package/skills/bee/peaks-ui/SKILL.md +49 -43
  479. package/skills/bee/peaks-ui/test-prompts.json +12 -0
  480. package/skills/peaks-code/SKILL.md +54 -109
  481. package/skills/peaks-code/references/boundaries.md +15 -1
  482. package/skills/peaks-code/references/cron-scheduler-deployment.md +313 -0
  483. package/skills/peaks-code/references/external-skill-invocation.md +27 -0
  484. package/skills/peaks-code/references/lease-dashboard.html +224 -0
  485. package/skills/peaks-code/references/lease-stats.sample.json +26 -0
  486. package/skills/peaks-code/references/peaks-worktree-l2-enforcers.md +208 -0
  487. package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
  488. package/skills/peaks-code/references/runbook.md +63 -1
  489. package/skills/peaks-code/references/startup-sequence.md +110 -0
  490. package/skills/peaks-code/references/step-0-8-gate.md +1 -1
  491. package/skills/peaks-code/references/sub-agent-dispatch.md +92 -1
  492. package/skills/peaks-code/references/worktree-governance.md +123 -0
  493. package/skills/peaks-code/test-prompts.json +12 -0
  494. package/skills/peaks-doctor/SKILL.md +1 -1
  495. package/skills/peaks-ide/SKILL.md +1 -1
  496. package/skills/peaks-solo/SKILL.md +21 -0
  497. package/skills/peaks-solo/references/triage-decision-table.md +6 -0
  498. package/skills/peaks-sop/test-prompts.json +17 -0
  499. package/dist/cli/commands/agent-commands.d.ts +0 -20
  500. package/dist/cli/commands/agent-commands.js +0 -48
  501. package/dist/cli/commands/classify-classify-commands.d.ts +0 -19
  502. package/dist/cli/commands/classify-classify-commands.js +0 -151
  503. package/dist/cli/commands/contract-commands.d.ts +0 -26
  504. package/dist/cli/commands/contract-commands.js +0 -114
  505. package/dist/cli/commands/session-auto-compact-hook-command.d.ts +0 -37
  506. package/dist/cli/commands/session-auto-compact-hook-command.js +0 -127
  507. package/dist/cli/commands/worker-commands.d.ts +0 -3
  508. package/dist/cli/commands/worker-commands.js +0 -52
  509. package/dist/services/agent/ecc-agent-service.d.ts +0 -47
  510. package/dist/services/agent/ecc-agent-service.js +0 -143
  511. package/dist/services/config/provider-service.d.ts +0 -48
  512. package/dist/services/config/provider-service.js +0 -143
  513. package/dist/services/context/dispatch-context-guard.d.ts +0 -27
  514. package/dist/services/context/dispatch-context-guard.js +0 -192
  515. package/dist/services/context/shared-channel.d.ts +0 -93
  516. package/dist/services/context/shared-channel.js +0 -308
  517. package/dist/services/filesystem/file-lock.d.ts +0 -11
  518. package/dist/services/filesystem/file-lock.js +0 -152
  519. package/dist/services/mut/assert-scanner.d.ts +0 -6
  520. package/dist/services/mut/assert-scanner.js +0 -116
  521. package/dist/services/mut/index.d.ts +0 -8
  522. package/dist/services/mut/index.js +0 -7
  523. package/dist/services/mut/mut-runner.d.ts +0 -39
  524. package/dist/services/mut/mut-runner.js +0 -29
  525. package/dist/services/mut/production-stryker.d.ts +0 -2
  526. package/dist/services/mut/production-stryker.js +0 -75
  527. package/dist/services/mut/report-builder.d.ts +0 -11
  528. package/dist/services/mut/report-builder.js +0 -110
  529. package/dist/services/mut/report-loader.d.ts +0 -31
  530. package/dist/services/mut/report-loader.js +0 -78
  531. package/dist/services/mut/thresholds.d.ts +0 -21
  532. package/dist/services/mut/thresholds.js +0 -22
  533. package/dist/services/mut/types.d.ts +0 -336
  534. package/dist/services/mut/types.js +0 -59
  535. package/dist/services/providers/minimax-provider-service.d.ts +0 -24
  536. package/dist/services/providers/minimax-provider-service.js +0 -143
  537. package/dist/services/providers/minimax-worker-service.d.ts +0 -21
  538. package/dist/services/providers/minimax-worker-service.js +0 -83
  539. package/dist/shared/fs.d.ts +0 -4
  540. package/dist/shared/fs.js +0 -26
  541. package/dist/shared/paths.d.ts +0 -6
  542. package/dist/shared/paths.js +0 -50
  543. package/dist/shared/result.d.ts +0 -22
  544. package/dist/shared/result.js +0 -46
  545. package/dist/shared/version.d.ts +0 -1
  546. package/dist/shared/version.js +0 -1
  547. package/examples/video-demo/README.md +0 -142
  548. package/examples/video-demo/out/en-closing-960.png +0 -0
  549. package/examples/video-demo/out/zh-closing-960.png +0 -0
  550. package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
  551. package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
  552. /package/dist/services/{job/job-resource-snapshot.js → job-snapshot/snapshot.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,7 +1,734 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.1 — 2026-07-30 (GA release)
4
+
5
+ ### Features
6
+
7
+ - **One super-command CLI surface** (rid-009): `peaks code / audit / doctor / openspec / release / release-pack` replacing 73 leaf commands.
8
+ - **peaks changeset check hard gate** (rid-011): mirrors publish.yml gate-changeset and refuses to publish when `.changeset/*.md` is staged.
9
+ - **peaks release precheck** (rid-010): 4-layer version gate mirroring publish.yml §(A); ships with `tests/unit/release/version-precheck-service.test.ts` (13 cases).
10
+ - **Dynamic workspace subpackage discovery** (rid-014): release-pack.mjs now derives publish order from `packages/*` and `pnpm-workspace.yaml` — adding/removing a subpackage needs no code edit.
11
+ - **Monorepo-wide version lockstep** (rid-015): `scripts/bump-version.mjs` bumps every publishable subpackage in lockstep with root (no more 33→35 CLI_VERSION lag class).
12
+ - **GitHub Release step + tag/version gate** (rid-017): publish.yml now runs `Extract release notes from root CHANGELOG.md` (per-version awk) → `Verify exact tag matches bumped root version` (hard `git describe --tags --exact-match` gate) → `Create GitHub Release` (non-draft, no `--generate-notes`).
13
+ - **5 pure-internal sub-packages folded into `src/services/*`** (rid-016): deleted `peaks-loop-{audit-independent,crystallization,doctor,final-review,job-snapshot}` from `packages/`; behaviour preserved by re-exports.
14
+
15
+ ### Bug fixes
16
+
17
+ - **CLI_VERSION drift closed** (peaks-publish-stale fix): `peaks-loop@<new>` no longer pins a stale `peaks-loop-shared@<old>` thanks to on-disk + tarball-content double guard in `gate-cli-version`.
18
+ - **33→35 npm version-skip regression closed** (AC7): `peaks workspace init` + `bump-version.mjs` are now idempotent when local root equals `dist-tags.latest`.
19
+ - **`workspace:*` protocol leak closed** (release-pack.mjs): every workspace tarball now ships with zero `workspace:` strings; each internal dep is pinned to the registry-safe version matched from the local manifest.
20
+ - **shared auto-bump no longer requires env gate** (sync-version.mjs): the `PEAKS_AUTO_BUMP_SHARED` gate was the Layer 2 root cause of stale local shared tarballs; `bump-version.mjs` is now the single owner.
21
+
22
+ ### Breaking changes
23
+
24
+ - The 73 leaf CLI commands have been collapsed to 5 super-commands (`code / audit / doctor / openspec / release / release-pack`). The pre-4.0.0 leaf commands are no longer present on `$PATH`; all users must migrate. Migration matrix and per-leaf replacement are documented in `docs/cli-migration-4-0-0.md` (added in this release; see link in the GitHub Release page for v4.0.0).
25
+
26
+ ### Patch Changes
27
+
28
+ - **rid-020b (24h mode integration)**: `peaks code run --24h` flag + dashboard long-run support; 10-file diff (+91/-1) including 3 NEW source (`code-run-command.ts` 120 / `dashboard-long-run.ts` 80 / `dashboard-commands.ts` parent) + 2 surgical edits + 2 NEW vitest (12/12 green) + 4 SKILL.md/ref edits.
29
+ - **rid-024 (code-commands split)**: `code-commands.ts` 1058 → 165 lines (≤ 800 cap) + 3 NEW sibling files (`code-mode-gate-commands.ts` 275 / `code-job-shape-commands.ts` 248 / `code-runtime-commands.ts` 460, including moved `readActiveSid` helper); public API preserved.
30
+ - **rid-025 (heartbeat watch + main-session-monitor ban)**: `peaks heartbeat watch --batch-id <id>` top-level CLI + main-session-monitor hard ban via per-symbol PreToolUse hook + scan test; 14 files (8 EDIT + 4 NEW + 3 NEW test).
31
+ - **rid-026 (monotonic jsonl-store)**: 2-file refactor; cycle persistence moved from `cycle-N.json` N-file → single jsonl-store per-session (`monotonic-runner.ts` 280→334) + monotonic-guard test fixtures migrated.
32
+ - **rid-027 (auto-compact partial mode)**: 7 files; `auto-compact-modes.ts` NEW (partial mode 0.70/0.85) + `--mode <mode>` CLI flag + `getAutoCompactMode` helper + 2 NEW tests (36 cases green).
33
+ - **rid-028 (context spillover storage)**: 3 NEW files (minimal scope); `spillover-types.ts` + `spillover-store.ts` + `context-spillover-store.test.ts` (102 lines, 7 cases including traversal regression). `auto-compact-orchestrator.ts` D6.e branch byte-identical preserved.
34
+ - **rid-029 (DAG wave + barrier)**: 4-file diff; `slice-dag.ts` Wave/WaveArtifact types + `dag-orchestrator.ts` `planDispatchWaves`/`runWaveWithArtifacts` + `sub-agent-dispatcher.ts` `dispatchFromWaves` + NEW test (6 cases). Existing `runDag`/`runLayeredDag`/`buildDispatchSpec` byte-identical preserved.
35
+ - **rid-030 (dashboard summary)**: 6 files; `observability-service.ts` 3 new categories (cycle/token-usage/monotonic-trigger) + `aggregation.ts` `aggregateDashboardMetrics` + `peaks dashboard summary` CLI + 2 NEW tests (26 cases green).
36
+ - **rid-031 (dispatcher deprecation)**: `src/services/context/auto-compact-dispatcher.ts` 285 → 249 lines; removed `node:child_process` import + `dispatchShellExec` function; `case 'shell-exec'` replaced with stub (returns same envelope shape pathway).
37
+ - **rid-032 (session spill-demo CLI)**: 5 files; `spill-demo-command.ts` NEW (64 lines, `peaks session spill-demo` opt-in experimental LLM no-context mode demo) + SKILL.md 24h-mode spill/hydrate subsection + 4 NEW vitest cases.
38
+ - **rid-033 (spillover-store lstat defense-in-depth)**: 2-file EDIT; `spillover-store.ts` adds `lstatSync` target symlink check + `assertNotSymlink` helper in `writeRecord` + `hydrate`; closes rid-028 defense-in-depth gap (now 4-layer defense: safe-segment + containment + lstat + entry.isFile).
39
+ - **rid-034 (v2.13.0 contract cleanup + 4.0.0 GA version bump)**: this release. Retired `peaks session auto-compact-hook` CLI surface (v2.13.0 zero-pause contract). Replaced all retired command strings (`peaks session auto-compact --execute` / `peaks code auto-compact --execute` / `peaks context now` / `peaks session auto-compact-hook`) with `peaks compact auto` family across `src/**` + `skills/**`. Fixed 6 stale unit-test assertions (4 openspec self-host-only skipif guards + 1 test-tool-detection regex + 2 qoder resource-profile assertions) and removed `.peaks/_sub_agents/2026-06-23-session-heartbeat-test/` orphan dir. Version bumped to 4.0.0 GA with lockstep `CLI_VERSION` + CHANGELOG + `.changeset/4-0-0-ga.md`. **Note**: `peaks test` vitest-path fix deferred to rid-035.
40
+
41
+ ## 4.0.0-beta.37 — 2026-07-25 (registry conflict bump + version skip)
42
+
43
+ ### Patch Changes
44
+
45
+ - **chore(version)**: skip 4.0.0-beta.36 to land on 4.0.0-beta.37. Reason: 4.0.0-beta.35 was already published to npm by a prior session (2026-07-22T17:10:24Z); our HEAD bumped to 4.0.0-beta.35 in the 4.0.0-beta.35 CHANGELOG entry below (matching that on-disk state) but a `pnpm publish` of 4.0.0-beta.35 would fail as duplicate. The version-skip jump (35 → 37, skipping 36) avoids both the duplicate and the public-36 release, keeping the published beta-37 as the next publishable artifact. The 4.0.0-beta.35 on-disk state stays as the work-record version; the 4.0.0-beta.37 version reflects the registry-publishable state once the user runs `git tag v4.0.0-beta.37 && pnpm publish` per their own workflow. No functional change — just a version number for the next release.
46
+
47
+ - **chore(version)**: `package.json` version 4.0.0-beta.35 → 4.0.0-beta.37. `packages/peaks-loop-shared/src/version.ts` `CLI_VERSION` matches. `pnpm-lock.yaml` resolved via `pnpm install --lockfile-only` (post-commit; user may run if their local lockfile is stale).
48
+
49
+ - **chore(archive)**: 5 OpenSpec proposals retired to `openspec/changes/archive/` via `peaks openspec archive --apply` (commits `3e5ec4e9` + this version bump sequence): `enforce-artifact-boundary-and-coverage`, `add-tech-dry-run-gate`, `add-rd-swarm-dry-run-planner`, `add-autonomous-rd-swarm-resume`, `add-slice-topology-multipass`, `fix-claude-settings-template-hook-node-wrapper`. `openspec/changes/` now contains only the `archive/` subdirectory.
50
+
51
+ ## 4.0.0-beta.35 — 2026-07-24 (claude-settings-template hook node-wrapper)
52
+
53
+ ### Patch Changes
54
+
55
+ - **fix(claude-settings-template)**: `buildWriteHookCommand()` now wraps its inner JS source in `node -e "<js>"` via the single-source-of-truth helper `wrapAsNodeOneLiner(js)` (lines 170-180 of `src/services/workspace/claude-settings-template.ts`). All embedded double quotes are JSON-escaped as `\\"`, so the on-disk `.claude/settings.local.json` `command` field is a real shell-evaluable one-liner instead of bare JS that bash rejected with `syntax error near unexpected token`. Byte-for-byte error-string preservation: the pre-2.0.3 error was `syntax error near unexpected token`; that exact string is what every Windows + macOS + Linux install hit on every Write / Edit / MultiEdit / Bash tool call. The wrapper changes the entry point from bash to Node; the error string no longer surfaces because `node -e` parses the JS, not bash. **Already on disk** (commits `8411fe88` 2026-06-13 + `d9a1a098` 2026-07-04). See the `fix-claude-settings-template-hook-node-wrapper` OpenSpec change for the full Why/What-Changes reconciliation; the original proposal named `buildBashHookCommand`, which pre-dates the v3.1.2 Bash gate-step-08 refactor — the present-day code uses `buildWriteHookCommand` (wrapped) + `buildBashGateStep08Command` (intentionally NOT wrapped).
56
+ - **fix(claude-settings-template)**: `buildBashGateStep08Command()` is **intentionally NOT wrapped** in `node -e "..."`. The Bash matcher returns the literal `peaks code gate-step-08 --project "${CLAUDE_PROJECT_DIR}"` CLI invocation. CLI delegation is the load-bearing contract for the v3.1.2 mechanical gate: the CLI is the only legitimate source of the structured decision + `Next:` slice context, and exit code is the gate-step-08 signal (0 = allow, 2 = block). Wrapping the Bash matcher would short-circuit the CLI delegation and break the gate. The no-wrapper decision is documented inline at lines 261-269 of `claude-settings-template.ts`. **Already on disk** (commit `d9a1a098` 2026-07-04, `TEMPLATE_VERSION 1.3.0`).
57
+ - **docs(claude-settings-template)**: docstring `argv[2]` → `argv[1]` reconciliation on `buildWriteHookCommand` (lines 200-201). Node.js argv layout under `-e` is `process.argv[0]=node, [1]=script-body, [2+]=args`; the previous docstring referenced `[2]` (the position a positional CLI arg would occupy) but the implementation reads `[1]` (the script body itself). The docstring is now consistent with the code. **Already on disk** (commit `8411fe88` 2026-06-13).
58
+ - **qa(claude-settings-template)**: Windows dogfood evidence captured at `.peaks/_runtime/2026-07-24-session-f13da7/qa/010-fix-claude-settings-template-hook-node-wrapper/dogfood-evidence-windows.md`. Confirmed on Windows 11 (PowerShell + Git Bash + Node v22.22.1, HEAD = `e51797c3`): `peaks workspace init --no-claude-hooks --project . --json` + `peaks workspace init --force-hooks --project . --json` round-trip produces a `.claude/settings.local.json` whose `command` field is a shell-evaluable `node -e "<js>"` one-liner; spawn harness on `Write|Edit|MultiEdit` matcher returns exit 0 for `.peaks/_runtime/.../test.md` (allow-list match) and exit 1 for `package.json` (deny-list match). The Bash matcher is the literal CLI delegation string `peaks code gate-step-08 --project "${CLAUDE_PROJECT_DIR}"` — NOT `node -e`-wrapped, as designed. Byte-for-byte match against `buildClaudeSettingsLocalJson()` (lines 227-259 of `claude-settings-template.ts`) confirmed.
59
+ - **Cross-platform note**: Windows is the strong-evidence half of spec.md S4. macOS + Linux halves are best-effort deferred per the rid-010 plan §3 (no in-repo macOS/Linux CI runner wired for the workspace-init + spawn-harness flow). The fix is platform-agnostic at the source level (Node `child_process` + `process.argv`); the dogfood on a second OS is a verification artifact, not a correctness artifact. macOS / Linux dogfood will be captured in a follow-up slice if/when a runner is wired.
60
+ - Closure sediment: `.peaks/memory/2026-07-24-rid-010-fix-claude-settings-closure.md` (rid-010 — Implementation Closure Record, 2 of 5 tasks shipped; Tasks 3-5 quality gates / 3-pass review / release are part of the 2.0.4 ship path).
61
+
62
+ ## 4.0.0
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies
67
+ - peaks-loop-shared@0.0.18
68
+ - peaks-loop-audit-independent@0.0.12
69
+ - peaks-loop-crystallization@0.0.13
70
+ - peaks-loop-doctor@0.0.12
71
+ - peaks-loop-final-review@0.0.12
72
+
73
+ ## 4.0.0-beta.26 — 2026-07-22 (peaks-loop-shared lockstep)
74
+
75
+ - Monorepo recurrence fix: `scripts/sync-version.mjs` now auto-bumps
76
+ `peaks-loop-shared` by 0.0.1 each time the root version is bumped,
77
+ gated by `PEAKS_AUTO_BUMP_SHARED=1` in the publish workflow's
78
+ `build` step. Without this, the publish workflow's
79
+ `isAlreadyPublished` guard short-circuits the shared subpackage
80
+ re-publish, leaving downstream `peaks -v` to read a stale
81
+ CLI_VERSION from the cached tarball. Tests: pretest/predev
82
+ invocations of sync-version are now no-ops w.r.t. the shared
83
+ version (no ratcheting during local dev loops).
84
+
85
+ ## 4.0.0
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies
90
+ - peaks-loop-shared@0.0.18
91
+ - peaks-loop-audit-independent@0.0.12
92
+ - peaks-loop-crystallization@0.0.13
93
+ - peaks-loop-doctor@0.0.12
94
+ - peaks-loop-final-review@0.0.12
95
+
96
+ ## 4.0.0
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies
101
+ - peaks-loop-shared@0.0.18
102
+ - peaks-loop-audit-independent@0.0.12
103
+ - peaks-loop-crystallization@0.0.13
104
+ - peaks-loop-doctor@0.0.12
105
+ - peaks-loop-final-review@0.0.12
106
+
107
+ ## 4.1.0 (Unreleased)
108
+
109
+ ### Added
110
+
111
+ - **Sub-agent memory preflight**: peaks-code orchestrator now
112
+ automatically injects a token-bounded `feedback / layer A` memory
113
+ block from `.peaks/memory/index.json` into every sub-agent's
114
+ system prompt. Defaults to 1.2k token cap (configurable via
115
+ `.peaks/preferences.json::memoryPreflight.maxTokens`); silent
116
+ degradation when the index is missing. No new CLI surface.
117
+ See `docs/superpowers/specs/2026-07-22-orchestrator-memory-preflight-design.md`.
118
+
119
+ - **Slice topology multi-pass decomposition (v1 shipped + gap-closure)**: `peaks slice decompose` now supports a `--granularity` flag (`service` | `file` | `both` | `auto`) that drives the multi-pass orchestrator (`MultiPassOrchestrator` + `SchemaRouter` + `CrossPassEdgeMerger` + `LLMArbitrator` + `GranularityDecider`). v1 produced a `DecompositionResultV2` envelope (`passes[]` + `crossPassEdges[]` + `llmArbitrations[]`); the gap-closure slice adds `tests/unit/slice/integration.test.ts` (12 cases: end-to-end `decompose()` against injected runners, two-service fixture, Pass 1 partition invariant, Pass 2 scope-filter invariant, cross-service topological order, internal-edge round-trip, single-pass fallback). The 4-dim `prepareFinalReview()` mapping (functional-completeness / problem-resolution / no-new-bugs / existing-functionality-intact) is covered by `packages/peaks-loop-final-review/tests/final-review-service.test.ts`. No source code touched in this gap-closure slice; only the integration test was added. See `.peaks/_runtime/2026-07-24-session-f13da7/rd/requests/2026-07-24-rid-015-add-slice-topology-multipass.md` for the RD plan.
120
+
121
+ ## 4.0.0
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies
126
+ - peaks-loop-shared@0.0.18
127
+ - peaks-loop-audit-independent@0.0.12
128
+ - peaks-loop-crystallization@0.0.13
129
+ - peaks-loop-doctor@0.0.12
130
+ - peaks-loop-final-review@0.0.12
131
+
132
+ ## 4.0.0
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies
137
+ - peaks-loop-shared@0.0.18
138
+ - peaks-loop-audit-independent@0.0.12
139
+ - peaks-loop-crystallization@0.0.13
140
+ - peaks-loop-doctor@0.0.12
141
+ - peaks-loop-final-review@0.0.12
142
+
143
+ ## 4.0.0
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies
148
+ - peaks-loop-shared@0.0.18
149
+ - peaks-loop-audit-independent@0.0.12
150
+ - peaks-loop-crystallization@0.0.13
151
+ - peaks-loop-doctor@0.0.12
152
+ - peaks-loop-final-review@0.0.12
153
+
154
+ ## 4.0.0
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies
159
+ - peaks-loop-shared@0.0.18
160
+ - peaks-loop-audit-independent@0.0.12
161
+ - peaks-loop-crystallization@0.0.13
162
+ - peaks-loop-doctor@0.0.12
163
+ - peaks-loop-final-review@0.0.12
164
+
165
+ ## 4.0.0
166
+
167
+ ### Patch Changes
168
+
169
+ - Updated dependencies
170
+ - peaks-loop-shared@0.0.18
171
+ - peaks-loop-audit-independent@0.0.12
172
+ - peaks-loop-crystallization@0.0.13
173
+ - peaks-loop-doctor@0.0.12
174
+ - peaks-loop-final-review@0.0.12
175
+
176
+ ## 4.0.0
177
+
178
+ ### Patch Changes
179
+
180
+ - Updated dependencies
181
+ - peaks-loop-shared@0.0.18
182
+ - peaks-loop-audit-independent@0.0.12
183
+ - peaks-loop-crystallization@0.0.13
184
+ - peaks-loop-doctor@0.0.12
185
+ - peaks-loop-final-review@0.0.12
186
+
187
+ ## 4.0.0
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies
192
+ - peaks-loop-shared@0.0.18
193
+ - peaks-loop-audit-independent@0.0.12
194
+ - peaks-loop-crystallization@0.0.13
195
+ - peaks-loop-doctor@0.0.12
196
+ - peaks-loop-final-review@0.0.12
197
+
198
+ ## 4.0.0
199
+
200
+ ### Patch Changes
201
+
202
+ - Updated dependencies
203
+ - peaks-loop-shared@0.0.18
204
+ - peaks-loop-audit-independent@0.0.12
205
+ - peaks-loop-crystallization@0.0.13
206
+ - peaks-loop-doctor@0.0.12
207
+ - peaks-loop-final-review@0.0.12
208
+
209
+ ## 4.0.0
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies
214
+ - peaks-loop-shared@0.0.18
215
+ - peaks-loop-audit-independent@0.0.12
216
+ - peaks-loop-crystallization@0.0.13
217
+ - peaks-loop-doctor@0.0.12
218
+ - peaks-loop-final-review@0.0.12
219
+
220
+ ## 4.0.0
221
+
222
+ ### Patch Changes
223
+
224
+ - Updated dependencies
225
+ - peaks-loop-shared@0.0.18
226
+ - peaks-loop-audit-independent@0.0.12
227
+ - peaks-loop-crystallization@0.0.13
228
+ - peaks-loop-doctor@0.0.12
229
+ - peaks-loop-final-review@0.0.12
230
+
231
+ ## 4.0.0
232
+
233
+ ### Patch Changes
234
+
235
+ - Updated dependencies
236
+ - peaks-loop-shared@0.0.18
237
+ - peaks-loop-audit-independent@0.0.12
238
+ - peaks-loop-crystallization@0.0.13
239
+ - peaks-loop-doctor@0.0.12
240
+ - peaks-loop-final-review@0.0.12
241
+
242
+ ## 4.0.0
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies
247
+ - peaks-loop-shared@0.0.18
248
+ - peaks-loop-audit-independent@0.0.12
249
+ - peaks-loop-crystallization@0.0.13
250
+ - peaks-loop-doctor@0.0.12
251
+ - peaks-loop-final-review@0.0.12
252
+
253
+ ## 4.0.0
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies
258
+ - peaks-loop-shared@0.0.18
259
+ - peaks-loop-audit-independent@0.0.12
260
+ - peaks-loop-crystallization@0.0.13
261
+ - peaks-loop-doctor@0.0.12
262
+ - peaks-loop-final-review@0.0.12
263
+
264
+ ## 4.0.0
265
+
266
+ ### Patch Changes
267
+
268
+ - Updated dependencies
269
+ - peaks-loop-shared@0.0.18
270
+ - peaks-loop-audit-independent@0.0.12
271
+ - peaks-loop-crystallization@0.0.13
272
+ - peaks-loop-doctor@0.0.12
273
+ - peaks-loop-final-review@0.0.12
274
+
275
+ ## 4.0.0
276
+
277
+ ### Patch Changes
278
+
279
+ - Updated dependencies
280
+ - peaks-loop-shared@0.0.18
281
+ - peaks-loop-audit-independent@0.0.12
282
+ - peaks-loop-crystallization@0.0.13
283
+ - peaks-loop-doctor@0.0.12
284
+ - peaks-loop-final-review@0.0.12
285
+
286
+ ## 4.0.0
287
+
288
+ ### Patch Changes
289
+
290
+ - Updated dependencies
291
+ - peaks-loop-shared@0.0.18
292
+ - peaks-loop-audit-independent@0.0.12
293
+ - peaks-loop-crystallization@0.0.13
294
+ - peaks-loop-doctor@0.0.12
295
+ - peaks-loop-final-review@0.0.12
296
+
297
+ ## 4.0.0
298
+
299
+ ### Patch Changes
300
+
301
+ - Updated dependencies
302
+ - peaks-loop-shared@0.0.18
303
+ - peaks-loop-audit-independent@0.0.12
304
+ - peaks-loop-crystallization@0.0.13
305
+ - peaks-loop-doctor@0.0.12
306
+ - peaks-loop-final-review@0.0.12
307
+
308
+ ## 4.0.0
309
+
310
+ ### Patch Changes
311
+
312
+ - Updated dependencies
313
+ - peaks-loop-shared@0.0.18
314
+ - peaks-loop-audit-independent@0.0.12
315
+ - peaks-loop-crystallization@0.0.13
316
+ - peaks-loop-doctor@0.0.12
317
+ - peaks-loop-final-review@0.0.12
318
+
319
+ ## 4.0.0
320
+
321
+ ### Patch Changes
322
+
323
+ - Updated dependencies
324
+ - peaks-loop-shared@0.0.18
325
+ - peaks-loop-audit-independent@0.0.12
326
+ - peaks-loop-crystallization@0.0.13
327
+ - peaks-loop-doctor@0.0.12
328
+ - peaks-loop-final-review@0.0.12
329
+
330
+ ## 4.0.0
331
+
332
+ ### Patch Changes
333
+
334
+ - Updated dependencies
335
+ - peaks-loop-shared@0.0.15
336
+ - peaks-loop-audit-independent@0.0.11
337
+ - peaks-loop-crystallization@0.0.12
338
+ - peaks-loop-doctor@0.0.11
339
+ - peaks-loop-final-review@0.0.11
340
+
341
+ ## 4.0.0
342
+
343
+ ### Patch Changes
344
+
345
+ - Updated dependencies
346
+ - peaks-loop-shared@0.0.15
347
+ - peaks-loop-audit-independent@0.0.11
348
+ - peaks-loop-crystallization@0.0.12
349
+ - peaks-loop-doctor@0.0.11
350
+ - peaks-loop-final-review@0.0.11
351
+
352
+ ## 4.0.0
353
+
354
+ ### Patch Changes
355
+
356
+ - Updated dependencies
357
+ - peaks-loop-shared@0.0.15
358
+ - peaks-loop-audit-independent@0.0.11
359
+ - peaks-loop-crystallization@0.0.12
360
+ - peaks-loop-doctor@0.0.11
361
+ - peaks-loop-final-review@0.0.11
362
+
363
+ ## 4.0.0-beta.21 — 2026-07-22 (ice-cola surface-check fixes, republish)
364
+
365
+ This release is the **republish** after the accidental 4.0.2
366
+ publish earlier on 2026-07-22. The 4.0.2 manifest is being
367
+ unpublished (`npm unpublish --force`, within 72h window). The
368
+ intended release is `4.0.0-beta.21`, the version that was
369
+ manually pinned but the publish workflow's `pnpm exec changeset
370
+ version` step overrode it to `4.0.2` due to a pending
371
+ `.changeset/*.md` in the tagged commit.
372
+
373
+ ### Bug fixes
374
+
375
+ - **standardsMissing UX (`fix(standards)`)** — `peaks workspace init`
376
+ previously reported `standardsMissing.missing: true` with the
377
+ remediation text "no project-local standards found" whenever the
378
+ language overlay was empty, even when common was clearly populated
379
+ (ice-cola shape: common/\*.md + typescript overlay populated, but
380
+ no javascript/ dir). The detector now distinguishes three states
381
+ (`complete` / `common-missing` / `language-missing`) and the
382
+ remediation text calls out the precise failing component.
383
+
384
+ - **`peaks statusline` default action (`fix(statusline)`)** — `peaks
385
+ statusline` (no subcommand) was documented as "Run with no
386
+ subcommand to render" but commander was printing usage instead of
387
+ dispatching to the hidden `render` subcommand. The fix attaches
388
+ a default `.action(...)` on the parent `statusline` command that
389
+ delegates to a public `runDefaultStatuslineRender` body, and adds
390
+ `--project <path>` to the parent so the default path inherits the
391
+ project label.
392
+
393
+ - **release-pack test version pinning (`fix(release-tests)`)** —
394
+ five `tests/unit/release/*.test.ts` files hard-coded `'4.0.0-beta.17'`
395
+ and `'0.0.4'` literals. Root bumping from 4.0.0-beta.17 to
396
+ 4.0.0-beta.20 made three tests fail immediately, demonstrating the
397
+ tests were carrying version knowledge the production code does not.
398
+ Expectations now derive from the on-disk `package.json` instead,
399
+ so future version bumps are a no-op for the suite.
400
+
401
+ - **`peaks preferences` unknown-key error (`fix(preferences)`)** —
402
+ the prior error was `PREFERENCES_KEY_UNKNOWN: <key>` which forced
403
+ the operator to look up valid keys elsewhere. All three sites
404
+ (`get` / `set` / `reset`) now throw via a shared `unknownKeyError`
405
+ helper that includes the sorted `ALLOWED_KEYS_LIST` inline.
406
+
407
+ ### Chore
408
+
409
+ - **`chore(deps)`** — Migrate `onlyBuiltDependencies: [better-sqlite3]`
410
+ out of `package.json#pnpm` (no longer read by pnpm 10.11+) into
411
+ `.npmrc` as the canonical pnpm config key. Silences the per-package
412
+ `WARN The "pnpm" field in package.json is no longer read by pnpm`
413
+ log line without changing install behavior.
414
+
415
+ ### CI
416
+
417
+ - **`ci(publish)`** — Add `workflow_dispatch` input
418
+ `skip_changeset_version` to `.github/workflows/publish.yml`. When
419
+ set, the conditional `pnpm exec changeset version` step is
420
+ skipped, so manual version pins in `package.json` survive the
421
+ registry-repair release path.
422
+
423
+ - **`ci(unpublish)`** — One-shot `unpublish-4-0-2` workflow that
424
+ uses Trusted Publishing + OIDC to remove peaks-loop@4.0.2 + 8
425
+ subpackages. Triggered by `gh workflow run` with
426
+ `confirm_destructive=yes-i-am-sure`. Retired (kept for audit)
427
+ once the unpublish completes (npm 72h propagation).
428
+
429
+ ### Validation
430
+
431
+ - `vitest tests/unit/standards/missing-standards-detector.test.ts` — 18/18
432
+ - `vitest tests/unit/cli/commands/statusline-default-render.test.ts` — 3/3
433
+ - `vitest tests/unit/release` — 20/20
434
+ - `vitest tests/integration/preferences-cli.test.ts` — 5/5
435
+ - `PEAKS_DRY_RUN=1 node scripts/release-pack.mjs` — 9/9 packages, zero WARN
436
+
437
+ ## 4.0.0-beta.17
438
+
439
+ ### Patch Changes
440
+
441
+ - Repair registry install: `npm i -g peaks-loop` previously failed with
442
+ `EUNSUPPORTEDPROTOCOL / workspace:*` because the publish workflow
443
+ called `npm publish` on each workspace directory directly, which
444
+ serialized the manifest verbatim and leaked the pnpm-only
445
+ `workspace:*` protocol into the published tarballs. The new
446
+ `scripts/release-pack.mjs` packs each workspace package with
447
+ `pnpm pack` (which rewrites `workspace:*` to exact semver pins) and
448
+ then publishes the resulting tarball via `npm publish <tarball>` so
449
+ npm 11+ OIDC Trusted Publishing remains in effect.
450
+
451
+ Bumped versions: `peaks-loop` 4.0.0-beta.16 → 4.0.0-beta.17; all
452
+ eight subpackages 0.0.3 → 0.0.4. The publish workflow's changeset
453
+ step is now conditional on detected `.changeset/*.md` files so the
454
+ registry-repair release keeps its manually-pinned versions, and
455
+ future releases still pick up automated `changeset version` bumps.
456
+
457
+ - per-package OIDC Trusted Publisher entries still need to be added
458
+ once on npmjs.com (one-time UI step per package).
459
+ - the install smoke verifies the registry tarball surface: bin shim,
460
+ package layout, postinstall, and registry metadata. `peaks
461
+ --version`/`--help` may fail at runtime until
462
+ `peaks-loop-crystallization` declares `zod` as a runtime
463
+ dependency (a separate source bug, out of scope for this repair).
464
+
465
+ ## 4.0.0
466
+
467
+ ### Patch Changes
468
+
469
+ - Updated dependencies
470
+ - peaks-loop-shared@0.0.5
471
+ - peaks-loop-audit-independent@0.0.5
472
+ - peaks-loop-crystallization@0.0.5
473
+ - peaks-loop-doctor@0.0.5
474
+ - peaks-loop-final-review@0.0.5
475
+
476
+ ## 4.0.0
477
+
478
+ ### Patch Changes
479
+
480
+ - Updated dependencies
481
+ - peaks-loop-shared@0.0.5
482
+ - peaks-loop-audit-independent@0.0.5
483
+ - peaks-loop-crystallization@0.0.5
484
+ - peaks-loop-doctor@0.0.5
485
+ - peaks-loop-final-review@0.0.5
486
+
487
+ ## 4.0.0
488
+
489
+ ### Minor Changes
490
+
491
+ - 5d01343: Monorepo extraction: peaks-loop 4.0.0-beta.15 ships the new pnpm
492
+ workspace shell with 6 independent packages extracted from the main
493
+ repo as Tier-A zero/low-coupling domains:
494
+
495
+ - peaks-loop-shared (4 utils: fs / paths / result / version)
496
+ - peaks-loop-mut (mutation testing + ECC cache)
497
+ - peaks-loop-doctor (project health check)
498
+ - peaks-loop-crystallization (crystallization pipeline)
499
+ - peaks-loop-final-review (4-dim business review)
500
+ - peaks-loop-audit-independent (security + perf audit)
501
+
502
+ Each subpackage has its own typecheck / build / vitest pipeline; they
503
+ are wired back into the main peaks-loop CLI via workspace:_ protocol.
504
+ Trusted Publishing (OIDC) is wired via .github/workflows/publish.yml
505
+ on push tags v_._._ — no NPM_TOKEN required.
506
+
507
+ Also:
508
+
509
+ - D21: peaks sub-agent finalize command (LLM-side completion signal
510
+ to mark dispatch records done/failed/cancelled; without it records
511
+ would stay queued forever).
512
+ - Trusted Publishing via OIDC — npmjs.com trusted publisher
513
+ configured; npm token removed from ~/.npmrc.
514
+
515
+ ### Patch Changes
516
+
517
+ - Updated dependencies [5d01343]
518
+ - peaks-loop-shared@0.1.0
519
+ - peaks-loop-mut@0.1.0
520
+ - peaks-loop-doctor@0.1.0
521
+ - peaks-loop-crystallization@0.1.0
522
+ - peaks-loop-final-review@0.1.0
523
+ - peaks-loop-audit-independent@0.1.0
524
+
3
525
  ## [Unreleased]
4
526
 
527
+ ## 4.0.0-beta.14 — 2026-07-16
528
+
529
+ ### Status: RELEASED (D-019: copy-templates.mjs + package.json files[])
530
+
531
+ > **This release fixes D-019 (full end-to-end)**:
532
+ >
533
+ > 1. `scripts/copy-templates.mjs` now copies
534
+ > `src/services/skillhub/migrations/*.sql` into `dist/services/skillhub/migrations/`.
535
+ > 2. `package.json` `"files"` whitelist now includes `dist/**/*.sql`
536
+ > (previously the whitelist was `dist/**/*.js | .d.ts | .md` only,
537
+ > so the migrations were filtered out of the npm tarball even
538
+ > after being copied to `dist/`).
539
+ >
540
+ > Without this fix, the published `peaks-loop` tarball shipped without
541
+ > the SkillHub SQLite schema, breaking any downstream consumer's first
542
+ > `peaks skill sediment <verb>` with `no such table: bee_release`.
543
+ >
544
+ > **Verdict**: `pnpm build` copies 6 migrations; tarball includes them.
545
+ > In-process vitest tests were always green (they use tsx + source tree
546
+ > directly, not `dist/`), so no test count change. Combined with
547
+ > 4.0.0-beta.13's D-018 path fix, the published tarball is now
548
+ > correct end-to-end.
549
+
550
+ ## 4.0.0-beta.13 — 2026-07-16
551
+
552
+ ### Status: RELEASED (D-018: state.db path relocation)
553
+
554
+ > **This release fixes the SQLite `state.db` location** to match the
555
+ > original peaks-loop design contract: `PEAKS_HOME/.peaks/skills/state.db`
556
+ > (PEAKS_HOME defaults to `~/.peaks`). Previously, the code resolved
557
+ > `home` to `process.cwd()` when invoked from a project root, producing
558
+ > `<project>/.peaks/state.db` — wrong location for loop engineering
559
+ >
560
+ > - bee sediment data.
561
+ >
562
+ > **Fix**: `src/cli/commands/sediment-commands.ts:664-665` now uses
563
+ > `peaksHome()` from `src/services/sop/sop-paths.ts:29` (which honors
564
+ > `PEAKS_HOME` override for test isolation). The downstream
565
+ > `resolveStateDbPath({ home })` (in `src/services/sediment/pool-paths.ts:15`)
566
+ > already correctly returned `{home}/.peaks/skills/state.db`; only the
567
+ > `home` resolution was broken.
568
+ >
569
+ > **Side bug found but out of scope**: `src/services/skillhub/migrations/*.sql`
570
+ > is not copied to `dist/` by `scripts/copy-templates.mjs`. This is a
571
+ > pre-existing build-config issue separate from D-018. Tracked as
572
+ > follow-up; tests still pass because the tests use vitest + tsx
573
+ > (which sees the source tree directly), but the published
574
+ > `peaks-loop@4.0.0-beta.13` will hit `no such table: bee_release` until
575
+ > a D-019 follow-up adds `.sql` to the copy-templates extensions.
576
+ >
577
+ > **Verdict**: 27/27 AC PASS (beta.12 verdict preserved; D-018 is
578
+ > architecture fix, no AC change). Old `<peaks-loop>/.peaks/state.db`
579
+ > discarded (beta phase, single user).
580
+
581
+ ## 4.0.0-beta.12 — 2026-07-16
582
+
583
+ ### Status: RELEASED (follow-up to `4.0.0-beta.11`; D-013 wrapper exit-code fix)
584
+
585
+ > \*\*This CHANGELOG entry documents the D-013 follow-up release.
586
+ > Same source tree as `4.0.0-beta.11`; pure fix for the wrapper
587
+ > exit-code bug that previously caused `peaks <unknown>` and
588
+ > `peaks <unknown> --help` to exit 0 with the help banner.
589
+ >
590
+ > **Verdict**: All 4 regression paths now exit 1 with a
591
+ > `COMMAND_NOT_FOUND` JSON envelope. ice-cola baseline 27/27 PASS
592
+ > (AC3.9/AC3.10 now functionally correct).
593
+
594
+ > \*\*This CHANGELOG entry documents the SHIPPED 4.0.0-beta.11.
595
+ > It is the post-implementation release of the 4.0.0-beta.10 contract
596
+ > documented at `docs/release/4.0.0-beta.10.md` (runbook filename
597
+ > preserved for cross-reference stability).
598
+ >
599
+ > The 3 slices (del-minimax-worker, hide-role-skills, on-demand-ecc)
600
+ > all landed PASS in this branch — see `peaks workflow verify-pipeline
601
+ --rid 2026-07-15-cli-surface-cleanup` and the Slice 1/2/3 sediment
602
+ > memories in `.peaks/memory/`.
603
+ >
604
+ > **Version bump rationale** (D-016): 4.0.0-beta.10 was the pre-impl
605
+ > contract name; 4.0.0-beta.11 is the actual release of that contract.
606
+ > One-line summary: **"CLI surface cleanup + on-demand ECC"**.
607
+ >
608
+ > **Verdict**: 10/12 AC PASS + 2 PASS-WITH-DEFERRED (D-013 wrapper
609
+ > exit-code bug, separate follow-up slice after publish).
610
+ > Ice-cola baseline gate: 27/27 AC functionally pass.
611
+
612
+ ### Removed — `peaks minimax-worker` (Slice 1)
613
+
614
+ - **`peaks minimax-worker` CLI removed** — historical MiniMax
615
+ provider integration. `peaks minimax-worker --help` now exits
616
+ non-zero with `COMMAND_NOT_FOUND`.
617
+ - **`peaks worker minimax` CLI removed** — same module.
618
+ - **`peaks config provider minimax *` subtree removed** —
619
+ `peaks config provider minimax set --help` exits non-zero.
620
+ - **6 source files deleted**:
621
+ - `src/cli/commands/worker-commands.ts`
622
+ - `src/services/providers/minimax-provider-service.ts`
623
+ - `src/services/providers/minimax-worker-service.ts`
624
+ - `src/services/config/provider-service.ts` (entire file; 100% MiniMax)
625
+ - `tests/unit/minimax-worker-service.test.ts`
626
+ - `tests/unit/minimax-provider-service.test.ts`
627
+ - **~21 source files modified** (drop imports, drop function bodies,
628
+ drop registrations, replace `'minimax-2.7'` literal with
629
+ `'claude-opus-4-7'` in 5 files).
630
+ - **~8 test files modified** (drop MiniMax cases; replace literal in 3).
631
+ - **4 openspec files updated** (1-line wording fixes).
632
+ - **Net security improvement**: smaller secret-handling surface
633
+ (5 MiniMax functions removed).
634
+
635
+ ### Changed — 10 role-skill CLI commands hidden (Slice 2)
636
+
637
+ - **10 top-level role-skill CLI commands** now hidden from `peaks --help`
638
+ via `Commander.hidden()`. Still invokable for internal
639
+ `peaks sub-agent dispatch --role <role>` paths. Final canonical
640
+ list (per QA grep audit):
641
+ - `peaks prd`
642
+ - `peaks qa`
643
+ - `peaks sc`
644
+ - `peaks audit`
645
+ - `peaks code-review`
646
+ - `peaks perf-audit`
647
+ - `peaks security-audit`
648
+ - `peaks upgrade`
649
+ - `peaks agent`
650
+ - `peaks code`
651
+ - **`peaks skill list`** now excludes skills with
652
+ `visibility: internal` frontmatter. Use `--include-internal` to opt in.
653
+ - **`peaks skill search`** accepts `--include-internal` flag.
654
+ - **8 SKILL.md files** updated to add/rename `visibility: internal`:
655
+ `peaks-prd`, `peaks-qa`, `peaks-rd`, `peaks-sc`, `peaks-ui`,
656
+ `peaks-txt`, `peaks-final-review`, `peaks-perf-audit`,
657
+ `peaks-security-audit`.
658
+ - **Integration test rewritten**:
659
+ `tests/integration/skill-search-cli.test.ts:72-79` now asserts
660
+ the new `visibility:` frontmatter field instead of legacy
661
+ `userInvocable`.
662
+
663
+ ### Added — `peaks ecc install|status|ls|show` (Slice 3)
664
+
665
+ > **PIVOT vs initial design**: Originally Slice 3 was supposed to
666
+ > spawn `<cached>/ecc agent run <name> --json` as a subprocess.
667
+ > RD sub-agent triggered **Gate S3-0**: affaan-m/everything-claude-code
668
+ > has no `ecc` binary; its real structure is `agents/*.md` flat
669
+ >
670
+ > - SKILL.md descriptors. User chose Option B — drop the subprocess
671
+ > model entirely.
672
+
673
+ - **`peaks ecc install`** — downloads affaan-m/everything-claude-code
674
+ from GitHub releases to `~/.peaks/cache/ecc-<sha>/`. Selective
675
+ tarball extraction: ONLY `agents/` subtree (skip `rules/`,
676
+ `commands/`, `settings/`, `docs/`, `README.md`).
677
+ - **`peaks ecc status`** — reads cache manifest, reports version + sha
678
+ - agent count.
679
+ - **`peaks ecc ls`** — lists cached agents by parsing `agents/*.md`
680
+ frontmatter.
681
+ - **`peaks ecc show <name>`** — outputs the agent's SKILL.md body
682
+ to stdout. LLM-side consumers (Skill-first path) read this output
683
+ to apply the agent's instructions.
684
+ - **3 source files deleted** (with Slice 1):
685
+ - `src/cli/commands/agent-commands.ts` (the old `peaks agent run/list`)
686
+ - `src/services/agent/ecc-agent-service.ts` (the spawn orchestrator)
687
+ - `tests/unit/services/agent/ecc-agent-service.test.ts`
688
+ - **3 new source files**:
689
+ - `src/services/agent/ecc-cache-service.ts` — pure-IO cache module
690
+ (`downloadToCache`, `readCacheManifest`, `listCachedAgents`,
691
+ `readAgentSkill`, `cleanupStaleCache`)
692
+ - `src/cli/commands/ecc-commands.ts` — 4 subcommands
693
+ - `tests/unit/agent/ecc-cache-service.test.ts`
694
+ - **Dead-probes removed**:
695
+ - `npx ecc --version` probe (was: never worked; affaan-m/ECC not on npm)
696
+ - `npx ecc-agentshield --version` probe in
697
+ `src/services/audit/static-service.ts:104` (parallel fix)
698
+ - **7-day cache TTL** via `bootstrapLogger.applyRetention` sweep
699
+ (wired at `src/cli/program.ts:121`). NOT via
700
+ `peaks doctor --cleanup-stale` (which is bound to `dropStale()`
701
+ for the binding store).
702
+
703
+ ### Removed — `peaks agent run` and `peaks agent list`
704
+
705
+ - **`peaks agent run <name>` exits non-zero with `COMMAND_NOT_FOUND`**.
706
+ - **`peaks agent list` exits non-zero with `COMMAND_NOT_FOUND`**.
707
+ - **No replacement CLI** — LLM-side consumers use
708
+ `peaks ecc show <name>` or read `<cache>/agents/<name>.md` directly.
709
+
710
+ ### Net security / performance impact
711
+
712
+ - **Security**: 0 subprocess attack surface (was: 1 per call in beta.9);
713
+ smaller secret-handling surface (5 MiniMax functions removed).
714
+ - **Performance**: cache-dir probe is pure read (<15ms vs ~500ms
715
+ for the npm-registry probe in beta.9); selective tarball extraction
716
+ saves ~95% disk footprint.
717
+
718
+ ### Pre-implementation gate
719
+
720
+ `peaks workflow verify-pipeline --rid 2026-07-15-cli-surface-cleanup`
721
+ returns `ok: true, complete: true, violations: []` (9/9 gates PASS).
722
+ This CHANGELOG entry is the contract; the actual implementation
723
+ follows the runbook in `docs/release/4.0.0-beta.10.md`.
724
+
725
+ ### Acceptance criteria
726
+
727
+ 27 ACs total: 7 (Slice 1) + 8 (Slice 2) + 11 (Slice 3 redesign + 1).
728
+ Full list in `docs/release/4.0.0-beta.10.md` §Acceptance criteria.
729
+
730
+ ---
731
+
5
732
  ## 4.0.0-beta.9 — 2026-07-15
6
733
 
7
734
  ### Fixed — `npm install peaks-loop` runtime path layout
@@ -66,7 +793,7 @@ all present after a fresh workspace init.
66
793
  audit/business templates (default: skip if present).
67
794
  - **5-template boot** — every `peaks workspace init` materialises
68
795
  `.peaks/project-scan/{project-scan.md, business-knowledge.md,
69
- security-template.md, perf-template.md, audit-output-schema.md}`.
796
+ security-template.md, perf-template.md, audit-output-schema.md}`.
70
797
  The 4 audit/business templates are bundled at
71
798
  `src/services/workspace/templates/project-scan/*.md` and copied
72
799
  verbatim by `scripts/copy-templates.mjs` (post-`tsc` step; tsc
@@ -178,15 +905,15 @@ exposed two follow-on bugs that the unit suite missed:
178
905
 
179
906
  ### Sediment (Step 11) — 7 lessons in `.peaks/memory/`
180
907
 
181
- | File | Topic |
182
- |---|---|
183
- | `z-code-peaks-loop-9-ide-adapter-vendor-neutrality-adapter.md` | z-code 9th IDE + vendor-neutrality adapter pattern |
184
- | `peaks-loop-install-model-getstrongestmodelid-fallback.md` | install no longer hardcodes default model |
185
- | `desktop-application-ide-adapter-z-code-cli.md` | desktop-app IDE adapter field-degradation decision |
186
- | `peaks-code-runbook-4-0-0-beta-6-skill-md-cli-d-001-d-002-d-003-d-010.md` | 4 SKILL.md / CLI drift points |
187
- | `2026-07-09-zcode-adapter-overview.md` | RID 003 overall summary (project record) |
188
- | `peaks-ide-runtime-detect-zcode-only.md` | `peaks ide model --current` z-code 4-tier priority chain |
189
- | `ide-adapter-detectcurrentmodel-optional-interface-pattern.md` | optional interface field extension pattern |
908
+ | File | Topic |
909
+ | ------------------------------------------------------------------------- | -------------------------------------------------------- |
910
+ | `z-code-peaks-loop-9-ide-adapter-vendor-neutrality-adapter.md` | z-code 9th IDE + vendor-neutrality adapter pattern |
911
+ | `peaks-loop-install-model-getstrongestmodelid-fallback.md` | install no longer hardcodes default model |
912
+ | `desktop-application-ide-adapter-z-code-cli.md` | desktop-app IDE adapter field-degradation decision |
913
+ | `peaks-code-runbook-4-0-0-beta-6-skill-md-cli-d-001-d-002-d-003-d-010.md` | 4 SKILL.md / CLI drift points |
914
+ | `2026-07-09-zcode-adapter-overview.md` | RID 003 overall summary (project record) |
915
+ | `peaks-ide-runtime-detect-zcode-only.md` | `peaks ide model --current` z-code 4-tier priority chain |
916
+ | `ide-adapter-detectcurrentmodel-optional-interface-pattern.md` | optional interface field extension pattern |
190
917
 
191
918
  ### Known follow-ups (S3-cleanup backlog)
192
919
 
@@ -203,7 +930,7 @@ None. All 8 pre-existing adapters continue to load without changes. CLI subcomma
203
930
 
204
931
  ### Added — peaks-solo dispatcher (分诊员)
205
932
 
206
- - **`peaks-solo` skill** — `skills/peaks-solo/SKILL.md` + 3 references (triage / fallback / sediment). Natural-language front door for the Peaks-Loop skill family. Use when the user describes a task in NL and does not know which peaks-* skill fits. 0 breaking change: 3.x / 4.x `/peaks-code` / `/peaks-content` / `/peaks-doctor` etc. continue to work.
933
+ - **`peaks-solo` skill** — `skills/peaks-solo/SKILL.md` + 3 references (triage / fallback / sediment). Natural-language front door for the Peaks-Loop skill family. Use when the user describes a task in NL and does not know which peaks-\* skill fits. 0 breaking change: 3.x / 4.x `/peaks-code` / `/peaks-content` / `/peaks-doctor` etc. continue to work.
207
934
  - **`peaks skill search` CLI** — `src/services/skill/skill-search-service.ts` + `src/cli/commands/skill-search-commands.ts`. Query / tag / domain filters; substring match; structured JSON output. Used by `peaks-solo` to find the right leaf skill. Available as a top-level primitive (not dispatcher-specific).
208
935
  - **Sub-skills unchanged** — `peaks-code / peaks-content / peaks-doctor / peaks-issue-fix-orchestrator / peaks-sop / etc.` are NOT modified. peaks-solo sits alongside, not on top.
209
936
 
@@ -244,9 +971,9 @@ Loop Engineering crystallization is now the product surface. The 4.0.0-beta.3 li
244
971
 
245
972
  - **`.peaks/standards/loop-engineering-guidelines.md`** — the single source of truth for the 10 red lines RL-0..RL-9, each in the four-section karpathy form (Failure modes / Rewrite / Self-check / Out-of-scope). Co-equal karpathy × darwin layers (RL-0).
246
973
  - **`peaks standards lint --category loop-engineering`** — `src/services/standards/loop-engineering-lint.ts`. Parses the guideline file and asserts every red line has all four sections, fails closed otherwise.
247
- - **`peaks skill lint --category loop-engineering-readiness --path <skill-dir>`** — `src/services/standards/loop-engineering-readiness-lint.ts` + `src/cli/commands/skill-loop-engineering-readiness-commands.ts`. Asserts a peaks-* SKILL.md (a) references `.peaks/standards/loop-engineering-guidelines.md`, (b) does not introduce a CLI verb the user is meant to type, (c) does not introduce a JSON / manifest hand-authoring surface. Alias verb: `peaks skill ready --category loop-engineering-readiness --path <skill-dir>`.
974
+ - **`peaks skill lint --category loop-engineering-readiness --path <skill-dir>`** — `src/services/standards/loop-engineering-readiness-lint.ts` + `src/cli/commands/skill-loop-engineering-readiness-commands.ts`. Asserts a peaks-\* SKILL.md (a) references `.peaks/standards/loop-engineering-guidelines.md`, (b) does not introduce a CLI verb the user is meant to type, (c) does not introduce a JSON / manifest hand-authoring surface. Alias verb: `peaks skill ready --category loop-engineering-readiness --path <skill-dir>`.
248
975
  - **Unit guard** — `tests/unit/standards/loop-engineering-guidelines.test.ts` enforces the four-section shape for every red line in the file.
249
- - **peaks-code domain boundary (RL-8)** — `skills/peaks-code/SKILL.md` self-declares as the code-domain long-task loop engineering orchestrator and is NOT a general-purpose orchestrator. Cross-domain peaks-* skills (peaks-content, peaks-issue-fix-orchestrator) import the shared guideline file and pass the readiness lint.
976
+ - **peaks-code domain boundary (RL-8)** — `skills/peaks-code/SKILL.md` self-declares as the code-domain long-task loop engineering orchestrator and is NOT a general-purpose orchestrator. Cross-domain peaks-\* skills (peaks-content, peaks-issue-fix-orchestrator) import the shared guideline file and pass the readiness lint.
250
977
 
251
978
  ### Added — Bundle share + desktop extension surface (§7A, AC-24 / AC-25 / AC-26)
252
979
 
@@ -260,6 +987,7 @@ Loop Engineering crystallization is now the product surface. The 4.0.0-beta.3 li
260
987
  ### Added — SkillHub expansion (5 new tables / non-breaking)
261
988
 
262
989
  The 6+ relation table layout is preserved. 5 new tables added under `.peaks/_runtime/<sessionId>/`:
990
+
263
991
  - `loop_release` (002)
264
992
  - `loop_bee_relation` (003)
265
993
  - loop↔bee share / desktop extension columns (004)
@@ -299,13 +1027,16 @@ Migration is non-breaking: every new column has a DEFAULT and the new tables sit
299
1027
  ## 4.0.0-beta.2 — 2026-07-07
300
1028
 
301
1029
  ### Renamed
1030
+
302
1031
  - **`peaks-solo` → `peaks-code`** — the long-running code-domain orchestrator skill (PRD/RD/QA/UI/SC/TXT pipeline) has been renamed to communicate its scope more accurately. The on-disk directory `~/.peaks/skills/.system/bees/peaks-code/` is preserved as a stable install location; only the manifest `id` and `displayName` change (`peaks-code` / `Peaks Code`). All four sibling skills (`peaks-solo-resume` → `peaks-resume`, `peaks-solo-status` → `peaks-status`, `peaks-solo-test` → `peaks-test`) are now top-level primitives rather than child skills of `peaks-solo`. Migration: `peaks session migrate-skill-name --from peaks-solo --to peaks-code --apply`.
303
1032
 
304
1033
  ### Changed (Breaking)
1034
+
305
1035
  - **`peaks skill presence:set peaks-solo` no longer recognized** — the canonical skill name is now `peaks-code`. Existing `.peaks/_runtime/*/active-skill.json` files carrying `skill: "peaks-solo"` are migrated by `peaks session migrate-skill-name`. Manual override: edit the file and replace `"skill": "peaks-solo"` with `"skill": "peaks-code"`.
306
1036
  - **CLI surface unchanged** — `peaks code`, `peaks code --fast`, and the entire `peaks-code` skill runbook continue to function; only the skill-identification field (`id`, `displayName`, presence `skill` value) changes. The runbook name `peaks code` is the user-facing verb and remains as-is.
307
1037
 
308
1038
  ### Fixed (post-rename polish)
1039
+
309
1040
  - **Rule name normalization** — `Code Code-Change Red Line` → `Code Commit Ban Red Line` (8 occurrences across `src/services/audit/enforcers/code-ban.ts`, `src/cli/commands/hook-handle.ts`, and the audit tests). Aligns with `red-line-catalog.ts` entry `rl-code-ban-001` / `Code Commit Ban`.
310
1041
  - **Wire-format error code rename** — `SOLO_MODE_REQUIRES_SOLO_WORKFLOW` → `CODE_MODE_REQUIRES_CODE_WORKFLOW` and `UNSUPPORTED_SOLO_MODE` → `UNSUPPORTED_CODE_MODE` in `src/cli/commands/workflow-commands.ts` (4 test sites updated).
311
1042
  - **Test local consts** — `soloResult/soloOutput` → `codeResult/codeOutput` in `tests/unit/cli-program.workflow.test.ts`; `SOLO_PATH/soloAbsPath` → `CODE_PATH/codeAbsPath` in `tests/unit/code/skills-subagent-scope-dir.test.ts`; `SOLO_REF/SOLO_FANOUT_REF` → `CODE_REF/CODE_FANOUT_REF` in `tests/unit/dispatch/dispatch-fanout-mandatory.test.ts`.
@@ -316,11 +1047,13 @@ Migration is non-breaking: every new column has a DEFAULT and the new tables sit
316
1047
  - **Video demo copy** — `examples/video-demo/src/copy.ts` `skillWas: 'peaks-solo'` → `skillWas: 'peaks-code'` (legacy label, both locales).
317
1048
 
318
1049
  ### Added
1050
+
319
1051
  - **Manifest id field** — `.peaks/skills/.system/bees/peaks-code/manifest.json` now carries `{ "id": "peaks-code", "displayName": "Peaks Code" }`. The `migrate-skill-name` service explicitly skips this file (test: `session-migrate-skill-name.test.ts:69` "跳过 .peaks/skills/.system/bees/peaks-code/manifest.json") so the canonical id is only ever edited by hand or by an explicit `peaks skill sediment refine-bee` flow, never by bulk migration.
320
1052
  - **Spec §4.1.1 rewrite** — `docs/superpowers/specs/2026-07-04-peaks-maker-dynamic-skill-sediment-design.md` §4.1.1 has been rewritten from "peaks-code as preserved alias" to "peaks-code as the system-stable code-domain bee (renamed from peaks-code)". The plan's spec-coverage table now references the renamed heading.
321
1053
  - **Migration helper** — `peaks session migrate-skill-name --from <old> --to <new> [--apply]` is the supported path for renaming skill references in `.peaks/_runtime/`. Idempotent; skip-list includes `.peaks/memory/**` and `.peaks/skills/.system/bees/peaks-code/manifest.json`.
322
1054
 
323
1055
  ### Verification
1056
+
324
1057
  - `tsc --noEmit` zero errors
325
1058
  - Full `vitest run` exit 0 (all 30 touched test files / 265 directly-tested assertions pass)
326
1059
  - `silent-warning-detector` OK on 481 files
@@ -439,10 +1172,11 @@ Validated on `C:/Users/smallMark/Desktop/peaksclaw/ice-cola` (consumer project).
439
1172
  ## [3.0.2] — 2026-07-02 — change-id shim retirement (v2.19.0) + Understand Anything hybrid context (3.0.2)
440
1173
 
441
1174
  **PATCH bump from 3.0.1**. Two independent slices bundled into one release:
1175
+
442
1176
  - **v2.19.0 change-id shim retirement** — full removal of the peaks-loop change-id axis (filesystem axis, code shim, envelope JSON slug, CLI flags). The change-id was a no-op post-v2.17.0 hard-kill; this slice retires the v2.17.0 shim half-life. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched.
443
1177
  - **3.0.2 Understand Anything hybrid context** — new `peaks understand context` subcommand that encapsulates the UA-first / codegraph-fallback / hybrid-union routing decision in the service layer (per the peaks-loop "skill-first / CLI-auxiliary" architecture). Consumers no longer pick one or the other at the LLM level.
444
1178
 
445
- The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced835e`, `7ee9d8f`, plus follow-up tests) but was never formally released. v2.19.0 is therefore *not* a separate release line — its changes are rolled forward into 3.0.2. Future releases resume numeric sequence from 3.0.3.
1179
+ The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced835e`, `7ee9d8f`, plus follow-up tests) but was never formally released. v2.19.0 is therefore _not_ a separate release line — its changes are rolled forward into 3.0.2. Future releases resume numeric sequence from 3.0.3.
446
1180
 
447
1181
  ### Removed — change-id shim (cleanup post v2.17.0 hard-kill)
448
1182
 
@@ -465,7 +1199,7 @@ The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced8
465
1199
  - 12 JSDoc references to the deleted `src/shared/change-id.ts` file scrubbed across `src/services/session/session-binding-bridge.ts`, `src/services/session/session-manager.ts`, `src/shared/path-safety.ts`, `tests/unit/session-manager.test.ts`, `tests/vitest.setup.ts`. The 3 pre-slim `tests/fixtures/skills/pre-slim/*.SKILL.md` fixtures preserve the historical reference per the FROZEN EVIDENCE rule.
466
1200
  - 2 weakened `tests/unit/rd/repair-cycle-2-cli-wiring.test.ts` cases restored with real assertions: the test now bootstraps a real session via `peaks workspace init` then drives `peaks swarm plan` end-to-end, asserting `standardsErrorCode`, `standardsDiagnostic`, and `process.exitCode` (no `expect(true).toBe(true)`, no `.skip`).
467
1201
 
468
- ### Round 3 — change-id彻底根治
1202
+ ### Round 3 — change-id 彻底根治
469
1203
 
470
1204
  - All 275 internal `changeId` field references in `src/` renamed to `sessionId` across 35 source files (cli/commands, services/workflow, services/tech, services/workspace, services/sc, services/rd, services/prd, services/audit, services/fixture, services/slice, services/mut, services/providers, services/artifacts, services/openspec-adjacent callers). The 65 remaining `changeId` hits are EXCLUSIVELY in `src/cli/commands/openspec-commands.ts` and `src/services/openspec/*.ts` — L4 OpenSpec vocabulary (positional `<change-id>` arg, `openspec/changes/<change-id>/` dir name, OpenSpec spec/proposal markdown tokens). The rename preserves L4 per PRD §Non-Goals.
471
1205
  - `WorkspaceInitOptions.changeId?: string` field REMOVED entirely (was a no-op post-v2.17.0; the slice deletes the binding-file legacy and the inline lstatSync guard now scopes the v2.8.3 hard-ban to date-stamped top-level siblings at `.peaks/<YYYY-MM-DD-*>/` only).
@@ -481,6 +1215,7 @@ The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced8
481
1215
  - `pnpm build` regenerated `dist/` to drop the dead `migrate-change-scope` JS. AC-15 (`node bin/peaks.js workspace migrate-change-scope`) now reports `error: unknown command 'migrate-change-scope'`.
482
1216
 
483
1217
  ### Round 4 — change-id full root-out (fix 55 test regressions)
1218
+
484
1219
  - Fixed 55 unit tests failing across 15 files (regressions from round-3 rename script + incomplete code paths).
485
1220
  - `peaks request *` dry-run mode no longer creates `.peaks/_runtime/<sid>/` dir eagerly (test updated to assert the canonical single-axis scope dir at apply-time only).
486
1221
  - Observability event hook restored on `peaks request transition` (3 tests): root cause was `readSummary` returning the scope fragment (`_runtime/<sid>`) as the bare session id, so `emitObservabilityEvent` landed at `.peaks/_runtime/_runtime/<sid>/metrics/slices.jsonl`. Fix strips the `_runtime[\\/]` prefix when storing the summary's sessionId.
@@ -513,10 +1248,11 @@ The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced8
513
1248
  ## [3.0.2] — 2026-07-02 — change-id shim retirement (v2.19.0) + Understand Anything hybrid context (3.0.2)
514
1249
 
515
1250
  **PATCH bump from 3.0.1**. Two independent slices bundled into one release:
1251
+
516
1252
  - **v2.19.0 change-id shim retirement** — full removal of the peaks-loop change-id axis (filesystem axis, code shim, envelope JSON slug, CLI flags). The change-id was a no-op post-v2.17.0 hard-kill; this slice retires the v2.17.0 shim half-life. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched.
517
1253
  - **3.0.2 Understand Anything hybrid context** — new `peaks understand context` subcommand that encapsulates the UA-first / codegraph-fallback / hybrid-union routing decision in the service layer (per the peaks-loop "skill-first / CLI-auxiliary" architecture). Consumers no longer pick one or the other at the LLM level.
518
1254
 
519
- The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced835e`, `7ee9d8f`, plus follow-up tests) but was never formally released. v2.19.0 is therefore *not* a separate release line — its changes are rolled forward into 3.0.2. Future releases resume numeric sequence from 3.0.3.
1255
+ The v2.19.0 work shipped as code commits (`f91d71c`, `5186d3d`, `b598612`, `ced835e`, `7ee9d8f`, plus follow-up tests) but was never formally released. v2.19.0 is therefore _not_ a separate release line — its changes are rolled forward into 3.0.2. Future releases resume numeric sequence from 3.0.3.
520
1256
 
521
1257
  ### Added — `peaks understand context` (3.0.2 user-facing feature)
522
1258
 
@@ -525,12 +1261,14 @@ The Understand Anything (UA) Claude Code plugin and `@colbymchenry/codegraph` ar
525
1261
  This slice adds a single `peaks understand context` subcommand that encapsulates the routing decision in the service layer (per the peaks-loop "skill-first / CLI-auxiliary" architecture — see `peaks-code` SKILL.md). The envelope carries a `source` tag so downstream consumers can audit which evidence contributed to the context.
526
1262
 
527
1263
  **Source routing** (deterministic, decided in `buildUnderstandContext`):
1264
+
528
1265
  - `ua-only` — UA knowledge graph present, no codegraph
529
1266
  - `ua-missing-fallback-codegraph` — UA absent, codegraph produced evidence
530
1267
  - `ua-and-codegraph-hybrid` — both present, both contribute (parallel `Promise.all`)
531
1268
  - `both-missing` — neither produced evidence, exit code 2
532
1269
 
533
1270
  **Added files (5):**
1271
+
534
1272
  - `src/services/understand/understand-hybrid-service.ts` (133L, new): `buildUnderstandContext({projectRoot, files?, sampleSize?, artifactDir?, codegraphRunner?})` uses `Promise.all` to run UA scan and codegraph affected in parallel; total wall-clock = `max(uaMs, codegraphMs)`, not sum. Failures are caught into `warnings[]` (best-effort); the main envelope is always returned so consumers can audit missing evidence.
535
1273
  - `src/services/understand/hybrid-types.ts` (39L, new): `UnderstandContextResult` envelope + 4-value source enum + `CodegraphContextBlock`.
536
1274
  - `src/cli/commands/understand-commands.ts` (208L, +51L net): new `peaks understand context` subcommand at base path `admin/audit-logs` (the only 3rd CLI surface in the understand module family). The subcommand accepts `--project --files --sample --artifact-dir` and emits the envelope as JSON or human-readable summary.
@@ -677,12 +1415,12 @@ The 1.x → 2.0 upgrade is an irreversible external side effect (rewrites `~/.pe
677
1415
 
678
1416
  The split methodology follows the v2.18.0 `session-binding-bridge.ts` pattern: identify a natural seam (state/helpers vs business logic, types vs impl, etc.), extract the chosen section into a new sibling file, and re-export the moved symbols from the original module so external imports are unchanged. Internal references are routed through a local `import { ... }` so the body of the original module continues to compile and behave identically.
679
1417
 
680
- | # | File | Before | After (orig + sibling) | New sibling | Seam |
681
- |---|------|-------:|-----------------------:|-------------|------|
682
- | 1 | `src/services/artifacts/request-artifact-service.ts` | 783 | 649 + 153 | `request-artifact-state-helpers.ts` | `RequestArtifactState` type, `ALLOWED_STATES_PER_ROLE`, `allowedStatesForRole`, 4 transition error classes, `updateStatusBlock` frontmatter mutator |
683
- | 2 | `src/services/slice/slice-decompose-service.ts` | 775 | 632 + 178 | `slice-decompose-runners.ts` | 3 default runner factories (`defaultCodegraphRunner`, `defaultUnderstandRunner`, `defaultImportEdgeRunner`) + `runCodegraph` shell-out helper |
684
- | 3 | `src/services/workflow/workflow-autonomous-service.ts` | 774 | 465 + 337 | `workflow-autonomous-resume-helpers.ts` | Resume validation pipeline (`getResumeRequiredArtifacts`, `readResumeArtifact`, `stripChangeScopePrefix`, JSON / frontmatter parsers, `getResumeArtifactsStatus`, `createResumePlan`) + `MAX_RESUME_ARTIFACT_BYTES` const |
685
- | 4 | `src/services/workspace/workspace-service.ts` | 742 | 550 + 217 | `workspace-claude-settings-materializer.ts` | Consumer `.claude/settings.local.json` materialization (`materializeClaudeSettingsLocal`, `writeOfflineTemplateCopy`, `upsertPeaksGitignoreSnippet`) + `PEAKS_GITIGNORE_*` constants |
1418
+ | # | File | Before | After (orig + sibling) | New sibling | Seam |
1419
+ | --- | ------------------------------------------------------ | -----: | ---------------------: | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1420
+ | 1 | `src/services/artifacts/request-artifact-service.ts` | 783 | 649 + 153 | `request-artifact-state-helpers.ts` | `RequestArtifactState` type, `ALLOWED_STATES_PER_ROLE`, `allowedStatesForRole`, 4 transition error classes, `updateStatusBlock` frontmatter mutator |
1421
+ | 2 | `src/services/slice/slice-decompose-service.ts` | 775 | 632 + 178 | `slice-decompose-runners.ts` | 3 default runner factories (`defaultCodegraphRunner`, `defaultUnderstandRunner`, `defaultImportEdgeRunner`) + `runCodegraph` shell-out helper |
1422
+ | 3 | `src/services/workflow/workflow-autonomous-service.ts` | 774 | 465 + 337 | `workflow-autonomous-resume-helpers.ts` | Resume validation pipeline (`getResumeRequiredArtifacts`, `readResumeArtifact`, `stripChangeScopePrefix`, JSON / frontmatter parsers, `getResumeArtifactsStatus`, `createResumePlan`) + `MAX_RESUME_ARTIFACT_BYTES` const |
1423
+ | 4 | `src/services/workspace/workspace-service.ts` | 742 | 550 + 217 | `workspace-claude-settings-materializer.ts` | Consumer `.claude/settings.local.json` materialization (`materializeClaudeSettingsLocal`, `writeOfflineTemplateCopy`, `upsertPeaksGitignoreSnippet`) + `PEAKS_GITIGNORE_*` constants |
686
1424
 
687
1425
  The original 4 files land at 465-649 LOC (well below the 800 cap; target range 600-650). The 4 new sibling files are 153-337 LOC. Total LOC across the 8 files is unchanged (3074) — this is a structural refactor only, not a deletion or compression.
688
1426
 
@@ -753,12 +1491,12 @@ Each original file gets a sibling `import { ... } from './X-helpers.js'` + `expo
753
1491
 
754
1492
  ### Dogfood
755
1493
 
756
- | # | Scenario | Verdict | Evidence |
757
- |---|---|---|---|
758
- | A | v2.18.1 verify-pipeline happy-path (session-axis) | PASS | `.peaks/_runtime/2026-06-29-session-9cac8e/{rd,qa}/...` resolves as canonical; `data.changeId` slug preserved in envelope |
759
- | B | v2.18.1 verify-pipeline missing-evidence | PASS | Clear `RD evidence missing: ...` violations, no `ReferenceError` |
760
- | C | v2.18.1 prd check-blocks well-formed PRD | PASS | `report.ok: true`, all 4 blocks pass, JSON envelope `{ 业务场景: 'pass', 边界 case: 'pass', UI 装配意图: 'pass' }` |
761
- | D | v2.18.1 prd check-blocks missing 业务场景 block | PASS | `report.ok: false`, `issues: ["Missing required block: 业务场景"]`, no `ReferenceError` |
1494
+ | # | Scenario | Verdict | Evidence |
1495
+ | --- | ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- |
1496
+ | A | v2.18.1 verify-pipeline happy-path (session-axis) | PASS | `.peaks/_runtime/2026-06-29-session-9cac8e/{rd,qa}/...` resolves as canonical; `data.changeId` slug preserved in envelope |
1497
+ | B | v2.18.1 verify-pipeline missing-evidence | PASS | Clear `RD evidence missing: ...` violations, no `ReferenceError` |
1498
+ | C | v2.18.1 prd check-blocks well-formed PRD | PASS | `report.ok: true`, all 4 blocks pass, JSON envelope `{ 业务场景: 'pass', 边界 case: 'pass', UI 装配意图: 'pass' }` |
1499
+ | D | v2.18.1 prd check-blocks missing 业务场景 block | PASS | `report.ok: false`, `issues: ["Missing required block: 业务场景"]`, no `ReferenceError` |
762
1500
 
763
1501
  ### Commits
764
1502
 
@@ -789,7 +1527,7 @@ Each original file gets a sibling `import { ... } from './X-helpers.js'` + `expo
789
1527
  - `src/services/session/binding-store.ts:259` — `ownerHint` field is now `${envSignal}#${pid}` (was bare env signal). Preserves the existing v2.17.0 field shape; only the value format changes.
790
1528
  - `registerInstance` distinguishes instances by `(callerId, pid)` tuple, not by `ownerHint` alone. Same pid + same callerId → auto-resume (D2 Claude-instance-level hard-exclusive sid preserved); same callerId + different pid → distinct sids.
791
1529
  - `/compact` resume: same outer-session-id + same pid → reuses sid (verified by new Case B test). Different pid (rare, but possible if the harness restarts) → new sid (safe default, not a stale resume).
792
- - Sub-agent dispatch: sub-agents inherit parent's `CLAUDE_CODE_SESSION_ID` but run in the same Node process → same pid → same callerId → same sid (D2 sid-aggregation across peaks-* skill activations preserved).
1530
+ - Sub-agent dispatch: sub-agents inherit parent's `CLAUDE_CODE_SESSION_ID` but run in the same Node process → same pid → same callerId → same sid (D2 sid-aggregation across peaks-\* skill activations preserved).
793
1531
  - 6 new test cases in `tests/unit/services/session/binding-store.test.ts:151-242`:
794
1532
  - **Case A:** 2 instances, same `callerId`, different `pid` → 2 distinct sids
795
1533
  - **Case B:** 2 instances, same `callerId`, same `pid`, same outer-session-id → 1 sid (auto-resume)
@@ -827,12 +1565,12 @@ Each original file gets a sibling `import { ... } from './X-helpers.js'` + `expo
827
1565
 
828
1566
  ### Dogfood (ice-cola NestJS project, 2026-06-29-session-2e81dc)
829
1567
 
830
- | # | Scenario | Verdict | Evidence |
831
- |---|---|---|---|
832
- | A | P0 fix verification (binding file format) | PASS | `callerId: 5fa8a7d8-...#13472` matches shell pid 13472; pre-existing instance pid 3876 ≠ current shell — fix works in production-shape data |
833
- | B | peaks doctor stale-binding scan | PASS | 0 stale bindings, ttl=300000ms, v2.16.0 schema surface intact |
834
- | C | peaks code smoke (4 sub-commands) | PARTIAL | 3/4 pass; `peaks request lint --project .` is invalid syntax (needs `<rid>` + `--role`); not a v2.18.0 regression |
835
- | D | env-collision simulation (single shell, 2 envs) | PASS | `fake-session-A#20984` + `fake-session-B#20984` → 2 distinct sids (fupv8b / xnntb1); transposed axis (same pid, different env) verified; primary 2-Claude-windows scenario needs CI integration test with 2 child node processes |
1568
+ | # | Scenario | Verdict | Evidence |
1569
+ | --- | ----------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1570
+ | A | P0 fix verification (binding file format) | PASS | `callerId: 5fa8a7d8-...#13472` matches shell pid 13472; pre-existing instance pid 3876 ≠ current shell — fix works in production-shape data |
1571
+ | B | peaks doctor stale-binding scan | PASS | 0 stale bindings, ttl=300000ms, v2.16.0 schema surface intact |
1572
+ | C | peaks code smoke (4 sub-commands) | PARTIAL | 3/4 pass; `peaks request lint --project .` is invalid syntax (needs `<rid>` + `--role`); not a v2.18.0 regression |
1573
+ | D | env-collision simulation (single shell, 2 envs) | PASS | `fake-session-A#20984` + `fake-session-B#20984` → 2 distinct sids (fupv8b / xnntb1); transposed axis (same pid, different env) verified; primary 2-Claude-windows scenario needs CI integration test with 2 child node processes |
836
1574
 
837
1575
  **Dogfood verdict:** 3.5 / 4 pass; `recommend_v2.18.0_commit: true`.
838
1576
 
@@ -871,7 +1609,7 @@ The first v2.18.0 release deferred two open items to a redo slice; both are now
871
1609
  ### Feature — binding-store v2 sentinel (v2.16.0-alpha + v2.17.0)
872
1610
 
873
1611
  - `src/services/session/binding-store.ts` — zod-validated multi-instance binding schema with auto-migration from legacy `{ sessionId, createdAt, projectRoot }`. New shape: `{ ownerHint, pid, lastHeartbeat, scope, instances: Record<sid, InstanceRecord> }`.
874
- - `InstanceRecord` = `{ startedAt, roles: string[], callerId, lastHeartbeat }` — `roles` accumulates as the Claude instance activates multiple peaks-* skills (solos → rd → qa all share one sid).
1612
+ - `InstanceRecord` = `{ startedAt, roles: string[], callerId, lastHeartbeat }` — `roles` accumulates as the Claude instance activates multiple peaks-\* skills (solos → rd → qa all share one sid).
875
1613
  - Auto-resume: same callerId reuses the same sid; different callers get different sids in the same `instances` map.
876
1614
  - `dropStale(projectRoot, ttlMs)` for Doctor integration.
877
1615
 
@@ -883,7 +1621,7 @@ The first v2.18.0 release deferred two open items to a redo slice; both are now
883
1621
 
884
1622
  ### Feature — D2 Claude-instance-level hard-exclusive sid
885
1623
 
886
- - Same Claude instance keeps one sid across multiple peaks-* skill activations (peaks-code → peaks-rd → peaks-qa).
1624
+ - Same Claude instance keeps one sid across multiple peaks-\* skill activations (peaks-code → peaks-rd → peaks-qa).
887
1625
  - `/compact` resume: same outer-session-id reuses the same sid (post-compact-resume v2.11.0 D7 alignment).
888
1626
 
889
1627
  ### Feature — Doctor stale-binding scan (AC-10)
@@ -916,7 +1654,7 @@ The first v2.18.0 release deferred two open items to a redo slice; both are now
916
1654
 
917
1655
  Recommended scenarios before next release (see `peaks/_runtime/2026-06-29-session-88411f/txt/handoff-2026-06-29-v2-17-0.md` for details):
918
1656
 
919
- 1. **Multi-Claude parallel提速**: open 2 Claude instances in the same project, run `peaks code <different goal>` in each. Verify both bindings coexist with distinct sids.
1657
+ 1. **Multi-Claude parallel 提速**: open 2 Claude instances in the same project, run `peaks code <different goal>` in each. Verify both bindings coexist with distinct sids.
920
1658
  2. **D1 conflict detection**: 2 instances both targeting the same source file. Verify each writes to its own session-scoped artifact directory.
921
1659
  3. **`/compact` resume**: run `peaks code <goal>`, `/compact`, continue. Verify same sid reused.
922
1660
  4. **Doctor stale**: kill -9 a Claude instance, run `peaks doctor`, verify stale binding listed + `--cleanup-stale` works.
@@ -1032,11 +1770,13 @@ Recommended scenarios before next release (see `peaks/_runtime/2026-06-29-sessio
1032
1770
  - **Per the user-given rule** `.peaks/memory/2026-06-28-full-auto-boundary.md`: "full-auto 只做到 commit 就是,push 不用". The commit-boundary hard-floor is the machine enforcement of that advisory rule.
1033
1771
 
1034
1772
  ### Test results
1773
+
1035
1774
  - 4 new test files: `presence-staleness.test.ts` (12), `stale-presence-detection.test.ts` (9), `feedback-promotion.test.ts` (18), `commit-boundary-hard-floor.test.ts` (247). Total new cases: **286**.
1036
1775
  - Existing code tests (mode-gate × 81, post-compact × 11) pass unchanged.
1037
1776
  - Full unit suite baseline 4394 → 4680 passing (286 added). 0 new failures; pre-existing 7 unrelated failures unchanged.
1038
1777
 
1039
1778
  ### Out-of-scope
1779
+
1040
1780
  - Push / tag / npm publish — full-auto boundary = commit only; the commit-boundary hard-floor now BLOCKS these in full-auto (was advisory). User must explicitly confirm via AskUserQuestion to proceed.
1041
1781
  - `peaks hooks install` — slice is code-only. Hooks remain user-only.
1042
1782
  - Cleaning the 88b27d session's stale presence on disk — slice ships the detection + auto-clear, does NOT proactively touch the live tree.
@@ -1059,12 +1799,14 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1059
1799
  4 个 PRD + 4 个 service + 4 个 CLI 文件 + 4 个 test 文件,共 **17 个新命令 + 63 个新测试通过**。
1060
1800
 
1061
1801
  **G11 上游 tag 同步**(slice-2026-06-28-fork-cli):
1802
+
1062
1803
  - 5 commands: `peaks fork status` / `upstream-check` / `sync-plan` / `sync` / `sync-verify`
1063
1804
  - 持久化 `.peaks/fork-state.json` (baseline + history)
1064
1805
  - `recommendStableTags` 过滤 pre-release 标签(alpha/beta/rc/dev/preview)
1065
1806
  - 15 tests pass
1066
1807
 
1067
1808
  **G13 存量影响面扫描**(slice-2026-06-28-impact-cli):
1809
+
1068
1810
  - 2 commands: `peaks impact scan --files <list>` / `peaks impact must-check --files <list>`
1069
1811
  - 手写 glob 匹配(`**` / `*`),无 AST 依赖
1070
1812
  - 10 个默认业务流(用户管理 / 权限校验 / 登录流程 / Skill 权限 / 数据列表 / API 网关 / DB schema / ...)
@@ -1072,6 +1814,7 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1072
1814
  - 13 tests pass
1073
1815
 
1074
1816
  **G14 轻量回归 critical-paths**(slice-2026-06-28-smoke-cli):
1817
+
1075
1818
  - 4 commands: `peaks smoke define` / `run` / `run-and-repair` / `add-path`
1076
1819
  - 持久化 `.peaks/smoke-paths.json`
1077
1820
  - 5 个 source (prd-business-scenario / boss-stated / historical-incident / impact-must-check / manual)
@@ -1079,6 +1822,7 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1079
1822
  - 16 tests pass
1080
1823
 
1081
1824
  **G15 上线观察期状态机**(slice-2026-06-28-release-cli):
1825
+
1082
1826
  - 7 commands: `peaks release plan` / `canary` / `promote` / `watch` / `done` / `rollback` / `hotfix`
1083
1827
  - 8 阶段状态机: planned → canary-10 → canary-50 → promoted → watching → done
1084
1828
  - side branches: → rolled-back (from any pre-done), → hotfixed (from watching)
@@ -1089,6 +1833,7 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1089
1833
  **触动:** 新增 4 个 service / 4 个 CLI / 4 个 test 文件 = **12 个新文件**。CLI 注册全在 `src/cli/program.ts`,**不触动** transition gates / hard contracts / Karpathy 4 / sub-agent 协议 / mode-gate。
1090
1834
 
1091
1835
  **已知未实现**(后续切片):
1836
+
1092
1837
  - 真实 git fetch + merge(G11)
1093
1838
  - 真实 Playwright 路径执行(G14)
1094
1839
  - 真实 k8s rollout / LB config / 监控集成(G15)
@@ -1098,23 +1843,27 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1098
1843
  4 个 service + 4 个 CLI 文件 + 4 个 test 文件,共 **16 个新命令 + 40+ 个新测试通过**。所有 CLI 都遵循 12 Gaps 核心原则: user 在循环里 = 业务/产品审阅,不参与技术决策。
1099
1844
 
1100
1845
  **G3 prd 4 必填块**(slice-2026-06-28-prd-blocks):
1846
+
1101
1847
  - `peaks prd check-blocks <rid>` — 验证 4 必填块(业务场景/边界/UI 装配/上游基线)+ 业务禁区子节
1102
1848
  - 上游基线仅在 fork 项目上 required(检测 `.peaks/fork-state.json`)
1103
1849
  - 8 tests pass
1104
1850
 
1105
1851
  **G4 user touchpoint classifier**(slice-2026-06-28-user-touchpoints):
1852
+
1106
1853
  - 3 commands: `peaks code gate-classify` / `peaks code user-touchpoints` / `peaks code commit-boundary-actions`
1107
1854
  - 14 个 Code gate 静态分类: business / tech / mode-selection / commit-boundary / commit-floor
1108
1855
  - `userShouldReview`: always / business-only / never
1109
1856
  - 7 tests pass
1110
1857
 
1111
1858
  **G1 slice 业务审阅**(slice-2026-06-28-slice-review):
1859
+
1112
1860
  - 4 commands: `peaks slice review` / `score` / `accept` / `reject`
1113
1861
  - 4 个默认 review item: business-match / boundary-cases / ui-assembly / mergeable
1114
1862
  - 12 Gaps 阈值: avg >= 3 AND no item <= 2 → accepted
1115
1863
  - 16 tests pass
1116
1864
 
1117
1865
  **G5 QA 业务视角验收**(slice-2026-06-28-qa-business):
1866
+
1118
1867
  - 4 commands: `peaks qa business-review` / `business-score` / `business-accept` / `business-reject`
1119
1868
  - 6 个默认 review item: business-flow / req-coverage / boundary-cases / ui-assembly / exception-tone / mergeable
1120
1869
  - 同一阈值(avg >= 3, no item <= 2)
@@ -1127,29 +1876,35 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1127
1876
  5 个 PRD 一次性收尾剩余 5 个 Gaps。每 G 一个 service + CLI + test,**10 个新文件 + 30+ 个新测试通过**。
1128
1877
 
1129
1878
  **G6 跨 slice 集成**(slice-2026-06-28-slice-integrate):
1879
+
1130
1880
  - `peaks slice-integrate --slices <id1,id2,...>` — 验证多个 slice 的公共契约不冲突(重复 export / signature drift)
1131
1881
  - 5 tests pass
1132
1882
 
1133
1883
  **G7 文档自动化**(slice-2026-06-28-doc):
1884
+
1134
1885
  - `peaks doc generate-skill --name --from <commands-dir>` — 扫描 program.command() 自动生成 SKILL.md skeleton
1135
1886
  - `peaks doc changelog-suggest --since <ref>` — git log 解析 conventional commit + 生成 [Unreleased] 块
1136
1887
  - 6 tests pass
1137
1888
 
1138
1889
  **G8 存量代码 smell 扫描**(slice-2026-06-28-legacy):
1890
+
1139
1891
  - `peaks legacy-detect --dir <path>` — TODO/FIXME/HACK/console.log/any-type/large-file/ts-ignore 启发式扫描
1140
1892
  - 5 tests pass
1141
1893
 
1142
1894
  **G9 角色 RBAC**(slice-2026-06-28-role):
1895
+
1143
1896
  - `peaks role list/add/grant/check` — 4 命令,持久化 .peaks/role-registry.json
1144
1897
  - `--preset senior-fe` 一键预置 12 Gaps 高级前端权限
1145
1898
  - 5 tests pass
1146
1899
 
1147
1900
  **G10 复杂度估算**(slice-2026-06-28-complexity):
1901
+
1148
1902
  - `peaks complexity-estimate --files <list>` — 按 LOC + exports + async 估算 trivial/simple/complex
1149
1903
  - 与 G2 字段(complexity tier)对齐,驱动 user-attended vs overnight 排程
1150
1904
  - 5 tests pass
1151
1905
 
1152
1906
  **Dogfood 验证(ice-cola NestJS 项目):**
1907
+
1153
1908
  - peaks legacy-detect (164 文件, smells=high, 406 个 any-type, 15 个 large-file)
1154
1909
  - peaks role add senior-fe --preset senior-fe + role list + role check (granted/not)
1155
1910
  - peaks complexity-estimate (auth files → complex, 41 lines + hasAsync)
@@ -1174,6 +1929,7 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1174
1929
  - `tests/unit/services/context/tokenizer.test.ts:23` — `fetchedAt` 硬编码 `2026-06-21` 距今 7 天触发 `timeDecayScore 0.886 < 0.9` 期望,改 `new Date().toISOString()` 符合"fresh fetch"测试意图
1175
1930
 
1176
1931
  **测试结果:**
1932
+
1177
1933
  - silent-warning-detector: 2 violations → 0
1178
1934
  - `tests/unit/services/context/`: 49/50 → 50/50
1179
1935
  - 全量 vitest 4819 tests:3 failed → 2 failed(剩下 2 个是并发 race condition,单跑 context 50/50 全过,pre-existing)
@@ -1185,19 +1941,23 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1185
1941
  **PATCH bump from 2.14.1** (slice `2026-06-28-tilde-peaks-p3p4`). Closes P3 + P4 from `.peaks/memory/2026-06-28-tilde-peaks-inventory.md`.
1186
1942
 
1187
1943
  ### Cleanup
1944
+
1188
1945
  - **`skills/peaks-companion/`** — REMOVED. Skill was dead: SKILL.md documented `peaks companion status/install/setup/start` but no CLI implementation existed (`src/services/companion/` not present, `peaks --help` had no companion entry). Empty `~/.peaks/companion/` directory is no longer expected to receive `cc-connect.log` writes.
1189
1946
  - **`tests/unit/skills/peaks-companion.test.ts`** — REMOVED (9 cases). The companion skill-count assertion (19 → 18 skills) is now verified by `tests/unit/skills/skill-count.test.ts` (already covers the meta count, not companion specifically).
1190
1947
  - **`.peaks/memory/peaks-companion-*.md`** — REMOVED (4 files: `cc-connect-dogfood-2026-06-15`, `qr-autoopen-2026-06-15`, `qr-inline-display-2026-06-15`, `watcher-ecs-url-config`). Historical dogfood records, no longer relevant.
1191
1948
 
1192
1949
  ### Refactor
1950
+
1193
1951
  - **`~/.peaks/providers.json`** (NEW sidecar) — MiniMax provider config migrated from deprecated `~/.peaks/config.json.providers` to canonical `~/.peaks/providers.json` per `provider-service.ts` schema. The slim `config.json` (per `config-types.ts`) no longer carries the `providers` field.
1194
1952
  - **MiniMax model field preserved** — `~/.peaks/providers.json.providers.minimax.model = "minimax-2.7"`; `peaks config provider minimax get/status` continue to report correctly via the back-compat fallback in `provider-service.ts`.
1195
1953
 
1196
1954
  ### Test results
1955
+
1197
1956
  - `pnpm vitest run tests/unit/doctor.test.ts` — 50/50 pass
1198
1957
  - `pnpm vitest run` full unit suite — `peaks-companion.test.ts` no longer runs; total cases drop from 4418 → 4409. Pre-existing failures (`doctor.test.ts` × 0, `tokenizer.test.ts` × 1, `35-checks-aggregate.test.ts` × 1) unchanged.
1199
1958
 
1200
1959
  ### Out-of-scope
1960
+
1201
1961
  - Push / tag / npm publish — full-auto mode boundary = commit only; user-only.
1202
1962
  - Re-implementing peaks-companion CLI — user chose delete over revive.
1203
1963
  - Cleaning `~/.peaks/companion/` empty dir — left in place; harmless.
@@ -1209,14 +1969,17 @@ slice-2026-06-28-layered-dag PRD: 大需求(1 周内做不完)= 基础先行 +
1209
1969
  **PATCH bump from 2.14.0** (carry-forward from v2.13.3 AC-2 partial fix + npm 11.x config rename).
1210
1970
 
1211
1971
  ### Bug fixes
1972
+
1212
1973
  - `scripts/prepublish-build.mjs` — use `execFileSync('pnpm', ['run', 'build'])` (no shell) with Windows fallback to `prepublish-build.ps1` (proven dogfood). Eliminates the v2.13.4 partial-fix `spawnSync cmd.exe ENOENT` on Node 22 + Windows native.
1213
1974
  - `.npmrc` (NEW, repo-local template) — documents that `https_proxy` (underscore) is NO LONGER VALID in npm 11.x; use `https-proxy` or `proxy`. User-global `~/.npmrc` may still have `https_proxy`; npm 11.x warns, npm 12 will error.
1214
1975
 
1215
1976
  ### Test results
1977
+
1216
1978
  - `tests/unit/scripts/prepublish-build.test.ts` (NEW, 6 cases) — covers execFile happy path + Windows ps1 fallback + error propagation + version validation + ENOENT regression
1217
1979
  - `node scripts/prepublish-build.mjs` end-to-end: `[prepublish-build] build OK` exit 0 (verified on this Windows session)
1218
1980
 
1219
1981
  ### Out-of-scope
1982
+
1220
1983
  - Do NOT modify user-global `~/.npmrc` (user-only boundary); user must run `npm config delete https_proxy` themselves if they want to silence the warning before npm 12.
1221
1984
 
1222
1985
  ---
@@ -1337,7 +2100,7 @@ The four defects all stem from the v2.13.0 two-axis convention landing debt: the
1337
2100
 
1338
2101
  **PATCH bump from 2.13.2** (slice `2026-06-27-verdict-aggregator-v2-12-debt`, red-line scope 7 source files + 3 test files modified + 3 new scripts + 1 package.json hook).
1339
2102
 
1340
- 2.13.2 dogfood surfaced 4 bugs that all stem from v2.12.0 envelope-schema落地 debt: the v2.12.0 audit artifacts (`audit/security.md`, `audit/perf.md`) are YAML-frontmatter + markdown, but v2.13.2's `parseSecurityEnvelope` / `parsePerfEnvelope` used `JSON.parse` (which is the wrong shape). v2.13.3 also fixes a cross-version publish-pipeline issue (`bin/peaks.js` was shipping a Jun 13 stale dist because `prepublishOnly` was never wired) and adds a soft-block-warning surface in the CLI so users can see v2.13.2's `mut-report-missing-deprecated-in-v2.14.0` warning instead of having it silently downgraded in service-layer.
2103
+ 2.13.2 dogfood surfaced 4 bugs that all stem from v2.12.0 envelope-schema 落地 debt: the v2.12.0 audit artifacts (`audit/security.md`, `audit/perf.md`) are YAML-frontmatter + markdown, but v2.13.2's `parseSecurityEnvelope` / `parsePerfEnvelope` used `JSON.parse` (which is the wrong shape). v2.13.3 also fixes a cross-version publish-pipeline issue (`bin/peaks.js` was shipping a Jun 13 stale dist because `prepublishOnly` was never wired) and adds a soft-block-warning surface in the CLI so users can see v2.13.2's `mut-report-missing-deprecated-in-v2.14.0` warning instead of having it silently downgraded in service-layer.
1341
2104
 
1342
2105
  ### Bug fixes
1343
2106
 
@@ -1373,9 +2136,9 @@ The four defects all stem from the v2.13.0 two-axis convention landing debt: the
1373
2136
 
1374
2137
  ### Multi-CC commit boundaries
1375
2138
 
1376
- | Commit tag | Scope |
1377
- |---|---|
1378
- | v2.13.3 | 4 bug fixes (parser / publish pipeline / CLI warnings / handoff sha256) + 3 new scripts + 4 new test cases + package.json prepublishOnly + README publish note + CHANGELOG + version bump + ship-state memory |
2139
+ | Commit tag | Scope |
2140
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2141
+ | v2.13.3 | 4 bug fixes (parser / publish pipeline / CLI warnings / handoff sha256) + 3 new scripts + 4 new test cases + package.json prepublishOnly + README publish note + CHANGELOG + version bump + ship-state memory |
1379
2142
 
1380
2143
  ### Verified (peaks code dogfood + QA on this session)
1381
2144
 
@@ -1451,9 +2214,9 @@ v2.13.1 shipped with a BLOCKER bug found via post-release dogfood: `aggregateVer
1451
2214
 
1452
2215
  ### Multi-CC commit boundaries
1453
2216
 
1454
- | Commit tag | Scope |
1455
- |---|---|
1456
- | v2.13.2 | `aggregateVerdict()` dedup bug fix + `peaks verdict aggregate` CLI + `envelopes.ts` unification + `prd/handoff.md` auto-regen + `MUT_REPORT` soft-block window + 4 new test files + 4 updated test files + CHANGELOG + version bump + ship-state memory |
2217
+ | Commit tag | Scope |
2218
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2219
+ | v2.13.2 | `aggregateVerdict()` dedup bug fix + `peaks verdict aggregate` CLI + `envelopes.ts` unification + `prd/handoff.md` auto-regen + `MUT_REPORT` soft-block window + 4 new test files + 4 updated test files + CHANGELOG + version bump + ship-state memory |
1457
2220
 
1458
2221
  ### Verified (peaks code dogfood + QA on this session)
1459
2222
 
@@ -1515,9 +2278,9 @@ peaks-code previously received 5 heterogeneous signals (security-audit, perf-aud
1515
2278
 
1516
2279
  ### Multi-CC commit boundaries
1517
2280
 
1518
- | Commit tag | Scope |
1519
- |---|---|
1520
- | v2.13.1 | MUT_REPORT prereq + `aggregateVerdict()` service + `## Verdict reasoning` section + 4 new test files + 2 updated test files + CHANGELOG + version bump + ship-state memory |
2281
+ | Commit tag | Scope |
2282
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2283
+ | v2.13.1 | MUT_REPORT prereq + `aggregateVerdict()` service + `## Verdict reasoning` section + 4 new test files + 2 updated test files + CHANGELOG + version bump + ship-state memory |
1521
2284
 
1522
2285
  ### Verified (peaks code dogfood on this session)
1523
2286
 
@@ -1581,10 +2344,10 @@ Adapter-driven protocol (no hard-coded IDE names): `IdeAdapter.compact?: IdeComp
1581
2344
 
1582
2345
  ### Multi-CC commit boundaries
1583
2346
 
1584
- | Commit tag | Scope |
1585
- |---|---|
2347
+ | Commit tag | Scope |
2348
+ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1586
2349
  | v2.13.0-alpha.1 (`edffc33`) | Two-tier threshold + auto-compact types + reader + dispatcher + orchestrator + Claude Code MVP adapter + `peaks code context-now` + `peaks code auto-compact` CLI |
1587
- | `a8b9804` | In-session dogfood limitation documented (current ad-hoc Claude Code session cannot be externally compacted — reserved for follow-up PreToolUse-hook slice) |
2350
+ | `a8b9804` | In-session dogfood limitation documented (current ad-hoc Claude Code session cannot be externally compacted — reserved for follow-up PreToolUse-hook slice) |
1588
2351
 
1589
2352
  ### Verified (peaks code dogfood on this session)
1590
2353
 
@@ -1595,7 +2358,7 @@ Adapter-driven protocol (no hard-coded IDE names): `IdeAdapter.compact?: IdeComp
1595
2358
  - `post-compact-detect` after pre-compact: `shouldAutoResume: true`, `reason: post-compact-match` ✓
1596
2359
  - Trae IDE (no `compact` profile): `ratio: 0` + `source: conservative-fallback` + `below-threshold` (no auto-fire on missing signal — by design) ✓
1597
2360
  - `pnpm tsc --noEmit`: clean
1598
- - `pnpm vitest run` (full suite): `4317 / 4317` pass + 17 skipped (2 pre-existing baseline failures on session-checkpoint + _archive-removal-guard unchanged)
2361
+ - `pnpm vitest run` (full suite): `4317 / 4317` pass + 17 skipped (2 pre-existing baseline failures on session-checkpoint + \_archive-removal-guard unchanged)
1599
2362
 
1600
2363
  ### Out-of-scope (NOT changed)
1601
2364
 
@@ -1652,17 +2415,17 @@ v2.13.0 hard-deletes the legacy paths.
1652
2415
 
1653
2416
  ### Multi-CC commit boundaries
1654
2417
 
1655
- | Group | Tiers | Commit tag | Scope |
1656
- |---|---|---|---|
1657
- | A | 1+2+3 | v2.12.0-alpha.1 | Templates + new skills (fa082f5) |
1658
- | B | 4+5 | v2.12.0-alpha.2 | 5→3 fanout collapse + prereq migration (6485f1c) |
1659
- | C | 6 | v2.12.0-alpha.3 | peaks-txt sediment extension (ab2757b) |
1660
- | D | 7 | v2.12.0-alpha.4 | fan-out SKILL.md updates (b6c4fae) |
1661
- | E | 8+9 | v2.12.0 (release) | Decision records + migration + CHANGELOG + version bump (this commit) |
2418
+ | Group | Tiers | Commit tag | Scope |
2419
+ | ----- | ----- | ----------------- | --------------------------------------------------------------------- |
2420
+ | A | 1+2+3 | v2.12.0-alpha.1 | Templates + new skills (fa082f5) |
2421
+ | B | 4+5 | v2.12.0-alpha.2 | 5→3 fanout collapse + prereq migration (6485f1c) |
2422
+ | C | 6 | v2.12.0-alpha.3 | peaks-txt sediment extension (ab2757b) |
2423
+ | D | 7 | v2.12.0-alpha.4 | fan-out SKILL.md updates (b6c4fae) |
2424
+ | E | 8+9 | v2.12.0 (release) | Decision records + migration + CHANGELOG + version bump (this commit) |
1662
2425
 
1663
2426
  ### Zero regression (verified per group)
1664
2427
 
1665
- Each Group A→D ran the full RD→QA loop independently. Group C final QA: 14/14 sediment tests pass + 39/39 prd service tests pass; 9 pre-existing baseline failures unchanged (doctor / _archive-removal-guard / request-commands / observability / session-checkpoint / tech-service / workflow-autonomous-resume / jsonl-store / 35-checks-aggregate — all unrelated to v2.12.0). Group D final QA: 35/35 fan-out SKILL.md contract tests pass; same 9 pre-existing baseline failures.
2428
+ Each Group A→D ran the full RD→QA loop independently. Group C final QA: 14/14 sediment tests pass + 39/39 prd service tests pass; 9 pre-existing baseline failures unchanged (doctor / \_archive-removal-guard / request-commands / observability / session-checkpoint / tech-service / workflow-autonomous-resume / jsonl-store / 35-checks-aggregate — all unrelated to v2.12.0). Group D final QA: 35/35 fan-out SKILL.md contract tests pass; same 9 pre-existing baseline failures.
1666
2429
 
1667
2430
  ### Out-of-scope (NOT changed)
1668
2431
 
@@ -1843,6 +2606,7 @@ LLM was creating top-level `.peaks/_runtime/<change-id>/` siblings of `.peaks/_r
1843
2606
  - Bumps `package.json#version` from 2.9.1 to 2.9.2
1844
2607
 
1845
2608
  **Pre-existing violations preserved as-is** (intentional historical/forbidden documentation, all explicitly labeled):
2609
+
1846
2610
  - 6 ban-explanation memory files under `.peaks/memory/` (slice 005 / 2.8.3 / 2.7.1 lessons)
1847
2611
  - 28 historic session files under `.peaks/_runtime/2026-06-*/`
1848
2612
  - 5 historic dispatch records under `.peaks/_sub_agents/`
@@ -1939,37 +2703,37 @@ the four-step recipe; no data is lost.
1939
2703
  final root-out of a 2.8.0-era orphan (`.peaks/2026-06-22-cc-connect-orphan-cleanup/`,
1940
2704
  4 files, 28 KB, untracked) and pins the rule across FOUR layers so a
1941
2705
  regression cannot survive:
1942
- 1. **`.gitignore` fnmatch rule** —
1943
- `.peaks/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*/` blocks any
1944
- future untracked date-prefix sibling at `.peaks/_runtime/<seg>/`. Path-anchored
1945
- so it does not over-match (`.peaks/_runtime/<date>/` is still ignored
1946
- by the existing `.peaks/_runtime/` rule, not this one).
1947
- 2. **Vitest guard** at
1948
- `tests/unit/workspace/top-level-change-id-guard.test.ts` (8 cases)
1949
- pins the gitignore rule literal, asserts fnmatch matches a synthetic
1950
- candidate, asserts it does NOT match `.peaks/_runtime/-nested`
1951
- candidates, scans the live working tree for orphan date-prefix
1952
- siblings, scans `git ls-files` for tracked escapes, asserts both
1953
- `CLAUDE.md` and `.peaks/PROJECT.md` carry the ban wording, AND
1954
- asserts the CLI help text (`init-command.ts`) teaches the
1955
- `.peaks/_runtime/current-change` binding path + the four
1956
- migration verbs (inspect / move / delete / unlink / re-run).
1957
- 3. **Source-code redirect** —
1958
- `src/shared/change-id.ts#setCurrentChangeId` now defaults to
1959
- `{ form: 'file' }` (was `'symlink'`); the file form writes ONLY
1960
- `.peaks/_runtime/current-change` and never creates
1961
- `.peaks/_runtime/<changeId>/`. The legacy `'symlink'` form is kept for
1962
- back-compat reads but is no longer written by `peaks workspace init`.
1963
- `src/services/workspace/workspace-service.ts#initWorkspace`
1964
- pre-flights the existence of `.peaks/_runtime/<changeId>/` and throws
1965
- `LegacyChangeIdSiblingError` if found.
1966
- 4. **CLI help-text guard** — `src/cli/commands/workspace/init-command.ts`
1967
- rewrites the `init` command description and `--change-id` option
1968
- description so an LLM reading `peaks workspace init --help` is
1969
- taught the correct path (`.peaks/_runtime/current-change`) instead
1970
- of the legacy `.peaks/_runtime/<change-id>/` sibling dir. A new catch block
1971
- surfaces `LegacyChangeIdSiblingError` with the 4-step migration
1972
- recipe in the JSON envelope.
2706
+ 1. **`.gitignore` fnmatch rule** —
2707
+ `.peaks/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*/` blocks any
2708
+ future untracked date-prefix sibling at `.peaks/_runtime/<seg>/`. Path-anchored
2709
+ so it does not over-match (`.peaks/_runtime/<date>/` is still ignored
2710
+ by the existing `.peaks/_runtime/` rule, not this one).
2711
+ 2. **Vitest guard** at
2712
+ `tests/unit/workspace/top-level-change-id-guard.test.ts` (8 cases)
2713
+ pins the gitignore rule literal, asserts fnmatch matches a synthetic
2714
+ candidate, asserts it does NOT match `.peaks/_runtime/-nested`
2715
+ candidates, scans the live working tree for orphan date-prefix
2716
+ siblings, scans `git ls-files` for tracked escapes, asserts both
2717
+ `CLAUDE.md` and `.peaks/PROJECT.md` carry the ban wording, AND
2718
+ asserts the CLI help text (`init-command.ts`) teaches the
2719
+ `.peaks/_runtime/current-change` binding path + the four
2720
+ migration verbs (inspect / move / delete / unlink / re-run).
2721
+ 3. **Source-code redirect** —
2722
+ `src/shared/change-id.ts#setCurrentChangeId` now defaults to
2723
+ `{ form: 'file' }` (was `'symlink'`); the file form writes ONLY
2724
+ `.peaks/_runtime/current-change` and never creates
2725
+ `.peaks/_runtime/<changeId>/`. The legacy `'symlink'` form is kept for
2726
+ back-compat reads but is no longer written by `peaks workspace init`.
2727
+ `src/services/workspace/workspace-service.ts#initWorkspace`
2728
+ pre-flights the existence of `.peaks/_runtime/<changeId>/` and throws
2729
+ `LegacyChangeIdSiblingError` if found.
2730
+ 4. **CLI help-text guard** — `src/cli/commands/workspace/init-command.ts`
2731
+ rewrites the `init` command description and `--change-id` option
2732
+ description so an LLM reading `peaks workspace init --help` is
2733
+ taught the correct path (`.peaks/_runtime/current-change`) instead
2734
+ of the legacy `.peaks/_runtime/<change-id>/` sibling dir. A new catch block
2735
+ surfaces `LegacyChangeIdSiblingError` with the 4-step migration
2736
+ recipe in the JSON envelope.
1973
2737
  - **`CLI_VERSION`** sync bumped 2.8.2 → 2.8.3 (regenerated via
1974
2738
  `scripts/sync-version.mjs` from `package.json#version`).
1975
2739
 
@@ -2095,7 +2859,7 @@ are unchanged by this release), `pnpm build` clean.
2095
2859
  `src/services/companion/*` module + `src/cli/commands/companion.ts`
2096
2860
  CLI + 14 `tests/unit/companion/*` test files are removed
2097
2861
  (~7,700 lines deleted, 0 added). The `peaks companion install|setup|
2098
- start|stop|bind|status|restart|verify|token|qr` command tree is gone
2862
+ start|stop|bind|status|restart|verify|token|qr` command tree is gone
2099
2863
  along with the `peaks scan companion-binary` sub-command and the
2100
2864
  `capability:companion-binary-resolution` doctor check. Companion
2101
2865
  types (`CompanionConfig`, `CompanionWeixinConfig`, `CompanionChannel`,
@@ -2123,7 +2887,7 @@ are unchanged by this release), `pnpm build` clean.
2123
2887
  - **`@alibaba-group/open-code-review` is now a peer dependency** —
2124
2888
  moved from `optionalDependencies` to `peerDependencies` with
2125
2889
  `peerDependenciesMeta."@alibaba-group/open-code-review".optional =
2126
- true`. The peer hint lets npm skip the optional resolution entirely
2890
+ true`. The peer hint lets npm skip the optional resolution entirely
2127
2891
  during global install; users who want second-opinion reviews via
2128
2892
  `peaks code-review run-ocr` install it manually with
2129
2893
  `npm i -g @alibaba-group/open-code-review`. Install hint copy in
@@ -2155,8 +2919,8 @@ are unchanged by this release), `pnpm build` clean.
2155
2919
  - **Defense-in-depth comment cites H6 verbatim (Plan 5 R1-W3 MED)** —
2156
2920
  `src/services/rd/impl.ts` defense-in-depth check now cites spec H6
2157
2921
  (CLI 计算裁决) directly. The accompanying `docs/superpowers/specs/
2158
- 2026-06-21-context-audit-redesign-design.md` gained a new §4.3
2159
- *战术审计* subsection that consolidates §3.2 / §3.3 / H6 / H8 / Phase 3
2922
+ 2026-06-21-context-audit-redesign-design.md` gained a new §4.3
2923
+ _战术审计_ subsection that consolidates §3.2 / §3.3 / H6 / H8 / Phase 3
2160
2924
  AC-2 into a single canonical anchor (previous code references to
2161
2925
  `§4.2` updated to `§4.3`).
2162
2926
 
@@ -2173,7 +2937,7 @@ are unchanged by this release), `pnpm build` clean.
2173
2937
  is in the test name, not just the body.
2174
2938
 
2175
2939
  - **Atomic-write crash test (Plan 5 R1-W5 LOW)** — new test
2176
- *unlinks .tmp when rename throws* pins the catch→unlink fallback in
2940
+ _unlinks .tmp when rename throws_ pins the catch→unlink fallback in
2177
2941
  `writeImpl` (EISDIR-triggered real-rename failure). Mutation probe
2178
2942
  KILLED: commenting out the unlink makes the test fail at the
2179
2943
  `existsSync(tmp)` assertion.
@@ -2275,7 +3039,7 @@ are unchanged by this release), `pnpm build` clean.
2275
3039
  `C:\Users\name\.trae\agents` and a Mac user gets
2276
3040
  `/Users/name/.trae/agents`. No hardcoded `/Users/...` or `C:\...` in
2277
3041
  any 5-IDE `awaitBatch` path. The 4 new IDE paths (`trae / trae-cn /
2278
- codex / cursor`) follow the same discipline.
3042
+ codex / cursor`) follow the same discipline.
2279
3043
  - **`runDag` cancel-on-fail correctness (slice 1.2.c)** — when any leaf
2280
3044
  fails, in-flight sub-agents in the same batch receive a cancel signal
2281
3045
  at the envelope level; the orchestrator no longer waits for them to
@@ -2366,11 +3130,11 @@ are unchanged by this release), `pnpm build` clean.
2366
3130
  4. `scanExportsInFile` now matches `export default function name()`
2367
3131
  and `export default class Name`; `importedNameCount` now treats
2368
3132
  re-exports (`export { x } from './y'`, `export type { T } from
2369
- './y'`) as consumer references.
2370
- Bonus: `OrphanScanOptions.baseRef` lets the scan diff against an
2371
- arbitrary git ref (default: `HEAD`) for branch-vs-main reviews.
3133
+ './y'`) as consumer references.
3134
+ Bonus: `OrphanScanOptions.baseRef` lets the scan diff against an
3135
+ arbitrary git ref (default: `HEAD`) for branch-vs-main reviews.
2372
3136
  - **karpathy-service code-fence skip (Slice 2.6.1.B)** — `peaks scan
2373
- karpathy` no longer flags anti-pattern phrases (TODO, "should be
3137
+ karpathy` no longer flags anti-pattern phrases (TODO, "should be
2374
3138
  fine", "maybe", "probably") when they appear inside fenced markdown
2375
3139
  code blocks. Illustrative code snippets were eroding trust in the
2376
3140
  structural scanner. The 4 guideline-marker tests
@@ -2393,7 +3157,7 @@ are unchanged by this release), `pnpm build` clean.
2393
3157
  byte-identical.
2394
3158
  - **KARPATHY_REVIEW heading-anchored gate (Slice 2.6.1.F)** — the L3
2395
3159
  LOW (the 4 guideline `mustContain` substring markers could be
2396
- spoofed by any file that just *mentioned* the marker names as
3160
+ spoofed by any file that just _mentioned_ the marker names as
2397
3161
  prose) is fixed by a new `headingMustContain: string[]` field on
2398
3162
  `ArtifactPrerequisite`. `KARPATHY_REVIEW` now requires each of
2399
3163
  the 4 guidelines to appear as an actual markdown heading
@@ -2410,8 +3174,7 @@ are unchanged by this release), `pnpm build` clean.
2410
3174
 
2411
3175
  - **L2-install dogfood verification (Slice 2.6.1.D)** — confirmed
2412
3176
  end-to-end on a temp HOME that the 2.6.0 tarball's `postinstall`
2413
- creates `~/.claude/agents/karpathy-reviewer.md` (15.4 KB, mode
2414
- 0600) and the matching `.peaks-managed` marker (245 bytes, JSON
3177
+ creates `~/.claude/agents/karpathy-reviewer.md` (15.4 KB, mode 0600) and the matching `.peaks-managed` marker (245 bytes, JSON
2415
3178
  with `version`, `kind`, `agentName`, `sourcePath`, `contentSha256`).
2416
3179
  The 8-platform skill fan-out also confirmed (codex, cursor, trae,
2417
3180
  trae-cn, qoder, tongyi-lingma, hermes, openclaw). After Slice E,
@@ -2441,7 +3204,7 @@ are unchanged by this release), `pnpm build` clean.
2441
3204
  title-case section markers (Think Before Coding / Simplicity First /
2442
3205
  Surgical Changes / Goal-Driven Execution). CLI error code
2443
3206
  `PREREQUISITES_MISSING`. Escape hatch: `peaks request transition
2444
- --allow-incomplete --confirm` (assisted mode).
3207
+ --allow-incomplete --confirm` (assisted mode).
2445
3208
  - **Karpathy prompt-injection across the full RD surface** (slice 1) —
2446
3209
  4-layer guard: SKILL.md body + 3 reference docs
2447
3210
  (`mandatory-tech-doc.md`, `rd-fanout-contracts.md`,
@@ -2463,7 +3226,7 @@ are unchanged by this release), `pnpm build` clean.
2463
3226
  endpoints / components / stores / mocks in the consumer project
2464
3227
  before any new code is written. `--project --format --scope --max-per-kind`
2465
3228
  options; output feeds the tech-doc's `## Existing API or Component
2466
- Inventory` section. New service
3229
+ Inventory` section. New service
2467
3230
  `src/services/scan/api-surface-service.ts` (~280 lines).
2468
3231
  - **`peaks scan orphan` CLI** (slice 4) — 4-kind orphan detection
2469
3232
  (exportOrphan / importOrphan / cliSubcommandOrphan /
@@ -2580,8 +3343,8 @@ are unchanged by this release), `pnpm build` clean.
2580
3343
  `references/checkpoint-resume.md` + `references/periodic-checkpoint.md`, but
2581
3344
  SKILL.md body only mentioned them in a single line. New Claude Code sessions
2582
3345
  that load SKILL.md never learned the optimization existed. `### Peaks-Loop
2583
- Step 0.75: Resume from checkpoint` and `### Peaks-Loop Step N: Periodic
2584
- checkpoint` headings are now in the body (≥ 5 lines each), with explicit
3346
+ Step 0.75: Resume from checkpoint` and `### Peaks-Loop Step N: Periodic
3347
+ checkpoint` headings are now in the body (≥ 5 lines each), with explicit
2585
3348
  `peaks session checkpoint` / `peaks session resume` CLI mentions and
2586
3349
  reference-doc pointers. Byte cap bumped 22K → 24K (precedent: 18K → 20K → 22K).
2587
3350
  - **`peaks test <pattern...>` CLI with smart cache** (sub-fix B) — new CLI
@@ -2690,7 +3453,7 @@ are unchanged by this release), `pnpm build` clean.
2690
3453
  (~/.claude/skills + ~/.claude/output-styles)" and writes to
2691
3454
  `~/.claude/skills/`.
2692
3455
  - Byte-stability: `git diff
2693
- src/services/ide/adapters/{claude-code,trae}-adapter.ts` returns
3456
+ src/services/ide/adapters/{claude-code,trae}-adapter.ts` returns
2694
3457
  empty (AC8 / AC15 ✓). Dispatch chokepoints `resource-profile.ts` /
2695
3458
  `ide-aware-standards-service.ts` / `install-skills.mjs` untouched
2696
3459
  (R6 inverse rule ✓).
@@ -2785,6 +3548,7 @@ are unchanged by this release), `pnpm build` clean.
2785
3548
  registered SOP gate.
2786
3549
 
2787
3550
  Concrete changes:
3551
+
2788
3552
  - `src/services/workspace/claude-settings-template.ts` — deleted
2789
3553
  `PEAKS_SUBCOMMAND_ALLOWLIST`, `buildBashHookCommand()`. The
2790
3554
  template now emits only the `Write|Edit|MultiEdit` matcher.
@@ -2837,11 +3601,12 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
2837
3601
  - **`headroom-ai` preferences resolver** — `src/services/context/headroom-prefs.ts` with
2838
3602
  `resolveHeadroomOptions` and `shouldCompressResults` (pure functions, no IO). Sub-agent
2839
3603
  dispatch now reads `loadPreferences().headroom` and:
2840
- - Hard-blocks `--use-headroom` when `headroom.enabled = false` (new error code
2841
- `HEADROOM_DISABLED_BY_PREFERENCE`, exit 1).
2842
- - Respects `--headroom-mode <m>` CLI override > `perTouchpoint.subAgentDispatch` >
2843
- `defaultMode` precedence.
2844
- - Falls back to G7 metadata-only on any preferences load failure (no dispatch break).
3604
+
3605
+ - Hard-blocks `--use-headroom` when `headroom.enabled = false` (new error code
3606
+ `HEADROOM_DISABLED_BY_PREFERENCE`, exit 1).
3607
+ - Respects `--headroom-mode <m>` CLI override > `perTouchpoint.subAgentDispatch` >
3608
+ `defaultMode` precedence.
3609
+ - Falls back to G7 metadata-only on any preferences load failure (no dispatch break).
2845
3610
 
2846
3611
  - **New preferences fields** — `headroom.perTouchpoint.subAgentDispatch` and
2847
3612
  `headroom.compressMinBytes` (default 4096). Shallow-merge on existing
@@ -2971,7 +3736,7 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
2971
3736
 
2972
3737
  - The "one rid = one feature" pattern. From 2.1.1 onward, the
2973
3738
  recommended workflow is: PRD -> `peaks slice decompose` -> `peaks
2974
- slice pick` (interactive) -> `peaks slice plan` -> N child rids.
3739
+ slice pick` (interactive) -> `peaks slice plan` -> N child rids.
2975
3740
  Legacy `--type`-based fan-out still works as a fallback for rids
2976
3741
  that pre-date the algorithm.
2977
3742
 
@@ -3049,10 +3814,10 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
3049
3814
  (canonical home: proxy-service.ts).
3050
3815
  - `~/.peaks/workspaces.json` — registered workspaces + current-workspace
3051
3816
  pointer (canonical home: workspace-state-service.ts).
3052
- On-disk legacy bloat is auto-detected and promoted to the correct
3053
- sidecar on next CLI invocation; the slim `config.json` is then
3054
- rewritten. The migration is **idempotent and silent** — no user
3055
- action required.
3817
+ On-disk legacy bloat is auto-detected and promoted to the correct
3818
+ sidecar on next CLI invocation; the slim `config.json` is then
3819
+ rewritten. The migration is **idempotent and silent** — no user
3820
+ action required.
3056
3821
  - **`peaks config migrate --apply` distributes legacy fields across
3057
3822
  their canonical homes.** `economyMode` / `swarmMode` continue to
3058
3823
  forward to `<project>/.peaks/preferences.json`; `providers` /
@@ -3071,9 +3836,9 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
3071
3836
 
3072
3837
  - **New `src/services/config/sidecar-store.ts`** — path helpers
3073
3838
  (`providersConfigPath()`, `proxyConfigPath()`, `workspacesConfigPath()`)
3074
- + generic `readSidecarJson<T>` / `writeSidecarJson` with the same
3075
- hardened-fs guarantees as `config-safety.ts` (symlink / hardlink
3076
- guards, atomic temp-file rename, 0o600 mode).
3839
+ - generic `readSidecarJson<T>` / `writeSidecarJson` with the same
3840
+ hardened-fs guarantees as `config-safety.ts` (symlink / hardlink
3841
+ guards, atomic temp-file rename, 0o600 mode).
3077
3842
  - **New `src/services/config/provider-service.ts`** —
3078
3843
  `getMiniMaxProviderConfig()`, `setMiniMaxProviderConfig()`,
3079
3844
  `getMiniMaxProviderStatus()`, `getAllProviders()`,
@@ -3192,10 +3957,10 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
3192
3957
  call; a missing or anonymous caller-id is rejected.
3193
3958
  3. **Mandatory `--reason`** — the CLI rejects `--reason ""`; the
3194
3959
  reason is persisted into the slice record for the retrospective.
3195
- Three rules, not one: each rule is independently fail-closed, so a
3196
- misuse in any one of them blocks the bypass. The classifier is the
3197
- pure function `canSkipSlice(slice, callerId, reason)` so the rule
3198
- set is testable in isolation.
3960
+ Three rules, not one: each rule is independently fail-closed, so a
3961
+ misuse in any one of them blocks the bypass. The classifier is the
3962
+ pure function `canSkipSlice(slice, callerId, reason)` so the rule
3963
+ set is testable in isolation.
3199
3964
  - **`peaks workflow verify-pipeline --gate-skipped`** — reporting
3200
3965
  flag that surfaces slices that completed via the skip classifier
3201
3966
  during a pipeline run. The default `verify-pipeline` output hides
@@ -3232,27 +3997,29 @@ Full suite: **2957 passed, 12 skipped, 0 failed**.
3232
3997
  bash saw literal `const c=process.argv[1]...` and tripped
3233
3998
  `syntax error near unexpected token`. Net effect on every 2.0.3
3234
3999
  install on Windows + macOS + Linux:
4000
+
3235
4001
  - Every Bash tool call (peaks CLI or otherwise) was rejected.
3236
4002
  - Every Write / Edit / MultiEdit call was rejected.
3237
4003
  - The [Fact-Forcing Gate] bypass that `peaks workspace init` was
3238
4004
  supposed to install was therefore self-defeating — the bypass
3239
4005
  broke the gate itself, and the gate could not be reached to fix
3240
4006
  it.
3241
- Recovery required the user to delete `.claude/settings.local.json`
3242
- manually (losing the bypass permanently) or hand-patch the
3243
- `command` field (drift vs the template).
3244
- The fix wraps both builders' JS payloads in a real shell-evaluable
3245
- `node -e "<js>"` form via a new `wrapAsNodeOneLiner` helper in
3246
- `src/services/workspace/claude-settings-template.ts`. Inner `"`
3247
- are escaped to `\"`; backslashes pass through unchanged so regex
3248
- literals like `/\.peaks\//` still match correctly. `process.argv[1]`
3249
- is the correct slot under `-e` per Node.js docs
3250
- (https://nodejs.org/api/process.html#processargv) — consistent
3251
- across Windows, macOS, and Linux. The docstring is reconciled
3252
- with the implementation (the previous docstring incorrectly said
3253
- `argv[2]`).
4007
+ Recovery required the user to delete `.claude/settings.local.json`
4008
+ manually (losing the bypass permanently) or hand-patch the
4009
+ `command` field (drift vs the template).
4010
+ The fix wraps both builders' JS payloads in a real shell-evaluable
4011
+ `node -e "<js>"` form via a new `wrapAsNodeOneLiner` helper in
4012
+ `src/services/workspace/claude-settings-template.ts`. Inner `"`
4013
+ are escaped to `\"`; backslashes pass through unchanged so regex
4014
+ literals like `/\.peaks\//` still match correctly. `process.argv[1]`
4015
+ is the correct slot under `-e` per Node.js docs
4016
+ (https://nodejs.org/api/process.html#processargv) — consistent
4017
+ across Windows, macOS, and Linux. The docstring is reconciled
4018
+ with the implementation (the previous docstring incorrectly said
4019
+ `argv[2]`).
3254
4020
 
3255
4021
  Regression tests cover:
4022
+
3256
4023
  - `buildBashHookCommand()` and `buildWriteHookCommand()` return
3257
4024
  `node -e "..."` form.
3258
4025
  - Inner `"` are escaped to `\"`.
@@ -3367,6 +4134,7 @@ config surface.
3367
4134
  > `optionalDependencies`; everything else in this section
3368
4135
  > (env-var injection, `config-template` CLI, `missingKeys`,
3369
4136
  > source-of-truth under `peaksConfig.ocr.llm`) is unchanged.
4137
+
3370
4138
  - **`detectOcr` / `runOcrReview` no longer read `~/.opencodereview/config.json`.**
3371
4139
  The source of truth is `peaksConfig.ocr.llm` (parsed by
3372
4140
  `getOcrLlmConfig()` in `config-service.ts`). Missing fields surface
@@ -3428,7 +4196,7 @@ subprocess ignores it when peaks-loop's env vars are present).
3428
4196
  supported IDE platforms in one command.
3429
4197
 
3430
4198
  - **`peaks audit red-lines`** — L2 catalog audit (P0/P1/P2-a/P2-b
3431
- enforcers) for skills/SKILL.md, references/*.md, and the agent shield.
4199
+ enforcers) for skills/SKILL.md, references/\*.md, and the agent shield.
3432
4200
 
3433
4201
  - **`peaks agent run`** — ECC 64 agents soft-optional integration
3434
4202
  (spec §7.2). When the L3 stack is installed, peaks delegates to it;
@@ -3463,6 +4231,7 @@ subprocess ignores it when peaks-loop's env vars are present).
3463
4231
  expands globs on disk before spawning.
3464
4232
 
3465
4233
  - **(2026-06-12) Three bugs surfaced by real-world ice-cola dogfood:**
4234
+
3466
4235
  - memory-extract was called without `--apply` → always dry-ran, never
3467
4236
  actually wrote.
3468
4237
  - `.claude/skills/**/SKILL.md` (the standard Claude-Code consumer
@@ -3586,7 +4355,7 @@ call-to-action text differ.
3586
4355
  Chinese tagline: `peaks-loop: 跨 AI IDE 的工程门禁与编排`).
3587
4356
  - `README-en.md` synced to mirror the new layout (typing animation
3588
4357
  uses the English tagline: `peaks-loop: cross-AI-IDE engineering
3589
- gates & orchestration`).
4358
+ gates & orchestration`).
3590
4359
  - Card anchors renamed to ASCII-friendly slugs on the English file
3591
4360
  (`30-seconds-to-running`, `5-minute-onboarding`, `11-skills-in-the-family`,
3592
4361
  `killer-feature-un-bypassable-gates`) so the README renders