@ultimat3/cli 31.49.0 → 31.51.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.
- package/CLAUDE.md +1 -1
- package/package.json +30 -30
- package/src/api-registration.ts +18 -1
- package/src/api-routes.ts +1 -0
- package/src/app-boundaries.ts +2 -0
- package/src/app-dev-imports.ts +77 -0
- package/src/app-load-import-chain.ts +112 -0
- package/src/app-load-unresolved.ts +173 -16
- package/src/app-load.ts +23 -7
- package/src/app-openapi.ts +7 -1
- package/src/budgets.ts +2 -1
- package/src/cmd-i18n.ts +33 -1
- package/src/codemods/engine-fs.ts +9 -2
- package/src/codemods/merge-drivers.ts +85 -4
- package/src/dev-only-imports.ts +59 -0
- package/src/error-codes-boundary.ts +2 -0
- package/src/evaluated-walk.ts +103 -0
- package/src/exercise-services.ts +13 -3
- package/src/framework-schema.ts +15 -5
- package/src/guard-sources.ts +1 -2
- package/src/index.ts +2 -0
- package/src/mcp-errors.ts +3 -1
- package/src/messages-upgrade.ts +4 -0
- package/src/module-imports.ts +26 -15
- package/src/page-navigation.ts +5 -2
- package/src/page-route.ts +75 -0
- package/src/pwa-artifacts.ts +1 -1
- package/src/retained-assets-boot.ts +1 -1
- package/src/runtime-assets-site.ts +2 -2
- package/src/runtime-assets.ts +1 -1
- package/src/runtime-render-document.ts +1 -2
- package/src/scan-ways.ts +145 -0
- package/src/site-asset-routes.ts +2 -2
- package/src/site-assets.ts +5 -158
- package/src/sw-precache-plan.ts +1 -1
- package/src/templates/guard-raw-motion.ts +96 -0
- package/src/templates/guard-released-forms.ts +4 -1
- package/src/templates/scaffold-repo.ts +1 -1
- package/src/test-only-shipped.ts +29 -2
- package/src/test-shards.ts +20 -8
- package/src/upgrade-coverage-ratchet.ts +95 -0
- package/src/upgrade-gate.ts +31 -11
- package/src/upgrade-report.ts +14 -0
- package/src/verify-checks.ts +7 -3
- package/src/verify-e2e.ts +21 -3
- package/src/workspace-checks.ts +4 -1
- package/wiki/Actions.md +64 -2
- package/wiki/Auth.md +6 -2
- package/wiki/CLI-Reference.md +8 -2
- package/wiki/Client-Navigation.md +34 -4
- package/wiki/Configuration.md +2 -1
- package/wiki/Entities-And-Migrations.md +12 -2
- package/wiki/Home.md +2 -2
- package/wiki/I18n.md +1 -1
- package/wiki/Interface-Rules.md +3 -1
- package/wiki/Known-Gaps.md +1 -1
- package/wiki/MCP-And-AI.md +41 -9
- package/wiki/Notify.md +4 -2
- package/wiki/Outbound-HTTP.md +53 -2
- package/wiki/Policies-And-Authz.md +1 -1
- package/wiki/Realtime.md +14 -6
- package/wiki/Routes-And-Render-Modes.md +1 -1
- package/wiki/Static-Assets.md +5 -3
- package/wiki/Testing.md +82 -3
- package/wiki/Theming.md +6 -3
- package/wiki/Troubleshooting.md +1 -1
- package/wiki/UI-Components.md +1 -0
- package/wiki/Upgrading.md +2 -0
package/wiki/Testing.md
CHANGED
|
@@ -53,6 +53,8 @@ export function useMigratedDatabase(): void {
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
**Shared test support lives in `apps/<app>/test/`** (a package's in `packages/<pkg>/test/`), never under `site/`, `app/`, `api/` or `shared/`. The boot scan imports the modules there, all but tests, client islands (`*.island.tsx`) and their `*.island.states.ts`, so a helper named `board.fixture.ts` beside its tests is evaluated by a role, `@ultimat3/cli` and `@ultimat3/testing` with it. Tests alone import what is in `test/`. The `boundaries` step warns `X_BOUNDARY_DEV_IMPORT`, naming the import to cut and the chain.
|
|
57
|
+
|
|
56
58
|
| Scope | What it gets |
|
|
57
59
|
|---|---|
|
|
58
60
|
| a test **file** | the worker's database with its DATA reset to the template's — every table truncated and re-filled, every sequence reset, triggers off meanwhile (`reusableDatabase`) |
|
|
@@ -393,6 +395,30 @@ test('the vendor map renders', async () => {
|
|
|
393
395
|
|
|
394
396
|
An entry covers the reads after the call and ends with the test; a blank `because` is refused, as in `e2eTest`. Each `goto` now spends five CDP deadlines, not three (`E2E_GOTO_MS`), for the audit's two reads. Source: `packages/testing/src/e2e-a11y.ts` (rules), `e2e-a11y-run.ts` (one test's run), `e2e-a11y-tabs.ts` (raw tabs), `ax-node.ts` (the tree reader).
|
|
395
397
|
|
|
398
|
+
## Passkeys and a second person in the e2e browser
|
|
399
|
+
|
|
400
|
+
`As of 2026-11`. Two free functions over the harness's own objects — `e2eBrowser()` in an app's e2e suite, `openE2eBrowser()` beside it — never a member a hand-rolled tab would lack:
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
import { addVirtualAuthenticator, e2eBaseUrl, e2eBrowser, expect, newBrowserContext } from '@ultimat3/testing';
|
|
404
|
+
|
|
405
|
+
const { page, session } = e2eBrowser();
|
|
406
|
+
const passkey = await addVirtualAuthenticator(page); // CTAP2, resident key, user verified
|
|
407
|
+
// … the app's own register / sign-in buttons run navigator.credentials.create/get, unprompted
|
|
408
|
+
expect((await passkey.credentials()).map((one) => one.rpId)).toEqual(['localhost']);
|
|
409
|
+
|
|
410
|
+
const invitee = await newBrowserContext(session); // no cookie or storage of the first profile
|
|
411
|
+
const tab = await invitee.newTab();
|
|
412
|
+
await tab.goto(`${e2eBaseUrl()}/invite/accept`);
|
|
413
|
+
await invitee.close();
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
| Call | Is |
|
|
417
|
+
|---|---|
|
|
418
|
+
| `addVirtualAuthenticator(tab, { transport?, residentKey?, userVerified? })` | CDP `WebAuthn` on that tab: `{ id, credentials(), setUserVerified(verified), remove() }`. Per tab, presence simulated; `userVerified: false` makes every user-verification fail. The rp id the ceremony names must be the page's host or a parent domain of it (`login.example.com` may register for `example.com`) and never an IP; locally, serve on `localhost`. `remove()` detaches that authenticator only |
|
|
419
|
+
| `newBrowserContext(session)` | `Target.createBrowserContext`: `{ id, newTab(), close() }`. Its tabs are attached, configured (offline switch, init scripts, `Accept-Language`) and audited as `session.newTab()`'s are; `close()` disposes every tab in it |
|
|
420
|
+
| a tab or session the harness did not build | `X_TEST_FIXTURE_UNAVAILABLE`, naming what it needs |
|
|
421
|
+
|
|
396
422
|
## Matchers
|
|
397
423
|
|
|
398
424
|
Installed by the preload on `expect`.
|
|
@@ -450,13 +476,42 @@ unitTest('the dashboard counts the posts of the org that is looking', async () =
|
|
|
450
476
|
| Answer | Is |
|
|
451
477
|
|---|---|
|
|
452
478
|
| `view.html` | the markup, as the document carries it |
|
|
453
|
-
| `view.text` | what a reader sees — tags and script/style bodies removed,
|
|
479
|
+
| `view.text` | what a reader sees — tags and script/style bodies removed, character references decoded (every numeric one, and the common named ones: `"`, `'`, ` `, typographic quotes and dashes …) as a browser reads them; a no-break space is kept. Compare it with `t('<key>')` |
|
|
454
480
|
| `view.data` · `view.meta` | what `load` resolved, and what `meta` answered for that same object |
|
|
455
481
|
| `view.islands` | the islands the render emitted. Empty on a page that ships no JavaScript |
|
|
456
482
|
|
|
457
|
-
`actor` runs `load` and the page inside a request context holding that actor. `
|
|
483
|
+
`actor` runs `load` and the page inside a request context holding that actor. A `url` whose first
|
|
484
|
+
segment is a routed locale (`https://example.test/es/precios`) renders `load`, `meta` and the page
|
|
485
|
+
in that locale, as the router reads the prefix. Unprefixed and with no `actor`, no request context is
|
|
486
|
+
opened: standalone that is the default locale, inside your own `runWithContext` it is that context's.
|
|
487
|
+
`cookies: { sid: '…' }` runs them inside a GET request for `url` carrying those cookies, read by
|
|
488
|
+
`useRequestCookie(name)` as a browser's are (`As of 2026-11`); with `actor` or a locale prefix too,
|
|
489
|
+
the actor still acts and the locale still holds. `renderView` refuses
|
|
458
490
|
a component that renders an `island()` — its hydration timing is a route's. `As of 2026-10`.
|
|
459
491
|
|
|
492
|
+
### A page's own GET
|
|
493
|
+
|
|
494
|
+
`renderRoute` says what a page renders. To see what a visitor RECEIVES (status, headers, cookies
|
|
495
|
+
set, a redirect, the document) through the real pipeline, import `pageRoute` from `@ultimat3/cli`,
|
|
496
|
+
the package that owns the page handler:
|
|
497
|
+
|
|
498
|
+
```ts
|
|
499
|
+
import { pageRoute } from '@ultimat3/cli';
|
|
500
|
+
import { expect, unitTest } from '@ultimat3/testing';
|
|
501
|
+
|
|
502
|
+
unitTest('the dashboard refuses an anonymous visitor', async () => {
|
|
503
|
+
expect((await pageRoute('/dashboard')).status).toBe(401);
|
|
504
|
+
const seen = await pageRoute('/dashboard', { cookies: { sid: 's-1' } });
|
|
505
|
+
expect(seen.status).toBe(200);
|
|
506
|
+
});
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
`pageRoute(path, { headers?, cookies?, buildId? }): Promise<Response>` sends `GET <path>` (URL path
|
|
510
|
+
and query, starting with `/`) through `httpPipeline` over the pages registered in the process
|
|
511
|
+
(`registerRoute`, or `loadApp`). `cookies` are percent-encoded as `useRequestCookie` decodes them;
|
|
512
|
+
give `cookies` or a `cookie` header, not both. A path no page claims is the pipeline's 404; a path
|
|
513
|
+
without a leading `/` is `X_INVARIANT`, naming the fix. `As of 2026-11`.
|
|
514
|
+
|
|
460
515
|
## Asserting on what an element carries
|
|
461
516
|
|
|
462
517
|
A string cannot say whether a node carries `aria-live`, or what its `onKeyDown` does. Walk the tree
|
|
@@ -623,6 +678,29 @@ What the rendered result is then held to: [Interface rules](Interface-Rules).
|
|
|
623
678
|
| `subscribe` | one subscriber's `rows()` `patches()` `settled()` `lsn()` | a replicator |
|
|
624
679
|
| `seed`, and anything else | the app's own graph | the app's `scripts/test-setup.ts` |
|
|
625
680
|
|
|
681
|
+
**Keys and the console: `pressKey(page, key)`, `consoleMessages(page)`, `expectNoConsoleErrors(page)`** (`@ultimat3/testing`). Free functions over the `page` an `e2eTest` or the `{ page }` fixture hands you, so `PageLike` itself does not grow:
|
|
682
|
+
|
|
683
|
+
```ts
|
|
684
|
+
import { e2eTest, expect, expectNoConsoleErrors, pressKey } from '@ultimat3/testing';
|
|
685
|
+
|
|
686
|
+
e2eTest('the dialog is keyboard-reachable and the page logs no error', async ({ page }) => {
|
|
687
|
+
await page.goto('/settings');
|
|
688
|
+
await pressKey(page, 'Tab'); // a real key: focus moves, Enter submits
|
|
689
|
+
await pressKey(page, 'Control+k'); // a chord: Alt, Control, Meta, Shift held
|
|
690
|
+
await pressKey(page, 'Escape');
|
|
691
|
+
expect(await page.evaluate(() => document.activeElement?.id)).toBe('search');
|
|
692
|
+
await expectNoConsoleErrors(page); // X_E2E_CONSOLE_ERRORS, quoting each
|
|
693
|
+
});
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
| Call | Answers |
|
|
697
|
+
|---|---|
|
|
698
|
+
| `pressKey(page, key)` | a trusted key press at the focused element: a name in `PRESS_KEYS` (`Tab` `Enter` `Escape` `Backspace` `Delete` `Home` `End` `PageUp` `PageDown` the arrows, `' '`), one ASCII letter or digit, or a chord `Mod+…+key` (`Shift+Tab`, `Control+k`) — Shift makes the key a US keyboard makes (`Shift+1` is `!`), Control/Meta/Alt type nothing. A chord the grammar refuses is `X_SCRAPE_KEY_INVALID` (the one chord grammar, `@ultimat3/scraping`'s); a key it does not know, `X_CDP_CALL_FAILED` |
|
|
699
|
+
| `consoleMessages(page)` | `readonly E2eConsoleMessage[]`, `{ level: 'debug' \| 'log' \| 'info' \| 'warning' \| 'error', text, source: 'console' \| 'exception' }`, since the running test began — each `e2eTest` and each test that takes the `{ page }` fixture starts it, after flushing the previous test's lines in flight — and after one round trip, so a line printed just before is in it. A cross-site iframe's console counts. `text` is the raw arguments joined by a space (no `%d` substitution). The tab keeps 1,000 lines of 2,000 characters at most, dropping the oldest non-error first, so an error survives a noisy page |
|
|
700
|
+
| `expectNoConsoleErrors(page)` | resolves when no `error` arrived since the test began (`console.error`, a failed `console.assert`, an uncaught throw); else `X_E2E_CONSOLE_ERRORS` listing them all. Warnings pass; filter `consoleMessages` for another rule |
|
|
701
|
+
|
|
702
|
+
A page no e2e driver built, or a hand-rolled `E2eBrowserPage` without `press` / `consoleMessages` (with `clearConsole` to start each test's console), is refused by name (`X_TEST_FIXTURE_UNAVAILABLE`). `As of 2026-11`.
|
|
703
|
+
|
|
626
704
|
**`waitForServiceWorker({ timeoutMs? })` hands the first page over** (25.0.0, #678). The framework's register script runs on `load`, so the first page of a run is committed before its worker activates and `clients.claim()` can miss it: `ready` resolves and no `controllerchange` ever fires. The wait answers `ready`, gives the claim a second (`CLAIM_GRACE_MS`), and reloads an uncontrolled page ONCE — that navigation is answered by the worker — within one budget (`serviceWorkerTimeoutMs`, 10 s, or this call's `timeoutMs`). A page with no worker is refused without a reload, and a reload still uncontrolled is refused saying so (`X_E2E_SERVICE_WORKER_ABSENT`). Proven against a real worker that never claims: `packages/testing/e2e/service-worker-handover.e2e.test.ts`.
|
|
627
705
|
|
|
628
706
|
The last five are **declared, not built**. The framework does not bundle a browser, so the name resolves and asking for it without a driver fails as `X_TEST_FIXTURE_UNAVAILABLE` naming what is missing — different from `X_TEST_FIXTURE_UNKNOWN`, whose fix ("register it") would have the app inventing its own idea of what a page is. A driver installs through the same registry:
|
|
@@ -1151,6 +1229,7 @@ shape, same unreached code. `As of 2026-11`.
|
|
|
1151
1229
|
| Rule | |
|
|
1152
1230
|
|---|---|
|
|
1153
1231
|
| Database | a scratch one with the framework tables and every migration applied; never the developer's. The pass commits, so the tenant proof can read rows after the call |
|
|
1232
|
+
| Services | what a server's boot installs beside its database, over the scratch one: a memory storage disk (unless the app defined its own), the fleet-wide rate-limit store, the fleet-wide auth limiter (`postgresAuthLimiter` per declared policy, so `defineAuth({ rateLimit: { scope: 'shared' } })` is judged, not refused with `X_AUTH_LIMITER_NOT_SHARED`, `As of 2026-11`), and a Web Push runtime whose sends are captured |
|
|
1154
1233
|
| Rows | one seed graph for the pass, a fresh pair of tenants per primitive in it — the first the actor's (A), the second the tenant proof's intruder (B); every table seeded off its declaration, parents first, same-tenant keys (`x db seed --generate`'s graph). A view and a `readOnly: '<why>'` table get no row; a NOT NULL key into a `readOnly` one is `X_SEED_GRAPH_UNSATISFIED` naming it ([Read-only tables](Entities-And-Migrations#read-only-tables)) |
|
|
1155
1234
|
| Actor | the entry's `actor` when it declares one, seated in the primitive's tenant — and a top-level value of its bound input — or of its `facts`, a string or an array holding it — equal to the org the entry declared becomes that tenant too, so `input: (drawn) => ({ ...drawn, orgId: '<the actor's org>' })` holds in every tenant the pass seeds; otherwise the first of `x policy explain`'s actors the policy allows, in the primitive's tenant (an `{ input }`-only entry keeps this pick and still binds its input). None allowed is `refused`, by design. Its id has a user's shape: a uuid per role × tenant, the same on every run (`exerciseActorId`), never the role's name. Where the database has `x_users` (the framework schema every pass database is built with) each actor the pass acts as gets its row first — `<id>@exercise.invalid`, its tenant, roles, permissions, scopes — so `findUserById(ctx.actor.id)` finds it; a refused insert is `X_EXERCISE_ACTOR_USER_UNSEATED`. `defineExercise(…, { actor: members })` makes the id a seeded row's key instead (`As of 2026-11-08`) |
|
|
1156
1235
|
| Input | the override, then an id field whose stem names a seeded entity (`postId` → `posts`), then the schema's minimal draw. A wrong guess shows as `unreached` |
|
|
@@ -1268,7 +1347,7 @@ Source: `packages/testing/src/scale-sweep*.ts`, `plan-oracle.ts`, `plan-sweep*.t
|
|
|
1268
1347
|
| Sweep | What | Red |
|
|
1269
1348
|
|---|---|---|
|
|
1270
1349
|
| scale | every reached primitive once more in a tenant at 2 rows a table, once in one at 8; per statement shape, the counts compared. Each sized seed is written beside the graph before it: row positions (a generated integer, a factory's `index`) continue past that graph's, so ``code: `c${index}` `` on a unique column never repeats the pass's own row | a shape sent more often at 8 than at 2, where it was sent at least once: `X_QUERY_SCALES_WITH_ROWS`, fix `preload()` or `expectedQueryLoop('<why>', fn)`. A shape sent only at 8, nothing else grown, is another path (a branch on the handed row), `unproven` (`As of 31.16.0`); the 8-row graph opens on the 2-row graph's values in every non-unique column, so the handed row is the same at both sizes |
|
|
1271
|
-
| plans | every distinct statement whose first relation is an app table, `PREPARE`d and explained as a generic plan with `enable_seqscan`, `enable_bitmapscan` off — and, for a statement with a `Limit`, planned again with `enable_sort` off for its sort alone — in a read-only transaction | `Seq Scan`, or an index scan with no `Index Cond` no `Limit` stops: `X_QUERY_UNINDEXED`. `Sort` under `Limit`: `X_QUERY_SORT_UNSERVED`, on the table its key names. Each prints an `indexes:` entry, one per arm for an `or`; a sort no declarable index serves (an expression, an aggregate, a derived column, keys across tables, mixed directions) or an index the entity already declares prints a rewrite or `expectedSeqScan` instead |
|
|
1350
|
+
| plans | every distinct statement whose first relation is an app table, `PREPARE`d and explained as a generic plan with `enable_seqscan`, `enable_bitmapscan` off — and, for a statement with a `Limit`, planned again with `enable_sort` off for its sort alone — in a read-only transaction | `Seq Scan`, or an index scan with no `Index Cond` no `Limit` stops: `X_QUERY_UNINDEXED`. `Sort` under `Limit`: `X_QUERY_SORT_UNSERVED`, on the table its key names. Each prints an `indexes:` entry, one per arm for an `or`; a sort no declarable index serves (an expression, an aggregate, a derived column, keys across tables, mixed directions) or an index the entity already declares prints a rewrite or `expectedSeqScan` instead. An index WALK that an index the entity already holds would serve (its equality columns, then the order) is green: on a seed of a few rows a partial index such as `where revoked_at is null` costs as little as the keyed one and the generic plan walks it. A schema heuristic, not a promise about production plans: with many revoked rows sharing a key and few active ones, the walk can stay cheaper at volume (`As of 2026-11`) |
|
|
1272
1351
|
|
|
1273
1352
|
With the planner's scans and sorts disabled it picks one only when no index can answer, so the
|
|
1274
1353
|
verdict reads the schema on empty tables — no volume, no statistics. Never red: `scale.verdict`
|
package/wiki/Theming.md
CHANGED
|
@@ -228,8 +228,9 @@ brandStyleTag(brand); // '<style>…</style>' — for a page you render yo
|
|
|
228
228
|
| `shadows` | `Partial<Record<'light' \| 'dark', Partial<Record<ShadowName, string>>>>` | elevation is themed like colour |
|
|
229
229
|
| `radius` | `Partial<Record<RadiusName, string>>` | `none sm md lg xl pill full` |
|
|
230
230
|
| `font` | `Partial<Record<'sans' \| 'mono' \| 'data', string>>` | the font slots |
|
|
231
|
+
| `motion` | `{ duration?: Partial<Record<DurationName, string>>; easing?: Partial<Record<EasingName, string>> }` | the app's own tempo: `t.duration(base)` reads `--duration-base`, so one rung re-times every component. Declaring `--duration-base` with a literal time (`180ms`, `.5s`; lowercase `ms` or `s`) or `cubic-bezier(…)` in a stylesheet is `X_RAW_MOTION`, whose fix names this slot with the value spelled as the slot takes it; a zero (`0ms`) or a plain `var(--…)` read is not reported, but a literal nested in one (`var(--x, calc(180ms * 2))`) is |
|
|
231
232
|
|
|
232
|
-
Returns a frozen `{ css: string }`. It emits `:root`, `html[data-theme='light']`, the `prefers-color-scheme: dark` block and `html[data-theme='dark']` — radius and
|
|
233
|
+
Returns a frozen `{ css: string }`. It emits `:root`, `html[data-theme='light']`, the `prefers-color-scheme: dark` block and `html[data-theme='dark']` — radius, font and motion ride `:root` only. Output is ordered by the canonical scale arrays rather than by your object, so re-rendering the same input is byte-identical. Empty input gives `css: ''`, which the framework emits nothing for.
|
|
233
234
|
|
|
234
235
|
### Values are validated, never escaped
|
|
235
236
|
|
|
@@ -239,12 +240,14 @@ The output can land in a `<style>` element (`brandStyleTag`), so a value that co
|
|
|
239
240
|
|---|---|---|
|
|
240
241
|
| colour | `^\d{1,3} \d{1,3} \d{1,3}$`, each channel ≤ 255 | `#1e6eb2`, `rgb(1,2,3)`, `1 1 1; } html { display: none }` |
|
|
241
242
|
| radius | `^(0\|\d+(\.\d+)?(px\|rem\|em\|ch\|%))$` | `calc(…)`, `var(…)`, `1` with no unit |
|
|
243
|
+
| duration | `^(0\|\d+(\.\d+)?(ms\|s))$`; `0` is emitted as `0ms`, a unitless zero being no CSS time | `180`, `calc(…)`, `-10ms` |
|
|
244
|
+
| easing | `cubic-bezier(x1, y1, x2, y2)`, numbers only, x1 and x2 in [0, 1] | `ease-in`, `steps(4)`, `cubic-bezier(1.2, 0, 0, 1)` |
|
|
242
245
|
| font | `^[\w\s,'"-]{1,200}$` | anything with `;` `}` `<` `>` `(` `)` `/` `:` — so `Menlo</style><script>` cannot get through |
|
|
243
246
|
|
|
244
247
|
| Failure | Code | Means |
|
|
245
248
|
|---|---|---|
|
|
246
|
-
| unknown role, radius name
|
|
247
|
-
| known key, unusable value | `X_UI_INVALID_VALUE` | `cause` names the slot and what was expected |
|
|
249
|
+
| unknown role, radius name, font slot, motion scale or rung | `X_TOKEN_UNKNOWN` | the key is not in the scale; `cause` lists every name that is |
|
|
250
|
+
| known key, unusable value — or a `motion`, `duration` or `easing` that is not an object (`null` from JSON) | `X_UI_INVALID_VALUE` | `cause` names the slot and what was expected |
|
|
248
251
|
|
|
249
252
|
## Resolution and first paint
|
|
250
253
|
|
package/wiki/Troubleshooting.md
CHANGED
|
@@ -37,7 +37,7 @@ The `--json` form is the same content as the terminal form. Paste the JSON into
|
|
|
37
37
|
| `X_DB_DRIFT` | schema differs from migrations (a column added by hand, or a generated migration never applied) | `x db gen "<message>"` then `x db migrate`. A column no entity declares is an empty diff: declare it, or restore the migration and `x db reset` |
|
|
38
38
|
| `X_DB_DRIFT`, cause *the dump holds a column no migration's snapshot records* | an applied migration was edited, and `x db gen` wrote the edit into `packages/db/schema/` | `git checkout -- packages/db/migrations packages/db/schema`. Meant it: declare the column on its entity, then `x db gen "<change>"` |
|
|
39
39
|
| `X_MIGRATION_CONFLICT`, *was applied with checksum* | an applied migration's file was edited | `git log -- packages/db/migrations/<id>.sql`, then `git checkout <rev> -- …` the revision whose checksum the ledger names, then `x db gen "<change>"`. `x db gen` first exits 0 and poisons the dump |
|
|
40
|
-
| `X_APP_IMPORT_UNRESOLVED` | an app module imports a package nobody installed, or a path with no file behind it.
|
|
40
|
+
| `X_APP_IMPORT_UNRESOLVED` | an app module imports a package nobody installed, or a path with no file behind it. A package the app imports is one finding, however many modules import it. A failure inside an installed package is one finding per app module to edit, with the chain when static imports spell it | `bun add <pkg>`, or edit the import in the file the finding names. A pruned dependency: `bun install --frozen-lockfile`; a damaged package: `bun install --force`. `x doctor` reports it too |
|
|
41
41
|
| `X_DB_DRIFT` on a brand-new app, cause *packages/db has a schema but no migration recorded it* | expected: `x new` writes no migration, and `x db gen` is the only writer of `packages/db/migrations`. Only an app that declares an entity reports it — zero declared against zero recorded is agreement | `x db gen "initial"` then `x db migrate` — `bun run setup` does both |
|
|
42
42
|
| `X_DB_DRIFT` after deleting the last entity, migrations still committed | correct, and not the case above: the migrations record tables the source no longer declares | `x db gen "drop <table>"` → it refuses with `X_MIGRATION_IRREVERSIBLE` → re-run as `x db gen "drop <table>" --allow-destructive`, or put the entity back |
|
|
43
43
|
| `X_MIGRATION_FORKED` after merging two branches | each ran `x db gen` from one parent, so the newest `.snapshot.json` omits the other's work | `x db gen --merge-fork`: no SQL changes, nothing is deleted. Do not generate a `record …` migration. If the cause says a migration creates something *again*, follow its `x db status --json` check, and never delete a migration a database applied |
|
package/wiki/UI-Components.md
CHANGED
|
@@ -151,6 +151,7 @@ One mode per use, and the type holds it: `hrefFor` beside `onCursor`, `onPage`,
|
|
|
151
151
|
- **Which list, when.** Records with columns: `DataTable`. Thousands of one-shape rows: `VirtualList` (no script, every row renders; with script, under 100 mounted). Things inside things: `Tree` — `hrefFor` is `<details>` and links at 0 B, `onSelect` is the island's `role="tree"`. What happened: `Timeline` (+ `InfiniteScroll` + `RelativeTime` is the activity feed; there is no feed component). Facts about one thing: `DescriptionList`, never a two-column `Table`.
|
|
152
152
|
- **Dates are the native input first.** `DatePicker`/`DateRangePicker` are `<input type="date">` with a `Calendar` popover only on a fine pointer with script. A date is a `PlainDate`; a window (`TimeRangePicker`, `timeRangeUrl`) is instants and takes a REQUIRED `timeZone`. Presets are the app's. `Slider` is `<input type="range">`; a segmented control is `Radio appearance="segmented"`; there is no number stepper.
|
|
153
153
|
- **Reordering is `SortableList` and `Board`, a split is `SplitPane`** — one Pointer Events gesture, never HTML5 drag. A drop calls `onMove` once and is a request: the row holds until it settles, a rejection restores it and says so. `canDrop(item, group)` is the one seam for a WIP limit or a status machine. With `action`, each row is a real `<form>` (Up/Down, or a target `select` per card). The handle alone has `touch-action: none`, so a phone still scrolls from a row's body. `SplitPane` is one column below `md`; `onResize` + `value` is how a split persists — storage is the app's.
|
|
154
|
+
- **Selecting rows is `selection` on `DataTable` and `Board`, one shape for both** (`As of 2026-11`). `selection: { name, form?, value, onChange?, label, matching?, actions? }`. Scripting off, every row is a native checkbox posting its key under `name` in one `form`, and the caller's `actions` in the `BulkBar` submit it. With `onChange`: Shift+click ranges from the last row clicked; on a row's box Down/Up move, Shift+Down/Up extend, Ctrl/Cmd+A ticks the page, Escape clears (the ARIA grid pattern; Space stays the checkbox's); a table adds a tick-all header box; a finger held on a board card ticks it. `value` is a `RowSelection`: `{ kind: 'keys', keys }` or `{ kind: 'matching', filter }`. **"All matching" carries the filter, never ids** — its box posts `matching.filter` under `matching.name`, and a server that receives it re-runs the filter and ignores the keys beside it. A key that left `rows`, or a `matching` from another filter, is pruned through `onChange` (never while a first page loads), and with `onChange` the bar's status region counts the ticked rows still on the list — or, under "all matching", the filter's whole `matching.count`; scripting off it shows no count, which could not follow the boxes. `matching.name` must differ from `name` (`X_UI_INVALID_VALUE`). A `Board` with `action` already draws a `<form>` per card, so its bulk form stands apart from the board, named by `form`, with its submit buttons carrying the same `form`. The bar is `BulkBar`, usable alone.
|
|
154
155
|
- **What a model wrote is `Markdown`; code is `CodeBlock`; never `innerHTML`.** Raw HTML prints as text, links only http/https/mailto/relative, a remote image prints its alt as a link unless `resolveImage` vouches for it, `baseLevel` defaults to 2. Fences go through `CodeBlock`, highlighted only by the `languages` the caller passes (`allLanguages` on a server page; one named language in an island). Structured payloads are `JsonView`, changes `DiffView` (two texts or a unified patch), structured logs `LogViewer`, terminal output `TerminalView` (SGR colours as roles). A rich-text editor is `Textarea` plus a `Markdown` preview.
|
|
155
156
|
|
|
156
157
|
## Error codes
|
package/wiki/Upgrading.md
CHANGED
|
@@ -330,6 +330,7 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
330
330
|
| `x upgrade` stops requiring an `e2e` suite no codemod wrote (**31.47.1**): an app with pages but no `apps/web/site/page.tsx` was left on `X_VERIFY_SUITE_VANISHED`. Rerunning `x upgrade` at the target no longer replays every codemod | nothing: `x upgrade` applies codemod `e2e-suite-floor`, which writes a `page.e2e.test.ts` beside the shortest parameter-free page, or moves `e2e` to `skip` with its why when no page can be visited. To apply codemods an older CLI left behind: `x upgrade codemods --from 0.0.0 --json` |
|
|
331
331
|
| 24 shipped guards' fixes change (**31.49.0**), built in; their findings do not: `animated-layout-property`, `bare-error`, `error-declared`, `focus-visible`, `image-dimensions`, `island-mount-clears`, `native-confirm`, `raw-breakpoint`, `raw-colour`, `raw-fetch`, `raw-interval`, `raw-length`, `raw-motion`, `raw-shadow`, `raw-z-index`, `repo-await-in-loop`, `repo-raw-sql`, `repo-unbounded`, `runtime-pin`, `semantic-interactive`, `unbounded-fanout`, `undeclared-custom-property`, `undefined-style-class` and `unzoned-date` end their fix on the one step that re-checks it (`then: x verify --only boundaries`) in place of `then: x verify`, which started the whole gate. A copy still in `guards/` keeps the old text until `x upgrade` migrates it to the release after 31.48.0 | nothing |
|
|
332
332
|
| **Upgrading to the next release: what to check**, in this order. `As of 2026-11-19`; each row below names one check, and [`CHANGELOG.md`](https://github.com/developerz-ai/ultimate/blob/main/CHANGELOG.md)'s `[Unreleased]` carries the detail. Five `app.config.ts` keys that were validated and read by nothing are **read** now (the next row) | run the rows in order, then `x verify` |
|
|
333
|
+
| the shipped `raw-motion` guard's fix changes (**31.50.0**), built in; its findings do not: a stylesheet re-declaring a motion scale property (`--duration-base: 180ms`, `--easing-out: cubic-bezier(…)`) is still `X_RAW_MOTION`, and the fix now names `defineTheme({ motion: { duration: { base: '180ms' } } })` in `apps/web/shared/theme.ts` instead of a token that reads the property itself. A copy still in `guards/` keeps the old text until `x upgrade` migrates it to the release after 31.49.0 | nothing; an app that wants its own tempo moves the declaration into `defineTheme({ motion })` |
|
|
333
334
|
| `app.config.ts` keys now read (**31.49.0**): `roles` — a `ROLE` it does not list refuses to boot (`X_CONFIG_INVALID`, `meta.key: 'roles'`; `ROLE=migrate` exempt); `database.ssl: true` adds `sslmode=require` on **every** pool — serving roles, `x dev`, migrate, the replicator's `DATABASE_URL` and `REPLICATION_URL`, `x doctor`'s probes, `x db branch`, `x deploy verify` — unless the URL or `PGSSLMODE` states a mode; `cache.defaultTtlMs` sets the boot-built `lru`/`redis` lease (a Redis rung held such values 300 s, now 60 s by default; `0` is refused); `jobs.maxAttempts` (default now `3`, not the documented `5`) and `jobs.backoff` apply to every job declaring no `retry` | `grep -n 'roles\|ssl\|defaultTtlMs\|maxAttempts\|backoff' app.config.ts`. `roles`: every `ROLE` your compose services, Helm values or platform processes start is listed, or drop the key. `ssl: true` against a Postgres without TLS: `database: { ssl: false }` or `?sslmode=disable` in each URL. `defaultTtlMs: 0`: a positive lease. `maxAttempts` / `backoff`: keep them only if they are the retry you want for every job declaring none |
|
|
334
335
|
| `pwa.enabled`, `pwa.backgroundSync` and `pwa.push` must be real booleans (**31.49.0**), checked even when `enabled` is false: `'false'` used to turn the PWA **on**; a non-list `pwa.categories` / `shortcuts` / `screenshots`, a non-string `neverCache` entry or `site.favicon` are refused too — `X_CONFIG_INVALID` at boot | each a literal `true` or `false` in `app.config.ts`'s `pwa` block |
|
|
335
336
|
| a records channel keyed by a param that is not the tenant column (a `roomId` topic) delivers a tenanted row only to members of that row's tenant, live and on replay (**31.49.0**); every other member receives the seq alone | nothing, unless a channel deliberately fanned one org's rows out to members of other orgs: that feed needs its own untenanted table or a channel keyed by the tenant column |
|
|
@@ -356,6 +357,7 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
356
357
|
| fix text changed, codes unchanged (**31.49.0**): `X_ENV_MISSING` is the line to add to the file the environment loads; `X_CATALOG_MISSING_KEYS`'s comment half; `X_TEST_FAILED` reruns the first failing file; on the embedded development database `X_MIGRATION_CONFLICT` and `X_MIGRATION_ROLLBACK_DESTRUCTIVE` lead with `x stop --json && x db reset` | anything matching those strings exactly: `grep -rn 'x env check\|as ⟦key⟧' <your scripts>` and match the new text |
|
|
357
358
|
| new scaffolds (**31.49.0**): `docker/docker-compose.test.yml` is named `<app>-test-<hash of the directory>` with ports picked per directory, and `package.json` declares `@ultimat3/realtime` | nothing; an existing app keeps its `name:` and dependency set. One importing `@ultimat3/realtime` without declaring it: `bun add --exact @ultimat3/realtime@$(bun -p "require('./package.json').dependencies['@ultimat3/core']")`. Sharing a test stack with a same-named app: its own `name:` and ports in the compose file and `docker/test-services.env` |
|
|
358
359
|
| a production container runs one process per declared CPU (**31.49.0**, `ULTIMATE_PROCESSES=auto`, [Processes per container](Deployment#processes-per-container)), and `jobs.concurrency`, `jobs.maxInFlight` and `DATABASE_POOL_MAX` are per **container**, split across its processes. A no-op for a container that declares no CPU quota (no `cpus:` in Compose, no CPU limit in Kubernetes — every scaffold before this): it still runs one process, where container and process are the same. A service that **already** declares `cpus:` of 2 or more, or a Kubernetes CPU limit of 2 or more, runs that many processes once every clamp passes (shared state, the pool, a prebuilt image). The new scaffold's compose declares `cpus:` per role and `init: true`, and carries `sysctls: { net.ipv4.tcp_migrate_req: 1 }` on `web`/`sync` commented out (Linux ≥ 5.14 only: on an older kernel Docker refuses to create the container); its chart pins `ULTIMATE_PROCESSES: "1"` | with no CPU quota anywhere: nothing. A service with `cpus:` or a CPU limit ≥ 2: `x doctor` names the count each role would run; set `ULTIMATE_PROCESSES=1` on it to keep one process, or keep N and, on a host ≥ Linux 5.14, add `sysctls: { net.ipv4.tcp_migrate_req: 1 }` to `web`/`sync`. To use a second core on purpose: `cpus: '2'` on the service (and 256 MiB of `mem_limit` per process), `init: true`, the same `sysctls:` line where the kernel has it, then `x doctor`. A worker with `concurrency: 1` stays serial across the container |
|
|
360
|
+
| `x verify`'s `boundaries` step lists `X_BOUNDARY_DEV_IMPORT` under `warnings` for each import to cut where a module the boot scan imports reaches `@ultimat3/cli` (the barrel), `@ultimat3/testing` or `bun:test` through static imports of the app's own files (**31.51.0**). The step stays green; a refusal is planned for `next`. `X_APP_IMPORT_UNRESOLVED` for an import that failed inside an installed package is now `at` the app module that reached it, with `meta.chain` when static imports spell the way there | `git mv apps/web/app/<slice>/<name>.fixture.ts apps/web/test/` and repoint its tests, or drop the import from a module a role needs |
|
|
359
361
|
|
|
360
362
|
## 29.x → 30.0.0, entry by entry
|
|
361
363
|
|