Skip to content

docs(adr): ADR 245 adopts typed nextActions (S4 follow-up) - #29958

Merged
wmadden-electric merged 2 commits into
mainfrom
s4-adr-245-next-actions
Aug 11, 2026
Merged

wmadden-electric merged 2 commits into
mainfrom
s4-adr-245-next-actions

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Trails #29957, which amended ADR 239 to replace the freeform fix?: string prose field with a typed nextActions: readonly NextAction[]. ADR 245 governs how ADR 239's envelopes are built and carried, so it spells the envelope fields out in its examples and prose — and five of those spellings still said fix. This brings it into line. Merge after #29957.

The grounding example, before and after

ADR 245 opens with a raise site: the only place that knows enough to fill in an envelope.

Before

errorRuntime('MIGRATION.SNAPSHOT_MISSING', `Ref "${refName}" is not resolvable`, {
  why: `Ref "${refName}" has no pointer file and its fallback hash is not a graph node.`,
  fix: `Create the ref with \`prisma-next ref set ${refName} <hash>\`, or pass a graph-node hash.`,
  meta: { identifier: refName, viaRef: true },
})

After

errorRuntime('MIGRATION.SNAPSHOT_MISSING', `Ref "${refName}" is not resolvable`, {
  why: `Ref "${refName}" has no pointer file and its fallback hash is not a graph node.`,
  nextActions: [
    { kind: 'run-command', label: 'Create the ref', command: `prisma-next ref set ${refName} <hash>` },
    { kind: 'user-choice', label: 'Or pass a graph-node hash instead of a ref name' },
  ],
  meta: { identifier: refName, viaRef: true },
})

The fix string was two alternatives fused into one sentence, with a backtick-quoted command and a placeholder inside it. A consumer wanting to offer "create the ref" as a one-click action had to parse English to find the command. Now it reads nextActions[0].command.

The decision

No new rules. ADR 245 says the same things in the vocabulary ADR 239 settled. Five sites:

  1. The raise-site example above.
  2. The serialized toEnvelope() field list — code/summary/why/nextActions/where/meta, without cause.
  3. Rule 1 — a failure carries "its own dotted code, its own why, and its own nextActions".
  4. The MigrationToolsError subclass example — its constructor requires why and a non-empty nextActions. (The shipped class currently requires why/fix; like every other call site, it converts under the ratchet ADR 239 describes. No code is changed here.)
  5. The "Why" paragraph on structuring at origin. This one gets sharper under the rename rather than merely renamed, so it gained a sentence: a next action names an executable command with real arguments in it, and the raise site is the only place that holds those arguments. The argument for structuring at origin was always about where the knowledge lives; typed actions make the claim concrete.

The Related: line now points at ADR 239 for the field definition itself, so a reader who lands on 245 first knows where the shape is specified.

ADR-INDEX.md's description of ADR 245 is updated to match.

What is not here

  • No code changes. The several hundred fix: call sites — MigrationToolsError included — convert under the ratchet, per ADR 239.
  • docs/Error Handling.md untouched. It says user-facing surfaces should "emphasize why/fix/docs", which is loose prose about what to foreground, not a field list. Nothing there is now wrong. Say the word if you want it tightened anyway.

Verification

node scripts/list-error-codes.mjs --verify docs/reference/error-reference.md → error-reference lists all 275 known codes. No codes change. Docs-only, so no test suites.

Note for whoever merges

Both this PR and #29957 touch ADR-INDEX.md, and their edits land on adjacent lines — #29957 inserts a new ADR 239 row immediately above the ADR 245 row that this PR edits. Expect a possible textual conflict on the second merge; the resolution is to keep both changes.

Slice S4 of prisma-cli-v8, follow-up.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated architecture documentation to describe typed nextActions alongside structured error codes and explanations.
    • Revised ADR 245 examples and guidance to use structured follow-up actions instead of string-based fixes.
    • Clarified requirements for error subclasses and serialization of recommended next steps.

ADR 245 governs how ADR 239 envelopes are built and carried, so its
examples and prose spell the envelope fields out. Five of those spellings
still said `fix`, which ADR 239 has replaced with a typed
`nextActions: readonly NextAction[]`.

Updated: the raise-site grounding example, the serialized `toEnvelope()`
field list, rule 1 ("its own dotted code, why, and nextActions"), the
`MigrationToolsError` subclass example, and the "Why" paragraph on putting
remediation where the knowledge is. That last one gets sharper under the
rename, not just renamed: a next action names an executable command with
real arguments in it, and the raise site is the only place holding those
arguments. The Related line now points at ADR 239 for the field itself.

