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