@ultimat3/cli 31.26.0 → 31.28.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 (206) hide show
  1. package/CLAUDE.md +47 -37
  2. package/README.md +19 -8
  3. package/package.json +29 -29
  4. package/src/app-manifest.ts +6 -1
  5. package/src/app-mcp.ts +17 -3
  6. package/src/cmd-cache-spec.ts +5 -2
  7. package/src/cmd-db-spec.ts +2 -3
  8. package/src/cmd-db.ts +0 -2
  9. package/src/cmd-deploy-verify-sample.ts +93 -0
  10. package/src/cmd-deploy-verify.ts +2 -41
  11. package/src/cmd-dev-spec.ts +15 -1
  12. package/src/cmd-dev.ts +31 -4
  13. package/src/cmd-doctor.ts +15 -4
  14. package/src/cmd-exercise-spec.ts +7 -1
  15. package/src/cmd-exercise.ts +22 -10
  16. package/src/cmd-generate.ts +2 -0
  17. package/src/cmd-jobs-spec.ts +3 -6
  18. package/src/cmd-jobs.ts +1 -7
  19. package/src/cmd-logs-spec.ts +2 -1
  20. package/src/cmd-logs.ts +9 -28
  21. package/src/cmd-planned.ts +11 -45
  22. package/src/cmd-profile-frames.ts +99 -0
  23. package/src/cmd-profile-spec.ts +24 -0
  24. package/src/cmd-profile.ts +164 -0
  25. package/src/cmd-repro-spec.ts +13 -1
  26. package/src/cmd-repro.ts +37 -5
  27. package/src/cmd-status-sample.ts +57 -0
  28. package/src/cmd-status-spec.ts +30 -0
  29. package/src/cmd-status.ts +108 -0
  30. package/src/cmd-token-spec.ts +5 -2
  31. package/src/cmd-token.ts +7 -3
  32. package/src/cmd-upgrade-codemods.ts +71 -0
  33. package/src/cmd-upgrade-spec.ts +19 -5
  34. package/src/cmd-upgrade.ts +91 -34
  35. package/src/codemods/agents-dev-mcp.ts +50 -0
  36. package/src/codemods/authenticator-session-refusal.ts +214 -0
  37. package/src/codemods/biome-no-default-export.ts +58 -0
  38. package/src/codemods/bunfig-island-coverage.ts +33 -0
  39. package/src/codemods/chart-dashboard.ts +73 -0
  40. package/src/codemods/ci-e2e-browser-stock.ts +75 -0
  41. package/src/codemods/ci-e2e-browser.ts +63 -0
  42. package/src/codemods/codemod.ts +58 -0
  43. package/src/codemods/define-error-leaf.ts +73 -0
  44. package/src/codemods/docs-ci-parts.ts +65 -0
  45. package/src/codemods/docs-gate-prose.ts +53 -0
  46. package/src/codemods/docs-island-rows.ts +31 -0
  47. package/src/codemods/docs-shipped-guards.ts +100 -0
  48. package/src/codemods/docs-test-services.ts +62 -0
  49. package/src/codemods/engine-diff.ts +104 -0
  50. package/src/codemods/engine-edits.ts +111 -0
  51. package/src/codemods/engine-fs.ts +95 -0
  52. package/src/codemods/engine.ts +191 -0
  53. package/src/codemods/format-edited-hook-3122.ts +28 -0
  54. package/src/codemods/format-edited-hook.ts +152 -0
  55. package/src/codemods/helm-alerts-objective.ts +105 -0
  56. package/src/codemods/helm-alerts-stock.ts +108 -0
  57. package/src/codemods/index.ts +56 -0
  58. package/src/codemods/metrics-probe-healthz.ts +47 -0
  59. package/src/codemods/pending.ts +36 -0
  60. package/src/codemods/repro-gitignore.ts +40 -0
  61. package/src/codemods/runtime-pin-lines.ts +109 -0
  62. package/src/codemods/runtime-pin.ts +116 -0
  63. package/src/codemods/solid-floor.ts +63 -0
  64. package/src/codemods/test-ports.ts +86 -0
  65. package/src/codemods/test-suites.ts +37 -0
  66. package/src/codemods/theme-toggle-mount-over.ts +70 -0
  67. package/src/codemods/vendored-guards.ts +186 -0
  68. package/src/codemods/verify-floor-skips.ts +88 -0
  69. package/src/codemods/verify-floor-steps.ts +90 -0
  70. package/src/coverage-island.ts +121 -0
  71. package/src/coverage-lcov.ts +49 -5
  72. package/src/coverage-remap.ts +146 -0
  73. package/src/db-replay-engine-prepared.ts +66 -0
  74. package/src/db-replay-engine-template.ts +156 -0
  75. package/src/db-replay-engine.ts +4 -0
  76. package/src/db-replay-scratch-reap.ts +54 -0
  77. package/src/deploy-verify-flags.ts +9 -2
  78. package/src/deploy-verify-grade.ts +10 -3
  79. package/src/dev-boot.ts +14 -1
  80. package/src/dev-dashboard-guard.ts +57 -10
  81. package/src/dev-host.ts +46 -0
  82. package/src/dev-tls-cache.ts +103 -0
  83. package/src/dev-tls-der.ts +69 -0
  84. package/src/dev-tls.ts +120 -0
  85. package/src/doctor-advisory-floors.ts +113 -0
  86. package/src/doctor-browser.ts +60 -0
  87. package/src/doctor-guards.ts +39 -86
  88. package/src/doctor-superseded.ts +67 -0
  89. package/src/error-codes-doctor.ts +12 -4
  90. package/src/error-codes-verify.ts +47 -0
  91. package/src/error-codes.ts +20 -23
  92. package/src/exercise-database.ts +47 -9
  93. package/src/exercise-push-device.ts +51 -0
  94. package/src/exercise-route-api.ts +74 -0
  95. package/src/exercise-routes.ts +14 -5
  96. package/src/exercise-services.ts +3 -1
  97. package/src/exercise-shard-flag.ts +47 -0
  98. package/src/fix-command.ts +2 -2
  99. package/src/generate-factories.ts +5 -11
  100. package/src/generate-feature-required.ts +9 -4
  101. package/src/generate-files.ts +26 -7
  102. package/src/generate-kinds.ts +5 -1
  103. package/src/guards-built-in-codes.ts +36 -0
  104. package/src/guards-built-in-refusal.ts +25 -0
  105. package/src/guards-built-in.ts +134 -0
  106. package/src/guards-materialize.ts +42 -0
  107. package/src/guards-paths.ts +37 -0
  108. package/src/guards-shipped-names.ts +38 -0
  109. package/src/guards-vendored.ts +73 -0
  110. package/src/guards.ts +105 -34
  111. package/src/index.ts +10 -0
  112. package/src/island-bundle-options.ts +48 -0
  113. package/src/island-bundle.ts +18 -46
  114. package/src/island-link.ts +5 -0
  115. package/src/island-outputs.ts +5 -0
  116. package/src/lint-findings.ts +3 -3
  117. package/src/mcp-errors-verify.ts +35 -0
  118. package/src/mcp-errors.ts +21 -20
  119. package/src/mcp-host-logs.ts +121 -0
  120. package/src/mcp-host.ts +12 -73
  121. package/src/measure-scope.ts +23 -3
  122. package/src/messages-floor.ts +19 -0
  123. package/src/messages-repro.ts +16 -2
  124. package/src/messages-status.ts +10 -0
  125. package/src/messages-upgrade.ts +15 -0
  126. package/src/messages.ts +22 -1
  127. package/src/registry.ts +4 -0
  128. package/src/repro-archive-collect.ts +161 -0
  129. package/src/repro-archive-write.ts +96 -0
  130. package/src/repro-archive.ts +161 -0
  131. package/src/repro-bundle.ts +8 -16
  132. package/src/repro-errors.ts +14 -2
  133. package/src/repro-framework.ts +53 -0
  134. package/src/repro-parse.ts +87 -0
  135. package/src/repro-redact.ts +218 -0
  136. package/src/repro-scrub.ts +257 -0
  137. package/src/role-start-types.ts +7 -0
  138. package/src/role-start.ts +4 -0
  139. package/src/serve-boot.ts +7 -1
  140. package/src/serve-env-tls.ts +57 -0
  141. package/src/solid-loader.ts +27 -10
  142. package/src/superseded-match.ts +87 -0
  143. package/src/superseded.ts +84 -0
  144. package/src/templates/bun-image.ts +48 -0
  145. package/src/templates/generate-export-rows.ts +136 -0
  146. package/src/templates/generate-import-rows.ts +186 -0
  147. package/src/templates/generate-rows-slice.ts +95 -0
  148. package/src/templates/github/ci.yml.ts +5 -1
  149. package/src/templates/guard-released-forms.ts +112 -0
  150. package/src/templates/guard-runtime-pin-test.ts +54 -0
  151. package/src/templates/guard-runtime-pin.ts +189 -0
  152. package/src/templates/scaffold-claude-agents.ts +6 -6
  153. package/src/templates/scaffold-claude-commands.ts +1 -1
  154. package/src/templates/scaffold-claude-hook.ts +18 -8
  155. package/src/templates/scaffold-claude.ts +2 -2
  156. package/src/templates/scaffold-db-package.ts +3 -0
  157. package/src/templates/scaffold-docs.ts +34 -30
  158. package/src/templates/scaffold-guards.ts +73 -39
  159. package/src/templates/scaffold-repo.ts +4 -8
  160. package/src/templates/scaffold-site.ts +4 -1
  161. package/src/templates/scaffold-suites.ts +72 -0
  162. package/src/templates/scaffold-test-services.ts +35 -10
  163. package/src/templates/scaffold-verify-floor.ts +53 -31
  164. package/src/templates/shapes/api.ts +4 -0
  165. package/src/templates/slice-foundation.ts +3 -3
  166. package/src/unthrown-codes.ts +3 -1
  167. package/src/upgrade-bun-floor.ts +4 -0
  168. package/src/upgrade-clean-tree.ts +54 -0
  169. package/src/upgrade-gate-codemods-install.ts +40 -0
  170. package/src/upgrade-gate-codemods.ts +151 -0
  171. package/src/upgrade-gate.ts +44 -7
  172. package/src/upgrade-guards-baseline.ts +43 -0
  173. package/src/upgrade-guards.ts +37 -2
  174. package/src/upgrade-lock.ts +118 -0
  175. package/src/upgrade-plan.ts +2 -1
  176. package/src/upgrade-report-codemods.ts +54 -0
  177. package/src/upgrade-report.ts +55 -27
  178. package/src/upgrade-signals.ts +91 -0
  179. package/src/upgrade-unfinished.ts +61 -0
  180. package/src/verify-coverage-run.ts +42 -11
  181. package/src/verify-e2e.ts +115 -4
  182. package/src/verify-floor.ts +27 -0
  183. package/src/verify-guard-baseline.ts +109 -0
  184. package/src/verify-live.ts +72 -0
  185. package/src/verify-merge-skips.ts +51 -0
  186. package/src/verify-merge.ts +36 -2
  187. package/src/verify-run.ts +48 -7
  188. package/src/verify-services.ts +287 -0
  189. package/src/verify-skip-reason.ts +53 -0
  190. package/src/verify-strict.ts +108 -0
  191. package/src/verify-test-command.ts +129 -0
  192. package/src/verify-tests.ts +39 -126
  193. package/types/babel-modules.d.ts +2 -0
  194. package/wiki/CLI-Reference.md +200 -27
  195. package/wiki/Caching-And-Invalidation.md +1 -1
  196. package/wiki/Entities-And-Migrations.md +1 -1
  197. package/wiki/Interface-Rules.md +17 -8
  198. package/wiki/Jobs-And-Workflows.md +3 -3
  199. package/wiki/Known-Gaps.md +5 -1
  200. package/wiki/MCP-And-AI.md +1 -1
  201. package/wiki/Observability.md +1 -0
  202. package/wiki/PWA-And-Offline.md +1 -1
  203. package/wiki/Project-Layout.md +4 -4
  204. package/wiki/Troubleshooting.md +3 -3
  205. package/wiki/Tutorial-05-Deploy-Free.md +2 -2
  206. package/wiki/Upgrading.md +8 -0
