Skip to content

docs(adr): ADR 239 amendment — findings as diagnostics in completed envelopes, typed nextActions (S4) - #29957

Merged
wmadden-electric merged 6 commits into
mainfrom
s4-adr-239-amendment
Aug 11, 2026
Merged

wmadden-electric merged 6 commits into
mainfrom
s4-adr-239-amendment

Conversation

@wmadden-electric

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

Copy link
Copy Markdown
Contributor

Number collision resolved: the authoring-helpers ADR is now ADR 246

Two files were numbered ADR 239. Per operator ruling, this PR renumbers Option arguments and select templates for authoring helpers to ADR 246 (the next free number); the errors ADR keeps 239 because it is referenced by number from source comments, the CLI Style Guide, and ADR 245. The index rows and the two code comments that cited the authoring ADR by number follow the rename.

What this looks like in practice

Run migration check against a migrations tree with a dangling ref.

Before

$ prisma-next migration check
✖ 1 integrity failure(s)                       MIGRATION.CHECK_DANGLING_REF
  Why: Ref "prod" points at a hash no migration produces.
  Fix: Update the ref with `prisma-next ref set prod <valid-hash>` or delete it.
$ echo $?
2

Exit 2 means "your invocation was wrong". It was not — the command did exactly what it was asked to do and found something. A shell pipeline cannot tell this apart from a typo'd flag, and an agent has to parse an English sentence to discover there is a command it could run.

After

$ prisma-next migration check
✖ 1 integrity failure(s)                       MIGRATION.CHECK_DANGLING_REF
  Why: Ref "prod" points at a hash no migration produces.
  → Repoint the ref    prisma-next ref set prod <valid-hash>
  → Or delete it       prisma-next ref delete prod
$ echo $?
4
{
  "ok": true,                    // the command completed
  "commandId": "migration.check",
  "exitCode": 4,                 // INTEGRITY_FAILED, documented by this command
  "result": { "failures": 1 },
  "diagnostics": [
    {
      "code": "MIGRATION.CHECK_DANGLING_REF",
      "severity": "error",
      "summary": "Ref \"prod\" points at a hash no migration produces",
      "where": { "path": "migrations/refs/prod" },
      "nextActions": [
        { "kind": "run-command", "label": "Repoint the ref", "command": "prisma-next ref set prod <valid-hash>" },
        { "kind": "run-command", "label": "Or delete it", "command": "prisma-next ref delete prod" }
      ]
    }
  ],
  "nextActions": []
}

ok: true because the command completed. Exit 4 because it found something, and 4 is what this command documents. The finding is a diagnostic, not a thrown error. Remediation is two executable commands, not a sentence.

The shipped migration check already returns exit 4 (migration-check/exit-codes.ts) — the ADR simply did not describe the model that behavior belongs to, and classified findings as structured failures exiting 2.

The decision

Two amendments to ADR 239, folded into the body with an amendment note at the top (following the ADR 211 / ADR 234 precedent rather than a trailing section).

1. Completed-with-findings. A command settles one of two ways. It completes — it ran to its end and has a result, good news or bad — or it errors, meaning it could not do its job. Findings belong to the first path: they are Diagnostic values in a completed envelope with a documented per-command exit code in the 4–99 band. Findings are data. They are never thrown.

The test is one question: was finding these problems the job? migration check reporting integrity violations did its job. It exits 2 only when it cannot run the check at all — an unresolvable migration reference, an unknown --space.

One runtime check keeps this honest: a severity: 'error' diagnostic requires a non-zero exit code, so a pipeline never reads a clean 0 over a reported error.

The exit-code table now reads: 0 completed cleanly / 1 bug only / 2 errored (expected, structured) / 3 user abort / 4–99 documented per command / 130, 143 signals.

2. fix → typed nextActions. The freeform fix?: string is replaced by nextActions: readonly NextAction[], always present, empty when there is nothing to suggest. NextAction is { kind: 'run-command' | 'user-choice' | 'edit-file' | 'done', label, command?, commands?, reason? }. An errored envelope copies the primary error's nextActions so consumers read envelope.nextActions on both settlement paths.

