@seanmars/tospec 0.19.0-beta.8 → 0.21.0

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 (423) hide show
  1. package/CHANGELOG.md +89 -296
  2. package/README.md +69 -82
  3. package/assets/dashboard/app.js +11 -0
  4. package/assets/dashboard/style.css +7 -0
  5. package/bin/tospec.js +1 -1
  6. package/dist/cli/index.d.ts +6 -1
  7. package/dist/cli/index.d.ts.map +1 -1
  8. package/dist/cli/index.js +120 -112
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/commands/config.d.ts +9 -17
  11. package/dist/commands/config.d.ts.map +1 -1
  12. package/dist/commands/config.js +300 -145
  13. package/dist/commands/config.js.map +1 -1
  14. package/dist/commands/dashboard.d.ts +57 -99
  15. package/dist/commands/dashboard.d.ts.map +1 -1
  16. package/dist/commands/dashboard.js +252 -330
  17. package/dist/commands/dashboard.js.map +1 -1
  18. package/dist/commands/decision.d.ts +38 -27
  19. package/dist/commands/decision.d.ts.map +1 -1
  20. package/dist/commands/decision.js +301 -131
  21. package/dist/commands/decision.js.map +1 -1
  22. package/dist/commands/metrics.d.ts +28 -51
  23. package/dist/commands/metrics.d.ts.map +1 -1
  24. package/dist/commands/metrics.js +62 -93
  25. package/dist/commands/metrics.js.map +1 -1
  26. package/dist/commands/shared-output.d.ts +12 -27
  27. package/dist/commands/shared-output.d.ts.map +1 -1
  28. package/dist/commands/shared-output.js +22 -45
  29. package/dist/commands/shared-output.js.map +1 -1
  30. package/dist/commands/show.d.ts +4 -7
  31. package/dist/commands/show.d.ts.map +1 -1
  32. package/dist/commands/show.js +23 -11
  33. package/dist/commands/show.js.map +1 -1
  34. package/dist/commands/validate.d.ts +34 -58
  35. package/dist/commands/validate.d.ts.map +1 -1
  36. package/dist/commands/validate.js +228 -142
  37. package/dist/commands/validate.js.map +1 -1
  38. package/dist/commands/workflow/index.d.ts +1 -5
  39. package/dist/commands/workflow/index.d.ts.map +1 -1
  40. package/dist/commands/workflow/index.js +1 -5
  41. package/dist/commands/workflow/index.js.map +1 -1
  42. package/dist/commands/workflow/instructions.d.ts +14 -24
  43. package/dist/commands/workflow/instructions.d.ts.map +1 -1
  44. package/dist/commands/workflow/instructions.js +230 -132
  45. package/dist/commands/workflow/instructions.js.map +1 -1
  46. package/dist/commands/workflow/new-change.d.ts +2 -5
  47. package/dist/commands/workflow/new-change.d.ts.map +1 -1
  48. package/dist/commands/workflow/new-change.js +75 -34
  49. package/dist/commands/workflow/new-change.js.map +1 -1
  50. package/dist/commands/workflow/schemas.d.ts +1 -5
  51. package/dist/commands/workflow/schemas.d.ts.map +1 -1
  52. package/dist/commands/workflow/schemas.js +6 -17
  53. package/dist/commands/workflow/schemas.js.map +1 -1
  54. package/dist/commands/workflow/shared.d.ts +37 -42
  55. package/dist/commands/workflow/shared.d.ts.map +1 -1
  56. package/dist/commands/workflow/shared.js +23 -54
  57. package/dist/commands/workflow/shared.js.map +1 -1
  58. package/dist/commands/workflow/status.d.ts +7 -17
  59. package/dist/commands/workflow/status.d.ts.map +1 -1
  60. package/dist/commands/workflow/status.js +57 -72
  61. package/dist/commands/workflow/status.js.map +1 -1
  62. package/dist/commands/workflow/templates.d.ts +8 -8
  63. package/dist/commands/workflow/templates.d.ts.map +1 -1
  64. package/dist/commands/workflow/templates.js +32 -46
  65. package/dist/commands/workflow/templates.js.map +1 -1
  66. package/dist/core/archive.d.ts +33 -31
  67. package/dist/core/archive.d.ts.map +1 -1
  68. package/dist/core/archive.js +322 -284
  69. package/dist/core/archive.js.map +1 -1
  70. package/dist/core/artifact-graph/graph.d.ts +25 -42
  71. package/dist/core/artifact-graph/graph.d.ts.map +1 -1
  72. package/dist/core/artifact-graph/graph.js +45 -63
  73. package/dist/core/artifact-graph/graph.js.map +1 -1
  74. package/dist/core/artifact-graph/index.d.ts +1 -1
  75. package/dist/core/artifact-graph/index.d.ts.map +1 -1
  76. package/dist/core/artifact-graph/index.js +1 -1
  77. package/dist/core/artifact-graph/index.js.map +1 -1
  78. package/dist/core/artifact-graph/instruction-loader.d.ts +54 -120
  79. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
  80. package/dist/core/artifact-graph/instruction-loader.js +129 -111
  81. package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
  82. package/dist/core/artifact-graph/outputs.d.ts +9 -23
  83. package/dist/core/artifact-graph/outputs.d.ts.map +1 -1
  84. package/dist/core/artifact-graph/outputs.js +45 -38
  85. package/dist/core/artifact-graph/outputs.js.map +1 -1
  86. package/dist/core/artifact-graph/resolver.d.ts +36 -81
  87. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  88. package/dist/core/artifact-graph/resolver.js +60 -101
  89. package/dist/core/artifact-graph/resolver.js.map +1 -1
  90. package/dist/core/artifact-graph/schema.d.ts +0 -6
  91. package/dist/core/artifact-graph/schema.d.ts.map +1 -1
  92. package/dist/core/artifact-graph/schema.js +7 -32
  93. package/dist/core/artifact-graph/schema.js.map +1 -1
  94. package/dist/core/artifact-graph/state.d.ts +1 -8
  95. package/dist/core/artifact-graph/state.d.ts.map +1 -1
  96. package/dist/core/artifact-graph/state.js +2 -17
  97. package/dist/core/artifact-graph/state.js.map +1 -1
  98. package/dist/core/artifact-graph/stub-detection.d.ts +6 -14
  99. package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
  100. package/dist/core/artifact-graph/stub-detection.js +13 -16
  101. package/dist/core/artifact-graph/stub-detection.js.map +1 -1
  102. package/dist/core/artifact-graph/types.d.ts +4 -0
  103. package/dist/core/artifact-graph/types.d.ts.map +1 -1
  104. package/dist/core/artifact-graph/types.js +46 -11
  105. package/dist/core/artifact-graph/types.js.map +1 -1
  106. package/dist/core/available-tools.d.ts +3 -12
  107. package/dist/core/available-tools.d.ts.map +1 -1
  108. package/dist/core/available-tools.js +4 -13
  109. package/dist/core/available-tools.js.map +1 -1
  110. package/dist/core/change-metadata/schema.d.ts +1 -1
  111. package/dist/core/change-metadata/schema.d.ts.map +1 -1
  112. package/dist/core/change-metadata/schema.js +10 -7
  113. package/dist/core/change-metadata/schema.js.map +1 -1
  114. package/dist/core/change-presenter.d.ts +16 -27
  115. package/dist/core/change-presenter.d.ts.map +1 -1
  116. package/dist/core/change-presenter.js +53 -53
  117. package/dist/core/change-presenter.js.map +1 -1
  118. package/dist/core/change-status-policy.d.ts +4 -8
  119. package/dist/core/change-status-policy.d.ts.map +1 -1
  120. package/dist/core/change-status-policy.js +9 -17
  121. package/dist/core/change-status-policy.js.map +1 -1
  122. package/dist/core/codex-metrics.d.ts +25 -45
  123. package/dist/core/codex-metrics.d.ts.map +1 -1
  124. package/dist/core/codex-metrics.js +44 -88
  125. package/dist/core/codex-metrics.js.map +1 -1
  126. package/dist/core/codex-residue.d.ts +14 -15
  127. package/dist/core/codex-residue.d.ts.map +1 -1
  128. package/dist/core/codex-residue.js +18 -22
  129. package/dist/core/codex-residue.js.map +1 -1
  130. package/dist/core/command-generation/adapters/claude.d.ts +2 -9
  131. package/dist/core/command-generation/adapters/claude.d.ts.map +1 -1
  132. package/dist/core/command-generation/adapters/claude.js +2 -12
  133. package/dist/core/command-generation/adapters/claude.js.map +1 -1
  134. package/dist/core/command-generation/adapters/index.d.ts +1 -9
  135. package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
  136. package/dist/core/command-generation/adapters/index.js +1 -9
  137. package/dist/core/command-generation/adapters/index.js.map +1 -1
  138. package/dist/core/command-generation/generator.d.ts +0 -17
  139. package/dist/core/command-generation/generator.d.ts.map +1 -1
  140. package/dist/core/command-generation/generator.js +0 -17
  141. package/dist/core/command-generation/generator.js.map +1 -1
  142. package/dist/core/command-generation/index.d.ts +2 -5
  143. package/dist/core/command-generation/index.d.ts.map +1 -1
  144. package/dist/core/command-generation/index.js +0 -9
  145. package/dist/core/command-generation/index.js.map +1 -1
  146. package/dist/core/command-generation/types.d.ts +10 -36
  147. package/dist/core/command-generation/types.d.ts.map +1 -1
  148. package/dist/core/command-generation/types.js +0 -6
  149. package/dist/core/command-generation/types.js.map +1 -1
  150. package/dist/core/command-generation/yaml.d.ts +3 -18
  151. package/dist/core/command-generation/yaml.d.ts.map +1 -1
  152. package/dist/core/command-generation/yaml.js +5 -23
  153. package/dist/core/command-generation/yaml.js.map +1 -1
  154. package/dist/core/config-prompts.d.ts +2 -4
  155. package/dist/core/config-prompts.d.ts.map +1 -1
  156. package/dist/core/config-prompts.js +2 -7
  157. package/dist/core/config-prompts.js.map +1 -1
  158. package/dist/core/config-schema.d.ts +7 -41
  159. package/dist/core/config-schema.d.ts.map +1 -1
  160. package/dist/core/config-schema.js +35 -74
  161. package/dist/core/config-schema.js.map +1 -1
  162. package/dist/core/config.d.ts +25 -49
  163. package/dist/core/config.d.ts.map +1 -1
  164. package/dist/core/config.js +22 -45
  165. package/dist/core/config.js.map +1 -1
  166. package/dist/core/dashboard-activity.d.ts +7 -9
  167. package/dist/core/dashboard-activity.d.ts.map +1 -1
  168. package/dist/core/dashboard-activity.js +34 -25
  169. package/dist/core/dashboard-activity.js.map +1 -1
  170. package/dist/core/dashboard-data.d.ts +35 -22
  171. package/dist/core/dashboard-data.d.ts.map +1 -1
  172. package/dist/core/dashboard-data.js +57 -72
  173. package/dist/core/dashboard-data.js.map +1 -1
  174. package/dist/core/global-config.d.ts +24 -53
  175. package/dist/core/global-config.d.ts.map +1 -1
  176. package/dist/core/global-config.js +38 -67
  177. package/dist/core/global-config.js.map +1 -1
  178. package/dist/core/init.d.ts +12 -28
  179. package/dist/core/init.d.ts.map +1 -1
  180. package/dist/core/init.js +93 -169
  181. package/dist/core/init.js.map +1 -1
  182. package/dist/core/list.d.ts.map +1 -1
  183. package/dist/core/list.js +95 -41
  184. package/dist/core/list.js.map +1 -1
  185. package/dist/core/local-server.d.ts +41 -83
  186. package/dist/core/local-server.d.ts.map +1 -1
  187. package/dist/core/local-server.js +53 -98
  188. package/dist/core/local-server.js.map +1 -1
  189. package/dist/core/markdown-render.d.ts +15 -23
  190. package/dist/core/markdown-render.d.ts.map +1 -1
  191. package/dist/core/markdown-render.js +25 -34
  192. package/dist/core/markdown-render.js.map +1 -1
  193. package/dist/core/migrate.d.ts +19 -16
  194. package/dist/core/migrate.d.ts.map +1 -1
  195. package/dist/core/migrate.js +162 -136
  196. package/dist/core/migrate.js.map +1 -1
  197. package/dist/core/parsers/change-parser.d.ts +7 -10
  198. package/dist/core/parsers/change-parser.d.ts.map +1 -1
  199. package/dist/core/parsers/change-parser.js +48 -56
  200. package/dist/core/parsers/change-parser.js.map +1 -1
  201. package/dist/core/parsers/markdown-parser.d.ts +8 -9
  202. package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
  203. package/dist/core/parsers/markdown-parser.js +23 -30
  204. package/dist/core/parsers/markdown-parser.js.map +1 -1
  205. package/dist/core/parsers/requirement-blocks.d.ts +43 -15
  206. package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
  207. package/dist/core/parsers/requirement-blocks.js +142 -70
  208. package/dist/core/parsers/requirement-blocks.js.map +1 -1
  209. package/dist/core/parsers/requirement-text.d.ts +73 -79
  210. package/dist/core/parsers/requirement-text.d.ts.map +1 -1
  211. package/dist/core/parsers/requirement-text.js +137 -79
  212. package/dist/core/parsers/requirement-text.js.map +1 -1
  213. package/dist/core/parsers/spec-structure.d.ts.map +1 -1
  214. package/dist/core/parsers/spec-structure.js +10 -6
  215. package/dist/core/parsers/spec-structure.js.map +1 -1
  216. package/dist/core/profiles.d.ts +3 -10
  217. package/dist/core/profiles.d.ts.map +1 -1
  218. package/dist/core/profiles.js +5 -12
  219. package/dist/core/profiles.js.map +1 -1
  220. package/dist/core/project-config.d.ts +43 -44
  221. package/dist/core/project-config.d.ts.map +1 -1
  222. package/dist/core/project-config.js +107 -82
  223. package/dist/core/project-config.js.map +1 -1
  224. package/dist/core/project-layout.d.ts +9 -17
  225. package/dist/core/project-layout.d.ts.map +1 -1
  226. package/dist/core/project-layout.js +16 -26
  227. package/dist/core/project-layout.js.map +1 -1
  228. package/dist/core/root-selection.d.ts +8 -14
  229. package/dist/core/root-selection.d.ts.map +1 -1
  230. package/dist/core/root-selection.js +3 -6
  231. package/dist/core/root-selection.js.map +1 -1
  232. package/dist/core/rules.d.ts.map +1 -1
  233. package/dist/core/rules.js +2 -3
  234. package/dist/core/rules.js.map +1 -1
  235. package/dist/core/schema-names.d.ts +16 -0
  236. package/dist/core/schema-names.d.ts.map +1 -0
  237. package/dist/core/schema-names.js +16 -0
  238. package/dist/core/schema-names.js.map +1 -0
  239. package/dist/core/schemas/base.schema.d.ts.map +1 -1
  240. package/dist/core/schemas/base.schema.js +6 -12
  241. package/dist/core/schemas/base.schema.js.map +1 -1
  242. package/dist/core/schemas/change.schema.d.ts +8 -0
  243. package/dist/core/schemas/change.schema.d.ts.map +1 -1
  244. package/dist/core/schemas/change.schema.js +41 -10
  245. package/dist/core/schemas/change.schema.js.map +1 -1
  246. package/dist/core/shared/index.d.ts +2 -7
  247. package/dist/core/shared/index.d.ts.map +1 -1
  248. package/dist/core/shared/index.js +2 -7
  249. package/dist/core/shared/index.js.map +1 -1
  250. package/dist/core/shared/rules-generation.d.ts +5 -15
  251. package/dist/core/shared/rules-generation.d.ts.map +1 -1
  252. package/dist/core/shared/rules-generation.js +33 -37
  253. package/dist/core/shared/rules-generation.js.map +1 -1
  254. package/dist/core/shared/skill-generation.d.ts +28 -43
  255. package/dist/core/shared/skill-generation.d.ts.map +1 -1
  256. package/dist/core/shared/skill-generation.js +82 -51
  257. package/dist/core/shared/skill-generation.js.map +1 -1
  258. package/dist/core/shared/tool-detection.d.ts +35 -76
  259. package/dist/core/shared/tool-detection.d.ts.map +1 -1
  260. package/dist/core/shared/tool-detection.js +73 -93
  261. package/dist/core/shared/tool-detection.js.map +1 -1
  262. package/dist/core/skill-metrics.d.ts +36 -63
  263. package/dist/core/skill-metrics.d.ts.map +1 -1
  264. package/dist/core/skill-metrics.js +34 -73
  265. package/dist/core/skill-metrics.js.map +1 -1
  266. package/dist/core/spec-presenter.d.ts.map +1 -1
  267. package/dist/core/spec-presenter.js +5 -10
  268. package/dist/core/spec-presenter.js.map +1 -1
  269. package/dist/core/specs-apply.d.ts +16 -31
  270. package/dist/core/specs-apply.d.ts.map +1 -1
  271. package/dist/core/specs-apply.js +146 -195
  272. package/dist/core/specs-apply.js.map +1 -1
  273. package/dist/core/templates/fragments/interview.d.ts +2 -6
  274. package/dist/core/templates/fragments/interview.d.ts.map +1 -1
  275. package/dist/core/templates/fragments/interview.js +2 -6
  276. package/dist/core/templates/fragments/interview.js.map +1 -1
  277. package/dist/core/templates/fragments/next-step.d.ts +4 -8
  278. package/dist/core/templates/fragments/next-step.d.ts.map +1 -1
  279. package/dist/core/templates/fragments/next-step.js +4 -8
  280. package/dist/core/templates/fragments/next-step.js.map +1 -1
  281. package/dist/core/templates/fragments/validate.d.ts +13 -0
  282. package/dist/core/templates/fragments/validate.d.ts.map +1 -0
  283. package/dist/core/templates/fragments/validate.js +13 -0
  284. package/dist/core/templates/fragments/validate.js.map +1 -0
  285. package/dist/core/templates/fragments/verify.d.ts +9 -12
  286. package/dist/core/templates/fragments/verify.d.ts.map +1 -1
  287. package/dist/core/templates/fragments/verify.js +9 -12
  288. package/dist/core/templates/fragments/verify.js.map +1 -1
  289. package/dist/core/templates/index.d.ts +0 -6
  290. package/dist/core/templates/index.d.ts.map +1 -1
  291. package/dist/core/templates/index.js +0 -7
  292. package/dist/core/templates/index.js.map +1 -1
  293. package/dist/core/templates/skill-templates.d.ts +1 -5
  294. package/dist/core/templates/skill-templates.d.ts.map +1 -1
  295. package/dist/core/templates/skill-templates.js +0 -5
  296. package/dist/core/templates/skill-templates.js.map +1 -1
  297. package/dist/core/templates/types.d.ts +3 -7
  298. package/dist/core/templates/types.d.ts.map +1 -1
  299. package/dist/core/templates/types.js +0 -3
  300. package/dist/core/templates/types.js.map +1 -1
  301. package/dist/core/templates/workflows/apply.d.ts +3 -9
  302. package/dist/core/templates/workflows/apply.d.ts.map +1 -1
  303. package/dist/core/templates/workflows/apply.js +11 -13
  304. package/dist/core/templates/workflows/apply.js.map +1 -1
  305. package/dist/core/templates/workflows/archive.d.ts +0 -6
  306. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  307. package/dist/core/templates/workflows/archive.js +16 -5
  308. package/dist/core/templates/workflows/archive.js.map +1 -1
  309. package/dist/core/templates/workflows/decision.js +3 -3
  310. package/dist/core/templates/workflows/decision.js.map +1 -1
  311. package/dist/core/templates/workflows/explore.js +1 -1
  312. package/dist/core/templates/workflows/grill.d.ts.map +1 -1
  313. package/dist/core/templates/workflows/grill.js +0 -2
  314. package/dist/core/templates/workflows/grill.js.map +1 -1
  315. package/dist/core/templates/workflows/issue.d.ts +0 -6
  316. package/dist/core/templates/workflows/issue.d.ts.map +1 -1
  317. package/dist/core/templates/workflows/issue.js +3 -2
  318. package/dist/core/templates/workflows/issue.js.map +1 -1
  319. package/dist/core/templates/workflows/propose.d.ts +0 -6
  320. package/dist/core/templates/workflows/propose.d.ts.map +1 -1
  321. package/dist/core/templates/workflows/propose.js +2 -2
  322. package/dist/core/templates/workflows/propose.js.map +1 -1
  323. package/dist/core/templates/workflows/sync.d.ts +2 -8
  324. package/dist/core/templates/workflows/sync.d.ts.map +1 -1
  325. package/dist/core/templates/workflows/sync.js +4 -3
  326. package/dist/core/templates/workflows/sync.js.map +1 -1
  327. package/dist/core/templates/workflows/update.d.ts +0 -6
  328. package/dist/core/templates/workflows/update.d.ts.map +1 -1
  329. package/dist/core/templates/workflows/update.js +9 -2
  330. package/dist/core/templates/workflows/update.js.map +1 -1
  331. package/dist/core/update.d.ts +10 -36
  332. package/dist/core/update.d.ts.map +1 -1
  333. package/dist/core/update.js +59 -126
  334. package/dist/core/update.js.map +1 -1
  335. package/dist/core/user-state-migration.d.ts +13 -15
  336. package/dist/core/user-state-migration.d.ts.map +1 -1
  337. package/dist/core/user-state-migration.js +30 -23
  338. package/dist/core/user-state-migration.js.map +1 -1
  339. package/dist/core/validation/constants.d.ts +4 -10
  340. package/dist/core/validation/constants.d.ts.map +1 -1
  341. package/dist/core/validation/constants.js +25 -25
  342. package/dist/core/validation/constants.js.map +1 -1
  343. package/dist/core/validation/prose-length.d.ts +15 -0
  344. package/dist/core/validation/prose-length.d.ts.map +1 -0
  345. package/dist/core/validation/prose-length.js +29 -0
  346. package/dist/core/validation/prose-length.js.map +1 -0
  347. package/dist/core/validation/purpose-placeholder.d.ts +9 -16
  348. package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
  349. package/dist/core/validation/purpose-placeholder.js +30 -44
  350. package/dist/core/validation/purpose-placeholder.js.map +1 -1
  351. package/dist/core/validation/section-validator.d.ts +4 -4
  352. package/dist/core/validation/section-validator.d.ts.map +1 -1
  353. package/dist/core/validation/section-validator.js +30 -12
  354. package/dist/core/validation/section-validator.js.map +1 -1
  355. package/dist/core/validation/task-numbering.d.ts +6 -3
  356. package/dist/core/validation/task-numbering.d.ts.map +1 -1
  357. package/dist/core/validation/task-numbering.js +23 -11
  358. package/dist/core/validation/task-numbering.js.map +1 -1
  359. package/dist/core/validation/types.d.ts +18 -0
  360. package/dist/core/validation/types.d.ts.map +1 -1
  361. package/dist/core/validation/types.js +12 -1
  362. package/dist/core/validation/types.js.map +1 -1
  363. package/dist/core/validation/validator.d.ts +42 -68
  364. package/dist/core/validation/validator.d.ts.map +1 -1
  365. package/dist/core/validation/validator.js +474 -285
  366. package/dist/core/validation/validator.js.map +1 -1
  367. package/dist/prompts/searchable-multi-select.d.ts +3 -8
  368. package/dist/prompts/searchable-multi-select.d.ts.map +1 -1
  369. package/dist/prompts/searchable-multi-select.js +16 -39
  370. package/dist/prompts/searchable-multi-select.js.map +1 -1
  371. package/dist/utils/change-metadata.d.ts +11 -50
  372. package/dist/utils/change-metadata.d.ts.map +1 -1
  373. package/dist/utils/change-metadata.js +48 -67
  374. package/dist/utils/change-metadata.js.map +1 -1
  375. package/dist/utils/change-utils.d.ts +24 -76
  376. package/dist/utils/change-utils.d.ts.map +1 -1
  377. package/dist/utils/change-utils.js +95 -142
  378. package/dist/utils/change-utils.js.map +1 -1
  379. package/dist/utils/file-lock.d.ts +39 -0
  380. package/dist/utils/file-lock.d.ts.map +1 -0
  381. package/dist/utils/file-lock.js +149 -0
  382. package/dist/utils/file-lock.js.map +1 -0
  383. package/dist/utils/file-system.d.ts +12 -32
  384. package/dist/utils/file-system.d.ts.map +1 -1
  385. package/dist/utils/file-system.js +41 -45
  386. package/dist/utils/file-system.js.map +1 -1
  387. package/dist/utils/frontmatter.d.ts +7 -11
  388. package/dist/utils/frontmatter.d.ts.map +1 -1
  389. package/dist/utils/frontmatter.js +11 -11
  390. package/dist/utils/frontmatter.js.map +1 -1
  391. package/dist/utils/interactive.d.ts +4 -9
  392. package/dist/utils/interactive.d.ts.map +1 -1
  393. package/dist/utils/interactive.js +2 -4
  394. package/dist/utils/interactive.js.map +1 -1
  395. package/dist/utils/item-discovery.d.ts +10 -20
  396. package/dist/utils/item-discovery.d.ts.map +1 -1
  397. package/dist/utils/item-discovery.js +31 -55
  398. package/dist/utils/item-discovery.js.map +1 -1
  399. package/dist/utils/link.d.ts +9 -18
  400. package/dist/utils/link.d.ts.map +1 -1
  401. package/dist/utils/link.js +9 -18
  402. package/dist/utils/link.js.map +1 -1
  403. package/dist/utils/requirement-diff.d.ts +13 -23
  404. package/dist/utils/requirement-diff.d.ts.map +1 -1
  405. package/dist/utils/requirement-diff.js +13 -23
  406. package/dist/utils/requirement-diff.js.map +1 -1
  407. package/dist/utils/spec-files.d.ts +7 -20
  408. package/dist/utils/spec-files.d.ts.map +1 -1
  409. package/dist/utils/spec-files.js +26 -51
  410. package/dist/utils/spec-files.js.map +1 -1
  411. package/dist/utils/task-progress.d.ts +11 -9
  412. package/dist/utils/task-progress.d.ts.map +1 -1
  413. package/dist/utils/task-progress.js +53 -32
  414. package/dist/utils/task-progress.js.map +1 -1
  415. package/dist/utils/timestamp.d.ts +5 -8
  416. package/dist/utils/timestamp.d.ts.map +1 -1
  417. package/dist/utils/timestamp.js +5 -8
  418. package/dist/utils/timestamp.js.map +1 -1
  419. package/package.json +2 -3
  420. package/schemas/issue/schema.yaml +8 -1
  421. package/schemas/issue/templates/spec.md +20 -3
  422. package/schemas/sdd/schema.yaml +20 -1
  423. package/schemas/sdd/templates/spec.md +20 -3
