@turri-dev/cli 0.4.3-next.7ada234 → 0.4.3-next.853c640

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 (538) hide show
  1. package/README.md +26 -4
  2. package/dist/banner.js +259 -0
  3. package/dist/capture-cli.js +50 -68
  4. package/dist/chat-commands.js +6 -6
  5. package/dist/chat-models.js +17 -15
  6. package/dist/chat-tab-header.js +0 -1
  7. package/dist/chat-tabs.js +1 -1
  8. package/dist/chat-terminal.js +114 -73
  9. package/dist/chat-waiting.js +0 -20
  10. package/dist/cli-options.js +11 -7
  11. package/dist/cli-root.js +141 -0
  12. package/dist/cli.js +49 -55
  13. package/dist/conform-cli.js +4 -6
  14. package/dist/cultivate-cli.js +65 -97
  15. package/dist/doctor-cli.js +99 -0
  16. package/dist/drift-cli.js +2 -7
  17. package/dist/entry-renderers.js +107 -0
  18. package/dist/extension.js +14 -3379
  19. package/dist/init-config-cli.js +218 -0
  20. package/dist/launch-cli.js +55 -91
  21. package/dist/lineage-cli.js +2 -4
  22. package/dist/loop-cli.js +118 -237
  23. package/dist/panel-view.js +409 -0
  24. package/dist/parse-cli.js +5 -2
  25. package/dist/pi-launch.js +37 -13
  26. package/dist/pi-themes.js +2 -2
  27. package/dist/plain-code-blocks.js +1 -1
  28. package/dist/print-mode.js +20 -0
  29. package/dist/quiet.js +7 -106
  30. package/dist/regenerate/diff-view.js +6 -87
  31. package/dist/regenerate/jobs-tree.js +2 -17
  32. package/dist/regenerate/spec-map-view.js +3 -68
  33. package/dist/regenerate-cli.js +7 -11
  34. package/dist/skill-progress.js +25 -0
  35. package/dist/skill-report.js +52 -0
  36. package/dist/terminal-marks.js +21 -0
  37. package/dist/terminal-notifications.js +74 -19
  38. package/dist/terminal-view.js +239 -0
  39. package/dist/turri-versions.js +64 -6
  40. package/docs/README.md +3 -3
  41. package/docs/capture.md +79 -180
  42. package/docs/chats.md +4 -4
  43. package/docs/claude-subscription.md +1 -1
  44. package/docs/config.md +7 -9
  45. package/docs/development.md +30 -64
  46. package/docs/headless.md +3 -1
  47. package/docs/hosting.md +3 -251
  48. package/docs/installation.md +5 -3
  49. package/docs/launch.md +1 -1
  50. package/docs/sentinel.md +3 -3
  51. package/docs/using.md +6 -6
  52. package/package.json +13 -31
  53. package/dist/ask.d.ts +0 -90
  54. package/dist/ask.js +0 -170
  55. package/dist/background-skills.d.ts +0 -56
  56. package/dist/background-skills.js +0 -129
  57. package/dist/bedrock-region.d.ts +0 -66
  58. package/dist/bedrock-region.js +0 -144
  59. package/dist/brand.d.ts +0 -13
  60. package/dist/btw.d.ts +0 -69
  61. package/dist/btw.js +0 -174
  62. package/dist/capture/agents.d.ts +0 -406
  63. package/dist/capture/agents.js +0 -379
  64. package/dist/capture/area.d.ts +0 -58
  65. package/dist/capture/area.js +0 -197
  66. package/dist/capture/assemble.d.ts +0 -112
  67. package/dist/capture/assemble.js +0 -453
  68. package/dist/capture/capture.d.ts +0 -116
  69. package/dist/capture/capture.js +0 -1315
  70. package/dist/capture/chat.d.ts +0 -29
  71. package/dist/capture/chat.js +0 -94
  72. package/dist/capture/checks.d.ts +0 -142
  73. package/dist/capture/checks.js +0 -649
  74. package/dist/capture/config.d.ts +0 -13
  75. package/dist/capture/config.js +0 -66
  76. package/dist/capture/interface.d.ts +0 -71
  77. package/dist/capture/interface.js +0 -199
  78. package/dist/capture/map.d.ts +0 -56
  79. package/dist/capture/map.js +0 -530
  80. package/dist/capture/models.d.ts +0 -4
  81. package/dist/capture/models.js +0 -16
  82. package/dist/capture/plan.d.ts +0 -7
  83. package/dist/capture/plan.js +0 -13
  84. package/dist/capture/progress.d.ts +0 -111
  85. package/dist/capture/progress.js +0 -266
  86. package/dist/capture/python-interface.d.ts +0 -3
  87. package/dist/capture/python-interface.js +0 -17
  88. package/dist/capture/report.d.ts +0 -75
  89. package/dist/capture/report.js +0 -268
  90. package/dist/capture/runners.d.ts +0 -6
  91. package/dist/capture/runners.js +0 -59
  92. package/dist/capture/scripts.d.ts +0 -26
  93. package/dist/capture/scripts.js +0 -38
  94. package/dist/capture/state.d.ts +0 -310
  95. package/dist/capture/state.js +0 -43
  96. package/dist/capture/trial.d.ts +0 -34
  97. package/dist/capture/trial.js +0 -89
  98. package/dist/capture-cli.d.ts +0 -1
  99. package/dist/chat-commands.d.ts +0 -17
  100. package/dist/chat-idle.d.ts +0 -7
  101. package/dist/chat-idle.js +0 -20
  102. package/dist/chat-models.d.ts +0 -22
  103. package/dist/chat-records.d.ts +0 -50
  104. package/dist/chat-records.js +0 -107
  105. package/dist/chat-scope.d.ts +0 -14
  106. package/dist/chat-scope.js +0 -15
  107. package/dist/chat-skills.d.ts +0 -17
  108. package/dist/chat-skills.js +0 -18
  109. package/dist/chat-tab-header.d.ts +0 -16
  110. package/dist/chat-tabs.d.ts +0 -26
  111. package/dist/chat-terminal.d.ts +0 -24
  112. package/dist/chat-ui.d.ts +0 -33
  113. package/dist/chat-waiting.d.ts +0 -67
  114. package/dist/chats.d.ts +0 -346
  115. package/dist/chats.js +0 -1022
  116. package/dist/cli-options.d.ts +0 -24
  117. package/dist/cli.d.ts +0 -9
  118. package/dist/config-edit.d.ts +0 -83
  119. package/dist/config-edit.js +0 -393
  120. package/dist/config.d.ts +0 -428
  121. package/dist/config.js +0 -816
  122. package/dist/conform-cli.d.ts +0 -1
  123. package/dist/conformance-switch.d.ts +0 -25
  124. package/dist/conformance-switch.js +0 -86
  125. package/dist/cultivate-cli.d.ts +0 -1
  126. package/dist/doctor-tool.d.ts +0 -11
  127. package/dist/doctor-tool.js +0 -33
  128. package/dist/drift-cli.d.ts +0 -1
  129. package/dist/environment.d.ts +0 -37
  130. package/dist/environment.js +0 -109
  131. package/dist/extension.d.ts +0 -209
  132. package/dist/genome.d.ts +0 -77
  133. package/dist/genome.js +0 -288
  134. package/dist/graph.d.ts +0 -52
  135. package/dist/graph.js +0 -247
  136. package/dist/host-session.d.ts +0 -112
  137. package/dist/host-session.js +0 -103
  138. package/dist/host.d.ts +0 -40
  139. package/dist/host.js +0 -54
  140. package/dist/identity.d.ts +0 -7
  141. package/dist/identity.js +0 -75
  142. package/dist/init-config.d.ts +0 -172
  143. package/dist/init-config.js +0 -867
  144. package/dist/installed-providers.d.ts +0 -40
  145. package/dist/installed-providers.js +0 -98
  146. package/dist/jellyfish.d.ts +0 -40
  147. package/dist/judge.d.ts +0 -25
  148. package/dist/judge.js +0 -62
  149. package/dist/launch-agent.d.ts +0 -62
  150. package/dist/launch-agent.js +0 -339
  151. package/dist/launch-cli.d.ts +0 -1
  152. package/dist/launch-session.d.ts +0 -68
  153. package/dist/launch-session.js +0 -225
  154. package/dist/launch-tools.d.ts +0 -28
  155. package/dist/launch-tools.js +0 -72
  156. package/dist/launch-track.d.ts +0 -175
  157. package/dist/launch-track.js +0 -497
  158. package/dist/lineage-cli.d.ts +0 -1
  159. package/dist/loop-cli.d.ts +0 -35
  160. package/dist/loop-tools.d.ts +0 -103
  161. package/dist/loop-tools.js +0 -361
  162. package/dist/model-check.d.ts +0 -72
  163. package/dist/model-check.js +0 -162
  164. package/dist/module-report.d.ts +0 -9
  165. package/dist/new-project.d.ts +0 -10
  166. package/dist/new-project.js +0 -42
  167. package/dist/notice.d.ts +0 -115
  168. package/dist/notice.js +0 -61
  169. package/dist/parse-cli.d.ts +0 -1
  170. package/dist/parse-tool.d.ts +0 -9
  171. package/dist/parse-tool.js +0 -33
  172. package/dist/pi-launch.d.ts +0 -1
  173. package/dist/pi-settings.d.ts +0 -4
  174. package/dist/pi-themes.d.ts +0 -3
  175. package/dist/pi.d.ts +0 -248
  176. package/dist/pi.js +0 -889
  177. package/dist/picture-row.d.ts +0 -10
  178. package/dist/plain/check.d.ts +0 -63
  179. package/dist/plain/check.js +0 -236
  180. package/dist/plain/concepts.d.ts +0 -37
  181. package/dist/plain/concepts.js +0 -283
  182. package/dist/plain/cycles.d.ts +0 -21
  183. package/dist/plain/cycles.js +0 -190
  184. package/dist/plain/errors.d.ts +0 -26
  185. package/dist/plain/errors.js +0 -50
  186. package/dist/plain/files.d.ts +0 -47
  187. package/dist/plain/files.js +0 -161
  188. package/dist/plain/graph.d.ts +0 -107
  189. package/dist/plain/graph.js +0 -194
  190. package/dist/plain/highlight.d.ts +0 -43
  191. package/dist/plain/highlight.js +0 -196
  192. package/dist/plain/index.d.ts +0 -18
  193. package/dist/plain/index.js +0 -18
  194. package/dist/plain/liquid.d.ts +0 -22
  195. package/dist/plain/liquid.js +0 -124
  196. package/dist/plain/markdown.d.ts +0 -103
  197. package/dist/plain/markdown.js +0 -330
  198. package/dist/plain/module-concepts.d.ts +0 -32
  199. package/dist/plain/module-concepts.js +0 -80
  200. package/dist/plain/parser.d.ts +0 -163
  201. package/dist/plain/parser.js +0 -930
  202. package/dist/plain/plain.tmLanguage.json +0 -150
  203. package/dist/plain/project.d.ts +0 -48
  204. package/dist/plain/project.js +0 -155
  205. package/dist/plain/spec.d.ts +0 -152
  206. package/dist/plain/spec.js +0 -265
  207. package/dist/plain/stdlib.d.ts +0 -16
  208. package/dist/plain/stdlib.js +0 -48
  209. package/dist/plain/test-plain-file.d.ts +0 -59
  210. package/dist/plain/test-plain-file.js +0 -232
  211. package/dist/plain-code-blocks.d.ts +0 -14
  212. package/dist/plain-files.d.ts +0 -21
  213. package/dist/plain-files.js +0 -156
  214. package/dist/pointer-hover.d.ts +0 -12
  215. package/dist/question-dialog.d.ts +0 -60
  216. package/dist/questioning.d.ts +0 -55
  217. package/dist/questioning.js +0 -109
  218. package/dist/quiet.d.ts +0 -34
  219. package/dist/regenerate/activity.d.ts +0 -227
  220. package/dist/regenerate/activity.js +0 -250
  221. package/dist/regenerate/agent-env.d.ts +0 -51
  222. package/dist/regenerate/agent-env.js +0 -315
  223. package/dist/regenerate/agent-shell.d.ts +0 -54
  224. package/dist/regenerate/agent-shell.js +0 -121
  225. package/dist/regenerate/arbiter.d.ts +0 -68
  226. package/dist/regenerate/arbiter.js +0 -133
  227. package/dist/regenerate/audit.d.ts +0 -69
  228. package/dist/regenerate/audit.js +0 -212
  229. package/dist/regenerate/base-folder.d.ts +0 -70
  230. package/dist/regenerate/base-folder.js +0 -186
  231. package/dist/regenerate/cases.d.ts +0 -12
  232. package/dist/regenerate/cases.js +0 -149
  233. package/dist/regenerate/change-view.d.ts +0 -23
  234. package/dist/regenerate/change-view.js +0 -153
  235. package/dist/regenerate/chunk-plan.d.ts +0 -217
  236. package/dist/regenerate/chunk-plan.js +0 -937
  237. package/dist/regenerate/codebase.d.ts +0 -21
  238. package/dist/regenerate/codebase.js +0 -75
  239. package/dist/regenerate/command-check.d.ts +0 -66
  240. package/dist/regenerate/command-check.js +0 -577
  241. package/dist/regenerate/compaction.d.ts +0 -13
  242. package/dist/regenerate/compaction.js +0 -20
  243. package/dist/regenerate/confine.d.ts +0 -69
  244. package/dist/regenerate/confine.js +0 -311
  245. package/dist/regenerate/conform.d.ts +0 -66
  246. package/dist/regenerate/conform.js +0 -132
  247. package/dist/regenerate/conformance-agents.d.ts +0 -388
  248. package/dist/regenerate/conformance-agents.js +0 -1162
  249. package/dist/regenerate/conformance.d.ts +0 -191
  250. package/dist/regenerate/conformance.js +0 -1035
  251. package/dist/regenerate/conversation-writes.d.ts +0 -10
  252. package/dist/regenerate/conversation-writes.js +0 -100
  253. package/dist/regenerate/credentials.d.ts +0 -18
  254. package/dist/regenerate/credentials.js +0 -88
  255. package/dist/regenerate/debug-log.d.ts +0 -56
  256. package/dist/regenerate/debug-log.js +0 -236
  257. package/dist/regenerate/debugger.d.ts +0 -36
  258. package/dist/regenerate/debugger.js +0 -133
  259. package/dist/regenerate/delivery.d.ts +0 -2
  260. package/dist/regenerate/diagnose-job.d.ts +0 -2
  261. package/dist/regenerate/diagnose-job.js +0 -40
  262. package/dist/regenerate/diagnose.d.ts +0 -46
  263. package/dist/regenerate/diagnose.js +0 -92
  264. package/dist/regenerate/diff-view.d.ts +0 -64
  265. package/dist/regenerate/drift.d.ts +0 -120
  266. package/dist/regenerate/drift.js +0 -285
  267. package/dist/regenerate/environment-error.d.ts +0 -167
  268. package/dist/regenerate/environment-error.js +0 -342
  269. package/dist/regenerate/failure-reports.d.ts +0 -28
  270. package/dist/regenerate/failure-reports.js +0 -79
  271. package/dist/regenerate/job-log.d.ts +0 -30
  272. package/dist/regenerate/job-log.js +0 -105
  273. package/dist/regenerate/job-panel.d.ts +0 -20
  274. package/dist/regenerate/job-panel.js +0 -54
  275. package/dist/regenerate/jobs-tree.d.ts +0 -76
  276. package/dist/regenerate/jobs.d.ts +0 -231
  277. package/dist/regenerate/jobs.js +0 -522
  278. package/dist/regenerate/lanes.d.ts +0 -16
  279. package/dist/regenerate/lanes.js +0 -32
  280. package/dist/regenerate/launch.d.ts +0 -256
  281. package/dist/regenerate/launch.js +0 -689
  282. package/dist/regenerate/ledger-view.d.ts +0 -87
  283. package/dist/regenerate/ledger-view.js +0 -325
  284. package/dist/regenerate/ledger.d.ts +0 -368
  285. package/dist/regenerate/ledger.js +0 -357
  286. package/dist/regenerate/lineage.d.ts +0 -105
  287. package/dist/regenerate/lineage.js +0 -485
  288. package/dist/regenerate/list-arguments.d.ts +0 -21
  289. package/dist/regenerate/list-arguments.js +0 -121
  290. package/dist/regenerate/loop.d.ts +0 -423
  291. package/dist/regenerate/loop.js +0 -2087
  292. package/dist/regenerate/masking.d.ts +0 -19
  293. package/dist/regenerate/masking.js +0 -95
  294. package/dist/regenerate/model-names.d.ts +0 -33
  295. package/dist/regenerate/model-names.js +0 -92
  296. package/dist/regenerate/notes.d.ts +0 -159
  297. package/dist/regenerate/notes.js +0 -446
  298. package/dist/regenerate/os-sandbox.d.ts +0 -93
  299. package/dist/regenerate/os-sandbox.js +0 -283
  300. package/dist/regenerate/panel-dock.d.ts +0 -23
  301. package/dist/regenerate/paths.d.ts +0 -110
  302. package/dist/regenerate/paths.js +0 -190
  303. package/dist/regenerate/plain-palette.d.ts +0 -34
  304. package/dist/regenerate/prompt.d.ts +0 -230
  305. package/dist/regenerate/prompt.js +0 -741
  306. package/dist/regenerate/pulse-files.d.ts +0 -14
  307. package/dist/regenerate/pulse-files.js +0 -63
  308. package/dist/regenerate/records.d.ts +0 -132
  309. package/dist/regenerate/records.js +0 -327
  310. package/dist/regenerate/regenerate.d.ts +0 -106
  311. package/dist/regenerate/regenerate.js +0 -660
  312. package/dist/regenerate/regression.d.ts +0 -58
  313. package/dist/regenerate/regression.js +0 -188
  314. package/dist/regenerate/renames.d.ts +0 -42
  315. package/dist/regenerate/renames.js +0 -185
  316. package/dist/regenerate/requires.d.ts +0 -117
  317. package/dist/regenerate/requires.js +0 -377
  318. package/dist/regenerate/resources.d.ts +0 -57
  319. package/dist/regenerate/resources.js +0 -162
  320. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  321. package/dist/regenerate/scripts-being-written.js +0 -30
  322. package/dist/regenerate/self-check.d.ts +0 -29
  323. package/dist/regenerate/self-check.js +0 -119
  324. package/dist/regenerate/services.d.ts +0 -28
  325. package/dist/regenerate/services.js +0 -158
  326. package/dist/regenerate/shell.d.ts +0 -91
  327. package/dist/regenerate/shell.js +0 -320
  328. package/dist/regenerate/side-panel.d.ts +0 -64
  329. package/dist/regenerate/spec-map-view.d.ts +0 -147
  330. package/dist/regenerate/spec-map.d.ts +0 -160
  331. package/dist/regenerate/spec-map.js +0 -596
  332. package/dist/regenerate/spec-steps.d.ts +0 -180
  333. package/dist/regenerate/spec-steps.js +0 -729
  334. package/dist/regenerate/standing.d.ts +0 -28
  335. package/dist/regenerate/standing.js +0 -30
  336. package/dist/regenerate/state.d.ts +0 -21
  337. package/dist/regenerate/state.js +0 -10
  338. package/dist/regenerate/steering.d.ts +0 -56
  339. package/dist/regenerate/steering.js +0 -119
  340. package/dist/regenerate/stop-report.d.ts +0 -43
  341. package/dist/regenerate/stop-report.js +0 -160
  342. package/dist/regenerate/submit-work.d.ts +0 -44
  343. package/dist/regenerate/submit-work.js +0 -76
  344. package/dist/regenerate/test-kinds.d.ts +0 -85
  345. package/dist/regenerate/test-kinds.js +0 -171
  346. package/dist/regenerate/test-scripts.d.ts +0 -240
  347. package/dist/regenerate/test-scripts.js +0 -847
  348. package/dist/regenerate/testing-steps.d.ts +0 -52
  349. package/dist/regenerate/testing-steps.js +0 -129
  350. package/dist/regenerate/testing.d.ts +0 -150
  351. package/dist/regenerate/testing.js +0 -438
  352. package/dist/regenerate/transcript-view.d.ts +0 -21
  353. package/dist/regenerate/unit-gate.d.ts +0 -27
  354. package/dist/regenerate/unit-gate.js +0 -20
  355. package/dist/regenerate/unit-review.d.ts +0 -152
  356. package/dist/regenerate/unit-review.js +0 -361
  357. package/dist/regenerate/web.d.ts +0 -61
  358. package/dist/regenerate/web.js +0 -256
  359. package/dist/regenerate/workspace.d.ts +0 -12
  360. package/dist/regenerate/workspace.js +0 -99
  361. package/dist/regenerate-cli.d.ts +0 -1
  362. package/dist/reopen.d.ts +0 -29
  363. package/dist/reopen.js +0 -47
  364. package/dist/resume-line.d.ts +0 -5
  365. package/dist/review/live.d.ts +0 -72
  366. package/dist/review/live.js +0 -166
  367. package/dist/rules.d.ts +0 -20
  368. package/dist/rules.js +0 -47
  369. package/dist/run-report.d.ts +0 -88
  370. package/dist/run-report.js +0 -338
  371. package/dist/screen-padding.d.ts +0 -28
  372. package/dist/self-invocation.d.ts +0 -36
  373. package/dist/self-invocation.js +0 -137
  374. package/dist/sentinel-chat.d.ts +0 -19
  375. package/dist/sentinel-chat.js +0 -226
  376. package/dist/sentinel-check.d.ts +0 -36
  377. package/dist/sentinel-check.js +0 -78
  378. package/dist/sentinel.d.ts +0 -107
  379. package/dist/sentinel.js +0 -601
  380. package/dist/settings.d.ts +0 -45
  381. package/dist/settings.js +0 -378
  382. package/dist/setup.d.ts +0 -97
  383. package/dist/setup.js +0 -436
  384. package/dist/skill-progress.d.ts +0 -46
  385. package/dist/skill.d.ts +0 -102
  386. package/dist/skill.js +0 -147
  387. package/dist/skills.d.ts +0 -54
  388. package/dist/skills.js +0 -111
  389. package/dist/spawn-async.d.ts +0 -18
  390. package/dist/spawn-async.js +0 -35
  391. package/dist/stack.d.ts +0 -80
  392. package/dist/stack.js +0 -206
  393. package/dist/stdlib.d.ts +0 -43
  394. package/dist/stdlib.js +0 -118
  395. package/dist/surface.d.ts +0 -5
  396. package/dist/surface.js +0 -18
  397. package/dist/terminal-images.d.ts +0 -2
  398. package/dist/terminal-notifications.d.ts +0 -37
  399. package/dist/test-plain-files.d.ts +0 -41
  400. package/dist/test-plain-files.js +0 -172
  401. package/dist/tools.d.ts +0 -101
  402. package/dist/tools.js +0 -242
  403. package/dist/turri-versions.d.ts +0 -71
  404. package/genome/capture/capture.md +0 -26
  405. package/genome/capture/check-conventions.md +0 -5
  406. package/genome/capture/check-reference.md +0 -12
  407. package/genome/capture/compact.md +0 -7
  408. package/genome/capture/concepts.md +0 -3
  409. package/genome/capture/divide.md +0 -9
  410. package/genome/capture/feature.md +0 -45
  411. package/genome/capture/interface.md +0 -9
  412. package/genome/capture/modules.md +0 -25
  413. package/genome/capture/outline.md +0 -11
  414. package/genome/capture/python-interface.py +0 -111
  415. package/genome/capture/readability.md +0 -12
  416. package/genome/capture/reference.md +0 -10
  417. package/genome/capture/runners/python-requirements.sh +0 -67
  418. package/genome/capture/split.md +0 -9
  419. package/genome/capture/survey.md +0 -39
  420. package/genome/capture/trial.md +0 -18
  421. package/genome/capture/verify.md +0 -7
  422. package/genome/rules/bullet-continuation.md +0 -61
  423. package/genome/rules/concise-specs-examples.md +0 -460
  424. package/genome/rules/concise-specs-integration-examples.md +0 -281
  425. package/genome/rules/concise-specs.md +0 -80
  426. package/genome/rules/definitions.md +0 -107
  427. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  428. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  429. package/genome/rules/exported-concepts.md +0 -39
  430. package/genome/rules/func-specs.md +0 -164
  431. package/genome/rules/impl-reqs.md +0 -68
  432. package/genome/rules/import-modules.md +0 -49
  433. package/genome/rules/integration-embedded-testing.md +0 -273
  434. package/genome/rules/integration-embedded.md +0 -171
  435. package/genome/rules/integration-standalone.md +0 -135
  436. package/genome/rules/integrations.md +0 -136
  437. package/genome/rules/linked-resources.md +0 -76
  438. package/genome/rules/module-structure.md +0 -112
  439. package/genome/rules/project-model.md +0 -69
  440. package/genome/rules/required-concepts.md +0 -44
  441. package/genome/rules/requires-modules.md +0 -81
  442. package/genome/rules/semantic-ids.md +0 -49
  443. package/genome/rules/stdlib.md +0 -37
  444. package/genome/rules/test-plain-files.md +0 -138
  445. package/genome/rules/test-reqs.md +0 -57
  446. package/genome/rules/turri-regeneration.md +0 -66
  447. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  448. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  449. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  450. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  451. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  452. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  453. package/genome/skills/debug-specs/SKILL.md +0 -194
  454. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  455. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  456. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  457. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  458. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  459. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  460. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  461. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  462. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  463. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  464. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  465. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  466. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  467. package/genome/skills/refactor-module/SKILL.md +0 -218
  468. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  469. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  470. package/stdlib/backend/common.plain +0 -25
  471. package/stdlib/backend/conformance/common.plain +0 -12
  472. package/stdlib/backend/conformance/go-gin.plain +0 -9
  473. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  474. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  475. package/stdlib/backend/conformance/python-django.plain +0 -9
  476. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  477. package/stdlib/backend/conformance/python-flask.plain +0 -9
  478. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  479. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  480. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  481. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  482. package/stdlib/backend/go-gin.plain +0 -18
  483. package/stdlib/backend/go-nethttp.plain +0 -18
  484. package/stdlib/backend/java-springboot.plain +0 -19
  485. package/stdlib/backend/python-django.plain +0 -19
  486. package/stdlib/backend/python-fastapi.plain +0 -23
  487. package/stdlib/backend/python-flask.plain +0 -23
  488. package/stdlib/backend/rust-axum.plain +0 -17
  489. package/stdlib/backend/typescript-express.plain +0 -19
  490. package/stdlib/backend/typescript-fastify.plain +0 -19
  491. package/stdlib/backend/typescript-nestjs.plain +0 -19
  492. package/stdlib/cli/common.plain +0 -17
  493. package/stdlib/cli/conformance/common.plain +0 -11
  494. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  495. package/stdlib/cli/conformance/go-flag.plain +0 -9
  496. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  497. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  498. package/stdlib/cli/conformance/python-click.plain +0 -9
  499. package/stdlib/cli/conformance/python-typer.plain +0 -9
  500. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  501. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  502. package/stdlib/cli/go-cobra.plain +0 -14
  503. package/stdlib/cli/go-flag.plain +0 -14
  504. package/stdlib/cli/java-picocli.plain +0 -15
  505. package/stdlib/cli/python-argparse.plain +0 -18
  506. package/stdlib/cli/python-click.plain +0 -16
  507. package/stdlib/cli/python-typer.plain +0 -16
  508. package/stdlib/cli/rust-clap.plain +0 -14
  509. package/stdlib/cli/typescript-commander.plain +0 -17
  510. package/stdlib/frontend/angular.plain +0 -17
  511. package/stdlib/frontend/common.plain +0 -17
  512. package/stdlib/frontend/conformance/angular.plain +0 -5
  513. package/stdlib/frontend/conformance/common.plain +0 -11
  514. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  515. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  516. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  517. package/stdlib/frontend/react-vite.plain +0 -16
  518. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  519. package/stdlib/frontend/vue-vite.plain +0 -16
  520. package/stdlib/lang/go.plain +0 -13
  521. package/stdlib/lang/java.plain +0 -12
  522. package/stdlib/lang/python.plain +0 -18
  523. package/stdlib/lang/rust.plain +0 -12
  524. package/stdlib/lang/typescript.plain +0 -13
  525. package/stdlib/library/common.plain +0 -15
  526. package/stdlib/library/conformance/common.plain +0 -9
  527. package/stdlib/library/conformance/go.plain +0 -9
  528. package/stdlib/library/conformance/java-gradle.plain +0 -9
  529. package/stdlib/library/conformance/java-maven.plain +0 -9
  530. package/stdlib/library/conformance/python.plain +0 -9
  531. package/stdlib/library/conformance/rust.plain +0 -9
  532. package/stdlib/library/conformance/typescript.plain +0 -9
  533. package/stdlib/library/go.plain +0 -12
  534. package/stdlib/library/java-gradle.plain +0 -13
  535. package/stdlib/library/java-maven.plain +0 -13
  536. package/stdlib/library/python.plain +0 -13
  537. package/stdlib/library/rust.plain +0 -12
  538. package/stdlib/library/typescript.plain +0 -15
