@ultimat3/cli 31.51.0 → 31.53.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 (169) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +9 -9
  3. package/package.json +29 -29
  4. package/src/app-kit-disk.ts +39 -0
  5. package/src/app-kit-forms.ts +27 -0
  6. package/src/app-kit.ts +146 -0
  7. package/src/budgets.ts +3 -1
  8. package/src/catalog-layout.ts +194 -0
  9. package/src/cdp-shot-driver-screen.ts +72 -0
  10. package/src/cdp-shot-driver.ts +17 -1
  11. package/src/cmd-design-capture.ts +210 -0
  12. package/src/cmd-design-errors.ts +50 -0
  13. package/src/cmd-design-paths.ts +47 -0
  14. package/src/cmd-design-publish.ts +64 -0
  15. package/src/cmd-design-run.ts +229 -0
  16. package/src/cmd-design-spec.ts +47 -0
  17. package/src/cmd-design-theme.ts +107 -0
  18. package/src/cmd-design-url.ts +201 -0
  19. package/src/cmd-design.ts +188 -0
  20. package/src/cmd-doctor.ts +3 -0
  21. package/src/cmd-generate-spec.ts +5 -0
  22. package/src/cmd-generate.ts +3 -1
  23. package/src/cmd-i18n-spec.ts +4 -4
  24. package/src/cmd-i18n-split.ts +133 -0
  25. package/src/cmd-i18n.ts +46 -66
  26. package/src/cmd-kit-spec.ts +13 -0
  27. package/src/cmd-kit.ts +133 -0
  28. package/src/cmd-shot-against.ts +275 -0
  29. package/src/cmd-shot-spec.ts +9 -1
  30. package/src/cmd-shot.ts +19 -0
  31. package/src/cmd-upgrade.ts +11 -0
  32. package/src/codemods/agent-kit.ts +130 -0
  33. package/src/codemods/agents-md-budget.ts +47 -0
  34. package/src/codemods/docs-visual-quality.ts +198 -0
  35. package/src/codemods/index.ts +8 -0
  36. package/src/codemods/settings-kit-allow.ts +49 -0
  37. package/src/config-redact.ts +20 -4
  38. package/src/db-rollback-pass.ts +4 -1
  39. package/src/design-extract-script.ts +187 -0
  40. package/src/design-extract.ts +311 -0
  41. package/src/design-map-colors.ts +180 -0
  42. package/src/design-map.ts +288 -0
  43. package/src/dev-child-watch.ts +16 -0
  44. package/src/dev-db-migrate.ts +27 -46
  45. package/src/dev-db-migrator-hold.ts +131 -0
  46. package/src/dev-db-rollback.ts +11 -2
  47. package/src/dev-rebuild-schema.ts +7 -24
  48. package/src/doctor-kit.ts +25 -0
  49. package/src/error-catalog.ts +4 -2
  50. package/src/error-codes-kit.ts +24 -0
  51. package/src/error-codes.ts +12 -10
  52. package/src/generate-catalog-locales.ts +25 -2
  53. package/src/generate-files.ts +31 -1
  54. package/src/generate-follow-ups.ts +8 -3
  55. package/src/guards-shipped-names.ts +5 -0
  56. package/src/i18n-audit.ts +17 -33
  57. package/src/i18n-index.ts +108 -31
  58. package/src/i18n-locale-parity.ts +14 -6
  59. package/src/i18n-new-locale.ts +75 -0
  60. package/src/i18n-registration.ts +52 -27
  61. package/src/island-capture.ts +36 -7
  62. package/src/kit/agent-audit.ts +49 -0
  63. package/src/kit/agent-data.ts +32 -0
  64. package/src/kit/agent-server.ts +34 -0
  65. package/src/kit/agent-shape.ts +61 -0
  66. package/src/kit/agent-web.ts +49 -0
  67. package/src/kit/design-map.ts +106 -0
  68. package/src/kit/managed.ts +12 -0
  69. package/src/kit/registry.ts +89 -0
  70. package/src/kit/skill-design-research.ts +119 -0
  71. package/src/kit/skill-feature.ts +159 -0
  72. package/src/kit/skill-planx.ts +139 -0
  73. package/src/kit/skill-upgrade.ts +94 -0
  74. package/src/kit/skill-verify.ts +80 -0
  75. package/src/mcp-errors.ts +5 -0
  76. package/src/mcp-ui-diff.ts +13 -38
  77. package/src/mcp-ui.ts +30 -1
  78. package/src/merge-state.ts +3 -2
  79. package/src/messages-design.ts +104 -0
  80. package/src/messages-floor.ts +2 -0
  81. package/src/messages-upgrade.ts +9 -0
  82. package/src/messages.ts +4 -0
  83. package/src/registry.ts +4 -0
  84. package/src/serve-boot-telemetry.ts +106 -0
  85. package/src/serve-boot.ts +23 -4
  86. package/src/shot-blank.ts +70 -0
  87. package/src/shot-diff.ts +96 -0
  88. package/src/shot-gpu.ts +17 -5
  89. package/src/templates/catalog-barrel.ts +84 -0
  90. package/src/templates/guard-animated-layout-script.ts +173 -0
  91. package/src/templates/guard-effect-without-fallback.ts +117 -0
  92. package/src/templates/guard-motion-adapter.ts +161 -0
  93. package/src/templates/guard-raw-frame-loop.ts +134 -0
  94. package/src/templates/guard-raw-motion-script.ts +132 -0
  95. package/src/templates/guard-raw-motion-ts-scan.ts +95 -0
  96. package/src/templates/guard-released-forms.ts +12 -1
  97. package/src/templates/guard-untranslated-string.ts +27 -6
  98. package/src/templates/index.ts +1 -2
  99. package/src/templates/island.ts +55 -8
  100. package/src/templates/kit-released-forms.ts +63 -0
  101. package/src/templates/locales.ts +6 -0
  102. package/src/templates/motion-scale.ts +115 -0
  103. package/src/templates/scaffold-claude.ts +39 -26
  104. package/src/templates/scaffold-design.ts +41 -0
  105. package/src/templates/scaffold-docs.ts +31 -7
  106. package/src/templates/scaffold-gitattributes.ts +9 -2
  107. package/src/templates/scaffold-guards.ts +31 -2
  108. package/src/templates/scaffold-i18n.ts +10 -6
  109. package/src/templates/scaffold-verify-floor.ts +3 -0
  110. package/src/templates/shapes/blog-site.ts +15 -0
  111. package/src/templates/shapes/blog.ts +2 -0
  112. package/src/templates/shapes/content-site.ts +13 -0
  113. package/src/templates/shapes/content.ts +2 -0
  114. package/src/templates/shapes/dashboard-detail.ts +2 -0
  115. package/src/templates/shapes/dashboard-motion.ts +284 -0
  116. package/src/templates/shapes/dashboard.ts +19 -1
  117. package/src/templates/shapes/landing-motion.ts +67 -0
  118. package/src/templates/shapes/offline.ts +5 -2
  119. package/src/templates/shapes/saas.ts +4 -0
  120. package/src/test-ignores.ts +3 -2
  121. package/src/upgrade-gate.ts +14 -2
  122. package/src/upgrade-kit.ts +65 -0
  123. package/src/upgrade-report-kit.ts +28 -0
  124. package/src/upgrade-report.ts +3 -0
  125. package/src/verify-checks.ts +9 -1
  126. package/src/verify-floor.ts +9 -1
  127. package/src/verify-local-only.ts +66 -0
  128. package/src/verify-run.ts +17 -2
  129. package/src/workspace-checks.ts +3 -3
  130. package/wiki/Actions.md +1 -1
  131. package/wiki/Agents.md +33 -1
  132. package/wiki/Auth.md +3 -3
  133. package/wiki/Batching-And-Preloading.md +1 -0
  134. package/wiki/CLI-Reference-Data.md +241 -0
  135. package/wiki/CLI-Reference-Gate.md +572 -0
  136. package/wiki/CLI-Reference-Project.md +414 -0
  137. package/wiki/CLI-Reference-Ship.md +348 -0
  138. package/wiki/CLI-Reference-Tools.md +687 -0
  139. package/wiki/CLI-Reference.md +18 -2227
  140. package/wiki/Compared.md +8 -8
  141. package/wiki/Configuration.md +26 -2
  142. package/wiki/Deployment.md +1 -1
  143. package/wiki/Design-Research.md +96 -0
  144. package/wiki/Effects.md +83 -0
  145. package/wiki/Entities-And-Migrations.md +3 -2
  146. package/wiki/FAQ.md +1 -1
  147. package/wiki/Getting-Started.md +1 -1
  148. package/wiki/Home.md +2 -2
  149. package/wiki/I18n.md +39 -5
  150. package/wiki/Installation.md +1 -1
  151. package/wiki/Jobs-And-Workflows.md +29 -1
  152. package/wiki/Known-Gaps.md +6 -2
  153. package/wiki/MCP-And-AI.md +4 -0
  154. package/wiki/Motion.md +85 -0
  155. package/wiki/Observability.md +15 -1
  156. package/wiki/Outbound-HTTP.md +62 -2
  157. package/wiki/PWA-And-Offline.md +1 -1
  158. package/wiki/Policies-And-Authz.md +10 -0
  159. package/wiki/Project-Layout.md +1 -1
  160. package/wiki/Realtime.md +29 -2
  161. package/wiki/Static-Assets.md +1 -1
  162. package/wiki/Testing.md +33 -0
  163. package/wiki/Theming.md +31 -8
  164. package/wiki/Troubleshooting.md +1 -1
  165. package/wiki/Tutorial-02-First-Feature.md +1 -1
  166. package/wiki/UI-Components.md +2 -0
  167. package/wiki/Upgrading.md +9 -3
  168. package/src/templates/scaffold-claude-agents.ts +0 -161
  169. package/src/templates/scaffold-claude-commands.ts +0 -239
package/wiki/Compared.md CHANGED
@@ -28,20 +28,20 @@ Who uses it:
28
28
 
29
29
  ## Measured, and how to reproduce it
30
30
 