This keeps Diagnostic field-for-field identical to the settled engine envelope minus ok. That identity is the point — a consumer that can read a finding can read an error.

The code sweep trails. The ADR freezes the target shape; the several hundred fix: call sites convert cluster by cluster under a ratchet, exactly as the bare-throw ban in the same ADR converts. Converting first and settling the shape afterwards would let Diagnostic and the error envelope drift while half the tree used each spelling. No code is renamed in this PR.

Severity: the three-value scale stays, on evidence

The amendment was contingent on whether any shipped error uses severity: 'info'. I grepped production code (excluding tests). It does:

  • packages/1-framework/3-tooling/cli/src/commands/init/errors.ts:119 — errorInitUserAborted() constructs a CliStructuredError for CLI.INIT_USER_ABORTED with severity: 'info'. It is the right value: nothing went wrong, the user changed their mind, and rendering it as a red error would misreport it.
  • packages/1-framework/3-tooling/cli/src/utils/migration-types.ts:9 — StatusDiagnostic.severity is typed 'warn' | 'info'.
  • packages/1-framework/3-tooling/cli/src/commands/json/schemas.ts:80,87 — the CONTRACT.UNREADABLE and MIGRATION.MARKER_NOT_IN_HISTORY diagnostics publish "warn" | "info" in their JSON schema, so 'info' is already part of the machine-readable surface consumers match on.

So both scales stay at 'error' | 'warn' | 'info', and they stay identical to each other. Trimming would be a breaking change to a published surface with a live producer behind it. The evidence is recorded in the ADR under The severity scale, and the trim is written up as a rejected alternative.

Files

  • docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md — amendment note, the two-settlement-paths decision, Diagnostic / NextAction in the grounding example, a rewritten exit-codes section with the full table, new Remediation is typed, not prose and The severity scale sections, and three new rejected alternatives.
  • docs/CLI Style Guide.md — § Errors (JSON schema, human layout, exit-code sentence, missing-flags rule, destructive-op rule) and § Exit Codes (a new Completed with findings subsection; 0 and 2 reworded). The 4–99 band and its migration check example were already there and already agreed; this makes the semantics explicit.
  • docs/architecture docs/ADR-INDEX.md — adds the errors ADR; the authoring-helpers row is renumbered to 246.

Alternatives considered

Findings as structured failures exiting 2 (the status quo ante). Makes a command throw to report what it was asked to find, and puts "eleven violations" in the same exit-code bucket as "unknown flag".

A separate Finding shape unrelated to the error envelope. Two renderers, two JSON schemas, two things to learn — for a distinction that is about carrier, not content.

Keep fix alongside nextActions. Guarantees they disagree; every factory would hand-sync a sentence against a list.

Trim severity to 'error' | 'warn'. Rejected on the evidence above.

Verification

  • node scripts/list-error-codes.mjs --verify docs/reference/error-reference.md → error-reference lists all 275 known codes. (No codes change, but the change touches the code-space docs.)
  • node scripts/validate-package-readmes.mjs → passes; its warnings are pre-existing and unrelated.
  • No test suites: docs-only. pnpm lint is biome over source and has nothing to say about these three files.

Left undone (deliberate)

  • No fix → nextActions code sweep. Out of scope; the ratchet is the plan.
  • ADR 245 still says "why/fix" in its body and in its index description. It governs how ADR 239's envelopes are built, so it will want the same rename — separate PR, since editing it means re-reading its own argument.
  • docs/Error Handling.md uses "why/fix/docs" as loose prose about what to emphasize, not as a field list. Left alone; flag it if you want it tightened.
  • The 4–99 band in the Style Guide already documented migration check's 4 = INTEGRITY_FAILED, so no exit-code numbers changed anywhere — only what they mean.

Slice S4 of prisma-cli-v8.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified CLI error-handling conventions, completion status, and exit-code rules.
    • Documented how completed commands report diagnostic findings without being treated as failures.
    • Replaced freeform remediation guidance with structured, typed next actions.
    • Added guidance for diagnostic data, severity levels, diagnostic codes, and destructive-operation remediation.
    • Updated architecture decision records and references for structured error envelopes and corrected numbering.

