@ultimat3/cli 31.27.0 → 31.28.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 (107) hide show
  1. package/CLAUDE.md +3 -1
  2. package/README.md +14 -4
  3. package/package.json +29 -29
  4. package/src/app-manifest.ts +6 -1
  5. package/src/cmd-doctor.ts +11 -3
  6. package/src/cmd-repro-spec.ts +13 -1
  7. package/src/cmd-repro.ts +37 -5
  8. package/src/cmd-upgrade-codemods.ts +71 -0
  9. package/src/cmd-upgrade-spec.ts +19 -5
  10. package/src/cmd-upgrade.ts +91 -34
  11. package/src/codemods/agents-dev-mcp.ts +50 -0
  12. package/src/codemods/authenticator-session-refusal.ts +214 -0
  13. package/src/codemods/biome-no-default-export.ts +58 -0
  14. package/src/codemods/bunfig-island-coverage.ts +33 -0
  15. package/src/codemods/chart-dashboard.ts +73 -0
  16. package/src/codemods/ci-e2e-browser-stock.ts +75 -0
  17. package/src/codemods/ci-e2e-browser.ts +63 -0
  18. package/src/codemods/codemod.ts +58 -0
  19. package/src/codemods/define-error-leaf.ts +73 -0
  20. package/src/codemods/docs-ci-parts.ts +65 -0
  21. package/src/codemods/docs-gate-prose.ts +53 -0
  22. package/src/codemods/docs-island-rows.ts +31 -0
  23. package/src/codemods/docs-shipped-guards.ts +100 -0
  24. package/src/codemods/docs-test-services.ts +62 -0
  25. package/src/codemods/engine-diff.ts +104 -0
  26. package/src/codemods/engine-edits.ts +111 -0
  27. package/src/codemods/engine-fs.ts +95 -0
  28. package/src/codemods/engine.ts +191 -0
  29. package/src/codemods/format-edited-hook-3122.ts +28 -0
  30. package/src/codemods/format-edited-hook.ts +152 -0
  31. package/src/codemods/helm-alerts-objective.ts +105 -0
  32. package/src/codemods/helm-alerts-stock.ts +108 -0
  33. package/src/codemods/index.ts +56 -0
  34. package/src/codemods/metrics-probe-healthz.ts +47 -0
  35. package/src/codemods/pending.ts +36 -0
  36. package/src/codemods/repro-gitignore.ts +40 -0
  37. package/src/codemods/runtime-pin-lines.ts +109 -0
  38. package/src/codemods/runtime-pin.ts +116 -0
  39. package/src/codemods/solid-floor.ts +63 -0
  40. package/src/codemods/test-ports.ts +86 -0
  41. package/src/codemods/test-suites.ts +37 -0
  42. package/src/codemods/theme-toggle-mount-over.ts +70 -0
  43. package/src/codemods/vendored-guards.ts +186 -0
  44. package/src/codemods/verify-floor-skips.ts +88 -0
  45. package/src/codemods/verify-floor-steps.ts +90 -0
  46. package/src/doctor-advisory-floors.ts +113 -0
  47. package/src/doctor-guards.ts +39 -86
  48. package/src/doctor-superseded.ts +67 -0
  49. package/src/error-codes-doctor.ts +12 -4
  50. package/src/error-codes.ts +6 -0
  51. package/src/exercise-database.ts +7 -2
  52. package/src/generate-files.ts +6 -5
  53. package/src/guards-built-in-codes.ts +36 -0
  54. package/src/guards-built-in-refusal.ts +25 -0
  55. package/src/guards-built-in.ts +134 -0
  56. package/src/guards-materialize.ts +42 -0
  57. package/src/guards-paths.ts +37 -0
  58. package/src/guards-shipped-names.ts +38 -0
  59. package/src/guards-vendored.ts +73 -0
  60. package/src/guards.ts +90 -34
  61. package/src/index.ts +10 -0
  62. package/src/lint-findings.ts +3 -3
  63. package/src/mcp-errors.ts +11 -1
  64. package/src/measure-scope.ts +23 -3
  65. package/src/messages-repro.ts +16 -2
  66. package/src/messages-upgrade.ts +15 -0
  67. package/src/messages.ts +1 -1
  68. package/src/repro-archive-collect.ts +161 -0
  69. package/src/repro-archive-write.ts +96 -0
  70. package/src/repro-archive.ts +161 -0
  71. package/src/repro-bundle.ts +8 -16
  72. package/src/repro-errors.ts +14 -2
  73. package/src/repro-framework.ts +53 -0
  74. package/src/repro-parse.ts +87 -0
  75. package/src/repro-redact.ts +218 -0
  76. package/src/repro-scrub.ts +257 -0
  77. package/src/superseded-match.ts +87 -0
  78. package/src/superseded.ts +84 -0
  79. package/src/templates/bun-image.ts +48 -0
  80. package/src/templates/github/ci.yml.ts +1 -1
  81. package/src/templates/guard-released-forms.ts +112 -0
  82. package/src/templates/guard-runtime-pin-test.ts +54 -0
  83. package/src/templates/guard-runtime-pin.ts +189 -0
  84. package/src/templates/scaffold-claude-agents.ts +6 -6
  85. package/src/templates/scaffold-claude-commands.ts +1 -1
  86. package/src/templates/scaffold-claude-hook.ts +18 -8
  87. package/src/templates/scaffold-claude.ts +2 -2
  88. package/src/templates/scaffold-docs.ts +26 -24
  89. package/src/templates/scaffold-guards.ts +73 -39
  90. package/src/templates/scaffold-repo.ts +2 -1
  91. package/src/unthrown-codes.ts +2 -0
  92. package/src/upgrade-bun-floor.ts +4 -0
  93. package/src/upgrade-clean-tree.ts +54 -0
  94. package/src/upgrade-gate-codemods-install.ts +40 -0
  95. package/src/upgrade-gate-codemods.ts +151 -0
  96. package/src/upgrade-gate.ts +38 -6
  97. package/src/upgrade-lock.ts +118 -0
  98. package/src/upgrade-plan.ts +2 -1
  99. package/src/upgrade-report-codemods.ts +54 -0
  100. package/src/upgrade-report.ts +52 -27
  101. package/src/upgrade-signals.ts +91 -0
  102. package/src/upgrade-unfinished.ts +61 -0
  103. package/wiki/CLI-Reference.md +58 -4
  104. package/wiki/Interface-Rules.md +17 -8
  105. package/wiki/Observability.md +1 -0
  106. package/wiki/Project-Layout.md +4 -4
  107. package/wiki/Upgrading.md +5 -0
