@ultimat3/cli 31.38.1 → 31.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +1 -1
  2. package/package.json +29 -29
  3. package/src/cmd-errors-guards.ts +69 -0
  4. package/src/cmd-errors.ts +11 -4
  5. package/src/cmd-exercise.ts +3 -2
  6. package/src/cmd-new-spec.ts +6 -1
  7. package/src/cmd-new-target.ts +73 -0
  8. package/src/cmd-new.ts +21 -21
  9. package/src/cmd-repro.ts +2 -1
  10. package/src/codemods/ci-e2e-browser.ts +7 -1
  11. package/src/codemods/ci-services-env.ts +25 -0
  12. package/src/codemods/docs-env-guard.ts +31 -0
  13. package/src/codemods/index.ts +4 -0
  14. package/src/dev-boot.ts +3 -0
  15. package/src/dev-rebuild-isr.ts +17 -0
  16. package/src/dev-rebuild.ts +14 -5
  17. package/src/error-contract.ts +25 -5
  18. package/src/exercise-findings-unreached.ts +94 -0
  19. package/src/exercise-findings.ts +9 -57
  20. package/src/exercise-route-api.ts +3 -4
  21. package/src/fix-sequence.ts +28 -3
  22. package/src/framework-schema-wait.ts +41 -2
  23. package/src/generate-feature-required.ts +40 -3
  24. package/src/generate-kinds.ts +23 -2
  25. package/src/guards-shipped-names.ts +1 -0
  26. package/src/messages.ts +5 -0
  27. package/src/serve-boot.ts +4 -0
  28. package/src/templates/action.ts +7 -2
  29. package/src/templates/github/ci.yml.ts +3 -2
  30. package/src/templates/guard-raw-colour.ts +88 -13
  31. package/src/templates/guard-released-forms.ts +9 -3
  32. package/src/templates/guard-undeclared-env.ts +192 -0
  33. package/src/templates/guard-untranslated-string.ts +29 -1
  34. package/src/templates/policy.ts +7 -1
  35. package/src/templates/query.ts +8 -6
  36. package/src/templates/scaffold-docs.ts +1 -0
  37. package/src/templates/scaffold-guards.ts +4 -1
  38. package/src/templates/scaffold-i18n.ts +1 -1
  39. package/src/templates/scaffold-repo.ts +26 -24
  40. package/src/templates/shapes/agent.ts +2 -2
  41. package/src/templates/shapes/offline.ts +1 -1
  42. package/src/templates/shapes/realtime.ts +2 -2
  43. package/src/templates/shapes/saas.ts +5 -4
  44. package/src/templates/slice-foundation.ts +29 -9
  45. package/src/test-workers.ts +3 -1
  46. package/src/workspace-checks.ts +4 -1
  47. package/wiki/Actions.md +1 -1
  48. package/wiki/CLI-Reference.md +1 -1
  49. package/wiki/Getting-Started.md +1 -1
  50. package/wiki/Installation.md +2 -2
  51. package/wiki/Money.md +19 -4
  52. package/wiki/Queries-And-Live-Queries.md +4 -4
  53. package/wiki/Realtime.md +2 -2
  54. package/wiki/Tutorial-04-Jobs-And-Realtime.md +3 -2
  55. package/wiki/Upgrading.md +2 -1
@@ -136,12 +136,12 @@ import * as recentPosts from '../app/post/queries/recent-posts';
136
136
  {
137
137
  path: 'package.json',
138
138
  find: ' "@ultimat3/policy": ',
139
- replace: ` "@ultimat3/notify": "^${loadVersion()}",\n "@ultimat3/policy": `,
139
+ replace: ` "@ultimat3/notify": "${loadVersion()}",\n "@ultimat3/policy": `,
140
140
  },
141
141
  {
142
142
  path: 'package.json',
143
143
  find: ' "@ultimat3/render": ',
144
- replace: ` "@ultimat3/realtime": "^${loadVersion()}",\n "@ultimat3/render": `,
144
+ replace: ` "@ultimat3/realtime": "${loadVersion()}",\n "@ultimat3/render": `,
145
145
  },
