@ultimat3/cli 31.16.0 → 31.18.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 +11 -2
- 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 +3 -3
- package/src/cmd-exercise.ts +34 -10
- package/src/cmd-explain-spec.ts +24 -0
- package/src/cmd-explain.ts +201 -0
- package/src/cmd-generate-spec.ts +3 -3
- package/src/cmd-generate.ts +2 -2
- 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-verify-spec.ts +13 -3
- package/src/cmd-verify.ts +2 -0
- package/src/config-redact.ts +39 -0
- package/src/dev-boot-data-dir.ts +69 -0
- package/src/dev-boot.ts +26 -13
- package/src/doctor-chart-alerts.ts +50 -22
- package/src/error-codes-tooling.ts +6 -4
- package/src/error-codes.ts +2 -0
- package/src/errors.ts +8 -2
- package/src/exercise-entry-edit.ts +5 -1
- package/src/exercise-routes.ts +59 -0
- package/src/explain-capture.ts +38 -0
- package/src/generate-chart-alerts.ts +99 -45
- package/src/generate-exercise.ts +2 -2
- package/src/generate-factories.ts +133 -0
- package/src/generate-files.ts +15 -0
- package/src/generate-kinds.ts +15 -0
- package/src/mcp-db-target.ts +4 -3
- package/src/mcp-errors.ts +4 -0
- package/src/messages-gate.ts +2 -0
- package/src/messages-ops.ts +32 -0
- package/src/messages-upgrade.ts +1 -0
- package/src/messages.ts +4 -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/chart-dashboard.ts +245 -0
- 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-helm-alert-rules.ts +160 -0
- package/src/templates/scaffold-helm-alerts.ts +22 -87
- package/src/templates/scaffold-helm-templates.ts +2 -0
- package/src/templates/scaffold-helm.ts +20 -4
- package/src/upgrade-gate.ts +18 -6
- package/src/upgrade-report.ts +4 -0
- package/src/verify-plan.ts +127 -0
- package/wiki/Admin-Dashboard.md +6 -2
- package/wiki/CI-Parallel-Gate.md +38 -1
- package/wiki/CLI-Reference.md +95 -14
- package/wiki/Caching-And-Invalidation.md +10 -10
- package/wiki/Configuration.md +4 -2
- package/wiki/Known-Gaps.md +1 -1
- package/wiki/MCP-And-AI.md +1 -1
- package/wiki/Observability.md +6 -1
- package/wiki/Testing.md +64 -0
- package/wiki/Troubleshooting.md +3 -2
- package/wiki/Upgrading.md +10 -0
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/Observability.md
CHANGED
|
@@ -233,6 +233,7 @@ Declared in `process-metrics.ts` and `packages/db/src/pool-gauge.ts`, started by
|
|
|
233
233
|
| `process_event_loop_lag_seconds` | histogram | `s` | none | how late a 1,000 ms timer fired, one sample a second |
|
|
234
234
|
| `process_start_time_seconds` | gauge | `s` | none | Unix time the process started |
|
|
235
235
|
| `process_info` | gauge | `1` | `role` | always 1; `role` is `ROLE`, or `x dev`'s roles joined by `+` |
|
|
236
|
+
| `process_memory_limit_bytes` | gauge | `By` | none | the container's memory limit, cgroup v2 `memory.max`, read once per start (`As of 2026-11`). **Absent** where there is none: `max`, no cgroup v2 file, not Linux. `process_resident_memory_bytes / process_memory_limit_bytes` is how near the pod is to its OOMKill |
|
|
236
237
|
| `db_pool_max` | gauge | `{connection}` | none | connections this process may open, summed over its pools |
|
|
237
238
|
| `db_pool_in_use` | gauge | `{connection}` | none | connections running a statement or pinned by a transaction |
|
|
238
239
|
| `db_pool_waiting` | gauge | `{statement}` | none | statements and pins queued because the pool is at `max` |
|
|
@@ -243,6 +244,10 @@ Declared in `process-metrics.ts` and `packages/db/src/pool-gauge.ts`, started by
|
|
|
243
244
|
- **`queue_wake_live`** (gauge, `worker` only): 1 once a notification has crossed the worker's `LISTEN` session, 0 while jobs start on the poll alone — a transaction-pooling proxy disables the wake without an error.
|
|
244
245
|
- **What grows?** `process_resident_memory_bytes` rising with `process_heap_used_bytes` flat is memory outside the heap (`process_external_memory_bytes`, or the allocator); both rising is a retained structure.
|
|
245
246
|
|
|
247
|
+
### Alerts and the dashboard the chart ships
|
|
248
|
+
|
|
249
|
+
`As of 2026-11`. The Helm chart's `alert-rules.yaml` holds the mechanism alerts, now with multi-window error-budget burn: `UltimateErrorBudgetFastBurn` (the 5xx share above 14.4 × the budget over 1h and 5m) and `UltimateErrorBudgetSlowBurn` (6 × over 6h and 30m). Both are measured against `alerts.objective`, in percent, default 99.9. Saturation rules sit beside them: `UltimateJobFailures`, `UltimatePoolSaturated`, `UltimateEventLoopLag` and `UltimateMemoryNearLimit`. The chart also ships one Grafana dashboard, off by default (`dashboard.enabled`), as a ConfigMap for a Grafana sidecar. `x g chart-alerts` / `x g chart-dashboard` backfill an older chart, and `--print` serves a loader outside Kubernetes. Every rule and panel is held to a declared series (`scripts/chart-alerts.test.ts`, `scripts/chart-dashboard.test.ts`). The full table and the runbooks: [`docs/ops/03-observability.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/03-observability.md#alerts-on-the-apps-own-metrics).
|
|
250
|
+
|
|
246
251
|
### The one series a `sync` node adds
|
|
247
252
|
|
|
248
253
|
| Instrument | Name | Kind | Unit | Labels |
|
|
@@ -269,7 +274,7 @@ CPU autoscaling is wrong for `sync` and `worker`: a node holding 80k idle socket
|
|
|
269
274
|
| Head sampling | `otel.sampling`, default `0.1`; errors are always sampled |
|
|
270
275
|
| OTLP delivery | a 429, 502, 503, 504 or a transport failure is retried, 3 attempts with full jitter and `Retry-After` honoured, inside the exporter's `timeoutMs` (default 10 s, the whole export); any other status is one POST. One `otlp export rejected`/`failed` line per batch, with `attempts`. A collector that accepted and then answered 503 receives that batch twice; span ids dedupe it |
|
|
271
276
|
| Error grouping | `errorFingerprint(report)`: 16 hex over `code`, `source`, `scope.operation`, plus the top application frame (function and root-relative path, no line) for `X_INTERNAL`. Never the cause or an id, so two throws differing in a row id are one group, and a deploy is not a new one. The Sentry envelope sends it as `fingerprint` |
|
|
272
|
-
| Log level | `LOG_LEVEL`, default `info` |
|
|
277
|
+
| Log level | `LOG_LEVEL`, default `info`. The framework's own policy (`As of 2026-11`): a routine per-unit event (one per request, job, fire or message) is `debug`; `info` is lifecycle and rare outcomes; `warn` asks an operator to act. `scripts/log-levels.ts` refuses an unstated per-unit `info` line in the framework (`X_LOG_LEVEL_UNSTATED`) |
|
|
273
278
|
| Secret redaction | a `Secret` is redacted by value before every other branch, at any depth → [Configuration](Configuration) |
|
|
274
279
|
| Request context | the ALS context carries the request id every log line and span inherits |
|
|
275
280
|
| Live queries | the realtime client puts a `traceparent` on the `subscribe` frame (`LiveClient({ traceparent })`); the snapshot that subscribe causes is the span `live.snapshot <query>`, a CHILD of it, and a re-read a change forces is `live.rerun <query>`, which LINKS to it and parents on the change. A value that is not a valid W3C header is ignored, never refused: telemetry never fails a subscribe. The page boot sends none (`As of 2026-11`): a browser holds no trace |
|
package/wiki/Testing.md
CHANGED
|
@@ -926,6 +926,38 @@ await insertSeedGraph(graph, writer);
|
|
|
926
926
|
|
|
927
927
|
`X_SEED_GRAPH_UNSATISFIED` names the table, the columns to supply and the `defineFactory` call. `As of 2026-11-05`, `seed-graph.live.test.ts` inserts both tracked apps' schemas into Postgres with no factory, and `seed-graph-pglite.test.ts` the same into PGlite, in the unit step. Source: `packages/testing/src/seed-graph*.ts`.
|
|
928
928
|
|
|
929
|
+
## Property checks
|
|
930
|
+
|
|
931
|
+
`As of 2026-11`. `property(gen, fn, { runs, seed, maxShrinks })` checks a claim against `runs` (200) seeded draws. A throw or a `false` fails it as `X_TEST_PROPERTY_FAILED`. The failure carries the input shrunk by halving to the smallest that still fails, plus a `fix:` whose `{ seed, runs }` replays exactly that draw.
|
|
932
|
+
|
|
933
|
+
```ts
|
|
934
|
+
import { decodeCursor, encodeCursor } from '@ultimat3/core';
|
|
935
|
+
import { expect, gen, property, unitTest } from '@ultimat3/testing';
|
|
936
|
+
|
|
937
|
+
const position = gen.map(
|
|
938
|
+
gen.tuple(gen.string({ maxLength: 24 }), gen.string(), gen.array(gen.int(-100, 100))),
|
|
939
|
+
([scope, id, key]) => ({ scope, id, key }),
|
|
940
|
+
);
|
|
941
|
+
|
|
942
|
+
unitTest('a cursor round-trips any position', () => {
|
|
943
|
+
property(position, (payload) => {
|
|
944
|
+
expect(decodeCursor(encodeCursor(payload), payload.scope)).toEqual(payload);
|
|
945
|
+
});
|
|
946
|
+
});
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
| Fact | Why |
|
|
950
|
+
|---|---|
|
|
951
|
+
| the default seed is fixed | the gate never flakes; pass another `seed` to explore |
|
|
952
|
+
| draw *n*'s size never depends on `runs` | so `{ runs: n }` replays draw *n* |
|
|
953
|
+
| a promise returned is refused (`PropertyAsyncError`, the same code) | every draw would pass before its assertion ran |
|
|
954
|
+
| `gen`: `int` `oneOf` `union` `map` `constant` `array` `tuple` `string` `bytes` `json`; `HOSTILE_CHARS` | each draw carries its shrinks, so a mapped value shrinks through its source |
|
|
955
|
+
| the framework's own: `packages/testing/src/property-*.test.ts` | cursor, canonical JSON, money, byte range, cookie, pgoutput, interpolate, `estimateBytes`. They found two shipped bugs (fixed in 31.18.0): `parseAmount` refused BHD formatted in `ar-EG`, and the pgoutput decoder accepted a negative length |
|
|
956
|
+
|
|
957
|
+
## The heap canary
|
|
958
|
+
|
|
959
|
+
`As of 2026-11`. `soak({ fetch, requests, total, warmup, maxGrowthBytes })` sends `total` (20,000) requests round-robin through an in-process handler, after `warmup` (2,000). It then compares the live heap after `Bun.gc(true)`; growth past `maxGrowthBytes` is `X_TEST_SOAK_HEAP_GROWTH`. Every response status is counted, because a soak that only ever answered 500 soaked nothing. The bound is a measurement: three runs, the largest × 1.5, written beside it. `measureSoak` reports without a verdict. The framework's own canary is `packages/testing/src/soak.live.test.ts` (SSR, an action, a query, a 404, a 400), in the `live` step.
|
|
960
|
+
|
|
929
961
|
## Shared examples
|
|
930
962
|
|
|
931
963
|
One contract, asserted against many subjects, with the subject passed as a **thunk** so a `beforeAll`-built value is read at test time rather than at declaration time.
|
|
@@ -1111,6 +1143,10 @@ reruns the one job and names the effect to move:
|
|
|
1111
1143
|
x exercise chargeOrder --json # in job("chargeOrder"): wrap the "row:payments:insert" made after step "create" in step.run('<name>', async () => …)
|
|
1112
1144
|
```
|
|
1113
1145
|
|
|
1146
|
+
**A throttled sweep pays no wall clock**, `As of 31.17.0`: every killed rerun runs on the pass's
|
|
1147
|
+
frozen clock, the control's own (`fixture-jobs.ts`), so a `backfill()` pacer's `rate` wait moves the
|
|
1148
|
+
instant instead of sleeping. The reference app's pass went from 23.3 s to 13.6 s.
|
|
1149
|
+
|
|
1114
1150
|
### The plan and scale sweeps
|
|
1115
1151
|
|
|
1116
1152
|
**After every primitive ran, two sweeps, with no flag to turn either off**, `As of 2026-11`.
|
|
@@ -1184,6 +1220,34 @@ export const exercise = defineExercise({
|
|
|
1184
1220
|
});
|
|
1185
1221
|
```
|
|
1186
1222
|
|
|
1223
|
+
### Route loads
|
|
1224
|
+
|
|
1225
|
+
`As of 31.17.0`. A page read is a read: after the primitives the pass runs every `app/` and `site/`
|
|
1226
|
+
file route that declares a `load` — the route table `x routes` prints — once, in a seeded tenant of
|
|
1227
|
+
its own, as the runtime calls it (in a request, as the first actor the route's permission allows, a
|
|
1228
|
+
signed-in one where it names none). Params are a seeded row's id where a param's stem names an
|
|
1229
|
+
entity, else the route's own `prerender()` sample. Source:
|
|
1230
|
+
`packages/testing/src/exercise-route-loads.ts`, `exercise-route-subjects.ts`.
|
|
1231
|
+
|
|
1232
|
+
| Proof | As for a primitive |
|
|
1233
|
+
|---|---|
|
|
1234
|
+
| statements | counted; the busiest call held to the ceiling (100) — `statementCeiling` |
|
|
1235
|
+
| 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 |
|
|
1236
|
+
| plans | the statements it sent, planned by the oracle the primitives share |
|
|
1237
|
+
|
|
1238
|
+
The records are `routes[]` beside `records[]` in `.x/exercise.json` and `--json`: `{ kind: 'route',
|
|
1239
|
+
name, file, outcome, reason?, statements, effects, ms, statementCeiling?, plans?, scale?, proofMs? }`.
|
|
1240
|
+
Every finding on them is a **warning line**, never red — no floor key opts a page read in yet — and a
|
|
1241
|
+
load that could not run says why: `route /settings (…/page.tsx) · load not exercised: <reason>`.
|
|
1242
|
+
Measured on the tracked apps: docs-site 3 of 3 loads ran, the demo 6 of 10; the reference app's 7
|
|
1243
|
+
report `load not exercised` — a load that calls the app's own API needs an origin the pass does not
|
|
1244
|
+
serve yet, and one reads a member fact its actor does not carry.
|
|
1245
|
+
|
|
1246
|
+
**A primitive reached with nothing to prove** — no statement, no effect — has vacuous proofs (a
|
|
1247
|
+
sweep of nothing is `flat`). On a whole pass one warning line names the first five:
|
|
1248
|
+
`X_EXERCISE_EMPTY_REACH`, fixed in `apps/web/exercise.ts` with an input that reaches the work, or
|
|
1249
|
+
`{ off: '<why>' }`.
|
|
1250
|
+
|
|
1187
1251
|
### The floor: `unprovenMax` and `statementsMax`
|
|
1188
1252
|
|
|
1189
1253
|
What is red is `x.verify.json`'s call ([Configuration](Configuration#the-gates-file--xverifyjson)):
|
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
|
@@ -270,6 +270,16 @@ 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 |
|
|
279
|
+
| the admin's search box, a list's `contains` filter and a reference lookup now ignore case (**31.18.0**). Each is the entity's own `contains`, a bound `ilike`, so `acme` finds `Acme Ltd`. A `contains` your app DECLARES, in `rows` or in a scope's `where`, is unchanged: still case-sensitive on the read and the write, because a row scope is authorization | nothing. On a large table, serve the search with a trigram index on the searched column: `indexes: [{ on: ['title'], using: 'gin', operatorClass: 'gin_trgm_ops' }]` on the entity, then `x db gen` (the plan sweep's `X_QUERY_UNINDEXED` names the column) |
|
|
280
|
+
| a hand-written `AdminRepo` receives `caseSensitive: true` on each `contains` filter the app declared (`rows`, a scope's `where`), and a bare `contains` from what an operator typed (**31.18.0**). The admin's search also reads up to four resources at once instead of one after another | nothing for `adminRepoFor`. A custom repo that compiles `contains` itself: keep the exact, case-sensitive match where `filter.caseSensitive === true`, and fold case otherwise to match the entity repo. A custom repo must already allow concurrent reads, which every pool does |
|
|
281
|
+
| the framework's Helm chart (`docker/helm`) and `x new`'s chart request less memory for web and worker and more for the scheduler (**31.18.0**): web 256Mi → 128Mi, worker 256Mi → 160Mi, scheduler 128Mi → 160Mi. These are measured idle plus headroom. Limits are unchanged | nothing. To keep the old requests on the framework's chart: `--set roles.web.resources.requests.memory=256Mi` (and `roles.worker…`/`roles.scheduler…`). An app chart `x new` wrote keeps its own values until you edit them |
|
|
282
|
+
| the chart has six new alert rules (**31.18.0**): `UltimateErrorBudgetFastBurn` / `UltimateErrorBudgetSlowBurn` against `alerts.objective` (default 99.9), plus `UltimateJobFailures`, `UltimatePoolSaturated`, `UltimateEventLoopLag` and `UltimateMemoryNearLimit`. It also has an opt-in Grafana dashboard (`dashboard.enabled: false`). Every process on a memory-limited container now emits `process_memory_limit_bytes` | nothing; an older app chart keeps its rules. To adopt the new rules: `x g chart-alerts --force`. To add the dashboard: `x g chart-dashboard`, then set `dashboard.enabled: true` where a Grafana sidecar runs. `x doctor` lists the dashboard files while the chart lacks them. To disable one rule: `alerts: { rules: { UltimateEventLoopLag: { enabled: false } } }` |
|
|
273
283
|
|
|
274
284
|
## 29.x → 30.0.0, entry by entry
|
|
275
285
|
|