@ultimat3/cli 31.16.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.
Files changed (65) hide show
  1. package/README.md +7 -1
  2. package/package.json +29 -29
  3. package/src/cache-graph.ts +67 -0
  4. package/src/cmd-cache-spec.ts +25 -0
  5. package/src/cmd-cache.ts +187 -0
  6. package/src/cmd-config-spec.ts +23 -0
  7. package/src/cmd-config.ts +61 -0
  8. package/src/cmd-exercise.ts +34 -10
  9. package/src/cmd-explain-spec.ts +24 -0
  10. package/src/cmd-explain.ts +201 -0
  11. package/src/cmd-logs-spec.ts +34 -0
  12. package/src/cmd-logs.ts +80 -0
  13. package/src/cmd-planned.ts +15 -29
  14. package/src/cmd-token-spec.ts +54 -0
  15. package/src/cmd-token.ts +173 -0
  16. package/src/cmd-verify-spec.ts +13 -3
  17. package/src/cmd-verify.ts +2 -0
  18. package/src/config-redact.ts +39 -0
  19. package/src/dev-boot-data-dir.ts +69 -0
  20. package/src/dev-boot.ts +26 -13
  21. package/src/error-codes-tooling.ts +6 -4
  22. package/src/error-codes.ts +2 -0
  23. package/src/errors.ts +8 -2
  24. package/src/exercise-entry-edit.ts +5 -1
  25. package/src/exercise-routes.ts +59 -0
  26. package/src/explain-capture.ts +38 -0
  27. package/src/generate-exercise.ts +2 -2
  28. package/src/generate-factories.ts +133 -0
  29. package/src/generate-files.ts +11 -0
  30. package/src/generate-kinds.ts +13 -0
  31. package/src/mcp-db-target.ts +4 -3
  32. package/src/mcp-errors.ts +4 -0
  33. package/src/messages-gate.ts +2 -0
  34. package/src/messages-ops.ts +32 -0
  35. package/src/messages-upgrade.ts +1 -0
  36. package/src/messages.ts +2 -0
  37. package/src/otlp-export.ts +16 -2
  38. package/src/registry.ts +10 -0
  39. package/src/role-start.ts +11 -5
  40. package/src/runtime-services.ts +35 -19
  41. package/src/serve-boot-phases.ts +30 -0
  42. package/src/serve-boot-warnings.ts +62 -0
  43. package/src/serve-boot.ts +30 -11
  44. package/src/templates/generate-cron-job.ts +90 -0
  45. package/src/templates/generate-purge.ts +93 -0
  46. package/src/templates/generate-webhook-receiver.ts +274 -0
  47. package/src/templates/github/ci.yml.ts +101 -36
  48. package/src/templates/guard-repo-raw-sql-test.ts +174 -0
  49. package/src/templates/guard-repo-raw-sql.ts +115 -145
  50. package/src/templates/guard-unbounded-fanout.ts +170 -0
  51. package/src/templates/scaffold-claude-commands.ts +3 -2
  52. package/src/templates/scaffold-docs.ts +3 -2
  53. package/src/templates/scaffold-guards.ts +3 -0
  54. package/src/upgrade-gate.ts +18 -6
  55. package/src/upgrade-report.ts +4 -0
  56. package/src/verify-plan.ts +127 -0
  57. package/wiki/CI-Parallel-Gate.md +38 -1
  58. package/wiki/CLI-Reference.md +90 -12
  59. package/wiki/Caching-And-Invalidation.md +10 -10
  60. package/wiki/Configuration.md +4 -2
  61. package/wiki/Known-Gaps.md +1 -1
  62. package/wiki/MCP-And-AI.md +1 -1
  63. package/wiki/Testing.md +32 -0
  64. package/wiki/Troubleshooting.md +3 -2
  65. package/wiki/Upgrading.md +6 -0
@@ -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 cache` | tag graph, bust, clear, stats | planned |
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
@@ -1409,7 +1436,24 @@ write, and the run stays green; with it, above a declared figure is red.
1409
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 |
1410
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 |
1411
1438
 
1412
- 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`.
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`.
1413
1457
 
1414
1458
  ## x drill
1415
1459
 
@@ -1916,24 +1960,58 @@ For each violation involving the file it reports the offending edge, the full ch
1916
1960
 
1917
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.
1918
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
+
1919
1999
  ## Planned commands
1920
2000
 
1921
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.
1922
2002
 
1923
- 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 jobs drain`. Each stays in its command's subcommand list, so the parser reaches it and `x help <command>` lists it.
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.
1924
2004
 
