@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
@@ -192,6 +192,18 @@ The body always opens with a `target_info` gauge carrying the service identity,
192
192
  | `x dev` with no `METRICS_PORT` moves off a taken port | two apps on one laptop both default to 9090: the second binds a free port, logs `ultimate metrics port taken`, and reports the real URL in `x dev --json`'s `metrics`. A declared `METRICS_PORT`, and every container, refuses with `X_PORT_IN_USE` — a scraper was told that port |
193
193
  | Answered outside the request pipeline | no auth stage, no rate limit, no locale — a saturated or draining process must still be able to say how saturated it is. Same shape as `/healthz` |
194
194
 
195
+ ### A container running N processes
196
+
197
+ `As of 2026-11`, a production container with a CPU budget runs one process per CPU ([Processes per container](Deployment#processes-per-container)). The scrape stays one target:
198
+
199
+ | Signal | Shape |
200
+ |---|---|
201
+ | `/metrics` on `METRICS_PORT` | the supervisor's: each child's own scrape (loopback, an ephemeral port), merged under one `# HELP` / `# TYPE` per family, every sample labelled `child="<i>"`. A child that does not answer within 2 s is left out of that scrape |
202
+ | counters and histograms | per child: `sum by (…)` over `child` is the container's total, as it is over pods |
203
+ | **process-global gauges** | appear **N times**, once per child — `queue_demand`, `queue_depth`, `queue_oldest_ready_seconds` and the `db_server_*` gauges are each child's reading of one shared fact. **Use `max`, never `sum`**: a sum reads N× the backlog and scales the fleet N× |
204
+ | log lines | every line a child writes carries `"child": <i>`; the supervisor's carry `"child": "supervisor"`. A caller's own `child` field moves to `field.child`. A child whose boot throws says so first as `ultimate child refused to boot` (`error`, with the code, cause and fix) — the line `X_PROCESS_CRASH_LOOP` sends you to |
205
+ | `/healthz`, `/readyz` | the supervisor's: alive and not in a crash loop; at least one child ready, every other one ready or draining, the container not stopping |
206
+
195
207
  ## The series autoscaling reads
196
208
 
197
209
  Declared in `runtime-metrics.ts`, so the role table, the Helm chart and the scrape cannot drift apart.
@@ -277,6 +289,7 @@ CPU autoscaling is wrong for `sync` and `worker`: a node holding 80k idle socket
277
289
  | Head sampling | `otel.sampling`, default `0.1`; errors are always sampled |
278
290
  | OTLP delivery | a 429, 502, 503, 504 or a transport failure is retried, 3 attempts with full jitter and `Retry-After` honoured, inside the exporter's `timeoutMs` (default 10 s, the whole export); any other status is one POST. One `otlp export rejected`/`failed` line per batch, with `attempts`. A collector that accepted and then answered 503 receives that batch twice; span ids dedupe it |
279
291
  | Error grouping | `errorFingerprint(report)`: 16 hex over `code`, `source`, `scope.operation`, plus the top application frame (function and root-relative path, no line) for `X_INTERNAL`. Never the cause or an id, so two throws differing in a row id are one group, and a deploy is not a new one. The Sentry envelope sends it as `fingerprint` |
292
+ | Monitor delivery | the `SENTRY_DSN` transport (`sentryErrorReporter`) reads each answer, `As of 2026-11-19`: one `warn` line per refused status (`error reporter delivery refused; events are being dropped`, with `status`), a 429 pauses sends for its `Retry-After` — 60 s when it states none — and reports in the pause are dropped, every answer's body is cancelled, and a throw while reading is logged, never an unhandled rejection. `X_ERROR_REPORTER_DSN_INVALID` names the DSN with its userinfo removed |
280
293
  | Log level | `LOG_LEVEL`, default `info`. The framework's own policy (`As of 2026-11`): a routine per-unit event (one per request, job, fire or message) is `debug`; `info` is lifecycle and rare outcomes; `warn` asks an operator to act. `scripts/log-levels.ts` refuses an unstated per-unit `info` line in the framework (`X_LOG_LEVEL_UNSTATED`) |
281
294
  | Secret redaction | a `Secret` is redacted by value before every other branch, at any depth → [Configuration](Configuration) |
282
295
  | Value redaction | `redactValues([{ pattern: /acct_[0-9]{10}/g, replace: '[account]' }])`, once at boot (`As of 2026-11`): every match is rewritten in the log line's message and field strings, an `Error`'s message, and the monitor envelope's exception value, `fix`, `stack`, extras and `meta`, a span's exception event and status message, and a failure bundle's captured values. Key redaction (`redactKeys`) cannot see a value inside a message; this can. The `g` flag is required; a sticky pattern, one matching the empty string, or a repeated group holding a repeating quantifier (`(a+)+`, `(a+){2,40}`; only `?`/`{0,1}` do not repeat) is refused with `X_REDACT_PATTERN_UNSAFE`, and the whole list with it. Appends, like `redactKeys`; the framework registers no pattern |
@@ -220,7 +220,7 @@ export const queries = queryClient<Api['queries']>({ baseUrl }); // reads
220
220
  | Why two clients and not one | actions and queries are two registries (`defineApi`'s `actions:` and `queries:` keys) answering two methods. A read taken off the action client is a name that does not exist on `Api['actions']` — a compile error, which is the point |
221
221
  | Types | the read's own `input` and row type. A list read answers `readonly TRow[]`, `limit(1)` included; a `single: true` read answers `TRow` and rejects with `X_NOT_FOUND` when the route 404s |
222
222
  | Failures | the server's own code, off `problem+json` — `X_INPUT_INVALID` stays `X_INPUT_INVALID`. A gateway answering HTML, a network fault and a 2xx body that is not JSON are `X_CLIENT_TRANSPORT_FAILED`, the same code an action's client answers. It was `X_RPC_FAILED` until 21.0.0 |
223
- | Rows are JSON, with their instants revived | what the body parses to, plus every value the server answered as a `Date` handed back as one (`As of 2026-10`, #710): the route names them in `x-ultimate-dates` by path — one entry per column of a list — and `clientTransport` revives exactly those. The body and the OpenAPI document are unchanged; a client that ignores the header reads ISO strings. A query's rows are never parsed on the way out (a declared `rows:` publishes structure, it parses nothing), so the header is how the row type's `Date` stays true |
223
+ | Rows are JSON, with their instants revived | what the body parses to, plus every value the server answered as a `Date` handed back as one (`As of 2026-10`, #710): the route names them in `x-ultimate-dates` by path — one entry per column of a list — and `clientTransport` revives exactly those. The body and the OpenAPI document are unchanged; a client that ignores the header reads ISO strings. A query's rows are never parsed on the way out (a declared `rows:` publishes structure, it parses nothing), so the header is how the row type's `Date` stays true. The header is capped at 1,536 bytes (`WIRE_DATES_MAX_BYTES`): an answer whose instants need one path each — a `string \| Date` column, a `[label, instant]` tuple — past that is sent with no `x-ultimate-dates` (and no `dates:` line), the client reads those instants as ISO strings, and the operation is logged once at `warn` as `http.wire_dates_dropped`. `As of 2026-11-19`. |
224
224
  | `then` is not a read | the proxy answers `undefined` for it, so `await queries` resolves to the client instead of fetching `/_x/query/then`. Same rule in `rpc` |
225
225
 
226
226
  ## A file at a signed URL — `download:`
@@ -437,7 +437,7 @@ Fifty *counts* collapse neither way — one `count()` per row is fifty different
437
437
  | Not recorded | `explainQuery()`, `describeSql()`, the shared live window: built `unenforced`, no caller to attribute |
438
438
  | No sink installed | `X_QUERY_AUDIT_SINK_MISSING`, before the input parse |
439
439
  | The sink refuses | a denied/failed record: logged (`audit.sink.failed`), the caller gets the original error. An allowed record: the rows are withheld, `X_QUERY_AUDIT_SINK_FAILED` — a read commits nothing, so retry |
440
- | Group commit | opt-in, `As of 31.11.0`: `postgresAuditSink({ executor, groupCommit: true })` (`@ultimat3/action`) queues each record up to 5 ms or 256 records (`{ maxRecords, maxDelayMs }` to change either) and writes the batch as one `x_audit` insert. Each call waits on its own batch, so the rule above holds per call: a failed batch is `X_QUERY_AUDIT_SINK_FAILED` (an action's, `X_AUDIT_SINK_FAILED`) on every allowed call it carried. Flushed on drain, before the pool closes. Any sink with a `writeMany(records)`: `batchedAuditSink(sink, opts)` from `@ultimat3/action/adapter` |
440
+ | Group commit | opt-in, `As of 31.11.0`: `postgresAuditSink({ executor, groupCommit: true })` (`@ultimat3/action`) queues each record up to 5 ms or 256 records (`{ maxRecords, maxDelayMs }` to change either) and writes the batch as one `x_audit` insert. Each call waits on its own batch, so the rule above holds per call: a failed batch is `X_QUERY_AUDIT_SINK_FAILED` (an action's, `X_AUDIT_SINK_FAILED`) on every allowed call it carried. Flushed on drain, before the pool closes. Any sink with a `writeMany(records)`: `batchedAuditSink(sink, opts)` from `@ultimat3/action/adapter`. A batch that committed but lost its reply stores nothing twice (`As of 2026-11-19`): each accepted write keeps one row id through the single retry, and an insert skips a row already stored with identical facts — a different row under that id still fails `unique_violation` |
441
441
 
442
442
  ## Every cached query carries a tag
443
443
 
package/wiki/Realtime.md CHANGED
@@ -155,7 +155,7 @@ adapter, its sync URL and its `LiveClient`: the page's one socket is the framewo
155
155
 
156
156
  | Step | Where | What |
157
157
  |---|---|---|
158
- | 1. the dependency | root `package.json` | `bun add @ultimat3/realtime`. `x new` installs `@ultimat3/query` and **not** `@ultimat3/realtime` |
158
+ | 1. the dependency | root `package.json` | `x new` declares `@ultimat3/realtime` beside `@ultimat3/query`, at the framework's exact version (`As of 2026-11-19`). An app scaffolded before 31.49.0 adds it once, at the version its `@ultimat3/core` pin names: `bun add --exact @ultimat3/realtime@$(bun -p "require('./package.json').dependencies['@ultimat3/core']")` — a bare `bun add` writes a range `x doctor` refuses (`X_FRAMEWORK_PIN_RANGE`). Missing, the import is `TS2307: Cannot find module '@ultimat3/realtime'` |
159
159
  | 2. the query | `app/<feature>/live.ts` | `query({ …, live: true, subscribes: ['posts'] })`, bounded and ordered; `x g query <name> --feature <slice> --live` writes it |
160
160
  | 3. the ref | the island | `{ name: 'liveFeed', live: true }`, the query's registered **name**, never the query value: importing that drags its whole read path into the island. `live` is stated beside the name, not derived (see below) |
161
161
  | 4. the install | nothing to write | `x build` builds every island whose own import graph reaches `@ultimat3/realtime` from an entry that calls `installRealtime({ signal: createSignal, cleanup: onCleanup })` first, for about 100 B — `cleanup` releases every hook with the component that called it (31.14.0), so an island writes no `onCleanup(() => h.release())`. An island not reaching realtime pays nothing. The sync target is read from the document's `<meta name="ultimate-sync">` ([Configuration](Configuration), `SYNC_URL`) |
@@ -400,6 +400,15 @@ org's value is `X_TOPIC_FORBIDDEN` (cause `X_TENANCY_ACTOR_MISMATCH`), an actor
400
400
  is enough: the policy decides the permission, the mechanism decides the tenant — the same split an
401
401
  HTTP read has.
402
402
 
403
+ `As of 2026-11-19`. A channel keyed by any other param — `room-feed.<roomId>` on `records: [messages]` — carries every
404
+ org's rows that name that room, and its subscribe cannot know which. So the mechanism decides per
405
+ row: a tenanted row reaches only the members whose org is the row's tenant, live and on a `since`
406
+ replay alike; every other member receives that frame's `seq` alone, carrying no record, key or
407
+ `write`, so its cursor stays whole. A row naming no tenant reaches no member; an untenanted entity's
408
+ rows, and every row on a topic keyed by the tenant column, reach every member as before
409
+ (`channel-tenant.ts`, `rowTenant`). The catch-up read is a query, tenant-scoped by
410
+ `@ultimat3/entity` like every other.
411
+
403
412
  ## A channel event re-reads the page
404
413
 
405
414
  `As of 30.0.0`. For a server-rendered page with nothing to push but "this changed": the channel
@@ -218,7 +218,7 @@ export const config = defineRoute({
218
218
 
219
219
  | Key | Default | What it decides |
220
220
  |---|---|---|
221
- | `onInvalidate: 'stale'` | yes | a tag bust marks the stored page stale; the next request is answered **that copy, however old**, while a fresh one renders behind it (`x-ultimate-isr: stale`). Right for a price list |
221
+ | `onInvalidate: 'stale'` | yes | a tag bust marks the stored page stale; the next request is answered **that copy, however old**, while a fresh one renders behind it (`x-ultimate-isr: stale`). That stale answer is **not leased to a shared cache**: it carries `public, max-age=0, s-maxage=0` and no `stale-while-revalidate`, with the same `surrogate-key`, so a CDN purged by the bust asks the origin again and gets the regenerated page, instead of holding the pre-write one for the whole `ttl` (`As of 2026-11-19`). Right for a price list |
222
222
  | `onInvalidate: 'purge'` | — | a tag bust **deletes** every stored page of the route carrying the tag — each locale, each keyed query, stored 404s included — and evicts any render of them in flight, so the next request renders and waits. For content that must come **down** (a withdrawn article, a corrected legal text). Needs `tags` **and `ttl`** (`X_ROUTE_MODE_INVALID` without either). The response carries no `stale-while-revalidate`, and its `s-maxage` is what is **left** of the `ttl` |
223
223
  | `maxStale` | unbounded; **`0` under `'purge'`** | how long **past its `ttl`** a stored page may still be answered stale: a duration, or `0` for never. Older, it is dropped and the request waits for a render. Also the `stale-while-revalidate` a shared cache is told (a day when omitted, absent at `0`). Needs `ttl` |
224
224
  | `query` | `[]`, none | the query parameters the page varies on. Only these are in the stored page's key **and** in the `url` / `query` that `load`, `meta` and the page receive; one value each (the first), sorted |
@@ -84,6 +84,8 @@ export const digestTask = sendDigest.schedule;
84
84
 
85
85
  Hand the job's module to `defineApi({ jobs })`; the task registers with it — it needs no `tasks` entry. A task that fires several jobs, or a job other code also enqueues, stays a `task()` beside its jobs.
86
86
 
87
+ **One job per org, from a schedule**: the schedule belongs to no org (`tenant: 'none'`), the org list is read inside `crossTenant()` as a service actor, and each child job is tenant-scoped and runs as its org — the whole pattern, with a test that runs it, is `x docs 'jobs.README#one-job-per-org-from-a-schedule'`. Fire it now in dev with `x tasks run <name>.schedule`.
88
+
87
89
  ## The fluent surface
88
90
 
89
91
  Every projection is a method on the task — `nightlyDigest.enqueue()`, never `runTask(nightlyDigest)` — and every declared field is lifted onto it. A task has no `.def`.
@@ -160,8 +162,9 @@ Role table and drain sequence: [Deployment](Deployment).
160
162
  |---|---|
161
163
  | `x tasks list --json` | the descriptor — `name`, `cron`, `tz`, `catchUp`, `maxCatchUp`, `jobs` — plus the resolved **`next`** occurrence, rendered in the task's own `tz`, and its `nextMs` epoch instant; and the **`last`** fire (`last`, `lastMs`, `lastFiredAtMs` — `null` before the first), read from the queue, which `x tasks` opens when a task is declared. All derived, never declared fields |
162
164
  | `x tasks show <name> --json` | the same, plus the cron in words (`describe`) and the next N occurrences (`--count`, default 5) |
165
+ | `x tasks run <name> --json` | fires the task now: each job its occurrence enqueues goes onto the app's queue (`TaskHandle.enqueue()`, the run-now path; the scheduler's watermark is untouched, so the next scheduled occurrence still fires). Beside an `x dev` on the embedded database it refuses with the stop–run–restart fix; where the environment resolves `production` it needs `--production` (or `ULTIMATE_TASK_RUN=<name>` in a container), else `X_TASK_RUN_PRODUCTION`. `x g cron-job` prints it as its next step. `As of 2026-11-19` |
163
166
  | `/admin/jobs/tasks` | the jobs dashboard every `defineAdmin()` serves: schedule, zone, last fire, next fire (`nextTaskRun`), paused; pause, resume and run now behind `job:manage` → [Admin dashboard](Admin-Dashboard#the-jobs-dashboard) |
164
- | MCP `admin.x_job_tasks.list`, `admin.action.job.task.run-now` | the same screen and actions as admin MCP tools, same authz (`job:read`, `job:manage`) |
167
+ | MCP `admin.x_job_tasks.list`, `admin.action.job.task.run-now` | the same screen and actions as admin MCP tools, same authz: listing needs `job:read`, run-now `job:manage` — which `x new`'s `admin` role does **not** hold (it holds `job:read`); grant it in `apps/web/shared/roles.ts` to see the tool |
165
168
  | `/_x` dev panel | the jobs tab: the dev process's tasks beside its queues and runs |
166
169
  | `x.manifest.json` | generated `tasks` section — the build-time source of truth |
167
170
  | `<task>.describe()` | in process: `kind`, `name`, `cron`, `tz`, `catchUp`, `maxCatchUp`, and the job names it enqueues |
package/wiki/Testing.md CHANGED
@@ -234,7 +234,8 @@ export const summarizeEval = defineEval({
234
234
  ```
235
235
 
236
236
  `ULTIMATE_EVAL_RECORD=1 x test eval` re-records every baseline, so accepting a new number is a
237
- reviewable diff instead of an edited threshold. It is refused inside the gate: `x verify` with that
237
+ reviewable diff instead of an edited threshold. `0`, `false`, `no`, `off` or empty (any case) is
238
+ off and gates; any other value records (`As of 2026-11-19`). It is refused inside the gate: `x verify` with that
238
239
  variable set is `X_EVAL_RECORDING` and runs no eval suite, because recording passes by definition
239
240
  and would overwrite the committed baselines during the run.
240
241
 
@@ -402,7 +403,7 @@ Installed by the preload on `expect`.
402
403
  | `toDenyPolicy(context)` | the policy refuses that context |
403
404
  | `toEmitSteps(names)` | a job runs exactly those steps, in order |
404
405
  | `toMatchOpenApi(committed)` | no operation removed, no parameter newly required |
405
- | `toBeWithinBudget(limit)` | a measured number is at or under the limit |
406
+ | `toBeWithinBudget(limit)` | a measured number is at or under the limit; a limit that is not a finite number (`undefined` from a renamed budget key, `NaN`, `Infinity`) throws `X_TEST_NUMBER_EXPECTED`, under `.not` too (`As of 2026-11-19`) |
406
407
  | `toRejectInput(input)` / `toAcceptInput(input)` | a schema's verdict on one input |
407
408
  | `toEqualRow(expected)` | equality over every OWN property — the one that sees a `.sealed()` column |
408
409
  | `toBeVisible(options?)` | waits for a locator to show; `.not` waits for it to go |
@@ -1098,7 +1099,7 @@ coverage floor counts that suite alone, so a body only a typed suite reaches is
1098
1099
  |---|---|---|
1099
1100
  | `x g action` | input parse; the handler through `.as(actor, input)` — the refusal first, then what it answers | `contract`: the action contract (the exercise as a member of the input's org), the foreign-org denial, the OpenAPI operation |
1100
1101
  | `x g mutator` | the same, plus `local()` against `memoryLocalTx()`, applied twice | `contract` |
1101
- | `x g query` | the SQL's bound, total order and direction; the read through `.as()` — no grant refused, an empty org reads empty, stored rows read back newest first and never another org's, the read costing one `statements` count however many rows it answers | `--live`: the declaration in `.live.test.ts` |
1102
+ | `x g query` | the SQL's bound, total order and direction; the read through `.as()` — no grant refused, an empty org reads empty, stored rows read back newest first and never another org's — a read through the slice's `<Feature>View` answers exactly its keys, no `orgId` — the read costing one `statements` count however many rows it answers | `--live`: the declaration in `.live.test.ts` |
1102
1103
  | `x g job` · `x g task` | the body under `runJobs`: which steps one run takes, what it answers, and how it ends | `job`: key, tenant, retry policy, enqueue dedupe |
1103
1104
  | `x g backfill` | one whole pass over rows in two tenants; the projection replayed | `job`: durable name, dedupe |
1104
1105
  | `x g route` | the page rendered (`renderRoute`): heading, metadata, mode, budget, islands | `e2e`: the offline fallback |
@@ -1384,7 +1385,9 @@ gates at once — and it is held to a **memory budget**, not to whatever looks f
1384
1385
 
1385
1386
  - **Width.** `max(2.75 GiB, 25% of total RAM)` divided by 1.25 GiB a worker, clamped to `1..cores`:
1386
1387
  3 workers on a 16 GB box, 12 on a 62 GB 16-core one, 2 on an 8 GB one (the 2.75 GiB floor). Never more workers than cores. The step line says
1387
- what it chose and why — `3 workers (budget 4.0 GB)`. `ULTIMATE_TEST_MEMORY_BUDGET=3g` replaces
1388
+ what it chose and why — `3 workers (budget 4.0 GB)`; fewer files than that read
1389
+ `1 worker, one per file (plan: …)`, and a run the machine held narrower reads
1390
+ `ran 2 at once (peak), planned 3 — …`. `ULTIMATE_TEST_MEMORY_BUDGET=3g` replaces
1388
1391
  the budget, `ULTIMATE_TEST_MAX_WORKERS=2` caps the width, `--workers N` wins over both. Total RAM,
1389
1392
  never "free": page cache counts as free, and two gates each planning on it took a 45 GB box down.
1390
1393
  - **One budget per machine.** Each batch of workers reserves its measured memory in the
@@ -66,7 +66,11 @@ and `Calendar` take and post `YYYY-MM-DD` and know no zone. Month and weekday na
66
66
  `Intl.DateTimeFormat` with `timeZone: 'UTC'` on the plain date's UTC midnight, which names the date
67
67
  and never shifts it; the week starts on the locale's day (`Intl.Locale#getWeekInfo`). A *window* is
68
68
  instants: `timeRangeUrl(url, { presets, default, timeZone, now })` reads a custom `from`/`to` as
69
- wall-clock time in `timeZone` (a spring-forward gap resolves forward) and `TimeRangePicker` requires
69
+ wall-clock time in `timeZone` (a spring-forward gap resolves forward); `href({ from, to })` writes
70
+ `:ss` when an instant has seconds and writes the end so it reads back at or after the instant
71
+ asked for, so a window touching a fall-back hour reads back as one containing the window given,
72
+ never `invalid` or an hour early (`As of 2026-11-19`). Every list cursor on the page, a namespaced
73
+ one (`runs.after`) included, is dropped when the window changes. And `TimeRangePicker` requires
70
74
  the same `timeZone` as a prop — omitting it is a type error. "Today" is the caller's: pass `month`
71
75
  (or `now`) computed with `plainDateIn(now(), actor.tz)`; with none, `Calendar` opens on today in
72
76
  `useUi().timeZone`, the request's zone, never the device's.
@@ -40,6 +40,7 @@ The `--json` form is the same content as the terminal form. Paste the JSON into
40
40
  | `X_APP_IMPORT_UNRESOLVED` | an app module imports a package nobody installed, or a path with no file behind it. One finding per specifier | `bun add <pkg>`, or edit the import in the file the finding names. `x doctor` reports it too |
41
41
  | `X_DB_DRIFT` on a brand-new app, cause *packages/db has a schema but no migration recorded it* | expected: `x new` writes no migration, and `x db gen` is the only writer of `packages/db/migrations`. Only an app that declares an entity reports it — zero declared against zero recorded is agreement | `x db gen "initial"` then `x db migrate` — `bun run setup` does both |
42
42
  | `X_DB_DRIFT` after deleting the last entity, migrations still committed | correct, and not the case above: the migrations record tables the source no longer declares | `x db gen "drop <table>"` → it refuses with `X_MIGRATION_IRREVERSIBLE` → re-run as `x db gen "drop <table>" --allow-destructive`, or put the entity back |
43
+ | `X_MIGRATION_FORKED` after merging two branches | each ran `x db gen` from one parent, so the newest `.snapshot.json` omits the other's work | `x db gen --merge-fork`: no SQL changes, nothing is deleted. Do not generate a `record …` migration. If the cause says a migration creates something *again*, follow its `x db status --json` check, and never delete a migration a database applied |
43
44
  | `X_MIGRATION_SNAPSHOT_MISSING`, and `x db gen` refuses before writing anything | the newest migration on disk carries no `.snapshot.json` — hand-written, or the sidecar was deleted | `git checkout -- packages/db/migrations/<id>.snapshot.json`; if it was never written, `rm packages/db/migrations/<id>.* && x db gen "<name>"` — the delete **first**, or the generate refuses again |
44
45
  | `ROLE=migrate` sits there doing nothing | another version's `ROLE=migrate` holds the session-pinned migration lock. This one **waits up to 60s**, polling once per 500ms, then exits non-zero with `X_MIGRATE_CONCURRENT` (`As of 2026-08`; on 1.2.0 it waits forever) | let the first exit 0 — the second then applies. If nothing else is deploying, the holder is a wedged backend: `psql "$DATABASE_URL" -c "select pid, application_name, state from pg_stat_activity join pg_locks using (pid) where locktype = 'advisory'"`, then `pg_terminate_backend(pid)` it |
45
46
  | `ROLE=migrate` exits non-zero, deploy blocked | migration failure — correct, the roll is supposed to stop | read the SQL error, fix the migration, re-run. Do not start `web` on the old schema |
@@ -40,7 +40,7 @@ cd myapp && bun run setup
40
40
  setup complete — next: bun run dev
41
41
  ```
42
42
 
43
- `bun run setup` is `bun install`, an `.env.development.local` touch, `x db gen "initial"`, `x db migrate`, `x db seed`, then `x manifest` — so the database is migrated and `x.manifest.json` exists before the gate asks for either. `x new` installs nothing, so this is not optional.
43
+ `bun run setup` is `bun install`, `x merge-driver install`, an `.env.development.local` touch, `x db gen "initial"`, `x db migrate`, `x db seed`, then `x manifest` — so the database is migrated and `x.manifest.json` exists before the gate asks for either. `x new` installs nothing, so this is not optional.
44
44
 
45
45
  `x` is a workspace dependency, not a global install. `bunx x <command>` resolves `node_modules/.bin/x`; the `package.json` scripts (`bun run verify`, `bun run dev`) resolve the same binary. A globally installed `x` (`bun link`, `bun add -g`) run inside the app **hands over** to that same file, `As of 2026-09-05`, and says so on stderr: a global copy carries its own `@ultimat3/entity` with an empty registry, and it wrote a zero-entity manifest under a green exit code before it did. `ULTIMATE_KEEP_GLOBAL_CLI=1` is the opt-out — [`@ultimat3/cli`'s README](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/README.md) has the measurement.
46
46
 
@@ -79,7 +79,7 @@ The default scaffold, after `bun run setup`, with no `.x/build-stats.json` befor
79
79
  ✓ unit 2790ms 3 workers (budget 4.0 GB)
80
80
  ✓ contract 1233ms 3 workers (budget 4.0 GB)
81
81
  ✓ live 840ms serial
82
- ✓ job 345ms 1 of 3 workers (budget 4.0 GB)
82
+ ✓ job 345ms 1 worker, one per file (plan: 3 workers (budget 4.0 GB))
83
83
  ✓ exercise 1952ms
84
84
  ✓ e2e 12124ms serial
85
85
  ✓ eval 91ms
@@ -240,7 +240,7 @@ bunx x db gen "initial" # entities → <id>.sql, <id>.snapshot.json, <id>.has
240
240
  bunx x db migrate # applies them, then diffs the live schema against the ledger it wrote
241
241
  ```
242
242
 
243
- `bun run setup` runs both — `bun install`, an `.env.development.local` touch, `x db gen "initial"` when the directory holds no `.sql`, `x db migrate`, `x db seed`, then `x manifest`. `x db migrate` is `@ultimat3/db`'s own migrator, the one `ROLE=migrate` runs, so nothing extra has to be installed.
243
+ `bun run setup` runs both — `bun install`, `x merge-driver install`, an `.env.development.local` touch, `x db gen "initial"` when the directory holds no `.sql`, `x db migrate`, `x db seed`, then `x manifest`. `x db migrate` is `@ultimat3/db`'s own migrator, the one `ROLE=migrate` runs, so nothing extra has to be installed.
244
244
 
245
245
  Until the generate has run, `x verify` is **red on its `drift` step** — correct behaviour with a runnable fix, not a defect:
246
246
 
@@ -249,7 +249,7 @@ bunx x db gen "add todos"
249
249
  ```
250
250
 
251
251
  ```text
252
- ✓ migration …_add_todos generated
252
+ ✓ migration …_add_todos generated — tables: todos
253
253
  ```
254
254
 
255
255
  The 1.1.0 workaround this step used to carry (a hand-written `db-gen.ts` script, and two manual
@@ -83,14 +83,14 @@ bunx x policy explain todo:write
83
83
 
84
84
  ```text
85
85
  action archiveTodo — policy todo:write
86
- actor verdict deciding reason
87
- anonymous deny todo:write no actor for todo:write
88
- admin deny todo:write todo:write predicate returned false
89
- member deny todo:write actor lacks todo:write
86
+ actor verdict deciding reason
87
+ anonymous deny todo:write no actor for todo:write
88
+ admin needs input todo:write not denied — every actor-only clause passes, and todo:write has a predicate that reads the request input
89
+ member deny todo:write actor lacks todo:write
90
90
  evaluated with no request input and no row — a rule reading either decides again on the real request
91
91
  action createTodo — policy todo:write
92
92
  …
93
- ✓ todo:write — allowed for 0 of 6 actor evaluation(s)
93
+ ✓ todo:write — allowed for 0 of 6 actor evaluation(s); 1 not denied, decided by a predicate that reads the request input — x policy explain todo:write --input '<the request input as JSON>'
94
94
  ```
95
95
 
96
96
  Read the `reason` column, not the verdict:
@@ -98,7 +98,8 @@ Read the `reason` column, not the verdict:
98
98
  | Reason | Means |
99
99
  |---|---|
100
100
  | `actor lacks todo:write` | the grant is missing — a role problem, fix it in `defineRoles` |
101
- | `predicate returned false` | the grant is held, the predicate said no. Here that is tenancy, with no `input.orgId` to compare against outside a request |
101
+ | `predicate returned false` | the grant is held, the predicate said no |
102
+ | `needs input` | the grant is held and every clause that reads only the actor passes; the rest reads the request input — here archive's tenancy rule, `input.orgId`. Not a denial: run the summary's own command with the input a request sends, `x policy explain todo:write --input '{"orgId":"…"}'` |
102
103
  | `no actor for …` | anonymous. Every surface agrees on this one |
103
104
 
104
105
  `<subject>` resolves against a permission, an action name, a query name, then an action's HTTP path — so the `fix:` line an `X_FORBIDDEN` prints is runnable whichever of the four the throwing surface had. Verdicts come from `policyMatrix()` over the app's real `Policy` objects, never a second evaluation.
package/wiki/Upgrading.md CHANGED
@@ -61,6 +61,15 @@ Each entry changes a surface the table below covers.
61
61
  | that the tarball is attested | `npm view @ultimat3/core dist.attestations` | a `provenance` object |
62
62
  | every name that must move together | `bun run scripts/release-workflow.ts --json` | the 30 derived names — check each |
63
63
 
64
+ **A hop's gate, handed to CI in part.** `As of 2026-11-19`. A bare `x upgrade --json` runs the full `x verify` and is the default. On a loaded machine, `x upgrade --only <step>[,<step>…] --json` runs the hop's `x verify` on those steps alone — the list `x verify --only` takes, refused the same way — and every other stage of the hop unchanged. It is **not the full gate**, and the report says so: `proof: "verify-only"`, `verify.only[]` the steps run, `verify.notRun[]` the rest, a summary reading `NOT THE FULL GATE`, and `then` naming `x verify --only <the rest> --json`. Commit the hop on a branch and let CI run the rest; the hop is proven when that is green.
65
+
66
+ ```sh
67
+ x upgrade --only typecheck,lint --json # here: two steps, and the hop
68
+ # then, in CI on the hop's commit: x verify --only <data.verify.notRun, comma-joined> --json
69
+ ```
70
+
71
+ To leave only `unit`, `live` and `e2e` to CI, name every other step: `x help verify` lists them in the gate's order.
72
+
64
73
  ## 30.x → 31.0.0, entry by entry
65
74
 
66
75
  `As of 2026-11-10`, released: the 74 breaking entries of `CHANGELOG.md`'s `## 31.0.0` section, in their order. No legacy path, no codemod, no shim. v31 is the stable line — the next major waits for its window ([Stability](Stability)).
@@ -319,6 +328,34 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
319
328
  | an offline replay sends `x-ultimate-replay-scope`, and the action route answers a session other than the queue's owner `409 X_REPLAY_PRINCIPAL_MISMATCH`, the entry kept `pending` (**31.47.0**, [Realtime](Realtime#tier-3-shipped-in-2100)); `DEFAULT_CORS.allowHeaders` lists the header | an app setting `cors.allowHeaders` replaces that list (`packages/http/src/config.ts`): add `x-ultimate-replay-scope` to it. A cross-origin caller sending the header needs this; the page outbox replays to a same-origin path, which has no preflight. An app on several processes sets `SESSION_SECRET` (32+ characters), or a replay reaching another process is refused |
320
329
  | `x exercise` with no `--seed`, and so `x verify`'s `exercise` step, runs one constant seed (**31.47.0**) where each run drew a random one, and `seed` in `.x/exercise.json` is always the number used, never `null`. One tree now gets one verdict, but an `exercise.unprovenMax` measured under random seeds can sit just below the constant seed's figure, so the first gate after the hop can be `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`. `x upgrade` writes a figure only where the app states none, and never raises one | `x exercise --json`, then fix the helper or override each `unproven` record names: pick rows by what they are, never by id order, and assume no order between sized calls ([Testing](Testing)). If the figure that remains is the honest one, raising `unprovenMax` to it is your own reviewed edit of `x.verify.json`. `x exercise --seed random` looks for seed-dependent helpers |
321
330
  | `x upgrade` stops requiring an `e2e` suite no codemod wrote (**31.47.1**): an app with pages but no `apps/web/site/page.tsx` was left on `X_VERIFY_SUITE_VANISHED`. Rerunning `x upgrade` at the target no longer replays every codemod | nothing: `x upgrade` applies codemod `e2e-suite-floor`, which writes a `page.e2e.test.ts` beside the shortest parameter-free page, or moves `e2e` to `skip` with its why when no page can be visited. To apply codemods an older CLI left behind: `x upgrade codemods --from 0.0.0 --json` |
331
+ | 24 shipped guards' fixes change (**31.49.0**), built in; their findings do not: `animated-layout-property`, `bare-error`, `error-declared`, `focus-visible`, `image-dimensions`, `island-mount-clears`, `native-confirm`, `raw-breakpoint`, `raw-colour`, `raw-fetch`, `raw-interval`, `raw-length`, `raw-motion`, `raw-shadow`, `raw-z-index`, `repo-await-in-loop`, `repo-raw-sql`, `repo-unbounded`, `runtime-pin`, `semantic-interactive`, `unbounded-fanout`, `undeclared-custom-property`, `undefined-style-class` and `unzoned-date` end their fix on the one step that re-checks it (`then: x verify --only boundaries`) in place of `then: x verify`, which started the whole gate. A copy still in `guards/` keeps the old text until `x upgrade` migrates it to the release after 31.48.0 | nothing |
332
+ | **Upgrading to the next release: what to check**, in this order. `As of 2026-11-19`; each row below names one check, and [`CHANGELOG.md`](https://github.com/developerz-ai/ultimate/blob/main/CHANGELOG.md)'s `[Unreleased]` carries the detail. Five `app.config.ts` keys that were validated and read by nothing are **read** now (the next row) | run the rows in order, then `x verify` |
333
+ | `app.config.ts` keys now read (**31.49.0**): `roles` — a `ROLE` it does not list refuses to boot (`X_CONFIG_INVALID`, `meta.key: 'roles'`; `ROLE=migrate` exempt); `database.ssl: true` adds `sslmode=require` on **every** pool — serving roles, `x dev`, migrate, the replicator's `DATABASE_URL` and `REPLICATION_URL`, `x doctor`'s probes, `x db branch`, `x deploy verify` — unless the URL or `PGSSLMODE` states a mode; `cache.defaultTtlMs` sets the boot-built `lru`/`redis` lease (a Redis rung held such values 300 s, now 60 s by default; `0` is refused); `jobs.maxAttempts` (default now `3`, not the documented `5`) and `jobs.backoff` apply to every job declaring no `retry` | `grep -n 'roles\|ssl\|defaultTtlMs\|maxAttempts\|backoff' app.config.ts`. `roles`: every `ROLE` your compose services, Helm values or platform processes start is listed, or drop the key. `ssl: true` against a Postgres without TLS: `database: { ssl: false }` or `?sslmode=disable` in each URL. `defaultTtlMs: 0`: a positive lease. `maxAttempts` / `backoff`: keep them only if they are the retry you want for every job declaring none |
334
+ | `pwa.enabled`, `pwa.backgroundSync` and `pwa.push` must be real booleans (**31.49.0**), checked even when `enabled` is false: `'false'` used to turn the PWA **on**; a non-list `pwa.categories` / `shortcuts` / `screenshots`, a non-string `neverCache` entry or `site.favicon` are refused too — `X_CONFIG_INVALID` at boot | each a literal `true` or `false` in `app.config.ts`'s `pwa` block |
335
+ | a records channel keyed by a param that is not the tenant column (a `roomId` topic) delivers a tenanted row only to members of that row's tenant, live and on replay (**31.49.0**); every other member receives the seq alone | nothing, unless a channel deliberately fanned one org's rows out to members of other orgs: that feed needs its own untenanted table or a channel keyed by the tenant column |
336
+ | `directionOf` / `isRtl` read an explicit script subtag first, and bare `ku` is `ltr` (Kurmanji, Latin script) (**31.49.0**) | an app serving Kurdish in Arabic script under `ku`: rename the locale `ku-Arab` or `ckb`, or its pages render `dir="ltr"` |
337
+ | outside dev, an undeclared non-`X_` code on an unclassified 5xx (a driver's `23505`, `ENOENT`, an app's `E_UPSTREAM`) is served as `X_INTERNAL` (**31.49.0**); a hang-up is `499 X_ABORTED`, no longer a reported 500, and `hooks.onError` receives the coded error; the request deadline ends at the headers, so a streamed answer is bounded only by the caller leaving | a client switching on such a code: declare it — `defineError`, or `registerErrorStatus({ E_UPSTREAM: 502 })`. An `onError` matching `AbortError` matches `code === 'X_ABORTED'`. A streamed agent answer that needs a cap: `withChildContext({ signal: AbortSignal.timeout(ms) }, …)` |
338
+ | `redisJobDriver()` (**31.49.0**): failed, dead and expired rows expire after 90 days (`deadTtlMs`), and with no `clock` injected leases, retries and gauges are measured on the Redis server's clock | to keep dead rows: `redisJobDriver({ deadTtlMs: 0 })`. A test freezing time against a real Redis driver: `redisJobDriver({ clock })`. Postgres apps: nothing |
339
+ | `x g sign-in --oidc` now passes `mfaPath` and writes the second-factor page (**31.49.0**); an app generated before still answers an MFA-enrolled SSO user 401 `X_MFA_REQUIRED` | an OIDC app with MFA users: `mfaPath: '<your second-factor page>'` in its `oauthLogin` / `identityProviderRoutes` call, and that page calling `completeMfa(auth, readMfaChallenge(request) ?? '', code)` then sending `clearMfaChallengeCookie()` ([Auth](Auth)). A fresh `x g sign-in --oidc --dry-run` in a scratch app shows the six files. No codemod |
340
+ | beside an `x dev` holding the embedded database (**31.49.0**): `x db migrate` is applied by that dev server; `x db seed`, `x db backfill --write`, the writing `x jobs` verbs and `x auth seal-mfa` refuse `X_DEV_ALREADY_RUNNING`; `x jobs pause\|resume` refuses a queue the app does not serve (`X_CLI_BAD_FLAG`) | a script or agent loop running those beside `x dev`: `x stop --json && <the command> && x dev`. A runbook pausing a queue reached only by `enqueue({ queue })`: add it to `jobs.queues` |
341
+ | `x db gen` asks for a plain column made `generated` as a drop (**31.49.0**): `X_MIGRATION_ROLLING_UNSAFE`, then `X_MIGRATION_IRREVERSIBLE` | `x db gen "<name>" --allow-destructive --rolling-unsafe`, or retire the column first. The stored values are lost either way |
342
+ | `.search()` inside `crossTenant()` through an external `SearchIndex` refuses a chain naming no tenant (**31.49.0**, `X_INVARIANT_VIOLATED`); `matches(/…/)` refuses an astral literal, a bound above 255, a `-` after a range in a class and a quantified lookaround at declaration; a natural-key `upsertAll` is reported to `entity.row` as `update` with its `before` | an external index: `andWhere('<tenant>', 'in', [<orgId>, …]).search(…)`. A refused pattern: the refusal names the portable spelling. A subscriber or test expecting `insert` there: `update` |
343
+ | OAuth (**31.49.0**): `/oauth/register` takes at most 10 `redirect_uris` of 2,048 characters, self-registered clients get `d_` ids that `purge()` reaps once idle and unnamed, limits are per IPv6 /64; `mcpOAuthClient().begin()` refuses a non-loopback `http:` server or issuer, and `refresh()` answers the token it was passed when the server sends none | a hand-written `AuthServerStore`: re-run `authServerStoreConformance` — its `purge` must reap those clients. An internal MCP server on plain `http:` by hostname: serve it over TLS. Consent pages: show `client.host` beside `client.name` |
344
+ | a push service's 401/403 keeps the subscription (**31.49.0**), refused by code and logged; a served-stale `isr` answer is `public, max-age=0, s-maxage=0` | after a real VAPID key rotation, old rows stay until each browser re-subscribes or the row expires. Behind a CDN: one extra origin request per stale serve, no stale window at the edge |
345
+ | AI and tests (**31.49.0**): `postgresVectorStore()` lexical search matches any word and reads no websearch syntax; `defineEval` refuses a `NaN`, infinite or negative `tolerance` (`X_INVARIANT`); `ULTIMATE_EVAL_RECORD=0` / `false` / `no` / `off` gates; `toBeWithinBudget` refuses a non-finite limit (`X_TEST_NUMBER_EXPECTED`); `chunkDocument` cuts a little earlier | drop `"…"` / `-word` from vector queries; `grep -rn 'tolerance\|toBeWithinBudget' apps packages` — a number ≥ 0, a finite limit. Re-indexing may change chunk ids: re-run `indexDocument` for every document, not a subset |
346
+ | `x env check` with no `ULTIMATE_ENV`, `NODE_ENV` or `CI` set checks as **development** (**31.49.0**), as `x dev` runs there; it checked as production. Under `CI`, or with either name set, nothing changes | a deploy script running a bare `x env check` on a host that sets none of the three: `ULTIMATE_ENV=production x env check` |
347
+ | `x test <type>` exits 1 with `X_TEST_FAILED` when every test it selected skipped itself (**31.49.0**), where it exited 0 having checked nothing; `x verify` is unaffected | a script calling `x test live` (or any type) without the services: `docker compose -f docker/docker-compose.test.yml up -d --wait && set -a && . docker/test-services.env && set +a` first, or drop the call |
348
+ | `x dev` is `✗ dev ready` while migrations on disk are ahead of its database (`X_APP_MIGRATIONS_UNAPPLIED`) or an applied one was edited (**31.49.0**), and a schema finding no longer restarts it; on the embedded database `x db gen` refuses an edited applied migration (`X_MIGRATION_CONFLICT`, nothing written) | a workflow starting `x dev` before its first migrate: `x db migrate`. A script waiting for a fresh `✓` banner after `x db gen`: read `/_x` (or `x dev --json --once`). An edited applied migration: restore it (`git checkout <rev> -- packages/db/migrations/<id>.sql`), or rebuild the dev database with `x stop --json && x db reset` |
349
+ | `x policy explain --json` (**31.49.0**): a row whose predicate reads request input it was not given is `verdict: "needs-input"`, `allowed: null`, counted in `data.pending` — it was `allowed: false` | a script reading `!allowed` as denied: `verdict === "deny"`. To decide such a row: `x policy explain <subject> --input '<json>'` |
350
+ | an action's `Date` output now reaches the typed client as a `Date` (**31.49.0**), on the plain and enveloped 200 and in streamed `chunk` / `done` frames; past 1,536 bytes of `x-ultimate-dates` an answer's instants stay ISO strings (`http.wire_dates_dropped`, logged once) | island code that called string methods on such a value (`.slice`, `.localeCompare`) must change: `grep -rn 'useAction\|clientStream' apps/web`, then read each such field as a `Date` |
351
+ | a scheduled fan-out entry whose `tenant()` throws or answers empty (**31.49.0**) fails the whole occurrence: nothing queued, `jobs.scheduler.entry-refused` logged naming the task, job and entry, retried every tick until repaired | nothing, unless the log shows that line: repair the declaration or the data, and the next tick queues the whole occurrence |
352
+ | `x db rollback` against an external `DATABASE_URL` on another machine (**31.49.0**) needs `ROLLBACK_ALLOW_DESTRUCTIVE` naming each id, whatever `ULTIMATE_ENV` says (a compose service host like `db` included) | a script rolling back such a database: `ROLLBACK_ALLOW_DESTRUCTIVE=<id>[,<id>…] x db rollback --json` |
353
+ | `x dev` runs only the roles `app.config.ts` `roles` declares, when set (**31.49.0**), and logs the ones it left out; `x dev --role` naming only undeclared roles is `X_CONFIG_INVALID` | an app declaring `roles`: list every role `x dev` should run (the scheduler and sync included) |
354
+ | `x tasks run <name>` (new, **31.49.0**) under `ULTIMATE_ENV=production` fires only with `--production` or `ULTIMATE_TASK_RUN=<name>`, else `X_TASK_RUN_PRODUCTION` | nothing |
355
+ | `X_JOB_OUTLASTS_DRAIN` with `drain.workerRetireMs: 0` grades against the drain's real cancel (**31.49.0**), the later hooks' reserve and the 2 s margin before the deadline: 21 s of a 25 s `drain.deadlineMs`, was 23 s | `x verify --only manifest --json`; a job it names: raise `drain.workerRetireMs` or lower its `timeout` |
356
+ | fix text changed, codes unchanged (**31.49.0**): `X_ENV_MISSING` is the line to add to the file the environment loads; `X_CATALOG_MISSING_KEYS`'s comment half; `X_TEST_FAILED` reruns the first failing file; on the embedded development database `X_MIGRATION_CONFLICT` and `X_MIGRATION_ROLLBACK_DESTRUCTIVE` lead with `x stop --json && x db reset` | anything matching those strings exactly: `grep -rn 'x env check\|as ⟦key⟧' <your scripts>` and match the new text |
357
+ | new scaffolds (**31.49.0**): `docker/docker-compose.test.yml` is named `<app>-test-<hash of the directory>` with ports picked per directory, and `package.json` declares `@ultimat3/realtime` | nothing; an existing app keeps its `name:` and dependency set. One importing `@ultimat3/realtime` without declaring it: `bun add --exact @ultimat3/realtime@$(bun -p "require('./package.json').dependencies['@ultimat3/core']")`. Sharing a test stack with a same-named app: its own `name:` and ports in the compose file and `docker/test-services.env` |
358
+ | a production container runs one process per declared CPU (**31.49.0**, `ULTIMATE_PROCESSES=auto`, [Processes per container](Deployment#processes-per-container)), and `jobs.concurrency`, `jobs.maxInFlight` and `DATABASE_POOL_MAX` are per **container**, split across its processes. A no-op for a container that declares no CPU quota (no `cpus:` in Compose, no CPU limit in Kubernetes — every scaffold before this): it still runs one process, where container and process are the same. A service that **already** declares `cpus:` of 2 or more, or a Kubernetes CPU limit of 2 or more, runs that many processes once every clamp passes (shared state, the pool, a prebuilt image). The new scaffold's compose declares `cpus:` per role and `init: true`, and carries `sysctls: { net.ipv4.tcp_migrate_req: 1 }` on `web`/`sync` commented out (Linux ≥ 5.14 only: on an older kernel Docker refuses to create the container); its chart pins `ULTIMATE_PROCESSES: "1"` | with no CPU quota anywhere: nothing. A service with `cpus:` or a CPU limit ≥ 2: `x doctor` names the count each role would run; set `ULTIMATE_PROCESSES=1` on it to keep one process, or keep N and, on a host ≥ Linux 5.14, add `sysctls: { net.ipv4.tcp_migrate_req: 1 }` to `web`/`sync`. To use a second core on purpose: `cpus: '2'` on the service (and 256 MiB of `mem_limit` per process), `init: true`, the same `sysctls:` line where the kernel has it, then `x doctor`. A worker with `concurrency: 1` stays serial across the container |
322
359
 
323
360
  ## 29.x → 30.0.0, entry by entry
324
361