@ultimat3/cli 31.22.3 → 31.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +4 -3
- package/package.json +29 -29
- package/src/cmd-db-recount.ts +81 -24
- package/src/cmd-db-spec.ts +9 -1
- package/src/cmd-db.ts +1 -0
- package/src/cmd-doctor.ts +7 -1
- package/src/db-generate.ts +14 -3
- package/src/doctor-guards.ts +5 -3
- package/src/doctor-redundant-indexes.ts +76 -0
- package/src/fix-sequence.ts +0 -1
- package/src/messages.ts +3 -0
- package/src/redundant-indexes.ts +101 -0
- package/src/retained-assets-boot.ts +38 -5
- package/src/retained-assets-warned.ts +76 -0
- package/src/role-start.ts +13 -0
- package/src/runtime-boot-warnings.ts +65 -0
- package/src/runtime-cache.ts +14 -8
- package/src/schema-drift.ts +5 -2
- package/src/serve-boot-warnings.ts +9 -8
- package/src/serve.ts +4 -1
- package/src/templates/guard-error-declared.ts +48 -11
- package/src/templates/guard-repo-unbounded.ts +29 -13
- package/src/templates/scaffold-guards.ts +26 -3
- package/wiki/Actions.md +1 -0
- package/wiki/CLI-Reference.md +4 -1
- package/wiki/Entities-And-Migrations.md +6 -2
- package/wiki/Jobs-And-Workflows.md +3 -1
- package/wiki/Migrations-And-Backfills.md +1 -1
- package/wiki/Observability.md +4 -1
- package/wiki/Outbound-HTTP.md +40 -0
- package/wiki/Policies-And-Authz.md +52 -20
- package/wiki/Realtime.md +1 -0
- package/wiki/Stability.md +1 -1
- package/wiki/Testing.md +1 -0
- package/wiki/Upgrading.md +2 -0
package/wiki/CLI-Reference.md
CHANGED
|
@@ -479,7 +479,7 @@ x db gen "add publish_at" | migrate | reset | studio
|
|
|
479
479
|
| `backfill --pending` | every backfill the app **declared**, minus the ones that completed | the alarm: a sweep merged and never enqueued had no ledger row and was invisible everywhere. **Non-zero exit** when anything is unswept, so a cron reads the code and not the table |
|
|
480
480
|
| `backfill <name>` / `backfill --all` | gate one sweep (or every pending one) and enqueue it | **dry run by default** — `--write` is never implied. `--write` enqueues; the workers perform the pass, because the queue is a job's execution surface. `--all` isolates per name and continues past a failure, exiting non-zero naming each |
|
|
481
481
|
| `diagnostics` | what the database is doing now: `blockers` (each waiting `pid` and the `blockedBy` pid holding it, at `data.blockers.rows[]`), `activity`, `slowQueries`, `unusedIndexes`, `invalidIndexes`, `notValidConstraints`, `deadTuples` | **facts, never a verdict: exit 0** whatever they say. The one failure is a connection that never opens, `X_DB_UNAVAILABLE`. Every section is one catalog read in its own `BEGIN READ ONLY` with a 2 s `statement_timeout`, capped at `--limit` rows (default 20, at most 1000). A section that fails is `{ available: false, code, reason, fix }` in place and the other six still answer; `slowQueries` is unavailable until an operator installs `pg_stat_statements` (never on the embedded database). No user table is read; session SQL is printed with every literal as `?`; a credential in a reason is masked. **Whoever runs it sees the redacted SQL of every session on the app's database role** (every role, when it holds `pg_read_all_stats`): statement shape and identifiers, never values. `unusedIndexes` skips unique and primary indexes and carries `statsAgeSeconds` and `replica`. Opens the database without applying the framework tables; an embedded one `x dev` holds is refused (`X_DEV_ALREADY_RUNNING`). `--json`: `data.<section>`. Arbitrary read-only SQL is `db.query` over [`x mcp serve`](MCP-And-AI) |
|
|
482
|
-
| `recount <entity>.<column>` | compare a `countedIn` counter with the true count of its child rows | **dry run by default**: lists the drifted rows (at most 50, the count whole) and exits non-zero with `X_LIFECYCLE_TRIGGER_MISSING` when any drifted.
|
|
482
|
+
| `recount <entity>.<column>` | compare a `countedIn` counter with the true count of its child rows | **dry run by default**: lists the drifted rows (at most 50, the count whole) and exits non-zero with `X_LIFECYCLE_TRIGGER_MISSING` when any drifted. The parent is walked in windows of 1,000 keys, in key order, each window one cross-tenant transaction (`As of 31.23`). `--write` repairs each window's drift inside its transaction and exits 0. An unknown `<entity>.<column>` is `X_CLI_BAD_FLAG`. `--json`: `data` = `{ target, write, drifted, batches, rows }` |
|
|
483
483
|
|
|
484
484
|
A bare `x db backfill` is `X_CLI_BAD_FLAG` naming a shape that works: the four answer four different questions, and defaulting to one of them is the ambiguity axiom 1 refuses.
|
|
485
485
|
|
|
@@ -524,6 +524,7 @@ Two more facts about the set, both `As of 2026-08`:
|
|
|
524
524
|
|---|---|---|---|
|
|
525
525
|
| `--name` | string | — | migration or branch name, or the backfill to filter the ledger by. Under `backfill --list` it is the **only** spelling of that filter: a positional there is a pass target in every other shape and is refused with `X_CLI_BAD_FLAG` rather than silently dropped |
|
|
526
526
|
| `--allow-destructive` | boolean | `false` | let `gen` emit a DROP whose `down` cannot restore the rows. `X_MIGRATION_IRREVERSIBLE`'s own `fix:` line names it |
|
|
527
|
+
| `--drop-redundant` | boolean | `false` | `gen`: leave out of the diff each implicit index (a column's own, from `.references()` or `.index()`) that another index, the primary key or a unique invariant already leads with, so the migration drops it `concurrently` in a non-transactional step you review. Never a default; once dropped, a plain `x db gen` does not rebuild it. A table with no migration yet keeps every index. `x doctor` lists what it would drop (`data.redundantIndexes`), `As of 2026-11-14` |
|
|
527
528
|
| `--list` | boolean | `false` | `backfill`: print the ledger |
|
|
528
529
|
| `--pending` | boolean | `false` | `backfill`: declared minus completed, judged in this `ULTIMATE_ENV`. Non-zero exit when anything is unswept |
|
|
529
530
|
| `--all` | boolean | `false` | `backfill`: every pending sweep, isolated per name |
|
|
@@ -1256,6 +1257,8 @@ Four warnings about how the app is held, `As of 31.16.0` (a fifth, `X_SHIPPED_GU
|
|
|
1256
1257
|
| `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` |
|
|
1257
1258
|
| `X_SHIPPED_GUARD_MISSING` (`As of 31.22`) | a guard `x new` ships is not in the app's `guards/`, so the gate does not hold the app to that rule — one per guard | `x g guard <name> && x verify --only boundaries --json` |
|
|
1258
1259
|
|
|
1260
|
+
**Redundant indexes**, the same way (`As of 2026-11-14`): each implicit index the entities describe that another index, the primary key or a unique invariant already leads with, still in the newest migration's snapshot, is one line — `<table>.<index> (<columns>) — <covering index>` — under a header naming `x db gen "drop redundant indexes" --drop-redundant`; `--json`: `data.redundantIndexes[]` = `{ table, name, columns, coveredBy }`, `[]` when none, absent when the app would not load or has no snapshot. A listing, never a finding: every write pays for each twice, and dropping it is a migration the app opts into.
|
|
1261
|
+
|
|
1259
1262
|
**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 }`). The dashboard is its own row: no `dashboards/ultimate-app.json` or `templates/dashboard-configmap.yaml` lists them, then `x g chart-dashboard` (`data.chartDashboard`, the same shape). A chart that dropped them on purpose keeps a green verdict; an app with no chart is listed nothing.
|
|
1260
1263
|
|
|
1261
1264
|
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.
|
|
@@ -65,6 +65,7 @@ The entity name is the first argument. Everything else is the init object:
|
|
|
65
65
|
| `table` | the physical table, when it is not the entity's own name. For a schema this framework did not generate — see [Adopting an existing database](#adopting-an-existing-database) |
|
|
66
66
|
| `tenant` | the tenant column. Omitted, it is inferred from `.tenant()` or a column named `orgId` — silence never means unscoped |
|
|
67
67
|
| `shared` | `'<why its rows belong to no tenant>'` — for an entity with no tenant column whose references reach one that has a tenant (a price list every org's subscriptions point at). Without it the `exercise` step reports `X_ENTITY_TENANT_UNDECLARED`; blank is refused at `entity()` with the same code, and beside a tenant column it is `X_INVARIANT_VIOLATED`. See [Policies and authz](Policies-And-Authz#the-static-tenant-check) |
|
|
68
|
+
| `global` | `'<why every tenant reads the same rows>'` — for an entity with no tenant column that references none (a plan catalog), `As of 2026-11-14`. A query reading only global entities is the tenant proof's `global` verdict, not `unproven`; projected on `$describe().global`. Blank is `X_ENTITY_TENANT_UNDECLARED`; beside a tenant column, or beside `shared`, `X_INVARIANT_VIOLATED`. See [Policies and authz](Policies-And-Authz#the-dynamic-tenant-proof) |
|
|
68
69
|
| `scan` | `'<why it stays small>'` — a bounded table (`'a closed catalog of 8 rows'`) the `exercise` step's plan sweep may see read whole. Without it a sequential scan of it is `X_QUERY_UNINDEXED`; blank is `X_INVARIANT_VIOLATED`. See [Testing](Testing#the-plan-and-scale-sweeps) |
|
|
69
70
|
| `invariants` | `(c) => [invariant(name, expr), …]` — named predicates enforced on write, projected to a CHECK or UNIQUE constraint where expressible. `c` is typed from `columns`, so a typo is a compile error |
|
|
70
71
|
| `indexes` | composite and partial indexes; a single unique or indexed column declares it on the column instead. On a table that already exists `x db gen` builds it with `create index concurrently` by default (`As of 2026-11`), in a migration of its own, outside a transaction; `concurrently: false` is the plain build, marked `-- lock-heavy: true` ([Indexes built concurrently](Migrations-And-Backfills#indexes-built-concurrently--expand--contract)). Key parts — `expression`, `orders`, `include`, `operatorClass` — under [Index key parts](#index-key-parts) |
|
|
@@ -456,7 +457,8 @@ export async function feed(orgId: string, after: string | null) {
|
|
|
456
457
|
| The plan | `order by` stays on the bare columns: an index on `(created_at desc, id desc)` answers it as an Index Only Scan. `date_trunc('milliseconds', …)` measured 100 ms against 0.2 ms on 300,000 rows |
|
|
457
458
|
| Kinds | `timestamptz`, `uuid`, `text`, `integer`, `bigint` |
|
|
458
459
|
| Directions | all one way: a row comparison. Mixed: the or-chain |
|
|
459
|
-
| A
|
|
460
|
+
| A nullable key | `As of 2026-11-14`: declare it — `{ column: raw('p.published_at'), kind: 'timestamptz', direction: 'desc', nullable: true }`. NULL's place is written into `order by` (`nulls: 'first' \| 'last'`; default `asc nulls last`, `desc nulls first`, the entity driver's), the cursor carries present/absent, and the seek is the or-chain. The last key stays not null |
|
|
461
|
+
| A null key | on a key not declared `nullable`, `X_KEYSET_NULL_KEY` on any row of the page: a row comparison has no null order. A nullable last key is the same code, at `keyset()` |
|
|
460
462
|
| A cursor from another read | `X_CURSOR_INVALID`. The scope is yours plus the keys: the same scope under another sort is refused too |
|
|
461
463
|
| Memory | none: raw SQL has no memory path. Test it on the migrated database |
|
|
462
464
|
|
|
@@ -1258,6 +1260,7 @@ Three declarations on the entity, each compiled to a trigger or a purge target,
|
|
|
1258
1260
|
| `retain: { after: '90d', on: 'createdAt' }` | a `PurgeTarget` per entity — batched, cross-tenant `delete … where created_at < now - after` | no window (`X_ENTITY_RETAIN_INVALID`), `on` not an indexed `timestamp()` (`X_ENTITY_RETAIN_UNINDEXED`), beside `appendOnly`, or on a table the catalog holds partitioned (drift, `X_ENTITY_RETAIN_INVALID`: detach partitions in a `task`) |
|
|
1259
1261
|
| `history: true` · `history: { retain: { after: '365d' }, ignore: ['likeCount', 'updatedAt'] }` | `<table>_history (id, <tenant>, row_id, op, at, actor_id, request_id, before, after)` — a registered entity (`posts.$history`), written by the `ultimate_history` trigger, guarded by `ultimate_history_guard` | a composite primary key, `appendOnly` (`X_INVARIANT_VIOLATED`) |
|
|
1260
1262
|
| `references(() => posts.id, { countedIn: () => posts.likeCount })` | a trigger on the child moving `posts.like_count` by one in the write's own transaction | the column is no `integer()`, or the key points at no single primary key (`X_ENTITY_COUNTS_INVALID`) |
|
|
1263
|
+
| `countedIn: { to: () => posts.upCount, where: (): Expr => whereColumns(likes).kind.eq('up') }` | the same trigger, counting only the child rows the predicate holds over — compiled once into its condition, its `update of` list and the recount | the predicate has no SQL (a function in `matches`/`satisfies`), or names no column of the child (`X_ENTITY_COUNTS_INVALID`) |
|
|
1261
1264
|
|
|
1262
1265
|
```ts
|
|
1263
1266
|
import { entity, integer, timestamp, uuid } from '@ultimat3/entity';
|
|
@@ -1280,7 +1283,8 @@ export const likes = entity('likes', {
|
|
|
1280
1283
|
- **Retention is a promise `x verify` checks.** A `retain` no `purge()` covers is `X_ENTITY_RETAIN_UNSWEPT` in the `manifest` step. `purge({ entities: 'declared' })` covers every one, history tables included, and needs no line per entity.
|
|
1281
1284
|
- **History is recorded by trigger**, so `updateWhere`, a cascade and raw SQL are recorded too. An update that changes nothing records nothing; a change to a counted column, or to columns `history: { ignore }` names, alone records nothing — on both drivers (`history-ignore.test.ts`). `ignore` takes the entity's own columns, typed; another name is `X_INVARIANT_VIOLATED`. Declaring it changes the trigger's arguments, so `x db gen` writes the migration that reinstalls it. `.sealed()` columns stay ciphertext in the images. `actor_id`/`request_id` are what the WRITE'S transaction set (`x.actor`, `x.request`): the repository sets them before its first write to a history entity inside a transaction; an autocommit write records `null`, never a guess. Update of a history row is refused always; delete only under `x.purge` naming that table, which the retention sweep and a subject erase set (`X_ENTITY_APPEND_ONLY`, SQLSTATE `23001`). Reading it is an ordinary, tenant-scoped, cursor-paged read: `database({ posts, postsHistory: posts.$history })`.
|
|
1282
1285
|
- **One row's history is `history(db.postsHistory, id)`**: every version, oldest first, each numbered `version` from 1 — ordered by chaining each `before` onto the previous `after` across every version, `at` only breaking ties: `at` is the transaction's START, so a transaction that began first and committed last carries the earlier `at` and the later image. `history(table, id, { limit: n })` reads the `n` versions with the latest `at` (ties at the edge kept), numbered as the whole history numbers them — chosen by transaction start, so a transaction that began before that window and committed inside it can fall outside. The read is the history table's, so another tenant's row reads back `[]`; the policy is the query or action that calls it. `version` counts what is retained: after a `retain` sweep, 1 is the oldest kept. As of 31.3.
|
|
1283
|
-
- **A counter locks its parent row.** A hot parent serializes its writers; where that matters, `countBy` plus a cache is the alternative. A soft-deleted child is not counted. A new counter's migration recounts once, so an existing table starts true; `x db recount posts.likeCount` reports drift and `--write` repairs it.
|
|
1286
|
+
- **A counter locks its parent row.** A hot parent serializes its writers; where that matters, `countBy` plus a cache is the alternative. A soft-deleted child is not counted. A new counter's migration recounts once, so an existing table starts true; `x db recount posts.likeCount` reports drift and `--write` repairs it, in key-range batches.
|
|
1287
|
+
- **A counter's `where` is the invariant language over the CHILD**, built from `whereColumns(<child>)` — a thunk, like `to`, so it is typed by the child's own columns. Annotate it `(): Expr =>` (`import type { Expr } from '@ultimat3/entity'`): the child names itself inside its own declaration, and without the return type TypeScript reports the cycle (TS7022). A NULL operand is not counted, as a SQL `where` decides it; memory decides it the same way (`counter-where.test.ts`). Changing the predicate reinstalls the trigger and recounts in the same migration. The bare `countedIn: () => col` form is unchanged. As of 31.23.
|
|
1284
1288
|
- **A counter's write is reported as the parent's change.** The WAL replicator sees the trigger's write; the in-process `entity.row` event (what `x dev` on PGlite and the memory driver feed live queries from) reports it too: after a child write, while `entity.row` has a subscriber, the parents whose count moved are read back in the write's transaction and each is an `update` at COMMIT, `before` the row with the count moved back. A filtered write (`deleteWhere`, `updateWhere`, a chain's `deleteAll`/`updateAll`) pinned to one parent by its key reports that row with `before: null`; one spanning parents is `entity.bulk` for the parent table. With no subscriber, nothing is read. So a live count needs no recount in the mutator (`counter-observed.test.ts`). As of 2026-11.
|
|
1285
1289
|
- **An erase reaches history.** A parent `subjectErase()` deletes or anonymizes writes the person into a before image, so its `<table>_history` needs a line in `defineSubject({ tables })`: `'delete'` removes every image of those rows in the parent's own transaction — under `x.purge` on Postgres, under `purgingHistory(table, work)` in memory, the one delete each lets through — `{ retain: '<why>' }` keeps them, `anonymize` is refused. An undeclared one is `X_SUBJECT_TABLE_UNDECLARED`, an `anonymize` `X_SUBJECT_TREATMENT_INVALID`; images written before an upgrade are reached only by the next erase of that subject ([Jobs and workflows](Jobs-And-Workflows#one-persons-data--subjectexport-and-subjecterase)). As of 2026-11.
|
|
1286
1290
|
- **Memory answers as Postgres does**: the memory driver records history and moves counters in its repository (`counter.test.ts`, `history.test.ts` are the parity tables).
|
|
@@ -246,6 +246,7 @@ export const syncCrm = job({
|
|
|
246
246
|
| a **`terminal`** thrown code | stops on the attempt that failed, before `attempts` is reached — the same code run again is the same answer, and the attempts left are a queue slot, a provider bill, or three more wrong passwords at a site that locks the account after three. `lastError` records `— not retried: this code is classified terminal`, so an early stop is never silent | the code's `retry` classification, `registerErrorRetry({ X_YOUR_CODE: 'terminal' })`. An **unclassified** code is unaffected |
|
|
247
247
|
| a **`retry-after`** thrown code | the responder's `meta.retryAfterSeconds` replaces the delay, clamped by `maxDelay` — never the attempt count | same |
|
|
248
248
|
| attempts exhausted | moves to dead-letter with the full step trace | `x jobs retry <id>` replays from the failed step |
|
|
249
|
+
| `retry.report` | what reaches the error tracker. `'dead-letter'` (default): only an attempt nobody recovered from, once, as `error`; a retry is counted on `jobs_retried_total{job,code}` and never pages. `'every-attempt'`: each retried attempt is reported too, as `warning` — for the job whose first failure already needs a human. Per job, never a global switch (`As of 2026-11-14`) | `executeJob` (`execute-report.ts`) |
|
|
249
250
|
|
|
250
251
|
A job over a tenant, queue or global cap, or over a `'wait'` concurrency cap, is **deferred, never dropped** — it stays queued with a later `runAt`. `whenBusy: 'fail'` is the one declared exception. `'wait'` holds the cap and states no order: a later enqueue can start first.
|
|
251
252
|
|
|
@@ -873,7 +874,8 @@ Draining a worker mid-job does **not** finish the current step (`As of 2026-09-0
|
|
|
873
874
|
| `x db backfill --list --json` | the whole ledger: one row per pass, newest first → [CLI reference](CLI-Reference#x-db) |
|
|
874
875
|
| MCP dev tools | `jobs.inspect` (definitions, retry policy, steps) and `queue.depth` (pending/running/failed per queue) — scope `dev:read`, never reachable in `ROLE=web` |
|
|
875
876
|
| OpenTelemetry | one span per job, one child span per step, trace linked to the enqueuing request |
|
|
876
|
-
| Metrics | `queue_depth{queue}`, `queue_demand{queue}` (what the worker HPA reads), `jobs_total{queue,outcome}`, `job_leases_lost_total{queue}` → [Observability](Observability) |
|
|
877
|
+
| Metrics | `queue_depth{queue}`, `queue_demand{queue}` (what the worker HPA reads), `jobs_total{queue,outcome}`, `jobs_retried_total{job,code}` (one per retried attempt; `code` is the thrown `X_*`, or `uncoded`), `job_leases_lost_total{queue}` → [Observability](Observability) |
|
|
878
|
+
| Loop failures | a database restart fails every tick: one line opens the streak, one closes it with the count — `jobs.scheduler.tick-failed` / `-recovered`, `jobs.worker.tick-failed` / `-recovered`, `jobs.outbox.tick-failed` / `-recovered` |
|
|
877
879
|
|
|
878
880
|
Every command supports `--json`. See [CLI reference](CLI-Reference).
|
|
879
881
|
|
|
@@ -537,7 +537,7 @@ Position in the plan is **necessary and not sufficient**: `docker compose up -d`
|
|
|
537
537
|
|
|
538
538
|
### `x db recount` — a counter, repaired
|
|
539
539
|
|
|
540
|
-
`x db recount <entity>.<column>` compares a `countedIn` counter with the count of child rows and lists the drifted rows; `--write` sets them
|
|
540
|
+
`x db recount <entity>.<column>` compares a `countedIn` counter with the count of child rows — under its `where`, when it declares one — and lists the drifted rows; `--write` sets them. A counter drifts only while its trigger was missing (`X_LIFECYCLE_TRIGGER_MISSING`). The parent is walked in key-range windows of 1,000 rows, one cross-tenant transaction each, so a big table never holds one long lock; the dry run reads the same windows and writes nothing. Batched in the command itself, not through `backfill()`: that factory declares a job for a worker, and a recount names its counter at run time. As of 31.23.
|
|
541
541
|
|
|
542
542
|
### `x g backfill` — the generator
|
|
543
543
|
|
package/wiki/Observability.md
CHANGED
|
@@ -209,7 +209,9 @@ Declared in `runtime-metrics.ts`, so the role table, the Helm chart and the scra
|
|
|
209
209
|
|
|
210
210
|
Recorders: `recordRequest({ method, route, status, durationMs })`, `recordConnection(delta)`, `recordQueueDepth(queue, depth)`, `recordJob(queue, outcome)`, `recordLeaseLost(queue)`.
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
Beside them, `@ultimat3/jobs` declares its own: `jobs_retried_total{job,code}` (counter, `{attempt}`) — one per attempt that failed and went back to the queue, `code` the thrown `X_*` or `uncoded`. A retry is counted there and **not** sent to the `ErrorReporter`; a dead letter is, once, as `error`. A job opts its retries into the reporter, as `warning`, with `retry: { report: 'every-attempt' }` ([Jobs](Jobs-And-Workflows#concurrency-rate-limits-queues-retry)). A polling loop that fails every tick logs one line when the streak opens and one with the count when it closes: `jobs.{scheduler,worker,outbox}.tick-failed` / `.tick-recovered`, `db.listen.redial_failed` / `db.listen.redialed`, `jobs.wake.{listen,probe}-failed` / `-recovered`, and `cache.broadcast.deferred-failed` / `-recovered` — core's `failureStreak` (`@ultimat3/core`), one line per cause, for a loop of your own.
|
|
213
|
+
|
|
214
|
+
All five recorders are wired `As of 2026-08`, each in the package that owns the event:
|
|
213
215
|
|
|
214
216
|
| Recorder | Called from | Note |
|
|
215
217
|
|---|---|---|
|
|
@@ -276,6 +278,7 @@ CPU autoscaling is wrong for `sync` and `worker`: a node holding 80k idle socket
|
|
|
276
278
|
| 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` |
|
|
277
279
|
| 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`) |
|
|
278
280
|
| Secret redaction | a `Secret` is redacted by value before every other branch, at any depth → [Configuration](Configuration) |
|
|
281
|
+
| Value redaction | `redactValues([{ pattern: /acct_[0-9]{10}/g, replace: '[account]' }])`, once at boot (`As of 2026-11`): every match is rewritten in the log line's message and field strings, an `Error`'s message, and the monitor envelope's exception value, `fix`, `stack`, extras and `meta`, a span's exception event and status message, and a failure bundle's captured values. Key redaction (`redactKeys`) cannot see a value inside a message; this can. The `g` flag is required; a sticky pattern, one matching the empty string, or a repeated group holding a repeating quantifier (`(a+)+`, `(a+){2,40}`; only `?`/`{0,1}` do not repeat) is refused with `X_REDACT_PATTERN_UNSAFE`, and the whole list with it. Appends, like `redactKeys`; the framework registers no pattern |
|
|
279
282
|
| Request context | the ALS context carries the request id every log line and span inherits |
|
|
280
283
|
| 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 |
|
|
281
284
|
| Request span name | `GET /r/:token` — the route PATTERN, never the concrete URL (a token in a path would reach every collector); `http.route` carries the same pattern, and an unmatched request is named by its method alone with `http.route: unmatched` (`As of 22.6.0`) |
|
package/wiki/Outbound-HTTP.md
CHANGED
|
@@ -45,6 +45,45 @@ Required, a decision per call.
|
|
|
45
45
|
| `'named'` | a host the app names in code or config: a vendor API, a sidecar | dialled as written |
|
|
46
46
|
| `'public'` | a URL a tenant or a user supplied | https only outside a local environment, no URL credentials, every address the name answers must be public, the connection pinned to the approved address with `tls.serverName`. Refusal: `X_OUTBOUND_HOST_BLOCKED` |
|
|
47
47
|
|
|
48
|
+
**Writing your own public-dial guard is the bug this option exists to prevent.** A URL a tenant
|
|
49
|
+
supplied (a webhook, an avatar, a feed) is `dial: 'public'`: resolve, classify every address, pin,
|
|
50
|
+
re-screen each redirect. All of it is in this one option.
|
|
51
|
+
|
|
52
|
+
## `proxy`: send the call through an HTTP proxy
|
|
53
|
+
|
|
54
|
+
| Form | What happens |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `proxy: 'http://user:pass@proxy:3128'` (or a `URL`) | every hop goes through it: `CONNECT` for `https:`, an absolute-form request for `http:` |
|
|
57
|
+
| `proxy: { url, headers }` | the same, `headers` sent on the `CONNECT` (`proxy-authorization: Bearer …`) |
|
|
58
|
+
| `proxy: (target) => … \| undefined` | asked once per hop with that hop's NAMED url (never the pinned address); `undefined` dials the hop direct. May be async, and is bounded by `deadlineMs` |
|
|
59
|
+
|
|
60
|
+
- **Beside `dial: 'public'`, the screen still runs FIRST.** A refused host never reaches the proxy or
|
|
61
|
+
your resolver; an approved one is tunnelled to the screened ADDRESS (`CONNECT 93.184.216.34:443`),
|
|
62
|
+
so the proxy resolves nothing itself. `tls.serverName` survives the tunnel: the certificate is
|
|
63
|
+
still proven against the name (measured on Bun 1.4.4, `outbound-proxy-tunnel.test.ts`).
|
|
64
|
+
- **The proxy is the app's own choice**, like a `'named'` host: it is not screened.
|
|
65
|
+
- `http:` and `https:` proxies only. Anything else, or a resolver that throws, is
|
|
66
|
+
`X_OUTBOUND_PROXY_INVALID` before a byte, never retried.
|
|
67
|
+
- **The proxy's credential is in no cause, log line, span or event**: URL userinfo is cut from a
|
|
68
|
+
transport's message (`//…@`), and the proxy is never recorded.
|
|
69
|
+
- With no `proxy`, Bun's own `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY` still apply, as for any `fetch`.
|
|
70
|
+
- **Which proxy, and rotating them, is app code** (axiom 8): a resolver over your own inventory.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { outbound } from '@ultimat3/core/outbound';
|
|
74
|
+
|
|
75
|
+
declare const url: string;
|
|
76
|
+
const proxies = ['http://u:p@egress-a:3128', 'http://u:p@egress-b:3128'];
|
|
77
|
+
let next = 0;
|
|
78
|
+
await outbound({
|
|
79
|
+
url,
|
|
80
|
+
vendor: 'feed',
|
|
81
|
+
dial: 'public',
|
|
82
|
+
deadlineMs: 10_000,
|
|
83
|
+
proxy: () => proxies[next++ % proxies.length],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
48
87
|
`screenDial(url, { resolve, allowPrivate })` is the screen alone, for a transport that keeps its own
|
|
49
88
|
codes: `@ultimat3/jobs`' webhook target and `@ultimat3/scraping`'s wildcard leg call it.
|
|
50
89
|
|
|
@@ -62,6 +101,7 @@ codes: `@ultimat3/jobs`' webhook target and `@ultimat3/scraping`'s wildcard leg
|
|
|
62
101
|
| `X_OUTBOUND_REDIRECTED` | terminal | a 3xx under `redirect: 'error'`, or more than 5 hops (`meta.location`, no query) |
|
|
63
102
|
| `X_OUTBOUND_RETRY_UNSAFE` | terminal | `retry` on POST or PATCH without `idempotent: true` |
|
|
64
103
|
| `X_OUTBOUND_BODY_INVALID` | terminal | `answer.json(schema)` refused the body (`meta.issues`) |
|
|
104
|
+
| `X_OUTBOUND_PROXY_INVALID` | terminal | `proxy` is not an `http:`/`https:` URL, or its resolver threw (`meta.reason`, never the URL) |
|
|
65
105
|
|
|
66
106
|
**A 401 is `X_OUTBOUND_REFUSED` with `meta.status: 401`.** There is no refresh hook: the app's own
|
|
67
107
|
wrapper refreshes its token and calls again. Token storage and single-flight stay the app's.
|
|
@@ -119,17 +119,17 @@ The matrix runs **outside a request**: no input, no row. A rule that reads eithe
|
|
|
119
119
|
## Scope — a policy's database filter
|
|
120
120
|
|
|
121
121
|
`scoped(policy, scope)` attaches `scope(actor) → where` to a policy, `As of 2026-11`: the
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
before; the JS rule stays the authority.
|
|
122
|
+
predicate a read hands the database, so the visible rows arrive as ONE statement's page rather than
|
|
123
|
+
a JS filter over an over-fetch that leaves a viewer a short page. The policy decides exactly as
|
|
124
|
+
before; the JS rule stays the authority and still runs on every row returned.
|
|
125
125
|
|
|
126
126
|
```ts
|
|
127
127
|
import type { Actor, Policy } from '@ultimat3/policy';
|
|
128
128
|
import { policyScope, scoped } from '@ultimat3/policy';
|
|
129
129
|
|
|
130
130
|
interface Post {
|
|
131
|
-
readonly
|
|
132
|
-
readonly audience: 'public' | '
|
|
131
|
+
readonly authorId: string;
|
|
132
|
+
readonly audience: 'public' | 'friends';
|
|
133
133
|
}
|
|
134
134
|
declare const postRule: Policy<unknown, Post>;
|
|
135
135
|
declare const actor: Actor | null;
|
|
@@ -137,34 +137,64 @@ declare const actor: Actor | null;
|
|
|
137
137
|
export const seePost = scoped(postRule, (who) =>
|
|
138
138
|
who === null
|
|
139
139
|
? [{ column: 'audience', op: 'eq', value: 'public' }]
|
|
140
|
-
: [
|
|
140
|
+
: [
|
|
141
|
+
{
|
|
142
|
+
or: [
|
|
143
|
+
{ column: 'authorId', op: 'eq', value: who.id },
|
|
144
|
+
{ column: 'audience', op: 'eq', value: 'public' },
|
|
145
|
+
{
|
|
146
|
+
and: [
|
|
147
|
+
{ column: 'audience', op: 'eq', value: 'friends' },
|
|
148
|
+
{
|
|
149
|
+
via: { column: 'authorId', entity: 'friendships', target: 'friendId' },
|
|
150
|
+
where: [{ column: 'userId', op: 'eq', value: who.id }],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
],
|
|
141
157
|
);
|
|
142
|
-
policyScope(seePost, actor); // the frozen
|
|
158
|
+
policyScope(seePost, actor); // the tree, frozen at every depth, or undefined for an unscoped policy
|
|
143
159
|
```
|
|
144
160
|
|
|
161
|
+
| Node | Means |
|
|
162
|
+
|---|---|
|
|
163
|
+
| `{ column, op, value? }` | a condition. `column` is typed by the policy's row; `op` is one of `eq` `neq` `in` `gt` `gte` `lt` `lte` `is-null` `is-not-null`; `value` is always bound |
|
|
164
|
+
| `{ or: [...] }` | any member holds; `[]` holds for no row |
|
|
165
|
+
| `{ and: [...] }` | every member holds — the arm of an `or` that needs two conditions |
|
|
166
|
+
| `{ via: { column, entity, target }, where: [...] }` | `column in (select target from entity where …)`; `entity` is a registered entity NAME |
|
|
167
|
+
|
|
145
168
|
| `policyScope(policy, actor)` answers | Means |
|
|
146
169
|
|---|---|
|
|
147
170
|
| `undefined` | no scope declared: nothing is handed down |
|
|
148
171
|
| `[]` | every row (an admin): the empty conjunction |
|
|
149
|
-
| `[
|
|
150
|
-
|
|
172
|
+
| `[node, …]` | every top-level node must hold; at most four levels deep (`X_ENTITY_PREDICATE_NODE_INVALID`) |
|
|
173
|
+
|
|
174
|
+
- **One statement.** `@ultimat3/entity`'s `.andWhereNode(node)` takes the tree on a repository
|
|
175
|
+
chain — `db.posts.where({ deletedAt: null }).andWhereNode(node)` — and compiles it into the one
|
|
176
|
+
select, a `via` as a subselect.
|
|
177
|
+
- **A `via` cannot cross tenants.** Its subselect is planned through the TARGET's tenant guard, the
|
|
178
|
+
acting actor's tenant and the target's soft delete applied inside; outside a request its `where`
|
|
179
|
+
must name the tenant, as a read of that table must. An untenanted target behind a tenanted source
|
|
180
|
+
must declare `shared:` or `global:`, else `X_TENANCY_UNSCOPED`.
|
|
181
|
+
- **A query read composes it**, `As of 31.11.0`: a `query({ policy: seePost, sql })` whose `sql`
|
|
182
|
+
returns `from()` gets each condition as a filter and each `or`/`and`/`via` node on
|
|
183
|
+
`RowWindow.nodes`, which a repository provider hands to `.andWhereNode(node)` —
|
|
184
|
+
[Queries: a scoped policy narrows the read](Queries-And-Live-Queries#a-scoped-policy-narrows-the-read).
|
|
185
|
+
Refused (`X_QUERY_SCOPE_UNCOMPOSABLE`), never served unscoped: another `SqlSource`, a tree on a live
|
|
186
|
+
read (the matcher patches a flat shape), and a `via` over `from()` given a list of rows.
|
|
187
|
+
- **A custom store** (`defineDriver`) takes a tree only when it declares `predicate:or` /
|
|
188
|
+
`predicate:via`; otherwise `X_DRIVER_UNSUPPORTED`, before the store is called.
|
|
151
189
|
- **The scope belongs to the clause it is declared on.** `and`/`or`/`not` over a scoped policy
|
|
152
190
|
carry none: the conjunction of children's scopes is not the scope of `or`. Scope the outermost
|
|
153
191
|
policy.
|
|
154
192
|
- **Tenant scoping is not scope.** Tenancy stays the entity layer's (the tenant predicate every
|
|
155
193
|
repository applies, [below](#tenancy)); a scope narrows what one actor sees inside a tenant and
|
|
156
194
|
never replaces it.
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Another `SqlSource` is `X_QUERY_SCOPE_UNCOMPOSABLE`. An action, or a repository read outside a
|
|
161
|
-
query, composes nothing: there `policyScope` is the read an app composes itself, e.g.
|
|
162
|
-
`db.posts.where({ orgId })` plus each condition as `andWhere`.
|
|
163
|
-
- **AND-only, by decision** (2026-11, `packages/policy/src/scope.ts`). A scope lands as query
|
|
164
|
-
filters, so it reaches the live matcher's shape, every provider's `RowWindow.filters` and the
|
|
165
|
-
entity chain, each a conjunction; an `or` group would widen all of them at once. A rule whose
|
|
166
|
-
visibility is a disjunction (a friend OR the author OR public, minus a block set) stays unscoped
|
|
167
|
-
and keeps the JS rule over what it reads.
|
|
195
|
+
- **`or` and `via` by decision** (2026-11, reversing the AND-only decision of earlier that month,
|
|
196
|
+
`packages/policy/src/scope.ts`): apps whose visibility is a disjunction over a graph over-fetched a
|
|
197
|
+
feed and ORed in JS — the short page `scope` exists to end.
|
|
168
198
|
- **Planned, not shipped:** a finding for a scope that admits other rows than its rule on the
|
|
169
199
|
exercise seed (`X_POLICY_SCOPE_MISMATCH`, not registered yet). Until then, a scope wider than its
|
|
170
200
|
rule costs rows the rule then drops — a short page again — and a narrower one hides rows the rule
|
|
@@ -203,6 +233,7 @@ X_ENTITY_TENANT_UNDECLARED: a child of a tenant-owned table has no tenant
|
|
|
203
233
|
|---|---|
|
|
204
234
|
| `orgId: uuid().tenant()`, then `x db gen '<table> tenant'` | the rows belong to an org. A table that already holds rows backfills the column: `x g backfill <name> --feature <slice>` |
|
|
205
235
|
| `entity('<name>', { shared: '<why>' })` | the rows belong to no org — a price list, a catalog. A blank reason is refused at `entity()`; a `shared` entity is not walked through ([Entities](Entities-And-Migrations#shape)) |
|
|
236
|
+
| `entity('<name>', { global: '<why>' })` | the rows belong to no org and reference none — a plan catalog, a stream cursor. Not a fix for this finding: a table that hangs off a tenant's row is `shared` or tenant-owned, so a `global` one with such a reference is still reported. It turns a read over it from `unproven` into `global` ([below](#the-dynamic-tenant-proof)) |
|
|
206
237
|
|
|
207
238
|
Reported in the `exercise` step, not `policy`: the policy step asks whether a permission exists. Source: `packages/cli/src/exercise-static.ts`.
|
|
208
239
|
|
|
@@ -231,6 +262,7 @@ X_TENANT_LEAK: another tenant's row reached a call's output or effect
|
|
|
231
262
|
| `public` | the policy admits an anonymous caller: what it returns, anyone may read. The read half is skipped; a crossed **write** is still red |
|
|
232
263
|
| `public`, as a declared sweep | a job that reads every org on purpose says so with `crossTenant(reason, fn)`, and its input names no org's rows. The proof sees the scope and quotes the reason; the read half is skipped, a crossed **write** is still red. The same scope in an action or a query, or in a job handed A's id, is still `X_TENANT_LEAK` |
|
|
233
264
|
| `public`, as a tenantless job | a job declaring `tenant: 'none'` whose input names none of A's rows — a nightly cleanup across every org, input `{ occurrenceMs }`. No org and no id of B's choosing reaches its run, so B's run is A's run: what it writes it writes for every enqueuer. The **write** half is skipped, the read half kept. Handed one of A's ids it is crossed as ever; an action or a query handed no id still crosses, since B's org runs it |
|
|
265
|
+
| `global` | a query whose every statement read an `entity('<name>', { global: '<why>' })` table — a plan catalog the same for every org. No row of A's exists to come back, so the reasons are quoted; a crossed **write** is still red. One other entity, or one hand-written statement, and it stays `unproven` |
|
|
234
266
|
| `unproven` | A's own call was not reached (that record is already red as `X_CONTRACT_EXERCISE_UNREACHED`), or a query answered A none of A's rows — B's empty answer then proves nothing |
|
|
235
267
|
|
|
236
268
|
B holds the role A held, minus `tenancy:cross`. **Not checked**: a `route` `load` and a `task`
|
package/wiki/Realtime.md
CHANGED
|
@@ -459,6 +459,7 @@ One outage is one fact. Each condition below is written on its 1st, 2nd, 4th, 8t
|
|
|
459
459
|
| `cache.invalidate.partial` `{ …report, failures }` | `warn` | a publisher | refusals 1, 2, 4, 8, … **per failing tier** (`broadcast`, `redis`, …). Every bust's report still carries its `errors`, and `/_x` still records every bust |
|
|
460
460
|
| `cache.invalidate.partial recovered` `{ tier, after }` | `info` | a publisher | once, when that tier clears again |
|
|
461
461
|
| `cache.broadcast.subscribe-failed` `{ attempt, error }` · `… recovered` `{ after }` | `warn` · `info` | every role | silent for the first 10 s of the boot subscribe (`FIRST_DIAL_GRACE_MS`: the bus's first dial is still in progress, and the subscribe lands within it on a healthy pod); past that the first refusal and then attempts 2, 4, 8, … warn, and the landing is said once at info — only after a warning. `As of 2026-10-17` |
|
|
462
|
+
| `cache.broadcast.deferred-failed` `{ error, code? }` · `cache.broadcast.deferred-recovered` `{ failures }` | `warn` · `info` | a publisher | publishing the busts a bus outage deferred, on each reconnect: once per cause (a new one carries `previous`), then once when a settle lands, with the count. `As of 2026-11-14` |
|
|
462
463
|
| `live.bus_reconnected` `{ desynced, channelGaps }` | `warn` | `sync` | once per recovery: how many windows and topics were told to re-read |
|
|
463
464
|
|
|
464
465
|
Until 2026-10-10 a three-minute outage wrote `presence.sweep failed` at `error` every 10 s on every `sync` node (19 lines on one), sent the monitor one event per refused beat per socket, and wrote `cache.invalidate.partial` once per bust on every publisher. A failure that is **not** the bus being away — a policy that threw inside a presence leave — is still written every time, as `<operation> failed`.
|
package/wiki/Stability.md
CHANGED
|
@@ -26,7 +26,7 @@ A breaking change to any of these needs a major, and a major waits for its windo
|
|
|
26
26
|
| `.x/` — the build cache, generated manifests, snapshots | regenerated by the CLI; never hand-edited, never read by an app |
|
|
27
27
|
| the exact wording of a `cause:` or `fix:` line | the code is the contract; the text improves in any release |
|
|
28
28
|
| a gate verdict getting stricter | a new `x verify` rule that reds an app waits on `next` like any break |
|
|
29
|
-
| performance figures and budgets | measurements, each dated in its committed JSON under `scripts/bench/results/`, never promises. `bench.yml`
|
|
29
|
+
| performance figures and budgets | measurements, each dated in its committed JSON under `scripts/bench/results/`, never promises. `bench.yml` re-measures the first-hour and HTTP figures weekly (and on dispatch), as a pull request; a release does not trigger it (`GITHUB_TOKEN` events start no workflow). `As of 2026-11-14` the committed figures predate its first green run. Budgets: [Routes and render modes](Routes-And-Render-Modes#budgets) |
|
|
30
30
|
|
|
31
31
|
Never "stable forever": a covered surface can change, in a scheduled major, with its entry in [Upgrading](Upgrading).
|
|
32
32
|
|
package/wiki/Testing.md
CHANGED
|
@@ -1090,6 +1090,7 @@ only what came back and what changed.
|
|
|
1090
1090
|
| `public` | the policy admits an anonymous caller with an empty input: read half skipped, write half kept | no |
|
|
1091
1091
|
| `public` | a **job** whose B leg opened `crossTenant(reason, fn)` and whose input carried none of A's marks — a declared sweep, `sendDigest` fanning out one delivery per org. The reason is quoted in the verdict; read half skipped, write half kept | no |
|
|
1092
1092
|
| `public` | a **job** declaring `tenant: 'none'` whose input carried none of A's marks — a nightly cleanup across every org, input `{ occurrenceMs }`. No org and no id B chose reaches its run, so B's run is A's run: write half skipped (no snapshots taken), read half kept. Handed one of A's ids, crossed as ever. Both this and a declared sweep: both reasons, `; `-joined | no |
|
|
1093
|
+
| `global` | a **query** every statement of whose A call was a repository read of an `entity({ global: '<why>' })` table, `As of 2026-11-14` — a plan catalog. There is no row of A's to hand back, so the reasons are quoted in the verdict; the legs are still searched and the write half kept. One other entity (a policy's membership read included) or one hand-written statement, and it is the `unproven` below | no |
|
|
1093
1094
|
| `unproven` | a query whose A answer held none of A's marks: B's empty answer proves nothing | no |
|
|
1094
1095
|
| `proven` | otherwise | no |
|
|
1095
1096
|
|
package/wiki/Upgrading.md
CHANGED
|
@@ -289,6 +289,8 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
289
289
|
| `x verify` without `--json` prints its per-step stderr lines for a person (**31.22.0**): `✓ lint 22.0s`, and for a red step its narrowest re-run — no longer `{"step":…}` JSON | a script that parses those lines passes `--json`, which keeps them JSON |
|
|
290
290
|
| `x verify`'s `lint` step reports every format and import-order miss as one `X_LINT_FAILED` (**31.22.0**), its fix a single `bunx biome check --write <file…>`; a reader counting one finding per file sees fewer | nothing; run the one command |
|
|
291
291
|
| `x verify --changed` gives a route's `page.tsx` its own rule, `page` (**31.22.0**): typecheck, lint, boundaries, filesize, i18n and that route's tests, where it ran every step but `drift` | nothing; `x verify` with no flag is still the verdict |
|
|
292
|
+
| `x doctor` lists `error-declared` as differing from the shipped template after the **31.24.0** hop: its `fix:` is now one pasteable call per class — `export const PostNotFound = defineError({ code: 'X_POST_NOT_FOUND', title, status, cause, fix, problemMeta: [...] })`, the binding and the code read off the finding — because `defineError` now takes `problemMeta` and `publicCause: true`, which replace a hand-written class's `registerErrorStatus` / `registerProblemMeta` rows. The rule is the same; nothing new is reported | optional: `x g guard error-declared --force` — it rewrites `guards/error-declared.ts` **and** its `.test.ts`, so review the diff and keep any rule you edited on purpose. Then `x verify` |
|
|
293
|
+
| `repo-unbounded` fails the gate in a **new** app from **31.24.0** (`x new` and `x g guard` write it with no `severity` line); an existing app's report-only copy still reads as current in `x doctor`. A bare `.all()` also logs `X_ENTITY_ALL_TRUNCATED` with its call site in dev and test | optional: `x g guard repo-unbounded --force` to make your copy fail the gate on a bare `.all()` — add `.limit(n)` or page with `.page()` at every site it then lists. Then `x verify` |
|
|
292
294
|
|
|
293
295
|
## 29.x → 30.0.0, entry by entry
|
|
294
296
|
|