@ultimat3/cli 31.47.1 → 31.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/CLAUDE.md +30 -23
  2. package/README.md +96 -4
  3. package/package.json +29 -29
  4. package/src/api-registration.ts +28 -14
  5. package/src/app-load.ts +6 -1
  6. package/src/app-root.ts +7 -1
  7. package/src/clean-services.ts +142 -0
  8. package/src/cmd-auth.ts +3 -0
  9. package/src/cmd-clean-spec.ts +10 -3
  10. package/src/cmd-clean.ts +23 -9
  11. package/src/cmd-db-backfill.ts +6 -0
  12. package/src/cmd-db-branch.ts +10 -4
  13. package/src/cmd-db-recount.ts +5 -12
  14. package/src/cmd-db-rollback.ts +77 -0
  15. package/src/cmd-db-spec.ts +18 -2
  16. package/src/cmd-db-status.ts +5 -10
  17. package/src/cmd-db.ts +105 -33
  18. package/src/cmd-deploy-verify.ts +14 -6
  19. package/src/cmd-docs-topic.ts +94 -0
  20. package/src/cmd-docs.ts +15 -1
  21. package/src/cmd-doctor.ts +109 -41
  22. package/src/cmd-drill.ts +100 -19
  23. package/src/cmd-env.ts +30 -8
  24. package/src/cmd-errors-app.ts +63 -0
  25. package/src/cmd-errors.ts +50 -14
  26. package/src/cmd-generate.ts +17 -4
  27. package/src/cmd-heavy-spec.ts +36 -0
  28. package/src/cmd-heavy.ts +244 -0
  29. package/src/cmd-jobs.ts +27 -1
  30. package/src/cmd-merge-driver-spec.ts +12 -0
  31. package/src/cmd-merge-driver.ts +95 -0
  32. package/src/cmd-new.ts +23 -3
  33. package/src/cmd-policy-spec.ts +9 -1
  34. package/src/cmd-policy.ts +72 -17
  35. package/src/cmd-stop.ts +18 -4
  36. package/src/cmd-tasks-run.ts +87 -0
  37. package/src/cmd-tasks-spec.ts +10 -3
  38. package/src/cmd-tasks.ts +8 -5
  39. package/src/cmd-test.ts +15 -4
  40. package/src/cmd-upgrade-spec.ts +8 -1
  41. package/src/cmd-upgrade.ts +32 -5
  42. package/src/cmd-verify.ts +9 -41
  43. package/src/codemods/agents-doc-row.ts +73 -0
  44. package/src/codemods/define-error-leaf.ts +37 -12
  45. package/src/codemods/docs-many-agents.ts +26 -0
  46. package/src/codemods/docs-worker-commands.ts +26 -0
  47. package/src/codemods/index.ts +6 -0
  48. package/src/codemods/merge-drivers.ts +66 -0
  49. package/src/command.ts +3 -0
  50. package/src/db-applied-edits.ts +117 -0
  51. package/src/db-dev-wire.ts +18 -0
  52. package/src/db-diagnostics.ts +5 -10
  53. package/src/db-generate.ts +82 -7
  54. package/src/db-migrate-pass.ts +51 -0
  55. package/src/db-migrate-through-dev.ts +209 -0
  56. package/src/db-rollback-consent.ts +128 -0
  57. package/src/db-rollback-pass.ts +76 -0
  58. package/src/db-seed-generate.ts +5 -1
  59. package/src/db-seed.ts +7 -1
  60. package/src/deploy-verify-findings.ts +3 -0
  61. package/src/deploy-verify-grade.ts +3 -0
  62. package/src/deploy-verify-processes.ts +32 -0
  63. package/src/dev-boot.ts +3 -0
  64. package/src/dev-db-migrate.ts +155 -0
  65. package/src/dev-db-rollback.ts +33 -0
  66. package/src/dev-db-settled.ts +22 -0
  67. package/src/dev-lock-errors.ts +78 -0
  68. package/src/dev-lock-holder-dir.ts +64 -0
  69. package/src/dev-lock-live.ts +44 -0
  70. package/src/dev-lock.ts +59 -84
  71. package/src/dev-policy.ts +11 -8
  72. package/src/dev-rebuild-schema.ts +116 -13
  73. package/src/dev-rebuild.ts +13 -4
  74. package/src/dev-route-table.ts +7 -0
  75. package/src/dispatch.ts +21 -1
  76. package/src/doctor-advisory-floors.ts +30 -8
  77. package/src/doctor-api-listing.ts +114 -0
  78. package/src/doctor-guarded.ts +41 -0
  79. package/src/doctor-port.ts +90 -17
  80. package/src/doctor-probe.ts +36 -5
  81. package/src/doctor-processes-probe.ts +127 -0
  82. package/src/doctor-processes.ts +136 -0
  83. package/src/doctor-warnings.ts +17 -0
  84. package/src/error-codes-agents.ts +35 -0
  85. package/src/error-codes-processes.ts +30 -0
  86. package/src/error-codes-tooling.ts +11 -3
  87. package/src/error-codes.ts +12 -13
  88. package/src/errors-suite.ts +27 -0
  89. package/src/errors.ts +18 -22
  90. package/src/exec.ts +11 -3
  91. package/src/exercise-registration.ts +4 -3
  92. package/src/framework-env.ts +7 -3
  93. package/src/generate-files.ts +1 -0
  94. package/src/generate-grant-findings.ts +7 -5
  95. package/src/generate-grants.ts +9 -8
  96. package/src/generate-kinds.ts +30 -6
  97. package/src/generate-roles-file.ts +30 -0
  98. package/src/generate-slice-policy.ts +3 -3
  99. package/src/guards.ts +2 -2
  100. package/src/heavy-cores.ts +51 -0
  101. package/src/heavy-env.ts +21 -0
  102. package/src/heavy-errors.ts +54 -0
  103. package/src/heavy-flock.ts +73 -0
  104. package/src/heavy-holders.ts +78 -0
  105. package/src/heavy-ledger.ts +400 -0
  106. package/src/heavy-memory.ts +67 -0
  107. package/src/heavy-pressure.ts +104 -0
  108. package/src/heavy-weights.ts +47 -0
  109. package/src/heavy.ts +308 -0
  110. package/src/i18n-registration.ts +22 -2
  111. package/src/island-harness.ts +2 -2
  112. package/src/job-budget.ts +4 -2
  113. package/src/job-registration.ts +64 -8
  114. package/src/jobs-queue-known.ts +43 -0
  115. package/src/local-cli.ts +6 -5
  116. package/src/mcp-errors-agents.ts +20 -0
  117. package/src/mcp-errors-doctor.ts +27 -0
  118. package/src/mcp-errors-processes.ts +23 -0
  119. package/src/mcp-errors.ts +18 -29
  120. package/src/mcp-host.ts +2 -2
  121. package/src/merge-driver-catalog.ts +58 -0
  122. package/src/merge-driver-config.ts +43 -0
  123. package/src/merge-driver-lines.ts +140 -0
  124. package/src/merge-state.ts +105 -0
  125. package/src/messages-db.ts +22 -1
  126. package/src/messages-processes.ts +13 -0
  127. package/src/messages-upgrade.ts +6 -0
  128. package/src/messages.ts +62 -1
  129. package/src/output-findings.ts +48 -21
  130. package/src/parse.ts +37 -6
  131. package/src/policy-facts.ts +38 -21
  132. package/src/policy-row.ts +99 -0
  133. package/src/port-pair-free.ts +28 -0
  134. package/src/registry-lines.ts +110 -0
  135. package/src/registry.ts +4 -0
  136. package/src/retain-sweep.ts +1 -1
  137. package/src/role-replicator.ts +9 -4
  138. package/src/role-select.ts +86 -0
  139. package/src/role-start.ts +13 -55
  140. package/src/role-sync.ts +10 -5
  141. package/src/runtime-cache-frame.ts +46 -0
  142. package/src/runtime-cache-ttl.ts +23 -0
  143. package/src/runtime-cache.ts +56 -18
  144. package/src/runtime-database-ssl.ts +84 -0
  145. package/src/runtime-idempotency-scope.ts +16 -2
  146. package/src/runtime-jobs-share.ts +52 -0
  147. package/src/runtime-jobs.ts +43 -12
  148. package/src/runtime-overrides.ts +4 -2
  149. package/src/runtime-queue.ts +18 -3
  150. package/src/runtime-services.ts +8 -1
  151. package/src/schema-drift.ts +19 -2
  152. package/src/schema-dump-drift.ts +4 -1
  153. package/src/serve-boot-probe.ts +30 -2
  154. package/src/serve-boot.ts +11 -1
  155. package/src/serve-env.ts +39 -3
  156. package/src/serve.ts +61 -10
  157. package/src/stop-run-start.ts +12 -0
  158. package/src/supervise-boot.ts +61 -0
  159. package/src/supervise-cgroup.ts +84 -0
  160. package/src/supervise-child.ts +206 -0
  161. package/src/supervise-count.ts +244 -0
  162. package/src/supervise-errors.ts +83 -0
  163. package/src/supervise-facts.ts +40 -0
  164. package/src/supervise-messages.ts +84 -0
  165. package/src/supervise-policy.ts +46 -0
  166. package/src/supervise-pool.ts +10 -0
  167. package/src/supervise-probe.ts +158 -0
  168. package/src/supervise-run.ts +54 -0
  169. package/src/supervise.ts +383 -0
  170. package/src/templates/generate-purge.ts +6 -6
  171. package/src/templates/guard-animated-layout-property.ts +2 -2
  172. package/src/templates/guard-bare-error.ts +1 -1
  173. package/src/templates/guard-error-declared.ts +2 -2
  174. package/src/templates/guard-focus-visible.ts +1 -1
  175. package/src/templates/guard-image-dimensions.ts +2 -2
  176. package/src/templates/guard-island-mount-clears.ts +1 -1
  177. package/src/templates/guard-native-confirm.ts +1 -1
  178. package/src/templates/guard-raw-breakpoint.ts +2 -2
  179. package/src/templates/guard-raw-colour.ts +2 -2
  180. package/src/templates/guard-raw-fetch.ts +1 -1
  181. package/src/templates/guard-raw-interval.ts +1 -1
  182. package/src/templates/guard-raw-length.ts +3 -3
  183. package/src/templates/guard-raw-motion.ts +1 -1
  184. package/src/templates/guard-raw-shadow.ts +1 -1
  185. package/src/templates/guard-raw-z-index.ts +1 -1
  186. package/src/templates/guard-released-forms.ts +59 -13
  187. package/src/templates/guard-repo-await-in-loop.ts +1 -1
  188. package/src/templates/guard-repo-raw-sql.ts +4 -4
  189. package/src/templates/guard-repo-unbounded.ts +1 -1
  190. package/src/templates/guard-runtime-pin.ts +1 -1
  191. package/src/templates/guard-semantic-interactive.ts +2 -2
  192. package/src/templates/guard-unbounded-fanout.ts +1 -1
  193. package/src/templates/guard-undeclared-custom-property.ts +3 -3
  194. package/src/templates/guard-undefined-style-class.ts +3 -3
  195. package/src/templates/guard-unzoned-date.ts +3 -3
  196. package/src/templates/query-slice.ts +82 -0
  197. package/src/templates/query.ts +76 -30
  198. package/src/templates/resource-page.ts +3 -2
  199. package/src/templates/scaffold-bin.ts +2 -0
  200. package/src/templates/scaffold-claude-agents.ts +9 -6
  201. package/src/templates/scaffold-claude-commands.ts +7 -1
  202. package/src/templates/scaffold-claude.ts +4 -4
  203. package/src/templates/scaffold-container-compose.ts +47 -7
  204. package/src/templates/scaffold-docs.ts +11 -6
  205. package/src/templates/scaffold-gitattributes.ts +18 -1
  206. package/src/templates/scaffold-helm-templates.ts +9 -0
  207. package/src/templates/scaffold-repo.ts +4 -1
  208. package/src/templates/scaffold-test-services.ts +33 -11
  209. package/src/templates/shapes/offline.ts +0 -7
  210. package/src/templates/shapes/realtime.ts +2 -6
  211. package/src/templates/sign-in-action-tests.ts +6 -4
  212. package/src/templates/sign-in-challenge.ts +62 -0
  213. package/src/templates/sign-in-oidc-mfa.ts +31 -0
  214. package/src/templates/sign-in-oidc.ts +11 -3
  215. package/src/templates/sign-in-password.ts +18 -56
  216. package/src/test-batches.ts +9 -3
  217. package/src/test-shards.ts +117 -37
  218. package/src/test-slots.ts +35 -161
  219. package/src/test-verdict.ts +79 -0
  220. package/src/test-workers.ts +15 -0
  221. package/src/upgrade-gate-codemods.ts +5 -3
  222. package/src/upgrade-gate.ts +19 -1
  223. package/src/upgrade-merge-drivers.ts +25 -0
  224. package/src/upgrade-report.ts +18 -4
  225. package/src/upgrade-scope.ts +62 -0
  226. package/src/verify-checks.ts +6 -11
  227. package/src/verify-coverage-run.ts +9 -5
  228. package/src/verify-deadline.ts +18 -2
  229. package/src/verify-heavy-steps.ts +26 -0
  230. package/src/verify-live.ts +38 -14
  231. package/src/verify-only.ts +67 -0
  232. package/src/verify-progress.ts +7 -3
  233. package/src/verify-run.ts +20 -2
  234. package/src/verify-services-stack.ts +165 -0
  235. package/src/verify-services.ts +84 -2
  236. package/src/verify-test-run.ts +9 -9
  237. package/src/verify-tests.ts +35 -22
  238. package/src/verify-typecheck.ts +25 -2
  239. package/wiki/Actions.md +2 -1
  240. package/wiki/Admin-Dashboard.md +2 -2
  241. package/wiki/Agents.md +5 -5
  242. package/wiki/Auth.md +15 -5
  243. package/wiki/Bare-VM.md +1 -1
  244. package/wiki/Building-Your-Own-Base.md +15 -2
  245. package/wiki/CI-Parallel-Gate.md +4 -4
  246. package/wiki/CLI-Reference.md +127 -48
  247. package/wiki/Caching-And-Invalidation.md +2 -2
  248. package/wiki/Client-Navigation.md +1 -1
  249. package/wiki/Configuration.md +32 -13
  250. package/wiki/Deployment.md +44 -4
  251. package/wiki/Entities-And-Migrations.md +5 -1
  252. package/wiki/FAQ.md +1 -1
  253. package/wiki/Getting-Started.md +2 -2
  254. package/wiki/Home.md +2 -1
  255. package/wiki/I18n.md +5 -3
  256. package/wiki/Installation.md +12 -11
  257. package/wiki/Interface-Rules.md +1 -1
  258. package/wiki/Jobs-And-Workflows.md +24 -4
  259. package/wiki/Known-Gaps.md +2 -2
  260. package/wiki/MCP-And-AI.md +8 -5
  261. package/wiki/Mail.md +1 -1
  262. package/wiki/Many-Agents.md +127 -0
  263. package/wiki/Migrations-And-Backfills.md +18 -0
  264. package/wiki/Notify.md +1 -1
  265. package/wiki/Observability.md +13 -0
  266. package/wiki/Queries-And-Live-Queries.md +2 -2
  267. package/wiki/Realtime.md +10 -1
  268. package/wiki/Routes-And-Render-Modes.md +1 -1
  269. package/wiki/Scheduled-Tasks.md +4 -1
  270. package/wiki/Testing.md +12 -9
  271. package/wiki/Timezones-And-Dates.md +5 -1
  272. package/wiki/Troubleshooting.md +1 -0
  273. package/wiki/Tutorial-01-First-App.md +5 -5
  274. package/wiki/Tutorial-02-First-Feature.md +1 -1
  275. package/wiki/Tutorial-03-Auth-And-Admin.md +7 -6
  276. package/wiki/Upgrading.md +37 -0