…ions

A command settles one of two ways: it completes (with a result that may be
good news or bad) or it errors (it could not do its job). ADR 239 only had
the second path, so a command asked to look for problems had to throw in
order to report what it found, landing on exit 2 alongside "you passed an
unknown flag".

The amendment gives findings their own path. `migration check` finding
integrity violations, `db verify` finding drift: these complete, exit a
documented per-command code in the 4-99 band, and carry the individual
problems as Diagnostic values in the completed envelope. Diagnostics are
pure data, never thrown, no stack. A severity-error diagnostic must come
with a non-zero exit code so a shell pipeline never reads a clean 0 over a
reported error. The shipped `migration check` already behaves this way
(exit 4 = INTEGRITY_FAILED); the ADR now describes it.

The second change replaces the freeform `fix?: string` prose field with a
typed `nextActions: readonly NextAction[]`, always present and empty when
there is nothing to suggest. A fix sentence fuses two actions, a command,
and an argument placeholder into English only a human can take apart; a
NextAction states the kind, label, and executable command directly. This
keeps Diagnostic field-for-field identical to the settled engine envelope.
The target shape freezes now and the several hundred call sites convert
under a ratchet, the same way the bare-throw ban converts.

Severity stays at three values on evidence: errorInitUserAborted() ships
with severity `info`, and the migration-status diagnostics publish
"warn" | "info" in their JSON schema.

CLI Style Guide gains a "Completed with findings" section and its error
JSON schema, human layout, and exit-code table are brought into line.
ADR-INDEX gains the errors ADR; both entries numbered 239 now say so.

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:02
@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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The documentation defines typed nextActions, adds Diagnostic findings for completed commands, separates findings from failures, and revises CLI exit-code rules. The ADR index resolves the ADR 239 numbering collision and updates related references.

Changes

Error envelope and diagnostic conventions

