diff --git a/.dz/briefs/health.md b/.dz/briefs/health.md index 1966ad836..0821285a6 100644 --- a/.dz/briefs/health.md +++ b/.dz/briefs/health.md @@ -16,10 +16,11 @@ Weekly: the failures no issue or PR announces. No verdict is always re-run, neve | `dependabot-not-stuck` | `gh pr list --app dependabot --limit 5 --state open --json number,createdAt,updatedAt,statusCheckRollup` | green checks at any age; failed checks until >7 days since `updatedAt` (7 exactly is not over). Green: completed CheckRuns `SUCCESS`, `NEUTRAL`, `SKIPPED`, StatusContexts `SUCCESS`; terminal failures red. Pending, missing, malformed, unknown, mixed evidence = no verdict; so is a missing or invalid `updatedAt`, never replaced by `createdAt`. A page of `--limit` (5) is truncated: raise it, file nothing until short. A confirmed stuck PR files even beside a PR with unread evidence. | | `demo-shipped` | `gh run list --workflow deploy-social-demo.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,displayTitle,url,createdAt` | `success` on a `workflow_run`. Null `conclusion` = still building: read `status`. `skipped` = the `ci.yml` completion was no green push: red `main-green` files it; with it green, look for a non-push `ci.yml` run. `workflow_dispatch` = an operator's run, not a push publish; `headBranch` names the ref. Other non-success: name the guard its log's `::error::` line names. The ask carries `url`, `createdAt`, `databaseId`, `displayTitle`, `headBranch` | | `release-exists` | `t=$(git describe --tags --abbrev=0 --match 'v[0-9]*' origin/main)`, then `gh release view "$t" --json tagName,isDraft,publishedAt` | `isDraft` false AND `publishedAt` set; a draft is unhealthy. Missing = unhealthy: gh prints `release not found` and no JSON — the message is the signal, not the exit code. Any other unreadable answer = `cannot tell` (`X_HEALTH_ROW_UNREADABLE`) | -| `tutorials-run` | `gh run list --workflow tutorial-run.yml --branch main --event push --limit 1 --json databaseId,event,status,conclusion,headBranch,displayTitle,url,createdAt` | `success`, or no run yet (paths-filtered). `cancelled` (superseded) = re-run. Else a tutorial diverged: the ask names `url` and `bun run scripts/tutorial-run.ts --json` (`X_DOC_TUTORIAL_DIVERGED`: page, line) | +| `tutorials-run` | `gh run list --workflow tutorial-run.yml --branch main --limit 20 --json databaseId,event,status,conclusion,headBranch,displayTitle,url,createdAt` | newest non-`pull_request` run: as `bench`. Else diverged: the ask names `url` and `bun run scripts/tutorial-run.ts --json` | | `flake-hunt` | `gh run list --workflow flake-hunt.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,headSha,displayTitle,url,createdAt` | `success` under 48 h; older = unhealthy, the schedule stopped. No run or `cancelled` = re-run. Else red: open `flake-hunt` issues name test, seed, rerun | | `bench` | `gh run list --workflow bench.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,headSha,displayTitle,url,createdAt` | `success` under 8 days; older = the weekly schedule stopped. No run or `cancelled` = re-run. Else a figure failed to measure | -| `compat` | `gh run list --workflow compat.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,headSha,displayTitle,url,createdAt` | `success` under 8 days; older = the schedule stopped. No run or `cancelled` = re-run. Else a cell is red: open `compat` issues name each and its replay | +| `compat` | `gh run list --workflow compat.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,headSha,displayTitle,url,createdAt` | as `bench`. Else open `compat` issues name each red cell and its replay | +| `next-sync` | `gh run list --workflow next-sync.yml --limit 1 --json databaseId,event,status,conclusion,headBranch,headSha,displayTitle,url,createdAt` | as `bench`. Else `main` is not in `next`: the open issue names the merge | | `maint-lane` | `gh api repos/{owner}/{repo}/git/matching-refs/heads/release/ --jq .[].ref`, then `npm view @ultimat3/core dist-tags --json` | each window SECURITY.md promises: open, `release/.x` on origin and `maint-` a `.x` version (`X_MAINT_LANE_ABSENT`); closed, no branch (`X_MAINT_LANE_EXPIRED`). `findings[]` carry each fix | | `registry-trust` | `NPM_CONFIG_OTP= bun run scripts/trust-publishers.ts --check --json` | `ok: true`. No `NPM_CONFIG_OTP` = no verdict, never filed: a person with npm 2FA runs it. `X_TRUST_PUBLISHER_MISSING` = unhealthy (an expired OTP reads the same: re-run first); other codes pass through | | `private-names-secret` | `gh secret list --json name,updatedAt` | lists `ULTIMATE_PRIVATE_NAMES`; absent reds every push to `main` (`X_PRIVATE_NAMES_UNSET`) | @@ -33,15 +34,15 @@ One ask per unhealthy row unless an open issue names it, titled by the signal (` `publish failed: `, `Dependabot # failed checks, inactive since `), its body the command, its output and the failing run's URL. A red `main` first. -A `Dependabot` npm-bump ask's repair: `bun run lockfile:fix` (its `bun.lock` is stale); a -conflicted lock is never merged over: regenerate it locally first. +A `Dependabot` npm-bump ask's repair: `bun run lockfile:fix`; a conflicted lock is regenerated +locally, never merged over. Never re-run a publish, delete a tag, a Release or a branch, or `npm publish` from here. `PUBLISHING.md` owns every recovery; a fix ships as the next patch, never a moved tag. ## Machine verdicts -Run `bun run scripts/health.ts --json` (the table's machine reading) first. `ok: false` = an unread row (`X_HEALTH_ROW_UNREADABLE` or a +Run `bun run scripts/health.ts --json` first. `ok: false` = an unread row (`X_HEALTH_ROW_UNREADABLE` or a child's codes, naming row and command): file that, never a verdict over it. `ok: true` carries `data.rows[]`, one `RowVerdict` per row in table order: @@ -71,6 +72,7 @@ Then `bun run finished --check --json`: one ask per `red` row, its - `flake-hunt` - `bench` - `compat` +- `next-sync` - `maint-lane` - `registry-trust` - `private-names-secret` diff --git a/.dz/briefs/release-due.md b/.dz/briefs/release-due.md index 176e5c55a..4894b6460 100644 --- a/.dz/briefs/release-due.md +++ b/.dz/briefs/release-due.md @@ -49,7 +49,7 @@ it and stop: this session cannot fetch or switch branches. The envelope is input, and `data.due` is the script's count, not the verdict. Some reasons do settle it: `nothing_ships` leaves nothing to release, `awaiting_tag` is one already cutting, and a major -stays a maintainer's — inside the major window: from v30, at most one major per 90 days +stays a maintainer's — inside the major window: from v31, at most one major per 90 days ([`wiki/Stability.md`](../../wiki/Stability.md)), and only a security fix that cannot be non-breaking takes the exception (`--security `). diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 6507c187c..9fdedf9eb 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -19,11 +19,13 @@ on: # the cadence; a figure wanted sooner is `gh workflow run bench.yml --ref main`. workflow_dispatch: -# `contents: write` + `pull-requests: write`: the branch and the pull request with the new JSON. No -# `id-token` and no new secret — the job's own token is all it holds. +# `contents: write` + `pull-requests: write`: the branch and the pull request with the new JSON; +# `actions: write`: the ci.yml dispatch that gates that branch. No `id-token` and no new secret — +# the job's own token is all it holds. permissions: contents: write pull-requests: write + actions: write concurrency: group: bench @@ -89,6 +91,9 @@ jobs: # Forced: the branch is always one commit of figures on today's `main`, and last week's # figures are what this run supersedes. The replaced commit stays on the pull request. git push --force "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$BRANCH" + # A push made with the job token starts no workflow, so the pull request would wait on a + # `verify` check that never reports; a dispatch is GitHub's exception, as next-sync.yml's. + gh workflow run ci.yml --ref "$BRANCH" OPEN="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty')" if [ -n "$OPEN" ]; then gh pr edit "$OPEN" --body "$BODY" diff --git a/.github/workflows/next-sync.yml b/.github/workflows/next-sync.yml index fe896407f..b36fbabb0 100644 --- a/.github/workflows/next-sync.yml +++ b/.github/workflows/next-sync.yml @@ -105,8 +105,9 @@ jobs: report: needs: merge - # On the merge's answer only: a red `merge` job filed nothing to report. - if: ${{ !cancelled() && needs.merge.result == 'success' }} + # On the merge's answer AND on its failure: a red `merge` job (no `next`, a refused push, a merge + # that failed with no conflict) is a week `next` fell behind, and it files the same issue. + if: ${{ !cancelled() }} runs-on: ubuntu-latest timeout-minutes: 5 permissions: @@ -117,6 +118,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} BLOCKED: ${{ needs.merge.outputs.blocked }} + MERGE_RESULT: ${{ needs.merge.result }} FILES: ${{ needs.merge.outputs.files }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} shell: bash @@ -127,6 +129,10 @@ jobs: # Only this workflow's own issue: anyone may open one with the same title. open="$(gh issue list --state open --author 'app/github-actions' --search "$TITLE in:title" \ --json number,title | jq -r --arg t "$TITLE" 'map(select(.title == $t)) | .[0].number // empty')" + # A merge job that went red handed nothing on: never read as a clean week, never closing. + if [ "$MERGE_RESULT" != 'success' ]; then + BLOCKED='failed' + fi if [ -z "$BLOCKED" ]; then if [ -n "$open" ]; then gh issue close "$open" --comment "main merged cleanly into next: $RUN_URL" @@ -134,7 +140,17 @@ jobs: exit 0 fi body="$RUNNER_TEMP/next-sync.md" - if [ "$BLOCKED" = 'workflows' ]; then + if [ "$BLOCKED" = 'failed' ]; then + { + echo "The weekly merge of \`main\` into \`next\` failed (merge job: $MERGE_RESULT), so \`next\` may be behind \`main\`: $RUN_URL" + echo + echo 'The merge job log at that run names the cause on its ::error:: line. Fix it, then re-run; the next clean run closes this issue:' + echo + echo '```bash' + echo 'gh workflow run next-sync.yml' + echo '```' + } > "$body" + elif [ "$BLOCKED" = 'workflows' ]; then { echo "The weekly merge of \`main\` into \`next\` is clean but changes workflow files, which the job token may not push, so it was not pushed: $RUN_URL" echo diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 3bf011ca4..8db7173d3 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -37,11 +37,10 @@ on: # a bump branch named `release/31.1.0` was tagged off main's history (#1054). branches: [main, 'release/[0-9]+.x'] -# One release cut at a time, and never cancelled: a tag without its Release, or a Release without -# its dispatch, is a half-cut release a human then has to finish. -concurrency: - group: release-tag - cancel-in-progress: false +# No workflow-level concurrency: every ci.yml completion on main starts this workflow, and a group +# keeps ONE pending run — a third arrival cancels the pending one whatever `cancel-in-progress` +# says, so a release commit's run waiting behind an ordinary commit's could be dropped. The queue +# is on `cut`, which only a release cut ever reaches. permissions: contents: read @@ -168,6 +167,11 @@ jobs: cut: needs: prepare if: needs.prepare.outputs.cut == 'true' + # One release cut at a time, and never cancelled: a tag without its Release, or a Release + # without its dispatch, is a half-cut release a human then has to finish. + concurrency: + group: release-tag + cancel-in-progress: false runs-on: ubuntu-latest timeout-minutes: 10 permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36465d12d..ab3ad447b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -306,25 +306,40 @@ jobs: # then died `E401 … token is invalid` on schema 71 s later while the registry was slow # to stage — and every re-run lost the rest of its tier the same way. for name in $names; do - held="$(npm view "${name}@${VERSION}" version 2>/dev/null || true)" - if [ "$held" = "$VERSION" ]; then - echo "::notice::skipping ${name}@${VERSION} — npm already holds it, published by an earlier attempt of this release" - continue - fi - echo "::group::npm publish — tier $tier: $name" - if ! out="$(npm publish -w "$name" --tag "$DIST_TAG" 2>&1)"; then + # BOUNDED RETRY: the weekly bot release has nobody on call, and a transient failure — a + # Sigstore TLOG 409, an E401 from a slow token exchange, a registry 5xx — killed the + # whole run. Three attempts, a pause between, and npm asked AGAIN before each one: an + # attempt that died after the registry took the tarball is this release's, never a + # re-publish into E403. Provenance is untouched: each attempt is the same command. + attempt=1 + while :; do + held="$(npm view "${name}@${VERSION}" version 2>/dev/null || true)" + if [ "$held" = "$VERSION" ]; then + echo "::notice::skipping ${name}@${VERSION} — npm already holds it, published by an earlier attempt of this release" + break + fi + echo "::group::npm publish — tier $tier: $name (attempt $attempt)" + if out="$(npm publish -w "$name" --tag "$DIST_TAG" 2>&1)"; then + echo "$out" + echo "::endgroup::" + break + fi echo "$out" + echo "::endgroup::" # npm STAGES a publish before `npm view` can see it, so an attempt that raced a # previous one meets its own staged copy. That version is already this release's. if printf '%s' "$out" | grep -q 'previously staged version'; then echo "::notice::${name}@${VERSION} is staged by an earlier attempt — npm will publish it" - echo "::endgroup::" - continue + break fi - exit 1 - fi - echo "$out" - echo "::endgroup::" + if [ "$attempt" -ge 3 ]; then + echo "::error::npm publish of ${name}@${VERSION} failed 3 times — read the npm error above. The run resumes where it stopped: gh workflow run release.yml --ref v${VERSION} -f version=${VERSION}" + exit 1 + fi + echo "::warning::npm publish of ${name}@${VERSION} failed (attempt ${attempt} of 3) — asking npm again in $((attempt * 30)) s" + sleep "$((attempt * 30))" + attempt=$((attempt + 1)) + done done done <<< "$plan" diff --git a/.github/workflows/security-channel.yml b/.github/workflows/security-channel.yml index 28be5adf9..bc4bce87f 100644 --- a/.github/workflows/security-channel.yml +++ b/.github/workflows/security-channel.yml @@ -63,11 +63,13 @@ jobs: floors: # `contents: write` + `pull-requests: write`: the branch and the pull request with the raised - # ranges, as bench.yml opens one. `issues: write`: the alarm for an advisory no floor closes. No - # `id-token`: this job can never publish, only propose; a release ships the raise. + # ranges, as bench.yml opens one. `actions: write`: the ci.yml dispatch that gates that branch. + # `issues: write`: the alarm for an advisory no floor closes. No `id-token`: this job can never + # publish, only propose; a release ships the raise. permissions: contents: write pull-requests: write + actions: write issues: write runs-on: ubuntu-latest # One packument and one advisory query per dependency, a few dozen in all, measured well under a @@ -122,6 +124,9 @@ jobs: BRANCH='security/advisory-floors' # One branch, force-pushed: tomorrow's run refreshes today's pull request, never a second. git push --force "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$BRANCH" + # A push made with the job token starts no workflow, so the pull request would wait on a + # `verify` check that never reports; a dispatch is GitHub's exception, as next-sync.yml's. + gh workflow run ci.yml --ref "$BRANCH" body="$(jq -r '"**" + .summary + "**\n\n" + ([.data.raises[] | "- `" + .manifest + "` " + .field + "." + .name + ": `" + .from + "` -> `" + .to + "` (" + ([.advisories[].advisory] | unique | join(", ")) + ")"] | join("\n")) + "\n\nThe root `package.json`, the scaffold pin and the tracked apps may pin the old version: CI on this branch names them."' floors.json)" existing="$(gh pr list --head "$BRANCH" --state open --limit 1 --json number --jq '.[0].number // empty')" if [ -n "$existing" ]; then diff --git a/.github/workflows/tutorial-run.yml b/.github/workflows/tutorial-run.yml index 5cfaf2f0b..e4ae8d38e 100644 --- a/.github/workflows/tutorial-run.yml +++ b/.github/workflows/tutorial-run.yml @@ -9,7 +9,11 @@ name: tutorial-run # of a green pull request (#1272: `x db gen`'s success line gained its tables); on a pull request # the red lands before the merge. Not a required check: `verify` is the one # (docs/history/ci-split.md), and a path-filtered workflow never leaves a check pending. -# `scripts/ci-workflow-main-only.test.ts` holds the two path lists equal. +# `scripts/ci-workflow-main-only.test.ts` holds the two path lists equal. AND weekly: the paths +# cannot list every package whose printed line a tutorial quotes (`x routes`, `x policy`, `x tasks`, +# `x build`, `create-ultimate`, …), so a filter alone let tutorials rot unseen while the health row +# (`scripts/lib/health-tutorials.ts`) kept reading the last green; a newest run over eight days old +# is stale there. # The same job RUNS `wiki/Building-Your-Own-Base.md`'s recipes: each `## Recipe:` fence written to # the path it names in a scratch app and driven by `scripts/base-recipes/` — seconds, no scaffold. @@ -47,6 +51,10 @@ on: - 'scripts/base-recipes/**' - 'scripts/lib/base-recipes.ts' - '.github/workflows/tutorial-run.yml' + schedule: + # Weekly, Sunday early UTC — clear of the nightly flake hunt (02:23), Saturday's compat (03:41) + # and Monday's bench and next-sync (04:41). + - cron: '29 5 * * 0' workflow_dispatch: # One group per ref: a newer push to main supersedes the run before it, as it always did, and a pull diff --git a/CHANGELOG.md b/CHANGELOG.md index c39c1cbbf..c2b85bb37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,30 @@ Semver applies from 1.0.0. A breaking change to a documented API needs a major - `x clean --services` stops this app's test service stack, and the gate prints one line saying whether it started, reused or shared one. - `x dev`'s port refusal names the directory of the process holding the port. - `x upgrade --only [,…]` runs the hop's `x verify` on those steps alone, so `unit`, `live` and `e2e` can be left to CI on a loaded machine. The report never reads as a full gate: `proof: "verify-only"`, `verify.notRun[]`, a `NOT THE FULL GATE` summary and a `then` naming `x verify --only `. A bare `x upgrade` still runs the full gate ([Upgrading](wiki/Upgrading.md)). +- auth: `oauthLogin(auth, { mfaPath })` and `identityProviderRoutes(auth, { providers, mfaPath })` let an MFA-enrolled user finish SSO through the built-in routes: the callback answers 303 to the app's second-factor page with the sealed challenge in an `HttpOnly` `__Host-x_mfa` cookie. On that page, `completeMfa(auth, readMfaChallenge(request) ?? '', code)`, then send `clearMfaChallengeCookie()` — both new exports of `@ultimat3/auth`. An `mfaPath` that is not one absolute path on this origin is `X_CONFIG_INVALID` at the call. Without `mfaPath` the callback is the same 401 `X_MFA_REQUIRED`, and its logged fix now names the option. +- jobs: `startQueueWake({ reproveEveryMs })` (default 10 s) re-proves a proven cross-process wake; `installDefaultRetry` / `resetDefaultRetry` / `DefaultRetry` on `@ultimat3/jobs/adapter` install the retry of a job that declares none (the boot does it from `jobs.maxAttempts` / `jobs.backoff`). +- http: `reportLateFault(error, ctx?)` is exported from `@ultimat3/http`: it runs the `error-map` stage's monitor, `onError` and log line for a fault after the response started, once per request; a caller's hang-up records nothing and leaves the one report unspent. +- http: `cappedWireDates` and `WIRE_DATES_MAX_BYTES` (4,096): the `x-ultimate-dates` value an answer carries, or none past the cap. +- ai: `GenerateRequest.toolChoice?: 'auto'` (optional) leaves a request's single tool unforced; compaction's summary call sets it. +- auth: `AuthServerClient.host` — a metadata-document client's `client_id` host, beside the `name` its document chose; show it on the consent page. +- jobs/redis: `redisJobDriver({ deadTtlMs })` — how long failed, dead and expired rows are kept (default 90 days, pg's `jobs.deadRetentionMs`; `0` keeps them forever). +- testing: `authServerStoreConformance` checks that `purge` deletes a self-registered client past the idle window that nothing names, and only it. +- `x db rollback [--steps n]` reverses the most recently applied migration(s), most recently applied first, by running each file's `-- down` half; the files stay, so each is pending again (`x db migrate` re-applies). Beside an `x dev` on the embedded database it is run by that dev server (`POST /_x/db/rollback`). A file with no `-- down` marker is `X_MIGRATION_IRREVERSIBLE`; outside development and test it is refused `X_MIGRATION_ROLLBACK_DESTRUCTIVE` until `ROLLBACK_ALLOW_DESTRUCTIVE` names every migration it would reverse. `--json`: `{ reverted, steps, files }`. +- db: `rollback({ confirm })` is called once, under the migrate lock and before the first `down`, with the exact ledger rows about to be reversed; a throw reverses nothing. +- `x tasks run ` fires a scheduled task now — its jobs onto the app's queue through `TaskHandle.enqueue()`, the scheduler's watermark untouched — with `--json`; where the environment resolves `production` it fires only when asked by name, `--production` or (a container whose command line is fixed) `ULTIMATE_TASK_RUN=`, else `X_TASK_RUN_PRODUCTION` with nothing queued — `x db seed`'s gate and refusal form; beside an `x dev` holding the embedded database it is refused. `x g cron-job` names it as its next step. +- `x policy explain --input ''` evaluates the policy on a request's input, for a rule whose predicate reads one; the value is never echoed. +- `x docs ` — the id every search line starts with — prints that topic's body: a package guide's whole section, or a module's header comment and exports. A search ends with that command for its first hit. +- `x new` declares `@ultimat3/realtime` at the exact framework pin, so `useQuery` / `channel()` resolve on a fresh app and `x doctor` stays green; an older app adds it with `bun add --exact` at its `@ultimat3/core` pin ([Realtime](wiki/Realtime.md)). +- `x errors explain ` answers an app's own `defineError()` codes inside the app, from the error registry: title, HTTP status and the declaring `file:line` (`--json`: `{ code, title, docs, status, site }`). +- `x doctor` warns (`X_ACTION_UNREGISTERED` / `X_QUERY_UNREGISTERED`, never a failure) on an action or query left off an app's `defineApi()` that lists others, with the import line that lists it; an app registering by the module scan alone is told nothing. +- jobs README: "One job per org, from a schedule" — a `tenant: 'none'` `cronJob()` listing orgs inside `crossTenant()` and enqueueing one tenant-scoped job per org, its fence run by a test. +- auth: `mfaChallengeOf`, `mfaChallengeCookie` and `MFA_CHALLENGE_COOKIE` — the write half of the MFA challenge cookie, beside `readMfaChallenge` / `clearMfaChallengeCookie`. +- action: `acceptedIdOf(record)` on `@ultimat3/action/adapter` — the id `batchedAuditSink` minted for a record, for a custom sink's idempotent insert. +- core: `JOBS_MAX_ATTEMPTS_DEFAULT` (3), the one statement of the default retry attempts: `jobs.maxAttempts`' default and `DEFAULT_RETRY.attempts` both read it; `laterHooksReserveMs(deadlineMs)`, the drain's reserve for the hooks behind the in-flight wait; `ShutdownReason.inflightUntil`, the instant that wait ends. +- cache: `CacheTier.scope?` names which entries a tier's bust clears (`redisTier` sets its `x:` namespace); `InvalidationBroadcast` receives the sender's scopes as an optional second argument (type `SharedTierScopes`). +- ui: `HotkeyKeyEvent.keyCode?` (optional). +- realtime: `SocketRegistry.deliverRecords(topic, epoch, frame, to?)` takes the tenant audience as an optional trailing parameter. ### Changed - `cache.defaultTtlMs` now sets the lease of a value cached with no `ttlMs` on the `lru` and `redis` rungs the boot builds. It was validated and documented and read by nothing; a boot-built Redis rung held such values 300 s, now the configured 60 s by default. A rung supplied through `cacheTiers` keeps its own default (#1260). @@ -27,12 +50,80 @@ Semver applies from 1.0.0. A breaking change to a documented API needs a major - Fixes no longer send a worker to a whole run: `X_TEST_NO_FILES` suggests `x test --affected --dirty`, `X_TYPECHECK_FAILED` names the file to edit and `x verify --only typecheck`, and an unknown command whose nearest match runs every suite suggests its `--help`. - A ledger wait says to leave the command running (`bunx x heavy status`), and reads `admission in progress` while no holder is known. - A new app's `CLAUDE.md` lists a worker's commands, its `/feature` and `/verify` skip the gate for a worker given a file set, and `.claude/settings.json` allows `bunx x heavy` and `bunx x stop` in place of the raw typecheck and lint scripts (the `docs-worker-commands` codemod updates `CLAUDE.md` on `x upgrade`). -- `x doctor`: a port another checkout's dev server holds is a warning, not a failure; the suggested port pair is free when asked, and so is the sync role's. +- `x doctor`: a port another checkout's dev server holds is a warning, not a failure; the suggested port pair is free when asked, and so is the sync role's; each taken port is reported once, as a warning or a failure, never both. - `X_JOB_UNREGISTERED` names the job's file and prints the whole import line. - `x db gen` runs one at a time per checkout; its success line names the tables, and "no migration needed" names the migration that already records them. - The test step line reads `ran 2 at once (peak), planned 3`, or `1 worker, one per file (plan: …)`, in place of `2 of 4 of 6 workers`. - A doctor probe that throws is an `X_DOCTOR_PROBE_FAILED` finding, never a crash whose fix is the doctor itself. +- `jobs.maxAttempts` and `jobs.backoff` are read: the attempts of a job that declares no `retry` (a factory's whose `retry` was omitted: `purge()`, `backfill()`, `rollup()`, …), and the curve of any `retry` naming no `backoff`. Installed by `startQueue`, the boot every entry point shares — every role, `x tasks run`, `x jobs` and `x db backfill` — so the enqueuing process stamps the same `max_attempts` the worker retries by. `jobs.maxAttempts` now defaults to `3`, not the documented `5`: the key was read by nothing, and 3 is the retry such a job always had. With neither key set nothing moves. **Upgrading:** an app that set either key gets it applied now — `grep -n 'maxAttempts\|backoff' app.config.ts` and keep the value only if it is the retry you want for every job declaring none. +- `cache.defaultTtlMs: 0` is refused by `defineConfig` (`X_CONFIG_INVALID`) instead of crashing the boot; the minimum is 1, and a value that is not a whole number ≥ 1 refuses the boot naming `cache.defaultTtlMs`. **Upgrading:** an app writing `0` sets a positive lease. +- core: `directionOf` / `isRtl` read an explicit script subtag first (`az-Arab` is `rtl`, `ks-Deva` `ltr`), and bare `ku` is now `ltr` (Kurmanji, Latin script). **Upgrading:** an app serving Kurdish in Arabic script under `ku` renames the locale `ku-Arab` or `ckb`, or its pages render `dir="ltr"`. +- `database.ssl: true` now requires TLS (`sslmode=require`) on the pool every boot opens — serving roles, `x dev`, the migrate step, `x db status`/`recount`/`diagnostics`, primary and replica — unless the URL (`sslmode` or `ssl`) or `PGSSLMODE` states a mode — and on every other pool the framework opens: the replicator's `DATABASE_URL` and `REPLICATION_URL` sessions, `x doctor`'s database probes, `x db branch` and `x deploy verify`'s queue read. It was validated and read by nothing. `PGSSLMODE` is a declared framework env name. **Upgrading:** an app with `ssl: true` whose `DATABASE_URL` states no mode, against a Postgres without TLS, no longer connects: set `database: { ssl: false }`, or put `?sslmode=disable` in that URL. +- A `ROLE` not listed in `roles` in `app.config.ts` refuses to boot with `X_CONFIG_INVALID` (`meta.key: 'roles'`); `ROLE=migrate` is exempt. The list was read by nothing. **Upgrading:** an app declaring `roles` checks every `ROLE` its deploy starts (compose services, Helm values, the platform's processes) is in it, or drops the key. +- `x db migrate` beside an `x dev` holding the embedded database is applied **by that dev server** (`POST /_x/db/migrate`, loopback and same-origin only), never by a second process: PGlite takes no lock, and the holder's next write dropped the tables a second process applied. The request sends `Sec-Fetch-Site: same-origin`, so an app with CSRF protection admits it, and a dev server still booting is waited for (up to 120 s; a sent request is never resent). `x dev`'s own `x db gen "…" && x db migrate` hint works again. A holder that cannot answer (an older server, a dead port) or serves `database.rowSecurity` refuses `X_DEV_ALREADY_RUNNING`, fix `x stop --json && x db migrate && x dev`. +- Beside an `x dev` holding the embedded database, `x db seed` (`--dry-run` and `--generate` included), `x db backfill --write`, `x jobs retry|cancel|delete|promote|resolve-step|pause|resume` and `x auth seal-mfa` refuse `X_DEV_ALREADY_RUNNING`; the fix stops it, runs the command and starts it again. An external `DATABASE_URL` is unaffected. **Upgrading:** a script or agent loop running one of these beside `x dev` runs `x stop --json` first. +- realtime: a records channel keyed by a param that is not the tenant column (a `roomId` topic) delivers a tenanted row only to members of that row's tenant, live and on replay after `since`; every other member receives the seq alone. **Upgrading:** an app whose channel intentionally fanned one tenant's rows out to members of other orgs sees those rows stop; that feed needs its own untenanted table or a channel keyed by the tenant column. +- http: outside dev, an unclassified 5xx whose `code` is not framework-shaped (`X_…`) and not declared — a driver's SQLSTATE (`23505`), `ENOENT`, an app's own `E_UPSTREAM` — is served as `X_INTERNAL` in `code`, `type`, the hidden `fix` and the HTML error page. **Upgrading:** a client that switches on a non-`X_` code from a 5xx needs that code declared — `defineError` or `registerErrorStatus({ E_UPSTREAM: 502 })` — `grep -rn "code: '[A-Z]" apps packages | grep -v "'X_"` lists the candidates. A declared code, and dev, are unchanged. +- http: a caller that hangs up mid-request is answered `499 X_ABORTED`, logged at `info`, not sent to the monitor and not counted as a 5xx; `hooks.onError` receives the coded `X_ABORTED`, not the raw `AbortError`. A library's own wrapped abort stays a reported 500. **Upgrading:** a dashboard or alert on `http.server.request` 5xx volume drops by the hang-ups; an `onError` that matched `name === 'AbortError'` matches `code === 'X_ABORTED'`. +- http: `ctx.peer` reads `x-forwarded-client-cert` from the right, parsing only the elements the trusted hops appended: a client prefix with an unbalanced quote no longer nulls the peer, and a trusted element holding a `"` that is not a whole-value quote (`URI=spiffe://a/b"c`) is no peer. **Upgrading:** an Envoy front quotes whole values, so nothing moves; a proxy that writes bare quotes inside a value shows `ctx.peer === null` — check it in staging. +- http: the request deadline bounds time-to-headers; once a streamed answer has started only the caller going away fires `ctx.signal`. **Upgrading:** a streamed agent answer that relied on `requestTimeoutMs` to end it bounds itself: `withChildContext({ signal: AbortSignal.timeout(ms) }, …)`. +- action: SSE `chunk` frames carry an optional `dates:` line (a reader that does not know it ignores it); `hooks.onError` and the `error-map` log line now fire for a streamed action's fault after the first chunk, 4xx included (4xx: sink and log only). +- core: `defineConfig` refuses a non-boolean `pwa.enabled`, `pwa.backgroundSync` or `pwa.push` (`'false'` turned the PWA **on**), checked even when `enabled` is false; a non-list `pwa.categories`, a non-string `pwa.offline.neverCache` entry, a non-list `pwa.shortcuts` / `pwa.screenshots` and a non-string `site.favicon` are `X_CONFIG_INVALID` too. **Upgrading:** `grep -n "enabled\|backgroundSync\|push" app.config.ts` in the `pwa` block: each is `true` or `false`, never a string or a number. +- core: `clientTransport` sends a write with no idempotency key **once**, whatever the flight's retry policy (a gateway 5xx re-sent it). `rpc`, the outbox and storage are already keyed or single-shot. **Upgrading:** a direct `clientTransport({ method: 'POST', flight, retry })` that relied on a retry passes an `idempotencyKey`. +- core: `drain()` keeps min(2 s, `deadlineMs` / 5) of its budget for the `inflight` / `close` hooks when in-flight work overruns, so the in-flight wait ends that much earlier; the total stays within `deadlineMs`. The instant is handed to every hook as `ShutdownReason.inflightUntil`, and the jobs worker's drain cut-off measures back from it, so a job cut at the cut-off drains with exit 0 (it raced the wait's end to `X_SHUTDOWN_TIMEOUT`, exit 70). **Upgrading:** `x verify`'s `X_JOB_OUTLASTS_DRAIN` (retire off) grades against that earlier cancel — 21 s of a 25 s `drain.deadlineMs`, was 23 s; a job whose `timeout` sits between them now reds `manifest`: raise `drain.workerRetireMs` or lower the `timeout`. +- core: the Sentry transport drops reports during a 429's `Retry-After` pause (60 s when unstated) and warns once per refused status; `X_ERROR_REPORTER_DSN_INVALID`'s `meta.dsn` holds the DSN without its userinfo, and a DSN that is not an http(s) URL (a legacy `key:secret@host/1`) is described, never echoed. +- jobs/redis: failed, dead and expired rows, their steps and debounce fences **expire after 90 days by default**; `stats()` no longer counts `failed`/`dead` members past the window. **Upgrading:** an app on `redisJobDriver()` that reads old dead rows for audit passes `redisJobDriver({ deadTtlMs: 0 })` to keep them forever, or exports them first. +- jobs/redis: with no `clock` injected, leases, retries, settle debts and gauges are measured on the **Redis server's clock** (`TIME`); `claimedAt`, `visibleAt` and `updatedAt` are server times and a nack's `runAt` is server now plus the delay, as on pg. **Upgrading:** a test that freezes time (`installClock`, the preload's `Date`) against a real Redis driver passes `redisJobDriver({ clock })` to keep the frozen clock in charge. +- jobs: a claimed job whose admission took the whole visibility window is handed back uncounted as a debug shed (`jobs.worker.shed`, `reason: 'admitted-late'`) without running its body — no `jobs.lease.lost`, no `job_leases_lost_total`, no `jobs.worker.settle-failed`; one admitted an interval or more late heartbeats at once. **Upgrading:** an alert on `job_leases_lost_total` no longer fires for a slow admission. +- ai: `postgresVectorStore()`'s lexical leg (`searchText`, `hybrid`) matches **any** word of the query, as `memoryVectorStore()` does, and reads no query syntax: `"quoted phrase"`, `-word` and `or` are plain text. **Upgrading:** a caller that passed websearch syntax to exclude or quote drops it; expect more lexical candidates per query. +- ai: `anthropicProvider()` sends `strict: true` only for a schema inside the Messages API's strict subset and under its per-request caps — nearly every tool with a string loses the flag on that wire (those requests were 400s). The output schema still validates. +- ai: `defineEval` refuses a `tolerance` that is not finite or is negative (`X_INVARIANT`). **Upgrading:** `grep -rn 'tolerance' apps packages` — each a number ≥ 0. +- ai: `ULTIMATE_EVAL_RECORD` set to `0`, `false`, `no`, `off` or empty gates (and `x verify` with it is no longer `X_EVAL_RECORDING`); any other value records. +- ai: `chunkDocument` cuts slightly earlier (the joining space is counted), so re-indexing a document can change chunk ids and boundaries. +- db: `x db gen` turning a plain column into a generated one is asked as a drop: `X_MIGRATION_ROLLING_UNSAFE` unless the column was retired first (or `--rolling-unsafe`), then `X_MIGRATION_IRREVERSIBLE` unless `--allow-destructive`; the migration carries `-- rolling-unsafe: true`. **Upgrading:** an app with that change pending passes both flags, or retires the column first. +- db: a column drop's generated `down` also re-creates the indexes and foreign keys the previous snapshot recorded over the column; a `.snapshot.json` whose `dataType` holds a second statement no longer parses (`X_MIGRATION_SNAPSHOT_MISSING`). Files on disk are untouched. +- entity: `.search()` inside `crossTenant()` through an external `SearchIndex` asks the index once per tenant of an `andWhere('', 'in', [...])`, and refuses `X_INVARIANT_VIOLATED` when the chain names no tenant (it silently answered the actor's org alone). Under the built-in Postgres index nothing changes. **Upgrading:** an app with an external index running `crossTenant(…, () => t.search(…))` adds the tenant `in` list. +- entity: `matches(/…/)` refuses at declaration a surrogate `\uD8xx` escape (any astral literal), a repetition bound above 255, a `-` straight after a range or `\d`/`\D` inside a class (not last), and a quantified lookaround. Each already failed or answered wrong on Postgres. **Upgrading:** an app that only ran the memory driver and declared one fails at boot; the refusal names the construct and the portable spelling. +- entity: `entity.row` reports an `upsertAll` matched on a natural key (`onConflict` other than `['id']`) as `update` with its `before` row, not `insert` with `before: null`. **Upgrading:** a subscriber or test asserting `insert` for such an upsert asserts `update`. +- entity: the memory driver's refused `updateMany` / `updateWhere` leaves no row changed, as Postgres; a seed replay with a `json()` column reports `skipped` on Postgres where it reported `updated` every run. +- auth: `POST /oauth/register` refuses more than 10 `redirect_uris` or one over 2,048 characters (`invalid_client_metadata`) and deduplicates `scope`; self-registered clients get `d_…` ids (were `c_…`), and `purge()` deletes a `d_` client older than the refresh idle window that no grant, code or device code names (the client re-registers). Registration and client-metadata limits are shared across an IPv6 /64. **Upgrading:** a hand-written `AuthServerStore` runs `authServerStoreConformance` again — its `purge` must reap those clients; clients registered before keep `c_` and are never reaped (a one-off `delete` by the operator, if wanted). +- mcp: `mcpOAuthClient().begin()` refuses a server URL or authorization-server issuer that is not `https:` (loopback `http:` aside), `X_MCP_REMOTE_REFUSED`. **Upgrading:** an app pointing at an internal cleartext MCP server by hostname serves it over TLS. +- mcp: `refresh()` answers the refresh token it was passed when the server's answer omits one (RFC 6749 §6), never `null`. **Upgrading:** code that read `refreshToken: null` from `refresh` as "revoked" reads the refresh's own refusal instead. +- mcp: `docs({ q })` refuses a `q` over 1,000 characters (`X_INPUT_INVALID`); `db.query` refuses `EXPLAIN ANALYSE` and the `pg_copy_*`, `pg_sync_replication_*`, `pg_backup_*`, `pg_start_backup`, `pg_stop_backup`, `pg_restore_*`, `pg_clear_*` families (dev MCP and the admin SQL panel); on a `tenant:` server `tenant.arg` is stripped from `params`; a throwing resource source answers `-32603` on `resources/list`. +- pwa: `pushSubscribe` stores an `expirationTime` that is not a whole number of milliseconds from 0 to `Number.MAX_SAFE_INTEGER` (a fraction, a negative, `1e30`) as no expiry, where the Postgres store answered an uncoded 500 and the memory store kept it. The action's input schema is unchanged. +- pwa: a 401/403 from a push service no longer deletes the subscription: it is refused by code (`X_PWA_PUSH_REJECTED`, logged, counted in `refused`) and kept; only 404/410 and expiry delete. **Upgrading:** after a real VAPID key rotation the old rows stay until each browser re-subscribes (`subscribeToPush` and the emitted `subscribePush` replace them) or expires. +- render: a served-stale `isr` answer carries `public, max-age=0, s-maxage=0` and no `stale-while-revalidate`; surrogate keys and `etag` are kept. **Upgrading:** behind a CDN, the edge's stale window shrinks from `ttl` + 24 h to none — one extra origin request per stale serve. +- render: `navigate()` to a fragment of the page on screen is the browser's fragment navigation: no fetch, no swap, no `ultimate:navigate` / `ultimate:navigated` events. +- ui: `timeRangeUrl().href({ from, to })` writes `:ss` when an instant has seconds and moves an end forward so it reads back at or after the instant (a fall-back hour included); every list cursor on the page is dropped, namespaced or not. `SearchableSelect` and `useCommandPalette` ignore keydowns while an IME is composing (`isComposing`, `Process`, `keyCode` 229); `niceTicks` answers `[low, high]` where it returned duplicate ticks. +- admin: sorting a list by a `money()` column works — by currency, then minor, paging forward and back (it answered 500); the manifest's `sorts` are unchanged. An `ids` batch over the bound answers `after: null` (screen and MCP); only an "all matching" selection continues. **Upgrading:** an MCP client resuming an ids batch re-sends the remaining ids. +- testing: `toBeWithinBudget(limit)` throws `X_TEST_NUMBER_EXPECTED` for a limit that is not finite (`undefined`, `NaN`, `Infinity`), under `.not` too. **Upgrading:** a test passing `Infinity` as "no budget" drops the assertion. +- cli: `x jobs pause|resume ` refuses a queue outside `jobs.queues` and the registered jobs' queues (`X_CLI_BAD_FLAG`, nearest name in the fix). **Upgrading:** a runbook pausing a queue reached only by `enqueue({ queue })` lists it in `jobs.queues`. +- cli: `x g sign-in --oidc` passes `mfaPath` and writes the second-factor page, `sign-in-challenge.ts`, `actions/confirm-session.ts`, their tests and catalog keys. **Upgrading:** an app generated before keeps its 401 `X_MFA_REQUIRED` for an MFA-enrolled user until it adds `mfaPath` to `oauthLogin` / `identityProviderRoutes` and the page ([Auth](wiki/Auth.md)); no codemod. +- cli: `x g query` into a slice whose hand-written `policy.ts` lacks `canRead` (and `Tag` unless `--live`) refuses `X_SLICE_POLICY_INCOMPLETE` and writes nothing; `x g purge` writes a unit test that asserts the declaration and runs no pass. +- docker: the framework's `docker/docker-compose.prod.yml` ships the `replicator` at `replicas: 0`, like `sync`; set it to 1 when you turn realtime on. New scaffolds pin the compose `postgres:18-alpine` by digest. +- `x env check` on a shell that names no environment (no `ULTIMATE_ENV`, no `NODE_ENV`, no `CI`) checks as **development** — what `x dev` in that directory runs as — and says so; it was production, red on a fresh scaffold. A named environment is checked as named, and under `CI` an unnamed one is still production. `--json` carries `data.environment`. **Upgrading:** a deploy script running a bare `x env check` on a host that sets none of the three names it: `ULTIMATE_ENV=production x env check`. +- `x test ` exits 1 (`X_TEST_FAILED`) when every test it selected skipped itself — `ran 0`, `skipped N` — naming the unset `TEST_DATABASE_URL` / `TEST_REDIS_URL` / `TEST_NATS_URL` and the command that starts the services; it exited 0 having checked nothing. `x verify` is unaffected. **Upgrading:** a script calling `x test live` (or any type) with no services starts them first — `docker compose -f docker/docker-compose.test.yml up -d --wait` — or stops calling it. +- `x dev` is `✗ dev ready` (`ok: false` under `--json --once`) while migrations on disk are ahead of its database (`X_APP_MIGRATIONS_UNAPPLIED`, fix `x db migrate`) or an applied one was edited (`X_MIGRATION_CONFLICT`); it was `✓` over a 500. It still serves. A schema finding appearing or clearing no longer restarts it, so `x db gen "…" && x db migrate` runs against a server that is up and the request that was a 500 is answered by the same process. **Upgrading:** a workflow that starts `x dev` before its first `x db migrate` sees a red banner until it migrates; a script waiting for a fresh `✓` banner after `x db gen` reads `/_x` instead. +- `x db gen` on the **embedded** database refuses an applied migration whose SQL was edited since (`X_MIGRATION_CONFLICT`, exit 1, nothing written) — it rewrote the schema dump to match the edit — and opens that database once to read the ledger (through a running `x dev`, else read-only). An external `DATABASE_URL` is never dialled. **Upgrading:** an edited applied migration is restored (`git checkout -- packages/db/migrations/.sql`), or the dev database rebuilt: `x stop --json && x db reset`. +- `x new` names the test stack's compose project `-test-` and picks its ports from name and directory, so two scaffolds with one name on one machine no longer share a stack. **Upgrading:** nothing; an existing app keeps the `name:` its `docker/docker-compose.test.yml` states. To stop sharing with a same-named app, give it its own `name:` there and its own ports there and in `docker/test-services.env`. +- `x policy explain` reports `needs input` (`verdict: 'needs-input'`, `allowed: null`, counted in `data.pending`), never `deny`, for a predicate that read request input it was not given; the summary names the `--input` command that decides it. A predicate that throws on missing input now gives a `needs-input` row per actor instead of `decidable: false`. **Upgrading:** a script reading `!allowed` as "denied" checks `verdict === 'deny'`. +- `x g query` and `x g resource` reads answer the slice's `View` — the shape the generated actions answer — instead of the whole row: no tenant column on the wire, and a column added to the entity is published only by an edit to the view (live patches included). Files generated before are untouched. +- `X_ENV_MISSING`'s `fix:` is the line to add, in the file the environment loads (`echo 'STRIPE_KEY=' >> .env.development.local`; `.env.test.local` under test, `.env.production` for a deploy), and a malformed key's is `grep -n -e '^KEY=' .env*` — no longer `x env check`, which printed the same error. **Upgrading:** anything matching the old fix text exactly matches the new. +- `x docs ` prints one extra closing line naming the first hit's topic command, and a query that is exactly a topic id answers that topic alone instead of a ranked search. +- An unknown subcommand with no near match answers `x help ` (that command's own subcommands), not `x help`; a mistyped generator keeps the name and slice you typed (`x g acton foo` → `x g action foo`). +- cache: during a rolling deploy, a write on one build also clears the other build's shared Redis tier: the invalidation broadcast names the namespace its own bust cleared, and a receiver skips its shared tier only when that namespace is its own. Old and new pods read each other's frames (an older frame names no scope and busts every tier). **Upgrading:** a custom `InvalidationBroadcast` callback still type-checks; nothing to change. +- cache: a refused delete's re-join is `ZADD … GT`, so it never lowers a later fill's bucket score. **Upgrading:** Redis ≥ 6.2 (Valkey, Dragonfly included); an older server refuses it only on the already-partial refused-`UNLINK` path, reported in the bust's failures. +- action, query, http: `x-ultimate-dates` (and a streamed frame's `dates:` line) is capped at 4,096 bytes (`WIRE_DATES_MAX_BYTES`); an answer needing more carries none, the client reads those instants as ISO strings, and the operation is logged once at `warn` (`http.wire_dates_dropped`). A proxy with a default header buffer no longer answers 502. **Upgrading:** an answer with ~100+ instants that cannot fold (a `[label, instant]` tuple, a `string | Date` column) reaches the client as strings: `grep` the logs for `http.wire_dates_dropped`. +- `x db rollback` needs `ROLLBACK_ALLOW_DESTRUCTIVE` naming each id against an external database that is not on this machine, whatever `ULTIMATE_ENV` says, and on any named deploy (`staging`, `production`, `NODE_ENV=production`). **Upgrading:** a script rolling back a remote database from a shell that names no environment (a compose service host like `db` included) sets `ROLLBACK_ALLOW_DESTRUCTIVE=`. +- `x dev` runs only the roles `app.config.ts`'s `roles` declares, when set, and logs the ones it left out; `x dev --role` naming only undeclared roles is `X_CONFIG_INVALID`. **Upgrading:** an app declaring `roles` lists every role it wants `x dev` to run. +- `startQueue` loads `app.config.ts` on every boot, embedded included. **Upgrading:** a command that boots the queue against an invalid config now refuses `X_CONFIG_INVALID`; `x verify --only manifest` shows the same. +- A scheduled occurrence that one fan-out entry cannot queue (its `tenant()` throws or answers empty) queues nothing, logs `jobs.scheduler.entry-refused` naming the task, job and entry, and is retried each tick until repaired, then queued whole. **Upgrading:** alert on `jobs.scheduler.entry-refused`. +- `database.ssl: true` requires TLS on a URL carrying an empty `?sslmode=` / `?ssl=` (it fell back to plaintext), and an upper-case `?SSLMODE=disable` is the operator's and no longer overridden. **Upgrading:** a deployment that relied on the empty value against a non-TLS server states `?sslmode=disable`. +- `x g sign-in --password` holds its second-factor challenge in auth's `__Host-x_mfa` cookie (`mfaChallengeCookie`), as the OIDC shape does, in place of its own `x_mfa_challenge`. **Upgrading:** an app generated before keeps its own `sign-in-challenge.ts` and cookie unchanged; the new shape's `__Host-` cookie needs HTTPS or `localhost`. +- entity: `gt`/`gte`/`lt`/`lte` on a `uuid()` column with an operand that is not a uuid is `X_INVARIANT_VIOLATED` on both drivers (Postgres answered `22P02`, memory compared the text). **Upgrading:** a memory-driver test relying on text order for such a bound passes a uuid. +- ai: compaction's carried user text is one `KEPT_USER_CHARS` (8,000) budget across ALL compactions, newest kept first; the summary note says how many blocks it carried. **Upgrading:** nothing; a long `.continue()` chat no longer grows its head until `X_AGENT_CONTEXT_EXHAUSTED`. +- `X_FORBIDDEN`'s fix names `--input ''` at all four throw sites, so the command it gives can decide a predicate that reads the request; the request's own input is never printed. **Upgrading:** a test asserting the old `fix:` text updates it. ### Fixed - `bun run preflight` and `bun run coverage` stopped by a signal kill the suites they started, so no orphan keeps its ledger reservation. @@ -40,6 +131,110 @@ Semver applies from 1.0.0. A breaking change to a documented API needs a major - `x upgrade`'s `docs-many-agents` codemod no longer reports `changed: [], skipped: []` when the app reworded its conventions table: it finds the table in `AGENTS.md` too, and otherwise reports the file as skipped with the row to add. It also checks the brief's byte budget (`agentsMdMaxBytes`, 12,000 by default) before writing, and skips with the byte count instead of pushing `CLAUDE.md` over it into `X_AGENTS_MD_TOO_LARGE`. `docs-worker-commands` does the same. - `x upgrade` installs the merge drivers a hop's `.gitattributes` names, as `bun run setup` does, so an upgraded clone has no `X_MERGE_DRIVER_UNSET` left to fix by hand. - A live suite no longer joins another app's test stack that shares its compose project name: it is refused with `X_TEST_SERVICES_UNAVAILABLE`. +- auth: a retired refresh token presented by a client other than the one it was issued to no longer revokes the grant; it is refused as another client's token. +- mcp: `mcpClient` cancels a legacy-server call by its own request id, never a sibling's, and only when the request was sent. +- mcp: a 429, 408 or 403 on the first call no longer switches `mcpClient` to the legacy protocol for good (only a 400/404/405, an era JSON-RPC code or a body that is no answer does); a failed handshake decides nothing; concurrent first calls share one handshake. +- mcp: `listTools` refuses a cursor that never ends (`X_MCP_REMOTE_REFUSED`, `meta.failure: 'malformed'`, past 50 pages) instead of returning a truncated list. +- mail: the SMTP connect is bounded by `timeoutMs` (stage `connect`, retryable), so a dead host no longer holds a pool slot. +- mail: the SES driver sends 7-bit envelope addresses: an encoded-word `From` display name and bare-mailbox destinations. +- scraping: a CDP command the transport refuses to send fails at once with `X_CDP_CALL_FAILED` and leaves no pending entry, and a `null` frame is dropped instead of throwing. +- i18n: `catalogSubset` carries a key's `_select_*` and `_ordinal_*` families, so an island no longer renders `⟦key⟧` where the server renders the message. +- i18n: `t.has(key)` is true for a select or ordinal family defined only in plural forms; a mail's `has()`-guarded preheader and footer no longer drop copy `t()` renders. +- money: a hand-built `Money` with a non-integer `minor` is `X_MONEY_NOT_INTEGER` from every arithmetic, rescale and format entry — never a bare `RangeError`, `$NaN` or `12..5`. +- money: `parseAmount` reads the half-width `¥` in `ja-JP`. +- schema: `sampleGaps` reports a formatted string (`t.email.min(30)`) whose sample cannot meet its length bounds, and `describeSampleGap` names the bound. +- schema: a `.default()` holding a `Date` is published to JSON Schema / OpenAPI / MCP as its ISO string; a default with no JSON form (`Map`, `Set`, `bigint`, a cycle) is omitted. Runtime defaults are unchanged. +- manifest: a non-JSON schema default no longer yields a manifest failing its own `buildId`. +- realtime: the in-process transport expires shared-set keys nobody reads again; a presence room no longer stays in memory after it empties. +- realtime: a live query's policy gets the subscriber's context, so `ctx.actor` is the subscriber, as over HTTP. +- jobs: a scheduled task's jobs are queued under the tenant each declares — a per-org fan-out with one key is one row per org, on the memory and Postgres schedulers. +- jobs: a job fired by the Postgres scheduler carries its `traceparent` (and `enqueued_by`), so its run is a child of the fire's producer span. +- jobs: a proven cross-process wake is re-proven every 10 s (`reproveEveryMs`); a session that stops delivering is un-proven (`jobs.wake.lost`, warn) and the loops return to the 2 s poll until a notification crosses again (`jobs.wake.live`). +- render: an island boots with the props inside its own wrapper (a modal's island took the page's); the hydration runtime is +100 B per strategy. +- render: text in a JSX `', + ); + expect(await renderToHtml(h('script', null, 'if (a && b > 1) x("