@@ -32,7 +32,7 @@ x version # CLI version
32
32
  | `x dev` | all roles in one process: embedded services, sub-second reload, `/_x` mounted | shipped |
33
33
  | `x stop [--timeout 30s]` | stop this checkout's `x dev` (the pid its `.x/dev.lock` names, nothing else) and return once the next `x dev` can boot | shipped |
34
34
  | `x g <kind> <name>` | scaffold a primitive with its test | shipped |
35
- | `x db <sub>` | gen, migrate, reset, seed, studio, branch, backfill, diagnostics | shipped |
35
+ | `x db <sub>` | gen, migrate, reset, seed, branch, backfill, diagnostics | shipped |
36
36
  | `x verify [--only <step>[,<step>…] [--shard i/n [--timings f]] \| --changed [--base <ref>] [--dirty]] [--workers N] [--isolate]` · `x verify merge <part.json…>` · `x verify plan [--parts n]` | the gate — 21 steps, in this order: typecheck, lint, boundaries, filesize, package-shape, errors, unit, contract, live, job, exercise, e2e, eval, drift, contract-diff, budgets, seo, i18n, policy, manifest, roadmap. `--only <step>[,<step>…]` runs the named steps, in one process and in gate order, for an iteration loop and announces `NOT A GATE RUN` in the summary and in `--json` (`data.notAGateRun`, `data.only` — always a list), writing no floor file; an unknown name is refused with every valid name and the nearest match. **The gate is this command with no flag.** There is no `--skip` | shipped |
37
37
  | `x env [check\|example\|init]` | validate the process env against `envSchema`, regenerate `.env.example` from it, or write `.env.production` (`init --production`) | shipped |
38
38
  | `x secrets <sub>` | the committed encrypted secrets file: show, init, edit, set, rotate | shipped |
@@ -47,10 +47,10 @@ x version # CLI version
47
47
  | `x doctor` | environment, versions, drift, the newest migration's snapshot sidecar, ports, PWA prerequisites — each with a fix | shipped |
48
48
  | `x help` / `x version` | catalogue and version | shipped |
49
49
  | `x actions` / `x queries` / `x entities` | introspect the declaration registries | shipped |
