spexcode 0.6.1 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/README.md +99 -149
  2. package/bin/spex.mjs +4 -0
  3. package/node_modules/@spexcode/spec-cli/bin/spex.mjs +76 -0
  4. package/node_modules/@spexcode/spec-cli/dist/attach.d.ts +2 -0
  5. package/node_modules/@spexcode/spec-cli/dist/attach.js +48 -0
  6. package/node_modules/@spexcode/spec-cli/dist/claude-headless.d.ts +33 -0
  7. package/node_modules/@spexcode/spec-cli/dist/claude-headless.js +307 -0
  8. package/node_modules/@spexcode/spec-cli/dist/cli.d.ts +1 -0
  9. package/node_modules/@spexcode/spec-cli/dist/cli.js +1859 -0
  10. package/node_modules/@spexcode/spec-cli/dist/client.d.ts +111 -0
  11. package/node_modules/@spexcode/spec-cli/dist/client.js +476 -0
  12. package/node_modules/@spexcode/spec-cli/dist/cockpit.d.ts +7 -0
  13. package/node_modules/@spexcode/spec-cli/dist/cockpit.js +26 -0
  14. package/node_modules/@spexcode/spec-cli/dist/codex-headless.d.ts +1 -0
  15. package/{spec-cli/src/codex-headless.ts → node_modules/@spexcode/spec-cli/dist/codex-headless.js} +3 -9
  16. package/node_modules/@spexcode/spec-cli/dist/codex-runtime-generations.d.ts +53 -0
  17. package/node_modules/@spexcode/spec-cli/dist/codex-runtime-generations.js +686 -0
  18. package/node_modules/@spexcode/spec-cli/dist/commit-surgery.d.ts +1 -0
  19. package/node_modules/@spexcode/spec-cli/dist/commit-surgery.js +90 -0
  20. package/node_modules/@spexcode/spec-cli/dist/contract-filter.d.ts +14 -0
  21. package/node_modules/@spexcode/spec-cli/dist/contract-filter.js +219 -0
  22. package/node_modules/@spexcode/spec-cli/dist/dashboard-assets.d.ts +6 -0
  23. package/node_modules/@spexcode/spec-cli/dist/dashboard-assets.js +50 -0
  24. package/node_modules/@spexcode/spec-cli/dist/delivery-queue.d.ts +23 -0
  25. package/node_modules/@spexcode/spec-cli/dist/delivery-queue.js +179 -0
  26. package/node_modules/@spexcode/spec-cli/dist/doctor.d.ts +9 -0
  27. package/node_modules/@spexcode/spec-cli/dist/doctor.js +547 -0
  28. package/node_modules/@spexcode/spec-cli/dist/eval-host.d.ts +1 -0
  29. package/node_modules/@spexcode/spec-cli/dist/eval-host.js +19 -0
  30. package/node_modules/@spexcode/spec-cli/dist/execution-trace.d.ts +26 -0
  31. package/node_modules/@spexcode/spec-cli/dist/execution-trace.js +475 -0
  32. package/node_modules/@spexcode/spec-cli/dist/file-write.d.ts +2 -0
  33. package/node_modules/@spexcode/spec-cli/dist/file-write.js +26 -0
  34. package/node_modules/@spexcode/spec-cli/dist/flat.d.ts +89 -0
  35. package/node_modules/@spexcode/spec-cli/dist/flat.js +1076 -0
  36. package/node_modules/@spexcode/spec-cli/dist/gateway-auth.d.ts +56 -0
  37. package/node_modules/@spexcode/spec-cli/dist/gateway-auth.js +168 -0
  38. package/node_modules/@spexcode/spec-cli/dist/gateway-hub.d.ts +28 -0
  39. package/node_modules/@spexcode/spec-cli/dist/gateway-hub.js +361 -0
  40. package/node_modules/@spexcode/spec-cli/dist/gateway.d.ts +37 -0
  41. package/node_modules/@spexcode/spec-cli/dist/gateway.js +503 -0
  42. package/node_modules/@spexcode/spec-cli/dist/graphCache.d.ts +27 -0
  43. package/node_modules/@spexcode/spec-cli/dist/graphCache.js +716 -0
  44. package/node_modules/@spexcode/spec-cli/dist/graphSnapshot.d.ts +14 -0
  45. package/node_modules/@spexcode/spec-cli/dist/graphSnapshot.js +35 -0
  46. package/node_modules/@spexcode/spec-cli/dist/graphStream.d.ts +85 -0
  47. package/node_modules/@spexcode/spec-cli/dist/graphStream.js +1195 -0
  48. package/node_modules/@spexcode/spec-cli/dist/guidance-catalog.d.ts +64 -0
  49. package/node_modules/@spexcode/spec-cli/dist/guidance-catalog.js +166 -0
  50. package/node_modules/@spexcode/spec-cli/dist/guide.d.ts +8 -0
  51. package/{spec-cli/src/guide.ts → node_modules/@spexcode/spec-cli/dist/guide.js} +115 -22
  52. package/node_modules/@spexcode/spec-cli/dist/harness-select.d.ts +18 -0
  53. package/node_modules/@spexcode/spec-cli/dist/harness-select.js +62 -0
  54. package/node_modules/@spexcode/spec-cli/dist/harness.d.ts +325 -0
  55. package/node_modules/@spexcode/spec-cli/dist/harness.js +3026 -0
  56. package/node_modules/@spexcode/spec-cli/dist/headless-controller.d.ts +9 -0
  57. package/node_modules/@spexcode/spec-cli/dist/headless-controller.js +47 -0
  58. package/node_modules/@spexcode/spec-cli/dist/help.d.ts +10 -0
  59. package/node_modules/@spexcode/spec-cli/dist/help.js +574 -0
  60. package/node_modules/@spexcode/spec-cli/dist/hook-prompts.d.ts +18 -0
  61. package/node_modules/@spexcode/spec-cli/dist/hook-prompts.js +122 -0
  62. package/node_modules/@spexcode/spec-cli/dist/hooks.d.ts +1 -0
  63. package/{spec-cli/src/hooks.ts → node_modules/@spexcode/spec-cli/dist/hooks.js} +15 -15
  64. package/node_modules/@spexcode/spec-cli/dist/host-resources.d.ts +97 -0
  65. package/node_modules/@spexcode/spec-cli/dist/host-resources.js +795 -0
  66. package/node_modules/@spexcode/spec-cli/dist/host.d.ts +88 -0
  67. package/node_modules/@spexcode/spec-cli/dist/host.js +663 -0
  68. package/node_modules/@spexcode/spec-cli/dist/index.d.ts +1 -0
  69. package/node_modules/@spexcode/spec-cli/dist/index.js +899 -0
  70. package/node_modules/@spexcode/spec-cli/dist/init.d.ts +1 -0
  71. package/node_modules/@spexcode/spec-cli/dist/init.js +284 -0
  72. package/node_modules/@spexcode/spec-cli/dist/issues-cli.d.ts +6 -0
  73. package/node_modules/@spexcode/spec-cli/dist/issues-cli.js +334 -0
  74. package/node_modules/@spexcode/spec-cli/dist/issues.d.ts +69 -0
  75. package/node_modules/@spexcode/spec-cli/dist/issues.js +189 -0
  76. package/node_modules/@spexcode/spec-cli/dist/lint.d.ts +34 -0
  77. package/node_modules/@spexcode/spec-cli/dist/lint.js +476 -0
  78. package/node_modules/@spexcode/spec-cli/dist/listen.d.ts +7 -0
  79. package/{spec-cli/src/listen.ts → node_modules/@spexcode/spec-cli/dist/listen.js} +13 -17
  80. package/node_modules/@spexcode/spec-cli/dist/localIssues.d.ts +65 -0
  81. package/node_modules/@spexcode/spec-cli/dist/localIssues.js +582 -0
  82. package/node_modules/@spexcode/spec-cli/dist/login-page.d.ts +5 -0
  83. package/{spec-cli/src/login-page.ts → node_modules/@spexcode/spec-cli/dist/login-page.js} +7 -7
  84. package/node_modules/@spexcode/spec-cli/dist/loop-in.d.ts +23 -0
  85. package/{spec-cli/src/loop-in.ts → node_modules/@spexcode/spec-cli/dist/loop-in.js} +35 -45
  86. package/node_modules/@spexcode/spec-cli/dist/machine-peer.d.ts +69 -0
  87. package/node_modules/@spexcode/spec-cli/dist/machine-peer.js +603 -0
  88. package/node_modules/@spexcode/spec-cli/dist/materialize.d.ts +18 -0
  89. package/node_modules/@spexcode/spec-cli/dist/materialize.js +468 -0
  90. package/node_modules/@spexcode/spec-cli/dist/mentions.d.ts +50 -0
  91. package/node_modules/@spexcode/spec-cli/dist/mentions.js +117 -0
  92. package/node_modules/@spexcode/spec-cli/dist/opencode-headless.d.ts +4 -0
  93. package/node_modules/@spexcode/spec-cli/dist/opencode-headless.js +208 -0
  94. package/node_modules/@spexcode/spec-cli/dist/opencode.d.ts +3 -0
  95. package/{spec-cli/src/opencode.ts → node_modules/@spexcode/spec-cli/dist/opencode.js} +9 -13
  96. package/node_modules/@spexcode/spec-cli/dist/pi-harness.d.ts +3 -0
  97. package/{spec-cli/src/pi-harness.ts → node_modules/@spexcode/spec-cli/dist/pi-harness.js} +45 -40
  98. package/node_modules/@spexcode/spec-cli/dist/pi-headless.d.ts +25 -0
  99. package/node_modules/@spexcode/spec-cli/dist/pi-headless.js +196 -0
  100. package/node_modules/@spexcode/spec-cli/dist/plugin-harness.d.ts +21 -0
  101. package/node_modules/@spexcode/spec-cli/dist/plugin-harness.js +146 -0
  102. package/node_modules/@spexcode/spec-cli/dist/pty-bridge.d.ts +10 -0
  103. package/node_modules/@spexcode/spec-cli/dist/pty-bridge.js +404 -0
  104. package/node_modules/@spexcode/spec-cli/dist/pty-helper.d.mts +1 -0
  105. package/node_modules/@spexcode/spec-cli/dist/pty-helper.mjs +101 -0
  106. package/node_modules/@spexcode/spec-cli/dist/pty-native-helper.d.mts +2 -0
  107. package/node_modules/@spexcode/spec-cli/dist/pty-native-helper.mjs +23 -0
  108. package/node_modules/@spexcode/spec-cli/dist/public-graph.d.ts +46 -0
  109. package/node_modules/@spexcode/spec-cli/dist/public-graph.js +56 -0
  110. package/node_modules/@spexcode/spec-cli/dist/ranker.d.ts +15 -0
  111. package/node_modules/@spexcode/spec-cli/dist/ranker.js +188 -0
  112. package/node_modules/@spexcode/spec-cli/dist/reaper.d.ts +6 -0
  113. package/node_modules/@spexcode/spec-cli/dist/reaper.js +81 -0
  114. package/node_modules/@spexcode/spec-cli/dist/reviews.d.ts +189 -0
  115. package/node_modules/@spexcode/spec-cli/dist/reviews.js +350 -0
  116. package/node_modules/@spexcode/spec-cli/dist/runtime-guard.d.ts +6 -0
  117. package/node_modules/@spexcode/spec-cli/dist/runtime-guard.js +37 -0
  118. package/node_modules/@spexcode/spec-cli/dist/runtime-ownership.d.ts +21 -0
  119. package/node_modules/@spexcode/spec-cli/dist/runtime-ownership.js +84 -0
  120. package/node_modules/@spexcode/spec-cli/dist/search.bench.d.mts +1 -0
  121. package/node_modules/@spexcode/spec-cli/dist/search.bench.mjs +75 -0
  122. package/node_modules/@spexcode/spec-cli/dist/search.d.ts +20 -0
  123. package/node_modules/@spexcode/spec-cli/dist/search.js +61 -0
  124. package/node_modules/@spexcode/spec-cli/dist/session-cursors.d.ts +14 -0
  125. package/node_modules/@spexcode/spec-cli/dist/session-cursors.js +82 -0
  126. package/node_modules/@spexcode/spec-cli/dist/session-declarations.d.ts +13 -0
  127. package/node_modules/@spexcode/spec-cli/dist/session-declarations.js +126 -0
  128. package/node_modules/@spexcode/spec-cli/dist/session-execution.d.ts +10 -0
  129. package/node_modules/@spexcode/spec-cli/dist/session-execution.js +70 -0
  130. package/node_modules/@spexcode/spec-cli/dist/session-files.d.ts +28 -0
  131. package/node_modules/@spexcode/spec-cli/dist/session-files.js +130 -0
  132. package/node_modules/@spexcode/spec-cli/dist/session-follow.d.ts +31 -0
  133. package/node_modules/@spexcode/spec-cli/dist/session-follow.js +179 -0
  134. package/node_modules/@spexcode/spec-cli/dist/session-reparent.d.ts +10 -0
  135. package/node_modules/@spexcode/spec-cli/dist/session-reparent.js +33 -0
  136. package/node_modules/@spexcode/spec-cli/dist/session-timeline.d.ts +51 -0
  137. package/node_modules/@spexcode/spec-cli/dist/session-timeline.js +233 -0
  138. package/node_modules/@spexcode/spec-cli/dist/session-web.d.ts +24 -0
  139. package/node_modules/@spexcode/spec-cli/dist/session-web.js +141 -0
  140. package/node_modules/@spexcode/spec-cli/dist/sessions.d.ts +412 -0
  141. package/node_modules/@spexcode/spec-cli/dist/sessions.js +4239 -0
  142. package/node_modules/@spexcode/spec-cli/dist/sh.d.ts +1 -0
  143. package/node_modules/@spexcode/spec-cli/dist/sh.js +3 -0
  144. package/node_modules/@spexcode/spec-cli/dist/shim-runtime.d.ts +1 -0
  145. package/{spec-cli/src/shim-runtime.ts → node_modules/@spexcode/spec-cli/dist/shim-runtime.js} +3 -4
  146. package/node_modules/@spexcode/spec-cli/dist/slash-commands.d.ts +9 -0
  147. package/node_modules/@spexcode/spec-cli/dist/slash-commands.js +307 -0
  148. package/node_modules/@spexcode/spec-cli/dist/source-files.d.ts +9 -0
  149. package/node_modules/@spexcode/spec-cli/dist/source-files.js +113 -0
  150. package/node_modules/@spexcode/spec-cli/dist/supervise.d.ts +1 -0
  151. package/node_modules/@spexcode/spec-cli/dist/supervise.js +308 -0
  152. package/node_modules/@spexcode/spec-cli/dist/tree.d.ts +25 -0
  153. package/node_modules/@spexcode/spec-cli/dist/tree.js +98 -0
  154. package/node_modules/@spexcode/spec-cli/dist/tsx-bin.d.ts +3 -0
  155. package/node_modules/@spexcode/spec-cli/dist/tsx-bin.js +41 -0
  156. package/node_modules/@spexcode/spec-cli/dist/uninstall.d.ts +3 -0
  157. package/node_modules/@spexcode/spec-cli/dist/uninstall.js +177 -0
  158. package/node_modules/@spexcode/spec-cli/dist/uploads.d.ts +36 -0
  159. package/node_modules/@spexcode/spec-cli/dist/uploads.js +243 -0
  160. package/node_modules/@spexcode/spec-cli/dist/worktree-sources.d.ts +1 -0
  161. package/node_modules/@spexcode/spec-cli/dist/worktree-sources.js +47 -0
  162. package/{spec-cli → node_modules/@spexcode/spec-cli}/hooks/dispatch.sh +5 -5
  163. package/{spec-cli → node_modules/@spexcode/spec-cli}/hooks/harness.sh +27 -7
  164. package/node_modules/@spexcode/spec-cli/package.json +47 -0
  165. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/commands/supervisor/spec.md +8 -0
  166. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/comment-altitude/spec.md +9 -0
  167. package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/spec-first/spec-first.sh +1 -1
  168. package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/spec-of-file/spec-of-file.sh +1 -0
  169. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/spec.md +22 -0
  170. package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/stop-gate/spec.md +2 -2
  171. package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/stop-gate/stop-gate.sh +31 -29
  172. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/prompts/atomic-landing/spec.md +15 -0
  173. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/prompts/forge-link/spec.md +10 -0
  174. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/prompts/memory-hygiene/spec.md +13 -0
  175. package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/prompts/reproduce-before-fix/spec.md +12 -0
  176. package/node_modules/@spexcode/spec-core/dist/anchors.d.ts +94 -0
  177. package/node_modules/@spexcode/spec-core/dist/anchors.js +730 -0
  178. package/node_modules/@spexcode/spec-core/dist/git.d.ts +166 -0
  179. package/node_modules/@spexcode/spec-core/dist/git.js +2736 -0
  180. package/node_modules/@spexcode/spec-core/dist/graph-delta.d.ts +44 -0
  181. package/node_modules/@spexcode/spec-core/dist/graph-delta.js +72 -0
  182. package/node_modules/@spexcode/spec-core/dist/graph.d.ts +34 -0
  183. package/node_modules/@spexcode/spec-core/dist/graph.js +237 -0
  184. package/node_modules/@spexcode/spec-core/dist/graphDelta.d.ts +3 -0
  185. package/node_modules/@spexcode/spec-core/dist/graphDelta.js +13 -0
  186. package/node_modules/@spexcode/spec-core/dist/harness-identity.d.ts +31 -0
  187. package/node_modules/@spexcode/spec-core/dist/harness-identity.js +20 -0
  188. package/node_modules/@spexcode/spec-core/dist/identity-presets.d.ts +152 -0
  189. package/node_modules/@spexcode/spec-core/dist/identity-presets.js +132 -0
  190. package/node_modules/@spexcode/spec-core/dist/index.d.ts +45 -0
  191. package/node_modules/@spexcode/spec-core/dist/index.js +19 -0
  192. package/node_modules/@spexcode/spec-core/dist/layout.d.ts +183 -0
  193. package/node_modules/@spexcode/spec-core/dist/layout.js +548 -0
  194. package/node_modules/@spexcode/spec-core/dist/process-identity.d.ts +37 -0
  195. package/node_modules/@spexcode/spec-core/dist/process-identity.js +214 -0
  196. package/node_modules/@spexcode/spec-core/dist/project-identity.d.ts +12 -0
  197. package/node_modules/@spexcode/spec-core/dist/project-identity.js +71 -0
  198. package/node_modules/@spexcode/spec-core/dist/project-store.d.ts +3 -0
  199. package/node_modules/@spexcode/spec-core/dist/project-store.js +14 -0
  200. package/node_modules/@spexcode/spec-core/dist/resilience.d.ts +2 -0
  201. package/node_modules/@spexcode/spec-core/dist/resilience.js +40 -0
  202. package/node_modules/@spexcode/spec-core/dist/review/index.d.ts +3 -0
  203. package/node_modules/@spexcode/spec-core/dist/review/index.js +5 -0
  204. package/node_modules/@spexcode/spec-core/dist/review/reviewFilters.d.ts +77 -0
  205. package/node_modules/@spexcode/spec-core/dist/review/reviewFilters.js +308 -0
  206. package/node_modules/@spexcode/spec-core/dist/review/reviewQuery.d.ts +66 -0
  207. package/node_modules/@spexcode/spec-core/dist/review/reviewQuery.js +180 -0
  208. package/node_modules/@spexcode/spec-core/dist/review/session.d.ts +4 -0
  209. package/node_modules/@spexcode/spec-core/dist/review/session.js +8 -0
  210. package/node_modules/@spexcode/spec-core/dist/reviewSnapshot.d.ts +15 -0
  211. package/node_modules/@spexcode/spec-core/dist/reviewSnapshot.js +12 -0
  212. package/node_modules/@spexcode/spec-core/dist/root-lru.d.ts +4 -0
  213. package/{spec-cli/src/root-lru.ts → node_modules/@spexcode/spec-core/dist/root-lru.js} +26 -30
  214. package/node_modules/@spexcode/spec-core/dist/specs.d.ts +117 -0
  215. package/node_modules/@spexcode/spec-core/dist/specs.js +489 -0
  216. package/node_modules/@spexcode/spec-core/package.json +28 -0
  217. package/node_modules/@spexcode/spec-eval/dist/cache.d.ts +10 -0
  218. package/node_modules/@spexcode/spec-eval/dist/cache.js +50 -0
  219. package/node_modules/@spexcode/spec-eval/dist/cli.d.ts +22 -0
  220. package/node_modules/@spexcode/spec-eval/dist/cli.js +981 -0
  221. package/node_modules/@spexcode/spec-eval/dist/evaltab.d.ts +98 -0
  222. package/node_modules/@spexcode/spec-eval/dist/evaltab.js +176 -0
  223. package/node_modules/@spexcode/spec-eval/dist/filing.d.ts +16 -0
  224. package/node_modules/@spexcode/spec-eval/dist/filing.js +36 -0
  225. package/node_modules/@spexcode/spec-eval/dist/freshness.d.ts +48 -0
  226. package/node_modules/@spexcode/spec-eval/dist/freshness.js +799 -0
  227. package/node_modules/@spexcode/spec-eval/dist/host.d.ts +46 -0
  228. package/node_modules/@spexcode/spec-eval/dist/host.js +53 -0
  229. package/node_modules/@spexcode/spec-eval/dist/humanok.d.ts +11 -0
  230. package/node_modules/@spexcode/spec-eval/dist/humanok.js +27 -0
  231. package/node_modules/@spexcode/spec-eval/dist/index.d.ts +4 -0
  232. package/node_modules/@spexcode/spec-eval/dist/index.js +4 -0
  233. package/node_modules/@spexcode/spec-eval/dist/remarks.d.ts +31 -0
  234. package/node_modules/@spexcode/spec-eval/dist/remarks.js +1 -0
  235. package/node_modules/@spexcode/spec-eval/dist/scenariofresh.d.ts +13 -0
  236. package/node_modules/@spexcode/spec-eval/dist/scenariofresh.js +303 -0
  237. package/node_modules/@spexcode/spec-eval/dist/scenarios.d.ts +99 -0
  238. package/node_modules/@spexcode/spec-eval/dist/scenarios.js +650 -0
  239. package/node_modules/@spexcode/spec-eval/dist/sessioneval.d.ts +307 -0
  240. package/node_modules/@spexcode/spec-eval/dist/sessioneval.js +1883 -0
  241. package/node_modules/@spexcode/spec-eval/dist/sidecar.d.ts +55 -0
  242. package/node_modules/@spexcode/spec-eval/dist/sidecar.js +82 -0
  243. package/node_modules/@spexcode/spec-eval/dist/timeline.d.ts +25 -0
  244. package/node_modules/@spexcode/spec-eval/dist/timeline.js +65 -0
  245. package/node_modules/@spexcode/spec-eval/dist/ui-path.d.ts +1 -0
  246. package/node_modules/@spexcode/spec-eval/dist/ui-path.js +2 -0
  247. package/node_modules/@spexcode/spec-eval/package.json +36 -0
  248. package/node_modules/@spexcode/spec-forge/dist/cache.d.ts +29 -0
  249. package/node_modules/@spexcode/spec-forge/dist/cache.js +59 -0
  250. package/node_modules/@spexcode/spec-forge/dist/cli.d.ts +1 -0
  251. package/node_modules/@spexcode/spec-forge/dist/cli.js +100 -0
  252. package/node_modules/@spexcode/spec-forge/dist/drivers/github.d.ts +2 -0
  253. package/node_modules/@spexcode/spec-forge/dist/drivers/github.js +116 -0
  254. package/node_modules/@spexcode/spec-forge/dist/drivers/gitlab.d.ts +7 -0
  255. package/node_modules/@spexcode/spec-forge/dist/drivers/gitlab.js +144 -0
  256. package/node_modules/@spexcode/spec-forge/dist/drivers.d.ts +10 -0
  257. package/node_modules/@spexcode/spec-forge/dist/drivers.js +83 -0
  258. package/node_modules/@spexcode/spec-forge/dist/index.d.ts +4 -0
  259. package/node_modules/@spexcode/spec-forge/dist/index.js +4 -0
  260. package/node_modules/@spexcode/spec-forge/dist/links.d.ts +15 -0
  261. package/node_modules/@spexcode/spec-forge/dist/links.js +65 -0
  262. package/node_modules/@spexcode/spec-forge/dist/needs-eval.d.ts +10 -0
  263. package/node_modules/@spexcode/spec-forge/dist/needs-eval.js +20 -0
  264. package/node_modules/@spexcode/spec-forge/dist/port.d.ts +53 -0
  265. package/node_modules/@spexcode/spec-forge/dist/port.js +1 -0
  266. package/node_modules/@spexcode/spec-forge/dist/resident.d.ts +7 -0
  267. package/node_modules/@spexcode/spec-forge/dist/resident.js +43 -0
  268. package/node_modules/@spexcode/spec-forge/package.json +32 -0
  269. package/package.json +33 -19
  270. package/spec-cli/bin/spex.mjs +0 -69
  271. package/spec-cli/src/anchors.ts +0 -706
  272. package/spec-cli/src/attach.ts +0 -43
  273. package/spec-cli/src/claude-headless.ts +0 -321
  274. package/spec-cli/src/cli.ts +0 -1115
  275. package/spec-cli/src/client.ts +0 -315
  276. package/spec-cli/src/cockpit.ts +0 -43
  277. package/spec-cli/src/codex-runtime-generations.ts +0 -646
  278. package/spec-cli/src/commit-surgery.ts +0 -68
  279. package/spec-cli/src/contract-filter.ts +0 -202
  280. package/spec-cli/src/delivery-queue.ts +0 -107
  281. package/spec-cli/src/doctor.ts +0 -516
  282. package/spec-cli/src/file-write.ts +0 -22
  283. package/spec-cli/src/gateway-auth.ts +0 -181
  284. package/spec-cli/src/gateway-hub.ts +0 -356
  285. package/spec-cli/src/gateway.ts +0 -368
  286. package/spec-cli/src/git.ts +0 -2180
  287. package/spec-cli/src/graph.ts +0 -221
  288. package/spec-cli/src/graphCache.ts +0 -641
  289. package/spec-cli/src/graphDelta.ts +0 -77
  290. package/spec-cli/src/graphStream.ts +0 -1019
  291. package/spec-cli/src/harness-select.ts +0 -77
  292. package/spec-cli/src/harness.ts +0 -2747
  293. package/spec-cli/src/headless-controller.ts +0 -63
  294. package/spec-cli/src/help.ts +0 -480
  295. package/spec-cli/src/host-resources.ts +0 -707
  296. package/spec-cli/src/host.ts +0 -611
  297. package/spec-cli/src/identity-presets.d.ts +0 -13
  298. package/spec-cli/src/identity-presets.js +0 -128
  299. package/spec-cli/src/index.ts +0 -730
  300. package/spec-cli/src/init.ts +0 -258
  301. package/spec-cli/src/issues-cli.ts +0 -276
  302. package/spec-cli/src/issues.ts +0 -237
  303. package/spec-cli/src/layout.ts +0 -557
  304. package/spec-cli/src/lint.ts +0 -458
  305. package/spec-cli/src/localIssues.ts +0 -538
  306. package/spec-cli/src/materialize.ts +0 -412
  307. package/spec-cli/src/mentions.ts +0 -81
  308. package/spec-cli/src/opencode-headless.ts +0 -205
  309. package/spec-cli/src/pi-headless.ts +0 -153
  310. package/spec-cli/src/plugin-harness.ts +0 -157
  311. package/spec-cli/src/process-identity.ts +0 -207
  312. package/spec-cli/src/project-identity.ts +0 -73
  313. package/spec-cli/src/project-store.ts +0 -17
  314. package/spec-cli/src/pty-bridge.ts +0 -396
  315. package/spec-cli/src/pty-helper.mjs +0 -96
  316. package/spec-cli/src/pty-native-helper.mjs +0 -22
  317. package/spec-cli/src/ranker.ts +0 -191
  318. package/spec-cli/src/reaper.ts +0 -125
  319. package/spec-cli/src/resilience.ts +0 -41
  320. package/spec-cli/src/reviewSnapshot.ts +0 -28
  321. package/spec-cli/src/reviews.ts +0 -405
  322. package/spec-cli/src/runtime-guard.ts +0 -35
  323. package/spec-cli/src/runtime-ownership.ts +0 -88
  324. package/spec-cli/src/search.bench.mjs +0 -80
  325. package/spec-cli/src/search.ts +0 -63
  326. package/spec-cli/src/session-cursors.ts +0 -91
  327. package/spec-cli/src/session-follow.ts +0 -182
  328. package/spec-cli/src/session-timeline.ts +0 -98
  329. package/spec-cli/src/sessions.ts +0 -3403
  330. package/spec-cli/src/sh.ts +0 -3
  331. package/spec-cli/src/slash-commands.ts +0 -318
  332. package/spec-cli/src/source-files.ts +0 -104
  333. package/spec-cli/src/specs.ts +0 -498
  334. package/spec-cli/src/supervise.ts +0 -245
  335. package/spec-cli/src/tree.ts +0 -118
  336. package/spec-cli/src/tsx-bin.ts +0 -18
  337. package/spec-cli/src/uninstall.ts +0 -171
  338. package/spec-cli/src/uploads.ts +0 -253
  339. package/spec-cli/src/worktree-sources.ts +0 -42
  340. package/spec-cli/templates/spec/project/.plugins/commands/supervisor/spec.md +0 -8
  341. package/spec-cli/templates/spec/project/.plugins/core/comment-altitude/spec.md +0 -28
  342. package/spec-cli/templates/spec/project/.plugins/core/spec.md +0 -23
  343. package/spec-cli/templates/spec/project/.plugins/prompts/atomic-landing/spec.md +0 -32
  344. package/spec-cli/templates/spec/project/.plugins/prompts/forge-link/spec.md +0 -9
  345. package/spec-cli/templates/spec/project/.plugins/prompts/memory-hygiene/spec.md +0 -15
  346. package/spec-cli/templates/spec/project/.plugins/prompts/reproduce-before-fix/spec.md +0 -18
  347. package/spec-dashboard/dist/assets/App-F9uaAVcH.js +0 -2
  348. package/spec-dashboard/dist/assets/Dashboard-Ba_jhxp1.js +0 -27
  349. package/spec-dashboard/dist/assets/Dashboard-C5ap-Sga.css +0 -1
  350. package/spec-dashboard/dist/assets/EvalsPage-FixoOg_n.js +0 -2
  351. package/spec-dashboard/dist/assets/IssuesPage-CuKLFhH3.js +0 -1
  352. package/spec-dashboard/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  353. package/spec-dashboard/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  354. package/spec-dashboard/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  355. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  356. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  357. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  358. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  359. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  360. package/spec-dashboard/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  361. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  362. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  363. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  364. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  365. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  366. package/spec-dashboard/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  367. package/spec-dashboard/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  368. package/spec-dashboard/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  369. package/spec-dashboard/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  370. package/spec-dashboard/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  371. package/spec-dashboard/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  372. package/spec-dashboard/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  373. package/spec-dashboard/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  374. package/spec-dashboard/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  375. package/spec-dashboard/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  376. package/spec-dashboard/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  377. package/spec-dashboard/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  378. package/spec-dashboard/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  379. package/spec-dashboard/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  380. package/spec-dashboard/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  381. package/spec-dashboard/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  382. package/spec-dashboard/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  383. package/spec-dashboard/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  384. package/spec-dashboard/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  385. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  386. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  387. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  388. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  389. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  390. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  391. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  392. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  393. package/spec-dashboard/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  394. package/spec-dashboard/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  395. package/spec-dashboard/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  396. package/spec-dashboard/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  397. package/spec-dashboard/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  398. package/spec-dashboard/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  399. package/spec-dashboard/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  400. package/spec-dashboard/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  401. package/spec-dashboard/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  402. package/spec-dashboard/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  403. package/spec-dashboard/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  404. package/spec-dashboard/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  405. package/spec-dashboard/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  406. package/spec-dashboard/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  407. package/spec-dashboard/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  408. package/spec-dashboard/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  409. package/spec-dashboard/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  410. package/spec-dashboard/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  411. package/spec-dashboard/dist/assets/MobileApp-CHgEHORJ.js +0 -2
  412. package/spec-dashboard/dist/assets/Modal-CQgYymmr.js +0 -1
  413. package/spec-dashboard/dist/assets/PageScroll-hT7UTLvD.js +0 -1
  414. package/spec-dashboard/dist/assets/ProjectsPage-CtXxakF9.js +0 -1
  415. package/spec-dashboard/dist/assets/SessionInterface-6GBZ9nXN.css +0 -32
  416. package/spec-dashboard/dist/assets/SessionInterface-Bpie-9fs.js +0 -39
  417. package/spec-dashboard/dist/assets/SessionWindow-CixDi4PI.js +0 -1
  418. package/spec-dashboard/dist/assets/Settings-C2MsucfE.js +0 -1
  419. package/spec-dashboard/dist/assets/Thread-C6Go8HRh.js +0 -13
  420. package/spec-dashboard/dist/assets/bindings-BC9vqpYU.js +0 -1
  421. package/spec-dashboard/dist/assets/data-B-RQmit6.js +0 -1
  422. package/spec-dashboard/dist/assets/index-CsI8DElI.css +0 -1
  423. package/spec-dashboard/dist/assets/index-DrVao0Ep.js +0 -41
  424. package/spec-dashboard/dist/assets/launch-BBH02b1v.js +0 -276
  425. package/spec-dashboard/dist/assets/launch-Cp579UoJ.css +0 -1
  426. package/spec-dashboard/dist/assets/terminalFont-C6oGNKrf.js +0 -1
  427. package/spec-dashboard/dist/index.html +0 -29
  428. package/spec-dashboard/src/reviewFilters.js +0 -322
  429. package/spec-dashboard/src/reviewQuery.js +0 -174
  430. package/spec-dashboard/src/session.js +0 -199
  431. package/spec-eval/src/cache.ts +0 -57
  432. package/spec-eval/src/cli.ts +0 -889
  433. package/spec-eval/src/evaltab.ts +0 -262
  434. package/spec-eval/src/filing.ts +0 -39
  435. package/spec-eval/src/freshness.ts +0 -557
  436. package/spec-eval/src/humanok.ts +0 -28
  437. package/spec-eval/src/scenariofresh.ts +0 -244
  438. package/spec-eval/src/scenarios.ts +0 -672
  439. package/spec-eval/src/sessioneval.ts +0 -2226
  440. package/spec-eval/src/sidecar.ts +0 -93
  441. package/spec-eval/src/timeline.ts +0 -54
  442. package/spec-forge/src/__fixtures__/github-forge.json +0 -63
  443. package/spec-forge/src/cache.ts +0 -66
  444. package/spec-forge/src/cli.ts +0 -99
  445. package/spec-forge/src/drivers/github.ts +0 -132
  446. package/spec-forge/src/drivers/gitlab.ts +0 -153
  447. package/spec-forge/src/drivers.ts +0 -73
  448. package/spec-forge/src/links.ts +0 -72
  449. package/spec-forge/src/needs-eval.ts +0 -29
  450. package/spec-forge/src/port.ts +0 -36
  451. package/spec-forge/src/resident.ts +0 -46
  452. /package/{spec-cli → node_modules/@spexcode/spec-cli}/README.md +0 -0
  453. /package/{spec-cli → node_modules/@spexcode/spec-cli}/hooks/compat/mark-active-0.5.2-eef1.fixture +0 -0
  454. /package/{spec-cli → node_modules/@spexcode/spec-cli}/hooks/compat/mark-active-sed-v0.fixture +0 -0
  455. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/commit-msg +0 -0
  456. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/post-checkout +0 -0
  457. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/post-merge +0 -0
  458. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/pre-commit +0 -0
  459. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/prepare-commit-msg +0 -0
  460. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/hooks/reference-transaction +0 -0
  461. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/commands/extract/spec.md +0 -0
  462. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/commands/regroup/spec.md +0 -0
  463. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/commands/rename/spec.md +0 -0
  464. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/commands/spec.md +0 -0
  465. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/commands/tidy/spec.md +0 -0
  466. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/idle/idle.sh +0 -0
  467. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/idle/spec.md +0 -0
  468. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/mark-active/mark-active.sh +0 -0
  469. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/mark-active/spec.md +0 -0
  470. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/session-fail/fail.sh +0 -0
  471. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/session-fail/spec.md +0 -0
  472. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/spec-first/spec.md +0 -0
  473. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/core/spec-of-file/spec.md +0 -0
  474. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/prompts/spec.md +0 -0
  475. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/skills/distill/digest.mjs +0 -0
  476. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/skills/distill/spec.md +0 -0
  477. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/skills/spec.md +0 -0
  478. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/.plugins/spec.md +0 -0
  479. /package/{spec-cli → node_modules/@spexcode/spec-cli}/templates/spec/project/spec.md +0 -0
  480. /package/{spec-cli → node_modules/@spexcode/spec-core}/templates/spexcode.json +0 -0
