@ultimat3/cli 31.14.0 → 31.16.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 +1 -1
- package/README.md +3 -2
- package/package.json +29 -29
- package/src/budgets-requests.ts +37 -0
- package/src/budgets.ts +20 -1
- package/src/cmd-doctor.ts +47 -37
- package/src/cmd-exercise.ts +14 -1
- package/src/cmd-upgrade.ts +19 -2
- package/src/coverage-floor.ts +2 -2
- package/src/dev-boot.ts +2 -2
- package/src/dev-route-table.ts +5 -9
- package/src/doctor-env-reserved.ts +111 -0
- package/src/doctor-floor.ts +62 -0
- package/src/doctor-pins.ts +101 -0
- package/src/doctor-probe.ts +21 -1
- package/src/doctor-row-security.ts +119 -4
- package/src/doctor-warnings.ts +55 -0
- package/src/document-options.ts +0 -7
- package/src/error-codes-doctor.ts +24 -0
- package/src/error-codes.ts +5 -0
- package/src/exercise-floor-report.ts +138 -0
- package/src/exercise-floor-verdict.ts +98 -0
- package/src/exercise-floor.ts +158 -0
- package/src/island-bundle.ts +52 -12
- package/src/island-disposer.ts +1 -1
- package/src/island-group-cache.ts +4 -0
- package/src/island-link-check.ts +73 -0
- package/src/island-vendor.ts +183 -0
- package/src/mcp-errors.ts +11 -1
- package/src/messages-upgrade.ts +13 -0
- package/src/messages.ts +3 -0
- package/src/prerender.ts +7 -7
- package/src/route-islands-preload.ts +54 -11
- package/src/runtime-admin.ts +2 -4
- package/src/runtime-render-document.ts +34 -13
- package/src/runtime-render.ts +58 -30
- package/src/serve-web.ts +8 -11
- package/src/static-images.ts +25 -4
- package/src/static-precompress.ts +57 -0
- package/src/style-bundle.ts +28 -6
- package/src/templates/guard-island-mount-clears.ts +151 -0
- package/src/templates/island.ts +8 -7
- package/src/templates/resource-form-island.ts +12 -9
- package/src/templates/scaffold-docs.ts +1 -0
- package/src/templates/scaffold-guards.ts +4 -1
- package/src/templates/scaffold-shell.ts +12 -9
- package/src/templates/scaffold-verify-floor.ts +4 -0
- package/src/test-dotenv.ts +15 -2
- package/src/theme-brand.ts +18 -20
- package/src/upgrade-coverage.ts +109 -0
- package/src/upgrade-document.ts +18 -0
- package/src/upgrade-exercise-floor.ts +53 -0
- package/src/upgrade-gate.ts +68 -25
- package/src/upgrade-guards.ts +159 -0
- package/src/upgrade-report.ts +29 -1
- package/src/verify-checks.ts +3 -1
- package/src/verify-floor.ts +13 -0
- package/wiki/CLI-Reference.md +26 -3
- package/wiki/Client-Data.md +52 -0
- package/wiki/Configuration.md +17 -0
- package/wiki/MCP-And-AI.md +42 -1
- package/wiki/Notify.md +6 -0
- package/wiki/PWA-And-Offline.md +11 -0
- package/wiki/Realtime.md +4 -3
- package/wiki/SEO.md +1 -1
- package/wiki/Static-Assets.md +30 -3
- package/wiki/Testing.md +64 -2
- package/wiki/Theming.md +6 -6
- package/wiki/Upgrading.md +11 -0
package/src/upgrade-gate.ts
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
// A hop's gate, run by the CLI the hop just installed:
|
|
2
|
-
//
|
|
3
|
-
// framework (`local-cli.ts`)
|
|
4
|
-
// a foreign document, and one that will not parse is
|
|
1
|
+
// A hop's gate, run by the CLI the hop just installed: manifest, doctor, the missing guards and a
|
|
2
|
+
// Bun-floor hop's coverage (`upgrade-guards.ts`, `upgrade-coverage.ts`), exercise, verify. Never in
|
|
3
|
+
// this process: the installed CLI knows the installed framework (`local-cli.ts`) and may be majors
|
|
4
|
+
// older, so each answer is read as a foreign document, and one that will not parse is never green.
|
|
5
5
|
|
|
6
6
|
// why: Bun exposes no path-join primitive; the installed bin is assembled from the app root.
|
|
7
7
|
import { join } from 'node:path';
|
|
8
8
|
import { t } from '@ultimat3/schema';
|
|
9
9
|
import type { ExecResult, Runner } from './exec';
|
|
10
10
|
import { execOutput } from './exec';
|
|
11
|
+
import { exerciseReportStamp } from './exercise-floor-report';
|
|
11
12
|
import { LOCAL_CLI_BIN } from './local-cli';
|
|
13
|
+
import type { CoverageRebaseline, HopCoverage } from './upgrade-coverage';
|
|
14
|
+
import { rebaselineCoverage, statedCoverage } from './upgrade-coverage';
|
|
15
|
+
import { documentIn } from './upgrade-document';
|
|
16
|
+
import type { HopExerciseFloor } from './upgrade-exercise-floor';
|
|
17
|
+
import { ratchetExerciseFloor } from './upgrade-exercise-floor';
|
|
18
|
+
import type { WithheldGuard } from './upgrade-guards';
|
|
19
|
+
import { installMissingGuards } from './upgrade-guards';
|
|
12
20
|
import { parseJson } from './upgrade-registry';
|
|
13
21
|
|
|
22
|
+
// Where it always was: `verify-exercise.ts` and `verify-budgets-build.ts` read it from here.
|
|
23
|
+
export { documentIn } from './upgrade-document';
|
|
24
|
+
|
|
14
25
|
const FINDING = t.object({
|
|
15
26
|
code: t.string,
|
|
16
27
|
cause: t.string,
|
|
@@ -80,8 +91,14 @@ interface DoctorDocument {
|
|
|
80
91
|
export interface HopGuards {
|
|
81
92
|
/** False when the hop's `x doctor` predates the listing: unknown, which is not the same as none. */
|
|
82
93
|
readonly reported: boolean;
|
|
94
|
+
/** Still missing after the hop: the ones it withheld, each with the command that adds it. */
|
|
83
95
|
readonly missing: readonly { readonly name: string; readonly add: string }[];
|
|
96
|
+
/** Held in another form: the app's edit, listed and never touched. */
|
|
84
97
|
readonly differs: readonly { readonly name: string; readonly refresh: string }[];
|
|
98
|
+
/** Written by this hop from the installed release's template; `boundaries` found nothing more. */
|
|
99
|
+
readonly installed: readonly string[];
|
|
100
|
+
/** Not written, with how many findings each would have added (`upgrade-guards.ts`). */
|
|
101
|
+
readonly withheld: readonly WithheldGuard[];
|
|
85
102
|
}
|
|
86
103
|
|
|
87
104
|
/**
|
|
@@ -98,7 +115,11 @@ export interface HopExercise {
|
|
|
98
115
|
export interface HopGate {
|
|
99
116
|
readonly manifest: { readonly ok: boolean; readonly findings: readonly GateFinding[] };
|
|
100
117
|
readonly guards: HopGuards;
|
|
118
|
+
/** The coverage floor a Bun-floor hop moved to what it measured; null when none moved. */
|
|
119
|
+
readonly coverage: HopCoverage | null;
|
|
101
120
|
readonly exercise: HopExercise;
|
|
121
|
+
/** The exercise figures the hop wrote into `x.verify.json` as its ratchet; null when none. */
|
|
122
|
+
readonly exerciseFloor: HopExerciseFloor | null;
|
|
102
123
|
readonly verify: {
|
|
103
124
|
readonly ok: boolean;
|
|
104
125
|
readonly summary: string;
|
|
@@ -108,21 +129,6 @@ export interface HopGate {
|
|
|
108
129
|
};
|
|
109
130
|
}
|
|
110
131
|
|
|
111
|
-
/**
|
|
112
|
-
* The one JSON document on a child's stdout. Whole first; then its last line that parses, because
|
|
113
|
-
* the CLI that keeps fd 1 to one document under `--json` is a recent one and a hop can install one
|
|
114
|
-
* that still logs a boot line ahead of it.
|
|
115
|
-
*/
|
|
116
|
-
export function documentIn(stdout: string): unknown {
|
|
117
|
-
const whole = parseJson(stdout.trim());
|
|
118
|
-
if (whole !== undefined) return whole;
|
|
119
|
-
const lines = stdout.split('\n').filter((line) => line.trimStart().startsWith('{'));
|
|
120
|
-
return lines
|
|
121
|
-
.reverse()
|
|
122
|
-
.map(parseJson)
|
|
123
|
-
.find((parsed) => parsed !== undefined);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
132
|
const flatten = (document: {
|
|
127
133
|
readonly steps?: VerifyDocument['steps'];
|
|
128
134
|
readonly findings?: readonly RawFinding[];
|
|
@@ -192,15 +198,31 @@ const readGuards = (result: ExecResult): HopGuards => {
|
|
|
192
198
|
const parsed = DOCTOR.safeParse(documentIn(result.stdout));
|
|
193
199
|
const guards =
|
|
194
200
|
parsed.issues === undefined ? (parsed.value as DoctorDocument).data?.guards : undefined;
|
|
195
|
-
if (guards === undefined)
|
|
196
|
-
|
|
201
|
+
if (guards === undefined) {
|
|
202
|
+
return { reported: false, missing: [], differs: [], installed: [], withheld: [] };
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
reported: true,
|
|
206
|
+
missing: guards.missing ?? [],
|
|
207
|
+
differs: guards.differs ?? [],
|
|
208
|
+
installed: [],
|
|
209
|
+
withheld: [],
|
|
210
|
+
};
|
|
197
211
|
};
|
|
198
212
|
|
|
199
|
-
|
|
213
|
+
export type HopStage = 'manifest' | 'doctor' | 'guards' | 'coverage' | 'exercise' | 'verify';
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The gate, in order, each stage told apart by `onStage` so a long gate is not a long silence.
|
|
217
|
+
* `guards` runs only when the doctor lists a missing one; `coverage` only on a hop that moved the
|
|
218
|
+
* Bun floor — both before `verify`, so the verdict is the one on the tree the hop leaves.
|
|
219
|
+
*/
|
|
200
220
|
export async function runHopGate(input: {
|
|
201
221
|
readonly runner: Runner;
|
|
202
222
|
readonly root: string;
|
|
203
|
-
readonly onStage: (stage:
|
|
223
|
+
readonly onStage: (stage: HopStage) => void;
|
|
224
|
+
/** Present when the hop moved the Bun floor: what the coverage rebaseline's `why` says. */
|
|
225
|
+
readonly bunMoved?: CoverageRebaseline;
|
|
204
226
|
}): Promise<HopGate> {
|
|
205
227
|
const { runner, root, onStage } = input;
|
|
206
228
|
const installed = (args: readonly string[]): Promise<ExecResult> =>
|
|
@@ -208,12 +230,33 @@ export async function runHopGate(input: {
|
|
|
208
230
|
onStage('manifest');
|
|
209
231
|
const manifest = readManifest(await installed(['manifest', '--json']));
|
|
210
232
|
onStage('doctor');
|
|
211
|
-
const
|
|
233
|
+
const listed = readGuards(await installed(['doctor', '--json']));
|
|
234
|
+
let guards = listed;
|
|
235
|
+
if (listed.missing.length > 0) {
|
|
236
|
+
onStage('guards');
|
|
237
|
+
const done = await installMissingGuards({ cli: installed, root, missing: listed.missing });
|
|
238
|
+
const still = new Set(done.withheld.map((guard) => guard.name));
|
|
239
|
+
guards = {
|
|
240
|
+
...listed,
|
|
241
|
+
missing: listed.missing.filter((guard) => still.has(guard.name)),
|
|
242
|
+
...done,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
let coverage: HopCoverage | null = null;
|
|
246
|
+
const stated = input.bunMoved === undefined ? undefined : await statedCoverage(root);
|
|
247
|
+
if (input.bunMoved !== undefined && stated !== undefined) {
|
|
248
|
+
onStage('coverage');
|
|
249
|
+
coverage = await rebaselineCoverage({ cli: installed, root, stated, bun: input.bunMoved });
|
|
250
|
+
}
|
|
251
|
+
// The report's stamp first: only a report this exercise rewrote is ratcheted.
|
|
252
|
+
const stamp = await exerciseReportStamp(root);
|
|
212
253
|
onStage('exercise');
|
|
213
254
|
const exercise = readExercise(await installed(['exercise', '--json']));
|
|
255
|
+
// Before `verify`, from the report that exercise just wrote: the gate judges the figures it holds.
|
|
256
|
+
const exerciseFloor = await ratchetExerciseFloor(root, stamp);
|
|
214
257
|
onStage('verify');
|
|
215
258
|
const verify = readVerify(await installed(['verify', '--json']));
|
|
216
|
-
return { manifest, guards, exercise, verify };
|
|
259
|
+
return { manifest, guards, coverage, exercise, exerciseFloor, verify };
|
|
217
260
|
}
|
|
218
261
|
|
|
219
262
|
/** What a repository with no app can still be asked, in the order an author would run them. */
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// A hop's missing shipped guards, installed by the CLI the hop just installed (`x g guard <name>`,
|
|
2
|
+
// that release's own template) — each one only if the `boundaries` step finds nothing more with it
|
|
3
|
+
// on disk. One the tree breaks is taken back out — every file its run listed, the refreshed manifest
|
|
4
|
+
// too, put back as it was — and listed; an app-modified guard is never touched (`differs`).
|
|
5
|
+
|
|
6
|
+
// why: Bun exposes no path-join primitive; a written guard's path is relative to the app root.
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { MANIFEST_FILENAME } from '@ultimat3/manifest';
|
|
9
|
+
import { t } from '@ultimat3/schema';
|
|
10
|
+
import type { ExecResult } from './exec';
|
|
11
|
+
import { documentIn } from './upgrade-document';
|
|
12
|
+
|
|
13
|
+
const GENERATED = t.object({
|
|
14
|
+
data: t.optional(t.object({ files: t.optional(t.array(t.string)) })),
|
|
15
|
+
});
|
|
16
|
+
const STEP = t.object({
|
|
17
|
+
name: t.string,
|
|
18
|
+
findings: t.optional(t.array(t.object({ code: t.string }))),
|
|
19
|
+
});
|
|
20
|
+
const BOUNDARIES = t.object({ steps: t.array(STEP) });
|
|
21
|
+
|
|
22
|
+
/** A missing guard the hop did not install, with what stood in the way. */
|
|
23
|
+
export interface WithheldGuard {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/** The command that writes it anyway; `x verify` then names what it finds. */
|
|
26
|
+
readonly add: string;
|
|
27
|
+
/** How many findings it would add to `boundaries`; null when that could not be measured. */
|
|
28
|
+
readonly findings: number | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GuardInstall {
|
|
32
|
+
readonly installed: readonly string[];
|
|
33
|
+
readonly withheld: readonly WithheldGuard[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Runs the installed CLI with these arguments in the app root. */
|
|
37
|
+
export type InstalledCli = (args: readonly string[]) => Promise<ExecResult>;
|
|
38
|
+
|
|
39
|
+
const MEASURE = ['verify', '--only', 'boundaries', '--json'] as const;
|
|
40
|
+
|
|
41
|
+
/** `boundaries`' finding count, or undefined when this CLI answered no step by that name. */
|
|
42
|
+
const boundariesCount = async (cli: InstalledCli): Promise<number | undefined> => {
|
|
43
|
+
const parsed = BOUNDARIES.safeParse(documentIn((await cli(MEASURE)).stdout));
|
|
44
|
+
if (parsed.issues !== undefined) return undefined;
|
|
45
|
+
const steps = (
|
|
46
|
+
parsed.value as { readonly steps: readonly { name: string; findings?: unknown[] }[] }
|
|
47
|
+
).steps;
|
|
48
|
+
const step = steps.find((candidate) => candidate.name === 'boundaries');
|
|
49
|
+
return step === undefined ? undefined : (step.findings ?? []).length;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** A path's bytes before a run, or null when it did not exist: what a rollback puts back. */
|
|
53
|
+
type Prior = ReadonlyMap<string, Uint8Array | null>;
|
|
54
|
+
|
|
55
|
+
/** One generator run: the paths it listed, and how to put each back. */
|
|
56
|
+
interface Generated {
|
|
57
|
+
readonly files: readonly string[];
|
|
58
|
+
readonly prior: Prior;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Every path a guard run can write, read before it runs: the guard and its test, and the generated
|
|
63
|
+
* contracts `x g` refreshes and lists beside them (`x.manifest.json`, `openapi*.json`). A listed
|
|
64
|
+
* path outside this set has no known prior state and is never deleted.
|
|
65
|
+
*/
|
|
66
|
+
const snapshot = async (root: string, name: string): Promise<Prior> => {
|
|
67
|
+
const paths = new Set([`guards/${name}.ts`, `guards/${name}.test.ts`, MANIFEST_FILENAME]);
|
|
68
|
+
paths.add('openapi.json');
|
|
69
|
+
for await (const path of new Bun.Glob('openapi*.json').scan({ cwd: root })) paths.add(path);
|
|
70
|
+
const prior = new Map<string, Uint8Array | null>();
|
|
71
|
+
for (const path of paths) {
|
|
72
|
+
const file = Bun.file(join(root, path));
|
|
73
|
+
prior.set(path, (await file.exists()) ? await file.bytes() : null);
|
|
74
|
+
}
|
|
75
|
+
return prior;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Writes one guard; what it listed with what stood there before, or undefined when refused. */
|
|
79
|
+
const generate = async (
|
|
80
|
+
cli: InstalledCli,
|
|
81
|
+
root: string,
|
|
82
|
+
name: string,
|
|
83
|
+
): Promise<Generated | undefined> => {
|
|
84
|
+
const prior = await snapshot(root, name);
|
|
85
|
+
const result = await cli(['g', 'guard', name, '--json']);
|
|
86
|
+
if (!result.ok) return undefined;
|
|
87
|
+
const parsed = GENERATED.safeParse(documentIn(result.stdout));
|
|
88
|
+
const listed =
|
|
89
|
+
parsed.issues === undefined
|
|
90
|
+
? (parsed.value as { readonly data?: { readonly files?: readonly string[] } }).data?.files
|
|
91
|
+
: undefined;
|
|
92
|
+
return { files: listed ?? [`guards/${name}.ts`, `guards/${name}.test.ts`], prior };
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** Puts each listed path back: rewritten when it existed before the run, deleted when it did not. */
|
|
96
|
+
const rollback = async (root: string, run: Generated | undefined): Promise<void> => {
|
|
97
|
+
for (const path of run?.files ?? []) {
|
|
98
|
+
const before = run?.prior.get(path);
|
|
99
|
+
// Unknown prior state: leaving a file is recoverable, deleting a committed one is not.
|
|
100
|
+
if (before === undefined) continue;
|
|
101
|
+
const file = Bun.file(join(root, path));
|
|
102
|
+
if (before !== null) await Bun.write(file, before);
|
|
103
|
+
else if (await file.exists()) await file.delete();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Every missing guard, installed or withheld. All at once first — two `boundaries` runs when the
|
|
109
|
+
* tree breaks none of them, the usual case — and one at a time only when the count rose, so the
|
|
110
|
+
* guard that found something is the one taken back out.
|
|
111
|
+
*/
|
|
112
|
+
export async function installMissingGuards(input: {
|
|
113
|
+
readonly cli: InstalledCli;
|
|
114
|
+
readonly root: string;
|
|
115
|
+
readonly missing: readonly { readonly name: string; readonly add: string }[];
|
|
116
|
+
}): Promise<GuardInstall> {
|
|
117
|
+
const { cli, root, missing } = input;
|
|
118
|
+
if (missing.length === 0) return { installed: [], withheld: [] };
|
|
119
|
+
const unmeasured = (guard: { name: string; add: string }): WithheldGuard => ({
|
|
120
|
+
name: guard.name,
|
|
121
|
+
add: guard.add,
|
|
122
|
+
findings: null,
|
|
123
|
+
});
|
|
124
|
+
const base = await boundariesCount(cli);
|
|
125
|
+
if (base === undefined) return { installed: [], withheld: missing.map(unmeasured) };
|
|
126
|
+
|
|
127
|
+
const written = new Map<string, Generated>();
|
|
128
|
+
const withheld: WithheldGuard[] = [];
|
|
129
|
+
for (const guard of missing) {
|
|
130
|
+
const run = await generate(cli, root, guard.name);
|
|
131
|
+
if (run === undefined) withheld.push(unmeasured(guard));
|
|
132
|
+
else written.set(guard.name, run);
|
|
133
|
+
}
|
|
134
|
+
if (written.size === 0) return { installed: [], withheld };
|
|
135
|
+
const together = await boundariesCount(cli);
|
|
136
|
+
if (together !== undefined && together <= base) {
|
|
137
|
+
return { installed: [...written.keys()], withheld: sortByName(withheld) };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Newest first, so each artifact ends at the bytes it held before the first run.
|
|
141
|
+
for (const run of [...written.values()].reverse()) await rollback(root, run);
|
|
142
|
+
const installed: string[] = [];
|
|
143
|
+
let held = base;
|
|
144
|
+
for (const guard of missing.filter(({ name }) => written.has(name))) {
|
|
145
|
+
const run = await generate(cli, root, guard.name);
|
|
146
|
+
const count = run === undefined ? undefined : await boundariesCount(cli);
|
|
147
|
+
if (run !== undefined && count !== undefined && count <= held) {
|
|
148
|
+
installed.push(guard.name);
|
|
149
|
+
held = count;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
await rollback(root, run);
|
|
153
|
+
withheld.push({ ...guard, findings: count === undefined ? null : count - held });
|
|
154
|
+
}
|
|
155
|
+
return { installed, withheld: sortByName(withheld) };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const sortByName = (list: readonly WithheldGuard[]): readonly WithheldGuard[] =>
|
|
159
|
+
[...list].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
package/src/upgrade-report.ts
CHANGED
|
@@ -88,10 +88,36 @@ export const humanLines = (input: {
|
|
|
88
88
|
...(agentsMd === 'link' || agentsMd === 'differs'
|
|
89
89
|
? [msg(agentsMd === 'link' ? 'cli.upgrade.agentsMd.link' : 'cli.upgrade.agentsMd.differs')]
|
|
90
90
|
: []),
|
|
91
|
-
...(gate?.guards.
|
|
91
|
+
...(gate?.guards.installed ?? []).map((name) => msg('cli.upgrade.guardInstalled', { name })),
|
|
92
|
+
...(gate?.guards.withheld ?? []).map((guard) =>
|
|
93
|
+
guard.findings === null
|
|
94
|
+
? msg('cli.upgrade.guardUnmeasured', { fix: guard.add })
|
|
95
|
+
: msg('cli.upgrade.guardWithheld', { fix: guard.add, count: guard.findings }),
|
|
96
|
+
),
|
|
92
97
|
...(gate?.guards.differs ?? []).map((guard) =>
|
|
93
98
|
msg('cli.upgrade.guard', { fix: guard.refresh }),
|
|
94
99
|
),
|
|
100
|
+
...(gate === undefined || gate.coverage === null
|
|
101
|
+
? []
|
|
102
|
+
: [
|
|
103
|
+
msg('cli.upgrade.coverage', {
|
|
104
|
+
file: gate.coverage.file,
|
|
105
|
+
fromLines: gate.coverage.from.lines,
|
|
106
|
+
fromFuncs: gate.coverage.from.funcs,
|
|
107
|
+
toLines: gate.coverage.to.lines,
|
|
108
|
+
toFuncs: gate.coverage.to.funcs,
|
|
109
|
+
lines: Math.floor(gate.coverage.measured.lines * 10) / 10,
|
|
110
|
+
funcs: Math.floor(gate.coverage.measured.funcs * 10) / 10,
|
|
111
|
+
}),
|
|
112
|
+
]),
|
|
113
|
+
...(gate === undefined || gate.exerciseFloor === null
|
|
114
|
+
? []
|
|
115
|
+
: [
|
|
116
|
+
msg('cli.upgrade.exerciseFloor', {
|
|
117
|
+
file: gate.exerciseFloor.file,
|
|
118
|
+
figures: JSON.stringify(gate.exerciseFloor.written),
|
|
119
|
+
}),
|
|
120
|
+
]),
|
|
95
121
|
// The exercise's own list first: every fix it has, before the gate's verdict on the same tree.
|
|
96
122
|
...findingLines([
|
|
97
123
|
...(gate?.exercise.findings ?? []),
|
|
@@ -144,8 +170,10 @@ export const report = (input: {
|
|
|
144
170
|
typescript: input.typescript,
|
|
145
171
|
agentsMd: input.agentsMd ?? null,
|
|
146
172
|
guards: gate?.guards ?? null,
|
|
173
|
+
coverage: gate?.coverage ?? null,
|
|
147
174
|
manifest: gate?.manifest ?? null,
|
|
148
175
|
exercise: gate?.exercise ?? null,
|
|
176
|
+
exerciseFloor: gate?.exerciseFloor ?? null,
|
|
149
177
|
verify: gate?.verify ?? null,
|
|
150
178
|
scripts,
|
|
151
179
|
then,
|
package/src/verify-checks.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { checkUngeneratableMigrations } from './db-ungeneratable';
|
|
|
24
24
|
import { checkDocumentStyles, documentSurfaces } from './document-styles';
|
|
25
25
|
import { driftOutcome } from './drift-store';
|
|
26
26
|
import { checkErrorCodeResolution, checkErrorFixReport } from './error-contract';
|
|
27
|
+
import { withUnprovenFloor } from './exercise-floor-report';
|
|
27
28
|
import { guardFindings } from './guards';
|
|
28
29
|
import { catalogFindings } from './i18n-registration';
|
|
29
30
|
import { isrQueryAdvice } from './isr-query-advice';
|
|
@@ -195,7 +196,8 @@ export const VERIFY_STEPS: readonly VerifyStep[] = [
|
|
|
195
196
|
...TEST_STEPS.slice(0, AFTER_JOB),
|
|
196
197
|
// Every step that loads the app stands down while the load is red: the cause is `manifest`'s,
|
|
197
198
|
// and what a half-filled registry looks like is not a finding (`load-findings.ts`).
|
|
198
|
-
|
|
199
|
+
// The floor's verdict on the report the child wrote rides on the step (`exercise-floor-report.ts`).
|
|
200
|
+
blockedByLoad(withUnprovenFloor(exerciseStep)),
|
|
199
201
|
...TEST_STEPS.slice(AFTER_JOB),
|
|
200
202
|
blockedByLoad({
|
|
201
203
|
name: 'drift',
|
package/src/verify-floor.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { ERROR_DOCS_URL, renderThrowable } from '@ultimat3/core';
|
|
|
11
11
|
import { AGENTS_MD_MAX_BYTES } from '@ultimat3/manifest';
|
|
12
12
|
import type { CoverageFloor } from './coverage-floor';
|
|
13
13
|
import { COVERAGE_FIELD, readCoverageFloor } from './coverage-floor';
|
|
14
|
+
import type { ExerciseFloor } from './exercise-floor';
|
|
15
|
+
import { EXERCISE_FIELD, readExerciseFloor } from './exercise-floor';
|
|
14
16
|
import type { Finding } from './output';
|
|
15
17
|
import type { StepTimeouts } from './verify-deadline';
|
|
16
18
|
import { readStepTimeouts, STEP_TIMEOUT_FIELD } from './verify-deadline';
|
|
@@ -75,6 +77,11 @@ export interface VerifyFloor {
|
|
|
75
77
|
* whole `x verify` under `CI`. Absent is no ceiling, and a CI run names the number to write.
|
|
76
78
|
*/
|
|
77
79
|
readonly skipCeiling?: SkipCeiling;
|
|
80
|
+
/**
|
|
81
|
+
* What the `exercise` step's pass may leave unproven (`exercise-floor.ts`). Absent is a warning
|
|
82
|
+
* naming the figure to write, never red: an app that has not opted in stays green on `main`.
|
|
83
|
+
*/
|
|
84
|
+
readonly exercise?: ExerciseFloor;
|
|
78
85
|
/** Why part of the file is not a floor. The `manifest` step reports these; nothing swallows them. */
|
|
79
86
|
readonly problems: readonly string[];
|
|
80
87
|
}
|
|
@@ -194,6 +201,7 @@ export function parseVerifyFloor(
|
|
|
194
201
|
const coverage = readCoverageFloor(record);
|
|
195
202
|
const rolling = readRollingSince(record);
|
|
196
203
|
const skips = readSkipCeiling(record, declared);
|
|
204
|
+
const exercise = readExerciseFloor(record);
|
|
197
205
|
const rest = {
|
|
198
206
|
...(budget.budget === undefined ? {} : { agentsMdMaxBytes: budget.budget }),
|
|
199
207
|
...(typecheckBin.bin === undefined ? {} : { typecheckBin: typecheckBin.bin }),
|
|
@@ -202,6 +210,7 @@ export function parseVerifyFloor(
|
|
|
202
210
|
...(coverage.coverage === undefined ? {} : { coverage: coverage.coverage }),
|
|
203
211
|
...(rolling.since === undefined ? {} : { rollingSince: rolling.since }),
|
|
204
212
|
...(skips.ceiling === undefined ? {} : { skipCeiling: skips.ceiling }),
|
|
213
|
+
...(exercise.floor === undefined ? {} : { exercise: exercise.floor }),
|
|
205
214
|
};
|
|
206
215
|
const steps = record?.['steps'];
|
|
207
216
|
if (!Array.isArray(steps)) {
|
|
@@ -217,6 +226,7 @@ export function parseVerifyFloor(
|
|
|
217
226
|
...coverage.problems,
|
|
218
227
|
...rolling.problems,
|
|
219
228
|
...skips.problems,
|
|
229
|
+
...exercise.problems,
|
|
220
230
|
],
|
|
221
231
|
};
|
|
222
232
|
}
|
|
@@ -237,6 +247,7 @@ export function parseVerifyFloor(
|
|
|
237
247
|
...coverage.problems,
|
|
238
248
|
...rolling.problems,
|
|
239
249
|
...skips.problems,
|
|
250
|
+
...exercise.problems,
|
|
240
251
|
],
|
|
241
252
|
};
|
|
242
253
|
}
|
|
@@ -330,5 +341,7 @@ const fixFor = (problem: string): string => {
|
|
|
330
341
|
return `x doctor --json # it names your newest migration id: set "${ROLLING_SINCE_FIELD}" in ${VERIFY_FLOOR_FILE} to that, "0" to judge them all, or drop the key`;
|
|
331
342
|
if (problem.includes(`"${SKIP_CEILING_FIELD}"`))
|
|
332
343
|
return `x verify --json # then write "${SKIP_CEILING_FIELD}" in ${VERIFY_FLOOR_FILE} as { "contract": 9 } — a step it runs, a whole number of tests`;
|
|
344
|
+
if (problem.includes(`"${EXERCISE_FIELD}`))
|
|
345
|
+
return `x exercise --json # then write "${EXERCISE_FIELD}" in ${VERIFY_FLOOR_FILE} as { "unprovenMax": 0, "statementsMax": 100 } — a ratio from 0 to 1, a whole number of statements`;
|
|
333
346
|
return `x verify --json # then write ${VERIFY_FLOOR_FILE} as {"steps":["unit","contract"]}, naming only steps it ran`;
|
|
334
347
|
};
|
package/wiki/CLI-Reference.md
CHANGED
|
@@ -637,6 +637,7 @@ below on `--workers` and batching describe 22.6 and earlier where they differ.
|
|
|
637
637
|
| `steps` | steps this repo may never report as skipped (`X_VERIFY_SUITE_VANISHED`) |
|
|
638
638
|
| `coverage` | `{ "lines", "funcs", "why"?, "exclude"?: [{ "glob", "why" }] }` — the floor the `unit` step holds an app's whole source tree to (`X_COVERAGE_BELOW_FLOOR`, `X_COVERAGE_FLOOR_UNSTATED`, `X_COVERAGE_FLOOR_STALE`) → [Testing](Testing#coverage). `x doctor` prints every `exclude` |
|
|
639
639
|
| `stepTimeoutMs` | `{ "<step>": milliseconds }` — a step's own deadline. Default 8 minutes for the six suites, 5 for every other step; past it the step is `X_VERIFY_STEP_TIMEOUT` and its processes are killed |
|
|
640
|
+
| `exercise` | `{ "unprovenMax"?: <0–1>, "statementsMax"?: <whole ≥ 1> }` — what the `exercise` step's pass may leave unproven, and statements per call (`X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_STATEMENTS_OVER_BUDGET`); absent, each is a warning line → [`x exercise`](#x-exercise), `As of 31.16.0` |
|
|
640
641
|
| `isolate` · `typecheckBin` · `agentsMdMaxBytes` | a fresh global per test file · the `tsc`-compatible binary · the `AGENTS.md` byte budget |
|
|
641
642
|
|
|
642
643
|
Either render prints one line per finished step on **stderr** — `{"step":"lint","ok":true,"ms":21987}` —
|
|
@@ -1207,6 +1208,15 @@ It also lists the shipped guards the app's `guards/` does not hold, and the ones
|
|
|
1207
1208
|
|
|
1208
1209
|
A listing, never a finding: deleting or editing a guard is how an app changes a rule, so the verdict does not move.
|
|
1209
1210
|
|
|
1211
|
+
Four warnings about how the app is held, `As of 31.16.0` — beside the verdict, never in it: the exit status, `findings` and `data.codes` stay as they were, and `--json` carries each as `data.warnings[]` (`{ code, cause, fix, docs, at }`). None is a gate step; on `next` they join the verdict, red:
|
|
1212
|
+
|
|
1213
|
+
| Code | Asked | Fix |
|
|
1214
|
+
|---|---|---|
|
|
1215
|
+
| `X_DB_ROW_SECURITY_OFF` | `database.rowSecurity` is off and a raw `` sql`…` `` (or `` Bun.sql`…` ``, `` tx.sql`…` ``, `raw('…')`, `identifier('…')`) outside migrations, seeds and tests names a tenant table — up to five sites listed. Off with no raw tenant SQL is not reported | `database: { rowSecurity: true }` in `app.config.ts`, then `x db gen "row security" && x db migrate` |
|
|
1216
|
+
| `X_VERIFY_STEP_UNFLOORED` | a gate step applies here — its suite files exist, its input is committed — and `x.verify.json` `"steps"` does not hold it, so a deleted suite reads as skipped. `e2e` is never proposed (the scaffold's placeholder skips until a browser driver is registered) | `x verify --only <steps> --json`, then add each step that passed to `"steps"` |
|
|
1217
|
+
| `X_FRAMEWORK_PIN_RANGE` | an `@ultimat3/*` dependency in any of the app's manifests is anything but an exact version or a `workspace:`/`file:`/`link:` path (`^31.0.0`, `*`, `latest`, `>=31 <32`; an `npm:` alias by its own spec), one finding per manifest | the exact version `bun install` resolved, at the line named; then `bun install` |
|
|
1218
|
+
| `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` |
|
|
1219
|
+
|
|
1210
1220
|
**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 }`). A chart that dropped them on purpose keeps a green verdict; an app with no chart is listed nothing.
|
|
1211
1221
|
|
|
1212
1222
|
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.
|
|
@@ -1388,7 +1398,18 @@ A blank `off` reason is `X_CONTRACT_EXERCISE_UNDECLARED`; so is an `exercise.ts`
|
|
|
1388
1398
|
exactly its findings, plus the static half of the tenant proof: an entity with no tenant column
|
|
1389
1399
|
that references one with a tenant and declares no `shared` reason.
|
|
1390
1400
|
|
|
1391
|
-
|
|
1401
|
+
**The `exercise` floor** (`As of 31.16.0`). `x exercise` and the gate step judge the pass against
|
|
1402
|
+
`x.verify.json`'s `exercise` key ([Configuration](Configuration#the-gates-file--xverifyjson)). Without the key every
|
|
1403
|
+
judgement below is a warning line (`! …`, and `data.warnings[]` under `--json`) naming the figure to
|
|
1404
|
+
write, and the run stays green; with it, above a declared figure is red.
|
|
1405
|
+
|
|
1406
|
+
| Judged | Red, once opted in | Warning otherwise |
|
|
1407
|
+
|---|---|---|
|
|
1408
|
+
| unproven ÷ reached — a tenant, crash or scale proof that could not ask | `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, naming the first three | the ratio, rounded up, to write as `unprovenMax`; also when it fell under the floor, naming the lower figure |
|
|
1409
|
+
| a sized-seed table the database refused | `X_EXERCISE_SEED_FAILED`, one per table, naming the entity, the driver's words and its readers — red exactly when the unproven ratio is | the same finding as a line |
|
|
1410
|
+
| one call over its statement ceiling — `statementsMax`, or the entry's own `statements: { max, why }` | `X_STATEMENTS_OVER_BUDGET`, the busiest call and its three largest shapes | the same finding as a line, judged at 100 |
|
|
1411
|
+
|
|
1412
|
+
Errors: `X_CONTRACT_EXERCISE_UNREACHED`, `X_CONTRACT_EXERCISE_UNDECLARED`, `X_DECLARATION_UNKNOWN`, `X_CLI_BAD_FLAG`, `X_EXERCISE_UNPROVEN_ABOVE_FLOOR`, `X_EXERCISE_SEED_FAILED`, `X_STATEMENTS_OVER_BUDGET`.
|
|
1392
1413
|
|
|
1393
1414
|
## x drill
|
|
1394
1415
|
|
|
@@ -1554,7 +1575,7 @@ One major per run, so each hop's gate attributes its red to that hop. `As of 30.
|
|
|
1554
1575
|
| 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` |
|
|
1555
1576
|
| 4 | write exact pins, raise the Bun floor | — |
|
|
1556
1577
|
| 5 | `bun install` | `X_UPGRADE_INSTALL_FAILED`, `fix:` carries the undo |
|
|
1557
|
-
| 6 | the installed CLI: `x manifest`, `x doctor --json`, `x exercise --json
|
|
1578
|
+
| 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 |
|
|
1558
1579
|
|
|
1559
1580
|
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.
|
|
1560
1581
|
|
|
@@ -1572,7 +1593,9 @@ A dry run refuses exactly what the real run would, then stops before step 4. It
|
|
|
1572
1593
|
| `pins[]` | `{ file, name, from, to }` |
|
|
1573
1594
|
| `bun` | `{ from, to, edited[], manual[] }`. `manual[]`: `{ path, line, text, why }`, a site only you can move, listed on every run |
|
|
1574
1595
|
| `agentsMd` | `link`: `AGENTS.md` was byte-identical to `CLAUDE.md` and the hop makes it a relative symlink to it · `linked`: already one · `differs`: two different files, left alone; merge what only `AGENTS.md` says into `CLAUDE.md`, then `ln -sf CLAUDE.md AGENTS.md` · `none`: one of the two is missing · `null`: no hop planned |
|
|
1575
|
-
| `guards` | `{ reported, missing[], differs[] }` from the hop's own `x doctor`.
|
|
1596
|
+
| `guards` | `{ reported, missing[], differs[], installed[], withheld[] }` from the hop's own `x doctor`. `As of 31.16.0` each missing shipped guard is written from the installed release's template and kept when `boundaries` finds nothing more with it on disk: `installed[]` names it. One the tree already breaks is taken back out: `withheld[]` is `{ name, add, findings }` (`findings: null` when the count could not be measured) and `missing[]` still lists it. `differs[]` — the app's edit or an older copy — is never overwritten: `x g guard <name> --force` is yours. `reported: false` is a CLI too old to list them, which is not the same as none |
|
|
1597
|
+
| `coverage` | a hop that moved the Bun floor re-measures unit coverage (`x verify --only unit`); only when that measurement is `X_COVERAGE_BELOW_FLOOR` is the `x.verify.json` `coverage` floor moved to it, the number that fell alone, with a dated `why`: `{ file, measured, from, to, why }`. `null` when nothing moved |
|
|
1598
|
+
| `exerciseFloor` | `{ file, written }`: the `exercise` keys (`unprovenMax`, `statementsMax` ≥ 100) the hop's own `x exercise` measured, written into an `x.verify.json` that stated none, so the hop stays green and the floor only falls. A key the app already wrote is never touched; `null` when nothing was written |
|
|
1576
1599
|
| `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
|
|
1577
1600
|
| `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 |
|
|
1578
1601
|
| `verify` | `{ ok, summary, failed[], findings[] }`, each finding `{ step?, code, cause, fix, at? }` |
|
package/wiki/Client-Data.md
CHANGED
|
@@ -198,3 +198,55 @@ Layering: the last config layer that states `sharedChunks` wins; absent everywhe
|
|
|
198
198
|
(`mergeIslands`). A value that is not a boolean is refused at boot (`X_CONFIG_INVALID`). `As of
|
|
199
199
|
2026-11`.
|
|
200
200
|
|
|
201
|
+
## One Solid for every island
|
|
202
|
+
|
|
203
|
+
**Off by default, by measurement.** Each island build inlines the part of Solid it uses, ~14 kB
|
|
204
|
+
tree-shaken. `islands: { vendorSolid: true }` in `app.config.ts` builds Solid ONCE instead, as
|
|
205
|
+
`/islands/vendor-solid.<hash>.js` (`solid-js`, `solid-js/web`, `solid-js/store`, whole: 48,083 B,
|
|
206
|
+
17,388 B gzip), and every island imports it. Named by its bytes, like every island output
|
|
207
|
+
(`packages/cli/src/island-vendor.ts`). Measured `As of 2026-11-12`, Bun 1.4.4, solid-js 1.9.17.
|
|
208
|
+
|
|
209
|
+
| Turn it on when | Leave it off when |
|
|
210
|
+
|---|---|
|
|
211
|
+
| a route renders four or more Solid islands that are built apart (not one route group) | a route renders one to three Solid islands — every Solid route of the three tracked apps grew 33,572–38,769 B with it on |
|
|
212
|
+
| `x build --target static`, then `x verify --only budgets`, shows the routes shrinking | any route's `budget.js` grows past its budget |
|
|
213
|
+
|
|
214
|
+
The vendor counts once per route in `budget.js`, is precached and preloaded like any shared chunk,
|
|
215
|
+
and adds one request. An island that imports no Solid loads no vendor. An `islands.vendorSolid`
|
|
216
|
+
that is not a boolean is `X_CONFIG_INVALID`.
|
|
217
|
+
|
|
218
|
+
## Island mounts that never leave a blank box
|
|
219
|
+
|
|
220
|
+
**An island's `mount` draws through `mountOver`** (`@ultimat3/render/client`): it clears the
|
|
221
|
+
server's markup for the live render — Solid's `render` APPENDS — and puts that markup back when
|
|
222
|
+
the render throws, then rethrows. The hydration runtime still marks the root `data-x-failed`, and
|
|
223
|
+
`clientErrors` still reports it once. A visitor sees the server's HTML, never an empty box. 167 B
|
|
224
|
+
in a chunk; framework-neutral (the caller hands in the draw).
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import { mountOver } from '@ultimat3/render/client';
|
|
228
|
+
import { render } from 'solid-js/web';
|
|
229
|
+
|
|
230
|
+
function Counter(props: { start: number }) {
|
|
231
|
+
return <p>{props.start}</p>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function mount(el: HTMLElement, props: { start: number }): () => void {
|
|
235
|
+
return mountOver(el, (root) => render(() => <Counter {...props} />, root));
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
`x g island`, `x new` and the resource form island write it. An app scaffolded earlier adopts
|
|
240
|
+
through the `island-mount-clears` guard, which `x new` ships and an older app installs:
|
|
241
|
+
|
|
242
|
+
| Step | Command |
|
|
243
|
+
|---|---|
|
|
244
|
+
| install the guard | `x g guard island-mount-clears` |
|
|
245
|
+
| find each island that empties its wrapper outside `mountOver` | `x verify --only boundaries` — one finding per clear, at its line |
|
|
246
|
+
| fix each | delete `el.textContent = ''` and end `mount` with `return mountOver(el, (root) => render(() => <Island {...props} />, root))` |
|
|
247
|
+
|
|
248
|
+
The guard reads `.textContent = ''`, `.innerHTML = ''` and `.replaceChildren()` on `mount`'s own
|
|
249
|
+
first parameter in a `*.island.tsx` that calls no `mountOver(`. A clear of an element INSIDE the
|
|
250
|
+
wrapper — a handler emptying an output region — is the island's own business and is not read.
|
|
251
|
+
`As of 31.15.0`.
|
|
252
|
+
|
package/wiki/Configuration.md
CHANGED
|
@@ -374,6 +374,7 @@ islands: { sharedChunks: true },
|
|
|
374
374
|
| field | type | default | notes |
|
|
375
375
|
|---|---|---|---|
|
|
376
376
|
| `islands.sharedChunks` | `boolean` | `false` | **read** by `x dev`, the container and `x build`: `true` builds every island in one split bundle, so a module two islands import is one `/islands/chunk-<hash>.js` a page fetches once and a browser caches across pages; each route's `budget.js` counts it once. `false` (the default) groups by route: islands rendered on exactly the same set of routes are one split build sharing their modules, every other island is built alone, self-contained ([Client data](Client-Data#shared-island-chunks)). `true` is one group holding every island: tree shaking across one split build keeps what ANY importer uses, so a small island importing a helper from a module other islands use heavily pays for all of it (`examples/dummy`'s update banner 712 → 16,288 B). Turn it on only when cross-page caching of shared code is worth that, then weigh the routes with `x verify`. A non-boolean → `X_CONFIG_INVALID` |
|
|
377
|
+
| `islands.vendorSolid` | `boolean` | `false` | **read** by `x dev`, the container and `x build`: `true` builds Solid once as `/islands/vendor-solid.<hash>.js` (`solid-js`, `/web`, `/store`, whole) and every island imports it instead of inlining its own tree-shaken copy. Pays only on a route rendering four or more Solid islands built apart: the vendor is 48,083 B (17,388 B gzip) where an island inlines ~14 kB, measured `As of 2026-11-12` (Bun 1.4.4, solid-js 1.9.17) — every Solid route of the three tracked apps grew 33,572–38,769 B with it on ([Client data](Client-Data#one-solid-for-every-island)). A non-boolean → `X_CONFIG_INVALID` |
|
|
377
378
|
|
|
378
379
|
## `clientErrors`
|
|
379
380
|
|
|
@@ -774,6 +775,7 @@ Rules:
|
|
|
774
775
|
| `X_ENV_MISSING` is one key, `X_CONFIG_INVALID` is the shape | absent or malformed key → `X_ENV_MISSING` at the `defineEnv` gate. Keys that each parse but contradict each other → `X_CONFIG_INVALID`. The two never overlap |
|
|
775
776
|
| No runtime mutation | config is frozen after `defineConfig`; there is no `setConfig` |
|
|
776
777
|
| Same image, all environments | only env differs. That is what makes staging a real rehearsal ([Deployment](Deployment)) |
|
|
778
|
+
| An app's own name is not a framework name | `FRAMEWORK_ENV` (`@ultimat3/core`) lists every name the framework reads. An app name on one it reads as a switch or for itself (`OTEL_*`, `TEST_DATABASE_URL`, any `ULTIMATE_*`) is `X_ENV_NAME_RESERVED` in `x doctor`, `As of 31.16.0`: rename it `APP_<name>`. An adapter's settings (`S3_*`, `SMTP_URL`, `CLOUDFLARE_*`) are the contract, never reported: declaring them is how an app configures that adapter |
|
|
777
779
|
|
|
778
780
|
## The environment — `resolveEnvironment()`
|
|
779
781
|
|
|
@@ -863,6 +865,21 @@ x doctor --json # env + connectivity + version checks
|
|
|
863
865
|
x verify --json # the gate
|
|
864
866
|
```
|
|
865
867
|
|
|
868
|
+
## The gate's file — `x.verify.json`
|
|
869
|
+
|
|
870
|
+
Not configuration of the app: what `x verify` holds it to, committed at the repo root. Every key is in [CLI reference](CLI-Reference#x-verify); the `exercise` key, `As of 31.16.0`:
|
|
871
|
+
|
|
872
|
+
| Key | Value | Absent |
|
|
873
|
+
|---|---|---|
|
|
874
|
+
| `exercise.unprovenMax` | a ratio from 0 to 1: how many reached primitives the exercise pass may leave `unproven` (`X_EXERCISE_UNPROVEN_ABOVE_FLOOR` above it) | a warning line naming the figure to write; the step stays green |
|
|
875
|
+
| `exercise.statementsMax` | a whole number ≥ 1: statements one call may send, for every primitive whose `defineExercise` entry declares no `statements: { max, why }` (`X_STATEMENTS_OVER_BUDGET` above it) | judged at 100, as a warning line |
|
|
876
|
+
|
|
877
|
+
```json
|
|
878
|
+
{ "exercise": { "unprovenMax": 0, "statementsMax": 100 } }
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
`x new` writes exactly that; `x upgrade` writes the figures the hop measured into a file that states none, so the floor only falls. A malformed value is a `manifest`-step problem naming the shape → [CLI reference](CLI-Reference#x-exercise).
|
|
882
|
+
|
|
866
883
|
`x config show` is **planned**, not shipped — it throws `X_NOT_IMPLEMENTED` naming `x manifest --json` as the closest thing today → [CLI reference](CLI-Reference).
|
|
867
884
|
|
|
868
885
|
Error shapes: [Error codes](Error-Codes). Symptom-first fixes: [Troubleshooting](Troubleshooting). Metrics, spans and logs: [Observability](Observability).
|