@ultimat3/cli 31.49.0 → 31.50.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 (53) hide show
  1. package/package.json +30 -30
  2. package/src/api-registration.ts +18 -1
  3. package/src/api-routes.ts +1 -0
  4. package/src/app-load.ts +1 -2
  5. package/src/app-openapi.ts +7 -1
  6. package/src/budgets.ts +2 -1
  7. package/src/cmd-i18n.ts +33 -1
  8. package/src/codemods/engine-fs.ts +9 -2
  9. package/src/codemods/merge-drivers.ts +85 -4
  10. package/src/exercise-services.ts +13 -3
  11. package/src/framework-schema.ts +15 -5
  12. package/src/guard-sources.ts +1 -2
  13. package/src/messages-upgrade.ts +4 -0
  14. package/src/page-navigation.ts +5 -2
  15. package/src/pwa-artifacts.ts +1 -1
  16. package/src/retained-assets-boot.ts +1 -1
  17. package/src/runtime-assets-site.ts +2 -2
  18. package/src/runtime-assets.ts +1 -1
  19. package/src/runtime-render-document.ts +1 -2
  20. package/src/site-asset-routes.ts +2 -2
  21. package/src/site-assets.ts +5 -158
  22. package/src/sw-precache-plan.ts +1 -1
  23. package/src/templates/guard-raw-motion.ts +96 -0
  24. package/src/templates/guard-released-forms.ts +4 -1
  25. package/src/templates/scaffold-repo.ts +1 -1
  26. package/src/test-only-shipped.ts +29 -2
  27. package/src/test-shards.ts +20 -8
  28. package/src/upgrade-coverage-ratchet.ts +95 -0
  29. package/src/upgrade-gate.ts +31 -11
  30. package/src/upgrade-report.ts +14 -0
  31. package/src/verify-e2e.ts +21 -3
  32. package/src/workspace-checks.ts +4 -1
  33. package/wiki/Actions.md +64 -2
  34. package/wiki/Auth.md +6 -2
  35. package/wiki/CLI-Reference.md +8 -2
  36. package/wiki/Client-Navigation.md +34 -4
  37. package/wiki/Configuration.md +2 -1
  38. package/wiki/Entities-And-Migrations.md +12 -2
  39. package/wiki/Home.md +2 -2
  40. package/wiki/I18n.md +1 -1
  41. package/wiki/Interface-Rules.md +3 -1
  42. package/wiki/Known-Gaps.md +1 -1
  43. package/wiki/MCP-And-AI.md +41 -9
  44. package/wiki/Notify.md +4 -2
  45. package/wiki/Outbound-HTTP.md +53 -2
  46. package/wiki/Policies-And-Authz.md +1 -1
  47. package/wiki/Realtime.md +14 -6
  48. package/wiki/Routes-And-Render-Modes.md +1 -1
  49. package/wiki/Static-Assets.md +5 -3
  50. package/wiki/Testing.md +57 -3
  51. package/wiki/Theming.md +6 -3
  52. package/wiki/UI-Components.md +1 -0
  53. package/wiki/Upgrading.md +1 -0
package/src/verify-e2e.ts CHANGED
@@ -7,7 +7,10 @@
7
7
  // `x.verify.json` requires `e2e` and ran nothing for want of a browser is red by `judgeE2eBrowser`,
8
8
  // with the command that installs one.
9
9
 
10
- import { ERROR_DOCS_URL } from '@ultimat3/core';
10
+ // why: Bun ships no synchronous existence check, and `isAppRoot` answers inside a sync predicate.
11
+ import { existsSync } from 'node:fs';
12
+ import { join } from 'node:path'; // why: Bun exposes no path-join primitive.
13
+ import { APP_CONFIG_FILE, ERROR_DOCS_URL } from '@ultimat3/core';
11
14
  import { CHROME_PATH_ENV, chromeCandidates, findChrome } from '@ultimat3/scraping/cdp';
12
15
  import { E2E_ROOT_ENV } from '@ultimat3/testing';
13
16
  import type { ExecResult } from './exec';
@@ -61,11 +64,26 @@ export async function withE2eApp(
61
64
  },
62
65
  run: (e2e: E2eRun) => Promise<ExecResult>,
63
66
  ): Promise<ExecResult> {
64
- const chrome = input.isApp ? await findChrome(input.hostEnv) : undefined;
65
- if (chrome === undefined) return run({ command: input.command, env: input.env });
67
+ if (!(await drivesBrowser(input.isApp, input.hostEnv))) {
68
+ return run({ command: input.command, env: input.env });
69
+ }
66
70
  return run(appE2eRun({ root: input.root, command: input.command, env: input.env }));
67
71
  }
68
72
 
73
+ /** Whether `root` is an app: its `app.config.ts` is what the e2e preload boots. */
74
+ export const isAppRoot = (root: string): boolean => existsSync(join(root, APP_CONFIG_FILE));
75
+
76
+ /**
77
+ * Whether an e2e run drives a browser: an app, on a machine with one. The ONE answer
78
+ * `x verify`'s `e2e` step and `x test`'s e2e pass launch on, so the two never disagree.
79
+ */
80
+ export async function drivesBrowser(
81
+ isApp: boolean,
82
+ hostEnv: Readonly<Record<string, string | undefined>>,
83
+ ): Promise<boolean> {
84
+ return isApp && (await findChrome(hostEnv)) !== undefined;
85
+ }
86
+
69
87
  /** The floored e2e step that ran nothing because this machine has no browser to drive. */
70
88
  export const E2E_BROWSER_MISSING = 'X_VERIFY_E2E_BROWSER_MISSING';
71
89
 
@@ -442,7 +442,10 @@ export async function checkPackageShape(
442
442
  }
443
443
  if (record.private !== true) {
444
444
  findings.push(...(await fixtureReach(root, dir, manifest)));
445
- shipped.push({ dir, entries: entryPatternsOf(manifest) });
445
+ const excluded = filesOf(manifest)
446
+ .filter((entry) => entry.startsWith('!'))
447
+ .map((entry) => entry.slice(1));
448
+ shipped.push({ dir, entries: entryPatternsOf(manifest), excluded });
446
449
  }