31
- Medians of five runs on a 4-core GitHub `ubuntu-latest` runner, `As of 2026-11-18`; the method, the
31
+ Medians of five runs on a 4-core GitHub `ubuntu-latest` runner, `As of 2026-11-23`; the method, the
32
32
  box and the caveats are [`scripts/bench/results/README.md`](https://github.com/developerz-ai/ultimate/blob/main/scripts/bench/results/README.md),
33
33
  and every number below is held to the committed JSON by `bun run scripts/bench-claims.ts`
34
34
  (`X_BENCH_CLAIM_STALE`).
35
35
 
36
36
  | Figure | Measured |
37
37
  |---|---|
38
- | scaffold, published `create-ultimate` (31.46.0) | 1.5 s |
39
- | `bun run setup`, cold Bun cache | 8.0 s |
40
- | `node_modules` after setup | 197 MB |
41
- | first `bun run verify` | green in all five runs, median 23.1 s |
42
- | `/` under `x dev`, one client, concurrency 16 | median 1,147 req/s, p99 26.86 ms |
43
- | a typed read, `/_x/query/post-list` | median 875 req/s, p99 35.3 ms |
44
- | cold start to the first 2xx (`x dev`) | 1.1 s |
38
+ | scaffold, published `create-ultimate` (31.49.0) | 1.8 s |
39
+ | `bun run setup`, cold Bun cache | 9.0 s |
40
+ | `node_modules` after setup | 196 MB |
41
+ | first `bun run verify` | green in all five runs, median 29.5 s |
42
+ | `/` under `x dev`, one client, concurrency 16 | median 1,125 req/s, p99 33.2 ms |
43
+ | a typed read, `/_x/query/post-list` | median 889 req/s, p99 45.13 ms |
44
+ | cold start to the first 2xx (`x dev`) | 1.6 s |
45
45
 
46
46
  `x dev` is the development server — every role and an embedded Postgres in one process — so these
47
47
  are a CI runner's first-hour numbers, not a production capacity claim. The previous figures came from
@@ -596,6 +596,7 @@ Two disks may not share one driver **instance**: a driver learns its disk name a
596
596
 
597
597
  | var | notes |
598
598
  |---|---|
599
+ | `OTEL_SERVICE_NAME` / `OTEL_RESOURCE_ATTRIBUTES` | the service identity: name `OTEL_SERVICE_NAME` › `service.name` in the attributes › `app.config.ts`'s `name`; version `service.version` in the attributes › the build id › `APP_VERSION` → [Observability](Observability#the-service-identity) |
599
600
  | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP/HTTP **JSON** only, port `:4318`. Absent = spans still recorded, exported nowhere. Invalid → `X_OTLP_ENDPOINT_INVALID` |
600
601
  | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` / `..._METRICS_ENDPOINT` | per-signal override |
601
602
  | `OTEL_EXPORTER_OTLP_PROTOCOL` | anything but `http/json` → `X_OTLP_PROTOCOL_UNSUPPORTED`, naming `:4318`. gRPC (`:4317`) needs HTTP/2 and protobuf and is out of scope |
@@ -673,6 +674,27 @@ export const config = defineConfig({ name: 'my-app', time: { detect: true } });
673
674
 
674
675
  No default zone is a key here, and none ever is: the process default is `configureTime({ defaultZone })`, and every format call names its zone → [Timezones and dates](Timezones-And-Dates).
675
676
 
677
+ ## `outbound`
678
+
679
+ The app-wide egress proxy: every `outbound()` call with no `proxy` of its own goes through it, the framework's senders and the AI providers included → [Outbound HTTP](Outbound-HTTP#the-app-wide-proxy-outbound-in-appconfigts). `As of 2026-11`.
680
+
681
+ ```ts
682
+ import { defineConfig, defineEnv } from '@ultimat3/core';
683
+
684
+ export const env = defineEnv({
685
+ EGRESS_PROXY: { type: 'url', required: false, secret: true, description: 'The egress proxy.' },
686
+ });
687
+ export const config = defineConfig({
688
+ name: 'my-app',
689
+ outbound: { proxy: env.EGRESS_PROXY, direct: ['svc.cluster.local'] },
690
+ });
691
+ ```
692
+
693
+ | Key | Type | Default | Effect |
694
+ |---|---|---|---|
695
+ | `outbound.proxy` | `string` (`http:`/`https:` URL) | unset — every call dials as it says | **read** by the container boot (`configureOutboundProxy`). A call's own `proxy` wins; `proxy: () => undefined` dials direct. Any other scheme, or not a URL → `X_CONFIG_INVALID`, the value never echoed. A credential rides the URL: take it from the env, never a literal. `x config show` hides its whole userinfo (a token as the user included). A plain-`http:` target the proxy carries crosses it in cleartext, `Authorization` and SigV4 included: the first use per host logs one `ultimate outbound proxy cleartext` warn line (host and port only) naming `outbound.direct` — routing is not changed for you |
696
+ | `outbound.direct` | `string[]` (bare host names, IP literals) | `[]` | hosts never sent through the proxy, each with every name under it, per label. `localhost`, `*.localhost` and loopback are always direct. A scheme, path, port or `*` → `X_CONFIG_INVALID` |
697
+
676
698
  ## `drain`
677
699
 
678
700
  How a SIGTERM'd process leaves: `DrainConfig` in [`packages/core/src/config-health.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/core/src/config-health.ts). The production boot applies it to **every role** (`lifecycleForRole`, `packages/cli/src/serve-boot.ts`), not only to the web server.
@@ -793,6 +815,8 @@ One typed schema, declared with `defineEnv` at module scope **in `app.config.ts`
793
815
  | `BUILD_ID` | all | set by `x build` | content hash. Never a timestamp, never `latest` |
794
816
  | `LOG_LEVEL` | all | no — unset or empty is `info` | `trace \| debug \| info \| warn \| error \| fatal \| silent`, lowercase. Any other value — `DEBUG`, `verbose` — is REFUSED at import (`X_INVARIANT`), never read as `info` |
