@ultimat3/cli 31.32.0 → 31.34.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/package.json +29 -29
- package/src/admin-registration.ts +6 -5
- package/src/affected.ts +3 -2
- package/src/api-registration.ts +7 -5
- package/src/app-agents-md.ts +1 -1
- package/src/app-boundaries.ts +1 -1
- package/src/app-layout.ts +6 -5
- package/src/app-load.ts +1 -1
- package/src/app-manifest.ts +1 -1
- package/src/app-mcp.ts +11 -9
- package/src/app-openapi.ts +7 -5
- package/src/app-reload-graph.ts +9 -7
- package/src/app-runtime.ts +9 -6
- package/src/async-pages.ts +6 -5
- package/src/browser-launcher.ts +9 -5
- package/src/browser-transport.ts +8 -5
- package/src/budgets.ts +4 -3
- package/src/cdp-shot-errors.ts +7 -5
- package/src/cdp-shot-page.ts +6 -5
- package/src/cdp-shot-watch.ts +7 -5
- package/src/ci-log.ts +6 -5
- package/src/cmd-auth.ts +5 -4
- package/src/cmd-build.ts +2 -0
- package/src/cmd-ci.ts +8 -5
- package/src/cmd-clean.ts +9 -6
- package/src/cmd-db-branch.ts +3 -2
- package/src/cmd-db.ts +2 -2
- package/src/cmd-deploy-compose.ts +8 -5
- package/src/cmd-deploy.ts +1 -0
- package/src/cmd-dev.ts +1 -0
- package/src/cmd-env.ts +1 -1
- package/src/cmd-errors.ts +2 -3
- package/src/cmd-generate.ts +2 -0
- package/src/cmd-i18n.ts +5 -4
- package/src/cmd-jobs.ts +3 -2
- package/src/cmd-manifest.ts +1 -0
- package/src/cmd-new.ts +2 -0
- package/src/cmd-pr.ts +7 -6
- package/src/cmd-registries.ts +5 -4
- package/src/cmd-secrets.ts +1 -1
- package/src/cmd-shot.ts +1 -0
- package/src/cmd-tasks.ts +7 -5
- package/src/cmd-test.ts +8 -6
- package/src/db-backfill.ts +4 -3
- package/src/db-branch.ts +2 -2
- package/src/db-generate.ts +1 -1
- package/src/db-schema-refresh.ts +5 -4
- package/src/db-seed.ts +1 -1
- package/src/dev-child-watch.ts +7 -6
- package/src/dev-environment.ts +6 -5
- package/src/dev-lock.ts +3 -0
- package/src/dev-n-plus-one.ts +7 -5
- package/src/dev-reload.ts +7 -5
- package/src/dev-restart-retire.ts +7 -5
- package/src/dev-supervisor.ts +9 -6
- package/src/dev-watch-tree.ts +9 -7
- package/src/dev-watch.ts +7 -5
- package/src/document-styles.ts +7 -5
- package/src/drift.ts +9 -5
- package/src/duplicate-packages.ts +7 -5
- package/src/error-contract.ts +4 -2
- package/src/error-fixes.ts +7 -6
- package/src/error-unthrown.ts +7 -5
- package/src/fix-imports.ts +1 -1
- package/src/flag-reads.ts +1 -1
- package/src/framework-schema-apply.ts +7 -5
- package/src/framework-scope.ts +1 -1
- package/src/generate-follow-ups.ts +8 -5
- package/src/generate-shadow.ts +6 -4
- package/src/generate-sibling.ts +6 -4
- package/src/guards.ts +2 -2
- package/src/handle-registration.ts +4 -3
- package/src/i18n-audit.ts +4 -4
- package/src/i18n-registration.ts +5 -3
- package/src/import-closure.ts +7 -6
- package/src/island-bundle.ts +7 -6
- package/src/island-cache-inputs.ts +2 -1
- package/src/island-realtime-state.ts +6 -5
- package/src/island-realtime.ts +8 -6
- package/src/island-shot.ts +6 -5
- package/src/load-findings.ts +8 -5
- package/src/local-cli.ts +8 -6
- package/src/mcp-db-target.ts +2 -2
- package/src/mcp-ui-diff.ts +8 -5
- package/src/mcp-ui-inspect.ts +8 -6
- package/src/mcp-ui-interact.ts +9 -6
- package/src/mcp-ui.ts +11 -9
- package/src/measure-database.ts +8 -6
- package/src/measure-paths.ts +7 -5
- package/src/measure-scope.ts +10 -8
- package/src/migrations.ts +2 -0
- package/src/page-navigation.ts +9 -7
- package/src/page-speculation.ts +8 -6
- package/src/path-segments.ts +2 -1
- package/src/prerender.ts +4 -4
- package/src/runtime-assets.ts +8 -6
- package/src/runtime-bindings.ts +2 -0
- package/src/runtime-cache.ts +7 -5
- package/src/runtime-live-feed.ts +7 -5
- package/src/runtime-overrides.ts +7 -5
- package/src/runtime-queue.ts +6 -5
- package/src/script-csp.ts +4 -2
- package/src/secrets-rotation.ts +7 -5
- package/src/serve-boot.ts +8 -6
- package/src/serve.ts +8 -5
- package/src/server-barrels.ts +7 -5
- package/src/shot-theme.ts +8 -6
- package/src/site-config.ts +2 -1
- package/src/site-llms-pages.ts +8 -2
- package/src/source-list-edit.ts +8 -6
- package/src/static-cards.ts +2 -2
- package/src/static-report.ts +4 -3
- package/src/sync-authenticator.ts +6 -5
- package/src/templates/admin-page.ts +8 -5
- package/src/templates/admin.ts +6 -5
- package/src/templates/guard-animated-layout-property.ts +7 -5
- package/src/templates/guard-focus-visible.ts +7 -5
- package/src/templates/guard-image-dimensions.ts +8 -5
- package/src/templates/guard-island-without-states.ts +5 -3
- package/src/templates/guard-semantic-interactive.ts +1 -0
- package/src/templates/island.ts +9 -6
- package/src/templates/resource-form-island.ts +3 -2
- package/src/templates/resource-page.ts +8 -6
- package/src/templates/route.ts +1 -0
- package/src/templates/scaffold-docs.ts +7 -6
- package/src/templates/scaffold-entries.ts +7 -5
- package/src/templates/scaffold-errors.ts +8 -6
- package/src/templates/scaffold-repo.ts +5 -4
- package/src/templates/scaffold-shell.ts +7 -5
- package/src/templates/scaffold-site.ts +7 -5
- package/src/test-housekeeping.ts +3 -6
- package/src/test-select.ts +2 -2
- package/src/ts-scan.ts +6 -4
- package/src/tsconfig-references.ts +6 -6
- package/src/verify-checks.ts +9 -9
- package/src/verify-e2e.ts +8 -6
- package/src/verify-floor.ts +6 -7
- package/src/verify-pace.ts +3 -1
- package/src/verify-role-load.ts +8 -5
- package/src/verify-tests.ts +2 -2
- package/src/verify-typecheck.ts +7 -5
- package/src/version-loader.ts +1 -1
- package/src/worker-bundle.ts +7 -5
- package/src/workspace-checks.ts +2 -0
- package/src/workspace-graph.ts +4 -3
- package/src/write-line.ts +1 -1
package/src/cmd-generate.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// emits a TODO has moved the work, not done it; every file this writes typechecks, and every
|
|
3
3
|
// primitive arrives with the test that pins its distant invariants (policy, idempotency, budget).
|
|
4
4
|
|
|
5
|
+
// why: the follow-up filters ask "is it on disk?" synchronously, inside `.filter()`, and Bun's
|
|
6
|
+
// only existence check, `Bun.file().exists()`, is async.
|
|
5
7
|
import { existsSync } from 'node:fs';
|
|
6
8
|
import { MANIFEST_FILENAME } from '@ultimat3/manifest';
|
|
7
9
|
import { indexBindingFindings } from './api-registration';
|
package/src/cmd-i18n.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// X_CATALOG_MISSING_KEYS and X_CATALOG_INVALID fix line already names. CLI wiring only: the
|
|
3
3
|
// facts come from `i18n-audit.ts`, the audit itself from `@ultimat3/i18n`'s own `auditCatalogs`.
|
|
4
4
|
|
|
5
|
-
// `node:` and not Bun: Bun has no exclusive-create write, and `open(path, 'wx')` is the only
|
|
6
|
-
// there is — `Bun.write` overwrites, so an existence check before it is a race a second
|
|
7
|
-
// add` wins. `mkdir` comes with it because `open` does not create the parent directory
|
|
8
|
-
// would, and `node:path` because Bun exposes no path API to build what either of them
|
|
5
|
+
// why: `node:` and not Bun: Bun has no exclusive-create write, and `open(path, 'wx')` is the only
|
|
6
|
+
// one there is — `Bun.write` overwrites, so an existence check before it is a race a second
|
|
7
|
+
// `x i18n add` wins. `mkdir` comes with it because `open` does not create the parent directory
|
|
8
|
+
// `Bun.write` would, and `node:path` because Bun exposes no path API to build what either of them
|
|
9
|
+
// takes.
|
|
9
10
|
import { type FileHandle, mkdir, open } from 'node:fs/promises';
|
|
10
11
|
import { dirname, join } from 'node:path';
|
|
11
12
|
import { DEFAULT_LOCALE, stringField } from '@ultimat3/core';
|
package/src/cmd-jobs.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// `x jobs list|show|retry|cancel|delete|promote|resolve-step|pause|resume` — introspect and
|
|
2
|
-
// recover the job queue, bound to `@ultimat3/jobs`'s own introspection so the CLI, `/_x` and
|
|
3
|
-
// report identically.
|
|
2
|
+
// recover the job queue, bound to `@ultimat3/jobs`'s own introspection so the CLI, `/_x` and
|
|
3
|
+
// MCP report identically.
|
|
4
|
+
//
|
|
4
5
|
// CLI wiring only: the driver-injected logic is `jobs-report.ts`, the `--json` shapes
|
|
5
6
|
// `jobs-json.ts`, the table `jobs-table.ts`, the queue `jobs-driver.ts` — shared with `x db`.
|
|
6
7
|
|
package/src/cmd-manifest.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// conventions are hand-written: nothing in this file writes prose, and nothing else in the app is
|
|
3
3
|
// allowed to hand-edit these two files.
|
|
4
4
|
|
|
5
|
+
// why: Bun ships no path API; `join` builds the host-separator path to the manifest file.
|
|
5
6
|
import { join } from 'node:path';
|
|
6
7
|
import type { Manifest } from '@ultimat3/manifest';
|
|
7
8
|
import { MANIFEST_FILENAME } from '@ultimat3/manifest';
|
package/src/cmd-new.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// streaming dashboard, an admin app with MCP on, and an example feature slice with passing tests.
|
|
3
3
|
// Interactive-free: every choice is a flag with a default, because an agent cannot answer prompts.
|
|
4
4
|
|
|
5
|
+
// why: the target is a DIRECTORY, which `Bun.file().exists()` answers false for; Bun ships no
|
|
6
|
+
// path API, and `isAbsolute`/`join`/`relative`/`resolve` place the new app.
|
|
5
7
|
import { existsSync } from 'node:fs';
|
|
6
8
|
import { isAbsolute, join, relative, resolve } from 'node:path';
|
|
7
9
|
import { ERROR_DOCS_URL, renderThrowable } from '@ultimat3/core';
|
package/src/cmd-pr.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// `x pr review|resolve|reply` — the inline review, in a terminal.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// `x pr review|resolve|reply` — the inline review, in a terminal.
|
|
2
|
+
//
|
|
3
|
+
// `gh pr view --comments` prints ISSUE comments, so the findings a reviewer anchored to a line are
|
|
4
|
+
// invisible to it and the thread id needed to resolve one exists nowhere a human can copy. This
|
|
5
|
+
// command is the one place that query lives, and the one place the two facts a reviewer's verdict
|
|
6
|
+
// hides behind are stated: a `reviewDecision` outlives the push that answered it, and a RESOLVED
|
|
7
|
+
// thread is a closed conversation rather than a fixed finding.
|
|
7
8
|
|
|
8
9
|
import { PR_SUBCOMMANDS, prSpec } from './cmd-pr-spec';
|
|
9
10
|
import type { CliCommand, CommandContext } from './command';
|
package/src/cmd-registries.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// `x actions`, `x queries`, `x entities` — the declaration registries as a table or as JSON.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
//
|
|
3
|
+
// Replaces grepping a source tree, which is what an agent does when the framework has no answer to
|
|
4
|
+
// "what actions/queries/entities exist". One table, one generic command body: the three commands
|
|
5
|
+
// differ only in which registry they read, a row's columns, and (for a query only) the one extra
|
|
6
|
+
// field `show` surfaces that its descriptor does not already carry.
|
|
6
7
|
|
|
7
8
|
import type { ActionDescriptor, AnyAction } from '@ultimat3/action';
|
|
8
9
|
import { describeActions, getAction, jsonSchemaOf } from '@ultimat3/action';
|
package/src/cmd-secrets.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// the envelope comes from `@ultimat3/core`; this file owns the terminal, the temporary plaintext
|
|
4
4
|
// buffer, and the `.gitignore` rule that keeps the master key out of the repository.
|
|
5
5
|
|
|
6
|
-
// Bun ships no temp-directory primitive and no path join. `rmSync` is the synchronous half: a
|
|
6
|
+
// why: Bun ships no temp-directory primitive and no path join. `rmSync` is the synchronous half: a
|
|
7
7
|
// signal handler that awaited would be racing the default action it is trying to beat.
|
|
8
8
|
import { rmSync } from 'node:fs';
|
|
9
9
|
import { mkdtemp } from 'node:fs/promises';
|
package/src/cmd-shot.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// Never a step of `x verify`: it needs a real browser, and a gate that goes red because a machine
|
|
6
6
|
// has no Chrome is a gate that fails for reasons unrelated to the change.
|
|
7
7
|
|
|
8
|
+
// why: Bun ships no path API; `resolve` anchors `--out` at the caller's cwd, `join` the files.
|
|
8
9
|
import { join, resolve } from 'node:path';
|
|
9
10
|
import { renderFixShellArg } from '@ultimat3/core';
|
|
10
11
|
import { appLocaleSet } from '@ultimat3/i18n/app-catalogs';
|
package/src/cmd-tasks.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// `x tasks [list|show <name>]` — introspect scheduled cron tasks: cadence, timezone,
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// `x tasks [list|show <name>]` — introspect scheduled cron tasks: cadence, timezone, enqueued
|
|
2
|
+
// jobs, last dispatch and real next occurrences. CLI wiring only (`tasks-facts.ts`).
|
|
3
|
+
//
|
|
4
|
+
// The last dispatch is read off the queue's own record, and the next occurrences are real instants
|
|
5
|
+
// from `@ultimat3/time`'s cron math instead of an agent reading `0 3 * * *` and guessing. The
|
|
6
|
+
// pure computation lives in `tasks-facts.ts` — the same split `cmd-jobs.ts` makes against
|
|
7
|
+
// `jobs-report.ts`.
|
|
6
8
|
|
|
7
9
|
import { nearestName, systemClock } from '@ultimat3/core';
|
|
8
10
|
import type { JobDriver, TaskFire, TaskHandle } from '@ultimat3/jobs';
|
package/src/cmd-test.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// `x test`'s command surface: the flags and the one positional it accepts, and the refusals that
|
|
2
|
-
// happen before a single process starts.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
2
|
+
// happen before a single process starts.
|
|
3
|
+
//
|
|
4
|
+
// Which files run is test-select.ts, how they are split and spawned is test-shards.ts — this file
|
|
5
|
+
// only turns argv into their inputs, so a parsing bug can never be read as a sharding one.
|
|
6
|
+
// `--affected` is the one narrowing decided here rather than there, because it is a fact about a
|
|
7
|
+
// git diff and not about a path: what the diff touches is `affected.ts` (workspaces) and, in an app
|
|
8
|
+
// root, `affected-tests.ts` (import closure); this file only maps that answer onto the paths
|
|
9
|
+
// discovery yields.
|
|
8
10
|
|
|
9
11
|
import { JOB_SIM_SEED_ENV, TEST_TYPES } from '@ultimat3/testing';
|
|
10
12
|
import type { AffectedScope } from './affected';
|
package/src/db-backfill.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// `x db backfill`, everything except the argv: the ledger `--list` reports, the
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// `x db backfill`, everything except the argv: the ledger `--list` reports, the pending diff
|
|
2
|
+
// `--pending` reports, and the gate-plus-enqueue `<name>`/`--all` performs.
|
|
3
|
+
//
|
|
4
|
+
// A driver plus plain strings in, plain data out — the `cmd-jobs.ts` / `jobs-report.ts` split
|
|
4
5
|
// repeated, so every projection here is testable with no `ParsedArgs`, no app boot and no queue.
|
|
5
6
|
// `cmd-db.ts` is the CLI wiring and nothing else.
|
|
6
7
|
//
|
package/src/db-branch.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Plain inputs, plain rows — no `ParsedArgs`, no `CommandResult` — so every rule here is testable
|
|
4
4
|
// against a temp directory and a recording client, and `cmd-db-branch.ts` owns only the wiring.
|
|
5
5
|
|
|
6
|
-
// `node:fs/promises` for `readdir`/`rm`/`stat` — Bun exposes no directory listing, no
|
|
7
|
-
// delete and no birthtime. `node:path` for the joiner Bun also does not have.
|
|
6
|
+
// why: `node:fs/promises` for `readdir`/`rm`/`stat` — Bun exposes no directory listing, no
|
|
7
|
+
// recursive delete and no birthtime. `node:path` for the joiner Bun also does not have.
|
|
8
8
|
import { readdir, rm, stat } from 'node:fs/promises';
|
|
9
9
|
import { basename, dirname, join } from 'node:path';
|
|
10
10
|
import type { DbClient } from '@ultimat3/db';
|
package/src/db-generate.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// migration files already declare, written as one reversible `.sql` plus the two sidecars the gate
|
|
3
3
|
// reads back — the snapshot the next generation diffs against, and the schema hash `drift` checks.
|
|
4
4
|
|
|
5
|
-
// `node:path` — Bun ships no path joiner of its own, and these paths are built, not opened.
|
|
5
|
+
// why: `node:path` — Bun ships no path joiner of its own, and these paths are built, not opened.
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import type { GeneratedMigration, UnrenderedDeclaration } from '@ultimat3/db';
|
|
8
8
|
import {
|
package/src/db-schema-refresh.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// The schema dump, regenerated on behalf of a command: `x db gen` and `x db migrate` both end by
|
|
2
|
-
// making `packages/db/schema/` equal to what the migrations produce.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// making `packages/db/schema/` equal to what the migrations produce.
|
|
3
|
+
//
|
|
4
|
+
// Split from `db-schema-dump.ts`, which replays and writes; this decides what a command REPORTS
|
|
5
|
+
// when the dump was written, was already right, was not owed, or could not be produced — and holds
|
|
6
|
+
// the two findings that are about the dump as a whole rather than about one file in it.
|
|
6
7
|
|
|
7
8
|
import { ERROR_DOCS_URL, renderThrowable } from '@ultimat3/core';
|
|
8
9
|
import type { Migration } from '@ultimat3/db';
|
package/src/db-seed.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// The decisions a seed itself owns are `@ultimat3/entity`'s: `seedTiersFor` is the one table saying
|
|
6
6
|
// which tiers an environment runs, and two copies of "may this seed run" would be two answers.
|
|
7
7
|
|
|
8
|
-
// `node:path` for the joiner and the app-root-relative spelling every finding is keyed by; Bun
|
|
8
|
+
// why: `node:path` for the joiner and the app-root-relative spelling every finding is keyed by; Bun
|
|
9
9
|
// exposes neither.
|
|
10
10
|
import { relative, sep } from 'node:path';
|
|
11
11
|
import type { Environment } from '@ultimat3/core';
|
package/src/dev-child-watch.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// A supervised `x dev` child that outlives what it serves stops itself.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// A supervised `x dev` child that outlives what it serves stops itself.
|
|
2
|
+
//
|
|
3
|
+
// Two facts nothing else in the child watched: its SUPERVISOR is gone (SIGKILLed, so it forwarded
|
|
4
|
+
// nothing — the child was reparented to init and served forever), and its APP ROOT is gone (the
|
|
5
|
+
// jobs worker, the outbox relay and the scheduler then poll an embedded database whose directory no
|
|
6
|
+
// longer exists, at 100% CPU, measured at ~50 MB/s of heap growth). Found on a laptop, 2026-09-29:
|
|
7
|
+
// two children of `cmd-dev-restart.live.test.ts`, six hours old, ppid 1, cwd deleted, one at 7 GB.
|
|
7
8
|
//
|
|
8
9
|
// Both facts and the stop itself hold on Windows: the supervisor is asked for by pid
|
|
9
10
|
// (`process.kill(pid, 0)`), since a Windows child's ppid never changes, and a stop arrives as a
|
package/src/dev-environment.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Whether `x dev` must declare `ULTIMATE_ENV` for the app it is about to boot, and the one-liner
|
|
2
|
+
// side effect that declares it.
|
|
3
|
+
//
|
|
4
|
+
// Split out of `cmd-dev.ts` (which the filesize gate holds to ~500 lines) rather than folded into
|
|
5
|
+
// it — this is one decision with one consumer, and keeping it separate is what lets a test pin the
|
|
6
|
+
// decision without paying for a whole app boot.
|
|
6
7
|
|
|
7
8
|
import { ENVIRONMENT_KEY } from '@ultimat3/core';
|
|
8
9
|
|
package/src/dev-lock.ts
CHANGED
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
// The lock file is what makes the second one nameable at all: nothing else in the process can tell
|
|
15
15
|
// "another dev server owns this directory" from "the database is broken".
|
|
16
16
|
|
|
17
|
+
// why: Bun has no hard link, rename, mkdir or unlink — and `linkSync` is the one-syscall atomic
|
|
18
|
+
// create-if-absent the claim rests on. Sync because `clearLock` runs from `() => void` shutdown
|
|
19
|
+
// callbacks. Bun ships no path API either.
|
|
17
20
|
import { linkSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
18
21
|
import { join } from 'node:path';
|
|
19
22
|
import { stringField, UltimateError } from '@ultimat3/core';
|
package/src/dev-n-plus-one.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// The N+1 ledger: one count per statement shape per request, and a verdict once a shape crosses
|
|
2
|
-
// the threshold.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// `
|
|
2
|
+
// the threshold. Installed by `x dev` and by nothing else.
|
|
3
|
+
//
|
|
4
|
+
// Counting state hangs off the request's own `Ctx` in a `WeakMap`, so it is collected with the
|
|
5
|
+
// request and never swept. Installed by `x dev` and by nothing else — a production process pays the
|
|
6
|
+
// one `undefined` branch `@ultimat3/db`'s seam already costs (axiom 6). It counts and it warns
|
|
7
|
+
// once; what a verdict *means* — which code, which `fix:` — is `statement-loop.ts`'s, so all four
|
|
8
|
+
// surfaces read one answer.
|
|
7
9
|
|
|
8
10
|
import type { Ctx, StatementAttribution, DbStatementEvent as StatementEvent } from '@ultimat3/core';
|
|
9
11
|
import { assert, tryUseContext } from '@ultimat3/core';
|
package/src/dev-reload.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// One rebuild at a time
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// One rebuild at a time: the in-flight guard over the dev loop's reloads.
|
|
2
|
+
//
|
|
3
|
+
// A reload is a full `appManifest()` plus a `buildIslands()` over every island, and the watcher had
|
|
4
|
+
// no in-flight guard: a 45ms drip of writes — a slow `git checkout`, a formatter walking the tree,
|
|
5
|
+
// `x db gen` — started one per file, 40 for 40 files, each assigning the same two state slots in
|
|
6
|
+
// COMPLETION order. So a slower earlier rebuild could land on top of a newer one, and the dev
|
|
7
|
+
// server then served a manifest built from source that had already changed.
|
|
6
8
|
|
|
7
9
|
/** What a tick does while a rebuild is already running: nothing, except become the next one. */
|
|
8
10
|
export type ReloadTrigger = (file: string) => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// `x dev`'s restart, worker first (issue #677)
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// `x dev`'s restart, worker first (issue #677): retire the worker, then drain.
|
|
2
|
+
//
|
|
3
|
+
// A save that reaches a primitive-defining module restarts the child, and the drain that ends it
|
|
4
|
+
// used to be the FIRST thing it did: a job that ran past the drain budget was aborted `X_DRAINING`
|
|
5
|
+
// and requeued, so a non-idempotent one (a bank login) ran twice. The worker is retired first —
|
|
6
|
+
// `stop()` claims nothing and aborts nothing — and only then is the drain asked to release the
|
|
7
|
+
// port, the lock and the embedded database.
|
|
6
8
|
|
|
7
9
|
import { drain, logger, markRetiring, renderThrowable } from '@ultimat3/core';
|
|
8
10
|
import type { Worker } from '@ultimat3/jobs';
|
package/src/dev-supervisor.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
// `x dev` as two processes: this one supervises, a child serves
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
1
|
+
// `x dev` as two processes: this one supervises, a child serves — and a fresh child boots on
|
|
2
|
+
// the same port when a save reaches a module that defines a primitive.
|
|
3
|
+
//
|
|
4
|
+
// A save that reaches a module which DEFINES a primitive (`app-reload-graph.ts`'s pinned modules —
|
|
5
|
+
// a query over a slice's service, an admin page's view under `defineAdmin`) cannot be served by
|
|
6
|
+
// re-importing: the registries and the route table hold that module's first instance. The child
|
|
7
|
+
// exits `DEV_RESTART_EXIT_CODE` instead of logging "reloaded" over stale code, and this loop boots
|
|
8
|
+
// a fresh one on the same port. Every other save stays the in-process reload it was — a restart is
|
|
9
|
+
// paid only where nothing else works.
|
|
7
10
|
|
|
8
11
|
import type { StalePin } from './app-reload-graph';
|
|
9
12
|
import { devSpec } from './cmd-dev-spec';
|
package/src/dev-watch-tree.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
// The app root watched one directory at a time, because the watch SET is a registration
|
|
2
|
-
// and not a filter.
|
|
3
|
-
//
|
|
4
|
-
// `
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
1
|
+
// The app root watched one directory at a time, because the watch SET is a registration
|
|
2
|
+
// decision and not a filter.
|
|
3
|
+
//
|
|
4
|
+
// `watch(root, { recursive: true })` takes an inotify descriptor per directory in the tree —
|
|
5
|
+
// including every directory the dev loop then discards events from — so `.git/`, `node_modules/`
|
|
6
|
+
// and `.x/` (which this very process writes to, continuously) each cost a descriptor, a kernel
|
|
7
|
+
// queue entry and a JS callback per write, against a per-user descriptor budget of 8192 on many
|
|
8
|
+
// distributions. Bun 1.4.0's `fs.watch` takes no ignore option, so the only place the answer can be
|
|
9
|
+
// given early is at registration.
|
|
8
10
|
|
|
9
11
|
// why: Bun exposes no filesystem watcher, no directory listing and no synchronous stat —
|
|
10
12
|
// `Bun.file().exists()` is async and answers false for a DIRECTORY, which is the one thing this
|
package/src/dev-watch.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Which paths under the app root `x dev` must not watch
|
|
2
|
-
// filtering
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Which paths under the app root `x dev` must not watch — decided at REGISTRATION, not by
|
|
2
|
+
// filtering events.
|
|
3
|
+
//
|
|
4
|
+
// `watch(root, { recursive: true })` takes one inotify descriptor per directory before any filter
|
|
5
|
+
// runs, so an answer given after the event has already cost the kernel queue, a JS callback and a
|
|
6
|
+
// slot out of `max_user_watches`. Measured on a monorepo root: 1901 descriptors, 1490 of them under
|
|
7
|
+
// `.git/` and `node_modules/`, and one `git status` delivering 5 events.
|
|
6
8
|
//
|
|
7
9
|
// The ignore set is the app's own `.gitignore`, read with git's own anchoring (`gitignore.ts`),
|
|
8
10
|
// plus a floor of directory names an ignore file need not name. It was seven hand-listed names,
|
package/src/document-styles.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// One question the gate asks of what a render actually emits: does the document carry its
|
|
2
|
-
// style layer?
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// One question the gate asks of what a render actually emits: does the document carry its
|
|
2
|
+
// global style layer?
|
|
3
|
+
//
|
|
4
|
+
// Every rule `@ultimat3/ui` emits reads a custom property — `background:rgb(var( --color-bg)/1)`,
|
|
5
|
+
// `padding:var(--space-8)` — so CSS with no `:root` definitions is a document the browser drops
|
|
6
|
+
// every one of those declarations from, byte-for-byte identical to a working page apart from the
|
|
7
|
+
// styling nobody sees missing. A silent failure is exactly what axiom 3 exists for.
|
|
6
8
|
|
|
7
9
|
import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
8
10
|
import type { Surface } from '@ultimat3/render';
|
package/src/drift.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
// Source drift: the app's schema *source* against what migrations recorded.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Source drift: the app's schema *source* against what migrations recorded.
|
|
2
|
+
//
|
|
3
|
+
// `x db gen` writes the hash of the entity schema next to the migration it produced, so drift here
|
|
4
|
+
// is "the schema hashes to something no migration recorded". The hash is committed beside the
|
|
5
|
+
// migration, so a fresh clone answers with no local state and CI needs no database. An app with NO
|
|
6
|
+
// migration at all is the one case that also asks how many entities are declared — see
|
|
7
|
+
// `checkSourceDrift`.
|
|
6
8
|
//
|
|
7
9
|
// This is not the post-migrate verification and deliberately cannot be: that one is the live
|
|
8
10
|
// database against the ledger (`checkDrift`, `@ultimat3/db`), asked by `runMigrations` where a
|
|
9
11
|
// connection is open. Same `X_DB_DRIFT`, two conditions — an entity edited with no migration
|
|
10
12
|
// generated, versus a database that does not match the migrations it ran.
|
|
11
13
|
|
|
14
|
+
// why: the probes are of DIRECTORIES, which `Bun.file().exists()` answers false for; Bun ships no
|
|
15
|
+
// path API, and `join` builds the paths under the app root.
|
|
12
16
|
import { existsSync } from 'node:fs';
|
|
13
17
|
import { join } from 'node:path';
|
|
14
18
|
// `canonicalJson` is core's, the one serializer every content hash in the framework uses. A private
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Two installed copies of one registry-holding framework package, found before either registry
|
|
2
|
-
// asked anything.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Two installed copies of one registry-holding framework package, found before either registry
|
|
2
|
+
// is asked anything.
|
|
3
|
+
//
|
|
4
|
+
// `@ultimat3/i18n`, `@ultimat3/policy` and `@ultimat3/entity` each keep their registry at MODULE
|
|
5
|
+
// scope, so a second module instance is a second, EMPTY registry: an app whose `packages/i18n`
|
|
6
|
+
// workspace pinned `@ultimat3/i18n@19.0.0` while its root had 19.1.0 registered every catalog into
|
|
7
|
+
// the workspace's copy, the CLI read the root's, and `x i18n check` answered
|
|
6
8
|
// `X_CATALOG_UNREGISTERED` with a fix that said to move a `defineCatalogs()` call that was already
|
|
7
9
|
// exactly where the fix said to put it (one adopter, 2026-09-05). The same split is the one
|
|
8
10
|
// `local-cli.ts` hands over for — a global `x` is a second copy of `@ultimat3/entity` — except this
|
package/src/error-contract.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
// The error contract, enforced (axiom 3:
|
|
1
|
+
// The error contract, enforced (axiom 3): every `fix:` executable and every code documented,
|
|
2
|
+
// decided before the code runs.
|
|
3
|
+
//
|
|
2
4
|
// Axiom 4 says an error is an instruction, so a `fix:` an agent cannot act on is a defect in the
|
|
3
5
|
// error, not a matter of taste — and a code no reference page documents strands whoever hits it.
|
|
4
6
|
// Both halves are decidable before the code runs, which is why they are a gate step and not a
|
|
5
7
|
// runtime assertion nobody sees until the failure they describe has already happened.
|
|
6
8
|
|
|
7
|
-
// `join` is `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
9
|
+
// why: `join` is `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
8
10
|
import { join } from 'node:path';
|
|
9
11
|
import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
10
12
|
import { citedCommandProblem, loadCommandCatalog } from './fix-command';
|
package/src/error-fixes.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// Every `X_*` code's REAL `fix:`, read off the throw site that raises it.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Every `X_*` code's REAL `fix:`, read off the throw site that raises it.
|
|
2
|
+
//
|
|
3
|
+
// `x errors explain` used to answer `x verify --json` for every code the CLI does not own — 327 of
|
|
4
|
+
// 378 — which is a shrug, not an instruction. The framework already writes an executable fix at
|
|
5
|
+
// each throw site and the `errors` gate step already proves each one runnable, so the answer is to
|
|
6
|
+
// project that text rather than to restate it in a second table nobody keeps current (axiom 2).
|
|
6
7
|
|
|
7
|
-
// Bun ships no path join: the scan needs an absolute path per globbed, scope-relative entry.
|
|
8
|
+
// why: Bun ships no path join: the scan needs an absolute path per globbed, scope-relative entry.
|
|
8
9
|
import { join } from 'node:path';
|
|
9
10
|
import { staticFix } from './error-contract';
|
|
10
11
|
import { frameworkScopeDir } from './framework-scope';
|
package/src/error-unthrown.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// A registered code nothing constructs
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// A registered code nothing constructs, reported unless listed in `UNTHROWN_CODES`.
|
|
2
|
+
//
|
|
3
|
+
// The registry and the reference keep a shipped code alive forever — which is right — and that is
|
|
4
|
+
// exactly why a code can outlive its last thrower with no gate noticing: `X_RPC_FAILED` sat
|
|
5
|
+
// registered and documented as live after the transport change took its only throw site away. It
|
|
6
|
+
// has to be LISTED as unthrown (`UNTHROWN_CODES`), or this reports it.
|
|
6
7
|
|
|
8
|
+
// why: Bun ships no path API; `join` builds the absolute path of each scanned file.
|
|
7
9
|
import { join } from 'node:path';
|
|
8
10
|
import { ERROR_DOCS_URL, maskLiterals, stripComments } from '@ultimat3/core';
|
|
9
11
|
import { RESERVED_HEADING } from './error-contract';
|
package/src/fix-imports.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// `packages/ui/src/errors.ts` and every fix it is handed is written in `icons/build-icons.ts`.
|
|
3
3
|
// One specifier, one file read, one parameter position — deliberately still not `tsc`.
|
|
4
4
|
|
|
5
|
-
// `dirname`/`join` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
5
|
+
// why: `dirname`/`join` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
6
6
|
import { dirname, join } from 'node:path';
|
|
7
7
|
import { endOfLiteral, maskLiterals } from '@ultimat3/core';
|
|
8
8
|
import type { FixHelper } from './fix-scan';
|
package/src/flag-reads.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// plan JSON, where nothing read the field; that flag is deleted rather than wired, and a second
|
|
8
8
|
// one of its shape would pass here too.
|
|
9
9
|
|
|
10
|
-
// `join`/`relative` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
10
|
+
// why: `join`/`relative` are `node:`-only by necessity: Bun exposes no path-join primitive.
|
|
11
11
|
import { join, relative } from 'node:path';
|
|
12
12
|
import { ERROR_DOCS_URL, stripComments } from '@ultimat3/core';
|
|
13
13
|
import type { Finding } from './output';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The three ways a boot meets the framework schema (plan 101, s1-con #5):
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// `
|
|
1
|
+
// The three ways a boot meets the framework schema (plan 101, s1-con #5): locked apply, verify
|
|
2
|
+
// only, or ensure — apply only when this build is absent from the stamp.
|
|
3
|
+
//
|
|
4
|
+
// `applyLockedSchema` runs the DDL in ONE transaction behind the migration advisory lock with a
|
|
5
|
+
// bounded `lock_timeout`, then stamps the build; `verifySchema` (`framework-schema-verify.ts`) runs
|
|
6
|
+
// none; `ensureSchema` reads the stamp and applies only when this build is absent from it. Which
|
|
7
|
+
// boot takes which is `runtime-queue.ts`'s `SchemaMode`.
|
|
6
8
|
|
|
7
9
|
import { frameworkVersion, logger } from '@ultimat3/core';
|
|
8
10
|
import type { DbClient } from '@ultimat3/db';
|
package/src/framework-scope.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// the docs `x docs` quotes and the `fix:` lines `x errors explain` projects come from the same
|
|
4
4
|
// directory or they describe different builds.
|
|
5
5
|
|
|
6
|
-
// `node:fs`/`node:path` because Bun ships neither: `dirname` walks a resolved module up to the
|
|
6
|
+
// why: `node:fs`/`node:path` because Bun ships neither: `dirname` walks a resolved module up to the
|
|
7
7
|
// directory that owns it, `basename` names the two segments the store layout is recognised by,
|
|
8
8
|
// and `existsSync` is what says which directory is really there.
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
// Everything `x g` edits OUTSIDE the files it creates, in the one order they have to happen
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Everything `x g` edits OUTSIDE the files it creates, in the one order they have to happen,
|
|
2
|
+
// over one disk seam so a real run and a dry run are the same code.
|
|
3
|
+
//
|
|
4
|
+
// In order: a declared permission granted to a role, a primitive listed in `defineApi`, an entity
|
|
5
|
+
// added to the typed handle, an `--admin` override wired, a contract test's exercise entry
|
|
6
|
+
// declared, each new workspace edge declared, and every catalog made selectable. One function over
|
|
7
|
+
// one disk seam, so a real run and a dry run are the same code — and the dry run's list of touched
|
|
8
|
+
// files is what the run touches, not a second guess at it.
|
|
6
9
|
|
|
7
10
|
import { registerAdminResources } from './admin-registration';
|
|
8
11
|
import { registerGeneratedPrimitives } from './api-registration';
|