146
146
  ...shapeLines(
147
147
  'realtime',
@@ -72,15 +72,16 @@ const edits = (app: NameSet): readonly ShapeEdit[] => [
72
72
  replace:
73
73
  " entities: adminEntitiesOf(db),\n db,\n // A plan is the payment webhook's to write (`apps/web/app/billing/`): operators only read it.\n resources: { subscriptions: { operations: ['list', 'detail', 'search'] } },\n",
74
74
  },
75
- // A plan's features are flags: the package joins the app's dependencies, at the release's range.
75
+ // A plan's features are flags: the package joins the app's dependencies, pinned EXACT at the
76
+ // release like every other @ultimat3/* the scaffold writes (D9) — never a caret range.
76
77
  {
77
78
  path: 'package.json',
78
- find: ' "@ultimat3/http": "^',
79
- replace: ` "@ultimat3/flags": "^${loadVersion()}",\n "@ultimat3/http": "^`,
79
+ find: ` "@ultimat3/http": "${loadVersion()}",`,
80
+ replace: ` "@ultimat3/flags": "${loadVersion()}",\n "@ultimat3/http": "${loadVersion()}",`,
80
81
  },
81
82
  ...shapeLines(
82
83
  'saas',
83
- `a multi-tenant app — billing is app code in \`${BILLING_DIR}/plans.ts\`, a signed payment webhook (\`${BILLING_DIR}/jobs/${RECEIVER_NAME}.ts\`) moves an org between plans, and \`x g sign-in --password\` and \`x g invite\` wrote sign-in and the member invite`,
84
+ `a multi-tenant app — billing is app code in \`${BILLING_DIR}/plans.ts\`, a signed payment webhook (\`${BILLING_DIR}/jobs/${RECEIVER_NAME}.ts\`) moves an org between plans; \`x g sign-in --password\` and \`x g invite\` wrote its auth`,
84
85
  ),
85
86
  ];
86
87
 
@@ -9,7 +9,7 @@ import type { FeatureTarget } from './entity';
9
9
  import { entityFiles } from './entity';
10
10
  import type { GeneratedFile, NameSet } from './naming';
11
11
  import { names } from './naming';
12
- import { policyFiles } from './policy';
12
+ import { ORG_WRITE_RULE, policyFiles } from './policy';
13
13
 
14
14
  /**
15
15
  * Which slice modules a generator's own source imports. Named per generator rather than emitted as
@@ -271,14 +271,34 @@ export function sliceTakesScaffoldRow(
271
271
  }
272
272
 
273
273
  /**
274
- * The ONE permission `name` grants, when `source` declares it as a single literal call:
275
- * `export const canBlogWrite = can('blog:publish');`. Anything else — a predicate argument,
276
- * `and`/`or`, a function, a re-export — is `undefined`: the grant cannot be read, and a generated
277
- * test must not assume one.
274
+ * The ONE permission `name` grants, when `source` declares it as a single literal call —
275
+ * `export const canBlogWrite = can('blog:publish');` — or as the write rule `x g policy` /
276
+ * `x g resource` write themselves (`ORG_WRITE_RULE`: the grant, then the input's org equals the
277
+ * actor's), which a writer in the org passes. Anything else — another predicate, `and`/`or`, a
278
+ * function, a re-export — is `undefined`: the grant cannot be read, and a generated test must not
279
+ * assume one.
278
280
  */