@@ -0,0 +1,118 @@
1
+ // One `x upgrade` per app at a time: `.x/upgrade.lock`, claimed the way `dev-lock.ts` claims
2
+ // `dev.lock` — written whole to a staging file, then hard-linked into place, so the create and the
3
+ // exclusivity are one syscall. Two hops over one tree would each write pins and install under the other.
4
+
5
+ // why: the claim is synchronous link/write/unlink syscalls with no Bun equivalent, kept in one turn.
6
+ import { linkSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';
7
+ // why: Bun exposes no path-join primitive.
8
+ import { join } from 'node:path';
9
+ import { renderFixShellArg, stringField, UltimateError } from '@ultimat3/core';
10
+ import { isProcessAlive } from './dev-lock';
11
+ import { stealStale } from './dev-lock-steal';
12
+
13
+ /** App-root relative, beside the hop's record in the `.x/` every scaffold ignores. */
14
+ export const UPGRADE_LOCK_FILE = join('.x', 'upgrade.lock');
15
+
16
+ interface Holder {
17
+ readonly pid: number;
18
+ readonly startedAt: string;
19
+ }
20
+
21
+ const parseHolder = (raw: string | undefined): Holder | undefined => {
22
+ if (raw === undefined) return undefined;
23
+ try {
24
+ const value = JSON.parse(raw) as { pid?: unknown; startedAt?: unknown };
25
+ if (typeof value.pid !== 'number') return undefined;
26
+ return {
27
+ pid: value.pid,
28
+ startedAt: typeof value.startedAt === 'string' ? value.startedAt : '',
29
+ };
30
+ } catch {
31
+ return undefined;
32
+ }
33
+ };
34
+
35
+ const readText = (path: string): string | undefined => {
36
+ try {
37
+ return readFileSync(path, 'utf8');
38
+ } catch {
39
+ return undefined;
40
+ }
41
+ };
42
+
43
+ const unwritable = (path: string, error: unknown): UltimateError =>
44
+ new UltimateError({
45
+ code: 'X_UPGRADE_LOCKED',
46
+ cause: `${path} could not be created (${stringField(error, 'code') ?? 'unknown error'}), so this hop cannot prove it is the only one in this app`,
47
+ fix: `ls -ld ${renderFixShellArg(join(path, '..'), '<app>/.x')} # make it writable by this user, on a filesystem with hard links, then: x upgrade --json`,
48
+ });
49
+
50
+ /** Create `path` holding `text`, exclusively: `false` when it already exists. */
51
+ function claim(path: string, text: string): boolean {
52
+ const staged = `${path}.${process.pid}.${crypto.randomUUID().slice(0, 8)}.tmp`;
53
+ try {
54
+ writeFileSync(staged, text);
55
+ linkSync(staged, path);
56
+ return true;
57
+ } catch (error) {
58
+ if (stringField(error, 'code') === 'EEXIST') return false;
59
+ throw unwritable(path, error);
60
+ } finally {
61
+ try {
62
+ unlinkSync(staged);
63
+ } catch {
64
+ // Never written, or already gone: the staging name is unique to this call.
65
+ }
66
+ }
67
+ }
68
+
69
+ export interface LockDeps {
70
+ /** Whether a pid is a live process. */
71
+ readonly alive?: (pid: number) => boolean;
72
+ /** The pid this run records; a test claims as another process. */
73
+ readonly pid?: number;
74
+ }
75
+
76
+ /**
77
+ * Take the app's upgrade lock, or refuse with `X_UPGRADE_LOCKED` naming the live holder. A lock
78
+ * whose holder is gone — a hop killed hard — is taken over under `stealStale`'s guard. Returns the
79
+ * release, which removes the lock only while it still holds this run's bytes.
80
+ */
81
+ export function acquireUpgradeLock(root: string, deps: LockDeps = {}): () => void {
82
+ const alive = deps.alive ?? isProcessAlive;
83
+ const path = join(root, UPGRADE_LOCK_FILE);
84
+ try {
85
+ mkdirSync(join(root, '.x'), { recursive: true });
86
+ } catch (error) {
87
+ throw unwritable(path, error);
88
+ }
89
+ const mine = `${JSON.stringify({ pid: deps.pid ?? process.pid, startedAt: new Date().toISOString() })}\n`;
90
+ for (let attempt = 0; attempt < 3; attempt += 1) {
91
+ if (claim(path, mine)) {
92
+ return () => {
93
+ if (readText(path) === mine) unlinkSync(path);
94
+ };
95
+ }
96
+ const raw = readText(path);
97
+ const holder = parseHolder(raw);
98
+ if (holder !== undefined && alive(holder.pid)) {
99
+ throw new UltimateError({
100
+ code: 'X_UPGRADE_LOCKED',
101
+ cause: `another x upgrade (pid ${String(holder.pid)}, since ${holder.startedAt || 'an unknown time'}) holds ${path}, and two hops in one app would write pins and install under each other`,
102
+ fix: `ps -p ${String(holder.pid)} -o pid,etime,args # the hop holding the lock: let it finish, or stop it, then: x upgrade --json`,
103
+ });
104
+ }
105
+ // Gone, torn or unreadable: stale. Removed only while it still holds the bytes judged.
106
+ if (
107
+ raw !== undefined &&
108
+ stealStale({ path, judged: raw, claim: (p) => claim(p, mine), alive }) === 'busy'
109
+ ) {
110
+ break;
111
+ }
112
+ }
113
+ throw new UltimateError({
114
+ code: 'X_UPGRADE_LOCKED',
115
+ cause: `${path} is being taken over by another x upgrade right now`,
116
+ fix: `cat ${renderFixShellArg(path, '<app>/.x/upgrade.lock')} # the pid now holding it; when that process is gone: x upgrade --json`,
117
+ });
118
+ }
@@ -63,7 +63,8 @@ export function releaseOf(version: string): Triple | undefined {
63
63
 
64
64
  const tripleOf = (version: string): Triple => releaseOf(version) ?? [0, 0, 0];
65
65
 
66
- const compareVersions = (a: string, b: string): number => {
66
+ /** Release order over plain `major.minor.patch`; anything else sorts as `0.0.0`. */
67
+ export const compareVersions = (a: string, b: string): number => {
67
68
  const left = tripleOf(a);
68
69
  const right = tripleOf(b);
69
70
  return left[0] - right[0] || left[1] - right[1] || left[2] - right[2];
@@ -0,0 +1,54 @@
1
+ // The codemod half of what `x upgrade` says: one line per codemod that ran, one per file it
2
+ // changed, and each file it left for the author with the reason and the diff to apply by hand.
3
+
4
+ import type { CodemodsReport } from './codemods/engine';
5
+ import { msg } from './messages';
6
+
7
+ /** Where a hop's codemods came from: the CLI it installed, or this one when that one has none. */
8
+ export type CodemodSource = 'installed' | 'driver';
9
+
10
+ export interface HopCodemods extends CodemodsReport {
11
+ readonly source: CodemodSource;
12
+ /** Present when a codemod changed a `package.json` and the hop ran `bun install` again. */
13
+ readonly reinstalled?: true;
14
+ /** The installed CLI's codemods run failed: nothing applied, and the hop is not done. */
15
+ readonly failure?: { readonly code: string; readonly cause: string; readonly fix: string };
16
+ }
17
+
18
+ export const codemodCounts = (
19
+ report: CodemodsReport,
20
+ ): { readonly count: number; readonly changed: number; readonly skipped: number } => ({
21
+ count: report.applied.length,
22
+ changed: report.applied.reduce((sum, one) => sum + one.changed.length, 0),
23
+ skipped: report.applied.reduce((sum, one) => sum + one.skipped.length, 0),
24
+ });
25
+
26
+ export function codemodLines(report: CodemodsReport | HopCodemods | null): readonly string[] {
27
+ if (report !== null && 'failure' in report && report.failure !== undefined) {
28
+ return [msg('cli.upgrade.codemods.failed', { ...report.failure })];
29
+ }
30
+ if (report === null || report.applied.length === 0) return [];
31
+ return [
32
+ ...('source' in report && report.source === 'driver'
33
+ ? [msg('cli.upgrade.codemods.fromDriver')]
34
+ : []),
35
+ ...report.applied.flatMap((one) => [
36
+ msg('cli.upgrade.codemod', {
37
+ id: one.id,
38
+ since: one.since,
39
+ summary: one.summary,
40
+ changed: one.changed.length,
41
+ skipped: one.skipped.length,
42
+ }),
43
+ ...one.changed.map((path) => msg('cli.upgrade.codemod.changed', { path })),
44
+ ...one.skipped.flatMap((skip) => [
45
+ msg('cli.upgrade.codemod.skipped', { path: skip.path, reason: skip.reason }),
46
+ ...(skip.diff ?? '')
47
+ .trimEnd()
48
+ .split('\n')
49
+ .filter((line) => line !== '')
50
+ .map((line) => ` ${line}`),
51
+ ]),
52
+ ]),
53
+ ];
54
+ }
@@ -9,6 +9,23 @@ import type { BunEdit, BunManual } from './upgrade-bun-floor';
9
9
  import type { GateFinding, HopGate, RepoScript } from './upgrade-gate';
10
10
  import type { UpgradeHop, UpgradePin } from './upgrade-plan';
11
11
  import { pinMoves } from './upgrade-plan';
12
+ import type { HopCodemods } from './upgrade-report-codemods';
13
+ import { codemodLines } from './upgrade-report-codemods';
14
+
15
+ /** A dry run's codemod preview and superseded scan; a hop's come from its gate. */
16
+ interface Previewed {
17
+ readonly codemods?: HopCodemods;
18
+ readonly superseded?: readonly GateFinding[];
19
+ }
20
+
21
+ const supersededLines = (findings: readonly GateFinding[]): readonly string[] =>
22
+ findings.map((finding) =>
23
+ msg('cli.upgrade.superseded', {
24
+ at: finding.at === undefined ? '' : ` (${finding.at})`,
25
+ cause: finding.cause,
26
+ fix: finding.fix,
27
+ }),
28
+ );
12
29
 
13
30
  export interface PlannedWrites {
14
31
  /** Absolute path to final text; a manifest holding both a pin and a floor is written once. */
@@ -63,16 +80,18 @@ const findingLines = (findings: readonly GateFinding[]): readonly string[] =>
63
80
  ]);
64
81
 
65
82
  /** The terminal's form of the report: the url first, then each finding's `fix:`. */
66
- export const humanLines = (input: {
67
- readonly hop: UpgradeHop;
68
- readonly writes: PlannedWrites;
69
- readonly gate: HopGate | undefined;
70
- readonly scripts: readonly RepoScript[];
71
- readonly then: string;
72
- readonly agentsMd?: AgentsLinkState;
73
- /** Manifests whose TypeScript lags the scaffold's: by hand, the hop never moves a compiler. */
74
- readonly typescript: readonly TypescriptLag[];
75
- }): readonly string[] => {
83
+ export const humanLines = (
84
+ input: {
85
+ readonly hop: UpgradeHop;
86
+ readonly writes: PlannedWrites;
87
+ readonly gate: HopGate | undefined;
88
+ readonly scripts: readonly RepoScript[];
89
+ readonly then: string;
90
+ readonly agentsMd?: AgentsLinkState;
91
+ /** Manifests whose TypeScript lags the scaffold's: by hand, the hop never moves a compiler. */
92
+ readonly typescript: readonly TypescriptLag[];
93
+ } & Previewed,
94
+ ): readonly string[] => {
76
95
  const { hop, writes, gate, scripts, then, agentsMd, typescript } = input;
77
96
  return [
78
97
  ...(hop.section === null
@@ -88,6 +107,8 @@ export const humanLines = (input: {
88
107
  ...(agentsMd === 'link' || agentsMd === 'differs'
89
108
  ? [msg(agentsMd === 'link' ? 'cli.upgrade.agentsMd.link' : 'cli.upgrade.agentsMd.differs')]
90
109
  : []),
110
+ ...codemodLines(input.codemods ?? gate?.codemods ?? null),
111
+ ...supersededLines(input.superseded ?? gate?.superseded ?? []),
91
112
  ...(gate?.guards.installed ?? []).map((name) => msg('cli.upgrade.guardInstalled', { name })),
92
113
  ...(gate?.guards.baselined ?? []).map((guard) =>
93
114
  msg('cli.upgrade.guardBaselined', { name: guard.name, count: guard.findings }),
@@ -140,23 +161,25 @@ export const humanLines = (input: {
140
161
  const asJson = (value: unknown): JsonValue => value as JsonValue;
141
162
 
142
163
  /** The one shape every outcome reports: `--json` and the terminal project this and nothing else. */
143
- export const report = (input: {
144
- readonly hop: UpgradeHop;
145
- readonly done: boolean;
146
- readonly dryRun: boolean;
147
- readonly pins: readonly UpgradePin[];
148
- readonly bunFrom: string | null;
149
- readonly bunTo: string | null;
150
- readonly writes: PlannedWrites;
151
- readonly app: boolean;
152
- readonly gate: HopGate | undefined;
153
- readonly scripts: readonly RepoScript[];
154
- readonly then: string;
155
- /** What the hop does to `AGENTS.md` (`upgrade-agents-link.ts`); absent when no hop is planned. */
156
- readonly agentsMd?: AgentsLinkState;
157
- /** `typescript-floor.ts`'s lags — reported on every outcome, an at-target app's included. */
158
- readonly typescript: readonly TypescriptLag[];
159
- }): JsonValue => {
164
+ export const report = (
165
+ input: {
166
+ readonly hop: UpgradeHop;
167
+ readonly done: boolean;
168
+ readonly dryRun: boolean;
169
+ readonly pins: readonly UpgradePin[];
170
+ readonly bunFrom: string | null;
171
+ readonly bunTo: string | null;
172
+ readonly writes: PlannedWrites;
173
+ readonly app: boolean;
174
+ readonly gate: HopGate | undefined;
175
+ readonly scripts: readonly RepoScript[];
176
+ readonly then: string;
177
+ /** What the hop does to `AGENTS.md` (`upgrade-agents-link.ts`); absent when no hop is planned. */
178
+ readonly agentsMd?: AgentsLinkState;
179
+ /** `typescript-floor.ts`'s lags — reported on every outcome, an at-target app's included. */
180
+ readonly typescript: readonly TypescriptLag[];
181
+ } & Previewed,
182
+ ): JsonValue => {
160
183
  const { hop, done, dryRun, pins, bunFrom, bunTo, writes, app, gate, scripts, then } = input;
161
184
  return asJson({
162
185
  from: hop.from,
@@ -175,6 +198,8 @@ export const report = (input: {
175
198
  bun: { from: bunFrom, to: bunTo, edited: writes.edited, manual: writes.manual },
176
199
  typescript: input.typescript,
177
200
  agentsMd: input.agentsMd ?? null,
201
+ codemods: input.codemods ?? gate?.codemods ?? null,
202
+ superseded: input.superseded ?? gate?.superseded ?? [],
178
203
  guards: gate?.guards ?? null,
179
204
  coverage: gate?.coverage ?? null,
180
205
  manifest: gate?.manifest ?? null,
@@ -0,0 +1,91 @@
1
+ // A stopped `x upgrade` stops what it started. Every child carries the hop's tag in
2
+ // `STEP_TAG_ENV`, inherited by the gate's own children; SIGTERM or SIGINT kills that tree
3
+ // (`killTagged`, by pid on Windows), runs the cleanup, then re-raises like `signal-shred.ts`.
4
+
5
+ import type { Runner } from './exec';
6
+ import { killTagged, STEP_TAG_ENV, taskkillTree } from './verify-deadline';
7
+
8
+ /** This hop's word in `STEP_TAG_ENV`: unique per process, so a nested hop never kills its parent's. */
9
+ export const upgradeTag = (pid: number = process.pid): string => `x-upgrade-${String(pid)}`;
10
+
11
+ /**
12
+ * `runner` with the tag added to every child's env — after any tag an outer gate already set, as
13
+ * `guardStep` does — and each child's pid held in `pids` while it runs: Windows reads no
14
+ * process's environment, so the pid recorded at spawn is the only handle there.
15
+ */
16
+ export const tagRunner =
17
+ (
18
+ runner: Runner,
19
+ tag: string,
20
+ env: Readonly<Record<string, string | undefined>>,
21
+ pids: Set<number>,
22
+ ): Runner =>
23
+ async (command, options) => {
24
+ const inherited = options.env?.[STEP_TAG_ENV] ?? env[STEP_TAG_ENV];
25
+ const value = inherited === undefined || inherited === '' ? tag : `${inherited} ${tag}`;
26
+ let pid: number | undefined;
27
+ try {
28
+ return await runner(command, {
29
+ ...options,
30
+ env: { ...options.env, [STEP_TAG_ENV]: value },
31
+ onSpawn: (spawned) => {
32
+ pid = spawned;
33
+ pids.add(spawned);
34
+ options.onSpawn?.(spawned);
35
+ },
36
+ });
37
+ } finally {
38
+ if (pid !== undefined) pids.delete(pid);
39
+ }
40
+ };
41
+
42
+ /** Kill every process carrying `tag`; on Windows, tree-kill each recorded pid. */
43
+ export const killUpgradeTree = async (tag: string, pids: ReadonlySet<number>): Promise<void> => {
44
+ if (process.platform === 'win32') {
45
+ for (const pid of pids) await taskkillTree(pid);
46
+ return;
47
+ }
48
+ await killTagged(tag);
49
+ };
50
+
51
+ const STOP_SIGNALS = ['SIGINT', 'SIGTERM'] as const;
52
+
53
+ export interface StopInput {
54
+ readonly tag: string;
55
+ readonly pids: ReadonlySet<number>;
56
+ readonly kill?: (tag: string, pids: ReadonlySet<number>) => Promise<void>;
57
+ /** Synchronous: the lock is released before the process dies. */
58
+ readonly cleanup: () => void;
59
+ readonly reraise?: (signal: NodeJS.Signals) => void;
60
+ }
61
+
62
+ /**
63
+ * On SIGINT/SIGTERM: kill the tagged tree, clean up, then remove the listeners and re-raise the
64
+ * same signal so it meets its default action. The listeners stay until that is done and a repeat
65
+ * is ignored (`signal-shred.ts`' reason: a forwarded second Ctrl-C would otherwise kill mid-sweep).
66
+ * Returns the undo for the normal path.
67
+ */
68
+ export function stopChildrenOnSignal(input: StopInput): () => void {
69
+ const kill = input.kill ?? killUpgradeTree;
70
+ const reraise = input.reraise ?? ((signal) => process.kill(process.pid, signal));
71
+ let stopping = false;
72
+ const undo = (): void => {
73
+ for (const signal of STOP_SIGNALS) process.off(signal, handler);
74
+ };
75
+ function handler(signal: NodeJS.Signals): void {
76
+ if (stopping) return;
77
+ stopping = true;
78
+ void kill(input.tag, input.pids)
79
+ .catch(() => undefined)
80
+ .finally(() => {
81
+ try {
82
+ input.cleanup();
83
+ } finally {
84
+ undo();
85
+ reraise(signal);
86
+ }
87
+ });
88
+ }
89
+ for (const signal of STOP_SIGNALS) process.on(signal, handler);
90
+ return undo;
91
+ }
@@ -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
+ }
@@ -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. A name the framework ships a guard under — `raw-length`, `raw-breakpoint`, `raw-z-index`, `raw-shadow`, `raw-motion`, `undefined-style-class`, `undeclared-custom-property`, `repo-raw-sql` and every other name in `SHIPPED_GUARD_NAMES` (`packages/cli/src/templates/scaffold-guards.ts`) — writes THAT guard, which is how an app adopts one it does not hold; any other name writes the blank template. `x doctor` lists the shipped ones missing, and the held ones that differ from the current template ([Interface rules](Interface-Rules#stylesheets)).
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
@@ -1716,6 +1722,7 @@ Every test leftover the framework knows of, cleared (`As of 27.3.0`): the migrat
1716
1722
 
1717
1723
  ```bash
1718
1724
  x upgrade [--to <version>] [--dry-run] [--json]
1725
+ x upgrade codemods --from <version> [--to <version>] [--dry-run] [--json]
1719
1726
  ```
1720
1727
 
1721
1728
  One major per run, so each hop's gate attributes its red to that hop. `As of 30.0.0`.
@@ -1729,9 +1736,9 @@ One major per run, so each hop's gate attributes its red to that hop. `As of 30.
1729
1736
  | 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
1737
  | 4 | write exact pins, raise the Bun floor | — |
1731
1738
  | 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 |
1739
+ | 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
1740
 
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.
1741
+ 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
1742
 
1736
1743
  `--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
1744
 
@@ -1754,8 +1761,20 @@ A dry run refuses exactly what the real run would, then stops before step 4. It
1754
1761
  | `manifest` | `{ ok, findings[] }`. A failure does not stop the gate |
1755
1762
  | `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
1763
  | `verify` | `{ ok, summary, failed[], findings[] }`, each finding `{ step?, code, cause, fix, at? }` |
1764
+ | `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 |
1765
+ | `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
1766
  | `then` | the next thing to do, in a sentence naming the commands |
1758
1767
 
1768
+ **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:
1769
+
1770
+ | Flag | Type | Default | Meaning |
1771
+ |---|---|---|---|
1772
+ | `--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` |
1773
+ | `--to` | string | this CLI's version | the last release whose codemods run |
1774
+ | `--dry-run` | boolean | off | report what would change; write nothing |
1775
+
1776
+ `data.codemods` is the same shape as the hop's, without `source`. A second run changes nothing.
1777
+
1759
1778
  `null` for `guards`, `manifest`, `exercise` and `verify` means no gate ran: a dry run, already there, or no app.
1760
1779
 
1761
1780
  **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 +2044,7 @@ command rather than quoting the line. `docs` is `ERROR_DOCS_URL`, the same URL f
2025
2044
  x repro <jobId|requestId|traceId|fingerprint> [--write] [--verify] [--json]
2026
2045
  x repro --list [--code X_…] [--json]
2027
2046
  x repro --from <file> [--write] [--verify] [--json]
2047
+ x repro <id> --bundle [--include-rows] [--json] | x repro --from <file> --bundle [--include-rows] [--json]
2028
2048
  ```
2029
2049
 
2030
2050
  A production failure becomes a failing test. `As of 2026-11`.
@@ -2041,6 +2061,40 @@ green. Masked input (`.sensitive()`, secret-named keys) and masked columns are s
2041
2061
  the schema. `--list` reads the bundles with each group's count and last sighting. An id nothing
2042
2062
  holds is `X_REPRO_UNKNOWN`; a request id with capture off is `X_REPRO_CAPTURE_OFF`.
2043
2063
 
2064
+ **`--bundle` carries the failure to an issue** (`As of 2026-11`): one JSON file,
2065
+ `repro/bundle-<id>.json` (the scaffold's `.gitignore` keeps it out of a commit), deterministic
2066
+ bytes, meant to be read before it is attached — its `readFirst` lines say what is in it and what
2067
+ is not found. Never with `--write`/`--verify`; `--include-rows` without `--bundle` is refused
2068
+ (`X_CLI_BAD_FLAG`).
2069
+
2070
+ | Section | Holds |
2071
+ |---|---|
2072
+ | `framework` | every installed `@ultimat3/*` package and the versions found of it, the CLI's, Bun's, the platform |
2073
+ | `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 |
2074
+ | `schema.entities` | the declarations of the entities whose rows the call read — never the whole app |
2075
+ | `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 |
2076
+ | `masked` / `scrubbed` | the masked paths; the env var NAMES whose values were found, the count of hostnames |
2077
+ | `reproducer` | the test, rendered from `subject` alone, against the scaffold's `apps/web/api` and the `@app/db` placeholder |
2078
+
2079
+ | Flag | Does |
2080
+ |---|---|
2081
+ | `--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 |
2082
+
2083
+ Replaced everywhere (never in the primitive's name, the code or the reproducer's imports): the app
2084
+ root (`.`), the home directory (`~`), an env value that is secret-named, a URL or from the app's
2085
+ `.env*` files (`[env:NAME]`; 6+ characters, any length under a secret name) — and an env URL's
2086
+ user and password raw, URL-decoded and base64 (a Basic header) —, every hostname in
2087
+ `app.config.ts` or an env URL (`[host]`), any URL's userinfo (`[cred]@`) and query values
2088
+ (`?k=[redacted]`), emails (`[email]`), IPv4/IPv6 addresses (`[ip]`); in a cause or frame, any other
2089
+ absolute file path (`<abs>/<file>`). **Not found**: a value this machine never knew — a
2090
+ production-only secret, a customer's name in a cause.
2091
+
2092
+ **A bundle is untrusted input.** `bunx create-ultimate repro <bundle.json>` reads only its
2093
+ `subject`, checked field by field (`X_REPRO_BUNDLE_INVALID` otherwise, control characters
2094
+ included), and renders the test from it; the bundle's own `reproducer` text never reaches disk.
2095
+ It opens into a scratch app (`repro-<id>/`), the test under `repro/`, linked to the framework
2096
+ checkout the command runs in (or `--framework <checkout>`) through `file:` overrides.
2097
+
2044
2098
  ## x docs
2045
2099
 
2046
2100
  ```bash
@@ -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** in your app's `guards/` | `x verify`'s `boundaries` step | `guards/focus-visible.ts` |
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
- Guards are yours: `x new` writes every name in `SHIPPED_GUARD_NAMES`
24
- (`packages/cli/src/templates/scaffold-guards.ts`), the directory is the registration, and deleting
25
- a file deletes the rule. Add one with `x g guard <name>` — a name the framework ships a guard under writes
26
- that guard, any other name writes a blank one — and `x doctor` lists the shipped ones an app does
27
- not hold. Each raises an app-owned `X_*` code derived from
28
- its own filename — `guards/focus-visible.ts` raises `X_FOCUS_VISIBLE` — so a finding says which
29
- convention broke, not which framework subsystem noticed.
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
 
@@ -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 |
@@ -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 rule per file, DISCOVERED not registered — `x verify` runs
24
- # each inside its `boundaries` step. `x new` writes every
25
- # name in SHIPPED_GUARD_NAMES (packages/cli/src/templates/
26
- # scaffold-guards.ts); `x doctor` lists the ones missing
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