Docs only, and no rule changes — this is ADR 245 saying the same things in
the vocabulary ADR 239 settled.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner August 11, 2026 07:05
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 985cb322-25c9-4ff7-8975-0ea8bdcc9abc

📥 Commits

Reviewing files that changed from the base of the PR and between 42e64f3 and ff1346b.

📒 Files selected for processing (1)
  • docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results carry one ok discriminator.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results carry one ok discriminator.md

📝 Walkthrough

Walkthrough

ADR 245 documentation now references ADR 239’s typed nextActions, updates failure examples, and replaces prose fix guidance in its error contract and rationale.

Changes

ADR 245 typed remediation actions

Layer / File(s) Summary
Structured error contract and examples
docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results carry one ok discriminator.md
Failure examples and decision rules now use typed nextActions alongside why. Domain subclasses require non-empty actions when remediation guidance applies.
ADR references and rationale
docs/architecture docs/ADR-INDEX.md, docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results carry one ok discriminator.md
The index references typed nextActions, and the rationale describes executable commands supplied at the raise site.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: wmadden

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the ADR 245 update to use typed nextActions and accurately reflects the main documentation change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch s4-adr-245-next-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture` docs/adrs/ADR 245 - Errors are structured at origin;
results carry one ok discriminator.md:
- Line 5: The ADR 245 reference and ADR index must match ADR 239’s contract,
which defines fix?: string rather than typed nextActions. Update
docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results
carry one ok discriminator.md:5-5 and docs/architecture
docs/ADR-INDEX.md:100-100 to remove or correct the typed nextActions claim, or
update ADR 239 consistently if that contract is intended to change.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: da90efd4-b627-4ad2-9b8f-b9d9665d98a3

📥 Commits

Reviewing files that changed from the base of the PR and between 7e80e77 and 42e64f3.

📒 Files selected for processing (2)
  • docs/architecture docs/ADR-INDEX.md
  • docs/architecture docs/adrs/ADR 245 - Errors are structured at origin; results carry one ok discriminator.md

Drop the amendment-process aside in the Related line, name the Composer
repository explicitly, and explain the category discriminant in the
subclass predicate example.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit d2a0843 Aug 11, 2026
16 checks passed
@wmadden-electric
wmadden-electric deleted the s4-adr-245-next-actions branch August 11, 2026 08:18
SnowingFox pushed a commit to SnowingFox/prisma that referenced this pull request Aug 12, 2026
…or (prisma#29976)

## Linked issue

n/a — small docs change. Prompted by the engine-side telemetry work now
underway; see the note at the end about what this PR deliberately does
*not* pre-document.

## At a glance

`docs/Telemetry.md`, "Flipping your choice", before:

> To turn telemetry off (or back on), run `prisma-next telemetry
disable` / `prisma-next telemetry enable`, or edit the file in any text
editor and change the `enableTelemetry` value.

After:

> To turn telemetry off (or back on), run `prisma-next telemetry
disable` / `prisma-next telemetry enable`. The command writes the
`enableTelemetry` value for you and the change takes effect on the next
CLI invocation. `prisma-next telemetry status` reports what is in effect
and why.

## Decision

`prisma-next telemetry enable | disable | status` have been in the CLI
the whole time. They exist so nobody has to open a JSON file to change
their telemetry preference. The telemetry page was still teaching the
JSON file as an equal route in three places — one of them told readers
they could pre-create the file before ever running the CLI.

Hand-editing is now documented as what the file *is*, not as something
you should do. The distinction the page holds throughout: **describing
the file is useful reference material; recommending that users write to
it is not.** `telemetry status` prints the file's path, so a reader who
lands on it needs to know what the fields mean.

Nothing about where the file lives, what it contains, or how the fields
resolve is removed.

## How it fits together

1. **"The user-level config file"** opens with one new sentence saying
who writes it: the commands set the preference, `status` prints the
resolved path, and the section that follows describes the contents so
you can *read* them. The path bullets, the JSON samples, and the
`enableTelemetry` / `installationId` field definitions are all
untouched.
2. **Two field descriptions** dropped their "…or a hand edit"
parenthetical. They now say the CLI writes `enableTelemetry` when you
make an explicit choice with `enable` / `disable`.
3. **"Flipping your choice"** stops offering the text editor (shown
above).
4. **"Fully resetting"** no longer offers `keep "enableTelemetry": false
in it` as an alternative to running `disable`.
5. **"The `prisma-next telemetry` command"** now says plainly why it
exists, and notes that `enable` / `disable` write the preference
atomically and preserve every other field in the file — which is the
concrete reason to prefer them over an editor.
6. **"2. The stored preference"** keeps the JSON sample as *what
`disable` writes*, and the paragraph telling readers to drop a pre-made
`config.json` on disk is replaced. Provisioning a machine where the CLI
has never run is a real need, and the environment variables already
serve it — they work before any config file exists and suppress the
first-run notice too.

The `skills/prisma-8` quickstart carried the same hand-edit clause in
its telemetry callout; it goes the same way, keeping the per-user vs.
`prisma-next.config.ts` distinction it was making.

## Reviewer notes

- **Nothing shipped-behaviour-facing moved.** No filesystem path, no
environment-variable name, no wording inside the verbatim first-run
notice, and no `prisma-next` command prefix changed. Token counts for
each of those are identical before and after; the only increase is
`prisma-next telemetry`, which gains two mentions because the commands
are now the route.
- **The first-run notice still mentions setting `"enableTelemetry":
false` yourself.** That block is quoted verbatim from the shipped binary
and is left exactly as-is, so the page keeps matching what users
actually see on stderr. The notice's wording is one of the things
changing on the engine side.
- **Coming, and deliberately not written here:** when this CLI ports
onto the shared Prisma CLI engine, the config directory becomes `prisma`
rather than `prisma-next`, the opt-out variable becomes
`PRISMA_DISABLE_TELEMETRY`, and the first-run notice drops its hand-edit
clause. None of that has shipped in the `prisma-next` CLI this page
describes, so documenting it now would make the page wrong for the
binary people are running. It lands with the port.
- **Anchors.** One new intra-page link, pointing at
`#how-to-opt-out-or-back-in`. It first pointed at the commands section's
own slug, and `lint:legacy-name` was right to reject that: the rule
allows a bare `prisma-next` only when the character after it is neither
a word character nor a hyphen, and `#the-prisma-next-telemetry-command`
is followed by `-telemetry-command`. That is also why the two command
spellings in the same sentence pass. Every existing heading and anchor
is unchanged, so `prisma#2-the-stored-preference` and
`prisma#1-environment-variables-runtime-only` still resolve from their inbound
links.
- **Second file.** `skills/prisma-8/references/quickstart.md` is one
sentence, included so the ruling isn't applied in only half the places a
reader meets it. Easy to drop if you'd rather keep this to
`docs/Telemetry.md`.