@@ -1,649 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { DEFAULT_CONCEPTS, extractConceptsFromSpecText } from "../plain/concepts.js";
4
- import { stronglyConnectedComponents } from "../plain/cycles.js";
5
- import { parseMarkdown, traverse } from "../plain/markdown.js";
6
- import { isStack, stdlibTemplates } from "../stdlib.js";
7
- import { covers, filesOf } from "./area.js";
8
- import { existsInMap } from "./map.js";
9
- import { entrySurface, featureText, interfaceIn, namedExactly, namedIn, shownSurface } from "./interface.js";
10
- /**
11
- * What the harness checks of each answer a capture agent hands over, before it is kept: what would make ***plain that
12
- * does not parse, a path that is not there, a feature over its budget. Each problem is said so the agent can fix it.
13
- */
14
- /** The most functional specs one feature is captured in. */
15
- export const MAX_SPECS_PER_FEATURE = 8;
16
- /**
17
- * The scenarios a feature may have in all: a few, and more the more the original tests it - one for each so many lines
18
- * of the original's tests in its files - up to a most. Scenarios go where the original's tests are densest.
19
- */
20
- export const BASE_SCENARIOS = 8;
21
- export const TEST_LINES_PER_SCENARIO = 50;
22
- export const MAX_SCENARIOS_PER_FEATURE = 30;
23
- /** The scenarios a feature may have, from the lines of the original's tests in its files. */
24
- export function scenarioBudget(testLines) {
25
- return Math.min(MAX_SCENARIOS_PER_FEATURE, BASE_SCENARIOS + Math.floor(testLines / TEST_LINES_PER_SCENARIO));
26
- }
27
- /** The longest a functional spec may be, in characters: a few short lines, never a page. */
28
- export const MAX_SPEC_CHARS = 1500;
29
- /** The most features one leaf is outlined into. */
30
- export const MAX_FEATURES_PER_LEAF = 20;
31
- const KEBAB = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
32
- const CONCEPT = /^:[A-Z][+\-.0-9A-Za-z_]*:$/;
33
- export function isKebab(id) {
34
- return KEBAB.test(id);
35
- }
36
- /** Every concept a text uses. */
37
- export function conceptsIn(text) {
38
- return [...new Set(extractConceptsFromSpecText(text))];
39
- }
40
- /** What is wrong with a piece of ***plain text, as a functional spec's body or a scenario's - its lines the parser would read as something else. */
41
- function badLines(what, text) {
42
- const problems = [];
43
- if (text.trim() === "")
44
- problems.push(`${what} is empty.`);
45
- if (/^#\s/m.test(text))
46
- problems.push(`${what} has a line starting with "# ", which would start a new functional spec or scenario.`);
47
- if (/^\*\*\*/m.test(text))
48
- problems.push(`${what} has a line starting with ***, which would start a section.`);
49
- return [...problems, ...links(what, text)];
50
- }
51
- /** What is wrong with a bullet: it is one line, and not empty. */
52
- function badBullet(what, bullet) {
53
- if (bullet.trim() === "")
54
- return [`${what} is empty.`];
55
- if (bullet.includes("\n"))
56
- return [`${what} is more than one line: one fact a bullet, on one line.`];
57
- if (bullet.startsWith("- "))
58
- return [`${what} starts with "- ": give the bullet's text alone.`];
59
- return links(what, bullet);
60
- }
61
- /**
62
- * The links in a text, as Markdown reads them - `<https://...>`, `[text](target)` - each a problem: a link in ***plain
63
- * names a file of the project, linked to the module, and the parser refuses any other. A capture links no file.
64
- */
65
- function links(what, text) {
66
- return traverse(parseMarkdown(text), "link").map((link) => {
67
- const target = String(link.url ?? "");
68
- const start = link.position?.start.offset;
69
- const end = link.position?.end.offset;
70
- const written = start !== undefined && end !== undefined ? text.slice(start, end) : target;
71
- return `${what} has a link, ${written}, which ***plain refuses: its links name files of the project. Write the address as code instead: \`${target}\`.`;
72
- });
73
- }
74
- /** Concepts a text uses that are not among those it may use. */
75
- function undefinedConcepts(what, text, known) {
76
- const missing = conceptsIn(text).filter((concept) => !known.has(concept) && !DEFAULT_CONCEPTS.has(concept));
77
- return missing.length === 0 ? [] : [`${what} uses ${missing.join(", ")}, which ${missing.length === 1 ? "is" : "are"} not defined: use a concept you were given, or define it.`];
78
- }
79
- /** What is wrong with definitions: a concept named wrong, predefined, defined twice or among those given already, or a text that does not start with it. */
80
- export function definitionProblems(definitions, given) {
81
- const problems = [];
82
- const seen = new Set();
83
- for (const definition of definitions) {
84
- const concept = definition.concept;
85
- if (!CONCEPT.test(concept))
86
- problems.push(`The concept "${concept}" is not a concept name: CamelCase between colons, :LikeThis:.`);
87
- else if (DEFAULT_CONCEPTS.has(concept))
88
- problems.push(`${concept} is predefined: never define it.`);
89
- else if (given.has(concept))
90
- problems.push(`${concept} is given already: use it, do not define it again.`);
91
- else if (seen.has(concept))
92
- problems.push(`${concept} is defined twice.`);
93
- seen.add(concept);
94
- if (!definition.text.startsWith(concept))
95
- problems.push(`The definition of ${concept} does not start with ${concept}.`);
96
- problems.push(...badBullet(`The definition of ${concept}`, definition.text));
97
- }
98
- return problems;
99
- }
100
- /**
101
- * Definitions that define each other round in a circle - `:Link:` uses `:LinkCode:`, whose definition uses `:Link:` -
102
- * which the parser refuses: one problem a circle, naming its concepts.
103
- */
104
- export function definitionCycles(definitions) {
105
- const defined = new Set(definitions.map((definition) => definition.concept));
106
- const graph = new Map();
107
- for (const definition of definitions) {
108
- const used = conceptsIn(definition.text).filter((concept) => concept !== definition.concept && defined.has(concept));
109
- graph.set(definition.concept, [...(graph.get(definition.concept) ?? []), ...used]);
110
- }
111
- return stronglyConnectedComponents(graph)
112
- .filter((component) => component.size > 1)
113
- .map((component) => [...defined].filter((concept) => component.has(concept)))
114
- .map((component) => `The definitions of ${component.join(", ")} use each other in a circle, which ***plain refuses: define one without naming the other${component.length > 2 ? "s" : ""}.`);
115
- }
116
- function leftOutProblems(map, leftOut, within) {
117
- return leftOut.flatMap((item) => {
118
- if (!existsInMap(map, item.path))
119
- return [`Left out ${item.path}: no such file or folder in the map.`];
120
- if (!within.some((path) => covers(path, item.path)))
121
- return [`Left out ${item.path}: not in your area.`];
122
- // The tests show what someone cared about: what scenarios are written from, never left behind.
123
- const files = filesOf(map, [item.path]);
124
- if (files.some((file) => file.kind === "test"))
125
- return [`Left out ${item.path}: it holds the original's tests, the evidence of what the software does - keep them with the code they test.`];
126
- return [];
127
- });
128
- }
129
- export function surveyProblems(map, survey) {
130
- const problems = [];
131
- if (survey.parts.length === 0)
132
- problems.push("Name at least one part.");
133
- const stacks = new Map(stdlibTemplates().filter(isStack).map((template) => [template.name, template]));
134
- const names = new Set();
135
- survey.parts.forEach((part, index) => {
136
- const what = `Part ${part.name || index + 1}`;
137
- if (!isKebab(part.name))
138
- problems.push(`${what}: its name is not short kebab-case.`);
139
- if (names.has(part.name))
140
- problems.push(`${what}: two parts have that name.`);
141
- names.add(part.name);
142
- if (part.paths.length === 0)
143
- problems.push(`${what}: name its folders and files.`);
144
- for (const path of part.paths)
145
- if (!existsInMap(map, path))
146
- problems.push(`${what}: ${path} is no file or folder in the map.`);
147
- survey.parts.forEach((other, at) => {
148
- if (at <= index)
149
- return;
150
- for (const path of part.paths)
151
- for (const theirs of other.paths)
152
- if (covers(path, theirs) || covers(theirs, path))
153
- problems.push(`Parts ${part.name} and ${other.name} share ${covers(path, theirs) ? theirs : path}: two parts never share a folder.`);
154
- });
155
- if (part.stdlibStack !== undefined) {
156
- const stack = stacks.get(part.stdlibStack);
157
- if (stack === undefined)
158
- problems.push(`${what}: ${part.stdlibStack} is not a stack of the standard library - name one the catalogue lists, or none.`);
159
- else if (part.stdlibConformance === true && stack.conformance === undefined)
160
- problems.push(`${what}: ${part.stdlibStack} has no conformance template.`);
161
- }
162
- else if (part.stdlibConformance === true) {
163
- problems.push(`${what}: stdlib_conformance needs a stdlib_stack.`);
164
- }
165
- if (part.stdlibStack === undefined && part.implementationReqs.length === 0)
166
- problems.push(`${what}: with no stdlib_stack, write its implementation_reqs - its language, framework and storage.`);
167
- problems.push(...conventionProblems(map, part.conventions ?? [], undefined).map((problem) => `${what}: ${problem}`));
168
- if (part.stdlibConformance !== true && part.testReqs.length === 0)
169
- problems.push(`${what}: with no conformance template, write its test_reqs - how its black-box tests run.`);
170
- const known = new Set(part.definitions.map((definition) => definition.concept));
171
- problems.push(...definitionProblems(part.definitions, new Set()).map((problem) => `${what}: ${problem}`));
172
- part.implementationReqs.forEach((req, at) => problems.push(...badBullet(`${what}: implementation req ${at + 1}`, req), ...undefinedConcepts(`${what}: implementation req ${at + 1}`, req, known)));
173
- part.testReqs.forEach((req, at) => problems.push(...badBullet(`${what}: test req ${at + 1}`, req), ...undefinedConcepts(`${what}: test req ${at + 1}`, req, known)));
174
- (part.conventions ?? []).forEach((convention, at) => problems.push(...undefinedConcepts(`${what}: convention ${at + 1}`, convention.text, known)));
175
- for (const definition of part.definitions)
176
- problems.push(...undefinedConcepts(`${what}: the definition of ${definition.concept}`, definition.text, known));
177
- problems.push(...definitionCycles(part.definitions).map((problem) => `${what}: ${problem}`));
178
- });
179
- problems.push(...leftOutProblems(map, survey.leftOut, ["."]));
180
- return problems;
181
- }
182
- /** The files of an area that the split placed nowhere: in no area, and not left out. */
183
- export function unplaced(map, within, areas, leftOut) {
184
- const placed = [...areas.flatMap((area) => area.paths), ...leftOut.map((item) => item.path)];
185
- return filesOf(map, within)
186
- .filter((file) => !placed.some((path) => covers(path, file.path)))
187
- .map((file) => file.path);
188
- }
189
- export function splitProblems(map, within, answer) {
190
- const problems = [];
191
- const total = filesOf(map, within).length;
192
- if (answer.areas.length < 2)
193
- problems.push("Split it into at least two areas.");
194
- const names = new Set();
195
- answer.areas.forEach((area, index) => {
196
- const what = `Area ${area.name || index + 1}`;
197
- if (!isKebab(area.name))
198
- problems.push(`${what}: its name is not short kebab-case.`);
199
- if (names.has(area.name))
200
- problems.push(`${what}: two areas have that name.`);
201
- names.add(area.name);
202
- if (area.paths.length === 0)
203
- problems.push(`${what}: name its folders and files.`);
204
- for (const path of area.paths) {
205
- if (!existsInMap(map, path))
206
- problems.push(`${what}: ${path} is no file or folder in the map.`);
207
- else if (!within.some((mine) => covers(mine, path)))
208
- problems.push(`${what}: ${path} is not in your area.`);
209
- }
210
- const files = filesOf(map, area.paths).length;
211
- if (area.paths.length > 0 && files === 0)
212
- problems.push(`${what}: it holds no file.`);
213
- if (files >= total)
214
- problems.push(`${what}: it is the whole of your area - each area must be smaller.`);
215
- answer.areas.forEach((other, at) => {
216
- if (at <= index)
217
- return;
218
- for (const path of area.paths)
219
- for (const theirs of other.paths)
220
- if (covers(path, theirs) || covers(theirs, path))
221
- problems.push(`Areas ${area.name} and ${other.name} share ${covers(path, theirs) ? theirs : path}: a path is in one area only.`);
222
- });
223
- });
224
- problems.push(...leftOutProblems(map, answer.leftOut, within));
225
- const missing = unplaced(map, within, answer.areas, answer.leftOut);
226
- if (missing.length > 0)
227
- problems.push(`These files are in no area and not left out - place each: ${missing.slice(0, 20).join(", ")}${missing.length > 20 ? `, and ${missing.length - 20} more` : ""}.`);
228
- return problems;
229
- }
230
- export function outlineProblems(map, within, answer) {
231
- const problems = [];
232
- if (answer.features.length === 0)
233
- problems.push("Outline at least one feature.");
234
- if (answer.features.length > MAX_FEATURES_PER_LEAF)
235
- problems.push(`${answer.features.length} features is more than ${MAX_FEATURES_PER_LEAF}: merge the smallest into those they belong with.`);
236
- const names = new Set();
237
- answer.features.forEach((feature, index) => {
238
- const what = `Feature ${feature.name || index + 1}`;
239
- if (!isKebab(feature.name))
240
- problems.push(`${what}: its name is not short kebab-case.`);
241
- if (names.has(feature.name))
242
- problems.push(`${what}: two features have that name.`);
243
- names.add(feature.name);
244
- if (feature.title === "")
245
- problems.push(`${what}: give it a title.`);
246
- if (feature.paths.length === 0)
247
- problems.push(`${what}: name where it is built.`);
248
- for (const path of feature.paths) {
249
- if (!existsInMap(map, path))
250
- problems.push(`${what}: ${path} is no file or folder in the map.`);
251
- else if (!within.some((mine) => covers(mine, path)))
252
- problems.push(`${what}: ${path} is not in your area.`);
253
- }
254
- });
255
- problems.push(...leftOutProblems(map, answer.leftOut, within));
256
- return problems;
257
- }
258
- /**
259
- * What is wrong with conventions: one more than a line or empty, one that names no file deciding it or a file not in
260
- * the map, one using a concept that is not given - when the concepts are given.
261
- */
262
- export function conventionProblems(map, conventions, known) {
263
- return conventions.flatMap((convention, at) => {
264
- const which = `convention ${at + 1}`;
265
- return [
266
- ...badBullet(which, convention.text),
267
- ...(convention.where.length === 0 ? [`${which}: name in where the files whose code decides it - a convention is settled from the code that does it.`] : []),
268
- ...convention.where.filter((path) => !existsInMap(map, path)).map((path) => `${which}: ${path} is no file or folder in the map.`),
269
- ...(known !== undefined ? undefinedConcepts(which, convention.text, known) : []),
270
- ];
271
- });
272
- }
273
- const INTERFACE_KINDS_TAKEN = new Set(["command", "argument", "option", "route", "env", "other"]);
274
- /**
275
- * A text as the reference's literals are looked for in code: string literals joined across lines, escapes and
276
- * whitespace collapsed, case aside - so a help text split over three Python strings is still found.
277
- */
278
- function lookedFor(text) {
279
- return text
280
- .replace(/(["'])\s*\+?\s*\1/g, "")
281
- .replace(/\\n/g, " ")
282
- .replace(/\s+/g, " ")
283
- .trim()
284
- .toLowerCase();
285
- }
286
- /** The literals an entry claims the code has: its names, its choices, its default and the start of its help. */
287
- function literalsOf(entry) {
288
- const name = entry.kind === "route"
289
- ? [entry.name.replace(/^[A-Z]+\s+/, "")]
290
- : entry.kind === "command"
291
- ? entry.name.split(/\s+/)
292
- : [entry.name];
293
- const value = entry.default?.trim();
294
- const help = entry.help !== undefined ? lookedFor(entry.help) : "";
295
- return [
296
- ...name,
297
- ...entry.aliases,
298
- ...entry.choices,
299
- ...(value !== undefined && value !== "" && !/^(none|null|undefined|nil)$/i.test(value) ? [value.replace(/^(["'`])(.*)\1$/, "$2")] : []),
300
- ...(help !== "" ? [help.slice(0, 60)] : []),
301
- ].filter((literal) => literal.trim() !== "");
302
- }
303
- /**
304
- * What is wrong with an agent's part of the interface reference - checked against the code, so nothing in it is guessed:
305
- * an entry with no kind or name, listed twice, whose `where` is no line of a file of the map, or one of whose literals -
306
- * a name, an alias, a choice, its default, its help - is not in the file it cites nor in those it names in `also`; an
307
- * exclusion with no why; and, of the interface the map found in the files it was given, any neither listed nor excluded.
308
- */
309
- export function referenceProblems(map, root, given, answer) {
310
- const problems = [];
311
- const texts = new Map();
312
- const read = (path) => {
313
- if (!texts.has(path)) {
314
- try {
315
- texts.set(path, readFileSync(join(root, ...path.split("/")), "utf8"));
316
- }
317
- catch {
318
- texts.set(path, undefined);
319
- }
320
- }
321
- return texts.get(path);
322
- };
323
- const seen = new Set();
324
- const commands = new Set(answer.entries.filter(entry => entry.kind === "command").map(entry => entry.name));
325
- answer.entries.forEach((entry, at) => {
326
- const what = `Entry ${at + 1}, \`${entry.name || "(no name)"}\``;
327
- if (!INTERFACE_KINDS_TAKEN.has(entry.kind))
328
- problems.push(`${what}: its kind is command, argument, option, route, env or other.`);
329
- if (entry.name.trim() === "")
330
- problems.push(`${what}: give its name, exactly as the code has it.`);
331
- if (entry.command && !commands.has(entry.command)) {
332
- const owners = entry.command.split(/,\s*|\s+and\s+/).map(name => name.trim());
333
- if (owners.length > 1 && owners.every(name => commands.has(name)))
334
- problems.push(`${what}: ${entry.command} is a list of commands, not one command. Give a separate entry under each command that accepts it.`);
335
- }
336
- const key = `${entry.kind} ${entry.command ?? ""} ${entry.name}`;
337
- if (seen.has(key))
338
- problems.push(`${what}: listed twice.`);
339
- seen.add(key);
340
- const cited = /^(.+):(\d+)$/.exec(entry.where.trim());
341
- if (cited === null) {
342
- problems.push(`${what}: where is path:line - the file it is defined in, relative to the codebase, and the line.`);
343
- return;
344
- }
345
- const [, path, line] = cited;
346
- const text = existsInMap(map, path) ? read(path) : undefined;
347
- if (text === undefined) {
348
- problems.push(`${what}: ${path} is no file in the map.`);
349
- return;
350
- }
351
- if (Number(line) < 1 || Number(line) > text.split("\n").length)
352
- problems.push(`${what}: ${path} has no line ${line}.`);
353
- const also = entry.also.filter((other) => {
354
- if (existsInMap(map, other) && read(other) !== undefined)
355
- return true;
356
- problems.push(`${what}: ${other}, in also, is no file in the map.`);
357
- return false;
358
- });
359
- const code = lookedFor([text, ...also.map((other) => read(other))].join("\n"));
360
- const missing = literalsOf(entry).filter((literal) => !code.includes(lookedFor(literal)));
361
- if (missing.length > 0) {
362
- problems.push(`${what}: ${missing.map((literal) => `\`${literal}\``).join(", ")} ${missing.length === 1 ? "is" : "are"} not in ${path}${also.length > 0 ? " or the files in also" : ""}. ` +
363
- "Give each exactly as the code has it - a help text word for word - and name in also the files where one is worked out: never one the code does not have.");
364
- }
365
- });
366
- answer.excluded.forEach((item) => {
367
- if (item.why.trim() === "")
368
- problems.push(`Say why \`${item.name}\` is not the software's interface.`);
369
- });
370
- // What the map found in the files given: each listed, or excluded with why - the reference is whole.
371
- const listed = answer.entries.map((entry) => entrySurface(entry));
372
- const unlisted = interfaceIn(map, given).filter((surface) => !listed.some((entry) => namedIn(surface, entry.name) || namedIn(surface, `${entry.name} ${entry.path}`)) && !answer.excluded.some((item) => namedExactly(surface, item.name)));
373
- if (unlisted.length > 0) {
374
- problems.push(`Neither listed nor excluded, of what the map found in your files: ${unlisted.slice(0, 30).map(shownSurface).join(", ")}${unlisted.length > 30 ? `, and ${unlisted.length - 30} more` : ""}. ` +
375
- "List each - or exclude it, by name, with why, when it is not the software's interface.");
376
- }
377
- return problems;
378
- }
379
- /**
380
- * What is wrong with a feature written for the interface no feature captured: a surface it was given that it neither
381
- * names in its ***plain nor drops, by name, with why.
382
- */
383
- export function gapProblems(captured, surfaces) {
384
- const text = featureText(captured);
385
- const missing = surfaces.filter((surface) => !namedIn(surface, text) && !captured.dropped.some((line) => namedExactly(surface, line)));
386
- return missing.length === 0
387
- ? []
388
- : [`Neither captured nor dropped: ${missing.map(shownSurface).join(", ")}. Capture each exactly, by the name the code gives it - or, when it is not the software's interface, name it in dropped with why.`];
389
- }
390
- /**
391
- * What is wrong with the interface check's corrections: one to a functional spec or a scenario that is not there, a
392
- * text the parser would read as something else, a link, a concept not defined, a text past twice the most a functional
393
- * spec may be, a correction with no why.
394
- */
395
- export function correctionProblems(corrections, specs, known) {
396
- return corrections.flatMap((correction) => {
397
- const spec = specs.get(correction.funcId);
398
- if (spec === undefined)
399
- return [`There is no functional spec ${correction.funcId} among those you were given.`];
400
- const what = correction.scenarioId !== undefined ? `The correction of ${correction.funcId}'s scenario ${correction.scenarioId}` : `The correction of ${correction.funcId}`;
401
- const problems = [];
402
- if (correction.scenarioId !== undefined && ![...spec.conformance, ...spec.acceptance].some((scenario) => scenario.id === correction.scenarioId))
403
- problems.push(`${correction.funcId} has no scenario ${correction.scenarioId}.`);
404
- problems.push(...badLines(what, correction.text), ...undefinedConcepts(what, correction.text, known));
405
- if (correction.scenarioId === undefined && correction.text.length > 2 * MAX_SPEC_CHARS)
406
- problems.push(`${what} is ${correction.text.length} characters: correct what is wrong, and leave the rest as it was.`);
407
- if (correction.why.trim() === "")
408
- problems.push(`${what}: say why, from the code.`);
409
- return problems;
410
- });
411
- }
412
- /**
413
- * What is wrong with a part's features gathered into modules: a module with no name, a name that is not kebab-case, taken
414
- * twice or an import module's, no about or no feature; a feature in no module or in two, or not the part's; a module past
415
- * twice the most functional specs a module holds, or one module holding a part too large for one; one that needs a module
416
- * that is not the part's, itself, or one after it; a scenario rewritten that is not there, that the parser would read as
417
- * something else, that uses a concept the part does not have, or that says no why.
418
- */
419
- export function moduleProblems(answer, given) {
420
- const problems = [];
421
- const specsOf = (keys) => keys.reduce((sum, key) => sum + (given.features.get(key)?.length ?? 0), 0);
422
- const total = specsOf([...given.features.keys()]);
423
- if (answer.modules.length === 0)
424
- problems.push("Gather the features into at least one module.");
425
- if (answer.modules.length === 1 && total > given.moduleSpecs) {
426
- problems.push(`One module holding all ${total} functional specs is the code again, unread and regenerated whole on every change: gather them by concern.`);
427
- }
428
- const names = new Map();
429
- const placed = new Set();
430
- answer.modules.forEach((module, at) => {
431
- const what = `Module ${module.name || at + 1}`;
432
- if (!isKebab(module.name))
433
- problems.push(`${what}: its name is not short kebab-case.`);
434
- else if (given.reserved.has(module.name))
435
- problems.push(`${what}: ${module.name} is the name of an import module - name the concern.`);
436
- else if (names.has(module.name))
437
- problems.push(`${what}: two modules have that name.`);
438
- names.set(module.name, at);
439
- problems.push(...badBullet(`${what}: its about`, module.about));
440
- if (module.features.length === 0)
441
- problems.push(`${what} holds no feature: give it its features, or leave it out.`);
442
- for (const key of module.features) {
443
- if (!given.features.has(key))
444
- problems.push(`${what}: ${key} is no feature of the part - name each by its key, as listed.`);
445
- else if (placed.has(key))
446
- problems.push(`${what}: ${key} is in another module too - a feature is in one module.`);
447
- placed.add(key);
448
- }
449
- const specs = specsOf(module.features);
450
- if (specs > 2 * given.moduleSpecs)
451
- problems.push(`${what} holds ${specs} functional specs, more than a person reads in one file: split it by concern.`);
452
- });
453
- const missing = [...given.features.keys()].filter((key) => !placed.has(key));
454
- if (missing.length > 0)
455
- problems.push(`Put every feature in a module: ${missing.join(", ")} ${missing.length === 1 ? "is" : "are"} in none.`);
456
- answer.modules.forEach((module, at) => {
457
- for (const need of module.needs) {
458
- if (need === module.name)
459
- problems.push(`${module.name} needs itself: name only the modules before it.`);
460
- else if (!names.has(need))
461
- problems.push(`${module.name} needs ${need}, which is none of the modules you gave.`);
462
- else if (names.get(need) > at)
463
- problems.push(`${module.name} needs ${need}, which comes after it: put ${need} first - or, when ${need} needs ${module.name} too, rewrite the scenarios of one that need the other.`);
464
- }
465
- });
466
- for (const rewrite of answer.rewrites) {
467
- const specs = given.features.get(rewrite.feature);
468
- if (specs === undefined) {
469
- problems.push(`The rewrite of ${rewrite.funcId}'s scenario ${rewrite.scenarioId}: ${rewrite.feature || "(no feature)"} is no feature of the part.`);
470
- continue;
471
- }
472
- if (rewrite.scenarioId === "") {
473
- problems.push(`The rewrite of ${rewrite.feature}'s ${rewrite.funcId}: name the scenario it rewrites - scenarios are rewritten, never functional specs.`);
474
- continue;
475
- }
476
- const byId = new Map(specs.map((spec) => [spec.funcId, spec]));
477
- problems.push(...correctionProblems([{ funcId: rewrite.funcId, scenarioId: rewrite.scenarioId, text: rewrite.text, why: rewrite.why }], byId, given.known).map((problem) => `${rewrite.feature}: ${problem}`));
478
- }
479
- return problems;
480
- }
481
- const TRIAL_OUTCOMES = new Set(["held", "corrected", "removed", "untried"]);
482
- /**
483
- * What is wrong with what an agent found trying scenarios on the original: a scenario it was given with no result, or
484
- * one it was not given; an outcome it may not give; a scenario held or corrected with nothing said of what it ran; a
485
- * corrected text the parser would read as something else, using a concept the module does not have, or the same as
486
- * before; a scenario corrected, removed or left untried with no why; a functional spec's correction, as the interface
487
- * check's are checked; a test req that is not one line.
488
- */
489
- export function trialProblems(answer, given, module) {
490
- const problems = [];
491
- const byKey = new Map(given.map((scenario) => [`${scenario.funcId}/${scenario.scenarioId}`, scenario]));
492
- const seen = new Set();
493
- for (const result of answer.results) {
494
- const key = `${result.funcId}/${result.scenarioId}`;
495
- const what = `Scenario ${result.scenarioId || "(no scenario-id)"} of ${result.funcId || "(no func-id)"}`;
496
- const scenario = byKey.get(key);
497
- if (scenario === undefined) {
498
- problems.push(`${what} is not among those you were given: name each by its func-id and scenario-id as listed.`);
499
- continue;
500
- }
501
- if (seen.has(key))
502
- problems.push(`${what} has two results: give it one.`);
503
- seen.add(key);
504
- if (!TRIAL_OUTCOMES.has(result.outcome)) {
505
- problems.push(`${what}: its outcome is held, corrected, removed or untried.`);
506
- continue;
507
- }
508
- if ((result.outcome === "held" || result.outcome === "corrected") && result.ran.trim() === "") {
509
- problems.push(`${what}: say in ran what you ran against the original and what it answered - a scenario holds, or is corrected, on what the original did, never on reading its code.`);
510
- }
511
- if (result.outcome === "corrected") {
512
- const text = result.text ?? "";
513
- problems.push(...badLines(`${what}'s new text`, text), ...undefinedConcepts(`${what}'s new text`, text, module.known));
514
- if (text.trim() === scenario.text.trim())
515
- problems.push(`${what} is corrected to the text it had: it held.`);
516
- }
517
- if (result.outcome !== "held" && (result.why ?? "").trim() === "")
518
- problems.push(`${what}: say why it was ${result.outcome === "untried" ? "not tried" : result.outcome}.`);
519
- }
520
- const missing = given.filter((scenario) => !seen.has(`${scenario.funcId}/${scenario.scenarioId}`));
521
- if (missing.length > 0) {
522
- const names = missing.slice(0, 20).map((scenario) => `${scenario.funcId}/${scenario.scenarioId}`);
523
- problems.push(`Try every scenario you were given - these have no result: ${names.join(", ")}${missing.length > 20 ? `, and ${missing.length - 20} more` : ""}.`);
524
- }
525
- problems.push(...correctionProblems(answer.specs, module.specs, module.known));
526
- // A test req is read for every scenario of every module: one that names a scenario or a functional spec is that
527
- // scenario's setup, which its own text says. Only ids of more than one word are looked for - one word is prose too -
528
- // and only kebab-case ones, as every id was checked to be when it was written.
529
- const ids = [...new Set([...given.flatMap((scenario) => [scenario.funcId, scenario.scenarioId]), ...module.specs.keys()])].filter((id) => id.includes("-") && isKebab(id));
530
- answer.testReqs.forEach((req, at) => {
531
- problems.push(...badBullet(`Test req ${at + 1}`, req), ...undefinedConcepts(`Test req ${at + 1}`, req, module.known));
532
- const named = ids.filter((id) => new RegExp(`(^|[^A-Za-z0-9_-])${id}($|[^A-Za-z0-9_-])`).test(req));
533
- if (named.length > 0) {
534
- problems.push(`Test req ${at + 1} names ${named.map((id) => `\`${id}\``).join(", ")}: what some scenarios need is set up in their own text - correct each to say it. A test req is what every conformance test of the part sets up.`);
535
- }
536
- });
537
- return problems;
538
- }
539
- /** What is wrong with a captured feature, against the concepts it was given and the scenarios it may have. */
540
- export function featureProblems(captured, givenDefinitions, scenarioLimit = BASE_SCENARIOS, options = {}) {
541
- const given = new Set(givenDefinitions.map((definition) => definition.concept));
542
- const problems = [];
543
- if (captured.specs.length === 0 && options.mayBeEmpty !== true)
544
- problems.push("Capture the feature in at least one functional spec.");
545
- if (captured.specs.length > MAX_SPECS_PER_FEATURE)
546
- problems.push(`${captured.specs.length} functional specs is more than ${MAX_SPECS_PER_FEATURE}: say less of what is obvious, or merge.`);
547
- const scenarios = captured.specs.reduce((sum, spec) => sum + spec.conformance.length + spec.acceptance.length, 0);
548
- if (scenarios > scenarioLimit)
549
- problems.push(`${scenarios} scenarios is more than your ${scenarioLimit}: keep those of the functional specs the original tests most, and those that can fail silently, be read two ways, or cost dearly when wrong.`);
550
- problems.push(...definitionProblems(captured.definitions, given));
551
- const known = new Set([...given, ...captured.definitions.map((definition) => definition.concept)]);
552
- for (const definition of captured.definitions)
553
- problems.push(...undefinedConcepts(`The definition of ${definition.concept}`, definition.text, known));
554
- if (captured.definitions.length > 0)
555
- problems.push(...definitionCycles([...givenDefinitions, ...captured.definitions]));
556
- const ids = new Set();
557
- for (const spec of captured.specs) {
558
- const what = `Functional spec ${spec.funcId || "(no func-id)"}`;
559
- if (!isKebab(spec.funcId))
560
- problems.push(`${what}: its func_id is not short kebab-case.`);
561
- if (ids.has(spec.funcId))
562
- problems.push(`${what}: two functional specs have that func_id.`);
563
- ids.add(spec.funcId);
564
- problems.push(...badLines(what, spec.text), ...undefinedConcepts(what, spec.text, known));
565
- if (spec.text.length > MAX_SPEC_CHARS)
566
- problems.push(`${what} is ${spec.text.length} characters, more than ${MAX_SPEC_CHARS}: cut what is obvious, move edge cases to scenarios, or split it.`);
567
- const scenarioIds = new Set();
568
- for (const scenario of [...spec.conformance, ...spec.acceptance]) {
569
- const which = `${what}, scenario ${scenario.id || "(no scenario-id)"}`;
570
- if (!isKebab(scenario.id))
571
- problems.push(`${which}: its scenario_id is not short kebab-case.`);
572
- if (scenarioIds.has(scenario.id))
573
- problems.push(`${which}: two of its scenarios have that scenario_id.`);
574
- scenarioIds.add(scenario.id);
575
- problems.push(...badLines(which, scenario.text), ...undefinedConcepts(which, scenario.text, known));
576
- }
577
- }
578
- return problems;
579
- }
580
- /**
581
- * What is wrong with a part's features divided: a feature given no owner line and not merged, or both; a key that is
582
- * no feature; a feature merged into nothing, into itself or into one that is merged too.
583
- */
584
- export function divisionProblems(keys, answer) {
585
- const problems = [];
586
- const known = new Set(keys);
587
- const owned = new Set();
588
- const merged = new Set(answer.merged.map((item) => item.feature));
589
- for (const item of answer.owns) {
590
- if (!known.has(item.feature))
591
- problems.push(`${item.feature} is no feature of the part: use the keys as listed.`);
592
- else if (owned.has(item.feature))
593
- problems.push(`${item.feature} is given what it owns twice.`);
594
- else if (merged.has(item.feature))
595
- problems.push(`${item.feature} is merged and given what it owns: a feature stays or is merged, not both.`);
596
- owned.add(item.feature);
597
- problems.push(...badBullet(`What ${item.feature} owns`, item.owns));
598
- }
599
- for (const item of answer.merged) {
600
- if (!known.has(item.feature))
601
- problems.push(`${item.feature} is no feature of the part: use the keys as listed.`);
602
- if (item.into.length === 0)
603
- problems.push(`${item.feature} is merged into nothing: name the features that take its behaviour.`);
604
- for (const into of item.into) {
605
- if (into === item.feature)
606
- problems.push(`${item.feature} is merged into itself.`);
607
- else if (!known.has(into))
608
- problems.push(`${item.feature} is merged into ${into}, which is no feature of the part.`);
609
- else if (merged.has(into))
610
- problems.push(`${item.feature} is merged into ${into}, which is merged too: name the features its behaviour ends up in.`);
611
- }
612
- if (item.why.trim() === "")
613
- problems.push(`Say why ${item.feature} is merged.`);
614
- }
615
- const missing = keys.filter((key) => !owned.has(key) && !merged.has(key));
616
- if (missing.length > 0)
617
- problems.push(`Say what each feature owns, or merge it: ${missing.join(", ")}.`);
618
- if (merged.size >= keys.length)
619
- problems.push("Keep at least one feature.");
620
- return problems;
621
- }
622
- /**
623
- * What is wrong with reconciled concepts: one missing, a text that does not start with its concept or uses one it may
624
- * not, or definitions that - with the others of the part - use each other in a circle.
625
- */
626
- export function reconciledProblems(answer, asked, known, others = []) {
627
- const problems = [...definitionCycles([...others.filter((definition) => !asked.includes(definition.concept)), ...answer.filter((definition) => asked.includes(definition.concept))])];
628
- for (const concept of asked) {
629
- const given = answer.find((definition) => definition.concept === concept);
630
- if (given === undefined) {
631
- problems.push(`Give ${concept} a definition.`);
632
- continue;
633
- }
634
- if (!given.text.startsWith(concept))
635
- problems.push(`The definition of ${concept} does not start with ${concept}.`);
636
- problems.push(...badBullet(`The definition of ${concept}`, given.text), ...undefinedConcepts(`The definition of ${concept}`, given.text, known));
637
- }
638
- return problems;
639
- }
640
- /** What is wrong with one edit of the readability pass. */
641
- export function editProblems(funcId, edited, original, known) {
642
- if (original === undefined)
643
- return [`There is no functional spec ${funcId} in the module.`];
644
- const what = `The new text of ${funcId}`;
645
- const problems = [...badLines(what, edited), ...undefinedConcepts(what, edited, known)];
646
- if (edited.length > Math.max(original.length * 1.2, original.length + 80))
647
- problems.push(`${what} is longer than the original: a rewrite for readability says the same in fewer words.`);
648
- return problems;
649
- }
@@ -1,13 +0,0 @@
1
- /** The config file in use for a folder: the nearest folder upwards that is a project's, its config.turri.yaml - or none. */
2
- export declare function configInUse(dir: string): string | undefined;
3
- /** Why the config in use cannot be started from - it does not parse - or undefined. */
4
- export declare function configInUseProblem(file: string | undefined): string | undefined;
5
- /**
6
- * The text the captured project's config starts as: the config in use - config.turri.yaml, never another tool's
7
- * config.yaml - without what was the original project's own, conformance tests on, and the models given for the capture
8
- * where the config in use says otherwise.
9
- */
10
- export declare function startingConfig(source: string | undefined, given: {
11
- harnessModel?: string;
12
- codingModel?: string;
13
- }): Promise<string>;