1925
2005
  | Command | Purpose | `fix:` today |
1926
2006
  |---|---|---|
1927
- | `x cache [graph\|bust <tag>\|clear\|stats]` | what a write evicts; targeted eviction | `x dev` — then the cache panel at `/_x` |
1928
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>` |
1929
2008
  | `x status` | role health and the build-ID distribution of connected clients | `x doctor --json` |
1930
- | `x logs tail` | structured logs and spans, filterable | `x dev` — then the timeline panel at `/_x` |
1931
- | `x token [create --scopes <s>\|grant <scope>]` | MCP tokens and scopes | `x mcp serve --help` |
1932
2009
  | `x ai [eval <name>\|cache\|reindex]` | eval scores, cache hit rate and tokens saved, vector reindex | `x test eval --json` |
1933
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 |
1934
- | `x config show` | the resolved configuration, defaults included | `x manifest --json` |
1935
2011
 
1936
- **Flags reach the same answer**, `As of 2026-10`: `x money add-currency USD --exponent 2` and `x logs tail --follow --json` exit `X_NOT_IMPLEMENTED` with the row's `fix:`, as the bare form does.
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.
1937
2015
 
1938
2016
  ## Names that moved
1939
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` is the planned reader of it; today it is `x dev` → the `/_x` cache panel. Tag typing comes from a generated registry augmentation; `x manifest` regenerates it.
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` is **planned**
232
+ ## CLI — `x cache`
233
233
 
234
- Every row below exits `X_NOT_IMPLEMENTED` `As of 2026-08`, with `x dev` → the `/_x` cache panel as its `fix:`. A planned command declares no flags either, so `x cache graph --tag post` dies at the parser with `X_CLI_BAD_FLAG` before the honest message — call the bare form.
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 | Will do |
236
+ | Command | Does |
237
237
  |---|---|
238
- | `x cache graph --json` | print the tag → dependents graph: cache keys, ISR routes, CDN paths, live queries. Build-time truth, no runtime call |
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>` | run the real fanout for one tag, all tiers, and print the invalidation report |
241
- | `x cache clear` | **dev only.** The only `flushAll` there would be; there is no runtime API for it |
242
- | `x cache stats --json` | per-tier hit rate, byte usage against budget, evictions |
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
- Today: `x dev` then the `/_x` cache panel, and `invalidateTags([...])` from `@ultimat3/cache` for a bust from code.
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` is planned, and there is no runtime API for it.
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.
@@ -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 **two fields**, deliberately — the connection itself is env, not config.
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` |
@@ -880,6 +882,6 @@ Not configuration of the app: what `x verify` holds it to, committed at the repo
880
882
 
881
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).
882
884
 
883
- `x config show` is **planned**, not shipped — it throws `X_NOT_IMPLEMENTED` naming `x manifest --json` as the closest thing today → [CLI reference](CLI-Reference).
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).
884
886
 
885
887
  Error shapes: [Error codes](Error-Codes). Symptom-first fixes: [Troubleshooting](Troubleshooting). Metrics, spans and logs: [Observability](Observability).
@@ -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 tail --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 |
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 |
@@ -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`: that command is `PLANNED` and exits `X_NOT_IMPLEMENTED` |
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`.
@@ -1184,6 +1188,34 @@ export const exercise = defineExercise({
1184
1188
  });
1185
1189
  ```
1186
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
+
1187
1219
  ### The floor: `unprovenMax` and `statementsMax`
1188
1220
 
1189
1221
  What is red is `x.verify.json`'s call ([Configuration](Configuration#the-gates-file--xverifyjson)):
@@ -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 status --json` · `x logs tail --json` | **planned**, not shipped — both throw `X_NOT_IMPLEMENTED` naming the two rows above ([CLI reference](CLI-Reference)) |
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` is **planned** and exits `X_NOT_IMPLEMENTED` |
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
@@ -270,6 +270,12 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
270
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
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
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 |
273
279
 
274
280
  ## 29.x → 30.0.0, entry by entry
275
281