@ultimat3/cli 31.27.0 → 31.29.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 -1
- package/README.md +14 -4
- package/package.json +29 -29
- package/src/app-manifest.ts +6 -1
- package/src/app-migrations-verdict.ts +84 -0
- package/src/cmd-doctor.ts +11 -3
- package/src/cmd-drill.ts +23 -9
- package/src/cmd-repro-spec.ts +13 -1
- package/src/cmd-repro.ts +37 -5
- package/src/cmd-upgrade-codemods.ts +71 -0
- package/src/cmd-upgrade-spec.ts +19 -5
- package/src/cmd-upgrade.ts +91 -34
- package/src/codemods/agents-dev-mcp.ts +50 -0
- package/src/codemods/authenticator-session-refusal.ts +214 -0
- package/src/codemods/biome-no-default-export.ts +58 -0
- package/src/codemods/bunfig-island-coverage.ts +33 -0
- package/src/codemods/chart-dashboard.ts +73 -0
- package/src/codemods/ci-e2e-browser-stock.ts +75 -0
- package/src/codemods/ci-e2e-browser.ts +63 -0
- package/src/codemods/codemod.ts +58 -0
- package/src/codemods/define-error-leaf.ts +73 -0
- package/src/codemods/docs-ci-parts.ts +65 -0
- package/src/codemods/docs-gate-prose.ts +53 -0
- package/src/codemods/docs-island-rows.ts +31 -0
- package/src/codemods/docs-shipped-guards.ts +100 -0
- package/src/codemods/docs-test-services.ts +62 -0
- package/src/codemods/engine-diff.ts +104 -0
- package/src/codemods/engine-edits.ts +111 -0
- package/src/codemods/engine-fs.ts +95 -0
- package/src/codemods/engine.ts +191 -0
- package/src/codemods/format-edited-hook-3122.ts +28 -0
- package/src/codemods/format-edited-hook.ts +152 -0
- package/src/codemods/helm-alerts-deploy.ts +85 -0
- package/src/codemods/helm-alerts-objective.ts +105 -0
- package/src/codemods/helm-alerts-stock.ts +108 -0
- package/src/codemods/index.ts +60 -0
- package/src/codemods/metrics-probe-healthz.ts +47 -0
- package/src/codemods/migrate-job-ordered.ts +81 -0
- package/src/codemods/migrate-job-stock.ts +41 -0
- package/src/codemods/pending.ts +36 -0
- package/src/codemods/repro-gitignore.ts +40 -0
- package/src/codemods/runtime-pin-lines.ts +109 -0
- package/src/codemods/runtime-pin.ts +116 -0
- package/src/codemods/solid-floor.ts +63 -0
- package/src/codemods/test-ports.ts +86 -0
- package/src/codemods/test-suites.ts +37 -0
- package/src/codemods/theme-toggle-mount-over.ts +70 -0
- package/src/codemods/vendored-guards.ts +186 -0
- package/src/codemods/verify-floor-skips.ts +88 -0
- package/src/codemods/verify-floor-steps.ts +90 -0
- package/src/doctor-advisory-floors.ts +113 -0
- package/src/doctor-guards.ts +39 -86
- package/src/doctor-superseded.ts +67 -0
- package/src/drill-schema-behind.ts +26 -0
- package/src/error-codes-doctor.ts +12 -4
- package/src/error-codes.ts +9 -0
- package/src/exercise-database.ts +7 -2
- package/src/framework-schema-apply.ts +7 -19
- package/src/framework-schema-stamp.ts +38 -3
- package/src/framework-schema-verify.ts +120 -0
- package/src/framework-schema-wait.ts +125 -0
- package/src/generate-files.ts +6 -5
- package/src/guards-built-in-codes.ts +36 -0
- package/src/guards-built-in-refusal.ts +25 -0
- package/src/guards-built-in.ts +134 -0
- package/src/guards-materialize.ts +42 -0
- package/src/guards-paths.ts +37 -0
- package/src/guards-shipped-names.ts +38 -0
- package/src/guards-vendored.ts +73 -0
- package/src/guards.ts +90 -34
- package/src/index.ts +10 -0
- package/src/lint-findings.ts +3 -3
- package/src/mcp-errors.ts +12 -1
- package/src/measure-scope.ts +23 -3
- package/src/messages-repro.ts +16 -2
- package/src/messages-upgrade.ts +15 -0
- package/src/messages.ts +1 -1
- package/src/repro-archive-collect.ts +161 -0
- package/src/repro-archive-write.ts +96 -0
- package/src/repro-archive.ts +161 -0
- package/src/repro-bundle.ts +8 -16
- package/src/repro-errors.ts +14 -2
- package/src/repro-framework.ts +53 -0
- package/src/repro-parse.ts +87 -0
- package/src/repro-redact.ts +218 -0
- package/src/repro-scrub.ts +257 -0
- package/src/role-pg-stats.ts +21 -0
- package/src/role-start.ts +4 -0
- package/src/runtime-queue.ts +27 -6
- package/src/serve-boot-probe.ts +97 -0
- package/src/serve-boot.ts +26 -1
- package/src/serve-retire.ts +16 -3
- package/src/superseded-match.ts +87 -0
- package/src/superseded.ts +84 -0
- package/src/templates/bun-image.ts +48 -0
- package/src/templates/chart-dashboard-panels.ts +178 -0
- package/src/templates/chart-dashboard.ts +9 -135
- package/src/templates/github/ci.yml.ts +1 -1
- package/src/templates/guard-released-forms.ts +112 -0
- package/src/templates/guard-runtime-pin-test.ts +54 -0
- package/src/templates/guard-runtime-pin.ts +189 -0
- package/src/templates/scaffold-claude-agents.ts +6 -6
- package/src/templates/scaffold-claude-commands.ts +1 -1
- package/src/templates/scaffold-claude-hook.ts +18 -8
- package/src/templates/scaffold-claude.ts +2 -2
- package/src/templates/scaffold-container.ts +2 -2
- package/src/templates/scaffold-docs.ts +26 -24
- package/src/templates/scaffold-guards.ts +73 -39
- package/src/templates/scaffold-helm-alert-deploy.ts +105 -0
- package/src/templates/scaffold-helm-alert-rules.ts +7 -1
- package/src/templates/scaffold-helm-alerts.ts +3 -0
- package/src/templates/scaffold-helm-migrate.ts +85 -0
- package/src/templates/scaffold-helm-templates.ts +2 -36
- package/src/templates/scaffold-helm.ts +1 -0
- package/src/templates/scaffold-repo.ts +2 -1
- package/src/unthrown-codes.ts +2 -0
- package/src/upgrade-bun-floor.ts +4 -0
- package/src/upgrade-clean-tree.ts +54 -0
- package/src/upgrade-gate-codemods-install.ts +40 -0
- package/src/upgrade-gate-codemods.ts +151 -0
- package/src/upgrade-gate.ts +38 -6
- package/src/upgrade-lock.ts +118 -0
- package/src/upgrade-plan.ts +2 -1
- package/src/upgrade-report-codemods.ts +54 -0
- package/src/upgrade-report.ts +52 -27
- package/src/upgrade-signals.ts +91 -0
- package/src/upgrade-unfinished.ts +61 -0
- package/wiki/CLI-Reference.md +70 -5
- package/wiki/Deployment.md +2 -1
- package/wiki/Interface-Rules.md +17 -8
- package/wiki/Known-Gaps.md +1 -1
- package/wiki/Observability.md +1 -0
- package/wiki/Project-Layout.md +4 -4
- package/wiki/Upgrading.md +6 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// The hop between its pin write and its gate, recorded in `.x/upgrade.json`. Once the pins land a
|
|
2
|
+
// rerun reads them as "at target", so without this record a stopped hop answered done with no
|
|
3
|
+
// install, no gate and no coverage rebaseline. Written before the first pin, removed when the gate returns.
|
|
4
|
+
|
|
5
|
+
// why: Bun has no mkdir and no remove; the record is a file in a directory that may not exist yet.
|
|
6
|
+
import { mkdirSync, rmSync } from 'node:fs';
|
|
7
|
+
// why: Bun exposes no path-join primitive.
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
|
|
10
|
+
/** App-root relative: `.x/` is the state every scaffold already ignores. */
|
|
11
|
+
export const UNFINISHED_FILE = join('.x', 'upgrade.json');
|
|
12
|
+
|
|
13
|
+
export interface UnfinishedHop {
|
|
14
|
+
readonly from: string;
|
|
15
|
+
readonly to: string;
|
|
16
|
+
/** `engines.bun` before and after the pin write: a resumed hop rebaselines coverage from them. */
|
|
17
|
+
readonly bunFrom: string | null;
|
|
18
|
+
readonly bunTo: string | null;
|
|
19
|
+
/** ISO 8601, only ever printed. */
|
|
20
|
+
readonly startedAt: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const textOrNull = (value: unknown): string | null | undefined =>
|
|
24
|
+
value === null ? null : typeof value === 'string' ? value : undefined;
|
|
25
|
+
|
|
26
|
+
/** Total: a torn write or a hand edit is no record, never a crash on the path that recovers one. */
|
|
27
|
+
export function parseUnfinished(raw: string): UnfinishedHop | undefined {
|
|
28
|
+
let value: unknown;
|
|
29
|
+
try {
|
|
30
|
+
value = JSON.parse(raw);
|
|
31
|
+
} catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value !== 'object' || value === null) return undefined;
|
|
35
|
+
const { from, to, bunFrom, bunTo, startedAt } = value as Record<string, unknown>;
|
|
36
|
+
const bf = textOrNull(bunFrom);
|
|
37
|
+
const bt = textOrNull(bunTo);
|
|
38
|
+
if (typeof from !== 'string' || typeof to !== 'string') return undefined;
|
|
39
|
+
if (bf === undefined || bt === undefined) return undefined;
|
|
40
|
+
return {
|
|
41
|
+
from,
|
|
42
|
+
to,
|
|
43
|
+
bunFrom: bf,
|
|
44
|
+
bunTo: bt,
|
|
45
|
+
startedAt: typeof startedAt === 'string' ? startedAt : '',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function readUnfinished(root: string): Promise<UnfinishedHop | undefined> {
|
|
50
|
+
const file = Bun.file(join(root, UNFINISHED_FILE));
|
|
51
|
+
return (await file.exists()) ? parseUnfinished(await file.text()) : undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function writeUnfinished(root: string, hop: UnfinishedHop): Promise<void> {
|
|
55
|
+
mkdirSync(join(root, '.x'), { recursive: true });
|
|
56
|
+
await Bun.write(join(root, UNFINISHED_FILE), `${JSON.stringify(hop, null, 2)}\n`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function clearUnfinished(root: string): Promise<void> {
|
|
60
|
+
rmSync(join(root, UNFINISHED_FILE), { force: true });
|
|
61
|
+
}
|
package/wiki/CLI-Reference.md
CHANGED
|
@@ -51,7 +51,7 @@ x version # CLI version
|
|
|
51
51
|
| `x tasks` | cron tasks, their timezone and their next run | shipped |
|
|
52
52
|
| `x policy` | which clause decided a permission, and why | shipped |
|
|
53
53
|
| `x exercise [<name>] [--seed n] [--shard i/n]` | run every action, query, job and route `load` once on generated rows, with no test written; the gate's `exercise` step | shipped |
|
|
54
|
-
| `x drill [<name>] [--list] [--budget-ms n]` | the app's
|
|
54
|
+
| `x drill [<name>] [--list] [--budget-ms n]` | the app's roles as real processes on real Postgres, Redis and NATS, each dependency faulted through a proxy, each role signalled, or every role started before `ROLE=migrate`, red on any framework contract that does not hold. Not a gate step: it needs the services | shipped |
|
|
55
55
|
| `x i18n` | add, sync, check catalogs | shipped |
|
|
56
56
|
| `x mail preview <id>` | render a mail's declared `preview` in every locale, nothing sent | shipped |
|
|
57
57
|
| `x test <type>` | run one of the six test types, or the whole suite | shipped |
|
|
@@ -65,7 +65,7 @@ x version # CLI version
|
|
|
65
65
|
| `x errors explain <CODE>` | code → cause, fix, docs | shipped |
|
|
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
|
-
| `x upgrade` | one major per run: exact pins, the Bun floor, `bun install`, the gate, the section to read | shipped |
|
|
68
|
+
| `x upgrade` | one major per run: exact pins, the Bun floor, `bun install`, the release's codemods, the gate, the section to read · `x upgrade codemods` | shipped |
|
|
69
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` was removed from the registry `As of 2026-11-15` ([Known gaps](Known-Gaps#open-by-decision)) | shipped |
|
|
70
70
|
| `x config show [--section <key>]` | the resolved `app.config.ts`, defaults merged, credentials redacted | shipped |
|
|
71
71
|
| `x logs tail [--lines n] [--role <role>]` | the last lines of `.x/dev.log`, or one role's (its `.x/logs/<role>.log`, else its lines of the dev log) — the `logs.tail` MCP tool's reader | shipped |
|
|
@@ -356,7 +356,7 @@ The boot guard is generated, app-owned: `apps/web/runtime.ts` calls `assertSignI
|
|
|
356
356
|
|
|
357
357
|
**`x g chart-dashboard`** (`As of 2026-11`) is the same backfill for the chart's Grafana dashboard: `docker/helm/dashboards/ultimate-app.json` (one column of panels over the series the framework declares — requests, latency by route, statements, pool, jobs, realtime, the process) and `templates/dashboard-configmap.yaml`, which ships it as a ConfigMap a Grafana sidecar provisions by label — plus the `dashboard:` block `values.yaml` lacks, `enabled: false` (`x new`'s chart writes the same three). The same rules as `chart-alerts`: only what is missing, `--force` rewrites, no `<name>`, `X_CHART_MISSING` with no chart. **`--print`** writes nothing and needs no chart: the dashboard JSON, to import into a Grafana outside Kubernetes (`--json`: `data.dashboard`).
|
|
358
358
|
|
|
359
|
-
`x g guard <name>` writes `guards/<name>.ts` and its test
|
|
359
|
+
`x g guard <name>` writes `guards/<name>.ts` and its test: the app's own convention, from the blank template. Every name in `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) already runs on `boundaries` from the installed framework; how one reports is a row in `guards/shipped.json` (`"error"`, `"warning"`, `"off"`). `x doctor` lists the copies of shipped guards an app still holds (`.data.guards.vendored`), and `x upgrade` migrates them ([Interface rules](Interface-Rules)).
|
|
360
360
|
|
|
361
361
|
**`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.
|
|
362
362
|
|
|
@@ -1556,6 +1556,12 @@ pass, as the memory mail driver accepts every address, so a notifier's `webPush(
|
|
|
1556
1556
|
and sends to the captured push service, and the record carries `{ kind: 'push', host, count }`. A
|
|
1557
1557
|
pusher that sends nothing leaves no effect: its job is an empty reach, not a delivered push.
|
|
1558
1558
|
|
|
1559
|
+
**A storage write is an effect** (`As of 2026-11-15`). An object the call puts, copies or deletes
|
|
1560
|
+
through a `defineStorage` disk is `{ kind: 'storage', disk, op, count }` on its record, so an upload
|
|
1561
|
+
or export that stores only an object is no empty reach. A read is none, nor is a write the driver
|
|
1562
|
+
refused. A multipart session (`grantMultipart`, `abortUpload`) is not counted yet: its calls are not
|
|
1563
|
+
on the event bus.
|
|
1564
|
+
|
|
1559
1565
|
**`--shard i/n`** (`As of 2026-11-15`) runs the i-th of n disjoint slices of the pass — primitives,
|
|
1560
1566
|
then routes, by their position in the registry — on its own scratch database, and writes
|
|
1561
1567
|
`.x/exercise.<i>-of-<n>.json` (never `.x/exercise.json`). Run the n slices as n processes. Each
|
|
@@ -1591,6 +1597,17 @@ sampled throughout.
|
|
|
1591
1597
|
| `worker-sigkill` | `SIGKILL` the worker, then a fresh one | `jobs-terminal`, `jobs-once`, `requests-coded` |
|
|
1592
1598
|
| `worker-sigterm` | `SIGTERM` the worker, then a fresh one | `role-exits`, `jobs-terminal`, `jobs-once` |
|
|
1593
1599
|
| `web-sigterm` | `SIGTERM` the web role under load | `requests-ok`, `role-exits` |
|
|
1600
|
+
| `roll-before-migrate` | the roles started before `ROLE=migrate`, on a schema stamped by an older build | `roles-wait`, `serves-after-migrate`, `one-wait-line` |
|
|
1601
|
+
|
|
1602
|
+
`roll-before-migrate`, `As of 2026-11-15`, is the rollout order a deploy cannot always hold: no
|
|
1603
|
+
proxy and no load. The scratch database is migrated, its framework stamp (`x_jobs`' table comment)
|
|
1604
|
+
is rewound to name only an older build, then `web`, `worker` and `scheduler` start on it without
|
|
1605
|
+
waiting for readiness. Once each has logged its wait (or exited), they are held 3 s and
|
|
1606
|
+
`ROLE=migrate` runs again. Each must stay up (`roles-wait`: an exit is a crash-loop), log exactly
|
|
1607
|
+
one line naming `X_FRAMEWORK_SCHEMA_UNAPPLIED` (`one-wait-line`), and answer `/readyz` 200 once
|
|
1608
|
+
migrate has run (`serves-after-migrate`). `ULTIMATE_SCHEMA_WAIT_MS` is inherited: `0` — refuse at
|
|
1609
|
+
once — turns it red. Its evidence is `evidence.rollout.roles[]`, each
|
|
1610
|
+
`{ role, exit, ready, waitLines, logTail }`.
|
|
1594
1611
|
|
|
1595
1612
|
Thresholds come from the app: the request deadline (`@ultimat3/http`'s default, 30 s, because
|
|
1596
1613
|
`configureHttp` is runtime code the CLI does not run), `drain.deadlineMs` plus
|
|
@@ -1716,6 +1733,7 @@ Every test leftover the framework knows of, cleared (`As of 27.3.0`): the migrat
|
|
|
1716
1733
|
|
|
1717
1734
|
```bash
|
|
1718
1735
|
x upgrade [--to <version>] [--dry-run] [--json]
|
|
1736
|
+
x upgrade codemods --from <version> [--to <version>] [--dry-run] [--json]
|
|
1719
1737
|
```
|
|
1720
1738
|
|
|
1721
1739
|
One major per run, so each hop's gate attributes its red to that hop. `As of 30.0.0`.
|
|
@@ -1729,9 +1747,9 @@ One major per run, so each hop's gate attributes its red to that hop. `As of 30.
|
|
|
1729
1747
|
| 3 | `bun pm view @ultimat3/cli versions`: the next major's newest; the last major's newest when no later major exists | `X_UPGRADE_REGISTRY_UNREACHABLE`, `X_UPGRADE_HOP_TOO_WIDE`, `X_UPGRADE_VERSION_UNPUBLISHED`, `X_BUN_VERSION` |
|
|
1730
1748
|
| 4 | write exact pins, raise the Bun floor | — |
|
|
1731
1749
|
| 5 | `bun install` | `X_UPGRADE_INSTALL_FAILED`, `fix:` carries the undo |
|
|
1732
|
-
| 6 | the installed CLI: `x manifest`, `x doctor --json`, each missing guard (`x g guard <name>`, kept only when `x verify --only boundaries` finds nothing more), a Bun-floor hop's `x verify --only unit` coverage rebaseline, `x exercise --json` and its `exercise` floor figures, `x verify --json` | `X_UPGRADE_GATE_UNREADABLE`, as a finding on a red hop |
|
|
1750
|
+
| 6 | the installed CLI: `x upgrade codemods --from <from> --to <to>` (below), then `x manifest`, `x doctor --json`, each missing guard (`x g guard <name>`, kept only when `x verify --only boundaries` finds nothing more), a Bun-floor hop's `x verify --only unit` coverage rebaseline, `x exercise --json` and its `exercise` floor figures, `x verify --json` | `X_UPGRADE_GATE_UNREADABLE`, as a finding on a red hop |
|
|
1733
1751
|
|
|
1734
|
-
A dry run refuses exactly what the real run would, then stops before step 4. It never commits; `git diff` is the hop. Under `--json` fd 1 is one document, fd 2 a `{"upgrade":"<stage>"}` line per stage and a heartbeat a minute.
|
|
1752
|
+
A dry run refuses exactly what the real run would, then stops before step 4 — after previewing this CLI's codemods for the span, written nowhere. It never commits; `git diff` is the hop. Under `--json` fd 1 is one document, fd 2 a `{"upgrade":"<stage>"}` line per stage and a heartbeat a minute.
|
|
1735
1753
|
|
|
1736
1754
|
`--to`: an exact release in the next major. Over a mixed set a run moves the LOWEST pins one major: `^19` beside `^29` is told `--to 20.x.y`, that hop rewrites only the pins at or below it (a pin above is never moved backwards) and names its walkthrough, `next` names the following hop, and the last one levels the set. A straggler jump straight to the highest major is `X_UPGRADE_HOP_TOO_WIDE`: it skipped every walkthrough between.
|
|
1737
1755
|
|
|
@@ -1754,8 +1772,20 @@ A dry run refuses exactly what the real run would, then stops before step 4. It
|
|
|
1754
1772
|
| `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
|
|
1755
1773
|
| `exercise` | `{ reported, ok, findings[] }` from the hop's own `x exercise --json`, listed (and printed) before the gate's findings; each `fix` pastes as written. `reported: false`: the hop's CLI answered no exercise document — unknown, never a finding |
|
|
1756
1774
|
| `verify` | `{ ok, summary, failed[], findings[] }`, each finding `{ step?, code, cause, fix, at? }` |
|
|
1775
|
+
| `codemods` | `As of 2026-11-15`: `{ from, to, dryRun, source, applied[] }`, each `applied[]` a codemod that ran: `{ id, since, summary, changed[], skipped[] }`; a `skipped[]` entry is `{ path, reason, diff? }`, a file the codemod would not overwrite (the app edited it), with the template's change as a unified diff to make by hand. `source: installed` — the hop's own CLI applied its list; `driver` — that CLI predates codemods, so this one applied its own. `reinstalled: true` — a `package.json` differs after the codemods (read byte for byte, never off a codemod's report), so the hop ran `bun install` again before any gate stage; `x upgrade codemods` does the same by hand. `failure: { code, cause, fix }` — the installed CLI's codemods run failed for a reason other than lacking the subcommand: nothing applied, this CLI does not stand in, and the hop is not done. An app already at its target reruns every codemod up to the release it is on (`from: 0.0.0`): each is idempotent, so a done one changes nothing and an app still holding an old template's copy is carried across. `null`: no app |
|
|
1776
|
+
| `superseded[]` | `As of 2026-11-15`: a workaround the hop's framework made unnecessary, read after the codemods — `{ code: X_SUPERSEDED_WORKAROUND, cause, fix, at }`. A warning, never the verdict |
|
|
1757
1777
|
| `then` | the next thing to do, in a sentence naming the commands |
|
|
1758
1778
|
|
|
1779
|
+
**Codemods.** A file `x new` wrote is the app's; when a release changes the template, a codemod (`packages/cli/src/codemods/<id>.ts`, `since` = the release whose template change it carries) moves the app's copy. The hop runs every codemod whose `since` lies after `from` and at or before `to`, in version then id order, before any gate stage, and leaves the edits uncommitted beside the pins. Mechanical or nothing: a file the app edited is listed in `skipped[]` with its diff and never overwritten. `x upgrade codemods --from <version>` runs the same list by hand — for a hop an older CLI drove, which applied none:
|
|
1780
|
+
|
|
1781
|
+
| Flag | Type | Default | Meaning |
|
|
1782
|
+
|---|---|---|---|
|
|
1783
|
+
| `--from` | string | required | the release the app came from (its old `@ultimat3/cli` pin); `X_CLI_BAD_FLAG` when absent or not `major.minor.patch` |
|
|
1784
|
+
| `--to` | string | this CLI's version | the last release whose codemods run |
|
|
1785
|
+
| `--dry-run` | boolean | off | report what would change; write nothing |
|
|
1786
|
+
|
|
1787
|
+
`data.codemods` is the same shape as the hop's, without `source`. A second run changes nothing.
|
|
1788
|
+
|
|
1759
1789
|
`null` for `guards`, `manifest`, `exercise` and `verify` means no gate ran: a dry run, already there, or no app.
|
|
1760
1790
|
|
|
1761
1791
|
**Pins and no `app.config.ts`.** Needs no app: the root is the app at or above the cwd, else the nearest manifest holding `@ultimat3/*` pins, or the workspace root claiming it. No such manifest is `X_UPGRADE_PIN_UNREADABLE`; an app below that root is `X_NOT_IN_APP`, with the `cd`. With no app, `x manifest`, `x doctor` and `x verify` cannot run, so the hop runs the `typecheck` and `test` scripts the root declares: `data.scripts[]` is `{ name, ok, code, output }`, `proof` is `scripts`, and the summary says no `x verify` ran. Neither script declared: `proof: none`, `done: false`, red. It checked nothing, so it never claims otherwise.
|
|
@@ -2025,6 +2055,7 @@ command rather than quoting the line. `docs` is `ERROR_DOCS_URL`, the same URL f
|
|
|
2025
2055
|
x repro <jobId|requestId|traceId|fingerprint> [--write] [--verify] [--json]
|
|
2026
2056
|
x repro --list [--code X_…] [--json]
|
|
2027
2057
|
x repro --from <file> [--write] [--verify] [--json]
|
|
2058
|
+
x repro <id> --bundle [--include-rows] [--json] | x repro --from <file> --bundle [--include-rows] [--json]
|
|
2028
2059
|
```
|
|
2029
2060
|
|
|
2030
2061
|
A production failure becomes a failing test. `As of 2026-11`.
|
|
@@ -2041,6 +2072,40 @@ green. Masked input (`.sensitive()`, secret-named keys) and masked columns are s
|
|
|
2041
2072
|
the schema. `--list` reads the bundles with each group's count and last sighting. An id nothing
|
|
2042
2073
|
holds is `X_REPRO_UNKNOWN`; a request id with capture off is `X_REPRO_CAPTURE_OFF`.
|
|
2043
2074
|
|
|
2075
|
+
**`--bundle` carries the failure to an issue** (`As of 2026-11`): one JSON file,
|
|
2076
|
+
`repro/bundle-<id>.json` (the scaffold's `.gitignore` keeps it out of a commit), deterministic
|
|
2077
|
+
bytes, meant to be read before it is attached — its `readFirst` lines say what is in it and what
|
|
2078
|
+
is not found. Never with `--write`/`--verify`; `--include-rows` without `--bundle` is refused
|
|
2079
|
+
(`X_CLI_BAD_FLAG`).
|
|
2080
|
+
|
|
2081
|
+
| Section | Holds |
|
|
2082
|
+
|---|---|
|
|
2083
|
+
| `framework` | every installed `@ultimat3/*` package and the versions found of it, the CLI's, Bun's, the platform |
|
|
2084
|
+
| `error` | the code, the cause, the stack's `at …` frames — from the job row, a `--from` file's `error`, or the error group's sample only when that sample is this request's own |
|
|
2085
|
+
| `schema.entities` | the declarations of the entities whose rows the call read — never the whole app |
|
|
2086
|
+
| `subject` | the failure, as `x repro --from` reads it back. Always: input masked by the primitive's `.sensitive()` schema and core's `captureValue`, rows minus sealed columns, a row of an undeclared entity dropped (`dropped`, `truncated: true`). By default also: every value that is not a key — input leaves, row columns other than the primary key, a declared reference or an `…Id`, step outputs — is `[redacted]` (a step's number `0`), listed as masked so the replay stands it in from the schema; the actor's org is a placeholder uuid everywhere it appears |
|
|
2087
|
+
| `masked` / `scrubbed` | the masked paths; the env var NAMES whose values were found, the count of hostnames |
|
|
2088
|
+
| `reproducer` | the test, rendered from `subject` alone, against the scaffold's `apps/web/api` and the `@app/db` placeholder |
|
|
2089
|
+
|
|
2090
|
+
| Flag | Does |
|
|
2091
|
+
|---|---|
|
|
2092
|
+
| `--include-rows` | real values for those non-key fields, and the real org — read them before sending. Secrets, `.sensitive()` fields and sealed columns stay masked |
|
|
2093
|
+
|
|
2094
|
+
Replaced everywhere (never in the primitive's name, the code or the reproducer's imports): the app
|
|
2095
|
+
root (`.`), the home directory (`~`), an env value that is secret-named, a URL or from the app's
|
|
2096
|
+
`.env*` files (`[env:NAME]`; 6+ characters, any length under a secret name) — and an env URL's
|
|
2097
|
+
user and password raw, URL-decoded and base64 (a Basic header) —, every hostname in
|
|
2098
|
+
`app.config.ts` or an env URL (`[host]`), any URL's userinfo (`[cred]@`) and query values
|
|
2099
|
+
(`?k=[redacted]`), emails (`[email]`), IPv4/IPv6 addresses (`[ip]`); in a cause or frame, any other
|
|
2100
|
+
absolute file path (`<abs>/<file>`). **Not found**: a value this machine never knew — a
|
|
2101
|
+
production-only secret, a customer's name in a cause.
|
|
2102
|
+
|
|
2103
|
+
**A bundle is untrusted input.** `bunx create-ultimate repro <bundle.json>` reads only its
|
|
2104
|
+
`subject`, checked field by field (`X_REPRO_BUNDLE_INVALID` otherwise, control characters
|
|
2105
|
+
included), and renders the test from it; the bundle's own `reproducer` text never reaches disk.
|
|
2106
|
+
It opens into a scratch app (`repro-<id>/`), the test under `repro/`, linked to the framework
|
|
2107
|
+
checkout the command runs in (or `--framework <checkout>`) through `file:` overrides.
|
|
2108
|
+
|
|
2044
2109
|
## x docs
|
|
2045
2110
|
|
|
2046
2111
|
```bash
|
package/wiki/Deployment.md
CHANGED
|
@@ -508,12 +508,13 @@ The framework depends on none of this; it is the operations manual for the app y
|
|
|
508
508
|
| [`docs/ops/04-datastores.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/04-datastores.md) | sizing Postgres, NATS and object storage for a given rung |
|
|
509
509
|
| [`docs/ops/05-disaster-recovery.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/05-disaster-recovery.md) | backups, PITR, restore drills, replication-slot recovery |
|
|
510
510
|
| [`docs/ops/06-runbooks.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/06-runbooks.md) | symptom → page → action, per role |
|
|
511
|
+
| [`docs/ops/07-deploy-contract.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/07-deploy-contract.md) | what a deploy guarantees: order, a role over a schema that is behind, drain, the skew window, rollback, each failure's alert |
|
|
511
512
|
|
|
512
513
|
Two design-only companions — **specification, not shipped behaviour**: [`docs/idea/16-app-targets.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/16-app-targets.md) (three targets, one backend, two view layers) and [`docs/idea/17-scale-ladder.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/idea/17-scale-ladder.md) (why the app code is identical at rung 0 and rung 4).
|
|
513
514
|
|
|
514
515
|
## Rollback
|
|
515
516
|
|
|
516
|
-
Redeploy the previous image tag. Inside an `assets.retain` window (below) a rollback 404s nobody mid-session; without one, a tab holding the other build's document reloads.
|
|
517
|
+
Redeploy the previous image tag: `x deploy --image <previous> --json`. `helm rollback` runs the older build's migrate first only onto a revision a 31.29+ chart rendered (a `pre-rollback` hook; Helm runs the target revision's hooks); onto an older one it skips the checks below → [Kubernetes migrations](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/01-kubernetes.md#migrations). Inside an `assets.retain` window (below) a rollback 404s nobody mid-session; without one, a tab holding the other build's document reloads.
|
|
517
518
|
|
|
518
519
|
The older image's migrate role decides whether the schema allows it (`As of 2026-11`). Over ledger rows the newer build applied it applies nothing and logs them (`ahead`). Over a row the newer build RECORDED as destructive (`x_migrations.destructive`, written at apply) it refuses before anything serves:
|
|
519
520
|
|
package/wiki/Interface-Rules.md
CHANGED
|
@@ -17,16 +17,25 @@ The mechanisms are of three shapes, and knowing which one you hit tells you wher
|
|
|
17
17
|
| Shape | Where it fires | Example |
|
|
18
18
|
|---|---|---|
|
|
19
19
|
| a **type** in `@ultimat3/ui` | `x verify`'s `typecheck` step | `AsyncRegionProps.empty` is required |
|
|
20
|
-
| a **guard
|
|
20
|
+
| a **guard**, shipped or in your app's `guards/` | `x verify`'s `boundaries` step | `focus-visible` |
|
|
21
21
|
| a **test** in the framework | `x verify`'s `unit` step | `packages/ui/src/tokens/contrast.test.ts` |
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
(`packages/cli/src/templates/scaffold-guards.ts`)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
Shipped guards run from the installed framework, never from a copy: every name in
|
|
24
|
+
`SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) runs on `boundaries`, so a
|
|
25
|
+
fixed guard reaches the app on its next install. `As of 2026-11`.
|
|
26
|
+
|
|
27
|
+
| You want | Do |
|
|
28
|
+
|---|---|
|
|
29
|
+
| a shipped guard to report only, gate, or not run | a row in `guards/shipped.json`: `{ "severity": { "raw-fetch": "warning" } }` — `"error"`, `"warning"` or `"off"` |
|
|
30
|
+
| a shipped guard held at its current count while the tree is brought under it | `"guardBaseline": { "raw-fetch": 3 }` in `x.verify.json` — the count only falls |
|
|
31
|
+
| a rule of your own | `x g guard <name>`: `guards/<name>.ts` and its test, discovered, never registered |
|
|
32
|
+
| off vendored copies (an app whose `guards/` holds them) | `x upgrade` — the `vendored-guards` codemod deletes each identical copy; a severity edit becomes a row; any other edit is kept as `guards/app-<name>.ts`, the shipped one `"off"`, with the reason and the diff |
|
|
33
|
+
|
|
34
|
+
`guards/shipped.json` present is the opt-in: absent, the app is legacy — a copy it holds runs in
|
|
35
|
+
place of the shipped guard (`X_GUARD_VENDORED`, a warning, fix `x upgrade`), and a shipped guard it
|
|
36
|
+
holds no copy of reports only. Each raises an `X_*` code derived from its name — `focus-visible`
|
|
37
|
+
raises `X_FOCUS_VISIBLE` — so a finding says which convention broke, not which framework subsystem
|
|
38
|
+
noticed.
|
|
30
39
|
|
|
31
40
|
## Loading, empty, error
|
|
32
41
|
|
package/wiki/Known-Gaps.md
CHANGED
|
@@ -58,7 +58,7 @@ CHANGELOG.md` finds its bounds, and it changes on any commit.
|
|
|
58
58
|
| Retry-from-step on the jobs dashboard is a free-text field | `As of 2026-10`. `job.retry-from-step` takes `{ step: t.string.min(1) }` (`packages/admin/src/jobs/job-actions.ts`); the run's detail page shows its steps, but the form does not offer them as a choice. | copy the step name from the run's `steps` section on the same page |
|
|
59
59
|
| The admin MCP batch tool takes `ids` only | `As of 2026-10`. A `batch` action is one MCP tool, `admin.action.<name>`, and it takes the rows by id; "all matching" — the list's own filter — is a screen control only | list the rows with `admin.<entity>.list` and its `where`, then pass their ids |
|
|
60
60
|
| No counts on the jobs dashboard's state tabs | `As of 2026-10`. `stats()` counts per queue across every tenant, so a count on a tab would show an org-scoped operator other orgs' numbers; the tabs carry none and the overview's tiles carry the counts, for a platform operator only. A per-tenant count is a second query nothing issues yet | a platform operator reads the overview tiles; an org-scoped operator reads a tab's own page |
|
|
61
|
-
| `x drill` proves one node per role on one machine, and drills no object store and no CDN | `As of 2026-11-06`. The fleet is one `web`, one `worker` (and one `sync` for `nats-down`) on one host, every dependency a local container behind a Bun TCP proxy: a multi-node NATS cluster, a Postgres failover to a real standby, a real S3 bucket and a real CDN in front of the web role are never faulted. `nats-down`'s sync lane is proven on a stand-in node (`packages/testing/src/drill-sync.test.ts`), not on `examples/dummy`, whose transport is in-memory; its client subscribes to nothing by default, so a gap counts only what the node volunteers. CI runs
|
|
61
|
+
| `x drill` proves one node per role on one machine, and drills no object store and no CDN | `As of 2026-11-06`. The fleet is one `web`, one `worker` (and one `sync` for `nats-down`) on one host, every dependency a local container behind a Bun TCP proxy: a multi-node NATS cluster, a Postgres failover to a real standby, a real S3 bucket and a real CDN in front of the web role are never faulted. `nats-down`'s sync lane is proven on a stand-in node (`packages/testing/src/drill-sync.test.ts`), not on `examples/dummy`, whose transport is in-memory; its client subscribes to nothing by default, so a gap counts only what the node volunteers. CI runs four of the nine (`fault-drills`, `roll-before-migrate` among them) [pin](https://github.com/developerz-ai/ultimate/blob/main/packages/testing/src/drills.test.ts#the%20nine%20drills%2C%20once%20each) | the rest by hand: `x drill --list --json`, then `x drill <name> --json` with `docker/test-services.env` loaded. A multi-node or object-store fault is a staging drill of your own, against [`docs/ops/06-runbooks.md`](https://github.com/developerz-ai/ultimate/blob/main/docs/ops/06-runbooks.md) |
|
|
62
62
|
|
|
63
63
|
## Open by decision
|
|
64
64
|
|
package/wiki/Observability.md
CHANGED
|
@@ -51,6 +51,7 @@ off(); // the unsubscribe; calling it twice is a no-op
|
|
|
51
51
|
| `outbound.request` | `vendor`, `method`, `host`, `status?` (absent when no answer came) | `outbound.<vendor>` (client) | `outbound()`, `@ultimat3/core/outbound` |
|
|
52
52
|
| `mail.deliver` | `transport`, `recipients` (a COUNT — no address rides an event) | client | `@ultimat3/mail` |
|
|
53
53
|
| `storage.put` `.get` `.stat` `.copy` `.delete` `.list` | `disk`, `key`, `bytes?` | client | every disk `defineStorage` resolves |
|
|
54
|
+
| `storage.multipart` | `disk`, `key`, `op` (`create` · `part` · `complete` · `abort`), `bytes?` (the part's, or the assembled object's) — signing a part URL or listing parts is no event | client | a resolved disk's `multipart` capability |
|
|
54
55
|
| `cache.hit` · `cache.miss` · `cache.invalidate` · `cache.tier_failure` | tier + key · tags, busted, errors · the failure | `cache.invalidate` (internal) | `@ultimat3/cache` |
|
|
55
56
|
| `span.end` | a `ReadableSpan` — SAMPLED spans only | — | core's tracer |
|
|
56
57
|
| `log.record` | `at`, `level`, `message`, `fields` — after redaction | — | core's process logger |
|
package/wiki/Project-Layout.md
CHANGED
|
@@ -20,10 +20,10 @@ myapp/
|
|
|
20
20
|
ui/ # app-specific Solid components on top of @ultimat3/ui
|
|
21
21
|
mcp/ # the app's own MCP tools (its dashboards are AI-first too)
|
|
22
22
|
bin/ # setup, dev, check — thin wrappers over `x`
|
|
23
|
-
guards/ # one
|
|
24
|
-
# each inside its `boundaries` step
|
|
25
|
-
#
|
|
26
|
-
#
|
|
23
|
+
guards/ # the app's own rules, one per file, DISCOVERED not registered —
|
|
24
|
+
# `x verify` runs each inside its `boundaries` step, beside every
|
|
25
|
+
# shipped guard (built in, never copied). shipped.json: a
|
|
26
|
+
# severity per shipped guard; `x new` writes it empty
|
|
27
27
|
docker/ # Dockerfile, Dockerfile.dockerignore, both compose files, and
|
|
28
28
|
# helm/ — the chart, 8 files. All written by `x new`
|
|
29
29
|
app.config.ts # the one config file
|
package/wiki/Upgrading.md
CHANGED
|
@@ -294,6 +294,12 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
294
294
|
| `@ultimat3/entity` `ColumnMeta.countedIn` (and `ReferenceOptions.countedIn`) widened in **31.24.0** from `() => AnyColumn` to `CountedIn` — that function, or `{ to, where? }` so a filtered counter carries its `where`. Passing it to `references()` is unchanged; code that READS it off a column's meta and calls it no longer compiles. Shipped in a minor; recorded `As of 2026-11-15` | where you read it: `const to = typeof meta.countedIn === 'function' ? meta.countedIn : meta.countedIn?.to;` |
|
|
295
295
|
| `@ultimat3/policy` `PolicyScope` and `policyScope()` return `readonly ScopeNode[]` from **31.24.0** — a condition, `{ or }`, `{ and }` or `{ via }` — where they returned `readonly ScopeCondition[]`. Writing a scope that returns conditions is unchanged; code that reads a scope's nodes and their fields no longer compiles. Shipped in a minor; recorded `As of 2026-11-15` | narrow each node before reading it: `if ('column' in node) { node.column; node.op; node.value }`, and treat `or` / `and` / `via` nodes as groups |
|
|
296
296
|
| `@ultimat3/core` `mapBounded` became overloads in **31.24.0** (`settle: 'first' \| 'all'`), so a value typed `MapBoundedOptions` matched none. **31.27.0** accepts it again; its result is `R[] \| PromiseSettledResult<R>[]`, since such a value may carry `settle: 'all'` | pass the options as a literal (`{ concurrency: 4 }` keeps `R[]`), or add `settle: 'first'` |
|
|
297
|
+
| shipped guards run **built in** from **31.28.0**: they load from the installed framework, and an app's `guards/` holds only its own guards plus `guards/shipped.json` (a severity per shipped guard: `error`, `warning`, `off`). A copy still in `guards/` runs in place of the shipped one with an `X_GUARD_VENDORED` warning; `x g guard <shipped name>` is refused (`X_GUARD_BUILT_IN`) — `x g guard … --force` is no longer the refresh | `x upgrade --json` — its `vendored-guards` codemod deletes every identical copy, turns a severity-only edit into a `guards/shipped.json` row, and keeps any other edit as `guards/app-<name>.ts` with its diff printed |
|
|
298
|
+
| a new shipped guard, `runtime-pin` (**31.28.0**), built in: it reports where the app's Bun pins disagree — `engines.bun`, `packageManager`, `.bun-version`, CI's `bun-version:`, the Dockerfile's `oven/bun` image and its digest | `x upgrade --json` (its `runtime-pin` codemod moves a scaffold-written pin onto today's; a pin you wrote is reported, never rewritten), then `x verify --only boundaries --json`; to opt out, `"runtime-pin": "off"` in `guards/shipped.json` |
|
|
299
|
+
| `x upgrade` applies **codemods** from **31.28.0**: every scaffold-owned change between your version and the target is carried as a codemod (`data.codemods`); a file you edited is listed with its diff and never overwritten. After a hop an older CLI drove, apply them with `x upgrade codemods --from <old version> --json` | nothing; read `data.codemods.skipped` after each hop |
|
|
300
|
+
| a stopped `x upgrade` (**31.28.0**) leaves `.x/upgrade.json`; rerunning it to the same `--to` finishes the hop — install, codemods, gate — and a second `x upgrade` in the same app is refused while one runs (`X_UPGRADE_LOCKED`). Ctrl-C or SIGTERM now stops the hop's own children too | stash a stopped hop's tree, never commit it: `git stash push --include-untracked`, then `x upgrade --to <same version> --json` |
|
|
301
|
+
| a serving role over a schema behind its build **waits** for the migrate step (**31.29.0**) instead of exiting — framework stamp and app migrations alike — and exits after `ULTIMATE_SCHEMA_WAIT_MS` (default 300000); the chart's migrate Job is an Argo CD `Sync` hook in wave −1, named by a hash of its image, its migrate settings and the chart version, deleted on success, and runs on `helm rollback` too | `x upgrade --json` (codemods `migrate-job-ordered`, `helm-alerts-deploy`); after a pre-31.29 chart, `kubectl delete job <release>-migrate` once; `ULTIMATE_SCHEMA_WAIT_MS=0` keeps the old refuse-at-once |
|
|
302
|
+
| `overrides` an app carries for `seroval`, `seroval-plugins` or `source-map-js` are no longer needed from **31.28.0**: `@ultimat3/ui`'s `solid-js` peer is `^1.9.18`, which requires the patched `seroval`; `source-map-js` and `immutable` arrive through `sass` and need a refreshed lockfile. `x doctor` warns below each floor (`X_ADVISORY_FLOOR_UNMET`) | drop those `overrides`, then `x upgrade --json` (its `solid-floor` codemod raises `solid-js`) and `bun update source-map-js immutable` |
|
|
297
303
|
|
|
298
304
|
## 29.x → 30.0.0, entry by entry
|
|
299
305
|
|