@ultimat3/cli 31.46.0 → 31.47.1
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/README.md +1 -1
- package/package.json +29 -29
- package/src/affected.ts +3 -2
- package/src/app-config-load.ts +8 -5
- package/src/app-mcp.ts +2 -5
- package/src/app-runtime.ts +4 -4
- package/src/cmd-cache.ts +8 -4
- package/src/cmd-deploy-compose.ts +11 -12
- package/src/cmd-deploy-helm.ts +5 -8
- package/src/cmd-exercise-spec.ts +2 -2
- package/src/cmd-exercise.ts +7 -19
- package/src/cmd-new.ts +4 -3
- package/src/cmd-planned.ts +11 -76
- package/src/cmd-shot-matrix.ts +3 -2
- package/src/cmd-token.ts +11 -3
- package/src/cmd-upgrade.ts +5 -7
- package/src/codemods/ci-weekly-schedule.ts +61 -0
- package/src/codemods/e2e-suite-floor.ts +42 -0
- package/src/codemods/e2e-suite.ts +71 -0
- package/src/codemods/index.ts +4 -0
- package/src/codemods/pending.ts +2 -2
- package/src/codemods/test-ports.ts +40 -33
- package/src/codemods/test-suites.ts +11 -22
- package/src/codemods/vendored-guards.ts +3 -5
- package/src/codemods/verify-floor-skips.ts +22 -12
- package/src/codemods/verify-floor-steps.ts +4 -3
- package/src/db-seed.ts +3 -2
- package/src/dispatch.ts +2 -11
- package/src/duplicate-packages.ts +4 -4
- package/src/exercise-findings.ts +4 -3
- package/src/exercise-floor.ts +1 -1
- package/src/exercise-seed.ts +34 -0
- package/src/fix-command.ts +2 -3
- package/src/flag-reads.ts +6 -3
- package/src/generate-files.ts +10 -6
- package/src/gitignore.ts +4 -3
- package/src/guards-built-in.ts +3 -6
- package/src/guards.ts +5 -8
- package/src/island-bundle.ts +3 -2
- package/src/island-sources.ts +4 -3
- package/src/island-states-load.ts +4 -3
- package/src/island-store.ts +3 -2
- package/src/json-merge.ts +8 -6
- package/src/lint-findings.ts +4 -7
- package/src/mcp-errors.ts +2 -2
- package/src/messages.ts +1 -0
- package/src/prerender-out.ts +4 -3
- package/src/publish-closure.ts +4 -6
- package/src/pwa-manifest-locales.ts +5 -8
- package/src/registry.ts +0 -7
- package/src/root-env.ts +3 -2
- package/src/runtime-admin.ts +2 -4
- package/src/runtime-keys.ts +5 -2
- package/src/static-report.ts +5 -8
- package/src/templates/github/ci-schedule.ts +86 -0
- package/src/templates/github/ci.yml.ts +6 -8
- package/src/templates/github/dependabot.yml.ts +6 -1
- package/src/templates/guard-released-forms.ts +30 -8
- package/src/templates/scaffold-docs.ts +1 -0
- package/src/templates/scaffold-suites.ts +22 -0
- package/src/templates/shapes/overlay.ts +4 -7
- package/src/upgrade-gate-codemods.ts +1 -18
- package/src/upgrade-guards-baseline.ts +3 -5
- package/src/verify-merge-skips.ts +2 -4
- package/src/verify-merge.ts +13 -8
- package/src/verify-part-step.ts +5 -7
- package/src/worker-bundle.ts +4 -2
- package/wiki/Actions.md +69 -5
- package/wiki/Agents.md +13 -0
- package/wiki/Auth.md +4 -0
- package/wiki/Batching-And-Preloading.md +77 -3
- package/wiki/CLI-Reference.md +19 -6
- package/wiki/Caching-And-Invalidation.md +76 -23
- package/wiki/Client-Navigation.md +2 -0
- package/wiki/Compared.md +13 -11
- package/wiki/Configuration.md +17 -4
- package/wiki/Entities-And-Migrations.md +168 -6
- package/wiki/FAQ.md +1 -1
- package/wiki/Feature-Flags.md +3 -0
- package/wiki/Getting-Started.md +27 -1
- package/wiki/Jobs-And-Workflows.md +70 -13
- package/wiki/Known-Gaps.md +58 -49
- package/wiki/MCP-And-AI.md +43 -3
- package/wiki/Mail.md +6 -0
- package/wiki/Migrations-And-Backfills.md +13 -0
- package/wiki/Money.md +20 -1
- package/wiki/N-Plus-One-Detection.md +31 -1
- package/wiki/Notify.md +13 -2
- package/wiki/PWA-And-Offline.md +34 -4
- package/wiki/Policies-And-Authz.md +27 -5
- package/wiki/Queries-And-Live-Queries.md +41 -4
- package/wiki/Realtime.md +22 -0
- package/wiki/Resource-Management.md +6 -1
- package/wiki/Routes-And-Render-Modes.md +54 -6
- package/wiki/SEO.md +24 -2
- package/wiki/Scheduled-Tasks.md +29 -11
- package/wiki/Scraping.md +33 -2
- package/wiki/Stability.md +1 -1
- package/wiki/Static-Assets.md +1 -0
- package/wiki/Storage-And-Uploads.md +8 -1
- package/wiki/Testing.md +120 -13
- package/wiki/The-Eight-Primitives.md +125 -6
- package/wiki/Timezones-And-Dates.md +13 -5
- package/wiki/Troubleshooting.md +1 -1
- package/wiki/Tutorial-02-First-Feature.md +6 -0
- package/wiki/Tutorial-03-Auth-And-Admin.md +8 -0
- package/wiki/Tutorial-04-Jobs-And-Realtime.md +40 -2
- package/wiki/Tutorial-06-Growing-Up.md +1 -2
- package/wiki/UI-Components.md +14 -5
- package/wiki/Upgrading.md +43 -5
package/wiki/Upgrading.md
CHANGED
|
@@ -313,9 +313,12 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
313
313
|
| a required column with no default is added nullable and contracted to NOT NULL in the migration's non-transactional step (**31.44.0**), so a fresh or reset database migrates clean | a committed migration that still holds the old `-- backfill "c", then: … set not null;` comment: declare the column `.nullable()`, `x db gen "relax c"`, declare it required again, `x db gen "contract c"`, then `x db migrate`. A populated production table: ship `.nullable()` plus its `backfill()` first, then required |
|
|
314
314
|
| two shipped guards change (**31.44.0**), built in: `undeclared-env` (`X_UNDECLARED_ENV`) also refuses a `defineEnv(` record anywhere in app source whose keys `envSchema` in `app.config.ts` does not declare; `untranslated-string` (`X_UNTRANSLATED_STRING`) ends its fix with `x verify --only boundaries`. A copy still in `guards/` keeps the old rule until `x upgrade` migrates it to the release after 31.43.0 | each `undeclared-env` finding names the keys to move into `envSchema`; then `x env example` |
|
|
315
315
|
| `x new`'s `ci.yml` uploads each `verify-part-*` document with `retention-days: 1` (**31.45.0**): the verdict job reads it in the same run, and GitHub's 90-day default let one adopter's parts fill the org's artifact storage quota until CI could not run | nothing: `x upgrade` applies codemod `ci-artifact-retention`; an upload that already sets `retention-days` is left as it is. Artifacts already stored keep their 90 days: delete them from the repository's Actions storage settings if the quota is already full |
|
|
316
|
-
| codemod `ci-pinned-actions` pins any tagged major of `actions/checkout`, `cache`, `upload-artifact` and `download-artifact` (**31.45.0**), and adds `persist-credentials: false` to each checkout it pins, inside the step's own `with:` when it has one; 31.43–31.44 skipped a workflow on another major (`actions/checkout@v5`) | nothing: `x doctor` names it as `X_UPGRADE_CODEMODS_PENDING`, and `x upgrade --json` applies it. A SHA-pinned line and an action with no pin are never touched |
|
|
316
|
+
| codemod `ci-pinned-actions` pins any tagged major of `actions/checkout`, `cache`, `upload-artifact` and `download-artifact` (**31.45.0**), and adds `persist-credentials: false` to each checkout it pins, inside the step's own `with:` when it has one; 31.43–31.44 skipped a workflow on another major (`actions/checkout@v5`) | nothing: `x doctor` names it as `X_UPGRADE_CODEMODS_PENDING`, and `x upgrade codemods --from 0.0.0 --json` applies it. A SHA-pinned line and an action with no pin are never touched |
|
|
317
317
|
| the shipped `undeclared-env` guard's fix changes (**31.45.0**), built in; its findings do not: `X_UNDECLARED_ENV` still opens with the `envSchema` line to paste, and adds a second branch for a build-time constant injected by `bun build --define process.env.X=…` (declare a global, `--define NAME=…`), which no deploy sets. A copy still in `guards/` keeps the old text until `x upgrade` migrates it to the release after 31.44.0 | nothing; for a `--define` constant, follow the second branch rather than declaring an env var |
|
|
318
318
|
| `x g sign-in --password` and `x g invite` declare `native: { success: (output) => output.next }` on their six actions and drop the `landAt()` helper (**31.46.0**); an app scaffolded before keeps its `landAt`, whose `setRedirect` still answers its forms with a 303 | nothing. Optional, to have one redirect path: on each action, add `native: { success: (output) => output.next }`, replace `landAt(x)` with `x`, delete `landAt` from `sign-in-flow.ts` / `invite.ts`, and move the test that asserted `request.redirect` to a form post through `httpServer({ routes: [toRoute(target)] }).fetch(…)` with `accept: text/html`, asserting `303` and the `Location` — a fresh `x g sign-in --password` writes that test. Then `x verify --only unit,manifest` |
|
|
319
|
+
| an offline replay sends `x-ultimate-replay-scope`, and the action route answers a session other than the queue's owner `409 X_REPLAY_PRINCIPAL_MISMATCH`, the entry kept `pending` (**31.47.0**, [Realtime](Realtime#tier-3-shipped-in-2100)); `DEFAULT_CORS.allowHeaders` lists the header | an app setting `cors.allowHeaders` replaces that list (`packages/http/src/config.ts`): add `x-ultimate-replay-scope` to it. A cross-origin caller sending the header needs this; the page outbox replays to a same-origin path, which has no preflight. An app on several processes sets `SESSION_SECRET` (32+ characters), or a replay reaching another process is refused |
|
|
320
|
+
| `x exercise` with no `--seed`, and so `x verify`'s `exercise` step, runs one constant seed (**31.47.0**) where each run drew a random one, and `seed` in `.x/exercise.json` is always the number used, never `null`. One tree now gets one verdict, but an `exercise.unprovenMax` measured under random seeds can sit just below the constant seed's figure, so the first gate after the hop can be `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`. `x upgrade` writes a figure only where the app states none, and never raises one | `x exercise --json`, then fix the helper or override each `unproven` record names: pick rows by what they are, never by id order, and assume no order between sized calls ([Testing](Testing)). If the figure that remains is the honest one, raising `unprovenMax` to it is your own reviewed edit of `x.verify.json`. `x exercise --seed random` looks for seed-dependent helpers |
|
|
321
|
+
| `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` |
|
|
319
322
|
|
|
320
323
|
## 29.x → 30.0.0, entry by entry
|
|
321
324
|
|
|
@@ -1040,7 +1043,7 @@ published limits and prices into the app's own `models.ts`, with the source and
|
|
|
1040
1043
|
each, as `examples/dummy/apps/web/app/models.ts` does.
|
|
1041
1044
|
|
|
1042
1045
|
```ts
|
|
1043
|
-
import { anthropicProvider,
|
|
1046
|
+
import { anthropicProvider, providerGateway, registerModel } from '@ultimat3/ai';
|
|
1044
1047
|
|
|
1045
1048
|
const usd = (minor: number) => ({ minor, currency: 'USD' }) as const;
|
|
1046
1049
|
|
|
@@ -1055,12 +1058,13 @@ export const appModel = registerModel({
|
|
|
1055
1058
|
reasoning: { effort: true, adaptive: true, disableThinkingUpTo: undefined },
|
|
1056
1059
|
});
|
|
1057
1060
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1061
|
+
// apps/<app>/runtime.ts — the boot installs it
|
|
1062
|
+
export const runtime = {
|
|
1063
|
+
aiGateway: providerGateway({
|
|
1060
1064
|
providers: [anthropicProvider({ models: [appModel.id] })],
|
|
1061
1065
|
defaultModel: appModel.id,
|
|
1062
1066
|
}),
|
|
1063
|
-
}
|
|
1067
|
+
};
|
|
1064
1068
|
```
|
|
1065
1069
|
|
|
1066
1070
|
```diff
|
|
@@ -2564,6 +2568,11 @@ connection after the caller's socket had already been answered `X_TIMEOUT`.
|
|
|
2564
2568
|
`X_MCP_RATE_LIMITED`, 429, with `Retry-After`.
|
|
2565
2569
|
|
|
2566
2570
|
```ts
|
|
2571
|
+
import { type DefineAppMcpInput, type McpServer, mcpHttpRoute } from '@ultimat3/mcp';
|
|
2572
|
+
|
|
2573
|
+
declare const server: McpServer;
|
|
2574
|
+
declare const resolveToken: NonNullable<DefineAppMcpInput['resolveToken']>;
|
|
2575
|
+
|
|
2567
2576
|
mcpHttpRoute({ server, resolveToken, rateLimits: { read: 600, write: 60 } });
|
|
2568
2577
|
// or defineAppMcp({ …, rateLimits: { read: 600, write: 60 } })
|
|
2569
2578
|
```
|
|
@@ -2578,6 +2587,14 @@ honest for `x mcp serve` and a lie for N replicas behind one URL, each enforcing
|
|
|
2578
2587
|
on its own:
|
|
2579
2588
|
|
|
2580
2589
|
```ts
|
|
2590
|
+
import type { PgExecutor } from '@ultimat3/action';
|
|
2591
|
+
import { postgresRateLimitStore } from '@ultimat3/http';
|
|
2592
|
+
import { type DefineAppMcpInput, type McpServer, mcpHttpRoute } from '@ultimat3/mcp';
|
|
2593
|
+
|
|
2594
|
+
declare const server: McpServer;
|
|
2595
|
+
declare const resolveToken: NonNullable<DefineAppMcpInput['resolveToken']>;
|
|
2596
|
+
declare const executor: PgExecutor;
|
|
2597
|
+
|
|
2581
2598
|
mcpHttpRoute({ server, resolveToken, rateLimitStore: postgresRateLimitStore({ executor }) });
|
|
2582
2599
|
```
|
|
2583
2600
|
|
|
@@ -2766,6 +2783,8 @@ your own that should keep its authored cause needs a status of its own — that
|
|
|
2766
2783
|
classified:
|
|
2767
2784
|
|
|
2768
2785
|
```ts
|
|
2786
|
+
import { registerErrorStatus } from '@ultimat3/http';
|
|
2787
|
+
|
|
2769
2788
|
registerErrorStatus({ X_PAYMENTS_UNREACHABLE: 502 }); // from @ultimat3/http, once at boot
|
|
2770
2789
|
```
|
|
2771
2790
|
|
|
@@ -3011,6 +3030,12 @@ worker and nothing in the framework calls `generateServiceWorker`; the generated
|
|
|
3011
3030
|
`regenerate:` header names the call for that reason.
|
|
3012
3031
|
|
|
3013
3032
|
```ts
|
|
3033
|
+
import { generateServiceWorker, type PwaRoute, type ServiceWorkerConfig } from '@ultimat3/pwa';
|
|
3034
|
+
|
|
3035
|
+
declare const routes: readonly PwaRoute[];
|
|
3036
|
+
declare const config: ServiceWorkerConfig;
|
|
3037
|
+
declare const buildId: string;
|
|
3038
|
+
|
|
3014
3039
|
generateServiceWorker(routes, config, buildId); // from @ultimat3/pwa
|
|
3015
3040
|
```
|
|
3016
3041
|
|
|
@@ -3394,6 +3419,15 @@ was not: you were on Postgres the whole time.
|
|
|
3394
3419
|
Which driver runs is `setJobDriver(driver)`, and only that:
|
|
3395
3420
|
|
|
3396
3421
|
```ts
|
|
3422
|
+
import type { PgExecutor } from '@ultimat3/action';
|
|
3423
|
+
|
|
3424
|
+
// This release's API, declared because it is gone: since 31.0.0 the driver is `jobs:` in
|
|
3425
|
+
// `apps/<app>/runtime.ts`.
|
|
3426
|
+
declare function setJobDriver(driver: unknown): void;
|
|
3427
|
+
declare function createPgDriver(options: { executor: PgExecutor }): unknown;
|
|
3428
|
+
declare function createMemoryDriver(): unknown;
|
|
3429
|
+
declare const executor: PgExecutor;
|
|
3430
|
+
|
|
3397
3431
|
setJobDriver(createPgDriver({ executor })) // production
|
|
3398
3432
|
setJobDriver(createMemoryDriver()) // a test
|
|
3399
3433
|
```
|
|
@@ -3578,6 +3612,8 @@ Two things are not compile errors and are the ones to read first: the **seven be
|
|
|
3578
3612
|
Entry 18's pair, both sides or neither:
|
|
3579
3613
|
|
|
3580
3614
|
```ts
|
|
3615
|
+
import { configureLifecycle } from '@ultimat3/core';
|
|
3616
|
+
|
|
3581
3617
|
configureLifecycle({ deadlineMs: 600_000 }); // and terminationGracePeriodSeconds >= 600
|
|
3582
3618
|
```
|
|
3583
3619
|
|
|
@@ -3877,6 +3913,8 @@ Full detail: [PWA and offline](PWA-And-Offline).
|
|
|
3877
3913
|
|
|
3878
3914
|
## Migrating jobs between drivers — **still nowhere to migrate to**
|
|
3879
3915
|
|
|
3916
|
+
**Superseded `As of 2026-11-18`:** this section records the state before `redisJobDriver()` shipped (`@ultimat3/jobs/redis`, 2026-10) and before 31.0.0 replaced `setJobDriver` with `jobs:` in `apps/<app>/runtime.ts`. Current drivers: [Jobs and workflows](Jobs-And-Workflows). `x jobs drain` no longer exists; moving in-flight rows is the app's own migration.
|
|
3917
|
+
|
|
3880
3918
|
**There is no `jobs.driver` field.** 5.0.0 deleted it, because it selected nothing: boot always built the Postgres driver, so `jobs: { driver: 'redis' }` gave you Postgres in silence; since 25.0.0 the key is refused by name (`X_CONFIG_INVALID`). Which driver runs is `setJobDriver(driver)` at boot, and only that.
|
|
3881
3919
|
|
|
3882
3920
|
**There is no driver migration to perform**, `As of 2026-10`. Postgres is the only durable driver — 25.0.0 deleted the NATS and Redis stubs, whose every method threw `X_NOT_IMPLEMENTED` — and `x jobs drain` is planned: it exits `X_NOT_IMPLEMENTED` before the queue boots, pointing at `x jobs list --json`. Its `--to` and `--dry-run` flags went with the drain body in 25.0.0 and are now `X_CLI_BAD_FLAG`. Before that a drain onto either stub leased the pending batch for five minutes, failed every enqueue and nacked it back; and the `memory` target, refused by name since 2026-09, acked every durable row off the source and lost the copy when the command exited — a target that dies with the command is not a migration.
|