## Testing performed

- Docs-only change; no suites apply.
- `pnpm lint:legacy-name` (`node scripts/lint-legacy-name.mjs`) —
passes, on the exact tree pushed.
- `pnpm lint:docs` (`scripts/validate-package-readmes.mjs`) — passes;
its warnings are pre-existing and concern mongo package READMEs
untouched here.
- Verified every intra-page anchor in `docs/Telemetry.md` resolves to a
heading that exists.
- Diffed the frozen surfaces (config paths,
`PRISMA_NEXT_DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `%APPDATA%`,
`$XDG_CONFIG_HOME`, `prisma-next.config.ts`, the notice block) against
`main`: byte-identical.
- The repo has no markdown linter or link checker in CI to run against
`docs/`.

## Skill update

`skills/prisma-8/references/quickstart.md` — the telemetry callout's
opt-out routes now match the page. No CLI surface, flag, config field,
or error code changed, so no other skill content is affected.

## Checklist

- [x] All commits are signed off (`git commit -s`) per the DCO.
- [x] I read CONTRIBUTING.md and the change is scoped to one logical
concern.
- [x] Tests are updated — n/a, doc-only with no behavioural delta.
- [ ] The PR title is in `TML-NNNN: <sentence-case title>` form — no
Linear ticket; follows the `docs(<scope>):` form used by recent docs PRs
(prisma#29958, prisma#29957, prisma#29925).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Clarified that telemetry preferences are managed through CLI commands
rather than manual configuration edits.
* Documented telemetry status behavior, preservation of unrelated
settings, and default-on behavior.
* Added guidance for resetting telemetry and installation identity by
deleting the configuration.
* Updated opt-out instructions to use the telemetry disable command or
environment-variable settings for provisioning.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants