@ultimat3/cli 31.48.0 → 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 (260) 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 +80 -18
  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 +9 -1
  28. package/src/cmd-heavy.ts +111 -27
  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 +2 -1
  40. package/src/cmd-upgrade-spec.ts +8 -1
  41. package/src/cmd-upgrade.ts +15 -1
  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 +11 -15
  46. package/src/codemods/docs-worker-commands.ts +26 -0
  47. package/src/codemods/index.ts +4 -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-api-listing.ts +114 -0
  77. package/src/doctor-guarded.ts +41 -0
  78. package/src/doctor-port.ts +90 -17
  79. package/src/doctor-probe.ts +36 -5
  80. package/src/doctor-processes-probe.ts +127 -0
  81. package/src/doctor-processes.ts +136 -0
  82. package/src/doctor-warnings.ts +17 -0
  83. package/src/error-codes-agents.ts +35 -0
  84. package/src/error-codes-processes.ts +30 -0
  85. package/src/error-codes-tooling.ts +2 -0
  86. package/src/error-codes.ts +12 -13
  87. package/src/errors-suite.ts +27 -0
  88. package/src/errors.ts +18 -22
  89. package/src/exercise-registration.ts +4 -3
  90. package/src/framework-env.ts +7 -3
  91. package/src/generate-files.ts +1 -0
  92. package/src/generate-grant-findings.ts +7 -5
  93. package/src/generate-grants.ts +9 -8
  94. package/src/generate-kinds.ts +30 -6
  95. package/src/generate-roles-file.ts +30 -0
  96. package/src/generate-slice-policy.ts +3 -3
  97. package/src/guards.ts +2 -2
  98. package/src/heavy-env.ts +2 -0
  99. package/src/heavy-errors.ts +18 -0
  100. package/src/heavy-holders.ts +78 -0
  101. package/src/heavy-ledger.ts +56 -14
  102. package/src/heavy-pressure.ts +104 -0
  103. package/src/heavy.ts +31 -13
  104. package/src/i18n-registration.ts +22 -2
  105. package/src/island-harness.ts +2 -2
  106. package/src/job-budget.ts +4 -2
  107. package/src/job-registration.ts +64 -8
  108. package/src/jobs-queue-known.ts +43 -0
  109. package/src/mcp-errors-agents.ts +20 -0
  110. package/src/mcp-errors-doctor.ts +27 -0
  111. package/src/mcp-errors-processes.ts +23 -0
  112. package/src/mcp-errors.ts +15 -29
  113. package/src/mcp-host.ts +2 -2
  114. package/src/merge-driver-catalog.ts +58 -0
  115. package/src/merge-driver-config.ts +43 -0
  116. package/src/merge-driver-lines.ts +140 -0
  117. package/src/merge-state.ts +105 -0
  118. package/src/messages-db.ts +22 -1
  119. package/src/messages-processes.ts +13 -0
  120. package/src/messages-upgrade.ts +6 -0
  121. package/src/messages.ts +54 -4
  122. package/src/output-findings.ts +48 -21
  123. package/src/parse.ts +37 -6
  124. package/src/policy-facts.ts +38 -21
  125. package/src/policy-row.ts +99 -0
  126. package/src/port-pair-free.ts +28 -0
  127. package/src/registry-lines.ts +110 -0
  128. package/src/registry.ts +2 -0
  129. package/src/retain-sweep.ts +1 -1
  130. package/src/role-replicator.ts +4 -1
  131. package/src/role-select.ts +86 -0
  132. package/src/role-start.ts +13 -55
  133. package/src/role-sync.ts +10 -5
  134. package/src/runtime-cache-frame.ts +46 -0
  135. package/src/runtime-cache-ttl.ts +23 -0
  136. package/src/runtime-cache.ts +33 -16
  137. package/src/runtime-database-ssl.ts +84 -0
  138. package/src/runtime-idempotency-scope.ts +16 -2
  139. package/src/runtime-jobs-share.ts +52 -0
  140. package/src/runtime-jobs.ts +43 -12
  141. package/src/runtime-queue.ts +18 -3
  142. package/src/runtime-services.ts +8 -1
  143. package/src/schema-drift.ts +19 -2
  144. package/src/schema-dump-drift.ts +4 -1
  145. package/src/serve-boot-probe.ts +30 -2
  146. package/src/serve-boot.ts +11 -1
  147. package/src/serve-env.ts +39 -3
  148. package/src/serve.ts +61 -10
  149. package/src/stop-run-start.ts +12 -0
  150. package/src/supervise-boot.ts +61 -0
  151. package/src/supervise-cgroup.ts +84 -0
  152. package/src/supervise-child.ts +206 -0
  153. package/src/supervise-count.ts +244 -0
  154. package/src/supervise-errors.ts +83 -0
  155. package/src/supervise-facts.ts +40 -0
  156. package/src/supervise-messages.ts +84 -0
  157. package/src/supervise-policy.ts +46 -0
  158. package/src/supervise-pool.ts +10 -0
  159. package/src/supervise-probe.ts +158 -0
  160. package/src/supervise-run.ts +54 -0
  161. package/src/supervise.ts +383 -0
  162. package/src/templates/generate-purge.ts +6 -6
  163. package/src/templates/guard-animated-layout-property.ts +2 -2
  164. package/src/templates/guard-bare-error.ts +1 -1
  165. package/src/templates/guard-error-declared.ts +2 -2
  166. package/src/templates/guard-focus-visible.ts +1 -1
  167. package/src/templates/guard-image-dimensions.ts +2 -2
  168. package/src/templates/guard-island-mount-clears.ts +1 -1
  169. package/src/templates/guard-native-confirm.ts +1 -1
  170. package/src/templates/guard-raw-breakpoint.ts +2 -2
  171. package/src/templates/guard-raw-colour.ts +2 -2
  172. package/src/templates/guard-raw-fetch.ts +1 -1
  173. package/src/templates/guard-raw-interval.ts +1 -1
  174. package/src/templates/guard-raw-length.ts +3 -3
  175. package/src/templates/guard-raw-motion.ts +1 -1
  176. package/src/templates/guard-raw-shadow.ts +1 -1
  177. package/src/templates/guard-raw-z-index.ts +1 -1
  178. package/src/templates/guard-released-forms.ts +54 -8
  179. package/src/templates/guard-repo-await-in-loop.ts +1 -1
  180. package/src/templates/guard-repo-raw-sql.ts +4 -4
  181. package/src/templates/guard-repo-unbounded.ts +1 -1
  182. package/src/templates/guard-runtime-pin.ts +1 -1
  183. package/src/templates/guard-semantic-interactive.ts +2 -2
  184. package/src/templates/guard-unbounded-fanout.ts +1 -1
  185. package/src/templates/guard-undeclared-custom-property.ts +3 -3
  186. package/src/templates/guard-undefined-style-class.ts +3 -3
  187. package/src/templates/guard-unzoned-date.ts +3 -3
  188. package/src/templates/query-slice.ts +82 -0
  189. package/src/templates/query.ts +76 -30
  190. package/src/templates/resource-page.ts +3 -2
  191. package/src/templates/scaffold-bin.ts +2 -0
  192. package/src/templates/scaffold-claude-commands.ts +6 -0
  193. package/src/templates/scaffold-claude.ts +4 -4
  194. package/src/templates/scaffold-container-compose.ts +47 -7
  195. package/src/templates/scaffold-docs.ts +7 -3
  196. package/src/templates/scaffold-gitattributes.ts +18 -1
  197. package/src/templates/scaffold-helm-templates.ts +9 -0
  198. package/src/templates/scaffold-repo.ts +4 -1
  199. package/src/templates/scaffold-test-services.ts +33 -11
  200. package/src/templates/shapes/offline.ts +0 -7
  201. package/src/templates/shapes/realtime.ts +2 -6
  202. package/src/templates/sign-in-action-tests.ts +6 -4
  203. package/src/templates/sign-in-challenge.ts +62 -0
  204. package/src/templates/sign-in-oidc-mfa.ts +31 -0
  205. package/src/templates/sign-in-oidc.ts +11 -3
  206. package/src/templates/sign-in-password.ts +18 -56
  207. package/src/test-shards.ts +114 -34
  208. package/src/test-verdict.ts +79 -0
  209. package/src/test-workers.ts +15 -0
  210. package/src/upgrade-gate-codemods.ts +5 -3
  211. package/src/upgrade-gate.ts +19 -1
  212. package/src/upgrade-merge-drivers.ts +25 -0
  213. package/src/upgrade-report.ts +18 -4
  214. package/src/upgrade-scope.ts +62 -0
  215. package/src/verify-checks.ts +2 -8
  216. package/src/verify-coverage-run.ts +4 -1
  217. package/src/verify-live.ts +38 -14
  218. package/src/verify-only.ts +67 -0
  219. package/src/verify-progress.ts +7 -3
  220. package/src/verify-run.ts +20 -2
  221. package/src/verify-services-stack.ts +165 -0
  222. package/src/verify-services.ts +84 -2
  223. package/src/verify-test-run.ts +6 -7
  224. package/src/verify-tests.ts +8 -2
  225. package/src/verify-typecheck.ts +25 -2
  226. package/wiki/Actions.md +2 -1
  227. package/wiki/Admin-Dashboard.md +2 -2
  228. package/wiki/Agents.md +5 -5
  229. package/wiki/Auth.md +15 -5
  230. package/wiki/Bare-VM.md +1 -1
  231. package/wiki/CI-Parallel-Gate.md +2 -1
  232. package/wiki/CLI-Reference.md +107 -40
  233. package/wiki/Caching-And-Invalidation.md +1 -1
  234. package/wiki/Client-Navigation.md +1 -1
  235. package/wiki/Configuration.md +10 -9
  236. package/wiki/Deployment.md +44 -4
  237. package/wiki/Entities-And-Migrations.md +5 -1
  238. package/wiki/FAQ.md +1 -1
  239. package/wiki/Getting-Started.md +2 -2
  240. package/wiki/Home.md +1 -1
  241. package/wiki/I18n.md +5 -3
  242. package/wiki/Installation.md +12 -11
  243. package/wiki/Jobs-And-Workflows.md +24 -4
  244. package/wiki/Known-Gaps.md +1 -1
  245. package/wiki/MCP-And-AI.md +8 -5
  246. package/wiki/Many-Agents.md +69 -2
  247. package/wiki/Migrations-And-Backfills.md +18 -0
  248. package/wiki/Notify.md +1 -1
  249. package/wiki/Observability.md +13 -0
  250. package/wiki/Queries-And-Live-Queries.md +2 -2
  251. package/wiki/Realtime.md +10 -1
  252. package/wiki/Routes-And-Render-Modes.md +1 -1
  253. package/wiki/Scheduled-Tasks.md +4 -1
  254. package/wiki/Testing.md +7 -4
  255. package/wiki/Timezones-And-Dates.md +5 -1
  256. package/wiki/Troubleshooting.md +1 -0
  257. package/wiki/Tutorial-01-First-App.md +3 -3
  258. package/wiki/Tutorial-02-First-Feature.md +1 -1
  259. package/wiki/Tutorial-03-Auth-And-Admin.md +7 -6
  260. package/wiki/Upgrading.md +37 -0
@@ -162,7 +162,7 @@ export function animatedLayoutProperties(files: readonly StyleFile[]): readonly
162
162
  findings.push({
163
163
  code: CODE,
164
164
  cause: \`\${at} transitions every property of this element — \${animated === undefined ? \`\\\`\${property}: \${value}\\\` names none, and an omitted property is \\\`all\\\`\` : 'written out as \`all\`'} — so it animates properties nobody chose, the ones that cost a layout pass included, and no part of it can be composited\`,
165
- fix: \`name the properties in \${at} — \\\`transition: transform tokens.duration('fast') tokens.easing('out')\\\` — then: x verify\`,
165
+ fix: \`name the properties in \${at} — \\\`transition: transform tokens.duration('fast') tokens.easing('out')\\\` — then: x verify --only boundaries\`,
166
166
  at: file.path,
167
167
  });
168
168
  continue;
@@ -180,7 +180,7 @@ function layoutFinding(path: string, at: string, property: string, where: string
180
180
  return {
181
181
  code: CODE,
182
182
  cause: \`\${at} animates \${property} in \${where} — only transform and opacity are compositor-only, so every frame of this costs a full layout or paint pass on the same main thread the app runs on, and a moving box feeds the layout-shift metric while it does it\`,
183
- fix: \`animate \${instead} instead of \${property} at \${at}, then: x verify\`,
183
+ fix: \`animate \${instead} instead of \${property} at \${at}, then: x verify --only boundaries\`,
184
184
  at: path,
185
185
  };
186
186
  }
@@ -59,7 +59,7 @@ export function bareThrows(files: readonly SourceFile[]): readonly Finding[] {
59
59
  findings.push({
60
60
  code: CODE,
61
61
  cause: \`\${file.path}:\${line} throws a bare \${thrown} — it reaches its reader as a stack trace with no code, no cause and nothing to run\`,
62
- fix: \`declare the failure in \${file.path} with defineError({ code, title, status, cause, fix }) from @ultimat3/core/page — an X_SCREAMING_SNAKE code and a fix naming a command — and throw its class, then: x verify\`,
62
+ fix: \`declare the failure in \${file.path} with defineError({ code, title, status, cause, fix }) from @ultimat3/core/page — an X_SCREAMING_SNAKE code and a fix naming a command — and throw its class, then: x verify --only boundaries\`,
63
63
  at: file.path,
64
64
  });
65
65
  }
@@ -146,7 +146,7 @@ const finding = (file: SourceFile, line: number, what: string, declared: Declare
146
146
  return {
147
147
  code: CODE,
148
148
  cause: \`\${file.path}:\${line} \${what} — the title, the HTTP status and the class are then declared apart, and a code with no status answers 500 and hides its cause\`,
149
- fix: \`rewrite it in \${file.path} as one call per class, from @ultimat3/core/page: export const \${name} = defineError({ code: \${code}, title, status, cause, fix, problemMeta: ['<meta key>'] }) — it replaces the class and its registerErrorStatus / registerProblemMeta rows (offSocket: true instead of status for a code no response carries; publicCause: true for a 5xx whose cause a caller may read; drop problemMeta when its meta stays operator-only), then: x verify\`,
149
+ fix: \`rewrite it in \${file.path} as one call per class, from @ultimat3/core/page: export const \${name} = defineError({ code: \${code}, title, status, cause, fix, problemMeta: ['<meta key>'] }) — it replaces the class and its registerErrorStatus / registerProblemMeta rows (offSocket: true instead of status for a code no response carries; publicCause: true for a 5xx whose cause a caller may read; drop problemMeta when its meta stays operator-only), then: x verify --only boundaries\`,
150
150
  at: file.path,
151
151
  };
152
152
  };
@@ -154,7 +154,7 @@ const finding = (file: SourceFile, line: number, what: string, declared: Declare
154
154
  const barrelFinding = (file: SourceFile, line: number): Finding => ({
155
155
  code: CODE,
156
156
  cause: \`\${file.path}:\${line} takes defineError from the @ultimat3/core barrel — every island that throws the code then carries the framework's titles table, ~5.5 kB it never reads\`,
157
- fix: \`import { defineError } from '@ultimat3/core/page' in \${file.path} — the same function, without the table — then: x verify\`,
157
+ fix: \`import { defineError } from '@ultimat3/core/page' in \${file.path} — the same function, without the table — then: x verify --only boundaries\`,
158
158
  at: file.path,
159
159
  });
160
160
 
@@ -153,7 +153,7 @@ export function unreplacedFocusRings(files: readonly StyleFile[]): readonly Find
153
153
  findings.push({
154
154
  code: CODE,
155
155
  cause: \`\${file.path}:\${lineOf(scss, match.index)} removes the focus ring with \${property}: \${value} and nothing in the rule or beside it paints one back — a keyboard user loses every trace of where they are, and WCAG 2.2 asks for an indicator at least 2px around the control at 3:1 against what is behind it\`,
156
- fix: \`add \\\`@include tokens.focus-ring;\\\` to the rule at \${file.path}:\${lineOf(scss, match.index)}, or a sibling \\\`:focus-visible\\\` rule with a box-shadow — which follows the border radius where an outline does not — then: x verify\`,
156
+ fix: \`add \\\`@include tokens.focus-ring;\\\` to the rule at \${file.path}:\${lineOf(scss, match.index)}, or a sibling \\\`:focus-visible\\\` rule with a box-shadow — which follows the border radius where an outline does not — then: x verify --only boundaries\`,
157
157
  at: file.path,
158
158
  });
159
159
  }
@@ -124,7 +124,7 @@ export function unsizedImages(files: readonly SourceFile[]): readonly Finding[]
124
124
  findings.push({
125
125
  code: CODE,
126
126
  cause: \`\${at} renders <\${tag.name}> with no width and height pair and no aspect-ratio — the browser reserves no box for it, so every element under it jumps the moment the bytes land\`,
127
- fix: \`add width and height to the <\${tag.name}> at \${at} — the intrinsic pixel size, since CSS still decides what it is drawn at — or an aspect-ratio, then: x verify\`,
127
+ fix: \`add width and height to the <\${tag.name}> at \${at} — the intrinsic pixel size, since CSS still decides what it is drawn at — or an aspect-ratio, then: x verify --only boundaries\`,
128
128
  at: file.path,
129
129
  });
130
130
  }
@@ -134,7 +134,7 @@ export function unsizedImages(files: readonly SourceFile[]): readonly Finding[]
134
134
  findings.push({
135
135
  code: CODE,
136
136
  cause: \`\${at} marks <\${tag.name}> as the priority image AND loading="lazy" — a lazy image is fetched after layout, and this is the one the page's largest paint is measured on, so the attribute delays the metric it is the subject of\`,
137
- fix: \`delete loading="lazy" from the <\${tag.name}> at \${at}, then: x verify\`,
137
+ fix: \`delete loading="lazy" from the <\${tag.name}> at \${at}, then: x verify --only boundaries\`,
138
138
  at: file.path,
139
139
  });
140
140
  }
@@ -75,7 +75,7 @@ export function islandMountClears(files: readonly SourceFile[]): readonly Findin
75
75
  findings.push({
76
76
  code: CODE,
77
77
  cause: \`\${at} empties the island's server markup outside mountOver, so a render that throws leaves a blank box where the server's HTML was, and the visitor sees nothing to retry\`,
78
- fix: \`edit \${at} — delete the clear and end mount() with return mountOver(el, (root) => render(() => <Island {...props} />, root)), adding mountOver to the island's imports from '@ultimat3/render/client' — then: x verify\`,
78
+ fix: \`edit \${at} — delete the clear and end mount() with return mountOver(el, (root) => render(() => <Island {...props} />, root)), adding mountOver to the island's imports from '@ultimat3/render/client' — then: x verify --only boundaries\`,
79
79
  at,
80
80
  });
81
81
  }
@@ -64,7 +64,7 @@ export function nativeConfirms(files: readonly SourceFile[]): readonly Finding[]
64
64
  findings.push({
65
65
  code: CODE,
66
66
  cause: \`\${at} asks with confirm(), whose OK holds focus — a stray Enter confirms — and which cannot be translated or refused\`,
67
- fix: \`replace the confirm() at \${at} with <ConfirmDialog> from '@ultimat3/ui' (action= for a native post, onConfirm= in an island) — or add a // why: comment on that line naming why it is not a destructive question — then: x verify\`,
67
+ fix: \`replace the confirm() at \${at} with <ConfirmDialog> from '@ultimat3/ui' (action= for a native post, onConfirm= in an island) — or add a // why: comment on that line naming why it is not a destructive question — then: x verify --only boundaries\`,
68
68
  at,
69
69
  });
70
70
  }
@@ -97,7 +97,7 @@ export function rawBreakpoints(files: readonly StyleFile[]): readonly Finding[]
97
97
  findings.push({
98
98
  code: CODE,
99
99
  cause: \`\${file.path}:\${line} defines its own \${match[1]} — @ultimat3/ui/tokens ships one, and a local definition silently shadows it, so the app has two breakpoint ladders\`,
100
- fix: \`delete @mixin \${match[1]} from \${file.path}:\${line} and write @include \${ns}.\${match[1]}(…), then: x verify\`,
100
+ fix: \`delete @mixin \${match[1]} from \${file.path}:\${line} and write @include \${ns}.\${match[1]}(…), then: x verify --only boundaries\`,
101
101
  at: \`\${file.path}:\${line}\`,
102
102
  });
103
103
  }
@@ -111,7 +111,7 @@ export function rawBreakpoints(files: readonly StyleFile[]): readonly Finding[]
111
111
  findings.push({
112
112
  code: CODE,
113
113
  cause: \`\${file.path}:\${line} writes \\\`@media\${prelude.trimEnd()}\\\` — a viewport width of its own, off the breakpoint ladder every other sheet shares\`,
114
- fix: \`\${include} — at \${file.path}:\${line}, then: x verify\`,
114
+ fix: \`\${include} — at \${file.path}:\${line}, then: x verify --only boundaries\`,
115
115
  at: \`\${file.path}:\${line}\`,
116
116
  });
117
117
  }
@@ -156,7 +156,7 @@ export function rawColours(files: readonly StyleFile[]): readonly Finding[] {
156
156
  findings.push({
157
157
  code: CODE,
158
158
  cause: \`\${file.path}:\${lineOf(scss, index)} sets \${property} to the raw colour \${literal} — a value no theme can restate, so dark theme renders it unchanged\`,
159
- fix: \`replace \${literal} in \${file.path} with tokens.role('fg'), tokens.role('bg') or the role this element means, then: x verify\`,
159
+ fix: \`replace \${literal} in \${file.path} with tokens.role('fg'), tokens.role('bg') or the role this element means, then: x verify --only boundaries\`,
160
160
  at: file.path,
161
161
  });
162
162
  }
@@ -197,7 +197,7 @@ export function inlineColours(
197
197
  findings.push({
198
198
  code: CODE,
199
199
  cause: \`\${file.path}:\${lineOf(text, attribute.index)} sets \${property} to the raw colour \${literal} in an inline style — a value no theme can restate, so dark theme renders it unchanged\`,
200
- fix: \`replace \${literal} in \${file.path} with rgb(var(--color-fg)), rgb(var(--color-bg)) or the role this element means — or a class whose stylesheet sets tokens.role('fg') — then: x verify\`,
200
+ fix: \`replace \${literal} in \${file.path} with rgb(var(--color-fg)), rgb(var(--color-bg)) or the role this element means — or a class whose stylesheet sets tokens.role('fg') — then: x verify --only boundaries\`,
201
201
  at: file.path,
202
202
  });
203
203
  }
@@ -92,7 +92,7 @@ export function rawFetches(files: readonly SourceFile[]): readonly Finding[] {
92
92
  findings.push({
93
93
  code: CODE,
94
94
  cause: \`\${at} calls fetch with no signal in its own options, so the call outlives the request that made it: a stalled vendor holds the handler, the drain and a socket\`,
95
- fix: \`call outbound({ url, vendor, dial: 'public', deadlineMs: 10_000 }) from @ultimat3/core/outbound in place of the fetch at \${at}, or pass { signal: ctx.signal } in its options — then: x verify\`,
95
+ fix: \`call outbound({ url, vendor, dial: 'public', deadlineMs: 10_000 }) from @ultimat3/core/outbound in place of the fetch at \${at}, or pass { signal: ctx.signal } in its options — then: x verify --only boundaries\`,
96
96
  at,
97
97
  });
98
98
  }
@@ -65,7 +65,7 @@ export function rawIntervals(files: readonly SourceFile[]): readonly Finding[] {
65
65
  findings.push({
66
66
  code: CODE,
67
67
  cause: \`\${at} polls with setInterval, which keeps asking from a hidden tab and asks for a 401 forever once the session is gone\`,
68
- fix: \`re-read a query with useQuery(ref, input, { poll: pollEvery(ms) }) (pollEvery is exported by @ultimat3/realtime) at \${at}; any other read: import { visibleInterval } from '@ultimat3/core/page' and call visibleInterval(run, ms) there, disposing it on cleanup — or add a // why: comment on that line naming why this interval is not a read — then: x verify\`,
68
+ fix: \`re-read a query with useQuery(ref, input, { poll: pollEvery(ms) }) (pollEvery is exported by @ultimat3/realtime) at \${at}; any other read: import { visibleInterval } from '@ultimat3/core/page' and call visibleInterval(run, ms) there, disposing it on cleanup — or add a // why: comment on that line naming why this interval is not a read — then: x verify --only boundaries\`,
69
69
  at,
70
70
  });
71
71
  }
@@ -164,7 +164,7 @@ export function rawLengths(files: readonly StyleFile[]): readonly Finding[] {
164
164
  findings.push({
165
165
  code: CODE,
166
166
  cause: \`\${file.path}:\${line} defines its own \${match[1]}() — @ultimat3/ui/tokens ships one, and a local definition silently shadows it, so two sheets can disagree about what a px is\`,
167
- fix: \`delete @function \${match[1]} from \${file.path}:\${line} and call \${ns}.\${match[1]}(), then: x verify\`,
167
+ fix: \`delete @function \${match[1]} from \${file.path}:\${line} and call \${ns}.\${match[1]}(), then: x verify --only boundaries\`,
168
168
  at: \`\${file.path}:\${line}\`,
169
169
  });
170
170
  }
@@ -196,7 +196,7 @@ export function rawLengths(files: readonly StyleFile[]): readonly Finding[] {
196
196
  findings.push({
197
197
  code: CODE,
198
198
  cause: \`\${file.path}:\${line} writes \\\`\${statement}\\\` — a px length off the scale: it does not grow with the reader's text size, and no token names it\`,
199
- fix: \`\${rewritten} — at \${file.path}:\${line}, then: x verify\`,
199
+ fix: \`\${rewritten} — at \${file.path}:\${line}, then: x verify --only boundaries\`,
200
200
  at: \`\${file.path}:\${line}\`,
201
201
  });
202
202
  }
@@ -223,7 +223,7 @@ export function rawInlineLengths(files: readonly MarkupFile[]): readonly Finding
223
223
  findings.push({
224
224
  code: CODE,
225
225
  cause: \`\${file.path}:\${line} sets \${px}px in an inline style — a length off the scale, in the one stylesheet nothing else reads\`,
226
- fix: \`\${written} in place of \${px}px — at \${file.path}:\${line}; better, move the declaration into the element's .module.scss, then: x verify\`,
226
+ fix: \`\${written} in place of \${px}px — at \${file.path}:\${line}; better, move the declaration into the element's .module.scss, then: x verify --only boundaries\`,
227
227
  at: \`\${file.path}:\${line}\`,
228
228
  });
229
229
  }
@@ -127,7 +127,7 @@ export function rawMotion(files: readonly StyleFile[]): readonly Finding[] {
127
127
  findings.push({
128
128
  code: CODE,
129
129
  cause: \`\${file.path}:\${line} writes \\\`\${property}: \${value}\\\` — \${literals.join(' and ')} off the motion scale, a tempo of this file's own\`,
130
- fix: \`\${property}: \${written} — at \${file.path}:\${line} (durations: \${DURATIONS.map(([name]) => name).join(' ')}; a longer one is calc(#{\${ns}.duration(slower)} * 2)), then: x verify\`,
130
+ fix: \`\${property}: \${written} — at \${file.path}:\${line} (durations: \${DURATIONS.map(([name]) => name).join(' ')}; a longer one is calc(#{\${ns}.duration(slower)} * 2)), then: x verify --only boundaries\`,
131
131
  at: \`\${file.path}:\${line}\`,
132
132
  });
133
133
  }
@@ -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
130
  ['16pof11n1trhg', 'error'],
92
131
  ['1f8kizielequo', 'error'],
132
+ ['1fc7m95vm6k3g', 'error'],
133
+ ['20rw6oj7g0bz3', 'error'],
93
134
  ['2jb32jms80mge', 'error'],
94
135
  ['2t3qtexnpfnyq', 'error'],
136
+ ['2x7h5rxf4hv0g', 'error'],
95
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
+ );