From 3cb80b2bc43830f04017f11698a38befb7bcfe8a Mon Sep 17 00:00:00 2001 From: willbot Date: Mon, 23 Nov 2026 10:38:18 +1100 Subject: [PATCH 1/5] Revert "TML-3900: When nobody can answer a command's question, the error leads with the question in plain words (#396)" This reverts commit bb14707a7f1a153fd4e2b33d3a5d7e7d08c5394c. --- .../adrs/0004-engine-version-pinning.md | 2 - .../adrs/0006-consent-as-a-statement.md | 4 -- docs/reference/error-reference.md | 2 +- packages/cli-engine/README.md | 2 +- packages/cli-engine/package.json | 2 +- packages/cli-engine/src/context.ts | 2 - packages/cli-engine/src/execution/prompts.ts | 27 +++---- .../tests/consent-leftovers.test.ts | 28 +------- .../tests/statement-prompts.test.ts | 70 ++++--------------- packages/cli/package.json | 2 +- packages/cli/scripts/conformance.ts | 21 +----- packages/prisma/package.json | 2 +- pnpm-lock.yaml | 4 +- 13 files changed, 34 insertions(+), 134 deletions(-) diff --git a/docs/architecture/adrs/0004-engine-version-pinning.md b/docs/architecture/adrs/0004-engine-version-pinning.md index 3414004d..521ef65a 100644 --- a/docs/architecture/adrs/0004-engine-version-pinning.md +++ b/docs/architecture/adrs/0004-engine-version-pinning.md @@ -47,8 +47,6 @@ The conformance checkers in both publishing repos are the mechanism, evolved fro - **Singleton install**: the packed shell tarball, installed into a clean sandbox, resolves exactly one engine copy — with **no exception list**. Under peers a mismatch fails at install, so the S6-era recorded exceptions are deleted the moment the first tandem release lands the peers. - **Engine-free libraries**: a library package's packed output names the engine in no import and in no consumer-installed dependency field. -**While the products catch up to a new engine version** (added 2026-11-23). Every merge to `main` publishes the engine, so an engine change has to merge before any product can require it. The pull request that bumps the engine records one exception per product in `packages/cli/scripts/conformance.ts`, limited to the `dev` channel. Pull request CI and the development build pass; a release of the CLI is still checked without the exceptions and is refused until every product requires the engine version the shell ships. During that window a development build installs two engine copies, the shell's and the one the products require. The pull request that pins the products' new releases removes the exceptions, and it must pin every product at once: a release pull request that pins only one passes its own checks and is then refused at publish. - ## Cases considered - *User installs the CLI alone* (global, `npx`, devDependency): peers guarantee one engine regardless of how the package manager arranges the tree. diff --git a/docs/architecture/adrs/0006-consent-as-a-statement.md b/docs/architecture/adrs/0006-consent-as-a-statement.md index c2cea4fe..605c68e8 100644 --- a/docs/architecture/adrs/0006-consent-as-a-statement.md +++ b/docs/architecture/adrs/0006-consent-as-a-statement.md @@ -47,10 +47,6 @@ These came from the ORM's first use and the reviews of this change, all in engin - **A signal while a prompt waits cancels the prompt** with `CLI.PROMPT_CANCELLED`: exit 3 for SIGINT, as Ctrl-C at the prompt is the user declining, and 143 for SIGTERM, which ends the run as a delivered signal. Later prompts in the run are cancelled at once, and a further signal force-exits. - **`last: true`** marks a batch as the run's final ask: values still unconsumed fail with `CLI.CONSENT_UNUSED` as soon as it is answered, before the command acts on the answers. -Added in engine 0.10.1: - -- **The question is the first line of the refusal** when it is the only question nobody can answer; with several, the first line counts them and `why` lists them. So a question is one line that names what it is about and what is at stake. - ## Consequences - A product adds a consent vocabulary by declaring it on the command that uses it, and its help text with it. The engine stays free of product words. diff --git a/docs/reference/error-reference.md b/docs/reference/error-reference.md index 2cfdbc88..c197eee8 100644 --- a/docs/reference/error-reference.md +++ b/docs/reference/error-reference.md @@ -186,7 +186,7 @@ The config file's `$prismaConfig` marker declares a version other than the one t A consent prompt was reached under `--yes` or in a non-interactive session. Consent has no default answer and `--yes` does not grant it, so there is nothing for the run to assume. When the consent declares a token, the message and next action say to pass `--confirm `, and the token travels in meta; without a token, the only path is running the command interactively. Meta: `consentToken` (only when the consent declares a token). -A statement prompt (`ctx.prompt.statement` or `ctx.prompt.statements`) raises the same code when no statement flag on the command line answers it. One error lists every question still unanswered, and the next actions give one flag to pass per verb, such as `--delete Legacy` or `--rename 'Legacy:'`. With one question unanswered, the summary is the command's question and `why` says that the user has to choose and that the run cannot ask (or, under `--yes`, that `--yes` does not choose). With several, the summary gives their number and `why` carries the questions. `why` also lists every given statement flag that names none of the questions' subjects, and any `--confirm` token, which answers no statement, so a misspelled flag is reported before anyone answers a prompt. Meta: `unanswered` (a list of `{ subject, verbs }`), plus `subject` and `verbs` when exactly one question is unanswered; `unmatched` (a list of `{ verb, values }`) and `confirm` (the tokens) when any. +A statement prompt (`ctx.prompt.statement` or `ctx.prompt.statements`) raises the same code when no statement flag on the command line answers it. One error lists every question still unanswered: the summary names the subjects, `why` carries the questions, and the next actions give one flag to pass per verb, such as `--delete Legacy` or `--rename 'Legacy:'`. `why` also lists every given statement flag that names none of the questions' subjects, and any `--confirm` token, which answers no statement, so a misspelled flag is reported before anyone answers a prompt. Meta: `unanswered` (a list of `{ subject, verbs }`), plus `subject` and `verbs` when exactly one question is unanswered; `unmatched` (a list of `{ verb, values }`) and `confirm` (the tokens) when any. ### CLI.CONSENT_UNUSED diff --git a/packages/cli-engine/README.md b/packages/cli-engine/README.md index 8d58d56d..419a0d4a 100644 --- a/packages/cli-engine/README.md +++ b/packages/cli-engine/README.md @@ -66,7 +66,7 @@ Each occurrence of `--` takes exactly `arity` values, in argv order across The engine answers the question in this order: 1. A verb flag whose first value names the subject: the value is the subject, or starts with `:`. `--delete Legacy` and `--rename Legacy:Archive` both name `Legacy`. Within one batch, a value equal to a subject answers that subject first, and any other value goes to the longest subject it names, so `--delete A:B` answers the question about `A:B`, not the one about `A`. Ask questions whose subjects are prefixes of one another in one batch. A value `validate` rejects fails the run with `CLI.PROMPT_INVALID`. -2. With no such value, a non-interactive run, or one under `--yes`, fails with `CLI.CONSENT_REQUIRED`. When one question is unanswered, the error's first line is that question word for word, so write the question to name what it is about. Its next actions give one flag to pass per verb, safe to paste into a shell: a value with anything but plain characters is single-quoted, and a value starting with `-` is written `--=`, and its `meta` carries `subject`, `verbs` and `unanswered`. +2. With no such value, a non-interactive run, or one under `--yes`, fails with `CLI.CONSENT_REQUIRED`. Its next actions give one flag to pass per verb, safe to paste into a shell: a value with anything but plain characters is single-quoted, and a value starting with `-` is written `--=`, and its `meta` carries `subject`, `verbs` and `unanswered`. 3. Otherwise the user is asked, and answers ` `, or `` alone to mean the subject. A verb with an arity above 1 takes its values from the text, separated by whitespace, and `text` is them joined by one space, as for a flag. A rejected answer is asked again on a terminal; with scripted or piped input it fails with `CLI.PROMPT_INVALID`. `ctx.prompt.statements([...])` asks several questions at once and returns the answers in order. Flags answer what they can, a refusal lists every question still unanswered, and an interactive run asks the rest one after another. diff --git a/packages/cli-engine/package.json b/packages/cli-engine/package.json index 7e1631a0..e122f034 100644 --- a/packages/cli-engine/package.json +++ b/packages/cli-engine/package.json @@ -1,6 +1,6 @@ { "name": "@prisma/cli-engine", - "version": "0.10.1", + "version": "0.10.0", "description": "The execution engine of the unified Prisma CLI.", "type": "module", "exports": { diff --git a/packages/cli-engine/src/context.ts b/packages/cli-engine/src/context.ts index 0ed1cf49..357ef066 100644 --- a/packages/cli-engine/src/context.ts +++ b/packages/cli-engine/src/context.ts @@ -216,8 +216,6 @@ export interface StatementOptions { export interface StatementQuestion extends StatementOptions { - /** Shown as the prompt, and as the first line of the error when it is - * the only question nobody can answer. Name what it is about. */ readonly question: string; } diff --git a/packages/cli-engine/src/execution/prompts.ts b/packages/cli-engine/src/execution/prompts.ts index 6875ae3a..c8c2a754 100644 --- a/packages/cli-engine/src/execution/prompts.ts +++ b/packages/cli-engine/src/execution/prompts.ts @@ -158,7 +158,6 @@ function answerFromFlags( function strayFlagLines( state: RunState, subjects: readonly string[], - verbs: readonly string[], ): readonly string[] { const unmatched = state.statementValues.filter( (value) => @@ -168,11 +167,11 @@ function strayFlagLines( return [ ...unmatched.map( (value) => - `${flagForm(value.verb, value.values)} does not name ${subjects.join(" or ")}.`, + `${flagForm(value.verb, value.values)} answers no question; the questions are about ${subjects.join(", ")}.`, ), ...state.confirmValues.map( (token) => - `${flagForm("confirm", [token])} does not choose what happens; ${verbs.map((verb) => `--${verb}`).join(" or ")} does.`, + `${flagForm("confirm", [token])} answers no consent in this run; a statement flag is what answers these questions.`, ), ]; } @@ -182,14 +181,14 @@ function statementUnavailable( subjects: readonly string[], state: RunState, ): CliStructuredError { + const quoted = unanswered.map((question) => `"${question.subject}"`); const situation = state.yes - ? "--yes does not choose for you" - : "this run cannot ask you"; - const [only, ...others] = unanswered; - const alone = others.length === 0; - const summary = alone - ? only.question - : `${unanswered.length} choices are needed, and ${situation}.`; + ? "which --yes cannot give" + : "and the session is not interactive"; + const summary = + unanswered.length === 1 + ? `${quoted[0]} needs a statement, ${situation}.` + : `${unanswered.length} subjects need a statement, ${situation}: ${quoted.join(", ")}.`; const listed = unanswered.map(({ subject, verbs }) => ({ subject, verbs })); const unmatched = state.statementValues .filter( @@ -200,12 +199,8 @@ function statementUnavailable( .map(({ verb, values }) => ({ verb, values })); return new CliStructuredError("CLI.CONSENT_REQUIRED", summary, { why: [ - ...(alone - ? [`You have to choose what happens, and ${situation}.`] - : unanswered.map((question) => question.question)), - ...strayFlagLines(state, subjects, [ - ...new Set(unanswered.flatMap((question) => question.verbs)), - ]), + ...unanswered.map((question) => question.question), + ...strayFlagLines(state, subjects), ].join("\n"), nextActions: unanswered.flatMap((question) => question.verbs.map((verb) => ({ diff --git a/packages/cli-engine/tests/consent-leftovers.test.ts b/packages/cli-engine/tests/consent-leftovers.test.ts index 22e71874..931fd90f 100644 --- a/packages/cli-engine/tests/consent-leftovers.test.ts +++ b/packages/cli-engine/tests/consent-leftovers.test.ts @@ -99,7 +99,7 @@ describe("an unconsumed --confirm token", () => { }); }); - test("is reported with a statement refusal, which names the flags that choose", async () => { + test("is reported with a statement refusal, which says a statement flag answers it", async () => { const result = await cliWith(askBoth).run([ "probe", "--confirm", @@ -109,32 +109,10 @@ describe("an unconsumed --confirm token", () => { expect(errorOf(result)).toMatchObject({ code: "CLI.CONSENT_REQUIRED", - why: "What happens to Legacy?\nWhat happens to User.nickname?\n--confirm mydb does not choose what happens; --rename or --delete does.", + why: "What happens to Legacy?\nWhat happens to User.nickname?\n--confirm mydb answers no consent in this run; a statement flag is what answers these questions.", meta: { confirm: ["mydb"] }, }); }); - - test("names only the flags of the questions still unanswered", async () => { - const result = await cliWith((prompt) => - prompt.statements([ - question("Legacy"), - { ...question("User.nickname"), verbs: ["delete"] }, - ]), - ).run([ - "probe", - "--rename", - "Legacy:Archive", - "--confirm", - "mydb", - "--json", - ]); - - expect(errorOf(result)).toMatchObject({ - code: "CLI.CONSENT_REQUIRED", - summary: "What happens to User.nickname?", - why: "You have to choose what happens, and this run cannot ask you.\n--confirm mydb does not choose what happens; --delete does.", - }); - }); }); describe("a statement value that matches no question", () => { @@ -148,7 +126,7 @@ describe("a statement value that matches no question", () => { expect(errorOf(result)).toMatchObject({ code: "CLI.CONSENT_REQUIRED", - why: "What happens to Legacy?\nWhat happens to User.nickname?\n--delete Legcy does not name Legacy or User.nickname.", + why: "What happens to Legacy?\nWhat happens to User.nickname?\n--delete Legcy answers no question; the questions are about Legacy, User.nickname.", meta: { unmatched: [{ verb: "delete", values: ["Legcy"] }] }, }); }); diff --git a/packages/cli-engine/tests/statement-prompts.test.ts b/packages/cli-engine/tests/statement-prompts.test.ts index b675d0bf..185ade73 100644 --- a/packages/cli-engine/tests/statement-prompts.test.ts +++ b/packages/cli-engine/tests/statement-prompts.test.ts @@ -179,15 +179,16 @@ describe("a verb flag answers the statement", () => { }); describe("without a flag, a non-interactive run refuses", () => { - test("the refusal leads with the question and gives one flag form per verb", async () => { + test("the refusal names the subject and one flag form per verb", async () => { const result = await cliWith(askLegacy).run(["probe", "--json"]); expect(result.exitCode).toBe(2); expect(errorOf(result)).toEqual({ code: "CLI.CONSENT_REQUIRED", severity: "error", - summary: LEGACY_QUESTION, - why: "You have to choose what happens, and this run cannot ask you.", + summary: + '"Legacy" needs a statement, and the session is not interactive.', + why: LEGACY_QUESTION, nextActions: [ { kind: "user-choice", @@ -213,19 +214,16 @@ describe("without a flag, a non-interactive run refuses", () => { ); expect(result.exitCode).toBe(2); - expect(errorOf(result)).toMatchObject({ - summary: LEGACY_QUESTION, - why: "You have to choose what happens, and --yes does not choose for you.", - }); + expect(errorOf(result)?.summary).toBe( + '"Legacy" needs a statement, which --yes cannot give.', + ); }); test("the human refusal prints each flag form as a next action", async () => { const result = await cliWith(askLegacy).run(["probe", "--format", "human"]); expect(result.exitCode).toBe(2); - expect(result.stderr).toContain( - `[CLI.CONSENT_REQUIRED] ${LEGACY_QUESTION}`, - ); + expect(result.stderr).toContain("[CLI.CONSENT_REQUIRED]"); expect(result.stderr).toContain( "Run the command again with --rename 'Legacy:'", ); @@ -235,38 +233,6 @@ describe("without a flag, a non-interactive run refuses", () => { }); }); -describe("a refusal of one question with a flag that answers nothing", () => { - test("says which subject a statement flag does not name", async () => { - const result = await cliWith(askLegacy).run([ - "probe", - "--delete", - "Legcy", - "--json", - ]); - - expect(errorOf(result)).toMatchObject({ - code: "CLI.CONSENT_REQUIRED", - summary: LEGACY_QUESTION, - why: "You have to choose what happens, and this run cannot ask you.\n--delete Legcy does not name Legacy.", - }); - }); - - test("says which flags choose when --confirm was given", async () => { - const result = await cliWith(askLegacy).run([ - "probe", - "--confirm", - "mydb", - "--json", - ]); - - expect(errorOf(result)).toMatchObject({ - code: "CLI.CONSENT_REQUIRED", - summary: LEGACY_QUESTION, - why: "You have to choose what happens, and this run cannot ask you.\n--confirm mydb does not choose what happens; --rename or --delete does.", - }); - }); -}); - describe("an interactive run asks", () => { test("a bare verb answers with the subject", async () => { const result = await cliWith(askLegacy).run(["probe"], { @@ -346,8 +312,8 @@ describe("prompt.statements asks several questions together", () => { expect(result.exitCode).toBe(2); expect(errorOf(result)).toMatchObject({ code: "CLI.CONSENT_REQUIRED", - summary: USER_NAME_QUESTION, - why: "You have to choose what happens, and this run cannot ask you.", + summary: + '"User.name" needs a statement, and the session is not interactive.', nextActions: [ { kind: "user-choice", @@ -364,19 +330,6 @@ describe("prompt.statements asks several questions together", () => { }); }); - test("--yes answers none of several questions", async () => { - const result = await cliWith(askBoth).run( - ["probe", "--yes", "--json"], - INTERACTIVE, - ); - - expect(errorOf(result)).toMatchObject({ - code: "CLI.CONSENT_REQUIRED", - summary: "2 choices are needed, and --yes does not choose for you.", - why: `${LEGACY_QUESTION}\n${USER_NAME_QUESTION}`, - }); - }); - test("one refusal lists every unanswered question", async () => { const result = await cliWith(askBoth).run(["probe", "--json"]); @@ -384,7 +337,8 @@ describe("prompt.statements asks several questions together", () => { expect(errorOf(result)).toEqual({ code: "CLI.CONSENT_REQUIRED", severity: "error", - summary: "2 choices are needed, and this run cannot ask you.", + summary: + '2 subjects need a statement, and the session is not interactive: "Legacy", "User.name".', why: `${LEGACY_QUESTION}\n${USER_NAME_QUESTION}`, nextActions: [ { diff --git a/packages/cli/package.json b/packages/cli/package.json index 60ea193e..941a580a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@manypkg/tools": "^2.1.2", - "@prisma/cli-engine": "workspace:0.10.1", + "@prisma/cli-engine": "workspace:0.10.0", "@prisma/composer-cli": "0.39.0", "@prisma/compute-sdk": "0.43.0", "@prisma/management-api-sdk": "1.80.0", diff --git a/packages/cli/scripts/conformance.ts b/packages/cli/scripts/conformance.ts index e440b15d..3403120d 100644 --- a/packages/cli/scripts/conformance.ts +++ b/packages/cli/scripts/conformance.ts @@ -109,26 +109,7 @@ async function tarball(): Promise { shellPackage: "@prisma/cli", enginePackage: "@prisma/cli-engine", familyPackages: ["@prisma/composer-cli", "@prisma/orm-toolchain"], - exceptions: [ - { - familyPackage: "@prisma/composer-cli", - familyPin: "0.10.0", - shellPin: "0.10.1", - channel: "dev", - reason: "engine 0.10.1 must publish before composer-cli can peer it", - removeWhen: - "composer-cli releases peering 0.10.1 and the follow-up bump PR pins that release", - }, - { - familyPackage: "@prisma/orm-toolchain", - familyPin: "0.10.0", - shellPin: "0.10.1", - channel: "dev", - reason: "engine 0.10.1 must publish before orm-toolchain can peer it", - removeWhen: - "orm-toolchain releases peering 0.10.1 and the follow-up bump PR pins that release", - }, - ], + exceptions: [], channel: CHANNEL, sandboxDir: join(WORK_DIR, "sandbox"), }, diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 310c3f7e..52a9887e 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -50,7 +50,7 @@ }, "dependencies": { "@manypkg/tools": "^2.1.2", - "@prisma/cli-engine": "workspace:0.10.1", + "@prisma/cli-engine": "workspace:0.10.0", "@prisma/composer-cli": "0.39.0", "@prisma/compute-sdk": "0.43.0", "@prisma/management-api-sdk": "1.80.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 09631fdc..640f5a47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,7 @@ importers: specifier: ^2.1.2 version: 2.1.2 '@prisma/cli-engine': - specifier: workspace:0.10.1 + specifier: workspace:0.10.0 version: link:../cli-engine '@prisma/composer-cli': specifier: 0.39.0 @@ -210,7 +210,7 @@ importers: specifier: ^2.1.2 version: 2.1.2 '@prisma/cli-engine': - specifier: workspace:0.10.1 + specifier: workspace:0.10.0 version: link:../cli-engine '@prisma/composer-cli': specifier: 0.39.0 From 951e7384d0bea9b8d1d8a19263c64a1b3fb10807 Mon Sep 17 00:00:00 2001 From: willbot Date: Mon, 23 Nov 2026 10:39:25 +1100 Subject: [PATCH 2/5] The reverted engine is version 0.10.2, because 0.10.1 is already published; development builds may ship it while the products still require 0.10.0 Signed-off-by: willbot Signed-off-by: Will Madden --- packages/cli-engine/package.json | 2 +- packages/cli/package.json | 2 +- packages/cli/scripts/conformance.ts | 23 ++++++++++++++++++++++- packages/prisma/package.json | 2 +- pnpm-lock.yaml | 4 ++-- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/cli-engine/package.json b/packages/cli-engine/package.json index e122f034..accc1dbe 100644 --- a/packages/cli-engine/package.json +++ b/packages/cli-engine/package.json @@ -1,6 +1,6 @@ { "name": "@prisma/cli-engine", - "version": "0.10.0", + "version": "0.10.2", "description": "The execution engine of the unified Prisma CLI.", "type": "module", "exports": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 941a580a..fc2cff5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@manypkg/tools": "^2.1.2", - "@prisma/cli-engine": "workspace:0.10.0", + "@prisma/cli-engine": "workspace:0.10.2", "@prisma/composer-cli": "0.39.0", "@prisma/compute-sdk": "0.43.0", "@prisma/management-api-sdk": "1.80.0", diff --git a/packages/cli/scripts/conformance.ts b/packages/cli/scripts/conformance.ts index 3403120d..17a6e78f 100644 --- a/packages/cli/scripts/conformance.ts +++ b/packages/cli/scripts/conformance.ts @@ -109,7 +109,28 @@ async function tarball(): Promise { shellPackage: "@prisma/cli", enginePackage: "@prisma/cli-engine", familyPackages: ["@prisma/composer-cli", "@prisma/orm-toolchain"], - exceptions: [], + exceptions: [ + { + familyPackage: "@prisma/composer-cli", + familyPin: "0.10.0", + shellPin: "0.10.2", + channel: "dev", + reason: + "engine 0.10.1 changed an error's text and 0.10.2 reverts it; composer-cli still peers 0.10.0", + removeWhen: + "composer-cli releases peering 0.10.2 and the follow-up bump PR pins that release", + }, + { + familyPackage: "@prisma/orm-toolchain", + familyPin: "0.10.0", + shellPin: "0.10.2", + channel: "dev", + reason: + "engine 0.10.1 changed an error's text and 0.10.2 reverts it; orm-toolchain still peers 0.10.0", + removeWhen: + "orm-toolchain releases peering 0.10.2 and the follow-up bump PR pins that release", + }, + ], channel: CHANNEL, sandboxDir: join(WORK_DIR, "sandbox"), }, diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 52a9887e..0aef011b 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -50,7 +50,7 @@ }, "dependencies": { "@manypkg/tools": "^2.1.2", - "@prisma/cli-engine": "workspace:0.10.0", + "@prisma/cli-engine": "workspace:0.10.2", "@prisma/composer-cli": "0.39.0", "@prisma/compute-sdk": "0.43.0", "@prisma/management-api-sdk": "1.80.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 640f5a47..8785466c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,7 @@ importers: specifier: ^2.1.2 version: 2.1.2 '@prisma/cli-engine': - specifier: workspace:0.10.0 + specifier: workspace:0.10.2 version: link:../cli-engine '@prisma/composer-cli': specifier: 0.39.0 @@ -210,7 +210,7 @@ importers: specifier: ^2.1.2 version: 2.1.2 '@prisma/cli-engine': - specifier: workspace:0.10.0 + specifier: workspace:0.10.2 version: link:../cli-engine '@prisma/composer-cli': specifier: 0.39.0 From 627a3e630ad7d473e2afd6c2c82abd5c95cd0fc7 Mon Sep 17 00:00:00 2001 From: willbot Date: Mon, 23 Nov 2026 10:43:18 +1100 Subject: [PATCH 3/5] The engine versioning decision record keeps the paragraph on how an engine change merges before the products require it Signed-off-by: willbot Signed-off-by: Will Madden --- docs/architecture/adrs/0004-engine-version-pinning.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/architecture/adrs/0004-engine-version-pinning.md b/docs/architecture/adrs/0004-engine-version-pinning.md index 521ef65a..3414004d 100644 --- a/docs/architecture/adrs/0004-engine-version-pinning.md +++ b/docs/architecture/adrs/0004-engine-version-pinning.md @@ -47,6 +47,8 @@ The conformance checkers in both publishing repos are the mechanism, evolved fro - **Singleton install**: the packed shell tarball, installed into a clean sandbox, resolves exactly one engine copy — with **no exception list**. Under peers a mismatch fails at install, so the S6-era recorded exceptions are deleted the moment the first tandem release lands the peers. - **Engine-free libraries**: a library package's packed output names the engine in no import and in no consumer-installed dependency field. +**While the products catch up to a new engine version** (added 2026-11-23). Every merge to `main` publishes the engine, so an engine change has to merge before any product can require it. The pull request that bumps the engine records one exception per product in `packages/cli/scripts/conformance.ts`, limited to the `dev` channel. Pull request CI and the development build pass; a release of the CLI is still checked without the exceptions and is refused until every product requires the engine version the shell ships. During that window a development build installs two engine copies, the shell's and the one the products require. The pull request that pins the products' new releases removes the exceptions, and it must pin every product at once: a release pull request that pins only one passes its own checks and is then refused at publish. + ## Cases considered - *User installs the CLI alone* (global, `npx`, devDependency): peers guarantee one engine regardless of how the package manager arranges the tree. From 2d3f57716f31aa925726f621519b8560400402a2 Mon Sep 17 00:00:00 2001 From: willbot Date: Mon, 23 Nov 2026 10:44:43 +1100 Subject: [PATCH 4/5] When a command needs explicit consent and nobody gave it, the first line of the error says so in plain words Signed-off-by: willbot Signed-off-by: Will Madden --- packages/cli-engine/src/execution/prompts.ts | 11 +++-------- packages/cli-engine/tests/statement-prompts.test.ts | 8 ++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/cli-engine/src/execution/prompts.ts b/packages/cli-engine/src/execution/prompts.ts index c8c2a754..79444451 100644 --- a/packages/cli-engine/src/execution/prompts.ts +++ b/packages/cli-engine/src/execution/prompts.ts @@ -181,14 +181,9 @@ function statementUnavailable( subjects: readonly string[], state: RunState, ): CliStructuredError { - const quoted = unanswered.map((question) => `"${question.subject}"`); - const situation = state.yes - ? "which --yes cannot give" - : "and the session is not interactive"; - const summary = - unanswered.length === 1 - ? `${quoted[0]} needs a statement, ${situation}.` - : `${unanswered.length} subjects need a statement, ${situation}: ${quoted.join(", ")}.`; + const summary = state.yes + ? "This command requires explicit consent, and --yes does not give it." + : "This command requires explicit consent, but it was not provided."; const listed = unanswered.map(({ subject, verbs }) => ({ subject, verbs })); const unmatched = state.statementValues .filter( diff --git a/packages/cli-engine/tests/statement-prompts.test.ts b/packages/cli-engine/tests/statement-prompts.test.ts index 185ade73..3a4e0c9c 100644 --- a/packages/cli-engine/tests/statement-prompts.test.ts +++ b/packages/cli-engine/tests/statement-prompts.test.ts @@ -187,7 +187,7 @@ describe("without a flag, a non-interactive run refuses", () => { code: "CLI.CONSENT_REQUIRED", severity: "error", summary: - '"Legacy" needs a statement, and the session is not interactive.', + "This command requires explicit consent, but it was not provided.", why: LEGACY_QUESTION, nextActions: [ { @@ -215,7 +215,7 @@ describe("without a flag, a non-interactive run refuses", () => { expect(result.exitCode).toBe(2); expect(errorOf(result)?.summary).toBe( - '"Legacy" needs a statement, which --yes cannot give.', + "This command requires explicit consent, and --yes does not give it.", ); }); @@ -313,7 +313,7 @@ describe("prompt.statements asks several questions together", () => { expect(errorOf(result)).toMatchObject({ code: "CLI.CONSENT_REQUIRED", summary: - '"User.name" needs a statement, and the session is not interactive.', + "This command requires explicit consent, but it was not provided.", nextActions: [ { kind: "user-choice", @@ -338,7 +338,7 @@ describe("prompt.statements asks several questions together", () => { code: "CLI.CONSENT_REQUIRED", severity: "error", summary: - '2 subjects need a statement, and the session is not interactive: "Legacy", "User.name".', + "This command requires explicit consent, but it was not provided.", why: `${LEGACY_QUESTION}\n${USER_NAME_QUESTION}`, nextActions: [ { From 02347e92a24a073cde8d1a9ebbdd075395553ad2 Mon Sep 17 00:00:00 2001 From: willbot Date: Mon, 23 Nov 2026 10:47:50 +1100 Subject: [PATCH 5/5] The error reference and the conformance exceptions describe the new first line Signed-off-by: willbot Signed-off-by: Will Madden --- docs/reference/error-reference.md | 2 +- packages/cli/scripts/conformance.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/error-reference.md b/docs/reference/error-reference.md index c197eee8..44403258 100644 --- a/docs/reference/error-reference.md +++ b/docs/reference/error-reference.md @@ -186,7 +186,7 @@ The config file's `$prismaConfig` marker declares a version other than the one t A consent prompt was reached under `--yes` or in a non-interactive session. Consent has no default answer and `--yes` does not grant it, so there is nothing for the run to assume. When the consent declares a token, the message and next action say to pass `--confirm `, and the token travels in meta; without a token, the only path is running the command interactively. Meta: `consentToken` (only when the consent declares a token). -A statement prompt (`ctx.prompt.statement` or `ctx.prompt.statements`) raises the same code when no statement flag on the command line answers it. One error lists every question still unanswered: the summary names the subjects, `why` carries the questions, and the next actions give one flag to pass per verb, such as `--delete Legacy` or `--rename 'Legacy:'`. `why` also lists every given statement flag that names none of the questions' subjects, and any `--confirm` token, which answers no statement, so a misspelled flag is reported before anyone answers a prompt. Meta: `unanswered` (a list of `{ subject, verbs }`), plus `subject` and `verbs` when exactly one question is unanswered; `unmatched` (a list of `{ verb, values }`) and `confirm` (the tokens) when any. +A statement prompt (`ctx.prompt.statement` or `ctx.prompt.statements`) raises the same code when no statement flag on the command line answers it. One error lists every question still unanswered: the summary says the command requires explicit consent and did not get it (under `--yes`, that `--yes` does not give it), `why` carries the questions, and the next actions give one flag to pass per verb, such as `--delete Legacy` or `--rename 'Legacy:'`. `why` also lists every given statement flag that names none of the questions' subjects, and any `--confirm` token, which answers no statement, so a misspelled flag is reported before anyone answers a prompt. Meta: `unanswered` (a list of `{ subject, verbs }`), plus `subject` and `verbs` when exactly one question is unanswered; `unmatched` (a list of `{ verb, values }`) and `confirm` (the tokens) when any. ### CLI.CONSENT_UNUSED diff --git a/packages/cli/scripts/conformance.ts b/packages/cli/scripts/conformance.ts index 17a6e78f..d6a5309a 100644 --- a/packages/cli/scripts/conformance.ts +++ b/packages/cli/scripts/conformance.ts @@ -116,7 +116,7 @@ async function tarball(): Promise { shellPin: "0.10.2", channel: "dev", reason: - "engine 0.10.1 changed an error's text and 0.10.2 reverts it; composer-cli still peers 0.10.0", + "engine 0.10.2 changes the first line of the statement refusal; composer-cli still peers 0.10.0", removeWhen: "composer-cli releases peering 0.10.2 and the follow-up bump PR pins that release", }, @@ -126,7 +126,7 @@ async function tarball(): Promise { shellPin: "0.10.2", channel: "dev", reason: - "engine 0.10.1 changed an error's text and 0.10.2 reverts it; orm-toolchain still peers 0.10.0", + "engine 0.10.2 changes the first line of the statement refusal; orm-toolchain still peers 0.10.0", removeWhen: "orm-toolchain releases peering 0.10.2 and the follow-up bump PR pins that release", },