@@ -21,14 +21,10 @@ export interface ChangeStatusPolicyArtifact {
21
21
  status: ArtifactStatusValue;
22
22
  }
23
23
  /**
24
- * `optional` and `skipped` are separate values, not one.
25
- *
26
- * Round 4 report 12: both an optional artifact nobody has written and one the
27
- * change declared away with `skip_specs: true` reported `skipped`, so a caller
28
- * could not tell "you may still write this" from "this change says there is
29
- * nothing to write". The issue schema's delta specs are the case that matters:
30
- * its own instruction says to write them when the fix changes observable
31
- * behaviour, and an agent driving off this field was told they were skipped.
24
+ * `optional` and `skipped` are separate values: collapsed into one, a caller
25
+ * cannot tell "you may still write this" from "this change says there is
26
+ * nothing to write". The issue schema's delta specs are the case that matters —
27
+ * its instruction asks for them whenever the fix changes observable behaviour.
32
28
  */
33
29
  export type ArtifactStatusValue = 'done' | 'ready' | 'blocked' | 'skipped' | 'optional' | 'stub';
34
30
  export interface ChangeNextStepsInput {
@@ -1 +1 @@
1
- {"version":3,"file":"change-status-policy.d.ts","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjG,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,0BAA0B,EAAE,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,mBAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAU3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAiCpE"}
1
+ {"version":3,"file":"change-status-policy.d.ts","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjG,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,0BAA0B,EAAE,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,mBAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAU3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CA+BpE"}
@@ -29,16 +29,14 @@ export function buildNextSteps(input) {
29
29
  }
30
30
  if (input.allArtifactsComplete) {
31
31
  steps.push('All planning artifacts are complete; review tasks before implementation.');
32
- // Still offered: "complete" means every *required* artifact is written, and
33
- // an unwritten optional one is exactly what a reader would want told here.
32
+ // Still offered: "complete" means every *required* artifact is written, so
33
+ // an unwritten optional one is worth naming here.
34
34
  steps.push(...optionalSteps(input));
35
35
  return steps;
36
36
  }
37
- // A stub is neither ready nor done, so without this the only state that
38
- // reports `isComplete: false` with no next step at all was the one where the
39
- // work looks finished from a directory listing: the files exist and still hold
40
- // the template. Human output named it (`[!] design (stub: ...)`); the machine
41
- // contract left a caller with nothing to do and no reason why.
37
+ // A stub is neither ready nor done, so without this it is the one state
38
+ // reporting `isComplete: false` with no next step — and the one that looks
39
+ // finished from a directory listing.
42
40
  const stubs = input.artifactStatuses.filter((artifact) => artifact.status === 'stub');
43
41
  for (const stub of stubs) {
44
42
  steps.push(`Artifact ${stub.id} is still the unfilled template. Run tospec instructions ${stub.id} --change "${input.changeName}" --json, then replace the file's contents.`);
@@ -47,16 +45,10 @@ export function buildNextSteps(input) {
47
45
  return steps;
48
46
  }
49
47
  /**
50
- * Optional artifacts an author may still want to write.
51
- *
52
- * They never reach `ready` — an optional artifact is not a prerequisite for
53
- * anything — so before this they appeared in no next step at any point in a
54
- * change's life (round 4 report 12). An agent following `nextSteps` therefore
55
- * never wrote delta specs for an issue fix, even though the issue schema's own
56
- * instruction asks for them whenever the fix changes observable behaviour.
57
- *
58
- * Phrased as an offer, not an instruction: the whole point of `optional` is
59
- * that skipping it is a legitimate outcome.
48
+ * Optional artifacts an author may still want to write. Nothing depends on them,
49
+ * so they never reach `ready` and would otherwise appear in no next step at any
50
+ * point in a change's life. Phrased as an offer, not an instruction: skipping
51
+ * an optional artifact is a legitimate outcome.
60
52
  */
61
53
  function optionalSteps(input) {
62
54
  return input.artifactStatuses
@@ -1 +1 @@
1
- {"version":3,"file":"change-status-policy.js","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,qBAAqB,CACnC,YAAsC;IAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,UAAU,EAAE,YAAY,CAAC,UAAU;QACnC,aAAa,EAAE,YAAY,CAAC,aAAa;KAC1C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,OAAO;QACL,IAAI,EAAE,YAAY;QAClB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C,UAAU,mCAAmC,CACnJ,CAAC;AACN,CAAC"}
@@ -3,22 +3,17 @@
3
3
  * report `skill-metrics.ts` builds from Claude Code transcripts.
4
4
  *
5
5
  * Codex keeps one session tree shared by every project
6
- * (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`),
7
- * partitioned by date rather than by project, with the working directory
8
- * recorded once per session (`type: "session_meta"`, `payload.cwd`) rather than
9
- * encoded into a directory name. Project scoping therefore reads that field
10
- * instead of resolving a path (see codex-metrics-source spec, "Codex sessions
11
- * are scoped to a project by their recorded working directory").
6
+ * (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`), with
7
+ * the working directory recorded once per session (`type: "session_meta"`,
8
+ * `payload.cwd`) rather than encoded into a directory name, so project scoping
9
+ * reads that field instead of resolving a path.
12
10
  *
13
- * Codex transcripts carry nothing like Claude Code's `attributionSkill`. Every
14
- * session's system prompt lists all installed skills identically whether or
15
- * not any of them were used, so that listing carries no signal. The one event
16
- * confirmed (against this project's own real `~/.codex` history) to correlate
17
- * with a skill actually being used is a tool-call command whose text reads a
18
- * path ending in `<skill-name>/SKILL.md` — the moment the agent pulls in that
19
- * skill's instructions. Skill attribution here is therefore a heuristic, not a
20
- * recorded fact, and undercounts by construction: a skill run that never
21
- * re-reads its own instructions file is invisible to it.
11
+ * Codex transcripts carry nothing like `attributionSkill`, and the system prompt
12
+ * lists every installed skill whether used or not, so that listing is no signal.
13
+ * The one event that correlates with a skill being used is a tool-call command
14
+ * reading a path ending in `<skill-name>/SKILL.md`. Attribution here is
15
+ * therefore a heuristic that undercounts: a run that never re-reads its own
16
+ * instructions file is invisible.
22
17
  */
23
18
  import { type RunGroupingOptions, type SkillMetrics, type TranscriptEntry } from './skill-metrics.js';
24
19
  export interface CodexSessionsDirOptions {
@@ -26,16 +21,13 @@ export interface CodexSessionsDirOptions {
26
21
  homedir?: string;
27
22
  }
28
23
  /**
29
- * Locates Codex's session tree. `CODEX_HOME` is honoured the same way
30
- * `CLAUDE_CONFIG_DIR` is for Claude Code; without it the default is
31
- * `~/.codex`. This is the directory to search, not a per-project one — Codex
32
- * has no equivalent of Claude Code's per-project transcript directory.
24
+ * Codex's session tree (`CODEX_HOME`, else `~/.codex`). The whole directory has
25
+ * to be searched: Codex has no per-project transcript directory.
33
26
  */
34
27
  export declare function resolveCodexSessionsDir(options?: CodexSessionsDirOptions): string;
35
28
  /**
36
- * Whether a session's recorded working directory names the given project.
37
- * `null` (no `session_meta` seen, or no `cwd` field) never matches — a session
38
- * with nothing recorded cannot be attributed to any project.
29
+ * Whether a session's recorded working directory names the given project. `null`
30
+ * never matches: a session with nothing recorded belongs to no project.
39
31
  */
40
32
  export declare function sessionBelongsToProject(cwd: string | null, rootPath: string): boolean;
41
33
  export interface CodexSessionResult {
@@ -44,18 +36,13 @@ export interface CodexSessionResult {
44
36
  entries: TranscriptEntry[];
45
37
  }
46
38
  /**
47
- * Parses one Codex rollout `.jsonl` file into the recorded project directory
48
- * plus a sorted, timestamped, skill-labelled entry list — the same shape
49
- * `parseTranscript` produces for Claude Code, so `buildRuns`/`aggregateRuns`
50
- * apply unchanged (design.md D3). Malformed lines are skipped rather than
51
- * fatal, for the same reason Claude Code transcripts are: an append-only log
52
- * that can be torn at the tail while a session is live.
39
+ * Produces the same shape `parseTranscript` does for Claude Code, so
40
+ * `buildRuns`/`aggregateRuns` apply unchanged (D3). Malformed lines are skipped:
41
+ * an append-only log can be torn at the tail.
53
42
  *
54
- * Only `function_call`/`custom_tool_call` entries are ever inspected for a
55
- * `SKILL.md` read. Every other entry — including the one carrying the fixed
56
- * skill-listing text every session opens with — is folded in unattributed
57
- * (`skill: null`), exactly as an unattributed Claude Code entry is: it cannot
58
- * end a run, but it is not evidence a skill became active either.
43
+ * Only `function_call`/`custom_tool_call` entries are inspected for a `SKILL.md`
44
+ * read. Everything else — including the fixed skill-listing text every session
45
+ * opens with — is folded in unattributed.
59
46
  */
60
47
  export declare function parseCodexSession(text: string): CodexSessionResult;
61
48
  export interface CodexProjectSession {
@@ -71,11 +58,8 @@ export interface CodexSessionScan {
71
58
  sessions: CodexProjectSession[];
72
59
  }
73
60
  /**
74
- * Finds and parses every Codex session belonging to one project.
75
- *
76
- * Shared by `collectCodexSkillMetrics` and the metrics server, which need
77
- * exactly this and previously each carried their own copy of the walk — so the
78
- * probe optimisation could otherwise have been applied to one and not the other.
61
+ * Finds and parses every Codex session belonging to one project. Shared by
62
+ * `collectCodexSkillMetrics` and the metrics server, so the probe reaches both.
79
63
  */
80
64
  export declare function scanCodexSessions(rootPath: string, options?: CodexSessionsDirOptions): Promise<CodexSessionScan>;
81
65
  export interface CollectCodexMetricsOptions extends RunGroupingOptions, CodexSessionsDirOptions {
@@ -83,13 +67,9 @@ export interface CollectCodexMetricsOptions extends RunGroupingOptions, CodexSes
83
67
  sinceMs?: number;
84
68
  }
85
69
  /**
86
- * Derives skill timings from the `SKILL.md`-read heuristic over this project's
87
- * Codex sessions — the Codex-flavoured equivalent of `collectSkillMetrics`.
88
- * `scanCodexSessions` does the finding and scoping.
89
- *
90
- * A missing sessions directory is a reportable state (`available: false`), not
91
- * an error, for the same reason it is for Claude Code: the project may simply
92
- * never have been opened in Codex.
70
+ * The Codex equivalent of `collectSkillMetrics`, over the `SKILL.md`-read
71
+ * heuristic. A missing sessions directory is a reportable state
72
+ * (`available: false`), not an error.
93
73
  */
94
74
  export declare function collectCodexSkillMetrics(rootPath: string, options?: CollectCodexMetricsOptions): Promise<SkillMetrics>;
95
75
  //# sourceMappingURL=codex-metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-metrics.d.ts","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,WAAW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AAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,YAAY,CAAC,CAqDvB"}
@@ -3,22 +3,17 @@
3
3
  * report `skill-metrics.ts` builds from Claude Code transcripts.
4
4
  *
5
5
  * Codex keeps one session tree shared by every project
6
- * (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`),
7
- * partitioned by date rather than by project, with the working directory
8
- * recorded once per session (`type: "session_meta"`, `payload.cwd`) rather than
9
- * encoded into a directory name. Project scoping therefore reads that field
10
- * instead of resolving a path (see codex-metrics-source spec, "Codex sessions
11
- * are scoped to a project by their recorded working directory").
6
+ * (`<CODEX_HOME or ~/.codex>/sessions/<yyyy>/<mm>/<dd>/rollout-*.jsonl`), with
7
+ * the working directory recorded once per session (`type: "session_meta"`,
8
+ * `payload.cwd`) rather than encoded into a directory name, so project scoping
9
+ * reads that field instead of resolving a path.
12
10
  *
13
- * Codex transcripts carry nothing like Claude Code's `attributionSkill`. Every
14
- * session's system prompt lists all installed skills identically whether or
15
- * not any of them were used, so that listing carries no signal. The one event
16
- * confirmed (against this project's own real `~/.codex` history) to correlate
17
- * with a skill actually being used is a tool-call command whose text reads a
18
- * path ending in `<skill-name>/SKILL.md` — the moment the agent pulls in that
19
- * skill's instructions. Skill attribution here is therefore a heuristic, not a
20
- * recorded fact, and undercounts by construction: a skill run that never
21
- * re-reads its own instructions file is invisible to it.
11
+ * Codex transcripts carry nothing like `attributionSkill`, and the system prompt
12
+ * lists every installed skill whether used or not, so that listing is no signal.
13
+ * The one event that correlates with a skill being used is a tool-call command
14
+ * reading a path ending in `<skill-name>/SKILL.md`. Attribution here is
15
+ * therefore a heuristic that undercounts: a run that never re-reads its own
16
+ * instructions file is invisible.
22
17
  */
23
18
  import { promises as fs } from 'node:fs';
24
19
  import * as os from 'node:os';
@@ -27,10 +22,8 @@ import fg from 'fast-glob';
27
22
  import { aggregateRuns, buildRuns, normalizeSkillName, DEFAULT_IDLE_GAP_MS, DEFAULT_SPLIT_GAP_MS, } from './skill-metrics.js';
28
23
  const CODEX_HOME_DIR_NAME = '.codex';
29
24
  /**
30
- * Locates Codex's session tree. `CODEX_HOME` is honoured the same way
31
- * `CLAUDE_CONFIG_DIR` is for Claude Code; without it the default is
32
- * `~/.codex`. This is the directory to search, not a per-project one — Codex
33
- * has no equivalent of Claude Code's per-project transcript directory.
25
+ * Codex's session tree (`CODEX_HOME`, else `~/.codex`). The whole directory has
26
+ * to be searched: Codex has no per-project transcript directory.
34
27
  */
35
28
  export function resolveCodexSessionsDir(options = {}) {
36
29
  const env = options.env ?? process.env;
@@ -40,9 +33,8 @@ export function resolveCodexSessionsDir(options = {}) {
40
33
  return path.join(home, 'sessions');
41
34
  }
42
35
  /**
43
- * Whether a session's recorded working directory names the given project.
44
- * `null` (no `session_meta` seen, or no `cwd` field) never matches — a session
45
- * with nothing recorded cannot be attributed to any project.
36
+ * Whether a session's recorded working directory names the given project. `null`
37
+ * never matches: a session with nothing recorded belongs to no project.
46
38
  */
47
39
  export function sessionBelongsToProject(cwd, rootPath) {
48
40
  if (cwd === null)
@@ -52,11 +44,8 @@ export function sessionBelongsToProject(cwd, rootPath) {
52
44
  return process.platform === 'win32' ? a.toLowerCase() === b.toLowerCase() : a === b;
53
45
  }
54
46
  /**
55
- * The working directory a record records, or null when it is not the kind of
56
- * record that carries one. Shared by the full parse and the prefix probe so a
57
- * single statement defines a session's cwd — the first `session_meta` whose
58
- * `payload.cwd` is a string — and the probe can never disagree with the parse
59
- * it exists to skip.
47
+ * Shared by the full parse and the prefix probe, so the probe cannot disagree
48
+ * with the parse it exists to skip.
60
49
  */
61
50
  function recordedCwd(record) {
62
51
  if (record.type !== 'session_meta')
@@ -65,17 +54,11 @@ function recordedCwd(record) {
65
54
  return typeof cwd === 'string' ? cwd : null;
66
55
  }
67
56
  /**
68
- * Matches a tool-call command's text against a path ending in
69
- * `<skill-name>/SKILL.md`, on either separator. This is the one signal
70
- * confirmed to correlate with a skill actually being read, as opposed to
71
- * merely appearing in the session's fixed skill-listing text (see the module
72
- * docstring).
57
+ * A path ending in `<skill-name>/SKILL.md`, on either separator — the one signal
58
+ * that a skill was read rather than merely listed.
73
59
  *
74
- * `function_call` arguments are JSON-encoded twice — once as the tool-call
75
- * argument string itself, once more for the outer transcript line — so a
76
- * Windows path's single backslash separator survives as a doubled `\\` in the
77
- * text this matches against. The separator class therefore matches one or
78
- * more repetitions rather than exactly one.
60
+ * `function_call` arguments are JSON-encoded twice, so a Windows path's single
61
+ * backslash arrives doubled; hence `[\\/]+`.
79
62
  */
80
63
  const SKILL_MD_READ_PATTERN = /([^\\/"]+)[\\/]+SKILL\.md/i;
81
64
  function extractSkillFromCommandText(text) {
@@ -83,18 +66,13 @@ function extractSkillFromCommandText(text) {
83
66
  return match ? match[1] : null;
84
67
  }
85
68
  /**
86
- * Parses one Codex rollout `.jsonl` file into the recorded project directory
87
- * plus a sorted, timestamped, skill-labelled entry list — the same shape
88
- * `parseTranscript` produces for Claude Code, so `buildRuns`/`aggregateRuns`
89
- * apply unchanged (design.md D3). Malformed lines are skipped rather than
90
- * fatal, for the same reason Claude Code transcripts are: an append-only log
91
- * that can be torn at the tail while a session is live.
69
+ * Produces the same shape `parseTranscript` does for Claude Code, so
70
+ * `buildRuns`/`aggregateRuns` apply unchanged (D3). Malformed lines are skipped:
71
+ * an append-only log can be torn at the tail.
92
72
  *
93
- * Only `function_call`/`custom_tool_call` entries are ever inspected for a
94
- * `SKILL.md` read. Every other entry — including the one carrying the fixed
95
- * skill-listing text every session opens with — is folded in unattributed
96
- * (`skill: null`), exactly as an unattributed Claude Code entry is: it cannot
97
- * end a run, but it is not evidence a skill became active either.
73
+ * Only `function_call`/`custom_tool_call` entries are inspected for a `SKILL.md`
74
+ * read. Everything else — including the fixed skill-listing text every session
75
+ * opens with — is folded in unattributed.
98
76
  */
99
77
  export function parseCodexSession(text) {
100
78
  let cwd = null;
@@ -137,19 +115,11 @@ export function parseCodexSession(text) {
137
115
  entries.sort((a, b) => a.timeMs - b.timeMs);
138
116
  return { cwd, entries };
139
117
  }
140
- // -----------------------------------------------------------------------------
141
- // IO: project scoping without reading whole sessions
142
- // -----------------------------------------------------------------------------
143
118
  /**
144
- * Bytes read from a session when only its `cwd` is wanted.
145
- *
146
- * Codex writes `session_meta` as the very first line, but that line embeds the
147
- * session's whole base-instructions text and so runs to ~20 KB. The probe has
148
- * to be large enough to hold a *complete* line: a line cut by the read boundary
149
- * fails `JSON.parse` and is indistinguishable from an absent one. 64 KiB clears
150
- * the observed maximum several times over, and anything the probe cannot settle
151
- * falls back to a full read — so an unusually long first line costs time, never
152
- * correctness.
119
+ * Bytes read from a session when only its `cwd` is wanted. `session_meta` is the
120
+ * first line but embeds the whole base-instructions text (~20 KB), and the probe
121
+ * must hold a *complete* line — one cut by the read boundary fails `JSON.parse`
122
+ * and looks absent. Anything inconclusive falls back to a full read.
153
123
  */
154
124
  const CWD_PROBE_BYTES = 64 * 1024;
155
125
  /** First recorded cwd in already-read text, stopping at the first one found. */
@@ -171,15 +141,10 @@ function findRecordedCwd(text) {
171
141
  return null;
172
142
  }
173
143
  /**
174
- * Reads just enough of a session to decide which project it belongs to.
175
- *
176
- * Every session in the shared Codex tree has to be classified, but only the
177
- * matching ones are worth parsing, and on a real machine the tree is dominated
178
- * by other projects: the history that motivated this held 716 MB of sessions of
179
- * which one project owned 0.9 MB, and parsing all of it cost ~9 s of the
180
- * command's startup. Because the deciding field sits on line 0, reading a prefix
181
- * instead of the whole file makes the cost proportional to this project's share
182
- * of Codex history rather than to all of it.
144
+ * Reads just enough of a session to decide which project it belongs to. The
145
+ * shared tree is dominated by other projects — one real history held 716 MB of
146
+ * sessions of which this project owned 0.9 MB — and the deciding field sits on
147
+ * line 0, so a prefix read makes the cost proportional to this project's share.
183
148
  */
184
149
  async function probeSessionCwd(filePath) {
185
150
  const handle = await fs.open(filePath, 'r');
@@ -187,8 +152,8 @@ async function probeSessionCwd(filePath) {
187
152
  const buffer = Buffer.alloc(CWD_PROBE_BYTES);
188
153
  const { bytesRead } = await handle.read(buffer, 0, CWD_PROBE_BYTES, 0);
189
154
  const cwd = findRecordedCwd(buffer.subarray(0, bytesRead).toString('utf8'));
190
- // A short read means the prefix was the entire file, so "no session_meta
191
- // here" is the final answer rather than a reason to read it again.
155
+ // A short read means the prefix was the whole file, so "no session_meta
156
+ // here" is final rather than a reason to read it again.
192
157
  return { cwd, conclusive: cwd !== null || bytesRead < CWD_PROBE_BYTES };
193
158
  }
194
159
  finally {
@@ -196,18 +161,14 @@ async function probeSessionCwd(filePath) {
196
161
  }
197
162
  }
198
163
  /**
199
- * Finds and parses every Codex session belonging to one project.
200
- *
201
- * Shared by `collectCodexSkillMetrics` and the metrics server, which need
202
- * exactly this and previously each carried their own copy of the walk — so the
203
- * probe optimisation could otherwise have been applied to one and not the other.
164
+ * Finds and parses every Codex session belonging to one project. Shared by
165
+ * `collectCodexSkillMetrics` and the metrics server, so the probe reaches both.
204
166
  */
205
167
  export async function scanCodexSessions(rootPath, options = {}) {
206
168
  const sessionsDir = resolveCodexSessionsDir(options);
207
169
  // fast-glob returns an empty list for a missing `cwd` rather than throwing,
208
- // so existence has to be checked directly — otherwise "Codex never used on
209
- // this machine" (available: false) would be indistinguishable from "used,
210
- // but nothing here matches this project" (available: true, sessions: 0).
170
+ // so without this check "Codex never ran here" and "ran, but nothing matches
171
+ // this project" look identical.
211
172
  const stat = await fs.stat(sessionsDir).catch(() => null);
212
173
  if (!stat)
213
174
  return { sessionsDir, available: false, sessions: [] };
@@ -218,8 +179,7 @@ export async function scanCodexSessions(rootPath, options = {}) {
218
179
  const probe = await probeSessionCwd(filePath);
219
180
  if (probe.conclusive && !sessionBelongsToProject(probe.cwd, rootPath))
220
181
  continue;
221
- // The probe only ever skips work; the full parse stays authoritative for
222
- // every session that survives it.
182
+ // The probe only skips work; the full parse stays authoritative.
223
183
  const { cwd, entries } = parseCodexSession(await fs.readFile(filePath, 'utf8'));
224
184
  if (!sessionBelongsToProject(cwd, rootPath))
225
185
  continue;
@@ -233,13 +193,9 @@ export async function scanCodexSessions(rootPath, options = {}) {
233
193
  return { sessionsDir, available: true, sessions };
234
194
  }
235
195
  /**
236
- * Derives skill timings from the `SKILL.md`-read heuristic over this project's
237
- * Codex sessions — the Codex-flavoured equivalent of `collectSkillMetrics`.
238
- * `scanCodexSessions` does the finding and scoping.
239
- *
240
- * A missing sessions directory is a reportable state (`available: false`), not
241
- * an error, for the same reason it is for Claude Code: the project may simply
242
- * never have been opened in Codex.
196
+ * The Codex equivalent of `collectSkillMetrics`, over the `SKILL.md`-read
197
+ * heuristic. A missing sessions directory is a reportable state
198
+ * (`available: false`), not an error.
243
199
  */
244
200
  export async function collectCodexSkillMetrics(rootPath, options = {}) {
245
201
  const thresholds = {
@@ -1 +1 @@
1
- {"version":3,"file":"codex-metrics.js","sourceRoot":"","sources":["../../src/core/codex-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GAMrB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAWrC;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAO,GAA4B,EAAE;IAC3E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU;QACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QAC9B,CAAC,CAAC,IAA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AE,CAAC;YACvB,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO;gBAAE,SAAS;YAC3E,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAkB;QAC5B,aAAa,EAAE,IAAI,CAAC,WAAW;QAC/B,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;QAC9B,kBAAkB;QAClB,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;QACjF,QAAQ,EACN,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;KAC/F,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU;QACV,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,OAAO;KACd,CAAC;AACJ,CAAC"}
@@ -1,23 +1,22 @@
1
1
  /**
2
- * Residual Codex Output Detection
3
- *
4
2
  * `.codex` was a write target until Codex turned out to read its skills from
5
- * `.agents`. Projects initialized by an earlier version still hold that output.
6
- *
7
- * This module answers one question and holds no writer: rule files are content
8
- * hash-protected precisely because users edit them, so anything that could
9
- * delete them must not exist here. Removing leftovers stays the user's call.
3
+ * `.agents`, and projects initialized by an earlier version still hold that
4
+ * output. Read-only by design: rule files are content hash-protected precisely
5
+ * because users edit them, so removing leftovers stays the user's call.
10
6
  */
11
7
  /**
12
8
  * Whether `<projectPath>/.codex` still holds tospec output: a `tospec-` skill
13
- * directory, or a file under `rules/tospec/`. Either alone is enough — a user
14
- * who cleaned up one half should still hear about the other.
15
- *
16
- * Both halves match only what tospec itself writes. The directory merely
17
- * existing is not enough: a project that only ever kept its own Codex settings
18
- * there would otherwise be told to delete them.
9
+ * directory, or a file under `rules/tospec/`. Either alone is enough. Both
10
+ * halves match only what tospec writes, so a project keeping its own Codex
11
+ * settings is not told to delete them.
19
12
  */
20
13
  export declare function hasResidualCodexOutput(projectPath: string): boolean;
21
- /** Shared by init and update so neither can report what the other suppresses. */
22
- export declare const RESIDUAL_CODEX_NOTICE = "Note: .codex/ still holds tospec output from an earlier version. tospec no longer writes there \u2014 Codex reads skills from .agents/. Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.";
14
+ /**
15
+ * Shared by init and update so neither can report what the other suppresses.
16
+ * Split into message and fix because both commands carry it through their
17
+ * `warn` helper: under `--json` a `say()` line is dropped, and the leftover
18
+ * would be reported to a human and hidden from an agent.
19
+ */
20
+ export declare const RESIDUAL_CODEX_NOTICE = ".codex/ still holds tospec output from an earlier version. tospec no longer writes there \u2014 Codex reads skills from .agents/.";
21
+ export declare const RESIDUAL_CODEX_FIX = "Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.";
23
22
  //# sourceMappingURL=codex-residue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-residue.d.ts","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2CH;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,qQAC6N,CAAC"}
1
+ {"version":3,"file":"codex-residue.d.ts","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,sIAC8F,CAAC;AACjI,eAAO,MAAM,kBAAkB,6HAC6F,CAAC"}
@@ -1,12 +1,8 @@
1
1
  /**
2
- * Residual Codex Output Detection
3
- *
4
2
  * `.codex` was a write target until Codex turned out to read its skills from
5
- * `.agents`. Projects initialized by an earlier version still hold that output.
6
- *
7
- * This module answers one question and holds no writer: rule files are content
8
- * hash-protected precisely because users edit them, so anything that could
9
- * delete them must not exist here. Removing leftovers stays the user's call.
3
+ * `.agents`, and projects initialized by an earlier version still hold that
4
+ * output. Read-only by design: rule files are content hash-protected precisely
5
+ * because users edit them, so removing leftovers stays the user's call.
10
6
  */
11
7
  import path from 'node:path';
12
8
  import * as fs from 'node:fs';
@@ -26,13 +22,10 @@ function hasTospecSkillDir(codexDir) {
26
22
  }
27
23
  }
28
24
  /**
29
- * Scoped to `rules/tospec/` rather than all of `rules/`, for the same reason
30
- * the skill check is scoped to the `tospec-` prefix: rule generation only ever
31
- * writes under that subdirectory, and the notice tells the user to delete
32
- * exactly it. Scanning the whole tree made a project's own
33
- * `.codex/rules/team-style.md` trigger a notice claiming tospec had put it
34
- * there — the very mistake this module's docstring warns against one paragraph
35
- * down. Still recursive, so a nested layout from an older version counts.
25
+ * Scoped to `rules/tospec/`, not all of `rules/`: generation only writes under
26
+ * that subdirectory, so scanning the whole tree makes a project's own
27
+ * `.codex/rules/team-style.md` trigger a notice claiming tospec put it there.
28
+ * Still recursive, so a nested layout from an older version counts.
36
29
  */
37
30
  function hasTospecRuleFile(codexDir) {
38
31
  try {
@@ -49,17 +42,20 @@ function hasTospecRuleFile(codexDir) {
49
42
  }
50
43
  /**
51
44
  * Whether `<projectPath>/.codex` still holds tospec output: a `tospec-` skill
52
- * directory, or a file under `rules/tospec/`. Either alone is enough — a user
53
- * who cleaned up one half should still hear about the other.
54
- *
55
- * Both halves match only what tospec itself writes. The directory merely
56
- * existing is not enough: a project that only ever kept its own Codex settings
57
- * there would otherwise be told to delete them.
45
+ * directory, or a file under `rules/tospec/`. Either alone is enough. Both
46
+ * halves match only what tospec writes, so a project keeping its own Codex
47
+ * settings is not told to delete them.
58
48
  */
59
49
  export function hasResidualCodexOutput(projectPath) {
60
50
  const codexDir = path.join(projectPath, CODEX_DIR);
61
51
  return hasTospecSkillDir(codexDir) || hasTospecRuleFile(codexDir);
62
52
  }
63
- /** Shared by init and update so neither can report what the other suppresses. */
64
- export const RESIDUAL_CODEX_NOTICE = 'Note: .codex/ still holds tospec output from an earlier version. tospec no longer writes there — Codex reads skills from .agents/. Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.';
53
+ /**
54
+ * Shared by init and update so neither can report what the other suppresses.
55
+ * Split into message and fix because both commands carry it through their
56
+ * `warn` helper: under `--json` a `say()` line is dropped, and the leftover
57
+ * would be reported to a human and hidden from an agent.
58
+ */
59
+ export const RESIDUAL_CODEX_NOTICE = '.codex/ still holds tospec output from an earlier version. tospec no longer writes there — Codex reads skills from .agents/.';
60
+ export const RESIDUAL_CODEX_FIX = 'Removing .codex/skills/tospec-* and .codex/rules/tospec/ is optional and entirely up to you; tospec will not touch them.';
65
61
  //# sourceMappingURL=codex-residue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-residue.js","sourceRoot":"","sources":["../../src/core/codex-residue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,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ED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,8HAA8H,CAAC;AACjI,MAAM,CAAC,MAAM,kBAAkB,GAC7B,0HAA0H,CAAC"}
@@ -1,14 +1,7 @@
1
- /**
2
- * Claude Code Command Adapter
3
- *
4
- * Formats commands for Claude Code following its frontmatter specification.
5
- */
6
1
  import type { ToolCommandAdapter } from '../types.js';
7
2
  /**
8
- * Claude Code adapter for command generation.
9
- * File path: .claude/commands/tosx/<id>.md — the `tosx` sub-folder becomes the
10
- * command namespace, so commands are invoked as `/tosx:<id>`.
11
- * Frontmatter: name, description, category, tags
3
+ * The `tosx` sub-folder becomes the command namespace, so what lands at
4
+ * `.claude/commands/tosx/<id>.md` is invoked as `/tosx:<id>`.
12
5
  */
13
6
  export declare const claudeAdapter: ToolCommandAdapter;
14
7
  //# sourceMappingURL=claude.d.ts.map