447
450
  facts.push({
448
451
  dir,
package/wiki/Actions.md CHANGED
@@ -57,7 +57,7 @@ Declared one per file in a feature's `actions/` (`actions/publish-post.ts`, what
57
57
  | `mcp.description` | `string` | no | the tool description an agent reads, and the OpenAPI `summary`. Contract text, so it stays outside `t()` — `openapi.json` must not depend on a locale. Write it for a stranger |
58
58
  | `mcp.visibleTo` | `readonly string[]` | no | roles that may see the projected tool; a caller whose role is not named gets ToolNotFound, never Forbidden — the policy still decides every call |
59
59
  | `rateLimit` | `{ limit: number \| (({ ctx }) => number \| Promise<number>); windowMs: number }` | no | `limit` may be resolved **per call** from `ctx` (the tenant's plan, read by the app), before any bucket is touched; a resolver answering `NaN`, `0`, `Infinity` or a non-number is `X_RATE_LIMIT_INVALID`, never allow-all. A per-call limit publishes as `rateLimit: null` + `rateLimitPerCall: { windowMs }` in `describe()` and `x-ultimate.rateLimit.limit: 'per-call'` in `openapi.json`. Spent **inside `invoke`**, so the HTTP route, the MCP tool, the in-app agent's tool call and `.job()` draw on ONE bucket — the third call to a `limit: 2` action is `X_RATE_LIMITED` whichever surface it came through; a direct in-process call spends nothing. Keyed actor → org → IP; counted in `@ultimat3/http`'s installed store — the `rateLimitStore` adapter port, filled by the boot on every role, `postgresRateLimitStore` unless `apps/<app>/runtime.ts` names one ([Adapters](Adapters#ratelimitstore)). Over HTTP the refusal is `429` + `Retry-After` and `RateLimit-*`, and the route is not also capped by the `default` bucket; the same `toBucket` conversion feeds `openapi.json`, so the published numbers are the enforced ones. `/mcp` additionally buckets by verb class (`MCP_RATE_LIMITS`, read 120/min, write 20/min per token) |
60
- | `meter` | `{ name, period: 'hour' \| 'day' \| 'month', limit, warnAt?, onWarn? }` | no | a durable per-period allowance — see [Usage meters](#usage-meters-meter). Drawn on **every** surface, `server` included, after the policy and before `handle`; spent, `X_METER_EXCEEDED` (429) |
60
+ | `meter` | `{ name, period: 'hour' \| 'day' \| 'month', limit, warnAt?, onWarn? }` | no | a durable per-period allowance — see [Usage meters](#usage-meters-meter); an amount measured after the work is [`drawMeter`](#programmatic-draws-drawmeter). Drawn on **every** surface, `server` included, after the policy and before `handle`; spent, `X_METER_EXCEEDED` (429) |
61
61
  | `idempotent` | `boolean` | no — **required `true` on a `mutator`** | marks the action safe to retry with an `Idempotency-Key` header — over MCP, the tool's optional `idempotencyKey` argument. Inside a transaction the Postgres store settles the record with the write's own `COMMIT`, so a rollback never leaves a `settled` record behind. A field core redacts by name (`apiKey`, `password`, `*Token`…) or a `Secret` is stored as `[redacted]`, and the replay of such an answer is `X_IDEMPOTENT_REPLAY_REDACTED` |
62
62
  | `http.path` | `string` | no | pins the URL whatever the app's `pathStyle` derives — for a path a caller already holds (`'/api/uploads/signed'`) or a resource-shaped one (`'/orders/:id/refund'`). Lowercase static segments and `:param`s, never `/_x`; each `:param` a REQUIRED `t.string` key of `input:`, else `X_ACTION_HTTP_PATH_INVALID` at registration. The URL's value joins the body before the input is parsed, so the schema, the policy, `row` and the handler read one object; a body naming the key with another value is **400** `X_HTTP_PATH_INPUT_CONFLICT`, never overridden. Under a bearer mount the pin is served at the prefix (`/v1/orders/:id/refund`) — and still at its own path, with the cookie session, as every pin is; the policy decides both. `derivePath(name)` refuses a template; `actionHttpPath(name, { id })` fills it. A `deprecated.replacedBy` naming one is `X_ACTION_DEPRECATION_INVALID`. An inbound webhook is not this door: it is `webhookReceiver()` ([Jobs and workflows](Jobs-And-Workflows#inbound-webhooks)) |
63
63
  | `http.method` | `'POST'` · `'PUT'` · `'PATCH'` · `'DELETE'` | no — `'POST'` | the verb the pin answers; needs `http.path`. `X_ACTION_PATH_DUPLICATE` keys on method and path, so `PUT /orders/:id` and `DELETE /orders/:id` are two actions. `action.client()` sends it and fills the URL from the input (each value one encoded segment, the key left out of the body); `rpc()` by name cannot see a pin. In `openapi.json`: `{id}`, an `in: path` required parameter, the key gone from the request body, the operation under the declared verb. `x.manifest.json` writes `http: { path, method }` for a pin only; moving it is breaking. `As of 2026-11` |
@@ -129,6 +129,66 @@ export const callTool = action({
129
129
  | contract diff | breaking when a call pattern the old meter admitted is refused: a meter introduced, a lower limit, a longer period not covering the old one at full use (100/day → month needs ≥ 3,100), a rename (`meta.meter` is on the wire), a move to or from a per-call limit. A shorter period at the same limit admits MORE (100/day → 100/hour): additive, as are a higher limit and a removed meter. `warnAt` is internal. `As of 2026-11` |
130
130
  | tests | the app preload resets the meter store at every file boundary, as it does the rate-limit store: a test file never resets it itself |
131
131
 
132
+ ### Programmatic draws: `drawMeter`
133
+
134
+ Work measured after the fact — tokens a model spent, bytes exported, rows synced — is drawn with `drawMeter(ctx, { meter, period, amount, limit, key })` from `@ultimat3/action`, inside the handler that measured it. Same counters, same store, same caller as `meter:`. `As of 2026-11`.
135
+
136
+ ```ts
137
+ import { action, drawMeter, t } from '@ultimat3/action';
138
+ import { allow } from '@ultimat3/policy';
139
+
140
+ const PLAN_TOKENS = new Map([['org-free', 100_000]]);
141
+ const tokensFor = (orgId: string | undefined) => PLAN_TOKENS.get(orgId ?? '') ?? 0;
142
+ // The app's own model client, whatever it is: it answers the run's id, its text and its usage.
143
+ declare const model: {
144
+ complete(text: string): Promise<{ id: string; text: string; usage: { totalTokens: number } }>;
145
+ };
146
+
147
+ export const summarise = action({
148
+ input: t.object({ text: t.string }),
149
+ output: t.object({ summary: t.string, used: t.number.int() }),
150
+ policy: allow(),
151
+ // Admission, before the model runs: a caller with no token allowance — anonymous, or on a plan
152
+ // without one — is refused here, or every call would bill the provider and record nothing.
153
+ meter: {
154
+ name: 'summaries',
155
+ period: 'day',
156
+ limit: ({ ctx }) => (tokensFor(ctx.actor.orgId) > 0 ? 1_000 : 0),
157
+ },
158
+ handle: async ({ input, ctx }) => {
159
+ // The handler does the work, so it measures the usage: never a count or an id the caller sent,
160
+ // which would let any member spend the tenant's allowance without running anything.
161
+ // Accounting after the fact, NOT a spend cap: the model has run before the draw is judged, so a
162
+ // tenant past its tokens still costs one run per admitted call, refused here and unrecorded.
163
+ // Bound that with the admission meter's call count and the model's own max-tokens setting.
164
+ const run = await model.complete(input.text);
165
+ const drawn = await drawMeter(ctx, {
166
+ meter: 'tokens',
167
+ period: 'day',
168
+ amount: run.usage.totalTokens,
169
+ limit: ({ ctx }) => tokensFor(ctx.actor.orgId),
170
+ key: run.id, // the run's own id: a retry of this draw for the same run counts once
171
+ });
172
+ return { summary: run.text, used: drawn.used }; // also: limit, replayed, resetsAt
173
+ },
174
+ });
175
+ ```
176
+
177
+ | Use | When |
178
+ |---|---|
179
+ | `meter:` on the action | the unit is **the call**, known before the handler runs: refused before any work starts — also the admission gate in front of a costly handler, a limit of 0 for a caller with no allowance |
180
+ | `drawMeter` | the unit is an **amount known only after the work**, or one action draws several meters. It records and refuses what was spent; it cannot stop work already done, so it bounds spend only together with a pre-work gate (a `meter:`, a per-call cap on the work) |
181
+
182
+ | Rule | What happens |
183
+ |---|---|
184
+ | amount | a positive safe integer, added whole or not at all: an amount that would pass `limit` counts nothing and throws `X_METER_EXCEEDED` (429, the same `meta` and `Retry-After`). One larger than the whole limit fits no period: its refusal says so, names no `retryAfterSeconds` (no `Retry-After`) and is `retry: 'terminal'`, so a job dead-letters it instead of waiting out a reset. `limit` judges new charges: a remembered key replays even after its limit drops below its amount |
185
+ | key | required, 1–255 chars, no NUL or lone surrogate (Postgres `text` cannot hold either as written): the unit of work's own id, never one the caller made up. A second draw under it — a retry, a duplicate on another replica, a parallel one — adds nothing and answers `replayed: true`. Remembered for the period it counted in and the next, so a retry just after the reset still counts once; a lagging replica's draw counts in, and is remembered by, the counter's period. A refused draw leaves no key. Replicas share keys only through a shared store: `memoryMeterStore()` remembers per process, and either bound ends that early: `maxDrawKeys` (default 200,000 across every counter, the period before dropped first) or `maxKeys`, whose eviction of a counter takes its keys with it. A durable guarantee is the Postgres store's |
186
+ | counter | a `meter:` with the same name and period counts on the same counter; units are the app's to keep consistent |
187
+ | transaction | the draw is written outside the caller's transaction and stays counted if it rolls back — retry with the same `key` |
188
+ | store | the installed `MeterStore` with `amount` and `drawKey` on `MeterDraw`, declaring `keyedDraws: true` (one that does not is `X_METER_INVALID` before it is drawn on: a store written before keyed draws would count one call and never replay): memory in one process, `x_meter` + `x_meter_key` in Postgres (the counter row locked, then the key claimed under it). A store of your own passes `meterStoreConformance` |
189
+ | no warning | `warnAt`/`onWarn` are `meter:`'s; read `used` and `limit` off the answer |
190
+ | malformed | a bad name, period, amount, key or resolved limit is `X_METER_INVALID`, its fix naming the `drawMeter` call |
191
+
132
192
  ## Streaming: `stream:` and an async generator
133
193
 
134
194
  An action that answers in pieces declares `stream: <chunk schema>` and writes `handle` as `async *handle({ input, ctx })`: each `yield` is a chunk, the `return` is the output.
@@ -194,6 +254,7 @@ export const load = async (): Promise<{ readonly answer: ActionAnswer | null }>
194
254
  | `static` / `isr` pages read `null` | a shared document is rendered as nobody, with no inbound cookie |
195
255
  | outside a request (the `llms.txt` build runs `load` with none) reads `null`, never `X_NO_REQUEST` | no request, no answer |
196
256
  | translate on `code` and `issues[].rule` with `t()` | the flash carries no prose, so no locale |
257
+ | a field's text reaches its declared type | a form posts text; the route coerces it toward `input` as a query route coerces a query string — `ok=on` is `true` for `t.boolean`, `count=7` is `7`, one value fills a `t.array`, the last of a repeated scalar wins (a hidden `false` before its checkbox). A JSON body is never coerced. `As of 2026-11` |
197
258
  | field values are not carried back | a password or a card number does not belong in a cookie; the form re-renders empty, or the page keeps a draft |
198
259
 
199
260
  **Enforced.** The `manifest` step of `x verify` reads every `page.tsx` for a `<form method="post">` whose `action` names an action — a literal path, `derivePath(name).path`, `actionHttpPath(name, …).path`, or a `const` in the same file holding one — and reports one with no `native` as `X_NATIVE_FORM_UNANSWERED`, the page's `file:line` and the fix. On `main` it is a **warning** — listed under the step's `warnings` in `--json`, the step stays green — because refusing it would turn an app's gate red between two minors (`X_BREAKING_ON_MAIN`); the refusal is planned for `next`. A form inside a component other than the page is not read. `As of 2026-11`.
@@ -243,7 +304,8 @@ There is **one execution path**. HTTP, MCP, jobs, and direct server calls differ
243
304
  | Key | Effect |
244
305
  |---|---|
245
306
  | `http.pathStyle` | `'resource'` (default — every existing URL stays) or `'readable'`: `signIn` → `/api/sign-in`, `health` → `/api/health`. A browser states nothing: the server stamps a non-default style into every document (`<meta name="ultimate-path-style">`) and `rpc({ baseUrl: '' })`, `useMutation` and the outbox replay derive under it. A caller with no document — a script, another service — passes `rpc({ baseUrl, pathStyle: 'readable' })`; the wrong one is answered 404 `X_CONTRACT_DRIFT` naming the style served and the action's real path, never a bare `X_ROUTE_NOT_FOUND`. The module scan evaluates `apps/web/api/index.ts` first, so a module-level `derivePath(name)` anywhere else sees the declared style; one evaluated earlier (inside the index's own imports) is refused at the declaration, `X_ACTION_PATH_DERIVED_EARLY` — derive inside the function that uses it |
246
- | `http.mounts[]` | `{ prefix: '/v1', scopes, resolveToken, rateLimit?, openapi? }` — a second door onto a cut of the same routes. Only `Authorization: Bearer` authenticates there (a session cookie reaches nothing, so no CSRF proof is needed); a primitive outside the token's scopes answers **404** like MCP's unknown tool; no/invalid token **401** with `WWW-Authenticate: Bearer`; a per-token `rateLimit` answers `RateLimit-*` and **429** + `Retry-After`, and it **replaces** the `default` bucket on the mount's routes (no `rateLimit`, `default` stands; a route's own bucket and the tenant allowance still apply). A `Link: rel="successor-version"` names the mounted path, and is dropped when the successor is outside this token's cut. `scopes` is the map `defineAppMcp` takes; `resolveToken` the same resolver. `/api/create-case` → `/v1/create-case`, `/_x/query/case-list` → `GET /v1/case-list` |
307
+ | `http.mounts[]` | `{ prefix: '/v1', scopes, resolveToken, rateLimit?, openapi?, tenant? }` — a second door onto a cut of the same routes. Only `Authorization: Bearer` authenticates there (a session cookie reaches nothing, so no CSRF proof is needed); a primitive outside the token's scopes answers **404** like MCP's unknown tool; no/invalid token **401** with `WWW-Authenticate: Bearer`; a per-token `rateLimit` answers `RateLimit-*` and **429** + `Retry-After`, and it **replaces** the `default` bucket on the mount's routes (no `rateLimit`, `default` stands; a route's own bucket and the tenant allowance still apply). A `Link: rel="successor-version"` names the mounted path, and is dropped when the successor is outside this token's cut. `scopes` is the map `defineAppMcp` takes; `resolveToken` the same resolver. `/api/create-case` → `/v1/create-case`, `/_x/query/case-list` → `GET /v1/case-list` |
308
+ | `http.mounts[].tenant` | `{ arg, resolve, list }` — the shape `defineAppMcp({ tenant })` takes, with MCP's three outcomes. The token resolves to a person; every call to a mounted primitive names its tenant in the query string, `?org=org_a`, read after the per-token allowance (an exhausted token is **429** before its tenant is read) and before the pipeline's tenant-aware rate limit, the body and the policy, never from the body; `resolve({ person, value })`'s actor is the caller, so policy, the tenant allowance and a meter see one org per call. None named: **400** `X_BEARER_TENANT_REQUIRED`, fix `GET /v1/tenants`. One the person is not in: the **404** a primitive outside the token's scopes gets, byte for byte. `resolve` threw, or answered no actor: **500** `X_BEARER_TENANT_UNRESOLVED`. `GET <prefix>/tenants` answers `{ tenants }` from `list({ person })` to any valid token, and is the exception: no scope, no tenant; a listed value that `isTenantValue` (`@ultimat3/http`) refuses — not a string, empty, over 256 characters (code points), or holding a lone surrogate — is **500** `X_BEARER_TENANT_LIST_INVALID`. A successor link keeps the tenant the call named. The mount's document requires the parameter on every primitive operation (keeping a read's own schema for it) and adds the `tenants` path beside any operation already there. `As of 2026-11-23` |
247
309
  | `http.mounts[].openapi` | a file (`'openapi.v1.json'`) `x manifest` writes with only the cut, bearer-secured; `x verify` refuses it stale or missing. Each operation's `security` is `[{ bearer: ['<its scope>'] }]` — the one scope of `scopes` that names it (also `x-ultimate.scope`) — and `components.securitySchemes.bearer` lists every scope with the operations it unlocks, in its `description` and as `x-ultimate.scopes` (`{ scope: [names] }`). `As of 22.12`; before, every operation said `bearer: []` |
248
310
  | `openapi` | `{ title, version, description, servers, sessionCookie }` — any key makes `openapi.json` complete: `info`, `servers`, `securitySchemes` (`cookie`, plus `bearer` with a mount), `401` + `429` (with `Retry-After`) on every operation its route authenticates, `RateLimit-*` on rate-limited ones. Absent, the bytes are unchanged |
249
311
 
package/wiki/Auth.md CHANGED
@@ -214,6 +214,7 @@ const approved = await verifyPasskeyEvidence(evidence, { rpId: 'example.com', or
214
214
  | checked, every ceremony | `clientDataJSON` type, the origin against the declared list exactly (no cross-origin iframe), `rpIdHash`, **UP and UV** (user verification is required, never preferred), the signature with the STORED key's algorithm |
215
215
  | challenge | 32 random bytes, stored as its sha256 in `x_passkey_challenges` with a TTL, consumed by one `DELETE … RETURNING` — single-use across the fleet, never a process map. Unknown, spent and late are one code: `X_PASSKEY_CHALLENGE_EXPIRED` |
216
216
  | counter | a signature counter that did not move forward is a cloned authenticator (`X_PASSKEY_INVALID`); both zero is an authenticator that keeps none, allowed. Advanced compare-and-set |
217
+ | label | `renamePasskey(auth, { userId, id, label: 'Work laptop' })` names it — right after `register`, or later — `null` clearing it, `null` answered for an id `userId` does not hold (`As of 2026-11`). 1-64 characters after trimming, then no control character or lone surrogate, else `X_PASSKEY_LABEL_INVALID`. `PasskeyCredential.label` is absent for none. An adapter of your own without the optional `renamePasskey` member is `X_PASSKEY_RENAME_UNSUPPORTED` |
217
218
  | registration | `attestation: 'none'` — the statement is parsed, not trusted; a credential id already registered to anyone is `X_AUTH_WRITE_FAILED`; a challenge issued to one account never registers onto another |
218
219
  | sign-in | the session is `mfaSatisfied`: a user-verified passkey is possession plus the device's PIN or biometric |
219
220
  | step-up challenge | `SHA-256("ultimate.passkey.step-up.v1\0" ‖ nonce ‖ len ‖ digest ‖ userId)` — never supplied by a caller. A proof for other bytes, or none, is `X_PASSKEY_STEP_UP_REQUIRED` |
@@ -226,6 +227,7 @@ const approved = await verifyPasskeyEvidence(evidence, { rpId: 'example.com', or
226
227
  |---|---|
227
228
  | TOTP + recovery codes | `enrolTotp`, `saveTotpSecret`, `generateRecoveryCodes`. The secret is **sealed at rest** under the app's master key and a plaintext one is refused, never read (`X_MFA_SECRET_UNSEALED`; `x auth seal-mfa` seals rows from before); a recovery code is consumed in one statement, so it works once. A password proven with a factor outstanding is `X_MFA_REQUIRED`, whose `meta.challenge` is a sealed five-minute credential; `completeMfa(auth, challenge, code)` finishes the sign-in, meters the guess against the same lockout buckets a password guess spends, and refuses a spent code on every replica (`x_totp_steps`, installed by the boot) |
228
229
  | email verification, password reset, any other mailed credential | `defineVerificationPurpose({ name, template, ttlMs, identifier? })` → `{ issue, consume }` (`As of 2026-11`); `emailVerification` and `passwordReset` are its two built-in instances, and `issueVerification` / `consumeVerification` take any declared name. A token is consumed only when its hash matches, so a wrong guess cannot burn the victim's live link, and one purpose's token never consumes another's. A name declared twice or with no template is `X_VERIFICATION_PURPOSE_INVALID` at boot; an undeclared one at the call is `X_VERIFICATION_PURPOSE_UNKNOWN` (400). `VerificationPurpose` is `string`: a `switch` over it needs a default arm. The mail is sent through an injected `MailSender` ([Mail](Mail)) |
230
+ | sign-in by mailed link | Not exported yet: `signInWithLink` stays internal to `@ultimat3/auth` and ships in the next minor (`As of 2026-11`). A mailed credential today is `defineVerificationPurpose` + `consumeVerification` |
229
231
  | API keys — how an agent authenticates | `issueApiKey` → `ult_<env>_<id>_<secret>`, shown once; `verifyApiKey` + `apiKeyActor` give a `kind: 'agent'` actor whose scopes are the key's and never the owner's roles (`X_API_KEY_INVALID`). A key is its owner's credential: a missing or disabled owner refuses it on the next use, a wildcard scope (`*`, `<resource>:*`) is refused at issue, and an owned key keeps only the scopes its owner's grants cover — pass `grantsOf` to expand roles ([`packages/auth/README.md`](https://github.com/developerz-ai/ultimate/blob/main/packages/auth/README.md)); a key with no `userId` is unchanged. `apiKeyResolver(() => store)` is both as the `resolveToken` a bearer mount and `defineAppMcp()` take: `{ actor, scopes }` for a live key, one `null` for every wrong one, and a store fault left a throw. In a test the store is `memoryAuthAdapter()` |
230
232
  | service-to-service | `verifyWorkloadToken` reads a Kubernetes service-account token, a SPIFFE JWT-SVID or a cloud IMDS token (they are all one JWT); `actorFromService` gives a `kind: 'service'` actor. The returned `WorkloadToken` carries `raw`, the whole decoded payload, read only after every check held. mTLS is the mesh's job |
231
233
  | an external issuer's bearer (`As of 2026-11`) | `jwtBearerResolver({ keys, issuers, audience, requiredScope?, accept?, actorOf })` — `apiKeyResolver`'s twin for JWTs, the `resolveToken` a bearer mount and `defineAppMcp()` take. `keys` is a thunk read when a token arrives (no discovery at import); `accept(raw)` is the app's own claim check after the signature; `actorOf(token)` builds the actor. Every refusal — signature, issuer, audience, expiry, scope, `accept`, and a key set that cannot be read — is `null` plus one `auth.jwt_bearer.refused` log line naming the check, never a claim's value. The mount answers that `null` as `401 X_UNAUTHENTICATED` |
@@ -285,8 +287,9 @@ const resolveToken = oauthBearerResolver(oauth, { actor: (grant) => actorFor(gra
285
287
  | consent | the page calls `readRequest(url, { callerKey })` (`callerKey`: the request's address) → `{ client, scopes, resource, redirectUri }` or a refusal; a metadata-document client carries `client.host`, its `client_id`'s host, beside the `name` its own document chose — show the host, since the name is the client's to write (`As of 2026-11-19`); an unknown client or unregistered redirect has `redirectTo: null` — render it, never redirect. Its action calls `approve({ subject, request, scopes? })` / `deny({ request })` for the redirect URL (`code`, `state`, `iss`). A forged request is `X_AUTH_CONSENT_INVALID` (422) |
286
288
  | device | the verification page calls `readDevice({ userCode, key })`, `approveDevice` / `denyDevice`; `key` is the caller's bucket — 10 misses lock it (`X_ACCOUNT_LOCKED`) |
287
289
  | `registerClient(...)` | a client the app creates itself — a partner's `client_credentials` client; the secret is shown once and stored hashed. A redirect URI, grant, scope or resource that is empty or holds whitespace is `X_AUTH_CLIENT_INVALID` (422, `meta.field`): the store keeps each list space-joined, so it would read back as a different list |
288
- | `resolve(token)` | `{ subject, scopes, clientId, resource } \| null`. `oauthBearerResolver(server, { actor, resource? })` is the `resolveToken` a bearer mount and `defineAppMcp` take; `actor` runs per call, so a removed member loses access at once |
289
- | `revoke({ subject, clientId? })` · `purge({ before })` | immediate; `purge` is the app's `task` to schedule, nothing here runs on a timer. `purge` also deletes a self-registered client (a `d_` id, minted by `/oauth/register`) created before the refresh idle window that no grant, code or device code names; its next call is `invalid_client` and an MCP client re-registers. A client from `registerClient` (`c_`), and any registered before `As of 2026-11-19`, is never reaped |
290
+ | `resolve(token)` | `{ grantId, subject, scopes, clientId, resource } \| null` — `grantId` is the grant the token was issued under — a user's consent, or a `client_credentials` client's own — the same across every refresh rotation (`As of 2026-11-24`). `oauthBearerResolver(server, { actor, resource? })` is the `resolveToken` a bearer mount and `defineAppMcp` take; `actor` runs per call, so a removed member loses access at once |
291
+ | `grants({ subject, clientId? })` | the subject's live grants, oldest first: `{ grantId, clientId, scopes, resource, createdAt, refreshedAt }[]` — not revoked, and holding a stored token neither expired nor retired, so an abandoned consent or a grant whose tokens all passed their stored expiry is not listed. It needs an existing, unrevoked grant row and reads stored token expiry and retirement, not the current refresh policy: after a lifetime is shortened, or a client is denied refresh, its grant can stay listed while its row and an unexpired, unretired token remain — until that stored expiry, or sooner if `purge` removes the row. Each entry is a copy (`As of 2026-11-24`). A store without `liveGrants` (one of the app's own) is `X_AUTH_GRANTS_UNSUPPORTED` (`As of 2026-11-23`) |
292
+ | `revoke({ subject, clientId? })` · `revokeGrant({ subject, grantId, clientId? })` · `purge({ before })` | immediate; `revokeGrant` ends that one grant alone, refresh tokens included, and answers 0 for an id another subject (or another client than the one named) holds — the same answer as an unknown id (`As of 2026-11-23`); two racing calls on one grant count it once, through the store's optional `revokeLiveGrant(id, at)`, which answers `true` only for the write that ended it; the memory and Postgres stores implement it, and a store without it (an app's own) is counted on its read (`As of 2026-11-24`). `grants` and `revokeGrant` are optional in the `AuthorizationServer` type only, so an app's own implementation still compiles: call them as `server.grants?.(…)`; `authorizationServer()` always sets both; `purge` is the app's `task` to schedule, nothing here runs on a timer. `purge` also deletes a self-registered client (a `d_` id, minted by `/oauth/register`) created before the refresh idle window that no grant, code or device code names; its next call is `invalid_client` and an MCP client re-registers. A client from `registerClient` (`c_`), and any registered before `As of 2026-11-19`, is never reaped |
290
293
 
291
294
  | Rule | Held by |
292
295
  |---|---|
@@ -300,6 +303,7 @@ const resolveToken = oauthBearerResolver(oauth, { actor: (grant) => actorFor(gra
300
303
  | `registerClient` refuses an empty or whitespace-holding list value, before a secret is minted (`X_AUTH_CLIENT_INVALID`) | `authorization-server-register-client.test.ts` |
301
304
  | `resource` (RFC 8707) binds the grant; one not in `resources` is `invalid_target` | `authorization-server-request.test.ts`, `oauth-bearer-resolver.test.ts` |
302
305
  | tokens are opaque and stored hashed, never a JWT, so `revoke` holds on the next lookup | `token-endpoints.test.ts` |
306
+ | `revokeGrant({ subject, grantId })` ends one grant and leaves its sibling on the same client refreshing; a rotation keeps the id; another subject's id revokes nothing | `authorization-server-grants.test.ts`, `authorization-server-postgres.test.ts` |
303
307
  | an `https://` `client_id` is a metadata document, fetched through `outbound({ dial: 'public' })`, 5 KiB, cached 5 minutes, public clients only | `authorization-server-clients.test.ts` |
304
308
  | every metadata-document fetch is metered (`X_ACCOUNT_LOCKED` past 10 a minute): per `callerKey`'s network (`ipKey`: IPv4 whole, IPv6 per /64), or — when the consent page names none — on ONE shared bucket, so an unkeyed page is throttled as one caller | `authorization-server-clients.test.ts` |
305
309
  | `client_credentials`: confidential only, no refresh token, subject is the client | `grant-client-credentials.test.ts` |
@@ -799,7 +799,12 @@ declaration and say so in the output. **`x test live` and `x test e2e` obey the
799
799
  `As of 2026-08-27`** — they did not, so `x test live --workers 8` ran eight processes over the very
800
800
  files `x verify` ran one over. `--workers` is accepted there and clamps to 1. That clamp read the
801
801
  POSITIONAL, so the bare `x test --workers 8` still widened over the same files until 2026-09; the
802
- selection is now partitioned by each file's own type. The default width is
802
+ selection is now partitioned by each file's own type. `x test`'s e2e pass also LAUNCHES as the
803
+ gate's `e2e` step does, `As of 2026-11`: in an app root with a browser (`CHROME_PATH`, or one
804
+ `x doctor` finds) it runs under `@ultimat3/testing`'s e2e preload, which spawns the app, with the
805
+ device zone `America/Los_Angeles` — before, `x test e2e` never opened a browser and every
806
+ browser-backed case skipped. With no browser both skip those cases alike, and under
807
+ `E2E_BROWSER_REQUIRED=1` those cases refuse instead of skipping, in both. The default width is
803
808
  a memory budget, `As of 2026-11-07`: `max(2.75 GiB, 25% of RAM)` (`BUDGET_RULE`) at 1.25 GiB a worker
804
809
  (`WORKER_BYTES`, `GATE_BUDGET_FLOOR` and `GATE_BUDGET_SHARE` in
805
810
  `packages/cli/src/test-workers.ts`), at most one per core — the paragraph under `x verify` above.
@@ -872,7 +877,7 @@ $ x verify --json
872
877
  "summary":"1 of 21 steps failed — 3 skipped: e2e, contract-diff, roadmap","steps":[
873
878
  {"name":"budgets","ok":false,"durationMs":812,"skipped":false,"findings":[
874
879
  {"code":"X_BUDGET_EXCEEDED","cause":"/pricing ships 61.2kb of JS (minified, uncompressed) over a 40kb budget via site/pricing/page.tsx -> islands/post-form-04f75f18.js; charged: /islands/post-form-04f75f18.js 50123 B, inline scripts 855 B",
875
- "fix":"edit apps/web/site/pricing/page.tsx — set budget: { js: '62kb' } with // measured: 62682 B (x build --target static) — why: <the function it buys> directly above it; or x routes --json for the chain and move the heavy import behind hydrate: 'interaction'",
880
+ "fix":"edit apps/web/site/pricing/page.tsx — set budget: { js: '62kb' } with // measured: 62682 B (x build --target static) — why: <the function it buys> directly above it, then x manifest (x.manifest.json carries the budget); or x routes --json for the chain and move the heavy import behind hydrate: 'interaction'",
876
881
  "docs":"https://github.com/developerz-ai/ultimate/wiki/Error-Codes",
877
882
  "at":"apps/web/site/pricing/page.tsx",
878
883
  "meta":{"jsBytes":62682,"charged":[{"url":"/islands/post-form-04f75f18.js","bytes":50123}],"inlineJsBytes":855}}]}],
@@ -1840,6 +1845,7 @@ A dry run refuses exactly what the real run would, then stops before step 4 —
1840
1845
  | `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 |
1841
1846
  | `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 |
1842
1847
  | `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 |
1848
+ | `coverageRaised` | `As of 2026-11-20`: `{ file, measured, from, to }` when the gate's `unit` step said `X_COVERAGE_FLOOR_STALE` (the tree covers more than its floor, a codemod's new test among the causes): each `x.verify.json` `coverage` number is set to the larger of the stated floor and the whole percent that run measured, never lowered (a floor reaching 95 drops its `why`), then `x verify --only unit` re-runs and `verify` is the verdict with `unit` replaced by that run. `null` when nothing rose |
1843
1849
  | `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
1844
1850
  | `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 |
1845
1851
  | `verify` | `{ ok, summary, failed[], findings[], only?, notRun? }`, each finding `{ step?, code, cause, fix, at? }`. `only[]` and `notRun[]` only under `--only`: the steps run, and the gate's steps this hop did not run |
@@ -54,8 +54,9 @@ prefetch: 'intent' }` — only for a GET that does nothing but render.** A plain
54
54
  unprefetched: a modal is often a form, and its GET may prepare one (a draft, a token, a reserved
55
55
  slot). One spelling per meaning: the object takes exactly those two keys and values, anything else
56
56
  is `X_ROUTE_NAVIGATION_INVALID`, and `{ modal: true }` alone is refused — that is `'modal'`.
57
- Declaring any of them on a surface without client navigation refuses the boot
58
- (`X_ROUTE_NAVIGATION_INVALID`).
57
+ A `navigation` key on a page of a surface `navigation.client` does not list is refused at boot,
58
+ since no router runs there — except `'document'`, which asks for the real load such a surface
59
+ already gives and is honoured on every surface (`As of 2026-11`).
59
60
 
60
61
  An opted-in document (every page of the surface except a `'document'` one) carries:
61
62
 
@@ -66,7 +67,9 @@ An opted-in document (every page of the surface except a `'document'` one) carri
66
67
  | `<script src="/_x/assets/navigation/<hash>.js" defer>` | the router: one classic script, content-addressed, `immutable`, `'self'` under the default CSP. `x dev`, the container and `x build --target static` all serve or write it |
67
68
  | `<meta name="ultimate-modals" content='{"routes":[…],"close":"…","loading":"…"}'>` | only on a surface with a `'modal'` route: the modal patterns, most specific first, with `!<pattern>` for a page that outranks one (`/runs/new/peek` over `/runs/:id/peek`), and the frame's two words in the document's locale (`ui.close`, `ui.loading` — override them in the app's catalog). What lets a click open the dialog before the answer ([Modals](#opening-on-the-click)) |
68
69
 
69
- **Budget:** the router is 27,845 B minified (10,094 B gzip) `As of 29.1.0` — 24,448 B (9,028 B
70
+ **Budget:** the router is 32,699 B minified (11,809 B gzip) `As of 2026-11` — 31,904 B (11,507 B
71
+ gzip) before a stream's late fragment, its recovery and keep-alive frames were handled (+795 B);
72
+ 29,955 B (10,817 B gzip) before a soft visit read as it streams (+1,949 B); 27,845 B (10,094 B gzip) at 29.1.0, 24,448 B (9,028 B
70
73
  gzip) before the modal that opens on the click and its popover opening (+3,397 B), and 19,966 B
71
74
  before route-presented modals and navigating from code (+4,092 B, 26.1.0). It is **charged** to
72
75
  every route on the surface, like realtime's page boot, because it is interactivity the app opted
@@ -88,6 +91,15 @@ before any hook, before the handler**:
88
91
  | any router request answered with a 3xx (a form's 303, a sign-in wall, a `load`'s `setRedirect`, an OAuth or payment hop) | any | `204` + `x-ultimate-location: <target>`, cookies kept. The handler ran once; the router follows a same-origin target as its own next request, and hands another origin to the browser. A target that is not `http:`/`https:` (or will not parse) is never handed over: the header names the requested URL instead, as a path |
89
92
  | POST | any | never gated: it is the form's submission |
90
93
 
94
+ A principal is the actor's kind and id, who is really acting (an impersonator), and the actor's
95
+ `orgId` when it has one: the same person in two orgs is two principals, so a soft GET never swaps
96
+ a page rendered in one org into a document of the other, and the client store it fences is never
97
+ shared. The one exception is a POST answered in place: a form that switches org and renders its
98
+ page instead of redirecting is swapped in, since it cannot be repeated; the router then empties
99
+ every tab's cache and stops swapping (the POST row under
100
+ [What happens to the answer](#what-happens-to-the-answer)). An actor with no `orgId` keeps the scope id it had before the org joined it (`As of
101
+ 2026-11`; `packages/core/src/client-scope-id.ts`).
102
+
91
103
  A soft GET across a principal change runs auth and rate-limit **twice** — once before the `204` of
92
104
  the principal row above, once for the real load. Expected and harmless (auth and rate-limit only;
93
105
  the handler and `load` run once), but a tight per-actor rate limit should budget one extra request
@@ -170,6 +182,23 @@ In one order, so no frame is unstyled and no island runs twice:
170
182
  one only the previous page had is removed. Every inline script, head or body, still needs its
171
183
  CSP hash — the router re-inserts the same text, and the policy judges it as on a full load.
172
184
 
185
+ **A `stream` page paints before its slowest hole** (`As of 2026-11`). A soft visit reads the
186
+ answer as it arrives: the swap above runs once the shell is in (the server ends it with a flush
187
+ mark), with each hole's fallback on screen, and on a page (not a modal) `ultimate:navigated` fires
188
+ then, after the shell's scripts and before any hole's. Each hole's chunk is appended to the body as it lands and
189
+ its scripts run — the `$X()` reveal and the hole's own islands — so a hole fills, or shows its
190
+ `error` markup, as on a full load. A link to a fragment the shell does not have (`/feed#post-7`,
191
+ the post inside a hole) is scrolled to when the hole that carries it lands, unless the visitor
192
+ scrolled first. The next swap, or `stop()` (from an `ultimate:navigated` listener too), cancels
193
+ the request: the server aborts each open hole's signal, and a read that passes that signal on
194
+ (`fetch(url, { signal: useContext().signal })`) stops — one that ignores it runs to its end, and
195
+ its result is dropped. Nothing of a page left lands in the next one. A stream that breaks under the
196
+ page on screen is loaded for real (a GET, reloaded when only its fragment differs) or reported as
197
+ `ultimate:navigation-error` (a POST, never re-sent); while the visitor's next page is on its way,
198
+ the break waits for it, and is recovered only if that page never took the tab. A prefetch still
199
+ reads the whole answer, so a click that reuses one in flight waits for every hole; a modal is shown
200
+ whole. Measured: [Known gaps](Known-Gaps).
201
+
173
202
  Inside `document.startViewTransition` when the browser has it and `prefers-reduced-motion` is not
174
203
  `reduce`. Style the transition with the standard `::view-transition-*` pseudo-elements. While it
175
204
  animates the browser hit-tests every press to `<html>` (Chrome does whatever `pointer-events` the
@@ -480,7 +509,7 @@ Dispatched on `document`:
480
509
  | Event | When | `detail` |
481
510
  |---|---|---|
482
511
  | `ultimate:navigate` | before the fetch. **Cancelable**: `preventDefault()` keeps the tab where it is | `{ url, method }` |
483
- | `ultimate:navigated` | after the swap, the scroll and the new scripts — and after a modal opens, its `url` the modal's | `{ url }` |
512
+ | `ultimate:navigated` | after the swap, the scroll and the new scripts — and after a modal opens, its `url` the modal's. On a `stream` page swapped in as a page, the shell's scripts only: each hole's run when its chunk lands, so a hole's element may still be its fallback. A `stream` modal is shown whole, holes included | `{ url }` |
484
513
  | `ultimate:navigation-error` | a POST that failed or could not be shown, a swap that failed on a POST. **Cancelable**: the default is a GET of the current page | `{ url, method, reason }` |
485
514
 
486
515
  The three event names are on `@ultimat3/render/client` too — what an island listens with. The event
@@ -510,6 +539,7 @@ names and attributes are exported from `@ultimat3/render` (`NAVIGATE_EVENT`,
510
539
  | the server gate and the redirect hand-over, counting handler runs | `packages/http/src/navigation.test.ts` |
511
540
  | speculation rules: which pages are candidates, the tag on a router-less document only, the CSP hash of the served bytes | `packages/cli/src/page-speculation.test.ts`, `packages/render/src/speculation-rules.test.ts` |
512
541
  | real pages: prefetch and `'document'` run no `load`, another principal or app is refused, a misplaced key refuses the boot | `packages/cli/src/page-navigation.test.ts` |
542
+ | a soft visit to a `stream` page: the shell before an open hole, the hole filling and hydrating, its error branch, a second navigation cancelling the first | `packages/cli/e2e/stream-hole.e2e.test.ts`, `packages/render/src/navigation-stream.test.ts` |
513
543
  | writes announced after they settle | `packages/core/src/client-writes.test.ts` |
514
544
  | in a real Chrome, through the real pipeline under an enforced CSP: every rule above, counted in route executions | `packages/cli/e2e/client-navigation-*.e2e.test.ts` |
515
545
  | the reference app, opted in: real pages, sign-out, a like after a round trip, the editor as a modal over the feed, scripting off | `examples/dummy/apps/web/e2e/client-navigation.e2e.test.ts` |
@@ -124,7 +124,7 @@ await withReplicaReads(async () => {
124
124
  | `totpReplay` | `TotpReplayGuard` | which TOTP steps are spent, one atomic `claim(subject, step, at)`, called by `completeMfa`. Omitted means the guard the host installed: a framework boot's is `postgresTotpReplayGuard` (`x_totp_steps`), so a code is single-use across the fleet. With no host, `memoryTotpReplayGuard()`, single-use per replica. A guard with no `claim` is `X_CONFIG_INVALID` |
125
125
  | `providers` | `OAuthProviderId[]` | **defaults to `[]`**, `As of 2026-08-23` — an empty list is "no OAuth", and every `/auth/sso/<id>` answers `X_OAUTH_PROVIDER_UNKNOWN`. Never the live registry: that would let any dependency that calls `registerOAuthProvider` turn on a login route this app never enabled |
126
126
  | `link` | `OAuthLinkPolicy` | defaults to `'verified-email'` |
127
- | `passkeys` | `PasskeyPolicyInput` | `{ rpId, origins, rpName?, challengeTtlMs? }` (`As of 2026-11`): the relying party every WebAuthn ceremony verifies against. `rpId` a bare lowercase host, never a URL or an IP; each origin exact (`URL.origin` round-trips it), https or `http://localhost`, on `rpId` or a subdomain; `challengeTtlMs` 5 min. Anything else is `X_CONFIG_INVALID` at `defineAuth`. Absent means no passkeys: `passkeyLogin(auth)` / `passkeyStepUp(auth)` refuse at definition ([Auth](Auth#passkeys)) |
127
+ | `passkeys` | `PasskeyPolicyInput` | `{ rpId, origins, rpName?, challengeTtlMs? }` (`As of 2026-11`): the relying party every WebAuthn ceremony verifies against. `rpId` a bare lowercase host, never a URL or an IP; each origin exact (`URL.origin` round-trips it) with a DNS host — a wildcard `*` matches no origin a browser sends, so it is refused — https or `http://localhost`, on `rpId` or a subdomain; `challengeTtlMs` 5 min. Anything else is `X_CONFIG_INVALID` at `defineAuth`. Absent means no passkeys: `passkeyLogin(auth)` / `passkeyStepUp(auth)` refuse at definition ([Auth](Auth#passkeys)) |
128
128
 
129
129
  There is no `auth.trustedOrigins` in either place, and passkeys are `defineAuth`'s, never `app.config.ts`'s, `As of 2026-11`.
130
130
 
@@ -802,6 +802,7 @@ Rules:
802
802
  | Secrets are env or a mounted file | the framework never talks to a vendor secret API ([axiom 7](Home)) |
803
803
  | `env.X` reads through `defineEnv`'s schema | a declared key that is missing or malformed is `X_ENV_MISSING` at boot, every offender in one error. A `process.env` read outside the schema is a lint error, never a runtime one |
804
804
  | `X_CONFIG_INVALID` is env **and** `app.config.ts` | one code for a configuration that cannot boot: what `defineConfig`'s own validation throws — a bad locale or two spellings of one, an unknown time zone, a section or list of the wrong shape (`jobs: null`), a value outside its closed set (`roles`, `jobs.backoff`, `theme.defaultMode`), a switch that is not a boolean (`database.ssl: 'false'`), `jobs.concurrency < 1`, a removed key such as `realtime.transport`, a `cache.tiers` entry the environment cannot supply — and any env **combination** no boot can resolve, thrown by the selector that reads it. Both CDN pairs or half a pair (`selectPurgeDriver`), more than one of `SMTP_URL` / `RESEND_API_KEY` / `SES_REGION`, or a transport with no `MAIL_FROM` (`selectMailDriver`), or `REPLICATION_URL` naming a different host, port or database than `DATABASE_URL` (`selectChangeFeed`) |
805
+ | Required where it is needed | `role: 'sync'` (or a list) requires a key only on that role; `required: false, requiredIn: ['staging', 'production']` is optional except in those environments (`ULTIMATE_ENV`, else `NODE_ENV`), so a deploy cannot boot without it and a laptop or test run reads `undefined` (`As of 2026-11`). An environment no reader can name is a deploy: required. A `default` still answers an absent key first, and a `role` still narrows it. `describeEnv` reports it as `requiredIn`. `required: false` is optional everywhere |
805
806
  | `X_ENV_MISSING` is one key, `X_CONFIG_INVALID` is the shape | absent or malformed key → `X_ENV_MISSING` at the `defineEnv` gate. Keys that each parse but contradict each other → `X_CONFIG_INVALID`. The two never overlap |
806
807
  | No runtime mutation | config is frozen after `defineConfig`; there is no `setConfig` |
807
808
  | Same image, all environments | only env differs. That is what makes staging a real rehearsal ([Deployment](Deployment)) |
@@ -145,15 +145,25 @@ migration or a psql session can violate.
145
145
  | Written as | Reaches SQL | Note |
146
146
  |---|---|---|
147
147
  | `c.title.trimmed().minLength(1)` · `c.likeCount.atLeast(0)` · `c.email.contains('@')` · `c.a.eq(c.b)` · `c.flag.isTrue()` · `c.publishedAt.isNull()` / `.isNotNull()` | yes | `CHECK`. `trimmed()` strips leading and trailing **spaces** only, as one-argument `btrim` does — a tab is a character on both sides. `atLeast` / `eq(<number>)` compare the number the column holds, so a `bigint()` or `decimal()` row (a decimal string) is judged by its digits |
148
- | `iff(c.status.eq('published'), c.publishedAt.isNotNull())` | yes | `(a) = (b)` — a rule that holds *exactly when* another does. The **one** combinator: `and`/`or`/`not` are deliberately absent |
148
+ | `iff(c.status.eq('published'), c.publishedAt.isNotNull())` | yes | `(a) = (b)` — a rule that holds *exactly when* another does |
149
+ | `allOf(c.a.isNull(), c.b.isNull())` · `anyOf(c.a.isNull(), c.b.isNull())` | yes | `(a) and (b)` / `(a) or (b)`, two or more operands, three-valued as SQL's (`As of 2026-11`): "both unset", "at most one set". Two invariants are already a conjunction; `allOf` is for where ONE predicate must say it — an index `where: (c) => allOf(…)`, or inside `anyOf`/`iff`. One app-only operand makes the whole rule `sql: null`; a `unique` operand, or fewer than two, is `X_INVARIANT_VIOLATED`. `not` stays absent: `isNull`/`isNotNull` are the negations a CHECK needs |
149
150
  | `c.unique(['orgId', 'userId'])` | yes | `UNIQUE`, not a CHECK — a single row cannot see a duplicate |
150
151
  | `c.slug.matches(SLUG_PATTERN)` — a **`RegExp`** | yes | `slug ~ '…'` |
151
152
  | `c.slug.matches(isValidSlug)` — a **function** | **no** | `sql: null` |
152
153
  | `c.satisfies(fn, ['status', 'publishedAt'])` | **no** | `sql: null`, by construction — a JS function over several columns |
153
154
 
155
+ **A patch is refused as the row would be.** `insert` judges the whole row before its statement; an
156
+ `update` or `updateWhere` patch only becomes a row on the server, so there the CHECK judges first,
157
+ and its `23514` on a rule this entity declares answers `X_INVARIANT_VIOLATED` naming that rule (a
158
+ 422), the same as `insert`. A CHECK no invariant declares stays `X_DB_STATEMENT_FAILED`. As of
159
+ 2026-11; before it a refused patch was a 500.
160
+
154
161
  **A rule over a nullable column passes `NULL`, in the app as in the CHECK.** Every operator but
155
162
  `isNull()`/`isNotNull()` answers SQL's *unknown* for a NULL operand, in TypeScript too, and a rule
156
- holds unless it is false — so `c.slug.matches(SLUG_PATTERN)` on a `.nullable()` slug accepts a
163
+ holds unless its FINAL verdict is false. That is per comparison: a composite decides by its own
164
+ three-valued logic, so `allOf(c.a.eq(1), c.b.eq(1))` refuses `a = NULL, b = 2` (false beats
165
+ unknown) while `anyOf(c.a.eq(1), c.b.eq(1))` passes it (no operand true, one unknown) — in both
166
+ halves. So `c.slug.matches(SLUG_PATTERN)` on a `.nullable()` slug accepts a
157
167
  NULL in `$assert`, the memory driver and Postgres alike (`invariant-null.test.ts`, every operator on
158
168
  PGlite). To refuse NULL, declare the column NOT NULL or add `.isNotNull()`. As of 31.3; before it
159
169
  the app refused the NULL its CHECK stored.
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 99 source-derived UI components |
111
+ | [UI components](UI-Components) | the four page composites, and the generated catalog of 100 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 99 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 100 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
@@ -134,7 +134,7 @@ framework's diagnostic text changes without a semver signal, the rule names do n
134
134
  | Command | Does |
135
135
  |---|---|
136
136
  | `x i18n add <locale>` | create `catalogs/<locale>.json` seeded with every default-locale key, each value copied inside `⟦…⟧` |
137
- | `x i18n sync <locale>` | add keys the locale is missing; a key it already has is never overwritten, translated or not; never deletes |
137
+ | `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
138
  | `x i18n check --json` | extract keys from source, diff against every catalog and against `en`, report missing / unused / dynamic / slot mismatch / untranslated |
139
139
 
140
140
  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.
@@ -47,6 +47,8 @@ noticed.
47
47
  | A refetch keeps the previous data on screen | `asyncStateOf` — `loading` beside a defined `data` is `refreshing`, never `pending` |
48
48
  | A failure beats stale data: report the error, do not re-render rows the failed request did not answer | `asyncBranch` tests `failed` first |
49
49
  | Placeholder, error, empty and content land in the same box | `reserveBlockSize` is emitted as `--async-reserve` on the region in every branch |
50
+ | A person never reads a shell command: a failure in a page for an end user is the app's own screen | **judgement**: supply `AsyncRegionProps.failed(error, retry)` on every end-user page; it replaces `ErrorState` (code, cause, fix — the developer's report) on that branch. Nothing enforces it: a page that omits `failed` still typechecks and renders `ErrorState` with its shell fix, `As of 2026-11` |
51
+ | A state's title is in the outline when it is a destination | `EmptyState` and `Alert` take `level` (1-6): the title is `role="heading"` with that `aria-level` — an outline entry without six per-level templates in every island; absent, a paragraph |
50
52
  | The region carries `aria-busy` while in flight | `AsyncRegion` derives it from `isBusyBranch` |
51
53
  | `data: undefined` means nothing has arrived. An empty array is data | `asyncStateOf` |
52
54
  | A `{ total: 0, items: [] }` envelope passes its own `isEmpty` — `isEmptyData` does not guess at an envelope | `AsyncRegionProps.isEmpty` |
@@ -267,7 +269,7 @@ Biome does not read `.scss`. These seven guards are the only thing that does. `A
267
269
  | A viewport query names a rung of the one ladder | `guards/raw-breakpoint.ts` — `@media` with a `width` feature | `@include tokens.respond-to(md)` / `respond-down(md)` / `respond-between(md, lg)` |
268
270
  | A layer is a name | `guards/raw-z-index.ts` — a number in `z-index` | `z-index: tokens.z(dropdown)`; behind its own stacking context, `calc(-1 * #{tokens.z(raised)})` |
269
271
  | Elevation comes off the themed shadow scale | `guards/raw-shadow.ts` — a hand-written length in `box-shadow`, `text-shadow` or `drop-shadow()` | `box-shadow: tokens.shadow('sm')`, or `@include tokens.surface` |
270
- | One tempo | `guards/raw-motion.ts` — a duration or `cubic-bezier()` literal in `transition*` / `animation*`, or assigned to a custom property (`--ease: cubic-bezier(…)`) | `transition: opacity tokens.duration(fast) tokens.easing(out)`; in a custom property, interpolated: `--ease: #{tokens.easing(out)}` |
272
+ | One tempo | `guards/raw-motion.ts` — a duration or `cubic-bezier()` literal in `transition*` / `animation*`, or assigned to a custom property (`--ease: cubic-bezier(…)`) | `transition: opacity tokens.duration(fast) tokens.easing(out)`; in a custom property, interpolated: `--ease: #{tokens.easing(out)}`; the app's own tempo for a rung (`--duration-base: 180ms`): `defineTheme({ motion: { duration: { base: '180ms' } } })` |
271
273
  | A class a component reads is a class its sheet compiles | `guards/undefined-style-class.ts` — `styles.x` / `styles['x-y']` against the COMPILED `.module.scss` | the nearest class the sheet declares, or the rule to add |
272
274
  | A custom property a sheet reads is one the app declares | `guards/undeclared-custom-property.ts` — `var(--x)` in the compiled CSS with no declaration anywhere and no fallback | the steps the scale really has: `tokens.space(7)` → `0 \| 1 \| 2 \| …` |
273
275
  | A guard that reads compiled sheets never passes by reading nothing | `guards/undeclared-custom-property.ts` and `guards/undefined-style-class.ts` — a sheet that does not compile, or an imported one that does not exist, is a finding quoting the compiler's first line; while one is broken, no `var()` read is judged | repair the Sass at the error quoted |
@@ -75,7 +75,6 @@ Each of these is a defect, or a target, somebody has already argued about, and t
75
75
  | A local `typecheck` step can report green on a tree CI fails, on the same commit — **one sighting, unreproduced** | `As of 2026-10`. Observed once (2026-09-17, TypeScript 7.0.2): after a `git stash -u` → branch switch → `x verify` on the other branch → switch back → `stash pop` sequence, a type error that surfaces in an UNCHANGED file (a widened index signature in a file it imports) passed locally and failed CI; deleting `tsconfig.tsbuildinfo` then reproduced CI's red locally. Five faithful reproduction attempts against 7.0.2 all stayed correctly red ([#450](https://github.com/developerz-ai/ultimate/issues/450)). **[#450](https://github.com/developerz-ai/ultimate/issues/450) itself is closed `As of 2026-09-23`** — read from the shipped fix, not from the tracker: plan 101 row 14 r ("Close #450", `docs/plans/2026/09/23/101-framework-deep-sweep/14-guards-gate.md:37`; plan `status.yml` `complete`), recorded in `CHANGELOG.md` under 22.0.0 and pinned by `packages/cli/src/verify-typecheck.test.ts`. `tsc -b` decides "up to date" by **mtime**, and Bun installs a dependency as **hardlinks** carrying its cache's old mtimes, so an upgrade to an already-cached version left every input older than the buildinfo and a root without `references` — every scaffolded app — skipped the program and reported green while a cold CI was red. A scaffolded app's `typecheck` is now `tsc -p .` ([`packages/cli/src/templates/scaffold-repo.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/src/templates/scaffold-repo.ts), its `"typecheck"` script), which is incremental by **content hash**, and `x verify`'s `typecheck` step picks `-p .` over `-b` for any such root ([`packages/cli/src/verify-typecheck.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/src/verify-typecheck.ts)); the framework root keeps `-b`. **Still open**: a *second* `tsc` racing the same buildinfo is the one suspect not excluded, and no cause for it has been shown. `x verify` has no `--cold` flag: one sighting, and five faithful reproductions stayed red. **Why it stays** (`As of 2026-11-18`): There is no cause to fix: the one known mechanism is fixed, and no reproduction of the remainder exists. CI, always cold, is the judge of record. **Do instead:** CI is always cold and is the judge of record. If a local `typecheck` disagrees with it again, capture the command, its argv and its exit code before deleting any `tsconfig.tsbuildinfo`. |
76
76
  | 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
77
  | 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
- | A soft visit waits for the slowest hole | `As of 2026-11-02`. The client router reads `response.text()` ([`packages/render/src/navigation-fetch.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/render/src/navigation-fetch.ts)) and swaps the whole answer, so holes fill through the re-run scripts and the first paint of an in-app navigation is as late as a full `ssr` render. A full load streams. No incremental parse here [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/render/src/navigation-fetch.test.ts#a%20page%3A%20its%20text%2C%20its%20build%2C%20no-store%20read%20off%20cache-control) **Why it stays** (`As of 2026-11-18`): The router swaps one whole answer, so head, scripts and holes land together. The extension point is the route's `navigation` declaration. **Do instead:** nothing to do in an app; a page that must paint first on a soft visit declares `navigation: 'document'`. |
79
78
  | 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`. |
80
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. |
81
80
  | `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. |
@@ -169,6 +168,7 @@ the release that fixed it. Upgrading is the fix, and the breaking entries are th
169
168
 
170
169
  | Gap | Fixed in | If you are pinned below that |
171
170
  |---|---|---|
171
+ | A soft visit waited for the slowest hole | **31.50.0** | The client router read the whole answer before swapping, so an in-app navigation to a `stream` page painted as late as a full `ssr` render. It now reads the answer as it arrives: the shell is swapped in at the server's first flush mark, and each hole fills as its chunk lands, through the same `$X()` reveal and scripts a full load runs; a newer navigation cancels the request, so the server aborts each hole's signal and a read that honours it stops. A click that reuses a prefetch still in flight waits for the whole answer, as a prefetch reads it whole. Measured on a page with holes at 300 ms, 1 s and 2 s, 20 soft visits in Chrome: the shell paints at 65 ms p95 (2,041 ms before), the last hole at 2,026 ms p95 (2,045 ms before) — the gain is the slowest hole, 1,976 ms. The router grows by 1,949 B minified (691 B gzip) [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/cli/e2e/stream-hole.e2e.test.ts#a%20soft%20visit%20paints%20its%20shell%20while%20the%20hole%20is%20open%3B%20the%20hole%20then%20fills%20and%20hydrates). Below it: a page that must paint first on a soft visit declares `navigation: 'document'` |
172
172
  | A queued offline write was not bound to its principal on the server: a second tab's sign-in could send it as the new session | **31.47.0** | A replay now names its queue's principal in `x-ultimate-replay-scope`, and the action route refuses any other session with `409 X_REPLAY_PRINCIPAL_MISMATCH` before the body is read. The entry stays `pending` for its owner, as it does on a 401 to a signed-in queue, and is sent when that account is back; entries stored by older builds are bound by the queue that holds them [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/realtime/src/page-outbox-principal.test.ts#the%20entry%20behind%20the%20one%20on%20the%20wire%20is%20refused%2C%20kept%2C%20and%20sent%20once%20its%20owner%20is%20back). Loading a page as another account still wipes the queue, deliberately. Below 31.47.0: sign out by full navigation, and do not share a browser profile between accounts with offline writes queued |
173
173
  | A browser's own `<form method="post">` to an action got JSON back on a refusal — `setRedirect` covered success only (deferred by plan 101: 234 wrapper calls in 142 files of one app) | **31.11.0** | `action({ native: { success, refusal? } })`: a `303` either way, the outcome in a one-read flash `useActionAnswer()` reads in `load`; a `page.tsx` form posting to an action without it is an `X_NATIVE_FORM_UNANSWERED` warning ([Actions](Actions#native-forms-native)). Below it: `if ((useRequestHeader('accept') ?? '').includes('text/html')) setRedirect(next)` in `handle` (both from `@ultimat3/http`) answers success; a refusal still answers the error page |
174
174
  | `bun run error-render` could not see a `catch (error)` binding | **8.0.0** | The gate matched a **parameter** annotated `unknown`/`any`; a `catch (error)` binding is `unknown` by inference and carries no annotation, which is how `String(error)` echoing a caller's request body into a 422 `cause:` stayed green in `packages/http/src/request.ts` through 3.0.0. `error-render` now joins `catchRenderFindings` ([`scripts/catch-render.ts`](https://github.com/developerz-ai/ultimate/blob/main/scripts/catch-render.ts)), which reads the catch binding and a `.catch((error: unknown) => …)` callback; its header lists what it still cannot see (a helper in a third file, a field laundered by another package). Below it: review every `catch` by hand — a caught value reaches a `cause:`/`fix:` only through `renderThrowable(error)` from `@ultimat3/core` |