Layer / File(s) Summary
Error and diagnostic contracts
docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md
StructuredError now requires typed nextActions. The ADR adds NextAction and Diagnostic shapes and documents structural validation.
Completed findings and exit codes
docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md
Completed commands return non-throwing diagnostics with documented 4–99 exit codes. Migration-check examples, mappings, and code reconciliation use the updated outcome model.
CLI guidance and ADR references
docs/CLI Style Guide.md, docs/architecture docs/ADR-INDEX.md, docs/architecture docs/adrs/ADR 246 - Option arguments and select templates for authoring helpers.md, packages/1-framework/1-core/framework-components/src/shared/*
The CLI guide replaces freeform remediation text with typed actions. The index and authoring-helper references use ADR 246 for option arguments and select templates, and ADR 239 for structural error envelopes.

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

Possibly related PRs

  • prisma/prisma#29919: Both update ADR 239 structured error-envelope conventions.
  • prisma/prisma#29958: Both replace freeform fix remediation with typed nextActions in architecture documentation.

Suggested labels: lgtm

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 239 amendment and its main changes: completed-envelope findings as diagnostics and typed nextActions.
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-239-amendment

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: 8

🤖 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/ADR-INDEX.md:
- Line 100: Amend ADR 245 and its corresponding ADR index entry to present it as
a companion to ADR 239 rather than a separate compatibility layer. Replace the
why/fix contract with why plus typed nextActions, and clarify that
CliStructuredError subclasses are construction details while boundary
recognition remains structural.

In `@docs/architecture` docs/adrs/ADR 239 - Errors are structural envelopes with
dotted namespace codes.md:
- Around line 19-22: Align the Diagnostic model and its documented examples with
the StructuredError envelope described in the ADR. Update the Diagnostic
definition to use the same fields as StructuredError— including message and
cause while removing the divergent summary field—or explicitly document the
field mapping and rationale for excluding provenance. Apply the same correction
to the related sections referenced in the comment.
- Around line 104-107: Update the nextActions commands in the ADR so every
command marked executable can run as written: replace the <valid-hash>
placeholder in the ref-setting action with a command or preceding action that
obtains or computes the valid hash, or explicitly document the required
substitution contract and remove executable treatment until then.
- Line 170: Update isStructuredError to recognize structured error envelopes by
validating their serialized shape and required fields, without using e
instanceof Error, so JSON-parsed envelopes remain recognized across network
boundaries; keep the predicate’s type-narrowing behavior intact.
- Around line 40-46: Update NextAction into a discriminated union so run-command
requires command, user-choice requires commands, edit-file carries its required
payload, and done has no command payload; keep shared fields such as label and
reason on each variant as appropriate. Update the consumer guidance around
nextActions[0] to branch on kind before accessing variant-specific fields,
including the related sections at the other referenced locations.
- Around line 93-109: Update the completed-envelope section around the
migration-check example to explicitly define the required discriminator, the
canonical findings collection name, and that exitCode is part of the serialized
result. Reconcile the contract with migration-check.ts and
cross-consumer-integrity.test.ts by documenting how consumers using ok,
failures, summary, or an external exitCode must migrate to the chosen envelope
shape.
- Line 32: Align the ADR contract with the actual migration state: either
migrate StructuredError, CliStructuredError, CliErrorEnvelope,
errorInitMissingFlags, their producers, serializer, and tests from fix to
nextActions, or explicitly label nextActions as target state and document the
fix transition. Keep the ADR and docs/CLI Style Guide JSON schema consistent.

In `@docs/CLI` Style Guide.md:
- Line 96: Update errorInitMissingFlags so meta.missingFlags stores each missing
flag with its long-form “--” prefix, while preserving the existing prefixed
values used for flagList and fixList.
🪄 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: a6a39bfa-0f41-49a1-a69a-b6868f3475c7

📥 Commits

Reviewing files that changed from the base of the PR and between 7e80e77 and 257d230.

📒 Files selected for processing (3)
  • docs/CLI Style Guide.md
  • docs/architecture docs/ADR-INDEX.md
  • docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md

Comment thread docs/architecture docs/ADR-INDEX.md Resolved
Comment thread docs/CLI Style Guide.md Resolved
Restructure to grounding-example-first, remove transient refactor
framing (pre-amendment states, site counts, internal system numbers),
fold the amendment note into a one-line status, and state adoption
facts in the present tense.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@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 239 - Errors are structural envelopes with
dotted namespace codes.md:
- Line 306: Update the crosswalk table around the duplicate PN-CLI-4012 mappings
to identify the legacy producer or distinguishing context for each row, and
document that migration requires contextual disambiguation because the retired
code alone cannot select a replacement. Keep the mappings to
CLI.CONFIG_ARG_MISSING_PATH and CLI.INVALID_VERIFY_MODE explicit.
🪄 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: 2f816e7f-1002-41ed-aae3-126f31a7034d

📥 Commits

Reviewing files that changed from the base of the PR and between 257d230 and 45f23e1.

📒 Files selected for processing (1)
  • docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md

Make the example predicate fully structural to match the shipped one,
state the exact Diagnostic-to-envelope field mapping, document the flat
NextAction shape and placeholder convention, disambiguate the duplicate
PN-CLI-4012 crosswalk rows, and label the fix-to-nextActions transition
in the style guide.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md (1)

318-318: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Mark the second schema mapping as a merge.

The crosswalk defines ↦ merges at Line 237. PN-RUN-3004 at Line 286 and PN-SCHEMA-0001 at Line 318 both map to CONTRACT.SCHEMA_VERIFICATION_FAILED. Add the merge annotation to the PN-SCHEMA-0001 row or explain why this many-to-one mapping is excluded.

Proposed clarification
-| PN-SCHEMA-0001 | SQL schema-verify failure (the `SCHEMA` domain's only producer; the domain is dropped with it) | `CONTRACT.SCHEMA_VERIFICATION_FAILED` |
+| PN-SCHEMA-0001 | SQL schema-verify failure (the `SCHEMA` domain's only producer; the domain is dropped with it) | `CONTRACT.SCHEMA_VERIFICATION_FAILED` ↦ merges with `PN-RUN-3004` |
🤖 Prompt for 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.

In `@docs/architecture` docs/adrs/ADR 239 - Errors are structural envelopes with
dotted namespace codes.md at line 318, Update the PN-SCHEMA-0001 row to annotate
its mapping to CONTRACT.SCHEMA_VERIFICATION_FAILED as a merge, consistent with
the crosswalk notation and the PN-RUN-3004 mapping. If this mapping is
intentionally excluded, document the explicit rationale in the row instead.
🤖 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 239 - Errors are structural envelopes with
dotted namespace codes.md:
- Line 359: Clarify the ADR’s handling of the run-command action’s commands
field: define whether commands is a sequence or an alternative list, then update
the remediation consumer rule to execute it accordingly alongside command;
otherwise restrict commands to user-choice actions and state that constraint
explicitly.
- Line 118: Update the ADR’s StructuredError/Diagnostic comparison to explicitly
address their severity mismatch: either define and document the default applied
when StructuredError.severity is omitted, or make both declarations use the same
optionality. Revise the nearby “two deliberate differences” and identical
field-for-field mapping statements so they accurately include the chosen
severity behavior.
- Around line 48-52: Update isStructuredError to require a valid nextActions
collection and validate each NextAction before returning true, preventing
consumers from receiving incomplete envelopes. Align the StructuredError
foundation interface and structuredError factory so nextActions is required and
consistently populated with the expected type.

---

Outside diff comments:
In `@docs/architecture` docs/adrs/ADR 239 - Errors are structural envelopes with
dotted namespace codes.md:
- Line 318: Update the PN-SCHEMA-0001 row to annotate its mapping to
CONTRACT.SCHEMA_VERIFICATION_FAILED as a merge, consistent with the crosswalk
notation and the PN-RUN-3004 mapping. If this mapping is intentionally excluded,
document the explicit rationale in the row instead.
🪄 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: 9c66c85b-b7ae-48c4-8b95-ca676ae697f1

📥 Commits

Reviewing files that changed from the base of the PR and between 45f23e1 and f5bf45a.

📒 Files selected for processing (2)
  • docs/CLI Style Guide.md
  • docs/architecture docs/adrs/ADR 239 - Errors are structural envelopes with dotted namespace codes.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/CLI Style Guide.md

Two ADRs carried the number 239. The errors ADR keeps it (referenced
by number from code comments, the style guide, and ADR 245); the
option-arguments ADR becomes ADR 246, the next free number. Index rows
and the two code comments that cited it follow.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 169.96 KB (0%)
postgres / emit 147.68 KB (0%)
mongo / no-emit 100.42 KB (0%)
mongo / emit 90.25 KB (0%)
cf-worker / no-emit 194.19 KB (0%)
cf-worker / emit 169.5 KB (0%)

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

prisma-next

npm i https://pkg.pr.new/prisma-next@29957

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@29957

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@29957

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@29957

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@29957

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@29957

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@29957

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@29957

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@29957

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@29957

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@29957

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@29957

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@29957

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@29957

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@29957

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@29957

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@29957

commit: e490983

wmadden-electric and others added 2 commits August 11, 2026 10:12
Add the open-url action kind and url field to match the shipped engine
protocol, define command vs commands semantics, document the envelope
contract both settlement paths share, state the third Diagnostic
difference (required severity), and scope the predicate to
identification rather than schema validation.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	docs/architecture docs/ADR-INDEX.md
@wmadden-electric
wmadden-electric added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 7b83abe Aug 11, 2026
17 checks passed
@wmadden-electric
wmadden-electric deleted the s4-adr-239-amendment branch August 11, 2026 09:38
EmaToplek pushed a commit to EmaToplek/prisma that referenced this pull request Aug 11, 2026
)

Trails prisma#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
prisma#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**

```ts
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**

```ts
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 prisma#29957 touch `ADR-INDEX.md`, and their edits land on
adjacent lines — prisma#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](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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