@ultimat3/cli 31.15.0 → 31.17.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/README.md +7 -1
- package/package.json +29 -29
- package/src/cache-graph.ts +67 -0
- package/src/cmd-cache-spec.ts +25 -0
- package/src/cmd-cache.ts +187 -0
- package/src/cmd-config-spec.ts +23 -0
- package/src/cmd-config.ts +61 -0
- package/src/cmd-doctor.ts +47 -37
- package/src/cmd-exercise.ts +42 -5
- package/src/cmd-explain-spec.ts +24 -0
- package/src/cmd-explain.ts +201 -0
- package/src/cmd-logs-spec.ts +34 -0
- package/src/cmd-logs.ts +80 -0
- package/src/cmd-planned.ts +15 -29
- package/src/cmd-token-spec.ts +54 -0
- package/src/cmd-token.ts +173 -0
- package/src/cmd-upgrade.ts +19 -2
- package/src/cmd-verify-spec.ts +13 -3
- package/src/cmd-verify.ts +2 -0
- package/src/config-redact.ts +39 -0
- package/src/coverage-floor.ts +2 -2
- package/src/dev-boot-data-dir.ts +69 -0
- package/src/dev-boot.ts +26 -13
- package/src/doctor-env-reserved.ts +111 -0
- package/src/doctor-floor.ts +62 -0
- package/src/doctor-pins.ts +101 -0
- package/src/doctor-probe.ts +21 -1
- package/src/doctor-row-security.ts +119 -4
- package/src/doctor-warnings.ts +55 -0
- package/src/error-codes-doctor.ts +24 -0
- package/src/error-codes-tooling.ts +6 -4
- package/src/error-codes.ts +7 -0
- package/src/errors.ts +8 -2
- package/src/exercise-entry-edit.ts +5 -1
- package/src/exercise-floor-report.ts +138 -0
- package/src/exercise-floor-verdict.ts +98 -0
- package/src/exercise-floor.ts +158 -0
- package/src/exercise-routes.ts +59 -0
- package/src/explain-capture.ts +38 -0
- package/src/generate-exercise.ts +2 -2
- package/src/generate-factories.ts +133 -0
- package/src/generate-files.ts +11 -0
- package/src/generate-kinds.ts +13 -0
- package/src/mcp-db-target.ts +4 -3
- package/src/mcp-errors.ts +14 -0
- package/src/messages-gate.ts +2 -0
- package/src/messages-ops.ts +32 -0
- package/src/messages-upgrade.ts +14 -0
- package/src/messages.ts +5 -0
- package/src/otlp-export.ts +16 -2
- package/src/registry.ts +10 -0
- package/src/role-start.ts +11 -5
- package/src/runtime-services.ts +35 -19
- package/src/serve-boot-phases.ts +30 -0
- package/src/serve-boot-warnings.ts +62 -0
- package/src/serve-boot.ts +30 -11
- package/src/templates/generate-cron-job.ts +90 -0
- package/src/templates/generate-purge.ts +93 -0
- package/src/templates/generate-webhook-receiver.ts +274 -0
- package/src/templates/github/ci.yml.ts +101 -36
- package/src/templates/guard-repo-raw-sql-test.ts +174 -0
- package/src/templates/guard-repo-raw-sql.ts +115 -145
- package/src/templates/guard-unbounded-fanout.ts +170 -0
- package/src/templates/scaffold-claude-commands.ts +3 -2
- package/src/templates/scaffold-docs.ts +3 -2
- package/src/templates/scaffold-guards.ts +3 -0
- package/src/templates/scaffold-verify-floor.ts +4 -0
- package/src/test-dotenv.ts +15 -2
- package/src/upgrade-coverage.ts +109 -0
- package/src/upgrade-document.ts +18 -0
- package/src/upgrade-exercise-floor.ts +53 -0
- package/src/upgrade-gate.ts +84 -29
- package/src/upgrade-guards.ts +159 -0
- package/src/upgrade-report.ts +33 -1
- package/src/verify-checks.ts +3 -1
- package/src/verify-floor.ts +13 -0
- package/src/verify-plan.ts +127 -0
- package/wiki/CI-Parallel-Gate.md +38 -1
- package/wiki/CLI-Reference.md +115 -14
- package/wiki/Caching-And-Invalidation.md +10 -10
- package/wiki/Configuration.md +20 -2
- package/wiki/Known-Gaps.md +1 -1
- package/wiki/MCP-And-AI.md +1 -1
- package/wiki/Testing.md +96 -2
- package/wiki/Troubleshooting.md +3 -2
- package/wiki/Upgrading.md +9 -0
package/wiki/CLI-Reference.md
CHANGED
|
@@ -33,7 +33,7 @@ x version # CLI version
|
|
|
33
33
|
| `x stop [--timeout 30s]` | stop this checkout's `x dev` (the pid its `.x/dev.lock` names, nothing else) and return once the next `x dev` can boot | shipped |
|
|
34
34
|
| `x g <kind> <name>` | scaffold a primitive with its test | shipped |
|
|
35
35
|
| `x db <sub>` | gen, migrate, reset, seed, studio, branch, backfill, diagnostics | shipped |
|
|
36
|
-
| `x verify [--only <step>[,<step>…] [--shard i/n [--timings f]] \| --changed [--base <ref>] [--dirty]] [--workers N] [--isolate]` · `x verify merge <part.json…>` | the gate — 21 steps, in this order: typecheck, lint, boundaries, filesize, package-shape, errors, unit, contract, live, job, exercise, e2e, eval, drift, contract-diff, budgets, seo, i18n, policy, manifest, roadmap. `--only <step>[,<step>…]` runs the named steps, in one process and in gate order, for an iteration loop and announces `NOT A GATE RUN` in the summary and in `--json` (`data.notAGateRun`, `data.only` — always a list), writing no floor file; an unknown name is refused with every valid name and the nearest match. **The gate is this command with no flag.** There is no `--skip` | shipped |
|
|
36
|
+
| `x verify [--only <step>[,<step>…] [--shard i/n [--timings f]] \| --changed [--base <ref>] [--dirty]] [--workers N] [--isolate]` · `x verify merge <part.json…>` · `x verify plan [--parts n]` | the gate — 21 steps, in this order: typecheck, lint, boundaries, filesize, package-shape, errors, unit, contract, live, job, exercise, e2e, eval, drift, contract-diff, budgets, seo, i18n, policy, manifest, roadmap. `--only <step>[,<step>…]` runs the named steps, in one process and in gate order, for an iteration loop and announces `NOT A GATE RUN` in the summary and in `--json` (`data.notAGateRun`, `data.only` — always a list), writing no floor file; an unknown name is refused with every valid name and the nearest match. **The gate is this command with no flag.** There is no `--skip` | shipped |
|
|
37
37
|
| `x env [check\|example\|init]` | validate the process env against `envSchema`, regenerate `.env.example` from it, or write `.env.production` (`init --production`) | shipped |
|
|
38
38
|
| `x secrets <sub>` | the committed encrypted secrets file: show, init, edit, set, rotate | shipped |
|
|
39
39
|
| `x auth seal-mfa` | one-shot: seal every second-factor secret still stored in the clear | shipped |
|
|
@@ -66,14 +66,15 @@ x version # CLI version
|
|
|
66
66
|
| `x docs "<question>"` | framework docs and this wiki, offline, from the install — the first lookup | shipped |
|
|
67
67
|
| `x fix boundary <file>` | plan the minimal cut for an import that crossed a surface boundary (never rewrites) | shipped |
|
|
68
68
|
| `x upgrade` | one major per run: exact pins, the Bun floor, `bun install`, the gate, the section to read | shipped |
|
|
69
|
-
| `x
|
|
69
|
+
| `x token create\|list\|revoke` | MCP and API tokens in the app's `x_api_keys`: issue one with exact scopes (plaintext shown once), list an owner's, revoke one · `grant` is **planned** | shipped |
|
|
70
|
+
| `x config show [--section <key>]` | the resolved `app.config.ts`, defaults merged, credentials redacted | shipped |
|
|
71
|
+
| `x logs tail [--lines n] [--role <role>]` | the last lines of `.x/dev.log` or `.x/logs/<role>.log` — the `logs.tail` MCP tool's file and reader | shipped |
|
|
72
|
+
| `x cache graph\|bust <tag>\|clear` | the tag graph off the manifest (what each write evicts), a bust of one tag or every declared tag through the app's own tiers and bus · `stats` is **planned** | shipped |
|
|
73
|
+
| `x explain <query> [--input <json>] [--org <id>]` | one declared query run once on the dev database, every statement it sent planned by the `exercise` step's oracle | shipped |
|
|
70
74
|
| `x branch` | copy-on-write branch environments | planned |
|
|
71
75
|
| `x status` | connected-client build-ID distribution, role health | planned |
|
|
72
|
-
| `x logs tail` | structured logs + OTel spans | planned |
|
|
73
|
-
| `x token` | create and grant MCP scopes | planned |
|
|
74
76
|
| `x ai` | eval, cache stats, reindex | planned |
|
|
75
77
|
| `x money add-currency` | extend the currency table | planned |
|
|
76
|
-
| `x config show` | the resolved `app.config.ts` | planned |
|
|
77
78
|
|
|
78
79
|
## x new
|
|
79
80
|
|
|
@@ -315,6 +316,7 @@ Errors: `X_DEV_STOP_TIMEOUT`, `X_CLI_BAD_FLAG` (a `--timeout` that is not a posi
|
|
|
315
316
|
|
|
316
317
|
```bash
|
|
317
318
|
x g resource|action|mutator|backfill|job|route|policy|entity|query|task <name> [--feature f]
|
|
319
|
+
x g cron-job|purge|webhook-receiver <name> [--feature f] # a primitive factory's one call + tests
|
|
318
320
|
x g island <name> [--at <dir>] # a client component on an otherwise static page
|
|
319
321
|
x g admin:page <name> --permission <perm> [--at <dir>] # a custom admin screen, guarded by construction
|
|
320
322
|
x g guard <name> # a convention this app enforces, as a build error
|
|
@@ -339,6 +341,16 @@ The boot guard is generated, app-owned: `apps/web/runtime.ts` calls `assertSignI
|
|
|
339
341
|
|
|
340
342
|
`x g guard <name>` writes `guards/<name>.ts` and its test. A name the framework ships a guard under — `raw-length`, `raw-breakpoint`, `raw-z-index`, `raw-shadow`, `raw-motion`, `undefined-style-class`, `undeclared-custom-property`, `repo-raw-sql` and every other name in `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) — writes THAT guard, which is how an app adopts one it does not hold; any other name writes the blank template. `x doctor` lists the shipped ones missing, and the held ones that differ from the current template ([Interface rules](Interface-Rules#stylesheets)).
|
|
341
343
|
|
|
344
|
+
**`x g cron-job` · `x g purge` · `x g webhook-receiver`** (`As of 31.17.0`) scaffold a primitive *factory*'s one declaration — each a factory over `job()`, never a ninth primitive — with its tests, into the feature's slice, listed in `apps/web/api/index.ts`'s `jobs:`. None reads a table, so a slice with no `entity.ts` is fine.
|
|
345
|
+
|
|
346
|
+
| Generator | Writes | What the declaration holds |
|
|
347
|
+
|---|---|---|
|
|
348
|
+
| `x g cron-job <name>` | `jobs/<name>.ts`, `<name>.job.test.ts`, `<name>.test.ts` | `cronJob({ name, cron: '0 3 * * *', tz: 'UTC', tenant: 'none' })` — the job and its `.schedule` task from one call, an explicit IANA zone, the org stripped so a tenant read fails closed |
|
|
349
|
+
| `x g purge <name>` | `jobs/<name>.ts`, `<name>.job.test.ts`, `<name>.test.ts`, `tasks/<name>-hourly.ts` | `purge({ name, entities: 'declared' })` — the sweep for every `retain` the schema declares (`X_ENTITY_RETAIN_UNSWEPT` without one), fired on `DEFAULT_PURGE_CRON` |
|
|
350
|
+
| `x g webhook-receiver <name>` | `jobs/<name>.ts`, `<name>.test.ts`, and the job's entry in `apps/web/exercise.ts` (a draw cannot sign an event, so `x exercise` queues a verified-shape one) | `webhookReceiver()` at `/hooks/<name>`: the exact bytes `verifyBodyHmac`-checked under `<NAME>_WEBHOOK_SECRET` (comma-separated, so a rotation keeps the old one live), the event read out of the signed body, queued, then acknowledged; an unreadable event is the app's own `X_<NAME>_UNREADABLE` |
|
|
351
|
+
|
|
352
|
+
Every other factory, and why no generator writes it (`exportRows`, `importRows`, `rollup`, `webhook`, `llm`, `agentJob`, …): `FACTORY_GENERATORS` in `packages/cli/src/generate-factories.ts`, held complete against `PRIMITIVE_FACTORIES` by its test.
|
|
353
|
+
|
|
342
354
|
Alias: `x generate`.
|
|
343
355
|
|
|
344
356
|
`<name>` is one directory segment for every generator but `route`, whose name is its URL:
|
|
@@ -430,6 +442,8 @@ lands in `apps/admin/app/admin/pages/` without `--at` — beside the declaration
|
|
|
430
442
|
| `x g action` · `x g mutator` | `<name>.test.ts` **and** `<name>.contract.test.ts` | `unit`, `contract` |
|
|
431
443
|
| `x g query --live` | `<name>.live.test.ts` | `live` |
|
|
432
444
|
| `x g job` · `x g task` · `x g backfill` | `<name>.job.test.ts` | `job` |
|
|
445
|
+
| `x g cron-job` · `x g purge` | `<name>.job.test.ts` **and** `<name>.test.ts` | `job`, `unit` |
|
|
446
|
+
| `x g webhook-receiver` | `<name>.test.ts` | `unit` |
|
|
433
447
|
| `x g query` (not live) · `x g entity` · `x g policy` · `x g route` | `<name>.test.ts` | `unit` |
|
|
434
448
|
|
|
435
449
|
`--force` writes the new name and does not touch a file under the old one, because the old name is not in its output list. Delete the orphan by hand.
|
|
@@ -600,8 +614,21 @@ Errors, backfill: `X_BACKFILL_PENDING` (`--pending`, and the only one that is no
|
|
|
600
614
|
```bash
|
|
601
615
|
x verify [--only <step>[,<step>…] [--shard i/n [--timings file]] | --changed [--base <ref>] [--dirty]] [--workers N] [--isolate] [--json]
|
|
602
616
|
x verify merge <part.json…> [--json]
|
|
617
|
+
x verify plan [--parts n] [--json]
|
|
603
618
|
```
|
|
604
619
|
|
|
620
|
+
**`x verify plan`** (`As of 31.17.0`) — the gate cut into CI parts, as data: each part an `x verify
|
|
621
|
+
--only <steps> [--shard i/n]` for one runner, and `data.matrix` a GitHub `strategy.matrix`
|
|
622
|
+
(`{ include: [{ part, only, shard?, needs }] }`) a workflow reads with `fromJSON`. `--parts`: `1`
|
|
623
|
+
(the whole gate on one runner) or `4`–`64`, default `4` — a `static` part (every step that is not a
|
|
624
|
+
suite), an `e2e` part (`typecheck` + `e2e`), and the rest split between shards of `unit,contract,job`
|
|
625
|
+
and of `live`, the unit group taking the odd one. `needs` says what the runner starts first:
|
|
626
|
+
`none`, `database` (the test Postgres) or `services` (every test service). Derived from
|
|
627
|
+
`VERIFY_STEP_NAMES`, so a new gate step lands in a part with no workflow edit, and every step sits in
|
|
628
|
+
exactly one part or every shard of one split — the rule `x verify merge` refuses a run by. `x new`'s
|
|
629
|
+
`.github/workflows/ci.yml` is three jobs: `plan` → one `gate` per part → `verify` (the merge) →
|
|
630
|
+
[CI: the gate across parallel jobs](CI-Parallel-Gate). Pure: it reads no file and starts nothing.
|
|
631
|
+
|
|
605
632
|
**`--changed`**, `As of 31.0` — the steps whose inputs the diff touches, NOT A GATE RUN like `--only`
|
|
606
633
|
and never beside it (`X_CLI_BAD_FLAG`). The diff is `x affected`'s: `<base>...HEAD`, `--base` default
|
|
607
634
|
the remote-tracking default branch (`origin/HEAD`, else `origin/main`, else local `main`; `As of 31.1`), `--dirty` adds uncommitted and untracked work. Each file gets one rule, each rule selects
|
|
@@ -637,6 +664,7 @@ below on `--workers` and batching describe 22.6 and earlier where they differ.
|
|
|
637
664
|
| `steps` | steps this repo may never report as skipped (`X_VERIFY_SUITE_VANISHED`) |
|
|
638
665
|
| `coverage` | `{ "lines", "funcs", "why"?, "exclude"?: [{ "glob", "why" }] }` — the floor the `unit` step holds an app's whole source tree to (`X_COVERAGE_BELOW_FLOOR`, `X_COVERAGE_FLOOR_UNSTATED`, `X_COVERAGE_FLOOR_STALE`) → [Testing](Testing#coverage). `x doctor` prints every `exclude` |
|
|
639
666
|
| `stepTimeoutMs` | `{ "<step>": milliseconds }` — a step's own deadline. Default 8 minutes for the six suites, 5 for every other step; past it the step is `X_VERIFY_STEP_TIMEOUT` and its processes are killed |
|
|
667
|
+
| `exercise` | `{ "unprovenMax"?: <0–1>, "statementsMax"?: <whole ≥ 1> }` — what the `exercise` step's pass may leave unproven, and statements per call (`X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_STATEMENTS_OVER_BUDGET`); absent, each is a warning line → [`x exercise`](#x-exercise), `As of 31.16.0` |
|
|
640
668
|
| `isolate` · `typecheckBin` · `agentsMdMaxBytes` | a fresh global per test file · the `tsc`-compatible binary · the `AGENTS.md` byte budget |
|
|
641
669
|
|
|
642
670
|
Either render prints one line per finished step on **stderr** — `{"step":"lint","ok":true,"ms":21987}` —
|
|
@@ -1207,6 +1235,15 @@ It also lists the shipped guards the app's `guards/` does not hold, and the ones
|
|
|
1207
1235
|
|
|
1208
1236
|
A listing, never a finding: deleting or editing a guard is how an app changes a rule, so the verdict does not move.
|
|
1209
1237
|
|
|
1238
|
+
Four warnings about how the app is held, `As of 31.16.0` — beside the verdict, never in it: the exit status, `findings` and `data.codes` stay as they were, and `--json` carries each as `data.warnings[]` (`{ code, cause, fix, docs, at }`). None is a gate step; on `next` they join the verdict, red:
|
|
1239
|
+
|
|
1240
|
+
| Code | Asked | Fix |
|
|
1241
|
+
|---|---|---|
|
|
1242
|
+
| `X_DB_ROW_SECURITY_OFF` | `database.rowSecurity` is off and a raw `` sql`…` `` (or `` Bun.sql`…` ``, `` tx.sql`…` ``, `raw('…')`, `identifier('…')`) outside migrations, seeds and tests names a tenant table — up to five sites listed. Off with no raw tenant SQL is not reported | `database: { rowSecurity: true }` in `app.config.ts`, then `x db gen "row security" && x db migrate` |
|
|
1243
|
+
| `X_VERIFY_STEP_UNFLOORED` | a gate step applies here — its suite files exist, its input is committed — and `x.verify.json` `"steps"` does not hold it, so a deleted suite reads as skipped. `e2e` is never proposed (the scaffold's placeholder skips until a browser driver is registered) | `x verify --only <steps> --json`, then add each step that passed to `"steps"` |
|
|
1244
|
+
| `X_FRAMEWORK_PIN_RANGE` | an `@ultimat3/*` dependency in any of the app's manifests is anything but an exact version or a `workspace:`/`file:`/`link:` path (`^31.0.0`, `*`, `latest`, `>=31 <32`; an `npm:` alias by its own spec), one finding per manifest | the exact version `bun install` resolved, at the line named; then `bun install` |
|
|
1245
|
+
| `X_ENV_NAME_RESERVED` | a name the app declares in `envSchema` or seals in `secrets.enc.json` is one `FRAMEWORK_ENV` (`@ultimat3/core`) lists as a `switch` or `internal` name — setting it for the app also switches that package's behaviour. Deploy-contract names (`DATABASE_URL`, `PORT`) and host names are not collisions | rename it `APP_<name>` (or delete it where the value is meant for the framework); then `x env example` |
|
|
1246
|
+
|
|
1210
1247
|
**The chart's monitoring templates**, the same way (`As of 2026-11`): an app with a `docker/helm/Chart.yaml` and no `templates/servicemonitor.yaml` or `templates/alert-rules.yaml` gets one line per missing file, then `x g chart-alerts`, which writes only those (`--json`: `data.chartAlerts`, `{ missing[], add }`). A chart that dropped them on purpose keeps a green verdict; an app with no chart is listed nothing.
|
|
1211
1248
|
|
|
1212
1249
|
The embedded half is the bare-VM case: the external-database probe answers nothing the moment `DATABASE_URL` is unset, and that silence *is* the configuration a fresh box has. So `x doctor` also asks whether `@electric-sql/pglite` resolves from the app root — a resolve, never an import, because loading it boots the WASM build and takes the single-writer lock the next command needs. Red only where both hold: `DATABASE_URL` unset **and** the peer unresolvable, reported as `X_DB_UNAVAILABLE` with `@ultimat3/db`'s own sentence and its own runnable fix ([Bare VM](Bare-VM)). The snapshot half is `As of 2026-08` and separate from drift on purpose: they are two questions with two remedies, and `x db gen`'s own `X_MIGRATION_SNAPSHOT_MISSING` was a condition this diagnostic could not see at all, so `x doctor --json` — the `fix:` of the `X_CLI_UNEXPECTED` an author reaches it through — ran clean over a broken app.
|
|
@@ -1388,7 +1425,35 @@ A blank `off` reason is `X_CONTRACT_EXERCISE_UNDECLARED`; so is an `exercise.ts`
|
|
|
1388
1425
|
exactly its findings, plus the static half of the tenant proof: an entity with no tenant column
|
|
1389
1426
|
that references one with a tenant and declares no `shared` reason.
|
|
1390
1427
|
|
|
1391
|
-
|
|
1428
|
+
**The `exercise` floor** (`As of 31.16.0`). `x exercise` and the gate step judge the pass against
|
|
1429
|
+
`x.verify.json`'s `exercise` key ([Configuration](Configuration#the-gates-file--xverifyjson)). Without the key every
|
|
1430
|
+
judgement below is a warning line (`! …`, and `data.warnings[]` under `--json`) naming the figure to
|
|
1431
|
+
write, and the run stays green; with it, above a declared figure is red.
|
|
1432
|
+
|
|
1433
|
+
| Judged | Red, once opted in | Warning otherwise |
|
|
1434
|
+
|---|---|---|
|
|
1435
|
+
| unproven ÷ reached — a tenant, crash or scale proof that could not ask | `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, naming the first three | the ratio, rounded up, to write as `unprovenMax`; also when it fell under the floor, naming the lower figure |
|
|
1436
|
+
| a sized-seed table the database refused | `X_EXERCISE_SEED_FAILED`, one per table, naming the entity, the driver's words and its readers — red exactly when the unproven ratio is | the same finding as a line |
|
|
1437
|
+
| one call over its statement ceiling — `statementsMax`, or the entry's own `statements: { max, why }` | `X_STATEMENTS_OVER_BUDGET`, the busiest call and its three largest shapes | the same finding as a line, judged at 100 |
|
|
1438
|
+
|
|
1439
|
+
**Route loads** (`As of 31.17.0`). After the primitives, the pass runs every `app/` and `site/`
|
|
1440
|
+
file route that declares a `load` — the route table `x routes` prints — once in its own seeded
|
|
1441
|
+
tenant, as the runtime calls it: in a request, as the first actor the route's permission allows (a
|
|
1442
|
+
signed-in one where it names none), its params a seeded row's id or the route's own `prerender()`
|
|
1443
|
+
sample. Each load gets the primitives' proofs: its statements counted against the ceiling (100), a
|
|
1444
|
+
scale sweep at 2 and 8 rows a table, and the plan oracle over what it sent. The records ride beside
|
|
1445
|
+
`records`, as `routes[]` in `--json` and `.x/exercise.json` (`{ kind: 'route', name, file, outcome,
|
|
1446
|
+
reason?, statements, effects, ms, statementCeiling?, plans?, scale? }`), and every finding is a
|
|
1447
|
+
**warning line** on `main` — `route /messages (apps/web/app/messages/page.tsx) · X_QUERY_SCALES_WITH_ROWS …`,
|
|
1448
|
+
`· X_STATEMENTS_OVER_BUDGET …`, a plan code, or `· load not exercised: <reason>` — never red: no
|
|
1449
|
+
floor key opts a page read in yet.
|
|
1450
|
+
|
|
1451
|
+
**Reached with nothing to prove** (`As of 31.17.0`): a primitive reached that sent no statement and
|
|
1452
|
+
had no effect has vacuous proofs — a sweep of nothing is `flat`. One warning line names the first
|
|
1453
|
+
five, `X_EXERCISE_EMPTY_REACH … — fix: edit exercise.ts: give each an input that reaches its work, or
|
|
1454
|
+
{ off: '<why>' }`. A warning, not red, on a whole-pass run only.
|
|
1455
|
+
|
|
1456
|
+
Errors: `X_CONTRACT_EXERCISE_UNREACHED`, `X_CONTRACT_EXERCISE_UNDECLARED`, `X_DECLARATION_UNKNOWN`, `X_CLI_BAD_FLAG`, `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_EXERCISE_SEED_FAILED`, `X_STATEMENTS_OVER_BUDGET`; warning lines only: `X_EXERCISE_EMPTY_REACH`.
|
|
1392
1457
|
|
|
1393
1458
|
## x drill
|
|
1394
1459
|
|
|
@@ -1554,7 +1619,7 @@ One major per run, so each hop's gate attributes its red to that hop. `As of 30.
|
|
|
1554
1619
|
| 3 | `bun pm view @ultimat3/cli versions`: the next major's newest; the last major's newest when no later major exists | `X_UPGRADE_REGISTRY_UNREACHABLE`, `X_UPGRADE_HOP_TOO_WIDE`, `X_UPGRADE_VERSION_UNPUBLISHED`, `X_BUN_VERSION` |
|
|
1555
1620
|
| 4 | write exact pins, raise the Bun floor | — |
|
|
1556
1621
|
| 5 | `bun install` | `X_UPGRADE_INSTALL_FAILED`, `fix:` carries the undo |
|
|
1557
|
-
| 6 | the installed CLI: `x manifest`, `x doctor --json`, `x exercise --json
|
|
1622
|
+
| 6 | the installed CLI: `x manifest`, `x doctor --json`, each missing guard (`x g guard <name>`, kept only when `x verify --only boundaries` finds nothing more), a Bun-floor hop's `x verify --only unit` coverage rebaseline, `x exercise --json` and its `exercise` floor figures, `x verify --json` | `X_UPGRADE_GATE_UNREADABLE`, as a finding on a red hop |
|
|
1558
1623
|
|
|
1559
1624
|
A dry run refuses exactly what the real run would, then stops before step 4. It never commits; `git diff` is the hop. Under `--json` fd 1 is one document, fd 2 a `{"upgrade":"<stage>"}` line per stage and a heartbeat a minute.
|
|
1560
1625
|
|
|
@@ -1572,7 +1637,9 @@ A dry run refuses exactly what the real run would, then stops before step 4. It
|
|
|
1572
1637
|
| `pins[]` | `{ file, name, from, to }` |
|
|
1573
1638
|
| `bun` | `{ from, to, edited[], manual[] }`. `manual[]`: `{ path, line, text, why }`, a site only you can move, listed on every run |
|
|
1574
1639
|
| `agentsMd` | `link`: `AGENTS.md` was byte-identical to `CLAUDE.md` and the hop makes it a relative symlink to it · `linked`: already one · `differs`: two different files, left alone; merge what only `AGENTS.md` says into `CLAUDE.md`, then `ln -sf CLAUDE.md AGENTS.md` · `none`: one of the two is missing · `null`: no hop planned |
|
|
1575
|
-
| `guards` | `{ reported, missing[], differs[] }` from the hop's own `x doctor`.
|
|
1640
|
+
| `guards` | `{ reported, missing[], differs[], installed[], withheld[] }` from the hop's own `x doctor`. `As of 31.16.0` each missing shipped guard is written from the installed release's template and kept when `boundaries` finds nothing more with it on disk: `installed[]` names it. One the tree already breaks is taken back out: `withheld[]` is `{ name, add, findings }` (`findings: null` when the count could not be measured) and `missing[]` still lists it. `differs[]` — the app's edit or an older copy — is never overwritten: `x g guard <name> --force` is yours. `reported: false` is a CLI too old to list them, which is not the same as none |
|
|
1641
|
+
| `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 |
|
|
1642
|
+
| `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 |
|
|
1576
1643
|
| `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
|
|
1577
1644
|
| `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 |
|
|
1578
1645
|
| `verify` | `{ ok, summary, failed[], findings[] }`, each finding `{ step?, code, cause, fix, at? }` |
|
|
@@ -1893,24 +1960,58 @@ For each violation involving the file it reports the offending edge, the full ch
|
|
|
1893
1960
|
|
|
1894
1961
|
`<file>` is app-root-relative, or any suffix that matches exactly one source file — the short form a `fix:` line emits. Errors: `X_FIX_TARGET_UNKNOWN` (with the nearest real path as its fix), `X_CLI_BAD_FLAG` on an ambiguous suffix.
|
|
1895
1962
|
|
|
1963
|
+
## x token
|
|
1964
|
+
|
|
1965
|
+
`As of 2026-11`. The app's machine credentials — the keys an MCP endpoint's `apiKeyResolver` and the `/v1` mount accept — in the framework's `x_api_keys`, through `@ultimat3/auth`'s `issueApiKey` / `describeApiKey` / `revokeApiKey`. No default subcommand: `create` writes a credential.
|
|
1966
|
+
|
|
1967
|
+
| Subcommand | Does |
|
|
1968
|
+
|---|---|
|
|
1969
|
+
| `create --scopes <a,b> [--user <id>] [--org <id>] [--env dev\|stage\|prod] [--days n]` | issues one key carrying exactly those scopes (a wildcard is `X_CONFIG_INVALID`). `--env` unsaid is the environment's label: `ULTIMATE_ENV` (else `NODE_ENV`) production → `prod`, staging → `stage`, else `dev`; an unreadable `ULTIMATE_ENV` reads as `prod`. `--user` cuts its scopes to what that user may do and stops it when the user is disabled. The plaintext is printed **once** — in the human lines, or `data.token` under `--json` — and never in the summary; only its SHA-256 is stored |
|
|
1970
|
+
| `list --owner <id>` | the keys of a user or org, as `describeApiKey` answers them: no hash, no secret. A key issued with neither is listed by nobody and revoked by its id |
|
|
1971
|
+
| `revoke <id>` | revokes it; an unknown or already-revoked id answers `revoked: false`, exit 0 — neither is a key that works |
|
|
1972
|
+
| `grant` | **planned**: a key's scopes are fixed when issued. Issue a wider one and revoke the old |
|
|
1973
|
+
|
|
1974
|
+
Every flag is read before the database opens: a refusal costs no boot.
|
|
1975
|
+
|
|
1976
|
+
## x config
|
|
1977
|
+
|
|
1978
|
+
`As of 2026-11`. `x config show [--section <key>]` — `app.config.ts` as the boot reads it: through `loadAppConfig` and core's `defineConfig`, every default merged. A credential-named key (the logger's own rule, `isRedactedKey`), a `secret()` value and the password in a URL's userinfo print as `[redacted]`. `--section` takes a top-level key the resolved record owns; any other is `X_CLI_BAD_FLAG` listing them.
|
|
1979
|
+
|
|
1980
|
+
## x logs
|
|
1981
|
+
|
|
1982
|
+
`As of 2026-11`. `x logs tail [--lines n] [--role <role>]` — the last `n` lines (default 100, at most 10,000) of `.x/dev.log`, which `x dev` tees, or of `.x/logs/<role>.log`. The same file, path rule and end-first reader as the `logs.tail` MCP tool. A `--role` that is not a runtime role is `X_CLI_BAD_FLAG` before any path is built; no log yet exits `X_NOT_IMPLEMENTED` with `x dev` as the fix.
|
|
1983
|
+
|
|
1984
|
+
## x cache
|
|
1985
|
+
|
|
1986
|
+
`As of 2026-11`.
|
|
1987
|
+
|
|
1988
|
+
| Subcommand | Does |
|
|
1989
|
+
|---|---|
|
|
1990
|
+
| `graph` (default) | per tag: the actions whose `invalidates` name it, the queries cached under it and the routes revalidated by it, read off the manifest. `data.neverEvicted` lists the tags something reads and no action invalidates — fresh only until their TTL |
|
|
1991
|
+
| `bust <tag>` | boots the app's declared tiers and bus as a role does (`startServices`), then `invalidateTags`: shared tiers dropped, the edge purged, every replica told. With an in-process bus (no `NATS_URL`, no `REDIS_URL`) the summary says no running server heard it. A tier that failed is `X_CACHE_DRIVER_UNAVAILABLE`, exit 1; an undeclared tag is `X_CACHE_TAG_UNKNOWN` |
|
|
1992
|
+
| `clear` | the same bust over every declared tag. An entry cached under no tag waits for its TTL |
|
|
1993
|
+
| `stats` | **planned**: hit rates live in the serving processes — the `/_x` cache panel reads them there |
|
|
1994
|
+
|
|
1995
|
+
## x explain
|
|
1996
|
+
|
|
1997
|
+
`As of 2026-11`. `x explain <query> [--input '<json>'] [--org <id>]` — the query run once on the app's dev database (rows discarded; its policy is not asked, as `explainQuery`'s is not), every statement it **sent** captured off `db.statement` and planned by `sweepPlans`: the oracle the `exercise` step judges with. A read no declared index serves is `X_QUERY_UNINDEXED` / `X_QUERY_SORT_UNSERVED` with the `indexes:` entry as its fix, exit 1. A query over a tenant-scoped entity needs `--org`, else `X_CLI_BAD_FLAG`. Tables the dev database lacks are listed as not planned — run `x db migrate` first. An external `DATABASE_URL` where `ULTIMATE_ENV` (else `NODE_ENV`) resolves production — or `ULTIMATE_ENV` is unreadable — is refused before anything opens, `X_EXPLAIN_PRODUCTION_DATABASE`: the query would be sent for real with its policy skipped. Plan on the embedded database, or on a staging restore under `ULTIMATE_ENV=staging`.
|
|
1998
|
+
|
|
1896
1999
|
## Planned commands
|
|
1897
2000
|
|
|
1898
2001
|
Specified in the design docs, not yet implemented. Every one is in the command registry: calling it exits `X_NOT_IMPLEMENTED` with a `fix:` naming the closest shipped command, because "not built yet" and "not a command" are different facts and only one of them is true.
|
|
1899
2002
|
|
|
1900
|
-
The table is `PLANNED_COMMANDS` in `packages/cli/src/cmd-planned.ts`; `cmd-planned.test.ts` asserts every row is reachable through the parser and that no `fix` points at another planned command. `PLANNED_SUBCOMMANDS` in the same file is the one-level-down version — a subcommand of a shipped command that this build does not implement: `x db studio` and `x
|
|
2003
|
+
The table is `PLANNED_COMMANDS` in `packages/cli/src/cmd-planned.ts`; `cmd-planned.test.ts` asserts every row is reachable through the parser and that no `fix` points at another planned command. `PLANNED_SUBCOMMANDS` in the same file is the one-level-down version — a subcommand of a shipped command that this build does not implement: `x db studio`, `x jobs drain`, `x token grant` and `x cache stats`. Each stays in its command's subcommand list, so the parser reaches it and `x help <command>` lists it.
|
|
1901
2004
|
|
|
1902
2005
|
| Command | Purpose | `fix:` today |
|
|
1903
2006
|
|---|---|---|
|
|
1904
|
-
| `x cache [graph\|bust <tag>\|clear\|stats]` | what a write evicts; targeted eviction | `x dev` — then the cache panel at `/_x` |
|
|
1905
2007
|
| `x branch [<name>\|delete <name>]` | copy-on-write database + preview URL + scoped MCP socket | `x db branch list --json` — the database half: `list`, `create <name>`, `delete <name>` |
|
|
1906
2008
|
| `x status` | role health and the build-ID distribution of connected clients | `x doctor --json` |
|
|
1907
|
-
| `x logs tail` | structured logs and spans, filterable | `x dev` — then the timeline panel at `/_x` |
|
|
1908
|
-
| `x token [create --scopes <s>\|grant <scope>]` | MCP tokens and scopes | `x mcp serve --help` |
|
|
1909
2009
|
| `x ai [eval <name>\|cache\|reindex]` | eval scores, cache hit rate and tokens saved, vector reindex | `x test eval --json` |
|
|
1910
2010
|
| `x money add-currency <ISO> --exponent <n>` | extend the currency table | `x errors explain X_CURRENCY_UNKNOWN --json` — extend it in code: `registerCurrency({ code, exponent, name })` from `@ultimat3/money`, once at boot. Shipped `As of 2026-08`, and it is what this command promised |
|
|
1911
|
-
| `x config show` | the resolved configuration, defaults included | `x manifest --json` |
|
|
1912
2011
|
|
|
1913
|
-
**Flags reach the same answer**, `As of 2026-10`: `x money add-currency USD --exponent 2` and `x
|
|
2012
|
+
**Flags reach the same answer**, `As of 2026-10`: `x money add-currency USD --exponent 2` and `x status --follow --json` exit `X_NOT_IMPLEMENTED` with the row's `fix:`, as the bare form does.
|
|
2013
|
+
|
|
2014
|
+
`x token`, `x config`, `x logs` and `x cache` left this table `As of 2026-11` (plan 101-full-stack-efficiency-sweeps U5); each has its section above.
|
|
1914
2015
|
|
|
1915
2016
|
## Names that moved
|
|
1916
2017
|
|
|
@@ -54,7 +54,7 @@ export const tag = tags({
|
|
|
54
54
|
| Actions / mutators | `cache: { invalidates: [...] }` |
|
|
55
55
|
| LLM calls | `cache: { invalidates: [...] }` |
|
|
56
56
|
|
|
57
|
-
The graph is a build-time artifact in `x.manifest.json`, so it records exactly what a write will evict — before you run it. `x cache graph --json`
|
|
57
|
+
The graph is a build-time artifact in `x.manifest.json`, so it records exactly what a write will evict — before you run it. `x cache graph --json` reads it (since 31.17.0), as does `x dev` → the `/_x` cache panel. Tag typing comes from a generated registry augmentation; `x manifest` regenerates it.
|
|
58
58
|
|
|
59
59
|
## One hop, all tiers
|
|
60
60
|
|
|
@@ -229,19 +229,19 @@ No threshold fixes that, because the same number has to keep an honest repeat *a
|
|
|
229
229
|
|
|
230
230
|
Also cached exactly (tier 3, not semantic): embeddings themselves, keyed by content hash + model. Re-embedding unchanged text is pure waste. See [MCP and AI](MCP-And-AI).
|
|
231
231
|
|
|
232
|
-
## CLI — `x cache`
|
|
232
|
+
## CLI — `x cache`
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
Ships since **31.17.0** (`graph`, `bust`, `clear`); `stats` is still **planned** and exits `X_NOT_IMPLEMENTED` with `x dev` → the `/_x` cache panel as its `fix:`.
|
|
235
235
|
|
|
236
|
-
| Command |
|
|
236
|
+
| Command | Does |
|
|
237
237
|
|---|---|
|
|
238
|
-
| `x cache graph --json` |
|
|
238
|
+
| `x cache graph --json` | the tag graph off the app's manifest: per declared tag, the actions whose `invalidates` name it, the queries cached under it and the ISR routes it revalidates. Build-time truth, no runtime call |
|
|
239
239
|
| `x cache graph --tag post --json` | the blast radius of one tag |
|
|
240
|
-
| `x cache bust <tag
|
|
241
|
-
| `x cache clear` |
|
|
242
|
-
| `x cache stats
|
|
240
|
+
| `x cache bust <tag> --json` | the real fanout for one tag — the app's own tiers booted as a role boots them, then `invalidateTags`: shared tiers dropped, the edge purged, the bus told — and the invalidation report |
|
|
241
|
+
| `x cache clear --json` | the same bust over every tag the app's modules declare |
|
|
242
|
+
| `x cache stats` | **planned** — hit rates live in the serving processes; `x dev` then the `/_x` cache panel |
|
|
243
243
|
|
|
244
|
-
|
|
244
|
+
From code: `invalidateTags([...])` from `@ultimat3/cache`, the call `x cache bust` makes.
|
|
245
245
|
|
|
246
246
|
## Errors
|
|
247
247
|
|
|
@@ -260,7 +260,7 @@ Verbatim shapes: [`packages/cache/src/errors.ts`](https://github.com/developerz-
|
|
|
260
260
|
- Cache keys are framework-generated. A hand-built key is a rejected PR.
|
|
261
261
|
- Every cached `query` carries at least one tag. Review catches it `As of 2026-08`, not the gate — `X_CACHE_UNTAGGED_QUERY` is reserved and no `x verify` step reads a query's tags.
|
|
262
262
|
- Never cache a value whose policy scope is not in its key.
|
|
263
|
-
- `flushAll` has no shipped caller: `x cache clear`
|
|
263
|
+
- `flushAll` has no shipped caller: `x cache clear` busts every declared tag through `invalidateTags`, never a flush, and there is no runtime API for it.
|
|
264
264
|
- Cache misses must be correct and merely slower — no code path may depend on a hit.
|
|
265
265
|
- Prefer `tag.post.id(x)` over `tag.post`. Narrow eviction is the default, not an optimization.
|
|
266
266
|
- A cache tier may never fail a business read or write. Tier errors land in the invalidation report, or in a `cache.tier_failure` event on the read ladder.
|
package/wiki/Configuration.md
CHANGED
|
@@ -51,12 +51,14 @@ There is no `url` field. The canonical origin is an env key the app reads at its
|
|
|
51
51
|
|
|
52
52
|
## `database`
|
|
53
53
|
|
|
54
|
-
`DatabaseConfig` is **
|
|
54
|
+
`DatabaseConfig` is **four fields**, deliberately — the connection itself is env, not config.
|
|
55
55
|
|
|
56
56
|
| field | type | default | notes |
|
|
57
57
|
|---|---|---|---|
|
|
58
58
|
| `database.driver` | `'postgres'` | `'postgres'` | one driver; `postgresDriver()` from `@ultimat3/entity` is its only implementation |
|
|
59
59
|
| `database.ssl` | `boolean` | `false` | `true` on managed Postgres |
|
|
60
|
+
| `database.rowSecurity` | `boolean` | `false` | every `tenant:` table carries a forced row-security policy (`x db gen`), and a serving role Postgres exempts from it is refused at boot (`X_DB_ROW_SECURITY_BYPASSED`) |
|
|
61
|
+
| `database.slowStatementMs` | whole ms ≥ 0 | unset: 500 | `As of 31.17.0`. A statement at or over it writes one `db.statement.slow` warn line in **production** — the normalised shape (never a bound value), duration, rows, the request/job id; one line per shape per 10 s, the rest counted as `suppressed`. `0` is off; `NaN`, a negative or a fraction is `X_CONFIG_INVALID` at boot. Outside production the line is off whatever the key says: a test suite's deliberately slow statements are not an incident |
|
|
60
62
|
| ~~`database.urlEnv`~~ | — | — | **Deleted 2026-08.** Refused at boot since 25.0.0 (`X_CONFIG_INVALID`, naming the replacement). `@ultimat3/db`'s `client.ts` reads `process.env['DATABASE_URL']` as a hardcoded literal, so a different key here could never be honoured. Migration: delete the key; the connection string is `DATABASE_URL` |
|
|
61
63
|
| ~~`database.poolSize`~~ | — | — | **Deleted 2026-08.** Refused at boot since 25.0.0 (`X_CONFIG_INVALID`, naming the replacement). A second, non-functioning spelling of `DATABASE_POOL_MAX`, which `baseClient()` layers over the role profile and which works. Migration: delete the key; set `DATABASE_POOL_MAX`. The sizing rule is unchanged — the pool is per PROCESS, so keep `replicas × poolMax` under Postgres `max_connections` |
|
|
62
64
|
| ~~`database.schema`~~ | — | — | **Deleted 2026-08.** Refused at boot since 25.0.0 (`X_CONFIG_INVALID`, naming the replacement). Nothing emits `SET search_path`. Migration: delete the key; there is no replacement, and `entity()` tables live in `public` |
|
|
@@ -775,6 +777,7 @@ Rules:
|
|
|
775
777
|
| `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 |
|
|
776
778
|
| No runtime mutation | config is frozen after `defineConfig`; there is no `setConfig` |
|
|
777
779
|
| Same image, all environments | only env differs. That is what makes staging a real rehearsal ([Deployment](Deployment)) |
|
|
780
|
+
| An app's own name is not a framework name | `FRAMEWORK_ENV` (`@ultimat3/core`) lists every name the framework reads. An app name on one it reads as a switch or for itself (`OTEL_*`, `TEST_DATABASE_URL`, any `ULTIMATE_*`) is `X_ENV_NAME_RESERVED` in `x doctor`, `As of 31.16.0`: rename it `APP_<name>`. An adapter's settings (`S3_*`, `SMTP_URL`, `CLOUDFLARE_*`) are the contract, never reported: declaring them is how an app configures that adapter |
|
|
778
781
|
|
|
779
782
|
## The environment — `resolveEnvironment()`
|
|
780
783
|
|
|
@@ -864,6 +867,21 @@ x doctor --json # env + connectivity + version checks
|
|
|
864
867
|
x verify --json # the gate
|
|
865
868
|
```
|
|
866
869
|
|
|
867
|
-
|
|
870
|
+
## The gate's file — `x.verify.json`
|
|
871
|
+
|
|
872
|
+
Not configuration of the app: what `x verify` holds it to, committed at the repo root. Every key is in [CLI reference](CLI-Reference#x-verify); the `exercise` key, `As of 31.16.0`:
|
|
873
|
+
|
|
874
|
+
| Key | Value | Absent |
|
|
875
|
+
|---|---|---|
|
|
876
|
+
| `exercise.unprovenMax` | a ratio from 0 to 1: how many reached primitives the exercise pass may leave `unproven` (`X_EXERCISE_UNPROVEN_ABOVE_FLOOR` above it) | a warning line naming the figure to write; the step stays green |
|
|
877
|
+
| `exercise.statementsMax` | a whole number ≥ 1: statements one call may send, for every primitive whose `defineExercise` entry declares no `statements: { max, why }` (`X_STATEMENTS_OVER_BUDGET` above it) | judged at 100, as a warning line |
|
|
878
|
+
|
|
879
|
+
```json
|
|
880
|
+
{ "exercise": { "unprovenMax": 0, "statementsMax": 100 } }
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
`x new` writes exactly that; `x upgrade` writes the figures the hop measured into a file that states none, so the floor only falls. A malformed value is a `manifest`-step problem naming the shape → [CLI reference](CLI-Reference#x-exercise).
|
|
884
|
+
|
|
885
|
+
`x config show --json` prints the resolved config — defaults merged, credentials redacted; `--section database` for one key (since 31.17.0) → [CLI reference](CLI-Reference).
|
|
868
886
|
|
|
869
887
|
Error shapes: [Error codes](Error-Codes). Symptom-first fixes: [Troubleshooting](Troubleshooting). Metrics, spans and logs: [Observability](Observability).
|
package/wiki/Known-Gaps.md
CHANGED
|
@@ -153,7 +153,7 @@ the release that fixed it. Upgrading is the fix, and the breaking entries are th
|
|
|
153
153
|
| `on delete` was declared and reached no SQL | **4.0.0** | `references(() => orgs.id, { onDelete: 'cascade' })` type-checked and the rule was dropped one layer below the declaration, so no generated `add constraint` ever spelled one and a drift check had nothing truthful to compare. Now: `ColumnDescription`/`ReferenceDescription` carry `onDelete`, `addForeignKey` writes the clause, and a rule changed on either side is `changed-foreign-key` drift whose `fix:` is the drop/add pair. On 3.0.0, add the clause to the `add constraint` the generator emitted, **before** applying the migration: `… references "orgs" ("id") on delete cascade;`. Editing it after it applies moves the checksum → `X_MIGRATION_CONFLICT` |
|
|
154
154
|
| A `references()` **removed** from a column emitted nothing | **4.0.0** | the key stayed on the database, the snapshot beside it recorded `foreignKeys: []` — actively denying a constraint the catalog held — and `compareForeignKeys` judges the declared side, so no check could see it. Now `foreignKeyPlan` emits the `drop constraint` in `up` and the `add` in `down`, naming the constraint the **previous snapshot** recorded rather than the name the generator would have picked. On 3.0.0, write the drop into the next generated migration by hand before applying it: `alter table "posts" drop constraint "posts_org_id_fkey";` |
|
|
155
155
|
| Drift ignored an index's direction and its predicate's presence | **4.0.0** | a `desc` index rebuilt ascending served a feed's newest page off the wrong end, and a partial index recreated as a total one silently widened the constraint — both read `ok: true`. Both are compared now; `asc` is normalised to `null` first, since Postgres stores an ascending index as not-descending. The predicate **text** is still uncompared and always will be — see [Open by decision](#open-by-decision). On 3.0.0, `x db gen` compares all five fields, so regenerate and inspect the diff |
|
|
156
|
-
| An unknown flag was refused **before** a planned command could answer honestly | **4.0.0** | the parser read flags against the spec first, so `x logs
|
|
156
|
+
| An unknown flag was refused **before** a planned command could answer honestly | **4.0.0** | the parser read flags against the spec first, so a planned command given a flag (then `x logs` with `--follow`) reported `X_CLI_BAD_FLAG` instead of `X_NOT_IMPLEMENTED`. A planned command now answers with its own status whatever flags it was given; a **shipped** command still refuses an unknown flag, which is correct — `x env` is shipped and declares `--json`, `--help`, `--cwd` and `--verbose`, so anything else is `X_CLI_BAD_FLAG` for the ordinary reason that no such flag exists. On 3.0.0, run the flagless form of a planned command to see the real message |
|
|
157
157
|
| `x deploy --method helm` threw `X_NOT_IMPLEMENTED` in a scaffolded app | **4.0.0** | `x new` wrote no `docker/helm`, and the command carried a "does this build implement helm?" branch over a build that implemented it completely. `x new` now writes the chart — 8 files, `Chart.yaml` + `values.yaml` + 6 templates — and the lying branch is deleted, so a missing chart is helm's own error. The framework repo's own `docker/helm` carried two more templates the scaffold did not (`pdb.yaml`, `servicemonitor.yaml`); `As of 2026-11` only `pdb.yaml` — the scaffold writes `servicemonitor.yaml` and `alert-rules.yaml`, and `x g chart-alerts` backfills them. On 3.0.0, copy [`docker/helm`](https://github.com/developerz-ai/ultimate/tree/main/docker/helm) from the framework repo, or use `--method compose` |
|
|
158
158
|
| `.env.development` **and `.env.production`** shipped in the image | **4.0.0** | the scaffold's `.dockerignore` excluded `.env` and `.env.*.local` — neither pattern matches `.env.production`, which is the file `docker-compose.prod.yml`'s `env_file:` tells the operator to create. This page said the leak was "harmless as generated"; **that was false**, and a real `docker build` proved both files land in a layer. Now `**/.env` + `**/.env.*` + `!**/.env.example`, in the framework's file, both tracked apps' and the one `x new` writes. On 3.0.0, add those three lines to `docker/Dockerfile.dockerignore` yourself — and rebuild, because an image already built still carries them |
|
|
159
159
|
| `realtime.heartbeatMs` was read by nothing | **4.0.0**, and BREAKING | the key sat in `RealtimeConfig` with a default of 15 000 and no reader anywhere. It is **deleted**: `RealtimeConfig` is `{ enabled, tier, transport, urlEnv }`, the socket beat is the client's `new LiveClient({ heartbeatMs })` and the presence beat is derived (`PresenceRegistry.heartbeatMs` is `max(1000, floor(ttlMs / 3))`). **Refused at boot since 25.0.0**: `defineConfig` throws `X_CONFIG_INVALID` naming `realtime.heartbeatMs` and its replacement (`REMOVED_CONFIG_KEYS`, `packages/core/src/config-removed.ts`), and any other key it does not declare is refused too (`refuseUnknownKeys`, `packages/core/src/config-keys.ts`). From 4.0.0 until 25.0.0 there was no runtime refusal — `section()` copied the key through and only `TS2353` at typecheck caught it. On 3.0.0, delete the key; setting it changes no behaviour either way |
|
package/wiki/MCP-And-AI.md
CHANGED
|
@@ -778,7 +778,7 @@ $ x verify --json
|
|
|
778
778
|
| `X_MCP_ARGS_INVALID` | not raised on the wire since 22.10 — invalid arguments answer `X_INPUT_INVALID` as a tool result; `McpArgsInvalidError` stays exported | — |
|
|
779
779
|
| `X_MCP_SURFACE_OVER_BUDGET` | `assertMcpSurfaceBudget` measured `tools/list`, `list_resources` or `instructions` over the budget declared for them | shorten what it names, group tools behind `surface: 'meta'`, or raise the budget with the measured size and the reason in the same diff |
|
|
780
780
|
| `X_MCP_IDEMPOTENCY_KEY_SHADOWED` | an `idempotent: true` action's input declares `idempotencyKey`, the tool argument reserved for the retry key — refused at boot | rename the action's input field |
|
|
781
|
-
| `X_MCP_SCOPE_DENIED` | the connection's token does not carry the tool's scope | reconnect with a token whose scopes include the one `cause` names — the app's `resolveToken(token)` is what returns them — or drop that scope from `defineAppMcp({ scopes })`. Scopes are fixed for the life of a connection, so a grant takes effect on the next one. **Not** `x token grant
|
|
781
|
+
| `X_MCP_SCOPE_DENIED` | the connection's token does not carry the tool's scope | reconnect with a token whose scopes include the one `cause` names — the app's `resolveToken(token)` is what returns them — or drop that scope from `defineAppMcp({ scopes })`. Scopes are fixed for the life of a connection, so a grant takes effect on the next one. **Not** `x token grant`, which stays `PLANNED` (a token's scopes are never widened): issue one with the wider set, `x token create --scopes <a>,<b> --json`, then `x token revoke <old-id>` |
|
|
782
782
|
| `X_MCP_SCOPE_UNKNOWN` | `defineAppMcp`'s `scopes:` names a tool the server does not project | spell the name as one of the tools the server actually projects, or drop it from that `scopes` entry |
|
|
783
783
|
| `X_MCP_SCOPE_CONFLICT` | two `scopes:` entries claim the same tool | keep the tool under the single scope a token must hold for it, and remove the other entry |
|
|
784
784
|
| `X_MCP_QUERY_REJECTED` | `db.query` was not given one read-only statement | send exactly one **read-only** `SELECT`/`WITH`/`EXPLAIN`/`SHOW`/`TABLE`/`VALUES` — a data-modifying CTE is not a read |
|
package/wiki/Testing.md
CHANGED
|
@@ -1111,6 +1111,10 @@ reruns the one job and names the effect to move:
|
|
|
1111
1111
|
x exercise chargeOrder --json # in job("chargeOrder"): wrap the "row:payments:insert" made after step "create" in step.run('<name>', async () => …)
|
|
1112
1112
|
```
|
|
1113
1113
|
|
|
1114
|
+
**A throttled sweep pays no wall clock**, `As of 31.17.0`: every killed rerun runs on the pass's
|
|
1115
|
+
frozen clock, the control's own (`fixture-jobs.ts`), so a `backfill()` pacer's `rate` wait moves the
|
|
1116
|
+
instant instead of sleeping. The reference app's pass went from 23.3 s to 13.6 s.
|
|
1117
|
+
|
|
1114
1118
|
### The plan and scale sweeps
|
|
1115
1119
|
|
|
1116
1120
|
**After every primitive ran, two sweeps, with no flag to turn either off**, `As of 2026-11`.
|
|
@@ -1118,13 +1122,13 @@ Source: `packages/testing/src/scale-sweep*.ts`, `plan-oracle.ts`, `plan-sweep*.t
|
|
|
1118
1122
|
|
|
1119
1123
|
| Sweep | What | Red |
|
|
1120
1124
|
|---|---|---|
|
|
1121
|
-
| 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: `X_QUERY_SCALES_WITH_ROWS`, fix `preload()` or `expectedQueryLoop('<why>', fn)` |
|
|
1125
|
+
| 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 |
|
|
1122
1126
|
| 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 |
|
|
1123
1127
|
|
|
1124
1128
|
With the planner's scans and sorts disabled it picks one only when no index can answer, so the
|
|
1125
1129
|
verdict reads the schema on empty tables — no volume, no statistics. Never red: `scale.verdict`
|
|
1126
1130
|
`flat` (a declared loop listed in `expected` with its reason) or `unproven` (a call that did not
|
|
1127
|
-
answer at both sizes); a statement whose equality pins a unique key; one a partial index serves once
|
|
1131
|
+
answer at both sizes, or took another path at 8); a statement whose equality pins a unique key; one a partial index serves once
|
|
1128
1132
|
its value is bound; a whole read beside a join whose join column leads a declared index on that
|
|
1129
1133
|
side, while the other side is bound by its own key — on empty tables a partial index the statement
|
|
1130
1134
|
implies looks like one row, so the planner walks it rather than probe it per row (`As of
|
|
@@ -1137,6 +1141,96 @@ under `expectedSeqScan('<why>', fn)` or on an entity with `scan: '<why>'`
|
|
|
1137
1141
|
x db gen posts-orgId-createdAt-id-index # after indexes: [{ on: ['orgId', 'createdAt', 'id'] }] in entity("posts")
|
|
1138
1142
|
```
|
|
1139
1143
|
|
|
1144
|
+
**Seed isolation** (`As of 31.16.0`). A sized-seed table the database refuses — usually a unique
|
|
1145
|
+
column the default factory repeats — is that table's failure alone: the primitives whose statements
|
|
1146
|
+
read it are `unproven`, the failure on their `scale.seed` (`{ entity, cause }`), and every other
|
|
1147
|
+
primitive is still scale-judged. `scaleSeedFindings(records)` folds them into one
|
|
1148
|
+
`X_EXERCISE_SEED_FAILED` per table, naming the entity, the driver's words and up to ten readers; the
|
|
1149
|
+
fix is the factory to declare. Before, one refused table left every primitive `unproven` with the
|
|
1150
|
+
same reason.
|
|
1151
|
+
|
|
1152
|
+
```ts
|
|
1153
|
+
import { entity, text, uuid } from '@ultimat3/entity';
|
|
1154
|
+
import { defineExercise, defineFactory } from '@ultimat3/testing';
|
|
1155
|
+
|
|
1156
|
+
const posts = entity('posts', {
|
|
1157
|
+
columns: { id: uuid().primaryKey(), slug: text({ max: 80 }).unique() },
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
export const exercise = defineExercise(
|
|
1161
|
+
{},
|
|
1162
|
+
{ factories: { posts: defineFactory(posts, { defaults: (index) => ({ slug: `post-${index}` }) }) } },
|
|
1163
|
+
);
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
### The statement ceiling
|
|
1167
|
+
|
|
1168
|
+
`As of 31.16.0`. The scale sweep judges growth; this judges the count. One call of an action, query
|
|
1169
|
+
or job may send `STATEMENTS_MAX` — 100 — statements; the busiest of its calls is the one judged,
|
|
1170
|
+
never the runs' sum. Over it the record carries `statementCeiling: { verdict: 'over', statements,
|
|
1171
|
+
max, top }` — `top` its three most-sent shapes, what a `preload()` would fold — and
|
|
1172
|
+
`statementCeilingFindings(records)` reports `X_STATEMENTS_OVER_BUDGET`. A flat 300-statement call is
|
|
1173
|
+
never `X_QUERY_SCALES_WITH_ROWS`, and it is still slow.
|
|
1174
|
+
|
|
1175
|
+
Only statements no `expectedQueryLoop` declared are counted, as in the scale sweep: the loop's reason
|
|
1176
|
+
is its argument. A `backfill()` pass writes every row it visits under the factory's own loop, so a
|
|
1177
|
+
sweep over 500 seeded rows judges its page reads, never the seed's size; the excluded count is
|
|
1178
|
+
`statementCeiling.expected`, named in the finding.
|
|
1179
|
+
|
|
1180
|
+
One primitive's ceiling, raised or lowered with a reason; a blank `why` (or none) is
|
|
1181
|
+
`X_CONTRACT_EXERCISE_UNDECLARED`, and `max` is a whole number ≥ 1:
|
|
1182
|
+
|
|
1183
|
+
```ts
|
|
1184
|
+
import { defineExercise } from '@ultimat3/testing';
|
|
1185
|
+
|
|
1186
|
+
export const exercise = defineExercise({
|
|
1187
|
+
importRows: { statements: { max: 140, why: 'one insert per line, bounded by the 140-line form' } },
|
|
1188
|
+
});
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1191
|
+
### Route loads
|
|
1192
|
+
|
|
1193
|
+
`As of 31.17.0`. A page read is a read: after the primitives the pass runs every `app/` and `site/`
|
|
1194
|
+
file route that declares a `load` — the route table `x routes` prints — once, in a seeded tenant of
|
|
1195
|
+
its own, as the runtime calls it (in a request, as the first actor the route's permission allows, a
|
|
1196
|
+
signed-in one where it names none). Params are a seeded row's id where a param's stem names an
|
|
1197
|
+
entity, else the route's own `prerender()` sample. Source:
|
|
1198
|
+
`packages/testing/src/exercise-route-loads.ts`, `exercise-route-subjects.ts`.
|
|
1199
|
+
|
|
1200
|
+
| Proof | As for a primitive |
|
|
1201
|
+
|---|---|
|
|
1202
|
+
| statements | counted; the busiest call held to the ceiling (100) — `statementCeiling` |
|
|
1203
|
+
| scale | swept at 2 and 8 rows a table: a shape that grows is `X_QUERY_SCALES_WITH_ROWS` — the demo's `/messages` at 4 + N |
|
|
1204
|
+
| plans | the statements it sent, planned by the oracle the primitives share |
|
|
1205
|
+
|
|
1206
|
+
The records are `routes[]` beside `records[]` in `.x/exercise.json` and `--json`: `{ kind: 'route',
|
|
1207
|
+
name, file, outcome, reason?, statements, effects, ms, statementCeiling?, plans?, scale?, proofMs? }`.
|
|
1208
|
+
Every finding on them is a **warning line**, never red — no floor key opts a page read in yet — and a
|
|
1209
|
+
load that could not run says why: `route /settings (…/page.tsx) · load not exercised: <reason>`.
|
|
1210
|
+
Measured on the tracked apps: docs-site 3 of 3 loads ran, the demo 6 of 10; the reference app's 7
|
|
1211
|
+
report `load not exercised` — a load that calls the app's own API needs an origin the pass does not
|
|
1212
|
+
serve yet, and one reads a member fact its actor does not carry.
|
|
1213
|
+
|
|
1214
|
+
**A primitive reached with nothing to prove** — no statement, no effect — has vacuous proofs (a
|
|
1215
|
+
sweep of nothing is `flat`). On a whole pass one warning line names the first five:
|
|
1216
|
+
`X_EXERCISE_EMPTY_REACH`, fixed in `apps/web/exercise.ts` with an input that reaches the work, or
|
|
1217
|
+
`{ off: '<why>' }`.
|
|
1218
|
+
|
|
1219
|
+
### The floor: `unprovenMax` and `statementsMax`
|
|
1220
|
+
|
|
1221
|
+
What is red is `x.verify.json`'s call ([Configuration](Configuration#the-gates-file--xverifyjson)):
|
|
1222
|
+
`x exercise` and the gate's `exercise` step read its `exercise` key.
|
|
1223
|
+
|
|
1224
|
+
| Key | Red above it | Without the key |
|
|
1225
|
+
|---|---|---|
|
|
1226
|
+
| `unprovenMax` | `X_EXERCISE_UNPROVEN_ABOVE_FLOOR` — unproven ÷ reached, rounded up to four places, names the first three; the sized-seed findings behind it are red with it | a warning line naming the figure to write |
|
|
1227
|
+
| `statementsMax` | `X_STATEMENTS_OVER_BUDGET` for every primitive over it whose entry declares no `statements` (an entry's own ceiling stands) | the ceiling is 100 and each finding is a warning line |
|
|
1228
|
+
|
|
1229
|
+
`x new` writes `{ "unprovenMax": 0, "statementsMax": 100 }`. An app scaffolded before 31.16.0 stays
|
|
1230
|
+
green with warnings until it opts in, and `x upgrade` writes the figures its hop measured — the
|
|
1231
|
+
busiest undeclared call, never under 100 — so the floor starts where the app is. A figure the run
|
|
1232
|
+
beats is a warning naming the lower number: the floor only falls.
|
|
1233
|
+
|
|
1140
1234
|
## Memory, width and isolation
|
|
1141
1235
|
|
|
1142
1236
|
`As of 22.7`. The gate is built for the machines it runs on — 8-16 GB, 2-8 cores, often two agents'
|
package/wiki/Troubleshooting.md
CHANGED
|
@@ -14,7 +14,8 @@ Run these first, in this order. All support `--json`.
|
|
|
14
14
|
| `x docs "<symptom or question>" --json` | the framework's own docs and this wiki, offline from the install — the first lookup for a symptom with no code |
|
|
15
15
|
| `x doctor --json` | environment, versions, drift, ports, PWA prerequisites — each with a fix |
|
|
16
16
|
| `x dev` then `/_x` | the live panels: routes, timeline, jobs, db, mail, cache, policy, manifest |
|
|
17
|
-
| `x
|
|
17
|
+
| `x logs tail --json` | the last lines of `.x/dev.log`, or one role's `.x/logs/<role>.log` with `--role` — the file the `logs.tail` MCP tool reads (since 31.17.0) |
|
|
18
|
+
| `x status --json` | **planned**, not shipped — throws `X_NOT_IMPLEMENTED` naming the rows above ([CLI reference](CLI-Reference)) |
|
|
18
19
|
|
|
19
20
|
The `--json` form is the same content as the terminal form. Paste the JSON into a bug report; do not paraphrase the terminal.
|
|
20
21
|
|
|
@@ -142,7 +143,7 @@ Boundaries run on pre-push and inside `x verify`. They are build errors, never l
|
|
|
142
143
|
| `X_MCP_TOOL_UNKNOWN`, or a tool absent from `tools/list` | the tool is hidden from this caller, or the name is stale — role-hidden and absent answer identically, on purpose | visibility is fail-closed: check the caller against the tool's `visibleTo` (a role allowlist or a predicate over the caller). Otherwise `tools/list` for the catalog this caller may use, and `x manifest` if the committed manifest is stale |
|
|
143
144
|
| `X_MCP_TOOL_UNDECLARED`, and MCP refuses to boot | an action or query written out in `defineAppMcp`'s `actions:`/`queries:` never declared `mcp: { expose: true }` — a boot-time configuration error, not a hidden tool | add `mcp: { expose: true, description: '<what it does>' }` beside the primitive's policy, or drop it from the list and let `include: 'exposed'` project what opted in |
|
|
144
145
|
| `X_MCP_SCOPE_UNKNOWN`, and MCP refuses to boot | `defineAppMcp`'s `scopes:` map names a tool by a name the server does not project — a typo, or the primitive was renamed or dropped from `actions:`/`queries:`/`tools:` | spell the name as one of the tools the server actually projects, or drop it from that `scopes` entry |
|
|
145
|
-
| `X_MCP_SCOPE_DENIED` | the connection's token does not carry the tool's scope — scope is a property of the token, not of the actor's permissions | reconnect with a token whose scopes include the one `cause` names — the app's `resolveToken(token)` returns them — or drop that scope from `defineAppMcp({ scopes })`. Scopes are fixed for the life of a connection, so a grant takes effect on the next one. `x token grant`
|
|
146
|
+
| `X_MCP_SCOPE_DENIED` | the connection's token does not carry the tool's scope — scope is a property of the token, not of the actor's permissions | reconnect with a token whose scopes include the one `cause` names — the app's `resolveToken(token)` returns them — or drop that scope from `defineAppMcp({ scopes })`. Scopes are fixed for the life of a connection, so a grant takes effect on the next one. A wider grant is a new token — `x token create --scopes <a>,<b> --json`, then `x token revoke <old-id>`: `x token grant` stays **planned**, since a token's scopes are never widened |
|
|
146
147
|
| `X_FORBIDDEN` from a `tools/call` | the tool was invoked and its policy refused this input — the same denial the HTTP route returns for the same call | grant the human the permission — an agent can never exceed the human it acts for |
|
|
147
148
|
| Dev MCP server not reachable | `x dev` not running, or you pointed at prod | default socket is `mcp.devSocket` (`ws://localhost:9229`). The dev server is **never** bound in `ROLE=web` |
|
|
148
149
|
| `X_MCP_QUERY_REJECTED` | `db.query` was not given exactly one read-only statement | send a single **read-only** `SELECT`/`WITH`/`EXPLAIN`/`SHOW`/`TABLE`/`VALUES` — a data-modifying CTE is not a read. MCP has no arbitrary-write path: change data by calling an action exposed with `mcp: { expose: true }`, change schema with `db.migrate` on a branch database |
|
package/wiki/Upgrading.md
CHANGED
|
@@ -267,6 +267,15 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
267
267
|
| a `postgresVectorStore` search runs in a read-only transaction that widens the HNSW scan (**31.15.0**: `hnsw.iterative_scan = relaxed_order` on pgvector ≥ 0.8, else `hnsw.ef_search = max(40, k × 10)`), 2–3 round trips where it was 1, so a small tenant gets `k` hits | nothing. On pgvector < 0.8, upgrade the extension for the cheaper iterative scan |
|
|
268
268
|
| `x build --target static` writes `.br` (brotli 11) and `.gz` (gzip 9) siblings beside each island chunk and stylesheet (**31.15.0**), and the app brand ships at the end of each surface stylesheet instead of an inline `<style>` | a static host may serve the siblings (nginx `gzip_static on;` / `brotli_static on;`, Caddy `file_server { precompressed br gzip }`, with `Vary: Accept-Encoding`) or ignore them — [Static assets](Static-Assets#precompressed-siblings-in-a-static-export). A hand-written CSP that allowed the brand's `sha256` may drop it |
|
|
269
269
|
| a cacheable `ssr` document (not `no-store`) carries a strong content `ETag` and answers `If-None-Match` with `304` (**31.15.0**); every document sends a `Link` header (stylesheet preload + the modulepreloads its tags name) a CDN turns into 103 Early Hints | nothing. A test that expected `200` to `If-None-Match: *` on such a page expects `304` |
|
|
270
|
+
| `x exercise` and `x verify`'s `exercise` step print `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_EXERCISE_SEED_FAILED` and `X_STATEMENTS_OVER_BUDGET` as **warning lines** (**31.16.0**): one call over 100 statements, or primitives left `unproven`, in an app whose `x.verify.json` has no `exercise` key. The step stays green; each is red only once the key opts in | nothing. `x upgrade` to 31.16.0 writes the figures the hop's own `x exercise` measured (`"exercise": { "unprovenMax": <measured>, "statementsMax": <busiest call, ≥ 100> }`), so the hop stays green and the floor only falls; `x new` writes the strict `{ "unprovenMax": 0, "statementsMax": 100 }`. A primitive that needs more statements per call: `defineExercise({ <name>: { statements: { max: <n>, why: '<why one call sends that many>' } } })` in `apps/web/exercise.ts` |
|
|
271
|
+
| `x upgrade` writes files it used to print (**31.16.0**): each missing shipped guard whose rule the tree already meets is installed as `guards/<name>.ts` (+ its test), and a hop that moves the Bun floor rewrites `x.verify.json`'s `coverage` floor to the measurement, with a dated `why`, when unit coverage measured under it. Both are in the hop's diff and in `--json` (`data.guards.installed` / `data.guards.withheld`, `data.coverage`) | review the diff before committing it. A guard you do not want: delete its file. A withheld guard is listed with its finding count and the `x g guard <name>` that adds it |
|
|
272
|
+
| `x doctor` prints four new **warnings** (**31.16.0**): `X_DB_ROW_SECURITY_OFF`, `X_VERIFY_STEP_UNFLOORED`, `X_FRAMEWORK_PIN_RANGE`, `X_ENV_NAME_RESERVED`, one line each under `N warning(s)` and in `--json` as `data.warnings[]` (`{ code, cause, fix, docs, at }`). Its exit status, `findings` and `data.codes` are unchanged, so a CI step or `x upgrade` hop running `x doctor` stays green; they join the verdict (red) on the next major, `next`. `x verify` is unchanged — none of them is a gate step | nothing now. Before the next major, clear them: each warning's `fix:` is the edit. A reserved env name: rename it to `APP_<name>` in `envSchema` (or `x secrets edit`); an unfloored step: `x verify --only <steps> --json`, then add each step that passed to `"steps"` |
|
|
273
|
+
| `x doctor` lists `repo-raw-sql` as differing from the shipped template after the **31.17.0** hop: the guard now also reports a hand-written row comparison (`(a, b) < (?, ?)`, fix `keyset()`) and `pg_advisory_xact_lock` (fix `lockKeys`) in any repo statement, splices a quoted literal into its handle call as the value, and names the chain write (`.where(…).andWhere(…).deleteAll()` / `.updateAll({ … })`) for an update or delete with a range predicate, where it named `deleteWhere` | optional: `x g guard repo-raw-sql --force` — it rewrites `guards/repo-raw-sql.ts` **and** its `.test.ts`, so review the diff and keep any rule you edited on purpose (an adopter's copy that silenced range writes: the chain is one statement now). Then `x verify`: its `boundaries` step may report `X_REPO_RAW_SQL` at a row comparison or advisory lock it never read before |
|
|
274
|
+
| `x doctor` lists `unbounded-fanout` as a missing shipped guard after the **31.17.0** hop: `Promise.all(rows.map(async … db/tx/repo …))` opens one statement per row at once (`X_UNBOUNDED_FANOUT`, fix `mapBounded(rows, fn, { width })` from `@ultimat3/core`). `x upgrade` installs it when the tree already meets it, else lists it withheld with its finding count | nothing breaks. To adopt: `x g guard unbounded-fanout`, then `x verify`; a list bounded where it is built takes a `// why:` on the line |
|
|
275
|
+
| `x new`'s CI is three jobs read from `x verify plan` (**31.17.0**): `plan` → one `gate` per part (`bun run verify --only … [--shard …] --json`, uploaded) → `verify` (`bun run verify merge`) | nothing: an app's existing one-job `.github/workflows/ci.yml` (`bun run setup` then `bun run verify`) keeps working. To adopt the parallel gate, copy a fresh scaffold's `.github/workflows/ci.yml` (`x new <scratch> && cp <scratch>/.github/workflows/ci.yml .github/workflows/`) |
|
|
276
|
+
| `x exercise` prints new **warning lines** (**31.17.0**): one per route `load` it ran or could not run (`route <path> (<file>) · …`, `routes[]` in `.x/exercise.json`), and `X_EXERCISE_EMPTY_REACH` for primitives reached with no statement and no effect. Never red — no `x.verify.json` key opts a page read in yet | nothing. To clear the empty-reach line, give each named primitive an input in `apps/web/exercise.ts` that reaches its work, or `{ off: '<why>' }` |
|
|
277
|
+
| A worker, scheduler or sync container no longer logs the web role's boot warnings (**31.17.0**); every container logs `boot.phase { role, name, ms }` per phase; `/readyz` pings the database at most once a second | nothing. A log alert keyed on a warning in a non-web role stops firing: re-point it at the `web` role |
|
|
278
|
+
| `x dev` sets aside an embedded data directory that will not open (**31.17.0**): `.x/pgdata` becomes `.x/pgdata.unopenable-<UTC>` and the boot starts an empty database (`X_DEV_DATA_UNOPENABLE`) | `x db migrate`, then `x db seed` if the app has one. The moved directory holds the old rows; delete it once they are not needed |
|
|
270
279
|
|
|
271
280
|
## 29.x → 30.0.0, entry by entry
|
|
272
281
|
|