279
281
  export function grantOf(source: string, name: string): string | undefined {
280
- const declared = new RegExp(
281
- `\\bexport\\s+const\\s+${name}\\s*=\\s*can\\(\\s*(['"\`])([A-Za-z0-9_.*:-]+)\\1\\s*\\)\\s*;`,
282
- );
283
- return declared.exec(stripComments(source))?.[2];
282
+ const code = stripComments(source);
283
+ return grantPattern(name, 'literal').exec(code)?.[2] ?? grantPattern(name, 'org').exec(code)?.[2];
284
+ }
285
+
286
+ /**
287
+ * Whether `name` is the generator's own org write rule (`ORG_WRITE_RULE`): then the contract's
288
+ * exercise pins the input's org to the actor's, exactly as for a slice this run's policy writes.
289
+ */
290
+ export function writesOrgRule(source: string, name: string): boolean {
291
+ return grantPattern(name, 'org').test(stripComments(source));
284
292
  }
293
+
294
+ function grantPattern(name: string, form: 'literal' | 'org'): RegExp {
295
+ const head = `\\bexport\\s+const\\s+${name}\\s*=\\s*can(?:<[A-Za-z0-9_]+>)?\\(\\s*(['"\`])([A-Za-z0-9_.*:-]+)\\1`;
296
+ return form === 'literal'
297
+ ? new RegExp(`${head}\\s*\\)\\s*;`)
298
+ : new RegExp(`${head}\\s*,\\s*${ORG_WRITE_RULE_PATTERN}\\s*,?\\s*\\)\\s*;`);
299
+ }
300
+
301
+ /** `ORG_WRITE_RULE` with every run of whitespace free, so a formatter's line breaks still match. */
302
+ const ORG_WRITE_RULE_PATTERN = ORG_WRITE_RULE.split(/\s+/)
303
+ .map((token) => token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
304
+ .join('\\s*');
@@ -153,7 +153,9 @@ const UNITS: Readonly<Record<string, number>> = {
153
153
  * rather than a typo silently meaning "the default".
154
154
  */
155
155
  export const parseBytes = (raw: string): number | undefined => {
156
- const match = /^\s*(\d+(?:\.\d+)?)\s*([a-z]*)\s*$/i.exec(raw);
156
+ // Trimmed first: `\s*` on both sides of an optional unit split one run of spaces two ways, which
157
+ // was quadratic on a long one.
158
+ const match = /^(\d+(?:\.\d+)?)\s*([a-z]*)$/i.exec(raw.trim());
157
159
  if (match === null) return undefined;
158
160
  const unit = (match[2] ?? '').toLowerCase();
159
161
  if (!Object.hasOwn(UNITS, unit)) return undefined;
@@ -112,8 +112,11 @@ export const missingFileFinding = (dir: string, file: string, scaffolder: boolea
112
112
  * (`@ultimat3/core`'s `frameworkVersion()`, the CLI's `loadVersion()`, every dependency `x new` pins).
113
113
  * A manifest with no semver `version` therefore breaks the MCP handshake and every scaffold — so
114
114
  * the gate refuses the publish here, where the fix is one line, rather than at someone's install.
115
+ *
116
+ * One `[-+]` lead, then `+`-separated runs: `(?:[-+][\w.-]+)*` read the same strings, but `-` is
117
+ * in both the lead and the run, so a prerelease of `--` pairs backtracked exponentially.
115
118
  */
116
- export const SEMVER = /^\d+\.\d+\.\d+(?:[-+][\w.-]+)*$/;
119
+ export const SEMVER = /^\d+\.\d+\.\d+(?:[-+][\w.-]+(?:\+[\w.-]+)*)?$/;
117
120
 
118
121
  export const badVersionFinding = (dir: string, found: unknown): Finding => ({
119
122
  code: 'X_PACKAGE_SHAPE',
package/wiki/Actions.md CHANGED
@@ -279,7 +279,7 @@ export const likePost = mutator({
279
279
 
280
280
  | Code | When | Fix |
281
281
  |---|---|---|
282
- | `X_ACTION_POLICY_MISSING` | an action registered without `policy` | add `policy: can('<name>')` to the declaration |
282
+ | `X_ACTION_POLICY_MISSING` | an action registered without `policy` | add `policy: can('<resource>:<verb>')` (a permission `definePermissions()` declares, never the action's name) or `policy: allow('public')` to the declaration |
283
283
  | `X_ACTION_DUPLICATE` | two actions share an export name | rename one — names are globally unique |
284
284
  | `X_INPUT_INVALID` | body fails the `input` schema — including a string (or a `t.record` key) carrying U+0000, which every string-backed `t` refuses because Postgres `text`/`jsonb` cannot store it. Tabs, newlines and the other C0 controls are accepted. `As of 2026-09-29` | `x actions show <name> --json` prints the expected schema |
285
285
  | `X_FORBIDDEN` | the policy said no — one code for the direct call, the HTTP 403 and the MCP tool error | grant the capability, or call as an actor who has it |
@@ -87,7 +87,7 @@ x new <name> [--dir path] [--shape api|blog|dashboard] [--no-example] [--no-git]
87
87
  | `--shape` | string | none | start from an app shape — `api`, `blog` or `dashboard`, each an overlay over this scaffold ([Shapes](Shapes)). An unknown name is `X_NEW_SHAPE_UNKNOWN`; with `--no-example`, `X_NEW_SHAPE_CONFLICT` (a shape is its own example). Both refuse before a file is written. `dashboard` then runs `x g sign-in --password` in the new app (listed under `data.generate` by `--dry-run`); a refusal there is `X_NEW_SHAPE_GENERATE_FAILED` |
88
88
  | `--git` / `--no-git` | boolean | `true` | `git init`, then one commit named `x new`. On by default because three surfaces assume a repository — `x affected`, `x ci` and `x pr`. A git that is absent or fails never fails `x new`: the tree is the verdict, and `data.git` carries `{ initialized, committed, problem }` |
89
89
  | `--dry-run` | boolean | `false` | print the file list, write nothing |
90
- | `--force` | boolean | `false` | write into a directory that already exists |
90
+ | `--force` | boolean | `false` | write into a directory that already exists and holds no `app.config.ts`. Over an app it is refused, `--force` included (`X_GENERATE_CONFLICT`), and the fix names a free directory (`<name>-2`), never `--force`. `As of 2026-11` |
91
91
 
92
92
  **The name must be one `app.config.ts` accepts.** `x new` asks core's own `defineConfig` about the slug before anything is planned (`appNameIssue`, `packages/cli/src/app-name.ts`) — it is written verbatim as `name:`. Refused with `X_CLI_BAD_FLAG` and a corrected name in the `fix:`, the rest of your flags kept:
93
93
 
@@ -74,7 +74,7 @@ Measured on a fresh scaffold, `As of 2026-08-23`.
74
74
  ## 1. Write your first action
75
75
 
76
76
  ```
77
- x g action publish-post
77
+ x g action publish-post --feature post
78
78
  ```
79
79
 
80
80
  ```ts
@@ -69,7 +69,7 @@ one.
69
69
  | `--shape <shape>` | none | start from `api`, `blog` or `dashboard` instead of the dashboard and example slice — what each writes and leaves out: [Shapes](Shapes) |
70
70
  | `--git` / `--no-git` | `--git` | `git init` and commit the scaffold |
71
71
  | `--dry-run` | off | print the file list, write nothing |
72
- | `--force` | off | write into a directory that already exists |
72
+ | `--force` | off | write into a directory that already exists and holds no `app.config.ts`; never over an app |
73
73
  | `--json` | off | machine-readable result: the directory, every path written, the git outcome |
74
74
 
75
75
  There is **no** `--admin`, `--locale`, `--tz`, `--currency`, `--no-install` or `--yes` — this table
@@ -201,6 +201,6 @@ Read tools are unrestricted in dev; write tools are scoped to branch environment
201
201
  | Remove dev state (embedded PG, storage, caches) | `rm -rf .x` |
202
202
  | Remove the CLI | it ships with the app; deleting the repo is the uninstall |
203
203
 
204
- Framework ranges: an app declares every `@ultimat3/*` package at `^<version>`, as `x new` writes it, and `bun.lock` pins the exact build. Keep them on one version: the packages move in lockstep, and `x upgrade` moves them together. A third-party wrapper declares them as `peerDependencies` at `^<major>` ([Publish it](Building-Your-Own-Base#publish-it)).
204
+ Framework pins: an app declares every `@ultimat3/*` package at the exact `<version>`, as `x new` and `x upgrade` write it; a range is `X_FRAMEWORK_PIN_RANGE` on `x doctor`. Keep them on one version: the packages move in lockstep, and `x upgrade` moves them together. A third-party wrapper declares them as `peerDependencies` at `^<major>` ([Publish it](Building-Your-Own-Base#publish-it)).
205
205
 
206
206
  Version pinning: `As of 2026-11`, the Bun floor is the one stated at the top of this page and 2.0 the target; SolidJS 2 is in beta and is pinned exactly, and its upgrade is framework work, not app work. There is no ArkType or Drizzle pin to carry — `@ultimat3/schema` ships its own dependency-free validators and `@ultimat3/entity` its own `postgresDriver()`. Details and codemod inventory in [Upgrading](Upgrading). Boot failures and port conflicts in [Troubleshooting](Troubleshooting).
package/wiki/Money.md CHANGED
@@ -270,9 +270,11 @@ import { formatMoney } from '@ultimat3/money';
270
270
 
271
271
  ## An amount a person typed — `parseAmount`
272
272
 
273
- `As of 2026-11-06`. `parseAmount(text, { currency, locale })` reads the separators and digits of
273
+ `As of 2026-11-16`. `parseAmount(text, { currency, locale })` reads the separators and digits of
274
274
  the person's locale off `Intl.NumberFormat`, then hands the digits to `fromDecimal` as a string:
275
- no float, ever.
275
+ no float, ever. **Whatever `formatMoney` shows in that locale reads back to the same amount**:
276
+ every display (`symbol`, `code`, `narrowSymbol`) and `accounting`, held by
277
+ `packages/testing/src/property-money.test.ts`.
276
278
 
277
279
  | Text | Locale | Currency | Answer |
278
280
  |---|---|---|---|
@@ -283,9 +285,22 @@ no float, ever.
283
285
  | `1,234` | `en-US` | USD | 123400 |
284
286
  | `1,234` | `de-DE` | EUR | refused: three fraction digits, EUR has two |
285
287
  | `1.5` | `de-DE` | EUR | refused: `.` does not group as `de-DE` groups |
288
+ | `€ 1.234,56` or `1 234,56` | `de-AT` | EUR | 123456 — the price form and the plain-number form |
289
+ | `1'234.56 CHF` or `1'234,56` | `fr-CH` | CHF | 123456 |
290
+ | `ZAR 1 234,56` | `en-ZA` | ZAR | 123456 — the code is stripped before the symbol `R` inside it |
291
+ | `(USD 0.01)` | `en-US` | USD | -1 — the locale's accounting parentheses |
292
+ | `(1,00)` | `de-AT` | EUR | refused: `de-AT` writes no accounting parentheses |
293
+ | `1.234,56` | `en-DE` | EUR | refused: the currency form is `€1,234.56`, see below |
286
294
 
287
- The locale's currency symbol and the currency code are ignored, a sign is `-` or the locale's
288
- minus. Every refusal is `X_MONEY_INPUT_INVALID` (422), whose cause names the character: re-prompt
295
+ | Rule | Detail |
296
+ |---|---|
297
+ | Separator sets | every currency form's (decimal, group, grouping) first, the plain number's last. CLDR gives them apart: `de-AT` groups a price with `.` and a number with a no-break space; `mr-IN` and `en-IN`'s accounting form group a price the Western way |
298
+ | Never two amounts | a set whose group mark is an earlier set's decimal mark, or the reverse, is dropped. `en-DE` writes `€1,234.56` and the plain number `1.234,56`, so only the currency form reads there. Sets that agree on both marks cannot read one text two ways |
299
+ | Marks | the code, the symbol and the narrow symbol are ignored, longest first |
300
+ | Sign | `-`, the locale's minus, or the whole amount in parentheses where the locale's accounting form uses them; both at once is refused |
301
+ | Out of contract | `display: 'name'` (`1,234.56 US dollars`): the name is a plural phrase, not a mark. Ask for the amount and render the name beside the field |
302
+
303
+ Every refusal is `X_MONEY_INPUT_INVALID` (422), whose cause names the character: re-prompt
289
304
  the person, never round or guess.
290
305
 
291
306
  ## Where money appears in the framework
@@ -244,13 +244,13 @@ the `DownloadFile` and `await runRecording.url(input, { ctx })` the path.
244
244
 
245
245
  ## `live: true` requires deterministic, bounded SQL
246
246
 
247
- `x verify` rejects a live query without both an `orderBy` and a `limit`.
247
+ A live query without a `.limit()` is `X_QUERY_LIVE_UNBOUNDED` wherever its source is built (`packages/query/src/live-bounds.ts`), so `x verify`'s `exercise` step rejects it. As of 2026-11.
248
248
 
249
249
  | Requirement | Why | Failure |
250
250
  |---|---|---|
251
- | `orderBy` on a total order | the matcher decides *enters / leaves / moves within* the result from the changed row alone | `x verify` error naming the query |
252
- | `limit` | an unbounded result set has no bounded change buffer and no bounded reconnect snapshot | `x verify` error naming the query |
253
- | No `now()`, `random()`, or non-deterministic function | the same `(input, row)` must always yield the same membership answer | `x verify` error naming the expression |
251
+ | `limit` | an unbounded result set has no bounded change buffer and no bounded reconnect snapshot | `X_QUERY_LIVE_UNBOUNDED` (500) on every read, `exercise` included |
252
+ | `orderBy` | the window's order is what a reader sees; without one it is `id asc` (the order is always made total by the id) | none: the id order is served |
253
+ | No `now()`, `random()`, or non-deterministic function | the same `(input, row)` must always yield the same membership answer | not checked: the author's to keep |
254
254
  | No cross-tenant predicate | tenant scoping comes from `ctx`, not from `input` | `X_FORBIDDEN` at subscribe |
255
255
  | The source reads as its subscriber's tenant | a sync node shares one read per `(query, input)` **per org**, in a context carrying that org — so `repo.list(limit)` needs no org argument on a live query, exactly as on a request | a source naming another org is `X_TENANCY_ACTOR_MISMATCH`; a subscriber with no org reading a tenant table is `X_TENANCY_ACTOR_ORG_REQUIRED` |
256
256
 
package/wiki/Realtime.md CHANGED
@@ -260,7 +260,7 @@ Solid signal patch — fine-grained, no re-render of the list
260
260
  | socket | `sync` (stateless, no sticky sessions) | client re-subscribes anywhere; scales on connection count |
261
261
  | authz | `policy` on the `query` | evaluated at subscribe **and** re-checked on row delivery — a row that fails the policy is dropped, never sent |
262
262
 
263
- The matcher is why this is affordable: membership is decided from the changed row plus the query's predicate, order, and limit — never by re-running the query. Which is exactly why `live: true` requires a deterministic, bounded `sql` ([Queries and live queries](Queries-And-Live-Queries)).
263
+ The matcher is why this is affordable: membership is decided from the changed row plus the query's predicate, order, and limit — never by re-running the query. Which is exactly why `live: true` requires a bounded `sql`: no `.limit()` is `X_QUERY_LIVE_UNBOUNDED` when the source is built ([Queries and live queries](Queries-And-Live-Queries)).
264
264
 
265
265
  ## One record per `type:key`
266
266
 
@@ -770,7 +770,7 @@ Verbatim shapes: [`packages/realtime/src/errors.ts`](https://github.com/develope
770
770
  - Truth is always the server. A client is never the merge authority.
771
771
  - One authz system — the `query`'s `policy`, re-evaluated per delivered row.
772
772
  - `sync` is stateless. Any state that must survive a restart lives in Postgres or NATS.
773
- - A live query must be deterministic and bounded (`orderBy` + `limit`), or `x verify` rejects it.
773
+ - A live query must be bounded: a `live: true` read whose `sql:` declares no `.limit()` is refused `X_QUERY_LIVE_UNBOUNDED` wherever its source is built (`packages/query/src/live-bounds.ts`, called by `read.ts`) — the subscribe, the route, and `x verify`'s `exercise` step, which reads every query once. Its order is deterministic by construction: the declared `orderBy` keys, then `id`.
774
774
  - Presence and typing indicators are tier 1 forever — never model ephemeral state as rows.
775
775
  - `local` does no I/O, no `Date.now()`, no `Math.random()`. It must be replayable.
776
776
  - Offline writes go through the tier-3 mutator queue, never Background Sync guesswork.
@@ -160,8 +160,9 @@ export const todoList = query({
160
160
  }),
161
161
  policy: canTodoRead,
162
162
  live: true,
163
- // Opt-in, unlike an action's tool: a read hands rows to an agent, so silence exposes nothing.
164
- mcp: { expose: true, description: 'todoList — edit this description' },
163
+ // No `mcp`, as an action writes none: a tool's description is what an agent reads to decide to
164
+ // call it, and a placeholder there is worse than no tool. A read hands rows to an agent, so
165
+ // silence exposes nothing. Write one, then `mcp: { expose: true, description: '…' }`.
165
166
  sql: ({ limit, sort, dir }) =>
166
167
  // `feature.table`, not the kebab plural: `from()` quotes the identifier into the SQL text,
167
168
  // and the entity created the table as snake_case.
package/wiki/Upgrading.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Upgrading
2
2
 
3
- **`As of 2026-08`. Semver applies from here.** A breaking change to a documented API needs a major. Every `@ultimat3/*` package moves in lockstep — never mix versions. `x new` declares them at `^<version>`, so `bun update` takes a same-major fix before the first hop; `x upgrade` rewrites every pin it moves exact (`20.1.0`, no caret), on purpose — a caret is how `^19.0.0` beside `^19.4.0` came to be mixed, and a range is a silent upgrade. `bun.lock` pins the exact build either way.
3
+ **`As of 2026-08`. Semver applies from here.** A breaking change to a documented API needs a major. Every `@ultimat3/*` package moves in lockstep — never mix versions. `x new` declares them at the exact version and `x upgrade` rewrites every pin it moves exact (`20.1.0`, no caret), on purpose — a caret is how `^19.0.0` beside `^19.4.0` came to be mixed, and a range is a silent upgrade that skips the hop's codemods. `x doctor` reports a ranged pin (`X_FRAMEWORK_PIN_RANGE`), naming the exact version to write.
4
4
 
5
5
  > **From v31, one major per 90 days.** The window, what semver covers, the support window and the security exception: [Stability](Stability). A removal now ships its `@deprecated` alias for at least one minor before a major takes it, so `x upgrade` across one major names no edit a minor did not already warn about. The 30 sections below stay as they are.
6
6
 
@@ -300,6 +300,7 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
300
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
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
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` |
303
+ | two shipped guards report more (**31.40.0**), built in: `raw-colour` (`X_RAW_COLOUR`) also reads a component's inline `style` (`style={{ color: '#f00' }}`, a quoted CSS string), and `untranslated-string` (`X_UNTRANSLATED_STRING`) also reads typed user-facing attributes (`aria-label`, `title`, `placeholder`, `alt`, …). A third, `undeclared-env` (`X_UNDECLARED_ENV`), is new: a raw `process.env.X` / `Bun.env.X` that `app.config.ts` does not declare. Every app runs them on its next install; a copy still in `guards/` keeps the old rule until `x upgrade` migrates it to the release after 31.39.0 | each finding names its edit: a semantic token, a `t('…')` key, or the `envSchema` entry to add; `"<name>": "off"` in `guards/shipped.json` opts out |
303
304
 
304
305
  ## 29.x → 30.0.0, entry by entry
305
306