795
817
  | `TRUSTED_PROXY_HOPS` | `web`, `sync` | no — unset trusts no proxy header | how many proxies **append** to `x-forwarded-for` between the client and this process: 1 for a single ingress or ALB, 2 for a CDN in front of one. Decimal digits, 1–64 (`@ultimat3/http`'s `MAX_PROXY_HOPS`); anything else is `X_TRUSTED_PROXY_HOPS_INVALID`, refused rather than defaulted, because reading the header at the wrong index is trusting a value the client typed. Unset means `ctx.ip` is the socket address, `ctx.peer` is `null` and no inbound `x-request-id` is echoed |
818
+ | `OTEL_SERVICE_NAME` | all | no — unset falls to `OTEL_RESOURCE_ATTRIBUTES`, then `name` | `service.name` on every span, log, metric and Sentry event; empty is unset → [Observability](Observability#the-service-identity) |
819
+ | `OTEL_RESOURCE_ATTRIBUTES` | all | no | `key=value,…`, values percent-decoded: its `service.name` is used when `OTEL_SERVICE_NAME` is unset, its `service.version` beats the build id (`BUILD_ID`) and `APP_VERSION`. One malformed pair discards the whole variable, with one warn line |
796
820
  | `OTEL_EXPORTER_OTLP_ENDPOINT` | all | no | the OTLP collector. There is no `otel` config block for it to override — see [`otel`](#otel) |
797
821
 
798
822
  Rules:
@@ -905,7 +929,7 @@ x verify --json # the gate
905
929
 
906
930
  ## The gate's file — `x.verify.json`
907
931
 
908
- Not configuration of the app: what `x verify` holds it to, committed at the repo root. Every key is in [CLI reference](CLI-Reference#x-verify); the `exercise` key, `As of 31.16.0`:
932
+ Not configuration of the app: what `x verify` holds it to, committed at the repo root. Every key is in [CLI reference](CLI-Reference-Gate#x-verify); the `exercise` key, `As of 31.16.0`:
909
933
 
910
934
  | Key | Value | Absent |
911
935
  |---|---|---|
@@ -916,7 +940,7 @@ Not configuration of the app: what `x verify` holds it to, committed at the repo
916
940
  { "exercise": { "unprovenMax": 0, "statementsMax": 100 } }
917
941
  ```
918
942
 
919
- `x new` writes exactly that; `x upgrade` writes the figures the hop measured into a file that states none, so the floor only falls; a figure the app already wrote is never changed, even when the pass's constant seed (31.47.0) lands above it → [Upgrading](Upgrading). A malformed value is a `manifest`-step problem naming the shape → [CLI reference](CLI-Reference#x-exercise).
943
+ `x new` writes exactly that; `x upgrade` writes the figures the hop measured into a file that states none, so the floor only falls; a figure the app already wrote is never changed, even when the pass's constant seed (31.47.0) lands above it → [Upgrading](Upgrading). A malformed value is a `manifest`-step problem naming the shape → [CLI reference](CLI-Reference-Gate#x-exercise).
920
944
 
921
945
  `x config show --json` prints the resolved config — defaults merged, credentials redacted; `--section database` for one key (since 31.17.0) → [CLI reference](CLI-Reference).
922
946
 
@@ -68,7 +68,7 @@ The body is `{ state, ready, role }` for everyone, and `{ state, ready, uptimeMs
68
68
 
69
69
  **A check has three answers: `ok`, `degraded`, `failing`** (`As of 2026-10`). `degraded` is a dependency the role serves without — today, the bus on a role that only publishes to it. It never turns `/readyz` into a 503, in either mode, so a NATS outage cannot pull every web pod from the ingress; `/readyz?deep=1` is strict and answers 503 for it. An app registers its own with `registerReadinessCheck(name, check, { onFailure: 'degraded' })`.
70
70
 
71
- **Which build answers is a header, on every health answer** (`As of 27.2.3`). `/healthz`, `/readyz` and `/readyz?deep=1` send `x-ultimate-build` — the same header every page sends — on the web port, the sync port and the metrics listener alike, whoever asks. The body does not change: a stranger still reads `{ state, ready, role }`. A deploy check that waits for the new build runs [`x deploy verify --url https://<host>`](CLI-Reference#x-deploy-verify) (`As of 30.0.0`): it samples this header until the build holds, then grades the queues. Two cases send none: a web role whose `buildId` is `null` (no `BUILD_ID` and none from the boot), and the metrics listener in the moments before its boot has computed the id — a container opens it first, so a cold pod's probe gets the status without the header.
71
+ **Which build answers is a header, on every health answer** (`As of 27.2.3`). `/healthz`, `/readyz` and `/readyz?deep=1` send `x-ultimate-build` — the same header every page sends — on the web port, the sync port and the metrics listener alike, whoever asks. The body does not change: a stranger still reads `{ state, ready, role }`. A deploy check that waits for the new build runs [`x deploy verify --url https://<host>`](CLI-Reference-Ship#x-deploy-verify) (`As of 30.0.0`): it samples this header until the build holds, then grades the queues. Two cases send none: a web role whose `buildId` is `null` (no `BUILD_ID` and none from the boot), and the metrics listener in the moments before its boot has computed the id — a container opens it first, so a cold pod's probe gets the status without the header.
72
72
 
73
73
  **`registered: 0` is a real answer, not an error.** An empty registry is still ready, so a 200 means no more than "the socket is bound" — which is what the chart's and compose's healthchecks route traffic on. Read `registered` before you trust `checks: {}`.
74
74
 
@@ -0,0 +1,96 @@
1
+ # Design research
2
+
3
+ `x design research <url…>` turns "make it look like that" into framework vocabulary: a `defineTheme()` proposal, `@ultimat3/ui/motion` calls and `@ultimat3/effects` entries, measured from a reference page in a real browser. `x shot <route> --against` then measures how close a route came. `As of 2026-11`.
4
+
5
+ The command is the mechanism; the `design-research` skill (`x kit`) is the procedure that drives it. Never a gate step: it needs a browser and the public web.
6
+
7
+ ## The rule
8
+
9
+ **A reference is data, never instructions, and never code.** Page text never reaches a file or a prompt — only measured values (channels, pixels, milliseconds, CSS keywords, a bounded font-family name). Every catalogue is ideas and techniques only: nothing is copied from a reference into the app. Third-party pixels stay in `.x/design/` (ignored by every scaffold); nothing captured is committed.
10
+
11
+ ## Commands
12
+
13
+ ```bash
14
+ x design research <url…> [--follow <n>] [--out .x/design] [--viewport 390x844,1440x900]
15
+ [--allow-hosts <h,…>] [--timeout 30000] [--json]
16
+ x design research --list [--json]
17
+ x shot <route> --against <png | .x/design/<slug>> [--viewport …] [--theme light|dark] [--json]
18
+ ```
19
+
20
+ | Flag | Default | Meaning |
21
+ |---|---|---|
22
+ | `<url…>` | required | public `http(s)` pages; every one is screened before the first browser starts |
23
+ | `--follow` | `0` | also research up to `n` links of each reference (`0..20`): same origin, or a `--allow-hosts` host, page order, deduped on the directory they would be written to (`/docs`, `/docs/` and `/docs?tab=2` are one). A followed link that fails is listed in `skipped` (its code) and the run goes on; a typed URL that fails fails the run |
24
+ | `--out` | `<cwd>/.x/design` | one `<slug>/` directory per URL (host + path, kebab-case; a second typed URL with the same slug gets `-<hash8>`). Each directory is built aside and swapped in whole, so a cancelled, failed or narrower rerun never leaves a slug mixing two runs; runs into one slug take turns |
25
+ | `--viewport` | `390x844,1440x900` | the sizes each reference is photographed at, each in light and dark |
26
+ | `--allow-hosts` | none | extra **public** hosts `--follow` may visit. Never `*`, `localhost` or an inward address (`X_DESIGN_URL_REFUSED`); never widens what the browser may reach |
27
+ | `--timeout` | `30000` | ms one navigation may take |
28
+ | `--list` | off | the default catalogues and the licence posture each is held to |
29
+
30
+ Browser: the one `x shot` uses (`CHROME_PATH`, `PUPPETEER_EXECUTABLE_PATH`, the probed paths, or `SCRAPE_CDP_URL`) over raw CDP. No Playwright, in the framework or the scaffold.
31
+
32
+ ## The five artefacts, per URL
33
+
34
+ | File | Holds |
35
+ |---|---|
36
+ | `shot-<width>-<light\|dark>.png` | full-page capture per viewport and scheme |
37
+ | `reference.json` | palette clusters by usage (background, text, border share) with each one's nearest shipped role, font families + size scale, spacing histogram, radii, shadows, `backdrop-filter` use, canvases, every animation/transition (duration, delay, easing, trigger `enter`/`hover`/`scroll`/`loop`/`state`, animated properties), hosts refused |
38
+ | `tokens.proposal.json` | a `defineTheme({ colors, radius, motion })` argument — accepted by `defineTheme` itself before it is written (as mapped, else without colours, else `{}` with `tokens.validated: false`); a curve point that is not a plain decimal, or overshoots past 10, is dropped |
39
+ | `motion-map.json` | each observed animation → the `@ultimat3/ui/motion` call (`animate`, `inView`, `scrollLinked`, `motionTiming`, `layout`, `springLinear`) or `@ultimat3/effects` entry (`Marquee`, `Shimmer`, `GlassSurface`, `EffectCanvas`), with its snapped `duration`/`easing` token |
40
+ | `sources.json` | URL, final URL, followed-from, catalogue, licence posture, the ideas-only rule |
41
+
42
+ **Page-chosen text never comes back.** `finalUrl` (`location.href`, which a page rewrites with `history.replaceState`) and every followed page are named `origin#<hash8>`; a followed page's directory is `<reference-slug>--<hash8>`, never its path. A font family is one token plus words a family name is made of (`IBM Plex Sans`), never a phrase. Captures are clipped to the viewport's width and at most 16384 px of height.
43
+
44
+ How the measuring works: a recorder is installed before the page's own scripts (every `Element.animate`, CSS animation and transition, with the phase it started in); after load the page is scrolled to the bottom, then hovered over its links, buttons and cards; then up to 3000 visible elements' computed styles are read. Durations and easings snap through the same motion scale the shipped guards use (`packages/cli/src/templates/motion-scale.ts`). Radii snap to `sm`/`md`/`lg`/`xl`.
45
+
46
+ ## Colours that always pass contrast
47
+
48
+ `tokens.proposal.json` proposes `bg`, `fg`, `surface`/`bg-soft`/`surface-raised`, `accent`/`accent-fg` and `line` per theme, then runs `defineTheme`'s own pairing table (`CONTRAST_PAIRS` + `ALIAS_CONTRAST_PAIRS`): a role whose pairing fails is **dropped** and falls back to the shipped palette, until every pairing passes. A theme whose page colour does not fit it (a light site photographed in dark mode) gets no colours. `@ultimat3/ui` is resolved at run time; where it is not installed, the proposal carries no colours and `reference.json` says `coloursProposed: false`.
49
+
50
+ ## Network: public hosts only, browser-wide
51
+
52
+ | Request | Screen |
53
+ |---|---|
54
+ | the typed URL, each `--follow` link | `http(s)`, no credentials, core's address floor, then every address the name resolves to — before any browser |
55
+ | every navigation, redirect, subresource, popup the page makes | CDP `Fetch` interception on the page **and** browser sessions: core's floor refuses inward literals and `localhost`; a name is resolved (once per session) and refused if any address is not public |
56
+ | a WebSocket (`WebSocket`, `WebSocketStream`, `WebTransport`) | refused in the page before its scripts run, in every frame — `Fetch` never pauses a socket handshake, so none is screened, none is opened |
57
+
58
+ A refused top-level navigation or redirect is `X_DESIGN_URL_REFUSED`; refused subresources are listed by host in `reference.json` (`refused.hosts` inward, `refused.unresolved` a name that did not resolve — unreachable, not private, and asked again rather than cached). A dedicated worker's own socket and a `preconnect` TCP handshake are not covered. The resolve cannot pin Chrome's own socket: a name that rebinds between the screen and Chrome's lookup stays open, as for `@ultimat3/scraping`'s browser leg ([Known gaps](Known-Gaps)). There is no flag that admits loopback — the test suite reaches its fixture server through a harness-only option.
59
+
60
+ ## `x shot --against`
61
+
62
+ | Reference | Pairs |
63
+ |---|---|
64
+ | `.x/design/<slug>` | every `shot-<width>-<scheme>.png` it holds, narrowed by `--viewport` / `--theme`; a pair asked for and not held is `X_SHOT_AGAINST_MISSING` |
65
+ | a `.png` | one pair: the one `--viewport` (else `1440x900`; more than one is `X_CLI_BAD_FLAG`), `--theme` (else `light`) |
66
+
67
+ The reference must lie under the app root or the current directory, through any link (`X_CLI_BAD_FLAG` otherwise).
68
+
69
+ Each pair is an ordinary route shot into `<out>/<width>-<scheme>/`, plus `diff-<width>-<scheme>.png` and an `against` block in its `verdict.json`: `similarity` (`1` identical, `0` every pixel changed), `changedPercent`, `changedBox`, `threshold` (`0.1`, `ui.diff`'s). Two heights compare on the larger canvas; what only one covers counts as changed. **Recorded, never gating**: `ok` is the shot's own verdict. Refused beside `--matrix`, `--island`, `--all-islands`.
70
+
71
+ ## Dev MCP: `ui.research`
72
+
73
+ The same command (axiom 2), under `dev:test` like `ui.shot`: `{ urls: [1..5], follow?: 0..20 }` → the `--json` answer, artefacts in `<app>/.x/design/`. Same screen, same refusals. A cancelled call (`notifications/cancelled`) closes its browser, launches no further one and publishes nothing: `X_ABORTED`.
74
+
75
+ ## Catalogues (`--list`)
76
+
77
+ | Source | Posture |
78
+ |---|---|
79
+ | React Bits | `ideas-only` — MIT + Commons Clause: watch the effect, never open the source |
80
+ | 21st.dev | `ideas-only` — per-component licences |
81
+ | Paper Shaders | `ideas-only` |
82
+ | shaders.com | `ideas-only` |
83
+ | reui | `mit-attribution` |
84
+ | shadcn/ui | `mit-attribution` |
85
+ | Motion | `mit-attribution` |
86
+
87
+ A host on no row is `ideas-only`. `mit-attribution` / `apache-notice` state what copying *would* owe; the framework's rule — ideas only — is stricter than all of them.
88
+
89
+ ## Errors
90
+
91
+ | Code | When | Fix |
92
+ |---|---|---|
93
+ | `X_DESIGN_URL_REFUSED` | not `http(s)`, credentials, or the URL — or a redirect the page took — lands on a private, loopback or link-local address | a public `https://` page |
94
+ | `X_DESIGN_REFERENCE_UNREACHABLE` | navigation failed, timed out, answered 4xx/5xx, or the name did not resolve | `--timeout <ms>`, or drop the URL |
95
+ | `X_ABORTED` | the call was cancelled; nothing from the reference in progress was published | run it again |
96
+ | `X_SHOT_AGAINST_MISSING` | `--against` names no file, or a reference with no shot for that width and scheme | `x design research <url>` first |
@@ -0,0 +1,83 @@
1
+ # Effects
2
+
3
+ `@ultimat3/effects` — background, interaction and text effects. Optional package, tier 5: an app that does not import it pays 0 B. Every engine is ours; no runtime dependency beyond `@ultimat3/*`.
4
+
5
+ `As of 2026-11`. The component list is the generated [`CATALOG.md`](https://github.com/developerz-ai/ultimate/blob/main/packages/effects/CATALOG.md) (`bun run --filter @ultimat3/effects catalog`, drift is a red `x verify`); this page is the contract every entry meets.
6
+
7
+ ## The rule
8
+
9
+ Server-rendered first. Works at 0 kB JS in its CSS tier. Enhances inside an island. **A fallback is not a prop — the static frame is the fallback.** The one exception, `EffectCanvas`, takes `fallback` as a required prop, so the type refuses a canvas with none.
10
+
11
+ ## The contract: four tiers
12
+
13
+ Every root element carries `data-effect-backend`.
14
+
15
+ | Tier | When | `data-effect-backend` |
16
+ |---|---|---|
17
+ | static | reduced motion, `data-motion="paused"`, or an entry with no CSS animation — a still frame | `static` |
18
+ | CSS | server render of an entry whose CSS animates (every `site/` page; any island before hydration). CSS itself freezes it under reduced motion; the label stays `css` | `css` |
19
+ | Canvas2D | island, no WebGL2 | `canvas` |
20
+ | WebGL2 | island, `getContext('webgl2')` succeeds and is not lost | `webgl2` |
21
+
22
+ | Rule | Held by |
23
+ |---|---|
24
+ | First frame is computed by the same function as animated frame 0 — no flash | each entry's `*-view.test.ts` |
25
+ | Canvas is `aria-hidden`; DPR capped from one token; colours from resolved role tokens only | `*-view.test.ts`; the raw-colour guard |
26
+ | Paused by `frameLoop` on reduced motion, hidden tab, offscreen, `MotionToggle` ([Motion](Motion)) | backend-selection tests |
27
+ | Zero network: no `fetch`, `sendBeacon`, `XMLHttpRequest`, `WebSocket` from any entry | `network-seal.test.ts` (1,000 frames, every entry) |
28
+ | A canvas, `getContext('webgl…')` or `navigator.gpu` in app code outside `EffectCanvas` | `guard-effect-without-fallback` (warning in an existing app, error in a new one) |
29
+ | No WebGL2 is a backend, never an error | no code exists for it |
30
+
31
+ A bad prop value is `X_EFFECTS_INVALID_VALUE` ([Error codes](Error-Codes-effects)).
32
+
33
+ ## Catalogue
34
+
35
+ | Entry | Kind | Notes |
36
+ |---|---|---|
37
+ | `Aurora` | background | CSS tier by default; themes with dark/brand |
38
+ | `GradientOrbs` | background | transform/opacity only; pauses offscreen and hidden |
39
+ | `MosaicGrid` | background | Canvas2D with a server-rendered first frame — never a blank canvas |
40
+ | `GridGlow` | background | extends `grid-texture`; withdrawn under `prefers-contrast` |
41
+ | `Noise` | background | static SVG turbulence, no animation frame |
42
+ | `ShaderBackground` | background | `preset: 'mesh' \| 'grain' \| 'dots'`; each preset is its own lazy chunk where the island build splits (a lone island inlines all three, [Known gaps](Known-Gaps)); reduced motion is speed 0 on a fixed frame |
43
+ | `SpotlightCard` | interaction | keyboard focus gets the same highlight as the pointer |
44
+ | `Tilt` | interaction | off for coarse pointers and inside focus traps; capped angle |
45
+ | `GlassSurface` | surface | opaque under `prefers-reduced-transparency`; contrast checked against the role pairs |
46
+ | `Marquee` | interaction | pauses on hover, focus-within and `MotionToggle`; duplicate track is `aria-hidden`; logical (RTL-safe) direction |
47
+ | `TextReveal` | text | `by: 'word' \| 'line' \| 'char'`; one readable node plus an `aria-hidden` split; `Intl.Segmenter` with the locale |
48
+ | `CountUp` | text | final value server-rendered; `Intl.NumberFormat` with the `useUi()` locale; `Money`-aware |
49
+ | `Shimmer` | text/surface | consumes `@mixin shimmer` from `@ultimat3/ui` — the same sweep `Skeleton` uses |
50
+ | `EffectCanvas` | escape hatch | `<EffectCanvas draw fallback>`; `fallback` required by type |
51
+
52
+ A new effect is a new row in a later sweep, under this same contract: one PR each.
53
+
54
+ ## Ideas only
55
+
56
+ Reference libraries (Paper Shaders, shaders.com, Motion, React Bits, 21st.dev, reui, shadcn) are studied for behaviour and technique. **No code is copied, and none is added as a dependency.** React Bits is MIT with the Commons Clause, which forbids redistributing a ported version: its source is never opened for this repo. Rule stated in `packages/effects/CLAUDE.md`; verdicts in `docs/idea/18-build-vs-wrap.md`.
57
+
58
+ ## Reduced motion
59
+
60
+ | Setting | Result |
61
+ |---|---|
62
+ | `prefers-reduced-motion: reduce` | CSS animations freeze (`reset.scss`); canvas and shader entries draw their frame 0 and stop; backend reads `static` |
63
+ | `data-motion="paused"` (`MotionToggle`) | same as above, user-chosen, persists |
64
+ | `prefers-contrast: more` | `GridGlow` withdrawn |
65
+ | `prefers-reduced-transparency` | `GlassSurface` opaque |
66
+
67
+ `x shot --all-islands` photographs each island in the states its `*.island.states.ts` declares (the harness emulates colour scheme, not reduced motion or a missing WebGL2 — reduced motion and the canvas fallback are held by the unit tests); the verdict's `gpu` block reports `webgl2` beside WebGPU so a blank canvas is read as the machine or the app.
68
+
69
+ ## Budgets
70
+
71
+ `scripts/effects-bytes.test.ts` builds a one-entry island per effect (minified, `solid-js` external) and holds it to a ceiling.
72
+
73
+ | Claim | Pinned by |
74
+ |---|---|
75
+ | CSS-tier entries (`Aurora`, `GridGlow`, `Noise`, `GlassSurface`, `Shimmer`, `Marquee`, `TextReveal`) are 0 B of JS | no client-only machinery in their source or browser build |
76
+ | Every other entry stays under its ceiling | one ceiling per entry in the test |
77
+ | A shader preset is paid for only by the page that uses it | entry chunk holds no GLSL; `mesh`, `grain`, `dots` each a lazy chunk |
78
+
79
+ A ceiling is a measurement, not a number to game: raise one with the measured bytes and the reason in the same diff (`bun run budget-raises`, `X_BUDGET_RAISE_UNSTATED`). Never cut an effect to hold a figure.
80
+
81
+ ## See also
82
+
83
+ [UI components](UI-Components) · [Motion](Motion) · [Interface rules](Interface-Rules) · [Theming](Theming)
@@ -1020,7 +1020,8 @@ export const parkUnpublished = (authorId: string): Promise<number> =>
1020
1020
  | One plan | `updateWhere(filter, patch)` / `deleteWhere(filter)` and the chain build the same plan (`write-where.ts`): tenancy, soft-delete reach, invariant judging, `onUpdateNow()`, sealing, the search mirror and the `entity.bulk` report cannot differ. The filter is the chain's equalities |
1021
1021
  | Unbounded | no predicate is `X_WRITE_UNFILTERED`. So is a chain predicate whose value is `undefined` — dropped, it would widen the write to everything the rest of the chain matches; `.andWhere('<col>', 'is-null')` is SQL NULL. In `updateWhere`'s filter an `undefined` is dropped, as it always was |
1022
1022
  | No page | `limit()`, `after()` and `search()` on a write chain are `X_INVARIANT_VIOLATED`: a write reaches every match, and a search index answers a bounded sample of ids. `orderBy`, `select` and `preload` are ignored |
1023
- | Sealed columns | a lookup column matched as a read matches it; a null test passes; any other predicate on a sealed column is refused |
1023
+ | Sealed columns | on a chain, a lookup column matched as a read matches it; a null test passes; any other predicate on a sealed column is refused. In `updateWhere`'s or `deleteWhere`'s filter every sealed column is refused, lookup included |
1024
+ | The rows back | `updateWhereReturning(filter, patch)` is `updateWhere` resolving `readonly Row[]`: on Postgres one `update … returning *` decides, with no explicit lock, and `[]` is nothing matched. It takes the equality filter, not a chain, and `updateWhere`'s guards: a sealed column in that filter is `X_ENTITY_SEALED_PREDICATE`, a lookup column included (the row above is a chain's). On Postgres a `count(*)` goes first unless the filter names the whole primary key and no rule only the app can judge is declared; a count past `MAX_ASSERTED_ROWS` is refused (`X_INVARIANT_VIOLATED`). A transaction rolls back if concurrent changes increase the result past that bound. A `defineDriver` store refuses before writing because it reports counts only. On a hand-written `Repo` it is optional: absent, the call is refused with nothing written |
1024
1025
 
1025
1026
  ### A different value per row is `updateMany`
1026
1027
 
@@ -1100,7 +1101,7 @@ well as data for one.
1100
1101
 
1101
1102
  | Rule | Detail |
1102
1103
  |---|---|
1103
- | Tier | `reference` ships to production through this same command; `dev` is fixture data and is the default. `x db seed` runs `reference` alone under `ULTIMATE_ENV=production` — naming `--tier dev` (or `ULTIMATE_SEED_TIER=dev`) is both the selection and the consent → [CLI reference](CLI-Reference#x-db) |
1104
+ | Tier | `reference` ships to production through this same command; `dev` is fixture data and is the default. `x db seed` runs `reference` alone under `ULTIMATE_ENV=production` — naming `--tier dev` (or `ULTIMATE_SEED_TIER=dev`) is both the selection and the consent → [CLI reference](CLI-Reference-Data#x-db) |
1104
1105
  | Transaction | one per seed, never one around the run: a seed that throws must not roll back the seeds that already landed |
1105
1106
  | `createdAt` | an `upsert` that lands on a stored row does **not** overwrite it. A replay must not move when a row first arrived; `preserve: [...]` names other columns to spare |
1106
1107
  | Tenancy | `upsert` on a tenant-scoped entity needs the tenant column inside `by`, else `X_TENANCY_UNSCOPED` — the same rule `upsertAll` carries. `insert` has no such requirement: `do nothing` writes nothing to a row it does not own |
package/wiki/FAQ.md CHANGED
@@ -33,7 +33,7 @@ What it does **not** claim:
33
33
 
34
34
  ### What is actually finished?
35
35
 
36
- All 30 packages, implemented and tested — not skeletons. The eight primitives, HTTP, rendering, caching, realtime tiers 1–3 (tier 3 opt-in, since 21.0.0), auth, mail, storage, jobs, the AI-first surface (MCP, `llm()`, evals), and admin + generators + `x new`. Milestones 0–11 are ✅ and enforced by `x verify`'s `roadmap` step; milestone 11's deploy proof closed `As of 2026-09-24`, when `ci.yml`'s `deploy-proof` job upgraded an app in kind with 0 of 9,028 requests failed (Compose is the single-node rung and makes no invisible-restart claim). Each milestone ends in a **working demo app plus green `x verify`**, and the same demo app grows through all twelve. [`docs/idea/14-roadmap.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/14-roadmap.md) is the source of truth for those markers.
36
+ All 31 packages, implemented and tested — not skeletons. The eight primitives, HTTP, rendering, caching, realtime tiers 1–3 (tier 3 opt-in, since 21.0.0), auth, mail, storage, jobs, the AI-first surface (MCP, `llm()`, evals), and admin + generators + `x new`. Milestones 0–11 are ✅ and enforced by `x verify`'s `roadmap` step; milestone 11's deploy proof closed `As of 2026-09-24`, when `ci.yml`'s `deploy-proof` job upgraded an app in kind with 0 of 9,028 requests failed (Compose is the single-node rung and makes no invisible-restart claim). Each milestone ends in a **working demo app plus green `x verify`**, and the same demo app grows through all twelve. [`docs/idea/14-roadmap.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/14-roadmap.md) is the source of truth for those markers.
37
37
 
38
38
  ### What is left?
39
39
 
@@ -244,4 +244,4 @@ $ x verify
244
244
 
245
245
  ## Status
246
246
 
247
- `As of 2026-08-23`. Stable API — semver from here ([Upgrading](Upgrading); `x upgrade` moves one major per run). The repository holds 30 `@ultimat3/*` packages plus the unscoped `create-ultimate` and versions all 30 in lockstep. Every major so far has been a correctness sweep with no codemod, so each `BREAKING —` entry names its own manual edit; [Upgrading](Upgrading) walks all of them, oldest first, and each section states its own count. Only the [footer](_Footer) stamps a version number, and this page states none. **What `bunx create-ultimate myapp` installs is npm's `latest`**, one version for all 31 workspaces, each published by the release workflow over OIDC with a provenance attestation. Resolve it, do not trust this line — `npm view @ultimat3/core version`, and `npm view @ultimat3/core dist.attestations` for the attestation. **No publication holes**: `@ultimat3/scraping` was the last never-published package, bootstrapped by hand at 2.0.0, so `bun add @ultimat3/scraping` resolves. Milestones 0–10 are ✅; milestone 11 is 🚧, open on its two-platform deploy proof. Realtime tiers 1–2 ship, and tier 3 (local-first) shipped in 21.0.0, opt-in per entity (`entity(name, { persist: true })`). The 50k-socket forced-restart benchmark **is measured and committed** — first patch on the reconnected socket at p50 54.0s / p90 105.5s, on one node; delivery is a second run, 10,000 clients, 1,666,882 patches, 0 observed sequence gaps ([Realtime](Realtime)). Status markers come from [`docs/idea/14-roadmap.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/14-roadmap.md). See [FAQ](FAQ).
247
+ `As of 2026-08-23`. Stable API — semver from here ([Upgrading](Upgrading); `x upgrade` moves one major per run). The repository holds 31 `@ultimat3/*` packages plus the unscoped `create-ultimate` and versions all 30 in lockstep. Every major so far has been a correctness sweep with no codemod, so each `BREAKING —` entry names its own manual edit; [Upgrading](Upgrading) walks all of them, oldest first, and each section states its own count. Only the [footer](_Footer) stamps a version number, and this page states none. **What `bunx create-ultimate myapp` installs is npm's `latest`**, one version for all 32 workspaces, each published by the release workflow over OIDC with a provenance attestation. Resolve it, do not trust this line — `npm view @ultimat3/core version`, and `npm view @ultimat3/core dist.attestations` for the attestation. **No publication holes**: `@ultimat3/scraping` was the last never-published package, bootstrapped by hand at 2.0.0, so `bun add @ultimat3/scraping` resolves. Milestones 0–10 are ✅; milestone 11 is 🚧, open on its two-platform deploy proof. Realtime tiers 1–2 ship, and tier 3 (local-first) shipped in 21.0.0, opt-in per entity (`entity(name, { persist: true })`). The 50k-socket forced-restart benchmark **is measured and committed** — first patch on the reconnected socket at p50 54.0s / p90 105.5s, on one node; delivery is a second run, 10,000 clients, 1,666,882 patches, 0 observed sequence gaps ([Realtime](Realtime)). Status markers come from [`docs/idea/14-roadmap.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/14-roadmap.md). See [FAQ](FAQ).
package/wiki/Home.md CHANGED
@@ -108,7 +108,7 @@ Follow in order. Each page states what it was executed against in its own first
108
108
  | [I18n](I18n) | flat catalogs, loud misses, locale routing, `hreflang` |
109
109
  | [Theming](Theming) | 24 semantic colour roles as RGB channels, every token scale, breakpoint and layout mixins, `defineTheme()`, what contrast is gated |
110
110
  | [Interface rules](Interface-Rules) | how a screen must behave, and which of the app's `guards/` refuses each rule |
111
- | [UI components](UI-Components) | the four page composites, and the generated catalog of 100 source-derived UI components |
111
+ | [UI components](UI-Components) | the four page composites, and the generated catalog of 101 source-derived UI components |
112
112
  | [Timezones and dates](Timezones-And-Dates) | store UTC, format with an explicit IANA zone, frozen clocks in tests |
113
113
  | [Money](Money) | `Money = { minor, currency }`, never a float |
114
114
  | [Outbound HTTP](Outbound-HTTP) | `outbound()`: one vendor call with a whole-call deadline, the caller's signal, safe-only retry, idle and byte bounds, `dial: 'public'` pinning, and `breaker()` |
@@ -157,6 +157,6 @@ Follow in order. Each page states what it was executed against in its own first
157
157
  | [`docs/ops/`](https://github.com/developerz-ai/ultimate/tree/main/docs/ops) | running an app for real: the PaaS → Compose → Kubernetes ladder, secrets, observability, datastore sizing, disaster recovery, runbooks. **Recommendations only** — the framework depends on none of it |
158
158
  | [`docs/idea/16-app-targets.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/16-app-targets.md) | three targets, one backend, two view layers — **design only, not shipped behaviour** |
159
159
  | [`docs/idea/17-scale-ladder.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/17-scale-ladder.md) | why the app code is identical at rung 0 and rung 4 — **shipped, not design only**: all 26 seam rows are marked shipped, rungs 0–2 are real, and the places the invariant breaks today are named |
160
- | [`packages/ui/CATALOG.md`](https://github.com/developerz-ai/ultimate/blob/main/packages/ui/CATALOG.md) | the full catalog of 100 source-derived UI components with every prop, generated from source and drift-tested |
160
+ | [`packages/ui/CATALOG.md`](https://github.com/developerz-ai/ultimate/blob/main/packages/ui/CATALOG.md) | the full catalog of 101 source-derived UI components with every prop, generated from source and drift-tested |
161
161
  | [`framework.manifest.json`](https://github.com/developerz-ai/ultimate/blob/main/framework.manifest.json) | every package, tier, and `X_*` code with its owner — generated |
162
162
  | [llms.txt](https://github.com/developerz-ai/ultimate/blob/main/llms.txt) | the machine-readable repo map for agents |
package/wiki/I18n.md CHANGED
@@ -1,15 +1,18 @@
1
1
  # I18n
2
2
 
3
- Flat key catalog, one JSON file per locale. Loud misses. `Intl.*` for anything that is not a string.
3
+ Flat key catalog: one JSON file per locale, or one directory per locale with a file per namespace. Loud misses. `Intl.*` for anything that is not a string.
4
4
 
5
5
  Zero hardcoded user-facing strings — every string an end user can read goes through `t()`. A literal in JSX or in an error message is a lint failure and fails `x verify`.
6
6
 
7
7
  ## Catalogs
8
8
 
9
- One file per locale, flat dot-keys after load, nested for authoring.
9
+ One file per locale, or one directory of namespace files per locale; flat dot-keys after load, nested for authoring.
10
10
 
11
11
  ```
12
12
  packages/i18n/src/catalogs/en.json # framework strings — ships inside @ultimat3/i18n
13
+ packages/i18n/src/catalogs/ro.json # …and in Romanian, Spanish, Brazilian Portuguese
14
+ packages/i18n/src/catalogs/es.json
15
+ packages/i18n/src/catalogs/pt-BR.json
13
16
  packages/i18n/catalogs/en.json # the app's own catalogs, same shape
14
17
  packages/i18n/catalogs/es.json
15
18
  ```
@@ -31,9 +34,39 @@ packages/i18n/catalogs/es.json
31
34
  | Key segments | `/^[A-Za-z0-9_-]+$/` — anything else is `X_CATALOG_INVALID` |
32
35
  | Leaves | strings only. An array or a number leaf is `X_CATALOG_INVALID` |
33
36
  | Collisions | a nested branch and a dotted key that flatten to the same path throw |
34
- | Merge order | framework catalog first, app catalog last — apps override framework keys. **Under `en` only**: the framework catalog is English, so `defineCatalogs` seats it under core's `DEFAULT_LOCALE` (`en`) and nowhere else. An app shipping only `es` renders `⟦errors.notFound.title⟧` for a framework key it has not translated, which is the golden rule working — it used to be served English with `isMiss` reading `false`, a fallback locale chain wearing registration as a disguise |
37
+ | Merge order | framework catalog first, app catalog last — apps override framework keys. **Each under the language it is written in**: the framework ships `en`, `ro`, `es` and `pt-BR` (`FRAMEWORK_CATALOGS`, `As of 2026-11`), and an app catalog stands on the one in its LANGUAGE, matched on the canonical tag — `pt-br` on `pt-BR`, `es-MX` on `es`. Nothing to wire: `defineCatalogs({ locales: { ro } })` is enough for `ui.*`, `errors.*`, `auth.*`, `admin.*` in Romanian. Only `en` is seated on its own; `ro` is never in `registeredLocales()` of an app that did not register it. A language the framework does not ship (`de`) renders `⟦errors.notFound.title⟧` for a framework key the app has not translated — the golden rule working, never English with `isMiss` reading `false` |
38
+ | Framework locales | every shipped catalog carries every `en` key with the same `{placeholders}`, plus a language's own plural forms (`ro`'s `_few`); `framework-locales.test.ts` refuses a gap |
35
39
  | `en` | the reference locale. Its key set is what every other locale is diffed against |
36
40
 
41
+ ### Split catalogs
42
+
43
+ A locale is ONE of two forms, never both. `As of 2026-11`.
44
+
45
+ | Form | On disk | Index imports |
46
+ |---|---|---|
47
+ | flat (what `x new` writes) | `packages/i18n/catalogs/<locale>.json` — every namespace in one file | `import en from '../catalogs/en.json';` |
48
+ | split | `packages/i18n/catalogs/<locale>/<namespace>.json` — one file per namespace, holding that namespace's subtree, plus a generated `index.ts` | `import { catalog as en } from '../catalogs/en';` |
49
+
50
+ ```
51
+ packages/i18n/catalogs/en/billing.json # { "plans": { "pro": "Pro" } } → billing.plans.pro
52
+ packages/i18n/catalogs/en/site.json # { "footer": "…" } → site.footer
53
+ packages/i18n/catalogs/en/site/home.json # { "title": "Home" } → site.home.title
54
+ packages/i18n/catalogs/en/index.ts # generated: joins the three, never hand-edited
55
+ ```
56
+
57
+ Split when one file gets too long to review or every branch collides in it: each feature then edits its own namespace file.
58
+
59
+ | Rule | Detail |
60
+ |---|---|
61
+ | Migrate | `bunx x i18n split` moves every flat locale (`bunx x i18n split es`: one) into its directory, rewrites `packages/i18n/src/index.ts`'s import, widens `.gitattributes`' catalog merge rule, and deletes the flat file. Lossless — the files join back to the exact catalog — and idempotent: on a split locale it only re-derives the barrel. No reverse command |
62
+ | A file's keys | its path under the locale directory is the key prefix: `site/home.json` holds `site.home.*`. A folder is a deeper namespace, opt-in: move a subtree into it by hand, then `bunx x i18n split <locale>` re-derives the barrel |
63
+ | Top-level keys | a split locale has none: every key lives under a namespace. `split` refuses a flat catalog with a top-level string key (`X_CATALOG_INVALID`) — nest it first (`common.<key>`) |
64
+ | Both forms | `<locale>.json` beside `<locale>/` is `X_CATALOG_LAYOUT_MIXED` on every read; `bunx x i18n split <locale>` folds the file into the directory |
65
+ | One key, two files | the same key in two files, or a leaf one file defines that another file nests under (`site.home` in `site.json`, `site/home.json` beside it), is `X_CATALOG_KEY_DUPLICATE`, naming both files |
66
+ | The barrel | `catalogs/<locale>/index.ts`: one import and one object entry per file, so `typeof en` is still the typed key space and Bun builds it like any module. Every `x i18n` command and every `x g` re-derives it; `x merge-driver` merges two branches' new namespaces in it |
67
+ | Writers | `x i18n sync` and `x g` put each key in the existing file of its longest prefix, else in its namespace's own file, created; `x i18n add <locale>` starts the new locale in the default locale's form, one file per namespace the default has |
68
+ | Findings | name the locale directory (`es/`), and the parity findings the namespace file (`es/billing.json`) |
69
+
37
70
  ## `t()`
38
71
 
39
72
  ```ts
@@ -133,9 +166,10 @@ framework's diagnostic text changes without a semver signal, the rule names do n
133
166
 
134
167
  | Command | Does |
135
168
  |---|---|
136
- | `x i18n add <locale>` | create `catalogs/<locale>.json` seeded with every default-locale key, each value copied inside `⟦…⟧` |
169
+ | `x i18n add <locale>` | create `catalogs/<locale>.json` (or `catalogs/<locale>/`, when the default locale is split) seeded with every default-locale key, each value copied inside `⟦…⟧` |
137
170
  | `x i18n sync <locale>` | add keys the locale is missing; a key it already has is never overwritten, translated or not; never deletes. An admin key it adds that the default locale's file lacks is added there too, with the string that locale renders, so every catalog keeps one key set |
138
171
  | `x i18n check --json` | extract keys from source, diff against every catalog and against `en`, report missing / unused / dynamic / slot mismatch / untranslated |
172
+ | `x i18n split [<locale>]` | move flat catalogs into one file per namespace ([Split catalogs](#split-catalogs)) |
139
173
 
140
174
  Every command supports `--json`. `add` and `sync` copy the source value inside the marker, so the text sits where the translation goes and `x i18n check` counts the key as missing until a person replaces it. Source means every shape below; a key only a mail or a push names is a key.
141
175
 
@@ -158,7 +192,7 @@ Any other value of these is listed `dynamic`.
158
192
  | `slot mismatch` | two locales define one key with different interpolation slots — the slot sets are compared by name, so the same slots in another order are not a mismatch | non-zero, one `X_CATALOG_SLOT_MISMATCH` finding per direction |
159
193
  | `untranslated` | a locale still carries the reference locale's value — byte-identical to it and longer than 24 characters | non-zero, one `X_CATALOG_UNTRANSLATED` finding per key |
160
194
 
161
- The last two are the parity rules, and both compare a locale with the reference locale `en` (`As of 2026-10`). A key `en` defines and another locale lacks is a missing key, not a parity finding, and that holds for a key only reached dynamically (`t(`plans.${plan}.name`)`). A key only another locale defines is `unused` there. A `⟦key⟧` placeholder is a missing key too — never a copy. Every finding names the locale, the catalog key and the file `packages/i18n/catalogs/<locale>.json`; `x verify`'s `i18n` step and `x i18n check` report them from one implementation, so the command and the gate answer about an app with one voice.
195
+ The last two are the parity rules, and both compare a locale with the reference locale `en` (`As of 2026-10`). A key `en` defines and another locale lacks is a missing key, not a parity finding, and that holds for a key only reached dynamically (`t(`plans.${plan}.name`)`). A key only another locale defines is `unused` there. A `⟦key⟧` placeholder is a missing key too — never a copy. Every finding names the locale, the catalog key and the file `packages/i18n/catalogs/<locale>.json` (a split locale: its namespace file); `x verify`'s `i18n` step and `x i18n check` report them from one implementation, so the command and the gate answer about an app with one voice.
162
196
 
163
197
  Before any of the five, `check` resolves `@ultimat3/i18n` from the app root, from every workspace and from the CLI itself. Two real directories is `X_PACKAGE_DUPLICATED`, and every registration gap is then reported as the install's fault with the install's fix (pin one version, `bun install`) — not as a misplaced `defineCatalogs()`: each copy keeps its own registry, so the app registers into one and the check reads the other.
164
198
 
@@ -201,7 +201,7 @@ Read tools are unrestricted in dev; write tools are scoped to branch environment
201
201
 
202
202
  | Task | Command |
203
203
  |---|---|
204
- | Framework version bump | `x upgrade --json`, one major per run ([CLI reference](CLI-Reference#x-upgrade)). An app below 30.0.0 has no such command yet: `bunx @ultimat3/cli@latest upgrade --json` |
204
+ | Framework version bump | `x upgrade --json`, one major per run ([CLI reference](CLI-Reference-Tools#x-upgrade)). An app below 30.0.0 has no such command yet: `bunx @ultimat3/cli@latest upgrade --json` |
205
205
  | Check what a bump would change | `x upgrade --dry-run --json`: the pins, the Bun floor edits and the section to read. Writes nothing, runs no gate |
206
206
  | Remove dev state (embedded PG, storage, caches) | `rm -rf .x` |
207
207
  | Remove the CLI | it ships with the app; deleting the repo is the uninstall |
@@ -500,6 +500,33 @@ export const syncAccount = job({
500
500
  | a proven wake is proven again | every `reproveEveryMs` (10 s) one notification per channel that wakes no loop. A session that stops delivering with no re-dial (half-open) announces nothing; not back within `verifyTimeoutMs` (5 s) of the SEND, the wake is un-proven, `jobs.wake.lost` (`warn`) is logged and the loops return to the 2 s poll until a notification crosses again (`jobs.wake.live`). A pool that has not sent the proof by then is no verdict: a saturated pool cannot be told from a dead session, so the wake stays proven and the proof is sent again, with its own window, once the pool answers. `startQueueWake`, `packages/jobs/src/queue-wake.ts`, `As of 2026-11` |
501
501
  | a queue pause | read by the claim statement itself, so it holds from each worker's next claim; a resume announces the queue |
502
502
 
503
+ ### A tenant's own job — `jobStatusFor` and `cancelJobFor`
504
+
505
+ The operator surface takes an id and no tenant. An end user's status page or cancel button takes these two (`As of 2026-11-27`), from the app's own `query` and `action` under its own policy — functions, not a factory: who may read or cancel is policy.
506
+
507
+ ```ts
508
+ import type { JobDriver } from '@ultimat3/jobs';
509
+ import { cancelJobFor, jobStatusFor } from '@ultimat3/jobs';
510
+
511
+ declare const driver: JobDriver;
512
+ declare const jobId: string;
513
+ declare const orgId: string;
514
+ declare const actorId: string;
515
+
516
+ const status = await jobStatusFor(driver, { jobId, tenantId: orgId, name: 'posts.export' });
517
+ const after = await cancelJobFor(driver, { jobId, tenantId: orgId, reason: `by ${actorId}` });
518
+ ```
519
+
520
+ | Rule | |
521
+ |---|---|
522
+ | what `JobStatus` carries | `id`, `name`, `state`, `attempt`, `maxAttempts`, `progress`, `runAt`, `createdAt`, `updatedAt` — never `input`, `lastError`, its stack, `traceparent` or `enqueuedBy` |
523
+ | another tenant's job, a `tenant: 'none'` job, a missing id | all `undefined`: the fence is in the store (`JobDriver.tenantJobs` — Postgres, Redis and memory), one lookup, one answer |
524
+ | `name` | part of the fence when given: an export endpoint answers for exports only |
525
+ | `cancelJobFor` | cancels a LIVE job only and answers it as it now stands (`cancelled`, or how it had already ended); another tenant's job is a no-op answering `undefined`, never `X_JOB_NOT_CANCELLABLE` |
526
+ | a hand-rolled driver with no `tenantJobs` | `X_JOB_INTROSPECTION_UNSUPPORTED` |
527
+
528
+ The worked recipe: the reference app's `postsExportStatus` query and `cancelPostsExport` action (`examples/dummy/apps/web/app/posts/export-job.ts`) — `requestPostsExport` answers the `jobId`, an id the org does not own is one 404, `X_POSTS_EXPORT_NOT_FOUND`, whether it exists or not.
529
+
503
530
  ## Exports and imports — `exportRows()` and `importRows()`
504
531
 
505
532
  **A bulk file in either direction is a job.** `exportRows()` streams a paged read to object
@@ -602,6 +629,7 @@ export const exportMember = subjectExport({
602
629
  | a kept row under a deleted parent is refused | it would block the delete (`restrict`) or be cascaded away; `'delete'`, or anonymize the key to `null` |
603
630
  | children first, the subject last; one step per page of parent keys | a killed run resumes at the page it stopped on; every write is an equality on one key, so a replay changes nothing twice |
604
631
  | a loop of deleted tables needs one nullable key | it is cleared first; none is `X_SUBJECT_CYCLE` |
632
+ | the subject may be the tenant itself (`defineSubject(orgs, …)`) | a child whose tenant column is the foreign key to it is read with `eq` on the actor's org, the one predicate the tenant guard accepts there; the job's `tenant` must be that org |
605
633
  | a table with no foreign key to the person is invisible | list it: `columns: { audit_copies: 'memberId' }`, then it needs a treatment too |
606
634
  | a deleted or anonymized table's `<table>_history` is reached too (`As of 2026-11`) | the write records the person in one more before image, and `row_id` is no foreign key. `'delete'` removes every history row whose `before` or `after` image names the subject (`@>` on the parent's key column, tenant-scoped — so a row deleted, soft-deleted or inserted before the erase is reached too) in the parent's own step and transaction, after the write — the one delete the append-only guard lets through (`x.purge` on Postgres, `purgingHistory` in memory); `{ retain: '<why>' }` keeps and counts the same rows; `anonymize` is `X_SUBJECT_TREATMENT_INVALID`, undeclared `X_SUBJECT_TABLE_UNDECLARED`. |
607
635
  | a deleted table's own delete purges the images Postgres writes into a child's history (`As of 2026-11`) | `on delete set null` or `cascade` rewrites a child row, and the child's trigger records the person's key in its before image. A child history declared `'delete'` loses those images in the parent's step and transaction (`orphansOf`, `packages/jobs/src/subject-plan.ts:341`; `packages/jobs/src/subject-erase-history.ts`). Limits: the memory driver applies no `onDelete` action, so a kept child keeps the erased key there; a child history declared `{ retain }` is counted only for writes to its own table — the images a set-null or cascade write records into it are neither purged nor counted |
@@ -933,7 +961,7 @@ Draining a worker mid-job does **not** finish the current step (`As of 2026-09-0
933
961
  | `/_x` dev panel | queue depth per queue, in-flight, failed, step timeline per job, and the whole `x_backfills` ledger with a live count |
934
962
  | `x jobs list --json` | one row per job: state, queue, attempts, `runAt`, idempotency key — plus the `backfill()` passes **in flight**, with rows so far and cursor |
935
963
  | `x jobs show <id> --json` | machine-readable state, step results, next retry, dead-letter reason, and this run's ledger row under `backfill` when the job is a backfill |
936
- | `x db backfill --list --json` | the whole ledger: one row per pass, newest first → [CLI reference](CLI-Reference#x-db) |
964
+ | `x db backfill --list --json` | the whole ledger: one row per pass, newest first → [CLI reference](CLI-Reference-Data#x-db) |
937
965
  | MCP dev tools | `jobs.inspect` (definitions, retry policy, steps) and `queue.depth` (pending/running/failed per queue) — scope `dev:read`, never reachable in `ROLE=web` |
938
966
  | OpenTelemetry | one span per job, one child span per step, trace linked to the enqueuing request |
939
967
  | Metrics | `queue_depth{queue}`, `queue_demand{queue}` (what the worker HPA reads), `jobs_total{queue,outcome}`, `jobs_retried_total{job,code}` (one per retried attempt; `code` is the thrown `X_*`, or `uncoded`), `job_leases_lost_total{queue}` → [Observability](Observability) |
@@ -22,7 +22,7 @@ are on an earlier version, treat those rows as open and take the workaround. `[U
22
22
  truth for what the next release carries, and most of what it fixes was never a row here. Read that section rather than this sentence: `grep -n '^## '
23
23
  CHANGELOG.md` finds its bounds, and it changes on any commit.
24
24
 
25
- **Publication is not a gap.** All 31 workspaces are on the registry, every one with a provenance attestation, `As of 2026-11-10` by `bun run scripts/registry-audit.ts --json`, which `registry-audit.yml` re-runs daily;
25
+ **Publication is not a gap.** All 32 workspaces are on the registry, every one with a provenance attestation, `As of 2026-11-10` by `bun run scripts/registry-audit.ts --json`, which `registry-audit.yml` re-runs daily;
26
26
  `@ultimat3/scraping` was the last never-published package and was bootstrapped by hand at 2.0.0
27
27
  ([`PUBLISHING.md`](https://github.com/developerz-ai/ultimate/blob/main/PUBLISHING.md) step 1).
28
28
  `bun add @ultimat3/scraping` resolves — check it with `npm view @ultimat3/scraping version`.
@@ -35,8 +35,12 @@ Every row carries its decision, `As of 2026-11-18`: **build** is owed work, a de
35
35
  |---|---|---|---|
36
36
  | A pod evaluates the framework from **source**, one module at a time — ~28 Mi of resident memory per pod that a bundle would not hold | deferred | `As of 2026-10-01`, measured on the framework serve graph alone: 1,071 modules from source settle at **80.4 Mi**; the same graph as one `bun build --target=bun` file is 5 modules and settles at **51.8 Mi** — ~34 kB of RSS per source module, the runtime's cost and not the code's. It is the largest saving left after the per-role load and the prebuilt store (a web pod of the demo app settles at 97–102 Mi, a worker at 80–85 Mi). **Not a patch**: a registry is a module instance, so the framework bundled apart from the app is two `@ultimat3/jobs`, two `@ultimat3/entity` — the app registers into one and the boot reads the other. The unit has to be the app **and** the framework as one graph, per role, built inside the image build from a generated entry that imports what `scanAppModules` would, with the `.tsx`/`.scss` loaders as build plugins. Containers only either way (axiom 7). Design note: [`docs/architecture/13-topology-runtime.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/architecture/13-topology-runtime.md#not-built-one-bundle-per-role). Deferred `As of 2026-11-18`: it changes what an image contains and how a role resolves its app, so it needs a plan of its own. pin: none — a resident-memory measurement of a running pod, not a behaviour a unit test can assert | nothing to do in an app. Size a pod's memory request from `process_resident_memory_bytes` on `/metrics`, not from a guess |
37
37
  | Every role evaluates all of `@ultimat3/jobs` — 96 modules (`As of 2026-10-02`, by file) — whatever it runs | deferred | `As of 2026-10-01`, read off the serve graph by the names each role's code uses: a `web` pod needs 43 of them (enqueue, the outbox relay, the purge task), a `scheduler` 46, a `worker` 62. The rest ride the barrel: `worker.ts` and its eighteen dependencies in a web pod, the `backfill()` / `exportJob()` / `webhook()` factories (17 modules, 123 kB of source) in an app that declares none, and the memory driver (3 modules) outside a test. ~1.6 Mi per web pod at the measured 34 kB a module. Closing it means subpath entries (`@ultimat3/jobs/worker`, one per factory) and every importer rewritten — a breaking move for a saving the per-role bundle above makes moot, so it waits on that decision. The operator surface is **not** in this list: `JobIntrospection` is a member of the driver, and the worker announces itself and counts settles through it pin: none — a module count read off a role's serve graph, measured rather than asserted | nothing to do in an app |
38
+ | A lone island is bundled without code splitting, so Bun inlines every dynamic `import()` — `ShaderBackground` then carries all three presets (~4.3 kB min) | deferred | `As of 2026-11-28`, measured by `scripts/effects-bytes.test.ts` against `packages/cli/src/island-bundle.ts` | put the `ShaderBackground` island on a page with a second island, which builds with splitting; or accept the 4.3 kB. [pin](https://github.com/developerz-ai/ultimate/blob/main/scripts/effects-bytes.test.ts#known%20gap%3A%20an%20unsplit%20build%20%28a%20lone%20island%29%20inlines%20every%20preset%20into%20the%20entry) |
38
39
  | `onSettled` for a completion that **returned a value** runs at most once across a crash | deferred | `As of 2026-11-14`. Every other ending is at least once: the write that settles the row records the debt (`x_jobs.settle_owed`) and the scheduler leader re-drives a dead worker's with `redriven: true, reason: 'lost'` — failures, dead letters, refusals, completions whose body returned `undefined`, and the rows the CLAIM settles (a final-attempt lease lapse buried `dead`, an expired row: `ClaimOptions.settleOwed`, `packages/jobs/src/claim-exhausted.ts`). A body's return value is never stored (`x_jobs` has no result column), so a re-drive could only hand `result: undefined` to a hook typed for a value; on a minor that would break every `onSettled` reading `result`. Storing the result, and so at-least-once for every completion, is planned for `next` [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/jobs/src/settle-redrive.test.ts#a%20completion%20that%20returned%20a%20value%20owes%20nothing%3A%20told%20once%2C%20at%20most%20once) | write what must be recorded for certain inside the body, in a `step.run`; or have the body return nothing and read what it wrote from there |
39
40
  | A `step.run` output past 256 KiB is stored with a warning, not refused | deferred | `As of 2026-11-12`. Undeclared, `STEP_OUTPUT_MAX_BYTES` logs `jobs.step.output-too-large` (`X_STEP_OUTPUT_TOO_LARGE`) once per job and step and stores the output, because refusing by default would fail shipped jobs on a minor; every attempt still loads it. Refusal by default is planned for `next` [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/jobs/src/steps-output.test.ts#the%20default%20256%20KiB%20warns%20once%20per%20job%20and%20step%2C%20with%20the%20code%2C%20and%20still%20stores) | declare `job({ stepOutputMax: 262_144 })` to be refused now, and persist the payload, returning its key from the step |
41
+ | A live cursor with no signature still resumes from where it left off | deferred | `As of 2026-11-27`. Since 31.52.0 a cursor carries `sig`, an HMAC over its position; a mismatched one cold-starts. A cursor with no `sig` — a client built before it, or one that removed its own — still takes the delta path and is counted (`registry.unsignedCursors`, `onUnsignedCursor`), because refusing it would cold-start every open tab on a minor. Treating anything but a matching `sig` as a cold start flips on `next` (#1280) [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/realtime/src/live-resume-signed.test.ts#takes%20the%20legacy%20path%20%E2%80%94%20a%20delta%20%E2%80%94%20and%20is%20counted) | watch `onUnsignedCursor`: it counts every resume that sends no `sig` at all — an old build, or a client that stripped its own — so zero means nothing resumes unsigned, not only that every client is upgraded |
42
+ | An input key the schema does not declare is dropped with a warning, not refused | deferred | `As of 2026-11-27`. An action's or query's parse logs `X_INPUT_UNKNOWN_KEY` once per primitive and path set, naming the nearest declared key, and answers exactly as without the key: refusing it would fail shipped callers on a minor. The refusal (`X_INPUT_INVALID` naming the nearest key) flips on `next` (#1281) [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/action/src/validate-unknown-keys.test.ts#over%20HTTP%3A%20200%2C%20the%20same%20bytes%20as%20without%20it%2C%20and%20one%20warning%20naming%20%60limit%60) | grep the logs for `input.unknown_key` and fix each caller before the major |
43
+ | A device hello with no `v` is read as wire version 1 | deferred | `As of 2026-11-27`. `DEVICE_WIRE_VERSION` is 1 and a hello may omit `v`, because every node shipped before it does; a newer `v` is closed with `X_DEVICE_WIRE_VERSION`. Requiring `v` flips on `next` [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/realtime/src/device-agent.test.ts#a%20hello%20at%20the%20spoken%20version%2C%20or%20with%20no%20v%2C%20beats%20and%20stays%20open) | send `v: 1` in every hello (`@ultimat3/realtime/wire/device-v1.json`) |
40
44
 
41
45
  ## Open by decision
42
46
 
@@ -76,7 +80,7 @@ Each of these is a defect, or a target, somebody has already argued about, and t
76
80
  | A `stream` page with a realtime island keeps every island on the page inert until its slowest hole closes | `As of 2026-11-02`. The runtime goes `async` so a shell island answers while a hole is open, but only with no realtime boot in the document: the boot (`script defer`) has to run first (`bootScript`, [`packages/cli/src/route-islands.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/src/route-islands.ts)), and a deferred script waits for parsing to end. Bound by the hole's 15 s deadline. **Why it stays** (`As of 2026-11-18`): The realtime boot has to run before the hydration runtime (`streamScripts`, `packages/cli/src/route-islands.ts`), or an island mounts over a store not yet restored, and a deferred script waits for parsing to end. `DEFAULT_HOLE_TIMEOUT_MS` bounds the wait. **Do instead:** keep the slow read out of such a page's holes, or give it a short deadline of its own: `fetch(url, { signal: AbortSignal.timeout(2_000) })`. |
77
81
  | An open tab can meet a dead island across a deploy | `As of 2026-11-12`. A web process serves only the hashed files it built, so with `assets.retain` unset (the default) a tab holding the previous build's document gets a `no-store` 404 for its stylesheet, or for its island chunk on the first click, after every deploy; during a rolling update a new document that reaches an old pod gets no stylesheet either. What the framework does about the stylesheet half without a window: a soft navigation whose next sheet fails never swaps an unstyled page in (a GET becomes a full load, the old sheet stays) [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/render/src/navigation-stylesheet-skew.test.ts#a%20GET%20is%20loaded%20by%20the%20browser%3B%20the%20page%20on%20screen%20keeps%20its%20sheet); a full load whose sheet 404s stays unstyled — the framework does not reload it, as a reload it cannot tell from a missing file offline or under a test harness is a navigation nobody asked for. A web role booted outside development and test with no window logs `X_ASSET_RETAIN_UNDECLARED` [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/src/retained-assets-boot.test.ts#undeclared%3A%20nothing%20is%20published%20and%20there%20is%20no%20reader). Declared, a tab survives six deploys with build 0's island alive [evidence](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/e2e/six-deploys.e2e.test.ts#with%20assets.retain%2C%20the%20click%20boots%20build%200%E2%80%99s%20island%3A%20its%20chunk%20200%2C%20no%20404%2C%20an%20update%20offered) **Why it stays** (`As of 2026-11-18`): Retention needs a disk every web pod reads, and only the app can name one. Undeclared, boot says so by code. **Do instead:** declare `assets: { retain: { disk, builds } }` over a disk every web pod reads → [Deployment](Deployment#hashed-assets-across-a-deploy--assetsretain) |
78
82
  | A job's `runAt` is stamped from the enqueuer's clock | `As of 2026-10`. An enqueuer running ahead of the database delays its own "immediate" jobs; up to 1 s ahead still wakes a worker, beyond that the job starts on the poll. A delayed job enqueued by another process starts within the idle ceiling after its `runAt` — 5 s with a proven wake, 2 s without; only a retry or a sleep the worker itself handed back gets a due-time timer. **Why it stays** (`As of 2026-11-18`): `runAt` comes from the injected `Clock` (`packages/jobs/src/driver-pg.ts`, `enqueue-record.ts`), the one a frozen-clock test drives and the outbox stamps at stage time, before any row exists. A database clock would split those. **Do instead:** NTP on every pod; for a deadline tighter than the ceiling, enqueue at the moment the work is due rather than with `runAt`. |
79
- | The CDP driver cannot PIN a name, and a page's WebSocket is not screened at all | `As of 2026-11`. Measured on Chrome 150 with `localBrowser()`: interception (page-level and the browser-level `Fetch` that now covers popups) never pauses a WebSocket handshake, so `new WebSocket('ws://off-list/…')` from a scraped page connects. Since 31.0.0 a host a wildcard admitted is resolved before the browser leg releases it, and an inward or unresolvable answer is refused (`packages/scraping/src/browser-dial.ts`). But the browser then resolves again for itself, so a name that answers public to the screen and private to Chrome (DNS rebinding) is reached — the HTTP leg and the robots read resolve and pin (`packages/scraping/src/pinned-host.ts`), the browser cannot be pinned through this port — [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/scraping/src/cdp-arm-dial.test.ts#a%20screened%20name%20is%20continued%20by%20request%20id%20only%2C%20never%20pinned%20to%20the%20approved%20address) **Why it stays** (`As of 2026-11-18`): Interception never pauses the handshake and this port cannot hand Chrome a resolved address, so no driver code closes it. The boundary that can is the network's: the `egress` proxy. **Do instead:** list exact hosts rather than `'*'` on a scrape that runs where private addresses are reachable, and dial a scrape through an `egress` proxy outside that network. |
83
+ | The CDP driver cannot PIN a name, and a page's WebSocket is not screened at all — `x design research` and `x shot` too | `As of 2026-11`. Measured on Chrome 150 with `localBrowser()`: interception (page-level and the browser-level `Fetch` that now covers popups) never pauses a WebSocket handshake, so `new WebSocket('ws://off-list/…')` from a scraped page connects. Since 31.0.0 a host a wildcard admitted is resolved before the browser leg releases it, and an inward or unresolvable answer is refused (`packages/scraping/src/browser-dial.ts`). But the browser then resolves again for itself, so a name that answers public to the screen and private to Chrome (DNS rebinding) is reached — the HTTP leg and the robots read resolve and pin (`packages/scraping/src/pinned-host.ts`), the browser cannot be pinned through this port — [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/scraping/src/cdp-arm-dial.test.ts#a%20screened%20name%20is%20continued%20by%20request%20id%20only%2C%20never%20pinned%20to%20the%20approved%20address) **Why it stays** (`As of 2026-11-18`): Interception never pauses the handshake and this port cannot hand Chrome a resolved address, so no driver code closes it. The boundary that can is the network's: the `egress` proxy. **Do instead:** list exact hosts rather than `'*'` on a scrape that runs where private addresses are reachable, and dial a scrape through an `egress` proxy outside that network. |
80
84
  | `ScrapeReport.usage.bytesIn` counts the HTTP leg only | `As of 2026-10`. The CDP port subscribes to requests, not to their sizes, so the browser leg's bytes are not in the figure (`packages/scraping/src/usage.ts`) **Why it stays** (`As of 2026-11-18`): The field is defined as the HTTP leg (`packages/scraping/src/usage.ts`): this port sees requests, not sizes, and a browser figure would be a guess. The extension point is the resolver's `cost`. **Do instead:** treat `bytesIn` as a lower bound; a provider's own byte count, returned through the resolver's `cost`, is the billable one. |
81
85
  | An org-scoped operator's runs list reads `x_jobs` with no index on `tenant_id` | `As of 2026-10`. The jobs dashboard keeps an actor with an `orgId` to its own org's runs through `JobFilter.tenantId`, and `x_jobs.tenant_id` is a plain column: the only index naming it is the idempotency one, led by `name` (`packages/jobs/src/driver-pg-ddl.ts`). A platform operator's list is unaffected [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/jobs/src/driver-pg-sql.test.ts#no%20x_jobs%20index%20leads%20with%20tenant_id%3A%20an%20org-scoped%20runs%20list%20scans) **Why it stays** (`As of 2026-11-18`): Every enqueue would pay one more index on the queue's hottest table for a read only an org-scoped dashboard issues, and the index is one migration for the app that needs it. **Do instead:** on a large queue, add `create index on x_jobs (tenant_id, created_at desc, id desc)` in an app migration, or operate the dashboard as a platform operator (an actor with no `orgId`) |
82
86
  | Retry-from-step on the jobs dashboard is a free-text field | `As of 2026-10`. `job.retry-from-step` takes `{ step: t.string.min(1) }` (`packages/admin/src/jobs/job-actions.ts`); the run's detail page shows its steps, but the form does not offer them as a choice. **Why it stays** (`As of 2026-11-18`): An action's `input` is one static schema shared by the form, the MCP tool and the audit entry, so it has no per-row list of choices to offer. **Do instead:** copy the step name from the run's `steps` section on the same page. |
@@ -4,6 +4,10 @@ The differentiator. Not a chat widget, not an "AI SDK integration" — the frame
4
4
 
5
5
  `As of 2026-08`. Stable API — semver from here ([Upgrading](Upgrading)). The MCP registry, wire protocol, dev-tool catalog, read-only SQL guard, and action projection are built, and so are the four that used to be contracted: `llm()` is an action factory ([`packages/ai/src/llm.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/ai/src/llm.ts)), prompts are versioned, `postgresVectorStore()` fuses pgvector cosine with Postgres FTS via RRF, and evals gate on a committed baseline inside `x verify`'s `eval` step.
6
6
 
7
+ ## The agent kit
8
+
9
+ An app carries the skills and subagents that make an agent useful in it: `.claude/skills/{feature,planx,verify,upgrade,design-research}` and `.claude/agents/{shape,data,server,web,audit}`. They are generated from framework source and name this server's tools (`graph.query`, `tests.run`, `verify.narrow`, `db.explain`, `requests.statements`, `ui.research`), so an agent calls the MCP tool instead of grepping. `bunx x kit` rewrites them, `x upgrade` refreshes them, and `x verify` fails an edited one with `X_KIT_DRIFT`. The table of every entry: [Agents](Agents#the-agent-kit-skills-and-agents-every-app-gets).
10
+
7
11
  ## Built-in MCP dev server
8
12
 
9
13
  `x mcp serve` is the dev-tool server, over stdio or HTTP; `x dev` does not start it. Point any MCP client at it and the agent stops guessing. A new app's `.mcp.json` already names it — [Client config](#client-config).