@@ -1,63 +0,0 @@
1
- import { createConnection, type Socket } from 'node:net'
2
- import type { DispatchResult } from './harness.js'
3
-
4
- export type ControlRequestLabel = {
5
- name: string
6
- session: string
7
- timeoutMs: number
8
- rejected: string
9
- }
10
-
11
- export function withTimeout<T>(promise: Promise<T>, ms: number, message: string): Promise<T> {
12
- return new Promise((resolve, reject) => {
13
- const timer = setTimeout(() => reject(new Error(message)), ms)
14
- promise.then(
15
- (value) => { clearTimeout(timer); resolve(value) },
16
- (error) => { clearTimeout(timer); reject(error) },
17
- )
18
- })
19
- }
20
-
21
- export function controlRequest(
22
- sockPath: string,
23
- request: object,
24
- label: ControlRequestLabel,
25
- ): Promise<DispatchResult> {
26
- return new Promise((resolve) => {
27
- let socket: Socket | undefined
28
- let buffer = ''
29
- let settled = false
30
- const finish = (result: DispatchResult) => {
31
- if (settled) return
32
- settled = true
33
- clearTimeout(timer)
34
- socket?.destroy()
35
- resolve(result)
36
- }
37
- const timer = setTimeout(
38
- () => finish({ ok: false, error: `${label.name} control timed out for session ${label.session}` }),
39
- label.timeoutMs,
40
- )
41
- try {
42
- socket = createConnection(sockPath)
43
- } catch (error) {
44
- finish({ ok: false, error: `${label.name} controller connect failed for session ${label.session}: ${(error as Error).message}` })
45
- return
46
- }
47
- socket.setEncoding('utf8')
48
- socket.on('connect', () => socket!.write(`${JSON.stringify(request)}\n`))
49
- socket.on('data', (chunk) => {
50
- buffer += chunk
51
- const nl = buffer.indexOf('\n')
52
- if (nl < 0) return
53
- try {
54
- const response = JSON.parse(buffer.slice(0, nl)) as DispatchResult
55
- finish(response.ok ? { ok: true } : { ok: false, error: response.error || label.rejected })
56
- } catch (error) {
57
- finish({ ok: false, error: `${label.name} returned an invalid control response: ${(error as Error).message}` })
58
- }
59
- })
60
- socket.on('error', (error) => finish({ ok: false, error: `${label.name} controller unreachable for session ${label.session}: ${error.message}` }))
61
- socket.on('close', () => finish({ ok: false, error: `${label.name} controller closed before confirming session ${label.session}` }))
62
- })
63
- }
@@ -1,480 +0,0 @@
1
- // @@@ help journey - the CLI's three help layers, each pointing at the next so no probe dead-ends:
2
- // 1. `spex help` → the MAP: the whole noun-first surface, one line per drawer/verb.
3
- // 2. `spex help <cmd>` → ONE drawer/command's usage (also `spex <cmd> --help`, intercepted pre-verb).
4
- // 3. `spex guide [topic]` → the SKILL layer: workflows, file formats, best practice (guide.ts).
5
- // help answers "what do I type"; guide answers "how do I work". Machine plumbing (hook/launch-script
6
- // callees) lives under `spex internal` and is deliberately absent from the map — an agent scanning
7
- // `spex help` sees only verbs meant for it. Governed by the cli-surface spec node.
8
- //
9
- // The grammar the map teaches: `spex <noun> <verb> [object] [flags]` — the verb is always the second
10
- // token after its noun; a bare noun prints its drawer's help; a bare verb exists only where the object is
11
- // invariably THIS PROJECT. One verb, one spelling: there are no aliases and no promoted twins.
12
-
13
- // One command's help entry. `see` renders as a trailing "see also:" journey pointer.
14
- type Entry = { line: string; body: string; see?: string }
15
-
16
- const SEL_NOTE = `SEL = session id (or unique id-prefix) | node id | branch — every session read/control verb
17
- accepts any of the four; inside a session worktree, . means that worktree's session. On the list verbs (ls/watch),
18
- none (or @all) means every session.`
19
-
20
- const ROUTING_NOTE = `Backend routing: every backend-touching verb accepts --api <url> (--port <n> = localhost sugar) to name
21
- its backend explicitly — the flag always wins. Bare, it resolves: worker env / the cwd project's live
22
- recorded backend / fallback / :8787 (spex guide settings → BACKEND ROUTING).`
23
-
24
- const DOT_NOTE = `\`.\` as a node argument means the node THIS worktree works on (the session's bound node, else the
25
- node/<id> branch). One-shot payload reads (graph · spec search · session ls/show/review · eval ls ·
26
- scenario ls · issue ls/show/links) take --json.`
27
-
28
- const MENTION_NOTE = `Mentions: @session · [[node]] work in ANY prompt, issue, or remark body — text passed as a CLI arg included.
29
- [[node]] names a topic; @session names a retained session for the receiving agent to inspect, contact with
30
- \`spex session send\`, or inherit with \`/distill\`. Mentions are references only: they never send or spawn.`
31
-
32
- type SessionVerbNote = 'selector' | 'project-bound'
33
- type SessionVerbHelp = readonly [usage: string | readonly string[], detail: string, notes?: readonly SessionVerbNote[]]
34
-
35
- // One definition feeds both the complete session drawer and exact `session <verb> --help` projections.
36
- // Keeping the behavioral prose here prevents a compact probe from becoming a second, drifting manual.
37
- function sessionHelpDefinitions(): Record<string, SessionVerbHelp> {
38
- return {
39
- new: ['spex session new "<prompt>" [--prompt-file <path>|-] [--launcher <name>]',
40
- `Launch a worker in its own node worktree. The materialized system contract reaches it
41
- automatically; the prompt supplies the task context. Its first [[id]] mention binds the
42
- session to that node. --prompt-file <path>|- carries a long prompt without shell quoting
43
- (exclusive with the inline prompt). The successful receipt names what to read, monitor, and reply on.`],
44
- ls: ['spex session ls [SEL…] [--status a,b] [--all] [--json]',
45
- 'One-shot table of living sessions. Shelved sessions ([[archive]]) are hidden; --all includes them, and naming one explicitly always shows it.', ['selector']],
46
- resources: ['spex session resources [--json]', 'Read-only host/process ownership, budgets, shared refs, and findings.'],
47
- watch: [['spex session watch <SEL…>', 'spex session watch list', 'spex session watch cancel <SEL…>', 'spex session watch stream [SEL…] [--as NAME] [--idle] [--interval N=1]'],
48
- 'With a governed caller, watch registers durable send-backed state delivery and exits. list/cancel manage those relations. Without a governed caller it names the background `session wait` fallback. stream is the human-only continuous log view and blocks until killed.', ['selector']],
49
- wait: ['spex session wait [SEL…] [--timeout S=1200] [--interval S=1] [--idle]',
50
- `EDGE-TRIGGERED wait: follows the selected sessions' logs AND your own log, and exits 0 on
51
- the FIRST thing worth waking for — a followed session TRANSITIONING from a non-actionable
52
- status into an actionable one (stdout = the observed path, e.g. working→review; read the LAST
53
- token as the status reached), or a message arriving for you (stdout = message). The arrival
54
- status is printed immediately on stderr but never returns it: it NEVER returns just because a
55
- session is actionable ALREADY — for "what is it right NOW" use \`session ls\` / \`session review\`.
56
- It reads files only, so it needs no \`spex serve\` and costs the sessions it follows nothing.
57
- --timeout is the guaranteed exit (code 1, observed path on stderr); code 2 = a followed
58
- session's store is gone.`, ['selector']],
59
- review: ['spex session review <SEL> [--json]', 'Reports ahead · uncommitted · proposal · gates · merge-base diff.', ['selector']],
60
- merge: ['spex session merge <SEL>', 'Dispatches a gated merge to the session\'s own agent; it does not close the session.', ['selector', 'project-bound']],
61
- send: [['spex session send <SEL> "<msg>"', 'spex session send <SEL> --keys "<keys>"'],
62
- `Plain send delivers a message once its timeline append succeeds; a dead adapter only delays its context. --keys is the LAST RESORT:
63
- raw nav-mode keystrokes to a TUI dialog ("Up Up Enter", C-/M-/S- combos). The raw key surface
64
- is UNSTABLE and can confirm dangerous dialogs — try a plain send first; use keys only when text
65
- provably cannot land.`, ['selector', 'project-bound']],
66
- interrupt: ['spex session interrupt <SEL>', 'Hard-interrupt the current turn through native harness control.', ['selector', 'project-bound']],
67
- rename: ['spex session rename <SEL> "<name>"', 'Set the display name; an empty name clears it.', ['selector', 'project-bound']],
68
- show: ['spex session show <SEL> [--capture] [--json]', `The session record: status · node · branch · launcher · the full originating prompt.
69
- --capture prints the LIVE PANE as text instead (empty pane = exit 0; unknown session = exit 2).`, ['selector']],
70
- resume: ['spex session resume <SEL> [--force]', 'Relaunch ONLY if confirmed offline; --force is for a wedged session.', ['selector', 'project-bound']],
71
- stop: ['spex session stop <SEL>', 'Soft stop: kill the exact agent and KEEP the worktree resumable.', ['selector', 'project-bound']],
72
- archive: ['spex session archive <SEL>', 'Cold-archive it: exact leaf/runtime stopped, worktree and conversation kept.', ['selector']],
73
- unarchive: ['spex session unarchive <SEL>', 'Deprecated compatibility spelling: same behavior as resume, relaunching the same conversation.', ['selector']],
74
- close: ['spex session close <SEL>', `Retire ANOTHER session — one you dispatched — deleting its worktree, branch and record.
75
- <SEL> names that session; it is never \`.\` and never your own id. Closing yourself deletes the worktree
76
- you are running in, mid-turn. Your own ending is a declaration: \`done --propose close\`.`, ['selector', 'project-bound']],
77
- quarantine: ['spex session quarantine <ID> --adapter <harness> [--thread <native-id>] --tmux <id> --worktree <absent-path> --branch <absent-branch> [--restore]',
78
- 'Move only an unreadable record after the backend proves every named residue absent. --thread is an adapter-native conversation id, never the SpexCode session id; omit it for Claude. Quarantine and --restore both require the original exact id because corrupt rows are outside selectors.', ['project-bound']],
79
- done: ['spex session done --propose merge|nothing|close [--note T]',
80
- '`merge` declares review: committed work ready for human review, and it is the ONLY declaration that offers a clickable merge. `nothing` declares done: committed work, but no merge proposal. `close` declares close-pending: PROPOSE discarding this worktree — the human closes it. This declaration is how a session ends itself; never run `session close` on your own id.'],
81
- park: ['spex session park --note <what-you-await>',
82
- 'Declare parked only when a managed watch delivery or real background task will wake your own session. It self-resumes; waiting for a human is asking, not parked.'],
83
- ask: ['spex session ask --note <your-question>',
84
- 'Declare asking when the session needs a human reply or direction. It resumes only when the human replies; a background wake-up is parked instead.'],
85
- attach: ['spex session attach <SEL>', `Attaches the current terminal to the worker's tmux (detach: C-b d) and blocks until detached.
86
- LOCAL-only (fails loud on a remote backend); show --capture and send are non-interactive.`, ['selector']],
87
- }
88
- }
89
-
90
- const SESSION_HELP_GROUPS = [
91
- { title: 'Manager verbs (dispatch, monitor, land)', verbs: ['new', 'ls', 'resources', 'watch', 'wait', 'review', 'merge'] },
92
- { title: 'Control another session', verbs: ['send', 'interrupt', 'rename', 'show', 'resume', 'stop', 'archive', 'unarchive', 'close', 'quarantine'] },
93
- { title: 'Worker verbs (declare YOUR OWN state — a claim the graph and your supervisor act on)', verbs: ['done', 'park', 'ask'] },
94
- { title: 'Human escape hatch', verbs: ['attach'] },
95
- ] as const
96
-
97
- const SESSION_WRITE_NOTE = `Manager verbs that WRITE (send/interrupt/rename/resume/stop/close/merge) are PROJECT-BOUND: a backend serving
98
- another project's repo refuses loudly — name the target with --api <url> to drive it on purpose.`
99
-
100
- function indent(text: string, spaces: number): string {
101
- const prefix = ' '.repeat(spaces)
102
- return text.split('\n').map((line) => `${prefix}${line}`).join('\n')
103
- }
104
-
105
- function sessionDrawerHelp(): string {
106
- const definitions = sessionHelpDefinitions()
107
- const groups = SESSION_HELP_GROUPS.map(({ title, verbs }) => `${title}:\n${verbs.map((verb) => {
108
- const [rawUsage, detail] = definitions[verb]
109
- const usages = typeof rawUsage === 'string' ? [rawUsage] : rawUsage
110
- return `${usages.map((usage) => ` ${usage}`).join('\n')}\n${indent(detail, 6)}`
111
- }).join('\n')}`).join('\n\n')
112
- return `${groups}\n\n${SEL_NOTE}\n${SESSION_WRITE_NOTE}\n${MENTION_NOTE}`
113
- }
114
-
115
- function sessionVerbHelp(verb: string): string | null {
116
- const entry = sessionHelpDefinitions()[verb]
117
- if (!entry) return null
118
- const [rawUsage, detail, sharedNotes = []] = entry
119
- const usages = typeof rawUsage === 'string' ? [rawUsage] : rawUsage
120
- const notes = [detail]
121
- if (sharedNotes.includes('selector')) notes.push(SEL_NOTE)
122
- if (sharedNotes.includes('project-bound')) notes.push(SESSION_WRITE_NOTE)
123
- return `${usages.map((line, index) => `${index === 0 ? 'Usage: ' : ' '}${line}`).join('\n')}\n\n${notes.join('\n\n')}`
124
- }
125
-
126
- const ENTRIES: Record<string, Entry> = {
127
- // ── project verbs (implicit object = this project) ────────────────────────
128
- graph: {
129
- line: 'graph the assembled view: bare = readable tree · --json = the full payload',
130
- body: `Usage: spex graph [--focus <id>] [--depth N] [--json]
131
-
132
- The ONE assembled view — merged spec tree + worktree overlay + sessions. Bare it renders the
133
- status-coloured tree (coloured when stdout is a tty; NO_COLOR respected), one line per node: id,
134
- derived status, title, and attention badges (drift:N · stale:N · issues:N · ghost).
135
- --focus <id> render just that subtree (unknown id fails loud)
136
- --depth N limit levels below the shown root; prunes are counted, never silent
137
- --json the full payload (tree · overlay · sessions), identical to GET /api/graph — machine
138
- food; with --focus/--depth it is that filtered subtree as nested objects instead`,
139
- see: 'spex spec search (find one node by intent) · spex session ls (just the sessions, as a table)',
140
- },
141
- init: {
142
- line: 'init [dir] adopt SpexCode on a repo: seed .spec + hooks + materialize --harness <ids> [--preset name]',
143
- body: `Usage: spex init [dir=cwd] --harness <id[,id]|plugin:<folder>> [--preset default]
144
-
145
- Scaffolds adoption in one shot: seeds a starter .spec tree (project root + .plugins plugins), plants
146
- spexcode.json, installs the git hooks, and materializes the harness artifacts (contract block +
147
- shims). --harness is REQUIRED — the explicit choice of which harnesses materialize delivers into
148
- (stamped as spexcode.json "harnesses"; only their launchers are seeded); a pre-existing "harnesses"
149
- field satisfies it. Additive — never overwrites your files. --preset picks the .plugins plugin tier (cumulative).
150
- Footprint is fixed: materialized artifacts are never tracked — hidden via the per-clone .git/info/exclude, with
151
- a tracked/mixed CLAUDE.md/AGENTS.md covered by the clean/smudge filter (see spex guide footprint).`,
152
- see: 'spex guide (the full setup workflow) · spex uninstall (the inverse) · spex spec lint (adoption TODO)',
153
- },
154
- materialize: {
155
- line: 'materialize the base pass of harness adaptation: render .spec/.plugins into your harness’s artifacts',
156
- body: `Usage: spex materialize
157
-
158
- The base operation of HARNESS ADAPTATION: one pass renders the spec tree's surface nodes into the
159
- artifacts each selected harness auto-discovers — the managed <!-- spexcode --> block of
160
- CLAUDE.md/AGENTS.md, the .claude/.codex shims, the skills/agents — and prints the content hash.
161
- The outputs are derived and never tracked: to change one, edit its source (.plugins, spexcode.json)
162
- and re-materialize — never the artifact. Not a one-time setup: it anchors on git-native events
163
- (init · this verb · session-worktree creation · the pre-commit/post-checkout/post-merge hooks) —
164
- run it by hand after a toolchain update, or in the setup step of any clone that has no spex-planted
165
- hooks yet (CI, a cloud agent): generated and excluded, the artifacts never arrive via git.`,
166
- see: 'spex doctor (verify the materialized artifacts actually reach an agent)',
167
- },
168
- doctor: {
169
- line: 'doctor diagnose spec health and whether the workflow reaches this agent [--contract|--conflicts]',
170
- body: `Usage: spex doctor spec-health findings + delivery report: preconditions · git-hook floor ·
171
- contract · hooks + handler existence · backend · footprint
172
- spex doctor --contract print the composed surface:system text any agent here reads
173
- spex doctor --conflicts detect double-delivery (loose artifacts beside the managed ones)
174
-
175
- Bare doctor is the opt-in, read-only health surface: it reports altitude and breadth findings without
176
- putting them in the lint gate, then audits workflow delivery. Run it directly or let the tidy workflow
177
- consume the same visible diagnosis.`,
178
- see: 'spex spec lint (deterministic graph/contract gate) · spex materialize (repair delivery artifacts)',
179
- },
180
- uninstall: {
181
- line: 'uninstall [dir] remove all derived artifacts + local state; preserve tracked intent [--hooks]',
182
- body: `Usage: spex uninstall [dir=cwd] [--hooks]
183
-
184
- Removes all SpexCode-derived wiring and project-local state: contract blocks, harness shims,
185
- generated skills/agents, plugin bundles, trust/filter/exclude entries, and the global per-project
186
- store. Your tracked intent (.spec including .plugins, plus spexcode.json) and surrounding user prose
187
- are preserved. Git hooks remain unless --hooks; that flag removes only unmodified canonical copies.`,
188
- see: 'spex init (re-adopt later — your tracked intent survives)',
189
- },
190
- serve: {
191
- line: 'serve [api|ui] api (default) = the backend :8787 · ui = the dashboard :5173 on top of it',
192
- body: `Usage: spex serve [api] [--port N=8787]
193
- spex serve [api] --public --password <pw> [--tls-cert F --tls-key F] [--http]
194
- spex serve ui [--port N=5173] [--api-port N=8787] [--host H=127.0.0.1]
195
-
196
- \`serve\` (or \`serve api\`) runs the backend for the repo at cwd behind a zero-downtime supervisor
197
- (hot-reloads on source change; the public port never gaps). On a successful bind it RECORDS its
198
- endpoint in the per-project runtime tier — that's how a bare \`spex\` run from this project's tree
199
- finds this backend (spex guide settings → BACKEND ROUTING). --public exposes it on a public IP behind
200
- a password + self-signed TLS (own cert via --tls-cert/--tls-key; --http drops TLS).
201
-
202
- \`serve ui\` is a SEPARATE process: it serves the bundled dashboard on its own port and proxies /api +
203
- the terminal socket to a running backend (--api-port pairs with the backend's --port, so many
204
- projects coexist on one host). Loopback-only by default; --host 0.0.0.0 opens it to a LAN/tailnet —
205
- still plain HTTP with no gate, so bind wide only on a network you trust.`,
206
- see: 'GET /health (backend liveness probe)',
207
- },
208
- dashboard: {
209
- line: 'dashboard ONE dashboard for every project you serve — no --api-port pairing [--port N=5173]',
210
- body: `Usage: spex dashboard [--port N=5173] [--host H=127.0.0.1]
211
-
212
- The HOST gateway: serves the built dashboard once and routes to EVERY backend the current user runs —
213
- the multi-project hub engine plus the host registry on top. It continuously reconciles the per-project
214
- endpoint records each \`spex serve\` publishes (validating each against the live backend's /api/instance
215
- identity), keeps a durable known-project catalog, and proxies each project's API + SSE + terminal
216
- socket under /p/<projectId>/* — the project is named in the path, so nothing is "current" and no
217
- pairing flag exists.
218
-
219
- Admin surface (hub-authorized: implicit from loopback until an admin password is set, then cookie
220
- sessions): GET /projects (the validated list + gating state) · GET /projects/stream (SSE) ·
221
- GET /projects/browse?path=… (read-only host folder picker) · POST /projects {root, initGit?, init?}
222
- (explicit setup, then register) · GET|PUT /projects/<id>/config (raw portable
223
- spexcode.json, revision-guarded) · POST /projects/<id>/init|doctor|serve
224
- (run the real \`spex init\`/\`spex doctor\`, or start an offline project's backend, detached — a
225
- backend never depends on this gateway staying up) · PUT|DELETE /projects/admin-password and
226
- /projects/<id>/password (the gates). A gated project answers /p/<id>/login with the designed page.
227
-
228
- Loopback-only by default; --host widens the bind — the admin surface stays locked to loopback until
229
- an admin password exists, and ungated projects serve open.`,
230
- see: 'spex serve (each project\'s backend) · spex serve ui (explicit one-backend pairing)',
231
- },
232
-
233
- // ── the noun drawers ──────────────────────────────────────────────────────
234
- spec: {
235
- line: 'spec <verb> the governance graph: search · owner · lint · ack',
236
- body: `Usage: spex spec search <query…> [--limit N=10] [--json]
237
- spex spec owner <path> [--actionable]
238
- spex spec lint
239
- spex spec ack <node-id>… --reason "<why the contract still holds>"
240
-
241
- search — which spec node GOVERNS a topic, ranked by user-story relevance (which surfaces user-facing
242
- behaviour a code-grep misses). Run it BEFORE touching code: the node's spec.md body is the current
243
- contract. The corpus is English — query in English.
244
-
245
- owner — the reverse edge: a file's GOVERNORS (code: — drives drift + eval freshness) and REFERENCERS (related:
246
- — coverage only), with the verdict spelled out (uncovered / related-only / sanely governed /
247
- over-owned → split the file). --actionable prints NOTHING unless action is needed (hook use).
248
-
249
- lint — checks the whole spec↔code graph and exits non-zero on errors. Errors: integrity (a
250
- code:/related: file does not exist; a dead/ambiguous/unverifiable \`path#symbol\` selector; a selector
251
- whose language has no designated extractor or whose extractor can't run here; a duplicate entry, a
252
- base path both bare and scoped, or a selector on a glob/directory) · anchor-drift (a
253
- commit since the spec's version touched an ANCHORED unit's lines, unacked — the blocking tier of
254
- drift; same-file selectors OR'd, one error naming the hit selectors) · one-govern (a node
255
- governs >1 DISTINCT file) · living (a "## vN" changelog heading) · id-format (an
256
- id char outside the whitelist — ascii [a-z0-9-] or a non-ascii unicode letter/number, CJK ok — or a
257
- leaf id reused) · mention (a [[id]] naming no node). Warns: coverage · drift
258
- (UNANCHORED drift — always advisory, never blocks; on a scoped file's MISS, \`lint.scopedCodeMiss:
259
- "ignore"\` may silence it) · anchor (anchoring a type) · related-drift (a scoped related row warns
260
- per selector HIT, misses silent) · owners (whole-file governors only; scoped don't count) ·
261
- confusable-id (two leaf ids one edit apart). spec lint's errors BLOCK commits (the prepared reference hook; bypass SPEXCODE_SKIP_LINT=1);
262
- contrast \`spex eval lint\`, which is pure advisory and never blocks anyone.
263
-
264
- ack — stamp Spec-OK on HEAD (an empty stamp commit): the drift remedy when only MECHANICS changed
265
- and the spec's contract still holds. --reason is required and recorded in the ack commit's body
266
- (quieting an anchor hit is a strong claim — the why must be durable). If the intent DID change,
267
- edit the spec instead — same commit as the code.`,
268
- see: 'spex guide spec (the file format + every lint rule) · spex graph (browse the whole tree)',
269
- },
270
- session: {
271
- line: 'session <verb> the worktree state machine: new · ls · watch · wait · review · merge · send · …',
272
- body: sessionDrawerHelp(),
273
- see: 'spex eval ls --session <SEL> (the session’s measured loss) · spex help eval',
274
- },
275
- eval: {
276
- line: 'eval <verb> the measurement system: add · ls · scenario ls/write · lint · ok · retract · clean',
277
- body: `Usage: spex eval add [<node>|.] [--scenario <name>] (--pass|--fail) [--note <text>]
278
- [--image <png> …repeatable] [--result <path|->] [--video <webm|mp4>] [--timeline <json>]
279
- spex eval ls [<node>|.] [--json] a node's eval timeline, newest first
280
- spex eval ls --session <SEL> [--json] a session's aggregate: its changed nodes' scores
281
- spex eval ls --session <SEL> --export [--open | --out <path>]
282
- spex eval scenario ls [<node>|.] [--unmeasured] [--json] declared scenarios; JSON = canonical index
283
- spex eval scenario write --mutation <json> < eval.md propose one canonical metadata mutation
284
- spex eval lint [--changed] measurement-layer findings (advisory, always exit 0)
285
- spex eval ok <node> [--scenario <name>] the HUMAN sign-off on the scenario's latest measurement
286
- spex eval retract [<node>|.] [--scenario <name>] [--last | --ts <iso>] [--note <why>]
287
- spex eval clean [--keep-latest | --all] GC the content-addressed evidence cache
288
-
289
- add — file an eval of a scenario against its expected: the loss signal the optimizer reads.
290
- Measure through the REAL product surface, never by reasoning about the code. Evidence kind follows
291
- the behaviour: MOVING/timed behaviour records a --video; a STATIC end state screenshots --image;
292
- backend/CLI files a --result transcript. A fix's evidence is a fail→pass pair on the SAME scenario.
293
-
294
- ls — node-scoped bare (its per-scenario eval history); session-scoped with an EXPLICIT --session
295
- (never type-sniffed): filed evals are newest-first across nodes and source ownership; own measurements
296
- are ✦-marked, evals filed by other sessions are unmarked, and blind spots follow measured rows. --export writes ONE self-contained
297
- HTML artifact (diff · evidence inlined · gates) for CI/sharing.
298
-
299
- scenario ls — the DECLARED contracts, no evals: text may show the latest verdict and --unmeasured is its blind-spot
300
- worklist; --json emits the complete canonical semantic/measurement index with stable hashes and fixed-tree provenance
301
- (--unmeasured is text-only because the JSON projection never reads the eval sidecar).
302
-
303
- scenario write — the fixed-tree declaration writer for an external measurement guard: stdin is the authoritative
304
- eval.md, --mutation is one closed JSON insert/delete request for one scenario's test metadata, and stdout is only
305
- the proposed eval.md bytes. It reads no worktree or runner and fails without stdout on malformed or ambiguous input.
306
-
307
- lint — the measurement layer's findings: malformed eval.md (eval-schema) · unmeasured (eval-missing) ·
308
- stale (eval-drift) · orphaned remark tracks (eval-dangling) · governed source with no eval.md
309
- (eval-coverage — the same name and shape as spec lint's coverage, one rule per layer) · over-owned
310
- files (eval-owners). --changed scopes to the nodes THIS branch touched. spec lint's errors block
311
- commits; eval lint is PURE ADVISORY, always exit 0 — a measurement gap never blocks anyone.
312
-
313
- ok — the human's reviewed-and-agreed mark on the scenario's LATEST measurement: an appended, monotonic
314
- sign-off bound to that one immutable measurement (a newer measurement or staleness releases it on its own —
315
- no un-ok exists). The evals feed default-hides a fresh, ok'd scenario; a governed session is refused
316
- (an agent's judgment on a measurement is a remark, never a self-blessing).
317
-
318
- retract — the sanctioned undo for a botched filing: APPENDS a retraction event (traceable, never
319
- deletes a line); the previous eval becomes latest again, or the scenario honestly returns to
320
- unmeasured.
321
-
322
- ${DOT_NOTE}`,
323
- see: 'spex guide eval (the eval.md scenario format + evidence rules) · spex evidence (bare byte transport)',
324
- },
325
- issue: {
326
- line: 'issue <verb> concern threads, local + forge merged: ls · show · open · reply · close · promote · links',
327
- body: `Usage: spex issue ls [--node <id>] [--store local|<host>] [--all] [--json]
328
- spex issue show <id> [--json]
329
- spex issue open "<concern>" [--store local|<host>] [--node <id>…] [--evidence <hash>…] [--body -|<text>]
330
- spex issue reply <id> --body -|<text> [--evidence <hash>…]
331
- spex issue close <id>
332
- spex issue promote <id>
333
- spex issue links [--pending] [--store <host>] [--node <id>] [--json]
334
-
335
- ls is the drain view a supervisor reads: ONE store-tagged list, local + forge interleaved by
336
- creation time. \`show <id>\` is the single-thread detail — the whole thread with its replies (a local
337
- id, or a forge id like github#12). \`open\` welcomes taste, annotations, and off-mainline smells —
338
- not only bugs; --store <host> opens straight on the forge. \`reply\` and \`close\` route by the
339
- issue's store — one verb, local or forge. \`promote\` moves an OPEN local issue to the forge as one
340
- recorded action. \`links\` is the read-only forge trace: which open forge issues/PRs serve which
341
- spec node (--pending narrows to threads still awaiting an eval). The issues workflow's
342
- on/off switch is the \`issues.enabled\` key in spexcode.json (no CLI toggle verb — edit the JSON;
343
- \`spex doctor\` reports its state).
344
- ${MENTION_NOTE}`,
345
- see: 'spex remark (pin a resolvable concern to an issue or scenario) · spex evidence put (stash evidence bytes)',
346
- },
347
- remark: {
348
- line: 'remark <verb> resolvable pins on a host: add · resolve · retract',
349
- body: `Usage: spex remark add <issue-id | <node> --scenario <name>> --body -|<text> [--code-sha <sha>] [--evidence <hash>…]
350
- spex remark resolve <ref> (the <thread-id>#<rid> that \`spex remark add\` printed)
351
- spex remark retract <ref>
352
-
353
- The resolvable interaction primitive: \`add\` pins a concern to a HOST — a local issue, or a scenario
354
- (\`--scenario\` present ⇒ the positional is a node; otherwise it is an issue id — the flag decides,
355
- never type-sniffing). A SECOND agent \`resolve\`s it (never the author); the AUTHOR \`retract\`s their
356
- own. The whole loop is CLI-first; the dashboard adds no capability.`,
357
- see: 'spex issue (the thread hosts) · spex eval ls (scenario hosts)',
358
- },
359
- evidence: {
360
- line: 'evidence put|get content-addressed bytes: put stashes & prints the hash, get reads back',
361
- body: `Usage: spex evidence put <file|->
362
- spex evidence get <hash> [-o <file>]
363
-
364
- put writes bytes into the shared content-addressed evidence cache and prints the hash — transport
365
- only, no eval filed. Use the hash with --evidence on issues/remarks; re-putting the same content
366
- restores pruned or cloned-away evidence.
367
-
368
- get is the symmetric read: hash in, bytes out. Local cache first (no backend needed — the evidence
369
- is usually on this disk), then the backend on a local miss; both missing fails loud naming each
370
- path. Bytes go to stdout by default (pipe-friendly); -o writes a file.`,
371
- see: 'spex eval add (file an eval WITH evidence) · spex issue open --evidence <hash>',
372
- },
373
-
374
- // ── help & guide ──────────────────────────────────────────────────────────
375
- guide: {
376
- line: 'guide [topic] the manuals: setup workflow · spec/eval file formats · spexcode.json · footprint',
377
- body: `Usage: spex guide the human setup workflow (install once, adopt a repo, serve)
378
- spex guide spec the spec.md file format + every lint rule
379
- spex guide eval the eval.md scenario format + how loss is measured and filed
380
- spex guide settings every spexcode.json / spexcode.local.json field, and which file it belongs in
381
- spex guide footprint the footprint model: never-tracked artifacts, exclude + content filter, anchors
382
-
383
- guide is the SKILL layer — workflows and formats. Command usage lives here in help
384
- (\`spex help <cmd>\`); guide carries what the commands assume you know.`,
385
- },
386
-
387
- // ── plumbing ──────────────────────────────────────────────────────────────
388
- internal: {
389
- line: '', // deliberately not on the map
390
- body: `Usage: spex internal <sub>
391
-
392
- Machine plumbing — called by generated hooks and launch scripts, never typed by a human or agent:
393
- trunk print the resolved source-of-truth branch (the pre-commit main-guard captures it)
394
- commit-surgery pre-commit footprint anchor: unconditional materialize + staged-index repair
395
- refresh-footprint quiet materialize — the post-checkout/post-merge freshness anchor
396
- check-staged pre-commit eval backstop: reject staged stray evidence files / malformed eval.md
397
- session-state <st> --session <id> a lifecycle hook authors the session's state
398
- session-fail --session <id> the StopFailure hook marks the session errored
399
- session-idle --session <id> the idle-prompt hook marks an active session idle
400
- commit-gate the Stop gate's deterministic commit check (exit 0 = ready to declare done)
401
- nudge <node> the post-merge hook prints the issue nudge for a merged node
402
- shared-runtime-spawn <cwd> <log> <pid> <scope> <cmd> [args…] detached adapter control plane (launch script)
403
- codex-launch <sock> <cwd> [prompt…] backend-owned codex thread/start + first turn (launch script)
404
- codex-turn <sock> <threadId> <text…> fire a follow-up turn on an owned thread (tests/scripts)
405
- claude-headless-run <id> <runtime> <cmd> -- <tail…> resident stream-json controller (launch script)
406
- pi-headless-run <id> <runtime> <cmd> -- <tail…> resident pi text-mode controller (launch script)
407
-
408
- If you reached for one of these by hand, the porcelain you want is probably elsewhere: the trunk
409
- name also lives at GET /api/settings (.layout); sessions are driven with spex session new / session send;
410
- your own state is declared with spex session done|park|ask.`,
411
- see: 'spex help (the porcelain map)',
412
- },
413
- help: {
414
- line: '',
415
- body: `Usage: spex help the command map
416
- spex help <command> one command/drawer's usage (same as spex <command> --help)
417
- spex guide [topic] the skill layer: workflows, file formats, best practice`,
418
- },
419
- }
420
-
421
- // `spex <cmd> --help` must meet the user wherever they typed it: cli.ts intercepts the probe pre-verb.
422
- // Session's noun-verb shape gets one extra projection; a bare noun still returns the complete drawer.
423
- export function commandHelp(name: string, verb?: string): string | null {
424
- if (name === 'session' && verb) {
425
- const exact = sessionVerbHelp(verb)
426
- if (exact) return `${exact}\n\nsee also: spex session (the complete drawer)\n\nmap: spex help · skills: spex guide`
427
- }
428
- const e = ENTRIES[name]
429
- if (!e) return null
430
- const oneLiner = e.line.replace(/^\S+(\s+\S+)*?\s{2,}/, '') // the map line minus its "cmd args" column
431
- const header = oneLiner ? `spex ${name} — ${oneLiner}\n\n` : '' // unlisted entries (internal, help) lead with their own Usage
432
- return `${header}${e.body}${e.see ? `\n\nsee also: ${e.see}` : ''}\n\nmap: spex help · skills: spex guide`
433
- }
434
-
435
- export function sessionLaunchReceipt(id: string, managedWatch = false): string {
436
- return `spex: launched session ${id}
437
- current result: the session JSON is on stdout now; \`spex session ls ${id}\` is the later one-shot snapshot
438
- next lifecycle change: ${managedWatch
439
- ? `managed watch registered — this parent receives ${id}'s state changes through its normal send queue; \`spex session watch cancel ${id}\` ends it`
440
- : `background \`spex session wait ${id}\` (edge-triggered; exits on the next non-actionable→actionable transition); \`spex session watch ${id}\` registers send-backed delivery when the caller is governed`}; \`spex session watch stream ${id}\` NEVER EXITS
441
- response channel: \`spex session send ${id} "<msg>"\`; \`send --keys\` is an UNSTABLE LAST RESORT after a plain send cannot land`
442
- }
443
-
444
- export function overviewHelp(): string {
445
- return `spex — SpexCode CLI (spec↔code graph + worktree session state machine)
446
-
447
- Usage: spex <noun> <verb> [object] [flags] the verb is always the token after its noun;
448
- a bare noun prints that drawer's help
449
- spex help <command> one command's usage (or spex <command> --help — always
450
- safe: a help probe never runs the verb)
451
-
452
- Project verbs (implicit object = this project)
453
- ${ENTRIES.graph.line}
454
- ${ENTRIES.init.line}
455
- ${ENTRIES.materialize.line}
456
- ${ENTRIES.doctor.line}
457
- ${ENTRIES.uninstall.line}
458
- ${ENTRIES.serve.line}
459
- ${ENTRIES.dashboard.line}
460
-
461
- Noun drawers
462
- ${ENTRIES.spec.line}
463
- ${ENTRIES.session.line}
464
- ${ENTRIES.eval.line}
465
- ${ENTRIES.issue.line}
466
- ${ENTRIES.remark.line}
467
- ${ENTRIES.evidence.line}
468
-
469
- Manuals
470
- ${ENTRIES.guide.line}
471
-
472
- Conventions (stated once, hold everywhere)
473
- ${SEL_NOTE.split('\n').join('\n ')}
474
- ${DOT_NOTE.split('\n').join('\n ')}
475
- ${ROUTING_NOTE.split('\n').join('\n ')}
476
- ${MENTION_NOTE.split('\n').join('\n ')}
477
-
478
- Concepts & best practice live in the guide: spex guide (setup) · guide spec · guide eval · guide settings · guide footprint.
479
- Machine plumbing (hook/launch-script callees) lives under \`spex internal\` — not part of your vocabulary.`
480
- }