50
- | `x jobs` | list, show, retry, cancel, remove and promote jobs; pause and resume a queue · `drain` is **planned** | shipped |
50
+ | `x jobs` | list, show, retry, cancel, remove and promote jobs; pause and resume a queue · `drain` was removed from the registry `As of 2026-11-15` ([Known gaps](Known-Gaps#open-by-decision)) | shipped |
51
51
  | `x tasks` | cron tasks, their timezone and their next run | shipped |
52
52
  | `x policy` | which clause decided a permission, and why | shipped |
53
- | `x exercise [<name>] [--seed n]` | run every action, query and job once on generated rows, with no test written; the gate's `exercise` step | shipped |
53
+ | `x exercise [<name>] [--seed n] [--shard i/n]` | run every action, query, job and route `load` once on generated rows, with no test written; the gate's `exercise` step | shipped |
54
54
  | `x drill [<name>] [--list] [--budget-ms n]` | the app's `web` and `worker` roles as real processes on real Postgres, Redis and NATS, each dependency faulted through a proxy or each role signalled, red on any framework contract that does not hold. Not a gate step: it needs the services | shipped |
55
55
  | `x i18n` | add, sync, check catalogs | shipped |
56
56
  | `x mail preview <id>` | render a mail's declared `preview` in every locale, nothing sent | shipped |
@@ -65,14 +65,15 @@ x version # CLI version
65
65
  | `x errors explain <CODE>` | code → cause, fix, docs | shipped |
66
66
  | `x docs "<question>"` | framework docs and this wiki, offline, from the install — the first lookup | shipped |
67
67
  | `x fix boundary <file>` | plan the minimal cut for an import that crossed a surface boundary (never rewrites) | shipped |
68
- | `x upgrade` | one major per run: exact pins, the Bun floor, `bun install`, the gate, the section to read | shipped |
69
- | `x token create\|list\|revoke` | MCP and API tokens in the app's `x_api_keys`: issue one with exact scopes (plaintext shown once), list an owner's, revoke one · `grant` is **planned** | shipped |
68
+ | `x upgrade` | one major per run: exact pins, the Bun floor, `bun install`, the release's codemods, the gate, the section to read · `x upgrade codemods` | shipped |
69
+ | `x token create\|list\|revoke` | MCP and API tokens in the app's `x_api_keys`: issue one with exact scopes (plaintext shown once), list an owner's, revoke one · `grant` was removed from the registry `As of 2026-11-15` ([Known gaps](Known-Gaps#open-by-decision)) | shipped |
70
70
  | `x config show [--section <key>]` | the resolved `app.config.ts`, defaults merged, credentials redacted | shipped |
71
- | `x logs tail [--lines n] [--role <role>]` | the last lines of `.x/dev.log` or `.x/logs/<role>.log` — the `logs.tail` MCP tool's file and reader | shipped |
72
- | `x cache graph\|bust <tag>\|clear` | the tag graph off the manifest (what each write evicts), a bust of one tag or every declared tag through the app's own tiers and bus · `stats` is **planned** | shipped |
71
+ | `x logs tail [--lines n] [--role <role>]` | the last lines of `.x/dev.log`, or one role's (its `.x/logs/<role>.log`, else its lines of the dev log) — the `logs.tail` MCP tool's reader | shipped |
72
+ | `x cache graph\|bust <tag>\|clear` | the tag graph off the manifest (what each write evicts), a bust of one tag or every declared tag through the app's own tiers and bus · `stats` was removed `As of 2026-11-15` ([Known gaps](Known-Gaps#not-built-yet)) | shipped |
73
73
  | `x explain <query> [--input <json>] [--org <id>]` | one declared query run once on the dev database, every statement it sent planned by the `exercise` step's oracle | shipped |
74
+ | `x profile <route> [--runs 20] [--top 10]` | a CPU profile of rendering one route in this process: the hottest functions, file and line | shipped |
74
75
  | `x branch` | copy-on-write branch environments | planned |
75
- | `x status` | connected-client build-ID distribution, role health | planned |
76
+ | `x status [--url <origin>] [--samples n]` | the build each live worker runs (`x_job_workers`), and the build, status and role each sampled origin's `/readyz` answers | shipped |
76
77
  | `x ai` | eval, cache stats, reindex | planned |
77
78
  | `x money add-currency` | extend the currency table | planned |
78
79
 
@@ -142,12 +143,14 @@ in the summary and `mcp` in `--json`; an app exporting several prints one line p
142
143
  `--json` lists them all in `mcpPaths`, endpoint #0 first.
143
144
 
144
145
  ```bash
145
- x dev [--port 3000] [--role web,worker] [--once] [--json]
146
+ x dev [--port 3000] [--host 0.0.0.0] [--tls] [--role web,worker] [--once] [--json]
146
147
  ```
147
148
 
148
149
  | Flag | Type | Default | Meaning |
149
150
  |---|---|---|---|
150
151
  | `--port` | string | `3000` | HTTP port. The `sync` role listens on `--port + 1` |
152
+ | `--host` | string | `localhost` | the interface every socket binds — web, `sync`, metrics: one decision. `localhost` or an IP literal (`0.0.0.0`, `::`, `192.168.1.5`, `[::1]`); a hostname or a typo is `X_CLI_BAD_FLAG`. `HOST` is not read here (the container's variable must not widen a dev shell). A wildcard is reported as `http://localhost:<port>`; `--json` carries `host` |
153
+ | `--tls` | boolean | `false` | the web listener serves https with a generated self-signed ECDSA certificate (no openssl, no dependency), cached in `.x/tls/` — `cert.pem`, `key.pem` (0600) — and regenerated when its names change or within 7 days of its 90-day end. It carries `localhost`, `127.0.0.1`, `::1` and a specific `--host` address. The summary prints the path; `--json` carries `tls.certPath` (`null` without the flag). Trust it once: `curl --cacert .x/tls/cert.pem`, or the OS keychain. No HSTS in dev — a browser pins it per host, every localhost port at once. The `sync` port and the metrics endpoint stay plaintext |
151
154
  | `--role` | string | `web,sync,worker,scheduler` | comma-separated roles to run in this process |
152
155
  | `--once` | boolean | `false` | boot, report, exit — for smoke tests and CI |
153
156
 
@@ -166,6 +169,13 @@ importing them IS the registration. What those modules registered is then served
166
169
  A module that will not import becomes a finding on the result rather than a dead process, so the
167
170
  dev loop stays reachable while something is broken.
168
171
 
172
+ **`/_x` stays loopback-only whatever `--host` binds, `As of 2026-11`:** a non-loopback `Host` is
173
+ `X_DEV_HOST_REFUSED` (421), and a non-loopback peer naming a loopback `Host` is
174
+ `X_DEV_PEER_REFUSED` (403) — the peer as the pipeline resolves it (`TRUSTED_PROXY_HOPS` honoured,
175
+ so a terminator in front forwards the real client's address). Bound to one specific non-loopback
176
+ address, nothing loopback listens: the summary prints `introspect none` and `--json`'s
177
+ `introspect` is `null`. Over `--tls` the same two checks hold.
178
+
169
179
  **What it watches is decided before a descriptor is taken, and the ignore set is your own
170
180
  `.gitignore`, `As of 2026-09-06`.** `x dev` walks the app root and opens one non-recursive watcher
171
181
  per directory it admits, skipping an ignored one at descent rather than filtering its events
@@ -317,6 +327,7 @@ Errors: `X_DEV_STOP_TIMEOUT`, `X_CLI_BAD_FLAG` (a `--timeout` that is not a posi
317
327
  ```bash
318
328
  x g resource|action|mutator|backfill|job|route|policy|entity|query|task <name> [--feature f]
319
329
  x g cron-job|purge|webhook-receiver <name> [--feature f] # a primitive factory's one call + tests
330
+ x g export-rows|import-rows <name> --feature f # the slice's table through storage + tests
320
331
  x g island <name> [--at <dir>] # a client component on an otherwise static page
321
332
  x g admin:page <name> --permission <perm> [--at <dir>] # a custom admin screen, guarded by construction
322
333
  x g guard <name> # a convention this app enforces, as a build error
@@ -345,7 +356,7 @@ The boot guard is generated, app-owned: `apps/web/runtime.ts` calls `assertSignI
345
356
 
346
357
  **`x g chart-dashboard`** (`As of 2026-11`) is the same backfill for the chart's Grafana dashboard: `docker/helm/dashboards/ultimate-app.json` (one column of panels over the series the framework declares — requests, latency by route, statements, pool, jobs, realtime, the process) and `templates/dashboard-configmap.yaml`, which ships it as a ConfigMap a Grafana sidecar provisions by label — plus the `dashboard:` block `values.yaml` lacks, `enabled: false` (`x new`'s chart writes the same three). The same rules as `chart-alerts`: only what is missing, `--force` rewrites, no `<name>`, `X_CHART_MISSING` with no chart. **`--print`** writes nothing and needs no chart: the dashboard JSON, to import into a Grafana outside Kubernetes (`--json`: `data.dashboard`).
347
358
 
348
- `x g guard <name>` writes `guards/<name>.ts` and its test. A name the framework ships a guard under — `raw-length`, `raw-breakpoint`, `raw-z-index`, `raw-shadow`, `raw-motion`, `undefined-style-class`, `undeclared-custom-property`, `repo-raw-sql` and every other name in `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) — writes THAT guard, which is how an app adopts one it does not hold; any other name writes the blank template. `x doctor` lists the shipped ones missing, and the held ones that differ from the current template ([Interface rules](Interface-Rules#stylesheets)).
359
+ `x g guard <name>` writes `guards/<name>.ts` and its test: the app's own convention, from the blank template. Every name in `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) already runs on `boundaries` from the installed framework; how one reports is a row in `guards/shipped.json` (`"error"`, `"warning"`, `"off"`). `x doctor` lists the copies of shipped guards an app still holds (`.data.guards.vendored`), and `x upgrade` migrates them ([Interface rules](Interface-Rules)).
349
360
 
350
361
  **`x g cron-job` · `x g purge` · `x g webhook-receiver`** (`As of 31.17.0`) scaffold a primitive *factory*'s one declaration — each a factory over `job()`, never a ninth primitive — with its tests, into the feature's slice, listed in `apps/web/api/index.ts`'s `jobs:`. None reads a table, so a slice with no `entity.ts` is fine.
351
362
 
@@ -355,7 +366,14 @@ The boot guard is generated, app-owned: `apps/web/runtime.ts` calls `assertSignI
355
366
  | `x g purge <name>` | `jobs/<name>.ts`, `<name>.job.test.ts`, `<name>.test.ts`, `tasks/<name>-hourly.ts` | `purge({ name, entities: 'declared' })` — the sweep for every `retain` the schema declares (`X_ENTITY_RETAIN_UNSWEPT` without one), fired on `DEFAULT_PURGE_CRON` |
356
367
  | `x g webhook-receiver <name>` | `jobs/<name>.ts`, `<name>.test.ts`, and the job's entry in `apps/web/exercise.ts` (a draw cannot sign an event, so `x exercise` queues a verified-shape one) | `webhookReceiver()` at `/hooks/<name>`: the exact bytes `verifyBodyHmac`-checked under `<NAME>_WEBHOOK_SECRET` (comma-separated, so a rotation keeps the old one live), the event read out of the signed body, queued, then acknowledged; an unreadable event is the app's own `X_<NAME>_UNREADABLE` |
357
368
 
358
- Every other factory, and why no generator writes it (`exportRows`, `importRows`, `rollup`, `webhook`, `llm`, `agentJob`, …): `FACTORY_GENERATORS` in `packages/cli/src/generate-factories.ts`, held complete against `PRIMITIVE_FACTORIES` by its test.
369
+ **`x g export-rows` · `x g import-rows`** (`As of 2026-11`) are the two factory generators that DO read a table: the slice's own scaffolded one (`db.<plural>`, `title`, `price`), read off its `entity.ts` like `x g backfill`. A `--feature` with no `entity.ts` is `X_FEATURE_REQUIRED`; one whose entity is shaped otherwise is `X_ROWS_SLICE_ENTITY`, fix a `x g job` to declare the call in by hand. Both write `jobs/<name>.ts`, `<name>.job.test.ts` and `<name>.test.ts` (the pass run in process against a memory disk), and read storage through `disk()` — `@ultimat3/storage`, in a new app's dependencies.
370
+
371
+ | Generator | What the declaration holds |
372
+ |---|---|
373
+ | `x g export-rows <name> --feature f` | `exportRows({ input: { orgId, exportId }, tenant: ({ orgId }) => orgId, source: db.<plural>.where({ orgId }), format: 'csv', columns, row, sink: () => disk() })` — one org's rows, Money as minor units + currency, dates as UTC instants, parts under `exports/<name>/<orgId>/<exportId>/` |
374
+ | `x g import-rows <name> --feature f` | `importRows({ input: { orgId, key }, tenant, source: () => disk(), schema, handle })` — the input refines `key` onto `imports/<name>/<orgId>/` (`key-in-own-org`, no `..`), so an import never reads another org's upload and the run's dedupe key is per org; `handle` is `upsertAll(…, { onConflict: ['id'], onMatch: 'nothing' })`, so a replayed page writes nothing twice and never another org's row; refused rows by line under `imports/<name>/<orgId>/errors` |
375
+
376
+ Every other factory, and why no generator writes it (`rollup`, `webhook`, `llm`, `agentJob`, …): `FACTORY_GENERATORS` in `packages/cli/src/generate-factories.ts`, held complete against `PRIMITIVE_FACTORIES` by its test.
359
377
 
360
378
  Alias: `x generate`.
361
379
 
@@ -450,6 +468,7 @@ lands in `apps/admin/app/admin/pages/` without `--at` — beside the declaration
450
468
  | `x g job` · `x g task` · `x g backfill` | `<name>.job.test.ts` | `job` |
451
469
  | `x g cron-job` · `x g purge` | `<name>.job.test.ts` **and** `<name>.test.ts` | `job`, `unit` |
452
470
  | `x g webhook-receiver` | `<name>.test.ts` | `unit` |
471
+ | `x g export-rows` · `x g import-rows` | `<name>.job.test.ts` **and** `<name>.test.ts` | `job`, `unit` |
453
472
  | `x g query` (not live) · `x g entity` · `x g policy` · `x g route` | `<name>.test.ts` | `unit` |
454
473
 
455
474
  `--force` writes the new name and does not touch a file under the old one, because the old name is not in its output list. Delete the orphan by hand.
@@ -459,7 +478,7 @@ The synopsis above is `GENERATORS` in `packages/cli/src/cmd-generate.ts`, which
459
478
  ## x db
460
479
 
461
480
  ```bash
462
- x db gen "add publish_at" | migrate | reset | studio
481
+ x db gen "add publish_at" | migrate | reset
463
482
  | seed [<name>] [--tier reference|dev] [--dry-run] [--json]
464
483
  | branch list | branch create <name> | branch delete <name>
465
484
  | backfill --list [--name n] [--status s] [--limit n] [--json]
@@ -474,7 +493,6 @@ x db gen "add publish_at" | migrate | reset | studio
474
493
  | `migrate` | apply pending migrations, verify the result, then rewrite the schema dump | literally `ROLE=migrate`'s own `runMigrations` — which ends by diffing the live schema against the ledger it just wrote, on the connection it already holds. A difference is `X_DB_DRIFT` and a non-zero exit. Then, `x db migrate` only: the dump is regenerated as `gen` does, and the database is reopened to report any trigger, function, view, type or sequence no migration creates (`unexpected-object`, also `X_DB_DRIFT`). `--json` carries the same `data.schemaDump` |
475
494
  | `reset` | delete the embedded data directory, then migrate | **embedded database only** — against an external Postgres it exits `X_NOT_IMPLEMENTED` and tells you to drop and recreate it yourself |
476
495
  | `seed [<name>]` | apply the app's seeds — every one this environment takes, or the one named | **replayable**: a second run writes nothing and raises nothing, on Postgres as well as in memory. One transaction per seed, so one bad fixture graph cannot roll back the seeds that already landed. `--dry-run` reports what each would write and writes nothing |
477
- | `studio` | — | **planned**: exits `X_NOT_IMPLEMENTED` pointing at the `/_x` db panel. It used to shell out to `bunx drizzle-kit studio`; one subcommand is not worth a second schema engine |
478
496
  | `branch list` | every **managed** branch of this database: name, location, created-at, size | managed means this framework made it — external, a database carrying `createBranch()`'s `comment on database` marker; embedded, a `pgdata-<name>` directory. A branch cloned by the pre-1.2.x `psql` shell-out carries no marker, so it is absent here and `delete` refuses it → [Known gaps](Known-Gaps). `size` reads `unknown` on the embedded database — measuring it is a full directory walk. The delete path only touches what this lists |
479
497
  | `branch create <name>` | `CREATE DATABASE … TEMPLATE` copy-on-write clone (PGlite: a copied data directory) | the isolation an agent should use before migrating. An existing name is `X_BRANCH_EXISTS`, never an overwrite |
480
498
  | `branch delete <name>` | delete that branch database (PGlite: its `pgdata-<name>` directory) | a name `list` does not show is refused with `X_DB_BRANCH_FAILED` naming what it *would* have touched — that is the whole guard, and it is why there is no `--force` |
@@ -612,7 +630,7 @@ pre-1.2.0 layout, and reading it as one would drop every table the pair exists t
612
630
 
613
631
  Errors, seed: `X_DECLARATION_UNKNOWN` (no seed of that name — the cause lists the ones there are), `X_CLI_BAD_FLAG` (an unknown `--tier`, one name declared twice, or a `dev` seed reached under `production` with no consent), and whatever the seed itself threw, reported per seed with the file it came from.
614
632
 
615
- Errors, schema: `X_DB_DRIFT`, `X_SCHEMA_DUMP_DRIFT`, `X_DB_GEN_FAILED`, `X_DB_MIGRATE_FAILED`, `X_DB_BRANCH_FAILED`, `X_MIGRATION_CONFLICT`, `X_MIGRATION_IRREVERSIBLE`, `X_MIGRATION_VIEW_DEPENDS`, `X_MIGRATE_CONCURRENT`, `X_NOT_IMPLEMENTED`. `X_DB_STUDIO_FAILED` is reserved and no longer thrown — `x db studio` is planned.
633
+ Errors, schema: `X_DB_DRIFT`, `X_SCHEMA_DUMP_DRIFT`, `X_DB_GEN_FAILED`, `X_DB_MIGRATE_FAILED`, `X_DB_BRANCH_FAILED`, `X_MIGRATION_CONFLICT`, `X_MIGRATION_IRREVERSIBLE`, `X_MIGRATION_VIEW_DEPENDS`, `X_MIGRATE_CONCURRENT`, `X_NOT_IMPLEMENTED`. `X_DB_STUDIO_FAILED` is reserved and no longer thrown — `studio` left `x db` `As of 2026-11-15` ([Known gaps](Known-Gaps#open-by-decision)).
616
634
 
617
635
  Errors, backfill: `X_BACKFILL_PENDING` (`--pending`, and the only one that is not a refusal — the sweep simply has not run), `X_BACKFILL_UNKNOWN`, `X_BACKFILL_ENVIRONMENT`, `X_BACKFILL_MIGRATION_PENDING`, `X_BACKFILL_APPLIED`, `X_BACKFILL_RUNNING`. All six are `@ultimat3/jobs`', carry a one-line runnable `fix:`, and are what a non-zero exit from these shapes means — full wording in [Error codes → Backfills](Error-Codes#backfills). `X_BACKFILL_STALLED` is the seventh and never reaches this command: it is raised by the pass, on a worker, so it surfaces through `x jobs show <id>`.
618
636
 
@@ -674,6 +692,9 @@ below on `--workers` and batching describe 22.6 and earlier where they differ.
674
692
  | `stepTimeoutMs` | `{ "<step>": milliseconds }` — a step's own deadline. Default 8 minutes for the six suites, 5 for every other step; past it the step is `X_VERIFY_STEP_TIMEOUT` and its processes are killed |
675
693
  | `exercise` | `{ "unprovenMax"?: <0–1>, "statementsMax"?: <whole ≥ 1> }` — what the `exercise` step's pass may leave unproven, and statements per call (`X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_STATEMENTS_OVER_BUDGET`); absent, each is a warning line → [`x exercise`](#x-exercise), `As of 31.16.0` |
676
694
  | `isolate` · `typecheckBin` · `agentsMdMaxBytes` | a fresh global per test file · the `tsc`-compatible binary · the `AGENTS.md` byte budget |
695
+ | `strict` | `true`: every one of the 21 steps runs a check or carries a `skip` why — an unexcused one is red, `X_VERIFY_STRICT_UNRUN`. Absent or `false`: a warning line and `data.unwaived` name the steps that ran none. `As of 2026-11-15`; the default flips to `true` on `next` |
696
+ | `skip` | `{ "<step>": "<why>" }` — the written reason a step runs no check in this repo: a step the gate runs, not one `steps` lists, a non-empty reason. A why over a step that ran is a warning on that step (`drop its entry`) |
697
+ | `guardBaseline` | `{ "<guard>": n }` — a `guards/<guard>.ts` may still report `n` findings: up to `n` they are notices on `boundaries`, above it red (`X_GUARD_OVER_BASELINE`), under it red too, naming the lower number (`X_GUARD_BASELINE_STALE`) — the baseline only falls. A baseline for a guard the app no longer has is stale; a report-only guard (`severity: 'warning'`) is never judged |
677
698
 
678
699
  Either render prints one line per finished step on **stderr** as each finishes — under `--json`
679
700
  `{"step":"lint","ok":true,"ms":21987}`, otherwise (`As of 31.22`) `✓ lint 22.0s`, `○ seo 0.0s` for a
@@ -703,6 +724,11 @@ every reader sees:
703
724
  `--json` carries the same fact twice: `steps[].skipped` per step, and `data.skipped` as the list of
704
725
  names beside `data.failed`. `all {n} steps passed` is printed only when nothing was skipped.
705
726
 
727
+ Every step that ran no check — a skip, a vanished suite, a strict refusal — is printed under the
728
+ table as `skipped: <step> — <reason>` (`no *.e2e.test.ts file in this tree`, `found 3 test(s) and
729
+ every one skipped itself`) and carried in `data.skipReasons` as `{ "<step>": "<reason>" }`,
730
+ `As of 2026-11-15`.
731
+
706
732
  `x.verify.json` ratchets those skips. Hand-written, committed at the repo root, read by the gate
707
733
  and written by nothing:
708
734
 
@@ -716,6 +742,23 @@ the two edits that resolve it. A repo with no such file is not ratcheted, and a
716
742
  not run is refused by the `manifest` step (`X_CONFIG_INVALID`) rather than silently covering
717
743
  nothing. Removing a line is allowed; it just has to be a diff somebody reviews.
718
744
 
745
+ **`live` starts its own test database, `As of 2026-11-15`.** When `x.verify.json` holds `live`
746
+ (or `--only` names it), the step runs the idempotent `docker compose -f
747
+ docker/docker-compose.test.yml up -d --wait --wait-timeout 120` — the stack `x new` wrote — and
748
+ hands that env file's values to the suites, for every key the shell left unset. It runs even when
749
+ `TEST_DATABASE_URL` already answers: a Postgres still starting is waited for, and Redis, NATS and S3
750
+ come up beside it. If `up` fails while the database answers our login (a concurrent run's container
751
+ conflict, say), only the keys whose service answers are handed over — a suite with no URL skips; one
752
+ with a dead URL would fail. A Postgres on that port that refuses this app's login is another app's
753
+ stack: `X_TEST_SERVICES_UNAVAILABLE`, and nothing is handed over. A `TEST_DATABASE_URL` that is not
754
+ the env file's is your own server, and is never probed or second-guessed. The stack is **left
755
+ running** (RAM only; the next run reuses it) and the step's warning says so, with the stop line,
756
+ `docker compose -f docker/docker-compose.test.yml down`. No Docker, or a start that fails with no
757
+ database answering: a warning carrying `X_TEST_SERVICES_UNAVAILABLE` and the start command as its
758
+ fix, and the suites run exactly as before — a floor whose every live test then skipped is still
759
+ `X_VERIFY_SUITE_VANISHED`.
760
+ `packages/cli/src/verify-live.ts` decides when; `verify-services.ts` probes and starts.
761
+
719
762
  `--workers` widens the test steps only. `unit`, `contract`, `job` and `eval` run as
720
763
  `bun test --parallel=N`, each worker with its own database; `live` and `e2e` are serial by
721
764
  declaration and say so in the output. **`x test live` and `x test e2e` obey the same declaration,
@@ -986,6 +1029,7 @@ health probe at once.
986
1029
  | `ROLE` | `web` | one of `web`, `sync`, `worker`, `scheduler`, `migrate`, `replicator`. **There is no `all`** |
987
1030
  | `PORT` | `3000` | empty or whitespace falls back to the default; anything else must be an integer in 0–65535 (`0` is legal — an ephemeral port) |
988
1031
  | `HOST` | `0.0.0.0` | the interface the `web` and `sync` roles bind, and the metrics endpoint with them — one decision. Empty or whitespace falls back to the default. `HOST=127.0.0.1` inside a container is **unreachable through `docker run -p`** — the proxy connects to the container's bridge address, never its loopback — and reachable only where the container shares the host's network namespace (`--network host`) or through a sidecar and `ssh -L` inside it. That is the exposure an app which admits one implicit actor without a login wants, and until 2026-09-07 such an app could not run in a container at all. `runRole({ …, hostname: '127.0.0.1' })` overrides the variable, the way `port` overrides `PORT`, for an app that must never trust the deployment to set it |
1032
+ | `TLS_CERT` / `TLS_KEY` | unset | paths of a PEM certificate and its PEM private key, read once at boot by the `web` role, whose listener then serves TLS (a direct TLS socket counts as https: HSTS goes out with no proxy header). Both or neither, `X_CONFIG_INVALID` otherwise: one alone or a path that reads nothing is refused before any service starts, a file that is not PEM of the right kind when the listener is built. Unset — the default — the ingress terminates TLS. `sync` and the metrics endpoint stay plaintext |
989
1033
 
990
1034
  | Failure | Code | Fix as printed |
991
1035
  |---|---|---|
@@ -1210,7 +1254,7 @@ whatever its bearer token was issued.
1210
1254
  | `db.migrate` | apply pending migrations to a **branch** database | `db:migrate` |
1211
1255
  | `tests.run` | `x test [--filter]` itself — the shell's files, batches and environment, so it agrees with `x test`; structured results — an error outside any test (`1 error` beside `0 fail`) or a non-zero exit is a failure, never `failed: 0` | `dev:test` |
1212
1256
  | `verify.run` | `x verify` itself, so it agrees with the shell; `only: [steps]` is `--only` (not a gate run); structured per-step result | `dev:test` |
1213
- | `logs.tail` | last N log lines, optionally for one role | `dev:logs` |
1257
+ | `logs.tail` | last N log lines, optionally for one role: its `.x/logs/<role>.log` when one was written, else the `.x/dev.log` lines whose `role` field names it (`As of 2026-11-15`; a line written outside any request or job names none) | `dev:logs` |
1214
1258
  | `requests.statements` | the running `x dev`'s per-request statement ledger: SQL count, repeated statements and N+1 verdicts per recent request, or one `requestId`; `limit` default 10, maximum 50. No `x dev` running: `X_NOT_IMPLEMENTED` naming it (`As of 31.22`) | `dev:logs` |
1215
1259
  | `graph.query` | `{ node }`: what a change to a file or primitive reaches (`x impact`); `{ from, to }`: the edges linking two nodes (`x graph --from --to`) | `dev:read` |
1216
1260
  | `ui.shot` | photograph one route at a named viewport, light or dark; PNG path plus verdict. Launches a browser | `dev:test` |
@@ -1231,7 +1275,7 @@ Never exposed in `ROLE=web`. Errors split by when they fire:
1231
1275
  | boot — configuring an MCP surface with `defineAppMcp` | `X_MCP_TOOL_UNDECLARED`, `X_MCP_TOOL_UNSAFE`, `X_MCP_TOOL_DUPLICATE` | the call throws; no server starts |
1232
1276
  | runtime — one request | `X_MCP_TOOL_UNKNOWN`, `X_INPUT_INVALID` (an `isError` result), `X_MCP_SCOPE_DENIED`, `X_MCP_QUERY_REJECTED`, `X_MCP_NOT_BRANCH_DB`, `X_MCP_PROTOCOL` | that call is refused; the server keeps serving |
1233
1277
 
1234
- A tool this caller may not see is absent from `tools/list` and answers ToolNotFound, never Forbidden. `x token grant <scope>` takes effect on the next connection — scopes are fixed for the life of one. Full model: [MCP and AI](MCP-And-AI).
1278
+ A tool this caller may not see is absent from `tools/list` and answers ToolNotFound, never Forbidden. A wider token — `x token create --scopes <a>,<b> --json`, then `x token revoke <old-id>` — takes effect on the next connection: scopes are fixed for the life of one. Full model: [MCP and AI](MCP-And-AI).
1235
1279
 
1236
1280
  ## x doctor
1237
1281
 
@@ -1350,7 +1394,6 @@ x jobs [list|show <id>|retry <id>|cancel <id>|delete <id>|promote <id>|resolve-s
1350
1394
  | `resolve-step <id> <step>` | answer a `once` step whose outcome is unknown (`X_STEP_OUTCOME_UNKNOWN`): `--ran --output '<json>'` records it `completed` — a replay returns that JSON, default `null` — and `--not-ran` records it `cleared`, so the next run calls it again. Exactly one of the two. Refused on a running job, or a step that did not start-and-not-complete (`X_STEP_NOT_RESOLVABLE`). Answers the job's trace; then `x jobs retry <id>` |
1351
1395
  | `pause <queue>` | no worker claims from the queue; enqueues still land. A row every worker's next claim reads, so it holds **fleet-wide within one poll interval**. Idempotent. Answers the paused list as the queue now holds it |
1352
1396
  | `resume <queue>` | undo it |
1353
- | `drain` | **planned**, `As of 25.0.0`: exits `X_NOT_IMPLEMENTED` before the queue boots and before a job is leased, pointing at `x jobs list --json`. Postgres is the one durable job driver, so there is nowhere to drain to. Its two former `--to` values, `redis` and `nats`, were `X_NOT_IMPLEMENTED` stubs on every method — a drain leased the whole pending batch for five minutes, failed every enqueue and nacked it back — and 25.0.0 deleted both stubs and the unreachable drain body. 25.0.0 also deleted the `--to` and `--dry-run` flags: the parser refuses them as unknown |
1354
1397
 
1355
1398
  `show`, `retry`, `cancel`, `delete` and `promote` each take **one id positional**, `resolve-step` an id and a step name; `pause` and `resume` take **one queue positional**. There is no bulk verb here — bulk is `requeueMany` / `removeMany` on `JobIntrospection`, which a dashboard calls. `--queue`, `--state`, `--name`, `--limit` and `--after` narrow `list` only. A bare `x jobs` is `list`. One verb each, no alias: `ls` and `rm` are `X_CLI_UNKNOWN_COMMAND` since 26.0.0.
1356
1399
 
@@ -1398,7 +1441,7 @@ Errors: `X_DECLARATION_UNKNOWN` (with the nearest name as its fix), `X_CLI_BAD_F
1398
1441
  ## x exercise
1399
1442
 
1400
1443
  ```bash
1401
- x exercise [<name>] [--seed n] [--json]
1444
+ x exercise [<name>] [--seed n] [--shard i/n] [--json]
1402
1445
  ```
1403
1446
 
1404
1447
  Every action, query and job the app registers, run **once** against generated rows, with no test
@@ -1471,6 +1514,61 @@ had no effect has vacuous proofs — a sweep of nothing is `flat`. One warning l
1471
1514
  five, `X_EXERCISE_EMPTY_REACH … — fix: edit exercise.ts: give each an input that reaches its work, or
1472
1515
  { off: '<why>' }`. A warning, not red, on a whole-pass run only.
1473
1516
 
1517
+ **Route entries** (`As of 2026-11-15`). What a page needs that a seeded id and a role cannot give it
1518
+ is `defineExercise`'s second argument, keyed by the URL pattern `x routes` prints:
1519
+
1520
+ ```ts
1521
+ import type { Actor } from '@ultimat3/core';
1522
+ import { defineExercise } from '@ultimat3/testing';
1523
+
1524
+ declare const author: Actor; // a signed-in actor the policy allows
1525
+ declare function asMember(seated: Actor | null): Promise<Actor | null>;
1526
+ declare function ownThread(): Promise<{ id: string }>;
1527
+ declare function consentQuery(): Promise<string>;
1528
+
1529
+ export const exercise = defineExercise(
1530
+ { publishPost: { actor: author } },
1531
+ {
1532
+ routes: {
1533
+ '/posts/board': { actor: asMember }, // (seated) => the actor the authenticator resolves: its facts
1534
+ '/messages/:id': { params: ownThread }, // computed in the load's own request, as its actor
1535
+ '/oauth/consent': { search: consentQuery }, // the query string a load reads off `url`
1536
+ '/about': { empty: 'renders a static page: no row' },
1537
+ '/admin': { off: 'measured by its own e2e test' },
1538
+ },
1539
+ },
1540
+ );
1541
+ ```
1542
+
1543
+ `params`, `search` and an `actor` function run inside the load's request before the observed call,
1544
+ so their statements are never the load's; a function that throws leaves the load `unreached` with
1545
+ `its exercise.ts <field> threw`. `statements: { max, why }` moves its ceiling. A blank `off`, `empty`
1546
+ or `why` is `X_CONTRACT_EXERCISE_UNDECLARED`; a pattern no route with a `load` has is
1547
+ `X_DECLARATION_UNKNOWN` before a row is written. A load that reads the app's own typed client
1548
+ (`queries.orgPosts(…)` over `APP_URL`) is answered **in process** by the app's API, as the actor the
1549
+ load runs as — `APP_URL` is set to `http://localhost:3000` when the env names none — so its
1550
+ statements are counted and swept like the page's own. A route load reached with no statement and no
1551
+ effect is its own `· X_EXERCISE_EMPTY_REACH` line, its fix the `empty` entry to paste; a primitive's
1552
+ entry takes `empty: '<why>'` too, and a record whose entry gives one carries it as `empty`.
1553
+
1554
+ **Push is an effect** (`As of 2026-11-15`). Every actor holds one stand-in Web Push device in the
1555
+ pass, as the memory mail driver accepts every address, so a notifier's `webPush()` encrypts, signs
1556
+ and sends to the captured push service, and the record carries `{ kind: 'push', host, count }`. A
1557
+ pusher that sends nothing leaves no effect: its job is an empty reach, not a delivered push.
1558
+
1559
+ **A storage write is an effect** (`As of 2026-11-15`). An object the call puts, copies or deletes
1560
+ through a `defineStorage` disk is `{ kind: 'storage', disk, op, count }` on its record, so an upload
1561
+ or export that stores only an object is no empty reach. A read is none, nor is a write the driver
1562
+ refused. A multipart session (`grantMultipart`, `abortUpload`) is not counted yet: its calls are not
1563
+ on the event bus.
1564
+
1565
+ **`--shard i/n`** (`As of 2026-11-15`) runs the i-th of n disjoint slices of the pass — primitives,
1566
+ then routes, by their position in the registry — on its own scratch database, and writes
1567
+ `.x/exercise.<i>-of-<n>.json` (never `.x/exercise.json`). Run the n slices as n processes. Each
1568
+ slice's findings are its own; the static findings and the subject proof are slice 1's; the whole-pass
1569
+ floor (`unprovenMax`, its warning line) is judged only unsharded. Beside a `<name>`, or not i/n,
1570
+ `X_VERIFY_SHARD_INVALID`, fix `x exercise --shard 1/2 --json`.
1571
+
1474
1572
  Errors: `X_CONTRACT_EXERCISE_UNREACHED`, `X_CONTRACT_EXERCISE_UNDECLARED`, `X_DECLARATION_UNKNOWN`, `X_CLI_BAD_FLAG`, `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_EXERCISE_SEED_FAILED`, `X_STATEMENTS_OVER_BUDGET`; warning lines only: `X_EXERCISE_EMPTY_REACH`.
1475
1573
 
1476
1574
  ## x drill
@@ -1624,6 +1722,7 @@ Every test leftover the framework knows of, cleared (`As of 27.3.0`): the migrat
1624
1722
 
1625
1723
  ```bash
1626
1724
  x upgrade [--to <version>] [--dry-run] [--json]
1725
+ x upgrade codemods --from <version> [--to <version>] [--dry-run] [--json]
1627
1726
  ```
1628
1727
 
1629
1728
  One major per run, so each hop's gate attributes its red to that hop. `As of 30.0.0`.
@@ -1637,9 +1736,9 @@ One major per run, so each hop's gate attributes its red to that hop. `As of 30.
1637
1736
  | 3 | `bun pm view @ultimat3/cli versions`: the next major's newest; the last major's newest when no later major exists | `X_UPGRADE_REGISTRY_UNREACHABLE`, `X_UPGRADE_HOP_TOO_WIDE`, `X_UPGRADE_VERSION_UNPUBLISHED`, `X_BUN_VERSION` |
1638
1737
  | 4 | write exact pins, raise the Bun floor | — |
1639
1738
  | 5 | `bun install` | `X_UPGRADE_INSTALL_FAILED`, `fix:` carries the undo |
1640
- | 6 | the installed CLI: `x manifest`, `x doctor --json`, each missing guard (`x g guard <name>`, kept only when `x verify --only boundaries` finds nothing more), a Bun-floor hop's `x verify --only unit` coverage rebaseline, `x exercise --json` and its `exercise` floor figures, `x verify --json` | `X_UPGRADE_GATE_UNREADABLE`, as a finding on a red hop |
1739
+ | 6 | the installed CLI: `x upgrade codemods --from <from> --to <to>` (below), then `x manifest`, `x doctor --json`, each missing guard (`x g guard <name>`, kept only when `x verify --only boundaries` finds nothing more), a Bun-floor hop's `x verify --only unit` coverage rebaseline, `x exercise --json` and its `exercise` floor figures, `x verify --json` | `X_UPGRADE_GATE_UNREADABLE`, as a finding on a red hop |
1641
1740
 
1642
- A dry run refuses exactly what the real run would, then stops before step 4. It never commits; `git diff` is the hop. Under `--json` fd 1 is one document, fd 2 a `{"upgrade":"<stage>"}` line per stage and a heartbeat a minute.
1741
+ A dry run refuses exactly what the real run would, then stops before step 4 — after previewing this CLI's codemods for the span, written nowhere. It never commits; `git diff` is the hop. Under `--json` fd 1 is one document, fd 2 a `{"upgrade":"<stage>"}` line per stage and a heartbeat a minute.
1643
1742
 
1644
1743
  `--to`: an exact release in the next major. Over a mixed set a run moves the LOWEST pins one major: `^19` beside `^29` is told `--to 20.x.y`, that hop rewrites only the pins at or below it (a pin above is never moved backwards) and names its walkthrough, `next` names the following hop, and the last one levels the set. A straggler jump straight to the highest major is `X_UPGRADE_HOP_TOO_WIDE`: it skipped every walkthrough between.
1645
1744
 
@@ -1656,13 +1755,26 @@ A dry run refuses exactly what the real run would, then stops before step 4. It
1656
1755
  | `bun` | `{ from, to, edited[], manual[] }`. `manual[]`: `{ path, line, text, why }`, a site only you can move, listed on every run |
1657
1756
  | `agentsMd` | `link`: `AGENTS.md` was byte-identical to `CLAUDE.md` and the hop makes it a relative symlink to it · `linked`: already one · `differs`: two different files, left alone; merge what only `AGENTS.md` says into `CLAUDE.md`, then `ln -sf CLAUDE.md AGENTS.md` · `none`: one of the two is missing · `null`: no hop planned |
1658
1757
  | `guards` | `{ reported, missing[], differs[], installed[], withheld[] }` from the hop's own `x doctor`. `As of 31.16.0` each missing shipped guard is written from the installed release's template and kept when `boundaries` finds nothing more with it on disk: `installed[]` names it. One the tree already breaks is taken back out: `withheld[]` is `{ name, add, findings }` (`findings: null` when the count could not be measured) and `missing[]` still lists it. `differs[]` — the app's edit or an older copy — is never overwritten: `x g guard <name> --force` is yours. `reported: false` is a CLI too old to list them, which is not the same as none |
1758
+ | `guards.baselined` | `[{ name, findings }]`, absent when empty, `As of 2026-11-15`: a guard the tree breaks, kept anyway — its measured count merged into `x.verify.json` as `"guardBaseline": { "<name>": n }` (beside the app's keys; a baseline the app already wrote for it, or a floor that is not a JSON object, is never touched) and kept only when the installed CLI's `boundaries` then finds no more than before. Also in `installed[]`. `findings: null` stays withheld |
1659
1759
  | `coverage` | a hop that moved the Bun floor re-measures unit coverage (`x verify --only unit`); only when that measurement is `X_COVERAGE_BELOW_FLOOR` is the `x.verify.json` `coverage` floor moved to it, the number that fell alone, with a dated `why`: `{ file, measured, from, to, why }`. `null` when nothing moved |
1660
1760
  | `exerciseFloor` | `{ file, written }`: the `exercise` keys (`unprovenMax`, `statementsMax` ≥ 100) the hop's own `x exercise` measured, written into an `x.verify.json` that stated none, so the hop stays green and the floor only falls. A key the app already wrote is never touched; `null` when nothing was written |
1661
1761
  | `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
1662
1762
  | `exercise` | `{ reported, ok, findings[] }` from the hop's own `x exercise --json`, listed (and printed) before the gate's findings; each `fix` pastes as written. `reported: false`: the hop's CLI answered no exercise document — unknown, never a finding |
1663
1763
  | `verify` | `{ ok, summary, failed[], findings[] }`, each finding `{ step?, code, cause, fix, at? }` |
1764
+ | `codemods` | `As of 2026-11-15`: `{ from, to, dryRun, source, applied[] }`, each `applied[]` a codemod that ran: `{ id, since, summary, changed[], skipped[] }`; a `skipped[]` entry is `{ path, reason, diff? }`, a file the codemod would not overwrite (the app edited it), with the template's change as a unified diff to make by hand. `source: installed` — the hop's own CLI applied its list; `driver` — that CLI predates codemods, so this one applied its own. `reinstalled: true` — a `package.json` differs after the codemods (read byte for byte, never off a codemod's report), so the hop ran `bun install` again before any gate stage; `x upgrade codemods` does the same by hand. `failure: { code, cause, fix }` — the installed CLI's codemods run failed for a reason other than lacking the subcommand: nothing applied, this CLI does not stand in, and the hop is not done. An app already at its target reruns every codemod up to the release it is on (`from: 0.0.0`): each is idempotent, so a done one changes nothing and an app still holding an old template's copy is carried across. `null`: no app |
1765
+ | `superseded[]` | `As of 2026-11-15`: a workaround the hop's framework made unnecessary, read after the codemods — `{ code: X_SUPERSEDED_WORKAROUND, cause, fix, at }`. A warning, never the verdict |
1664
1766
  | `then` | the next thing to do, in a sentence naming the commands |
1665
1767
 
1768
+ **Codemods.** A file `x new` wrote is the app's; when a release changes the template, a codemod (`packages/cli/src/codemods/<id>.ts`, `since` = the release whose template change it carries) moves the app's copy. The hop runs every codemod whose `since` lies after `from` and at or before `to`, in version then id order, before any gate stage, and leaves the edits uncommitted beside the pins. Mechanical or nothing: a file the app edited is listed in `skipped[]` with its diff and never overwritten. `x upgrade codemods --from <version>` runs the same list by hand — for a hop an older CLI drove, which applied none:
1769
+
1770
+ | Flag | Type | Default | Meaning |
1771
+ |---|---|---|---|
1772
+ | `--from` | string | required | the release the app came from (its old `@ultimat3/cli` pin); `X_CLI_BAD_FLAG` when absent or not `major.minor.patch` |
1773
+ | `--to` | string | this CLI's version | the last release whose codemods run |
1774
+ | `--dry-run` | boolean | off | report what would change; write nothing |
1775
+
1776
+ `data.codemods` is the same shape as the hop's, without `source`. A second run changes nothing.
1777
+
1666
1778
  `null` for `guards`, `manifest`, `exercise` and `verify` means no gate ran: a dry run, already there, or no app.
1667
1779
 
1668
1780
  **Pins and no `app.config.ts`.** Needs no app: the root is the app at or above the cwd, else the nearest manifest holding `@ultimat3/*` pins, or the workspace root claiming it. No such manifest is `X_UPGRADE_PIN_UNREADABLE`; an app below that root is `X_NOT_IN_APP`, with the `cd`. With no app, `x manifest`, `x doctor` and `x verify` cannot run, so the hop runs the `typecheck` and `test` scripts the root declares: `data.scripts[]` is `{ name, ok, code, output }`, `proof` is `scripts`, and the summary says no `x verify` ran. Neither script declared: `proof: none`, `done: false`, red. It checked nothing, so it never claims otherwise.
@@ -1932,6 +2044,7 @@ command rather than quoting the line. `docs` is `ERROR_DOCS_URL`, the same URL f
1932
2044
  x repro <jobId|requestId|traceId|fingerprint> [--write] [--verify] [--json]
1933
2045
  x repro --list [--code X_…] [--json]
1934
2046
  x repro --from <file> [--write] [--verify] [--json]
2047
+ x repro <id> --bundle [--include-rows] [--json] | x repro --from <file> --bundle [--include-rows] [--json]
1935
2048
  ```
1936
2049
 
1937
2050
  A production failure becomes a failing test. `As of 2026-11`.
@@ -1948,6 +2061,40 @@ green. Masked input (`.sensitive()`, secret-named keys) and masked columns are s
1948
2061
  the schema. `--list` reads the bundles with each group's count and last sighting. An id nothing
1949
2062
  holds is `X_REPRO_UNKNOWN`; a request id with capture off is `X_REPRO_CAPTURE_OFF`.
1950
2063
 
2064
+ **`--bundle` carries the failure to an issue** (`As of 2026-11`): one JSON file,
2065
+ `repro/bundle-<id>.json` (the scaffold's `.gitignore` keeps it out of a commit), deterministic
2066
+ bytes, meant to be read before it is attached — its `readFirst` lines say what is in it and what
2067
+ is not found. Never with `--write`/`--verify`; `--include-rows` without `--bundle` is refused
2068
+ (`X_CLI_BAD_FLAG`).
2069
+
2070
+ | Section | Holds |
2071
+ |---|---|
2072
+ | `framework` | every installed `@ultimat3/*` package and the versions found of it, the CLI's, Bun's, the platform |
2073
+ | `error` | the code, the cause, the stack's `at …` frames — from the job row, a `--from` file's `error`, or the error group's sample only when that sample is this request's own |
2074
+ | `schema.entities` | the declarations of the entities whose rows the call read — never the whole app |
2075
+ | `subject` | the failure, as `x repro --from` reads it back. Always: input masked by the primitive's `.sensitive()` schema and core's `captureValue`, rows minus sealed columns, a row of an undeclared entity dropped (`dropped`, `truncated: true`). By default also: every value that is not a key — input leaves, row columns other than the primary key, a declared reference or an `…Id`, step outputs — is `[redacted]` (a step's number `0`), listed as masked so the replay stands it in from the schema; the actor's org is a placeholder uuid everywhere it appears |
2076
+ | `masked` / `scrubbed` | the masked paths; the env var NAMES whose values were found, the count of hostnames |
2077
+ | `reproducer` | the test, rendered from `subject` alone, against the scaffold's `apps/web/api` and the `@app/db` placeholder |
2078
+
2079
+ | Flag | Does |
2080
+ |---|---|
2081
+ | `--include-rows` | real values for those non-key fields, and the real org — read them before sending. Secrets, `.sensitive()` fields and sealed columns stay masked |
2082
+
2083
+ Replaced everywhere (never in the primitive's name, the code or the reproducer's imports): the app
2084
+ root (`.`), the home directory (`~`), an env value that is secret-named, a URL or from the app's
2085
+ `.env*` files (`[env:NAME]`; 6+ characters, any length under a secret name) — and an env URL's
2086
+ user and password raw, URL-decoded and base64 (a Basic header) —, every hostname in
2087
+ `app.config.ts` or an env URL (`[host]`), any URL's userinfo (`[cred]@`) and query values
2088
+ (`?k=[redacted]`), emails (`[email]`), IPv4/IPv6 addresses (`[ip]`); in a cause or frame, any other
2089
+ absolute file path (`<abs>/<file>`). **Not found**: a value this machine never knew — a
2090
+ production-only secret, a customer's name in a cause.
2091
+
2092
+ **A bundle is untrusted input.** `bunx create-ultimate repro <bundle.json>` reads only its
2093
+ `subject`, checked field by field (`X_REPRO_BUNDLE_INVALID` otherwise, control characters
2094
+ included), and renders the test from it; the bundle's own `reproducer` text never reaches disk.
2095
+ It opens into a scratch app (`repro-<id>/`), the test under `repro/`, linked to the framework
2096
+ checkout the command runs in (or `--framework <checkout>`) through `file:` overrides.
2097
+
1951
2098
  ## x docs
1952
2099
 
1953
2100
  ```bash
@@ -1989,17 +2136,28 @@ For each violation involving the file it reports the offending edge, the full ch
1989
2136
  | `create --scopes <a,b> [--user <id>] [--org <id>] [--env dev\|stage\|prod] [--days n]` | issues one key carrying exactly those scopes (a wildcard is `X_CONFIG_INVALID`). `--env` unsaid is the environment's label: `ULTIMATE_ENV` (else `NODE_ENV`) production → `prod`, staging → `stage`, else `dev`; an unreadable `ULTIMATE_ENV` reads as `prod`. `--user` cuts its scopes to what that user may do and stops it when the user is disabled. The plaintext is printed **once** — in the human lines, or `data.token` under `--json` — and never in the summary; only its SHA-256 is stored |
1990
2137
  | `list --owner <id>` | the keys of a user or org, as `describeApiKey` answers them: no hash, no secret. A key issued with neither is listed by nobody and revoked by its id |
1991
2138
  | `revoke <id>` | revokes it; an unknown or already-revoked id answers `revoked: false`, exit 0 — neither is a key that works |
1992
- | `grant` | **planned**: a key's scopes are fixed when issued. Issue a wider one and revoke the old |
1993
2139
 
1994
2140
  Every flag is read before the database opens: a refusal costs no boot.
1995
2141
 
2142
+ ## x status
2143
+
2144
+ `As of 2026-11-15`. `x status [--url <origin>[,<origin>…]] [--samples n] [--json]` — what the running deployment is, from what it already records. A read, exit 0 whatever it finds: whether one build is fully out is [`x deploy verify`](#x-deploy-verify)'s question.
2145
+
2146
+ | Half | Read from | `--json` |
2147
+ |---|---|---|
2148
+ | workers | every live row of `x_job_workers`, through the queue `x jobs list` opens (`DATABASE_URL`, else the embedded database) | `data.workers`: `count`, `draining`, `byBuild` (a row from before the build column is `unknown`), `rows[]` |
2149
+ | origins | `--url`: `--samples` (default 5, 1–50) `GET /readyz` per origin, each on its own connection, so a load balancer chooses again | `data.origins[]`: `origin`, `samples`, `byBuild` (`x-ultimate-build`), `byStatus` (`unreachable` when nothing answered), `unstamped` (a 2xx with no build), `roles` (named by a role's health port) |
2150
+ | unrecorded | — | `data.unrecorded`: `web`, `sync`, `scheduler`, `replicator` — no fleet-wide record holds their build; name each one's health origin in `--url` ([Known gaps](Known-Gaps#not-built-yet)) |
2151
+
2152
+ `--url` takes bare http(s) origins only — a path, query or credentials is `X_CLI_BAD_FLAG`, as is a `--samples` outside 1–50. Both are refused before any request or connection.
2153
+
1996
2154
  ## x config
1997
2155
 
1998
2156
  `As of 2026-11`. `x config show [--section <key>]` — `app.config.ts` as the boot reads it: through `loadAppConfig` and core's `defineConfig`, every default merged. A credential-named key (the logger's own rule, `isRedactedKey`), a `secret()` value and the password in a URL's userinfo print as `[redacted]`. `--section` takes a top-level key the resolved record owns; any other is `X_CLI_BAD_FLAG` listing them.
1999
2157
 
2000
2158
  ## x logs
2001
2159
 
2002
- `As of 2026-11`. `x logs tail [--lines n] [--role <role>]` — the last `n` lines (default 100, at most 10,000) of `.x/dev.log`, which `x dev` tees, or of `.x/logs/<role>.log`. The same file, path rule and end-first reader as the `logs.tail` MCP tool. A `--role` that is not a runtime role is `X_CLI_BAD_FLAG` before any path is built; no log yet exits `X_NOT_IMPLEMENTED` with `x dev` as the fix.
2160
+ `As of 2026-11`. `x logs tail [--lines n] [--role <role>]` — the last `n` lines (default 100, at most 10,000) of `.x/dev.log`, which `x dev` tees; with `--role`, that role's `.x/logs/<role>.log` when one was written, else the dev log's lines whose `role` field names it (`As of 2026-11-15`). The `logs.tail` MCP tool's reader (`mcp-host-logs.ts`), so both answer the same lines. A `--role` that is not a runtime role is `X_CLI_BAD_FLAG` before any path is built; no dev log yet is `X_DEV_LOG_ABSENT`, fix `x dev`.
2003
2161
 
2004
2162
  ## x cache
2005
2163
 
@@ -2010,28 +2168,43 @@ Every flag is read before the database opens: a refusal costs no boot.
2010
2168
  | `graph` (default) | per tag: the actions whose `invalidates` name it, the queries cached under it and the routes revalidated by it, read off the manifest. `data.neverEvicted` lists the tags something reads and no action invalidates — fresh only until their TTL |
2011
2169
  | `bust <tag>` | boots the app's declared tiers and bus as a role does (`startServices`), then `invalidateTags`: shared tiers dropped, the edge purged, every replica told. With an in-process bus (no `NATS_URL`, no `REDIS_URL`) the summary says no running server heard it. A tier that failed is `X_CACHE_DRIVER_UNAVAILABLE`, exit 1; an undeclared tag is `X_CACHE_TAG_UNKNOWN` |
2012
2170
  | `clear` | the same bust over every declared tag. An entry cached under no tag waits for its TTL |
2013
- | `stats` | **planned**: hit rates live in the serving processes — the `/_x` cache panel reads them there |
2014
2171
 
2015
2172
  ## x explain
2016
2173
 
2017
2174
  `As of 2026-11`. `x explain <query> [--input '<json>'] [--org <id>]` — the query run once on the app's dev database (rows discarded; its policy is not asked, as `explainQuery`'s is not), every statement it **sent** captured off `db.statement` and planned by `sweepPlans`: the oracle the `exercise` step judges with. A read no declared index serves is `X_QUERY_UNINDEXED` / `X_QUERY_SORT_UNSERVED` with the `indexes:` entry as its fix, exit 1. A query over a tenant-scoped entity needs `--org`, else `X_CLI_BAD_FLAG`. Tables the dev database lacks are listed as not planned — run `x db migrate` first. An external `DATABASE_URL` where `ULTIMATE_ENV` (else `NODE_ENV`) resolves production — or `ULTIMATE_ENV` is unreadable — is refused before anything opens, `X_EXPLAIN_PRODUCTION_DATABASE`: the query would be sent for real with its policy skipped. Plan on the embedded database, or on a staging restore under `ULTIMATE_ENV=staging`.
2018
2175
 
2176
+ ## x profile
2177
+
2178
+ `As of 2026-11`. `x profile <route> [--runs 20] [--top 10] [--json]` — the app booted in this
2179
+ process (`x dev`'s boot, web role, an ephemeral port, the same `.x/dev.lock` claim — so a running
2180
+ `x dev` on the checkout is `X_DEV_ALREADY_RUNNING`), the route requested once to warm it, then
2181
+ `--runs` more through the pipeline's in-process dispatch under JavaScriptCore's sampling profiler
2182
+ (`bun:jsc`, 100 µs). Reports the `--top` hottest functions by self samples:
2183
+
2184
+ | `--json` field | Meaning |
2185
+ |---|---|
2186
+ | `route`, `status`, `runs` | what was rendered, the warm-up's status, how many requests were sampled |
2187
+ | `samples`, `intervalMicros` | samples taken and the sampling interval |
2188
+ | `hottest[]` | `{ name, file, line, self, total, selfPercent }` — `file` root-relative for the app's own, `native` for a frame with no source; `total` counts samples with the function anywhere on the stack |
2189
+
2190
+ A route answering `>= 400` is profiled and reported red, `X_PROFILE_ROUTE_FAILED` (fix: `x routes
2191
+ --json`). An absolute URL, a missing route or a `--runs` outside 1–10000 is `X_CLI_BAD_FLAG`.
2192
+
2019
2193
  ## Planned commands
2020
2194
 
2021
2195
  Specified in the design docs, not yet implemented. Every one is in the command registry: calling it exits `X_NOT_IMPLEMENTED` with a `fix:` naming the closest shipped command, because "not built yet" and "not a command" are different facts and only one of them is true.
2022
2196
 
2023
- The table is `PLANNED_COMMANDS` in `packages/cli/src/cmd-planned.ts`; `cmd-planned.test.ts` asserts every row is reachable through the parser and that no `fix` points at another planned command. `PLANNED_SUBCOMMANDS` in the same file is the one-level-down version — a subcommand of a shipped command that this build does not implement: `x db studio`, `x jobs drain`, `x token grant` and `x cache stats`. Each stays in its command's subcommand list, so the parser reaches it and `x help <command>` lists it.
2197
+ The table is `PLANNED_COMMANDS` in `packages/cli/src/cmd-planned.ts`; `cmd-planned.test.ts` asserts every row is reachable through the parser and that no `fix` points at another planned command. `PLANNED_SUBCOMMANDS` in the same file is the one-level-down version — a subcommand of a shipped command that this build does not implement — and is empty `As of 2026-11-15`: `x db`'s `studio`, `x jobs`'s `drain`, `x token`'s `grant` and `x cache`'s `stats` left the registry, each with its reason in [Known gaps](Known-Gaps), and the parser now refuses each with `X_CLI_UNKNOWN_COMMAND` — exit 1, as `X_NOT_IMPLEMENTED` was.
2024
2198
 
2025
2199
  | Command | Purpose | `fix:` today |
2026
2200
  |---|---|---|
2027
2201
  | `x branch [<name>\|delete <name>]` | copy-on-write database + preview URL + scoped MCP socket | `x db branch list --json` — the database half: `list`, `create <name>`, `delete <name>` |
2028
- | `x status` | role health and the build-ID distribution of connected clients | `x doctor --json` |
2029
2202
  | `x ai [eval <name>\|cache\|reindex]` | eval scores, cache hit rate and tokens saved, vector reindex | `x test eval --json` |
2030
2203
  | `x money add-currency <ISO> --exponent <n>` | extend the currency table | `x errors explain X_CURRENCY_UNKNOWN --json` — extend it in code: `registerCurrency({ code, exponent, name })` from `@ultimat3/money`, once at boot. Shipped `As of 2026-08`, and it is what this command promised |
2031
2204
 
2032
- **Flags reach the same answer**, `As of 2026-10`: `x money add-currency USD --exponent 2` and `x status --follow --json` exit `X_NOT_IMPLEMENTED` with the row's `fix:`, as the bare form does.
2205
+ **Flags reach the same answer**, `As of 2026-10`: `x money add-currency USD --exponent 2` and `x branch --follow --json` exit `X_NOT_IMPLEMENTED` with the row's `fix:`, as the bare form does.
2033
2206
 
2034
- `x token`, `x config`, `x logs` and `x cache` left this table `As of 2026-11` (plan 101-full-stack-efficiency-sweeps U5); each has its section above.
2207
+ `x token`, `x config`, `x logs` and `x cache` left this table `As of 2026-11` (plan 101-full-stack-efficiency-sweeps U5), `x status` `As of 2026-11-15`; each has its section above.
2035
2208
 
2036
2209
  ## Names that moved
2037
2210
 
@@ -239,7 +239,7 @@ Ships since **31.17.0** (`graph`, `bust`, `clear`); `stats` is still **planned**
239
239
  | `x cache graph --tag post --json` | the blast radius of one tag |
240
240
  | `x cache bust <tag> --json` | the real fanout for one tag — the app's own tiers booted as a role boots them, then `invalidateTags`: shared tiers dropped, the edge purged, the bus told — and the invalidation report |
241
241
  | `x cache clear --json` | the same bust over every tag the app's modules declare |
242
- | `x cache stats` | **planned** — hit rates live in the serving processes; `x dev` then the `/_x` cache panel |
242
+ | hit rates | not a command: `stats` left `x cache` `As of 2026-11-15` — each serving process emits `cache.hit` / `cache.miss` on its own bus and nothing aggregates them ([Known gaps](Known-Gaps#not-built-yet)) |
243
243
 
244
244
  From code: `invalidateTags([...])` from `@ultimat3/cache`, the call `x cache bust` makes.
245
245
 
@@ -1357,7 +1357,7 @@ of 2026-11:
1357
1357
  | Generate | `x db gen "add publish_at"` | diffs entities vs migrations, writes a named, ordered migration + its `down` |
1358
1358
  | Apply (dev) | `x db migrate` | runs pending migrations against the dev DB; live queries resubscribe |
1359
1359
  | Check | `x db migrate --json` | the live schema against the ledger it just wrote; exits non-zero on a difference |
1360
- | Inspect | `x db studio` | tables, columns, indexes, FKs, generated SQL — also the `/_x` **Schema** panel |
1360
+ | Inspect | `x dev`, then the `/_x` **Schema** panel | tables, columns, indexes, FKs, generated SQL |
1361
1361
  | Pre-deploy | `ROLE=migrate` container | run-once hook, same image; waits on the session-pinned migration lock while another version's migration is in flight, then applies. The wait is bounded at 60s (`As of 2026-08`) — past that it exits non-zero with `X_MIGRATE_CONCURRENT` instead of hanging the rollout |
1362
1362
  | Test template | automatic | migrate + seed once into `myapp_test_tpl`, then clone per worker |
1363
1363
 
@@ -17,16 +17,25 @@ The mechanisms are of three shapes, and knowing which one you hit tells you wher
17
17
  | Shape | Where it fires | Example |
18
18
  |---|---|---|
19
19
  | a **type** in `@ultimat3/ui` | `x verify`'s `typecheck` step | `AsyncRegionProps.empty` is required |
20
- | a **guard** in your app's `guards/` | `x verify`'s `boundaries` step | `guards/focus-visible.ts` |
20
+ | a **guard**, shipped or in your app's `guards/` | `x verify`'s `boundaries` step | `focus-visible` |
21
21
  | a **test** in the framework | `x verify`'s `unit` step | `packages/ui/src/tokens/contrast.test.ts` |
22
22
 
23
- Guards are yours: `x new` writes every name in `SHIPPED_GUARD_NAMES`
24
- (`packages/cli/src/templates/scaffold-guards.ts`), the directory is the registration, and deleting
25
- a file deletes the rule. Add one with `x g guard <name>` — a name the framework ships a guard under writes
26
- that guard, any other name writes a blank one — and `x doctor` lists the shipped ones an app does
27
- not hold. Each raises an app-owned `X_*` code derived from
28
- its own filename — `guards/focus-visible.ts` raises `X_FOCUS_VISIBLE` — so a finding says which
29
- convention broke, not which framework subsystem noticed.
23
+ Shipped guards run from the installed framework, never from a copy: every name in
24
+ `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) runs on `boundaries`, so a
25
+ fixed guard reaches the app on its next install. `As of 2026-11`.
26
+
27
+ | You want | Do |
28
+ |---|---|
29
+ | a shipped guard to report only, gate, or not run | a row in `guards/shipped.json`: `{ "severity": { "raw-fetch": "warning" } }` — `"error"`, `"warning"` or `"off"` |
30
+ | a shipped guard held at its current count while the tree is brought under it | `"guardBaseline": { "raw-fetch": 3 }` in `x.verify.json` — the count only falls |
31
+ | a rule of your own | `x g guard <name>`: `guards/<name>.ts` and its test, discovered, never registered |
32
+ | off vendored copies (an app whose `guards/` holds them) | `x upgrade` — the `vendored-guards` codemod deletes each identical copy; a severity edit becomes a row; any other edit is kept as `guards/app-<name>.ts`, the shipped one `"off"`, with the reason and the diff |
33
+
34
+ `guards/shipped.json` present is the opt-in: absent, the app is legacy — a copy it holds runs in
35
+ place of the shipped guard (`X_GUARD_VENDORED`, a warning, fix `x upgrade`), and a shipped guard it
36
+ holds no copy of reports only. Each raises an `X_*` code derived from its name — `focus-visible`
37
+ raises `X_FOCUS_VISIBLE` — so a finding says which convention broke, not which framework subsystem
38
+ noticed.
30
39
 
31
40
  ## Loading, empty, error
32
41
 
@@ -419,7 +419,7 @@ export const syncAccount = job({
419
419
  | `QueueStats.failed` | rows that ended `failed`: refused by a busy concurrency key, or exhausted on a `retry.deadLetter: false` job (settled `failed`, outcome `dropped` — that job used to be re-queued forever) |
420
420
  | a job whose worker dies on every attempt is dead-lettered | a lease that lapses on a row's FINAL attempt is settled `dead` by the next claim itself — `lastError` says the lease lapsed — and never handed out again. It reaches the dead-letter queue after `retry.attempts` claims; it used to take a worker per visibility timeout, forever. Logged `jobs.claim.exhausted`; `onSettled` is told `dead-lettered`, and `WorkerStats.deadLettered` counts it. A job declaring `retry.deadLetter: false` is buried `failed` instead and told `dropped` — the worker names those jobs to the claim |
421
421
  | settles are fenced on the claim | `{ workerId, claim }`: a body whose lease lapsed cannot settle, renew or report on the run that replaced it — whether another worker claimed it or the same one did. The miss is logged `jobs.settle.unowned` |
422
- | `x jobs drain` (planned) | moves nothing: the subcommand exits `X_NOT_IMPLEMENTED` `As of 25.0.0` and has no body. A drain written for a future second driver settles what it moves without counting it — a moved job is not a completed one |
422
+ | no drain verb | `x jobs` has no `drain` `As of 2026-11-15` (planned with no body since 25.0.0, then removed). A drain written for a future second driver settles what it moves without counting it — a moved job is not a completed one |
423
423
  | a scheduled occurrence fires in one statement | the watermark and the occurrence's jobs move together, so a crash between them cannot fire it twice |
424
424
  | remote "quiet this worker" | not shipped: SIGTERM drain is the mechanism, and the orchestrator owns process lifecycle |
425
425
 
@@ -843,13 +843,13 @@ Two implementations ship, `As of 25.0.0`: `postgresJobDriver()` and `memoryJobDr
843
843
  | Driver | Status `As of 25.0.0` | When | Trade-off |
844
844
  |---|---|---|---|
845
845
  | `postgres` (default) | **shipped** | always, up to ~thousands of jobs/sec. `x dev` runs it too, against the embedded PGlite | outbox is free (same DB, same tx); `SELECT ... FOR UPDATE SKIP LOCKED` claiming; zero extra infra |
846
- | `memory` | **shipped**; there is no config value for any driver | tests and fixtures, through `memoryJobDriver()` | in-process; nothing survives a restart — which is why it was never a safe `x jobs drain` target |
846
+ | `memory` | **shipped**; there is no config value for any driver | tests and fixtures, through `memoryJobDriver()` | in-process; nothing survives a restart — which is why it was never a safe drain target |
847
847
 
848
848
  **There is no `jobs.driver`, and 5.0.0 is where it went.** It accepted `'postgres' | 'redis' | 'nats'` and had **no reader anywhere** — boot always built `postgresJobDriver`, stated in [`packages/jobs/src/driver.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/jobs/src/driver.ts)'s own header. So setting it to `redis` changed nothing at all and you silently got Postgres, which is the more dangerous behaviour because nothing reports it. From 5.0.0 to 24.x a stale key still rode through untyped; **25.0.0 refuses it** at `defineConfig`, naming the driver seam. Deleting it from `app.config.ts` is the whole of the upgrade.
849
849
 
850
850
  **The seam that does work is `jobs:` in `export const runtime = { … }`** (`apps/<app>/runtime.ts`; 31.0.0 deleted `setJobDriver`) — swap the driver, zero job-code change, which is what the interface buys; a test swaps one for itself with `await swapAdapter('jobs', driver)` from `@ultimat3/testing`. Every swappable backend works this way: [Adapters](Adapters). `redisJobDriver()` is the second durable driver (`As of 2026-10`, #710): `jobs: redisJobDriver()` on core's `redisClient()` — while Redis is down an `enqueue` is `X_DRIVER_UNAVAILABLE` at once, never a wait — imported from `@ultimat3/jobs/redis`, held to the same conformance suite as Postgres, without the operator surface (`x jobs show`, `retry`, `cancel`), backfill bookkeeping or fleet-wide `concurrency` — [`packages/jobs/README.md`](https://github.com/developerz-ai/ultimate/blob/main/packages/jobs/README.md#drivers) has the table. There is no NATS jobs driver.
851
851
 
852
- **`x jobs drain` is planned, `As of 25.0.0`.** It exits `X_NOT_IMPLEMENTED` before the queue boots, pointing at `x jobs list --json`: with Postgres the one durable driver, there is nowhere to drain to. Its two former `--to` values, `redis` and `nats`, were all-throw stubs — until 2026-10 a drain leased the whole pending batch for five minutes, failed every enqueue and nacked it back, nothing moved, and no worker could claim those jobs meanwhile. 25.0.0 deleted the stubs and the unreachable drain body behind the planned answer. A drain that returns with a real second driver is new code, and owes the lesson of `--to memory`, a target until 2026-09: `memoryJobDriver()` is a `Map` inside the command's own process, so the drain enqueued each job into it, acked the durable row off the source, printed `ok: true`, and lost every copy when the command exited.
852
+ **`x jobs` has no `drain`, `As of 2026-11-15`.** It was planned from 25.0.0 and left the registry ([Known gaps](Known-Gaps#open-by-decision)): with Postgres the one durable driver, there is nowhere to drain to. To stop a queue for maintenance, `x jobs pause <queue>`, then `x jobs list --queue <queue> --state running --json` until it is empty. Its two former `--to` values, `redis` and `nats`, were all-throw stubs — until 2026-10 a drain leased the whole pending batch for five minutes, failed every enqueue and nacked it back, nothing moved, and no worker could claim those jobs meanwhile. 25.0.0 deleted the stubs and the unreachable drain body. A drain that returns with a real second driver is new code, and owes the lesson of `--to memory`, a target until 2026-09: `memoryJobDriver()` is a `Map` inside the command's own process, so the drain enqueued each job into it, acked the durable row off the source, printed `ok: true`, and lost every copy when the command exited.
853
853
 
854
854
  So there is no cross-driver migration procedure — and none is needed while `postgres` is the only driver that runs.
855
855