@@ -111,7 +111,7 @@ export function rawShadows(files: readonly StyleFile[]): readonly Finding[] {
111
111
  findings.push({
112
112
  code: CODE,
113
113
  cause: \`\${file.path}:\${line} writes \\\`\${property}: \${value}\\\` — a shadow with the hand-written length \${literal}, which no theme restates: dark mode keeps the light theme's elevation\`,
114
- fix: \`\${written} — at \${file.path}:\${line}, then: x verify\`,
114
+ fix: \`\${written} — at \${file.path}:\${line}, then: x verify --only boundaries\`,
115
115
  at: \`\${file.path}:\${line}\`,
116
116
  });
117
117
  }
@@ -89,7 +89,7 @@ export function rawZIndexes(files: readonly StyleFile[]): readonly Finding[] {
89
89
  findings.push({
90
90
  code: CODE,
91
91
  cause: \`\${file.path}:\${line} writes \\\`z-index: \${value}\\\` — a number only this file knows, on no ladder another layer can be placed against\`,
92
- fix: \`z-index: \${written} — at \${file.path}:\${line} (layers: \${LAYERS.map(([name]) => name).join(' ')}), then: x verify\`,
92
+ fix: \`z-index: \${written} — at \${file.path}:\${line} (layers: \${LAYERS.map(([name]) => name).join(' ')}), then: x verify --only boundaries\`,
93
93
  at: \`\${file.path}:\${line}\`,
94
94
  });
95
95
  }
@@ -6,6 +6,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
6
6
  Record<string, readonly (readonly [string, 'error' | 'warning'])[]>
7
7
  > = {
8
8
  'animated-layout-property': [
9
+ ['21sfece05i0e3', 'error'],
9
10
  ['2hqr04589t23q', 'error'],
10
11
  ['2z9j3sd8e7lgl', 'error'],
11
12
  ],
@@ -15,22 +16,29 @@ export const RELEASED_GUARD_FORMS: Readonly<
15
16
  ['1ot9kwydyzd0j', 'error'],
16
17
  ['2aaavkemg4qee', 'error'],
17
18
  ['2s43pcjqyhmfi', 'error'],
19
+ ['n9w3ww2famyi', 'error'],
18
20
  ],
19
21
  'error-declared': [
20
22
  ['1rlzex7nalpiw', 'error'],
21
23
  ['2tfw2hq80msju', 'error'],
24
+ ['3drdb0cke61iw', 'error'],
22
25
  ['3kqd7d8pzpcnn', 'error'],
23
26
  ],
24
27
  'focus-visible': [
25
28
  ['3i4t0gznxyytf', 'error'],
26
29
  ['4c2nf0mpzn0z', 'error'],
30
+ ['wndpmcuvl3o6', 'error'],
27
31
  ],
28
32
  'image-dimensions': [
29
33
  ['1cfzth883qzt5', 'error'],
30
34
  ['1upoweaclyd8', 'error'],
35
+ ['1yk40qifcror', 'error'],
31
36
  ['33uv2ua4a9zcf', 'error'],
32
37
  ],
33
- 'island-mount-clears': [['1v09h5ptzqvs2', 'error']],
38
+ 'island-mount-clears': [
39
+ ['1v09h5ptzqvs2', 'error'],
40
+ ['2buinh3zw0lqs', 'error'],
41
+ ],
34
42
  'island-without-states': [
35
43
  ['2os1f5fb6aass', 'error'],
36
44
  ['31gjhz3nyf0gz', 'error'],
@@ -39,63 +47,100 @@ export const RELEASED_GUARD_FORMS: Readonly<
39
47
  ['1f7eh34hj085a', 'error'],
40
48
  ['2b134wpkoaqso', 'error'],
41
49
  ['2eb7ld3hg0tpb', 'error'],
50
+ ['3sabhehzp5i6g', 'error'],
51
+ ],
52
+ 'raw-breakpoint': [
53
+ ['21j2j5t89cmax', 'error'],
54
+ ['wdo3lsqmvsya', 'error'],
42
55
  ],
43
- 'raw-breakpoint': [['wdo3lsqmvsya', 'error']],
44
56
  'raw-colour': [
45
57
  ['17jw6r17ah3dq', 'error'],
46
58
  ['1e2pkqnmrjt44', 'error'],
59
+ ['2ml4gr1ou95vp', 'error'],
47
60
  ['3onnbx54g9zmd', 'error'],
48
61
  ['mdo7f20dnyof', 'error'],
49
62
  ],
50
63
  'raw-fetch': [
51
64
  ['17xdeprvzx5v2', 'error'],
52
65
  ['1hgdwthi7j353', 'error'],
66
+ ['21v2jbczhqz8k', 'error'],
53
67
  ['mazudnz7t6iy', 'error'],
54
68
  ],
55
69
  'raw-interval': [
56
70
  ['1o6p0fmjhzdhw', 'error'],
57
71
  ['2xrqszz066coc', 'error'],
58
72
  ['3qipy7ijjnz7r', 'error'],
73
+ ['3qu74px1wei5s', 'error'],
59
74
  ['ll7h7zpr075u', 'error'],
60
75
  ],
61
- 'raw-length': [['2vfl0ssvkqvua', 'error']],
76
+ 'raw-length': [
77
+ ['19by09okc9bse', 'error'],
78
+ ['2vfl0ssvkqvua', 'error'],
79
+ ],
62
80
  'raw-motion': [
63
81
  ['14c1bs20ysc1u', 'error'],
82
+ ['u6julhh0et2k', 'error'],
64
83
  ['w8aw0q20tfsz', 'error'],
65
84
  ],
66
- 'raw-shadow': [['1vhy6xulc5cs5', 'error']],
67
- 'raw-z-index': [['2nnuj62o3qvvr', 'error']],
68
- 'repo-await-in-loop': [['3a3v6vvmbf8q2', 'warning']],
85
+ 'raw-shadow': [
86
+ ['13t0n8kesciv6', 'error'],
87
+ ['1vhy6xulc5cs5', 'error'],
88
+ ],
89
+ 'raw-z-index': [
90
+ ['2fae6nsqzvylo', 'error'],
91
+ ['2nnuj62o3qvvr', 'error'],
92
+ ],
93
+ 'repo-await-in-loop': [
94
+ ['2453q2b7xpeu3', 'warning'],
95
+ ['3a3v6vvmbf8q2', 'warning'],
96
+ ],
69
97
  'repo-raw-sql': [
70
98
  ['12qj02j416sib', 'error'],
71
99
  ['2kr7gbv7j2m0v', 'error'],
72
100
  ['2m5sh5923zcdx', 'error'],
101
+ ['2od9gruczoiim', 'error'],
73
102
  ['3nmlelym16o78', 'error'],
74
103
  ],
75
104
  'repo-unbounded': [
105
+ ['1p97kt8y158hu', 'error'],
76
106
  ['2yjuyaj4n8dqq', 'error'],
107
+ ['3btoad27s4eai', 'warning'],
77
108
  ['ae4czielms3c', 'warning'],
78
109
  ],
79
- 'runtime-pin': [['28ffbpwy4q2ji', 'error']],
110
+ 'runtime-pin': [
111
+ ['28ffbpwy4q2ji', 'error'],
112
+ ['2xr2x2hjhyo1n', 'error'],
113
+ ],
80
114
  'semantic-interactive': [
115
+ ['24ry4tuzqa82q', 'error'],
81
116
  ['29pfa4ea628cv', 'error'],
82
117
  ['2m280ivq01zs2', 'error'],
83
118
  ['d4ncwu39wtrk', 'error'],
84
119
  ],
85
- 'unbounded-fanout': [['xk4dv9vsq8gg', 'error']],
120
+ 'unbounded-fanout': [
121
+ ['27m870avd47et', 'error'],
122
+ ['xk4dv9vsq8gg', 'error'],
123
+ ],
86
124
  'undeclared-custom-property': [
87
125
  ['2xnl4zuy9xv6f', 'error'],
88
126
  ['3b0u9i8hze00x', 'error'],
127
+ ['5q7i306j0imi', 'error'],
89
128
  ],
90
129
  'undeclared-env': [
91
- ['13k4amuxgsnla', 'error'],
92
- ['1xkusngzbabza', 'error'],
93
- ['2jbihvbp83mb4', 'error'],
94
- ['3gsy96z8bgrrl', 'error'],
95
- ['81vvl6xx5bb8', 'error'],
130
+ ['16pof11n1trhg', 'error'],
131
+ ['1f8kizielequo', 'error'],
132
+ ['1fc7m95vm6k3g', 'error'],
133
+ ['20rw6oj7g0bz3', 'error'],
134
+ ['2jb32jms80mge', 'error'],
135
+ ['2t3qtexnpfnyq', 'error'],
136
+ ['2x7h5rxf4hv0g', 'error'],
137
+ ['3gsoj050vbe69', 'error'],
138
+ ['3mtci6brks9i6', 'error'],
139
+ ['3rmwdbc6jgv5q', 'error'],
96
140
  ],
97
141
  'undefined-style-class': [
98
142
  ['3food9t4vrzv8', 'error'],
143
+ ['ps08370p9qlg', 'error'],
99
144
  ['w7as1ib1ido8', 'error'],
100
145
  ],
101
146
  'untranslated-string': [
@@ -108,6 +153,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
108
153
  ],
109
154
  'unzoned-date': [
110
155
  ['14sc1shft1opi', 'error'],
156
+ ['1ljvva96m9b9z', 'error'],
111
157
  ['38jqi2md5adsi', 'error'],
112
158
  ['3caz4m0vn66dz', 'error'],
113
159
  ['8apjndc5ybvm', 'error'],
@@ -186,7 +186,7 @@ export function awaitsInLoops(files: readonly RepoFile[]): readonly Finding[] {
186
186
  findings.push({
187
187
  code: CODE,
188
188
  cause: \`\${where} awaits inside the \${inner.kind} at \${loopLine} — one round trip per element, so the statements a call sends grow with the rows it is handed\`,
189
- fix: \`db.<table>.andWhere('id', 'in', ids).limit(ids.length).all() (or insertAll / updateWhere / deleteWhere) — one statement for the set in place of the \${inner.kind} at \${loopLine}, or expectedQueryLoop('<why one per element is optimal>', fn) from @ultimat3/db around it — then: x verify\`,
189
+ fix: \`db.<table>.andWhere('id', 'in', ids).limit(ids.length).all() (or insertAll / updateWhere / deleteWhere) — one statement for the set in place of the \${inner.kind} at \${loopLine}, or expectedQueryLoop('<why one per element is optimal>', fn) from @ultimat3/db around it — then: x verify --only boundaries\`,
190
190
  at: where,
191
191
  });
192
192
  }
@@ -294,7 +294,7 @@ const KEYSET_CALL =
294
294
  const truncatedFinding = (at: string): Finding => ({
295
295
  code: CODE,
296
296
  cause: \`\${at} orders by date_trunc('milliseconds', …), the workaround for a Date losing microseconds — and the index cannot serve that expression: measured on 300,000 rows, an Index Only Scan (0.2 ms) became a Parallel Seq Scan and a sort (100 ms)\`,
297
- fix: \`\${KEYSET_CALL} — from @ultimat3/db, its select, where, orderBy and limit spliced in place of the date_trunc order at \${at}, then: x verify\`,
297
+ fix: \`\${KEYSET_CALL} — from @ultimat3/db, its select, where, orderBy and limit spliced in place of the date_trunc order at \${at}, then: x verify --only boundaries\`,
298
298
  at,
299
299
  });
300
300
 
@@ -328,7 +328,7 @@ const ANY_STATEMENT: readonly {
328
328
  finding: (at) => ({
329
329
  code: CODE,
330
330
  cause: \`\${at} pages with a hand row comparison, (a, b) < (?, ?) — the seek keyset() writes with its tie-break, its direction and its cursor codec, each one a detail a hand copy gets wrong when a key column changes\`,
331
- fix: \`\${KEYSET_CALL} — from @ultimat3/db, its keys the columns of the row comparison at \${at}, then: x verify\`,
331
+ fix: \`\${KEYSET_CALL} — from @ultimat3/db, its keys the columns of the row comparison at \${at}, then: x verify --only boundaries\`,
332
332
  at,
333
333
  }),
334
334
  },
@@ -337,7 +337,7 @@ const ANY_STATEMENT: readonly {
337
337
  finding: (at) => ({
338
338
  code: CODE,
339
339
  cause: \`\${at} takes pg_advisory_xact_lock by hand — a key hashed where nothing else can see it, and two keys taken in whatever order two callers reach them, which is a deadlock\`,
340
- fix: \`db.<table>.lockKeys([key], async (tx) => …) — the typed handle of the table the lock guards, sorted keys in one transaction, in place of the sql literal at \${at}, then: x verify\`,
340
+ fix: \`db.<table>.lockKeys([key], async (tx) => …) — the typed handle of the table the lock guards, sorted keys in one transaction, in place of the sql literal at \${at}, then: x verify --only boundaries\`,
341
341
  at,
342
342
  }),
343
343
  },
@@ -359,7 +359,7 @@ export function rawRepoSql(files: readonly RepoFile[]): readonly Finding[] {
359
359
  findings.push({
360
360
  code: CODE,
361
361
  cause: \`\${at} sends a statement the typed handle expresses as hand-written SQL — no tenant guard on it, no codec for money or a sealed column, and no compile error when a column is renamed\`,
362
- fix: \`\${call} — in place of the sql literal at \${at}, with db imported from this app's db package, then: x verify\`,
362
+ fix: \`\${call} — in place of the sql literal at \${at}, with db imported from this app's db package, then: x verify --only boundaries\`,
363
363
  at,
364
364
  });
365
365
  }
@@ -177,7 +177,7 @@ export function unboundedReads(files: readonly RepoFile[]): readonly Finding[] {
177
177
  findings.push({
178
178
  code: CODE,
179
179
  cause: \`\${where} reads \${read} with .all() and no .limit(n) — .all() answers its first page, 50 rows, and drops the cursor to the rest, so the caller holds neither every row nor a page it chose\`,
180
- fix: \`\${read}….limit(<the most rows this caller needs>).all() at \${where} — or .inBatches(size) to walk every row, .page() to hand a cursor on, or a // why: comment on that line naming the bound — then: x verify\`,
180
+ fix: \`\${read}….limit(<the most rows this caller needs>).all() at \${where} — or .inBatches(size) to walk every row, .page() to hand a cursor on, or a // why: comment on that line naming the bound — then: x verify --only boundaries\`,
181
181
  at: where,
182
182
  });
183
183
  }
@@ -69,7 +69,7 @@ const imageFor = (version: string, variant: string, rest: string): string =>
69
69
  const finding = (at: string, cause: string, write: string): Finding => ({
70
70
  code: CODE,
71
71
  cause,
72
- fix: \`edit \${at} — \${write} — then: x verify\`,
72
+ fix: \`edit \${at} — \${write} — then: x verify --only boundaries\`,
73
73
  at,
74
74
  });
75
75
 
@@ -153,7 +153,7 @@ export function semanticInteractive(files: readonly SourceFile[]): readonly Find
153
153
  findings.push({
154
154
  code: CODE,
155
155
  cause: \`\${at} puts role="\${role}" on <\${tag.name}> — a role is a promise, and this one obliges the element to answer Space, Enter, focus and disabled, which the native element already does\`,
156
- fix: \`replace <\${tag.name} role="\${role}"> in \${file.path} with \${native.write}, then: x verify\`,
156
+ fix: \`replace <\${tag.name} role="\${role}"> in \${file.path} with \${native.write}, then: x verify --only boundaries\`,
157
157
  at: file.path,
158
158
  });
159
159
  continue;
@@ -163,7 +163,7 @@ export function semanticInteractive(files: readonly SourceFile[]): readonly Find
163
163
  findings.push({
164
164
  code: CODE,
165
165
  cause: \`\${at} hangs \${handler} on <\${tag.name}>, which takes no focus and answers no key — a keyboard, a screen reader and a switch reach a mouse handler on an inert element in exactly one way, which is not at all\`,
166
- fix: \`write <button type="button"> — or the native control this element means — in place of <\${tag.name}> at \${at}, then: x verify\`,
166
+ fix: \`write <button type="button"> — or the native control this element means — in place of <\${tag.name}> at \${at}, then: x verify --only boundaries\`,
167
167
  at: file.path,
168
168
  });
169
169
  }
@@ -80,7 +80,7 @@ export function unboundedFanouts(files: readonly SourceFile[]): readonly Finding
80
80
  findings.push({
81
81
  code: CODE,
82
82
  cause: \`\${at} starts a database call for every element of \${list} at once — as many statements in flight as the list is long, queued on a pool a fraction of that size\`,
83
- fix: \`mapBounded(\${list}, <the same async callback>, { width: 8 }) — from @ultimat3/core, in place of the Promise.all at \${at}, the width what the pool can take — or a // why: comment on that line naming the list's bound — then: x verify\`,
83
+ fix: \`mapBounded(\${list}, <the same async callback>, { width: 8 }) — from @ultimat3/core, in place of the Promise.all at \${at}, the width what the pool can take — or a // why: comment on that line naming the list's bound — then: x verify --only boundaries\`,
84
84
  at,
85
85
  });
86
86
  }
@@ -95,7 +95,7 @@ export function undeclaredCustomProperties(
95
95
  return broken.map((sheet) => ({
96
96
  code: CODE,
97
97
  cause: \`\${sheet.path} does not compile\${sheet.error === undefined ? '' : \`: \${sheet.error}\`} — so the custom properties it declares are unknown and no var() read in this app was checked\`,
98
- fix: \`repair the Sass in \${sheet.path}\${sheet.error === undefined ? " — x build --target static prints the compiler's error for a sheet a page uses —" : ' at the error the cause quotes,'} then: x verify\`,
98
+ fix: \`repair the Sass in \${sheet.path}\${sheet.error === undefined ? " — x build --target static prints the compiler's error for a sheet a page uses —" : ' at the error the cause quotes,'} then: x verify --only boundaries\`,
99
99
  at: sheet.path,
100
100
  }));
101
101
  }
@@ -121,8 +121,8 @@ export function undeclaredCustomProperties(
121
121
  cause: \`\${sheet.path}:\${line} reads var(\${name}), and nothing in this app declares \${name} — the declaration it sits in computes to nothing, silently\`,
122
122
  fix:
123
123
  offered.length > 0
124
- ? \`\${offered.join(' | ')} — the steps \${stem}* has; write one in place of \\\`\${name.slice(stem.length)}\\\` at \${sheet.path}:\${line}, then: x verify\`
125
- : \`declare \${name} where it is set — on the element, in the app's global.scss, or for a colour, radius or font through defineTheme() — or correct the name at \${sheet.path}:\${line}, then: x verify\`,
124
+ ? \`\${offered.join(' | ')} — the steps \${stem}* has; write one in place of \\\`\${name.slice(stem.length)}\\\` at \${sheet.path}:\${line}, then: x verify --only boundaries\`
125
+ : \`declare \${name} where it is set — on the element, in the app's global.scss, or for a colour, radius or font through defineTheme() — or correct the name at \${sheet.path}:\${line}, then: x verify --only boundaries\`,
126
126
  at: \`\${sheet.path}:\${line}\`,
127
127
  });
128
128
  }
@@ -92,7 +92,7 @@ export async function undefinedStyleClasses(
92
92
  findings.push({
93
93
  code: CODE,
94
94
  cause: \`\${at} imports \${sheet}, which does not compile\${said} — no class read off \${binding} was checked, and each may render as nothing\`,
95
- fix: \`repair the Sass in \${sheet}\${said === '' ? " (x build --target static prints the compiler's error)" : ' at the error the cause quotes'}, or correct the import at \${at}, then: x verify\`,
95
+ fix: \`repair the Sass in \${sheet}\${said === '' ? " (x build --target static prints the compiler's error)" : ' at the error the cause quotes'}, or correct the import at \${at}, then: x verify --only boundaries\`,
96
96
  at,
97
97
  });
98
98
  continue;
@@ -116,8 +116,8 @@ export async function undefinedStyleClasses(
116
116
  cause: \`\${file.path}:\${line} reads \${binding}.\${name}, and \${sheet} compiles no class \\\`\${name}\\\` — the element renders with no class, and nothing says so\`,
117
117
  fix:
118
118
  meant === undefined
119
- ? \`add \\\`.\${name} { … }\\\` to \${sheet}, or delete the read at \${file.path}:\${line}, then: x verify\`
120
- : \`\${binding}\${/^[A-Za-z_$][\\w$]*$/.test(meant) ? \`.\${meant}\` : \`['\${meant}']\`} — at \${file.path}:\${line}; \${sheet} declares \\\`.\${meant}\\\`, then: x verify\`,
119
+ ? \`add \\\`.\${name} { … }\\\` to \${sheet}, or delete the read at \${file.path}:\${line}, then: x verify --only boundaries\`
120
+ : \`\${binding}\${/^[A-Za-z_$][\\w$]*$/.test(meant) ? \`.\${meant}\` : \`['\${meant}']\`} — at \${file.path}:\${line}; \${sheet} declares \\\`.\${meant}\\\`, then: x verify --only boundaries\`,
121
121
  at: \`\${file.path}:\${line}\`,
122
122
  });
123
123
  }
@@ -114,10 +114,10 @@ export function unzonedDates(files: readonly SourceFile[]): readonly Finding[] {
114
114
  cause: \`\${file.path}:\${line} calls \${match[0].trim()}) with no timeZone — it formats in whatever zone the process happens to run in, so one row reads as two different days across two containers\`,
115
115
  fix:
116
116
  zoned !== undefined
117
- ? \`\${called}() has no zone option — in \${file.path} call \${zoned}(locale, { timeZone: 'UTC' }) instead — then: x verify\`
117
+ ? \`\${called}() has no zone option — in \${file.path} call \${zoned}(locale, { timeZone: 'UTC' }) instead — then: x verify --only boundaries\`
118
118
  : bare
119
- ? \`in \${file.path}: a Date → pass an explicit IANA zone, at.toLocaleString(locale, { timeZone: 'UTC' }); a NUMBER → new Intl.NumberFormat(locale).format(n) instead — then: x verify\`
120
- : \`pass an explicit IANA zone in \${file.path} — toLocaleDateString(locale, { timeZone: 'UTC' }) — then: x verify\`,
119
+ ? \`in \${file.path}: a Date → pass an explicit IANA zone, at.toLocaleString(locale, { timeZone: 'UTC' }); a NUMBER → new Intl.NumberFormat(locale).format(n) instead — then: x verify --only boundaries\`
120
+ : \`pass an explicit IANA zone in \${file.path} — toLocaleDateString(locale, { timeZone: 'UTC' }) — then: x verify --only boundaries\`,
121
121
  at: file.path,
122
122
  });
123
123
  }
@@ -0,0 +1,82 @@
1
+ // What `x g query` asks of a slice somebody wrote before it plans a file: the table its
2
+ // `entity.ts` declares and the rule its `policy.ts` exports. Split from `query.ts` at the ceiling.
3
+
4
+ import { stripComments, UltimateError } from '@ultimat3/core';
5
+ import { SlicePolicyIncompleteError } from '../generate-slice-policy';
6
+ import type { FeatureTarget } from './entity';
7
+ import type { GeneratedFile, NameSet } from './naming';
8
+ import { exportsUnknown, sliceExports } from './slice-foundation';
9
+
10
+ /** The slice modules as they stand on disk; absent is "this run writes the scaffolded one". */
11
+ export interface SliceOnDisk extends FeatureTarget {
12
+ readonly sliceEntity?: string;
13
+ readonly slicePolicy?: string;
14
+ }
15
+
16
+ /**
17
+ * The read imports the slice's own row type and repo, and a slice declaring another table under
18
+ * its name — or exporting no such type — has neither.
19
+ */
20
+ export class QuerySliceEntityError extends UltimateError {
21
+ constructor(input: { readonly path: string; readonly binding: string; readonly table: string }) {
22
+ super({
23
+ code: 'X_QUERY_SLICE_ENTITY',
24
+ cause: `x g query reads the slice's own scaffolded table, and its entity.ts declares ${input.binding} (${input.table}) instead — the generated read would import a row type and a repo that do not exist`,
25
+ fix: `x queries list --json # then declare query({ sql: … from('${input.table}', …) }) by hand in ${input.path}, over ../entity's ${input.binding}`,
26
+ meta: { binding: input.binding, table: input.table },
27
+ });
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Refuse a hand-written slice whose `policy.ts` lacks what the read imports from it: the rule and,
33
+ * cached, the tag. Thrown while the files are planned — a dangling VALUE import in a registered
34
+ * module is every later command failing to load the app. The row type is not asked for: a missing
35
+ * `type` is erased at load and is the typecheck's to name, and `X_BOUNDARY_ROUTE_TO_DB`'s printed
36
+ * fix runs this generator into slices whose `entity.ts` an author shaped.
37
+ */
38
+ export function assertSliceExports(target: SliceOnDisk, feature: NameSet, live: boolean): void {
39
+ const policy = target.slicePolicy;
40
+ // A barrel re-exporting a module nobody could read: cannot tell, so never refused on a guess.
41
+ if (policy === undefined || exportsUnknown(policy)) return;
42
+ const needed = [`can${feature.pascal}Read`, ...(live ? [] : [`${feature.camel}Tag`])];
43
+ const missing = needed.filter((name) => !sliceExports(policy, name));
44
+ if (missing.length === 0) return;
45
+ throw new SlicePolicyIncompleteError({
46
+ policy: `${target.surfaceDir}/${target.feature}/policy.ts`,
47
+ feature: target.feature,
48
+ missing,
49
+ kind: 'query',
50
+ });
51
+ }
52
+
53
+ /** The columns the read orders by, so its in-memory half can apply the order to what it answers. */
54
+ const ORDER_COLUMNS = ['id', 'title', 'createdAt'] as const;
55
+
56
+ /**
57
+ * Whether the read may answer through the slice's `<Feature>View`: this run writes the scaffolded
58
+ * entity (absent), or the one on disk declares the view over every column the read orders by — a
59
+ * view without `createdAt` is a sort the projected rows cannot answer (X_QUERY_COLUMN_UNSELECTED).
60
+ * Otherwise the read answers the row, as it did before the view existed: never an import of a
61
+ * name the author's `entity.ts` does not export.
62
+ */
63
+ export function readsThroughView(feature: NameSet, sliceEntity: string | undefined): boolean {
64
+ if (sliceEntity === undefined) return true;
65
+ const code = stripComments(sliceEntity);
66
+ const declared = new RegExp(
67
+ `\\bexport\\s+const\\s+${feature.pascal}View\\s*=\\s*\\w+\\.\\$view\\(\\[([^\\]]*)\\]`,
68
+ ).exec(code);
69
+ const keys = declared?.[1];
70
+ return keys !== undefined && ORDER_COLUMNS.every((column) => keys.includes(`'${column}'`));
71
+ }
72
+
73
+ /** A foundation test asserts the scaffold's shape: never planted beside a module the author wrote. */
74
+ export const withoutOwnedTests = (
75
+ files: readonly GeneratedFile[],
76
+ target: SliceOnDisk,
77
+ ): readonly GeneratedFile[] =>
78
+ files.filter(
79
+ (file) =>
80
+ !(target.sliceEntity !== undefined && file.path.endsWith('/entity.test.ts')) &&
81
+ !(target.slicePolicy !== undefined && file.path.endsWith('/policy.test.ts')),
82
+ );