Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

feat(cli): consolidate db verify and remove db schema-verify - #243

Merged
jkomyno merged 10 commits into
mainfrom
feat/cli-verify
Mar 20, 2026
Merged

jkomyno merged 10 commits into
mainfrom
feat/cli-verify

Conversation

@jkomyno

@jkomyno jkomyno commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

closes TML-2085

Walkthrough — db verify consolidation

Intent

Consolidate all database verification onto prisma-next db verify so engineers learn one command. The parallel db schema-verify command is removed; its marker-independent structural verification becomes db verify --schema-only, and its strict mode becomes db verify --strict.

Key snippet

Mode resolution and flag validation

function resolveDbVerifyMode(options: DbVerifyOptions): Result<DbVerifyMode, CliStructuredError> {
  if (options.shallow && options.schemaOnly) {
    return notOk(errorInvalidVerifyMode({
      why: '`--shallow` and `--schema-only` cannot be used together',
      fix: 'Choose one mode: omit both for marker + schema verification, ...',
    }));
  }
  if (options.shallow && options.strict) {
    return notOk(errorInvalidVerifyMode({
      why: '`--strict` requires structural schema verification, but `--shallow` skips it',
      fix: 'Remove `--strict`, or use `db verify` / `db verify --schema-only` ...',
    }));
  }
  if (options.schemaOnly) return ok('schema-only');
  if (options.shallow) return ok('shallow');
  return ok('full');
}

Change map

The story

  1. Introduce a mode discriminant: The DbVerifyMode type ('full' | 'shallow' | 'schema-only') and resolveDbVerifyMode() make the mode explicit and validate flag combinations before any I/O. Invalid combinations produce PN-CLI-4012 with exit code 2.

  2. Add --schema-only execution path: A new executeDbSchemaOnlyVerifyCommand() function bypasses marker verification and calls only client.schemaVerify(). It reuses the existing formatSchemaVerifyOutput / formatSchemaVerifyJson formatters, so TTY and JSON output stay identical to what db schema-verify produced.

  3. Thread --strict through full mode: executeDbVerifyCommand now passes options.strict to client.schemaVerify() instead of hard-coding false. The formatter shows (strict) or (tolerant) in the verification mode label.

  4. Delete db schema-verify: The command file, import in cli.ts, package export, build entry, test config entry, help docs URL, and suggest-command candidate are all removed.

  5. Migrate all call sites: Journey tests replace runDbSchemaVerify(ctx) with runDbVerify(ctx, ['--schema-only']). Error messages and docs replace db schema-verify with db verify --schema-only. Recordings config renames slugs and commands.

  6. Improve retry hints: errorDatabaseConnectionRequired gains a retryCommand option so that the fix text reflects the exact flags the user provided (e.g., Run prisma-next db verify --schema-only --strict --db ``).

  7. Extract shared setup boilerplate: The ~120 lines of duplicated config-loading / contract-reading / connection-resolution / error-handling between executeDbVerifyCommand and executeDbSchemaOnlyVerifyCommand are factored into focused helpers: resolveVerifyPaths, resolveVerifySetup, createVerifyClient, renderVerifyHeader, and wrapVerifyError.

Behavior changes & evidence

  • db verify default mode now reports strict/tolerant in output: Before, the mode label was marker + schema. After, it is full (marker + schema, tolerant) or full (marker + schema, strict).

    • Why: --strict is now available on db verify, so the output must disambiguate.
    • Tests: Help snapshot, e2e strict-mode test
  • --shallow warning text directs to db verify --schema-only instead of db schema-verify: Before → "Run prisma-next db schema-verify". After → "Run prisma-next db verify --schema-only".

    • Why: db schema-verify no longer exists.
    • Tests: e2e shallow-mode test
  • Adds db verify --schema-only as a new mode: Runs structural schema verification without marker checks. Reuses existing schemaVerify() call and formatters.

    • Why: Replaces db schema-verify for brownfield adoption, corrupt-marker diagnosis, and missing-marker triage.
    • Tests: e2e "runs schema-only verification with matching schema", "runs schema-only verification when marker is missing", "passes schema-only strict verification when schema matches exactly"; journeys F.03, G.03, K.02, L.02, P2.02
  • Adds db verify --strict for full mode: Before, db verify always called schemaVerify({ strict: false }). After, it passes options.strict, so db verify --strict catches extra schema elements.

    • Why: Replaces db schema-verify --strict for strict structural checks.
    • Tests: e2e "fails in strict mode when extra columns exist"; journey A.07, N.03
  • --shallow --schema-only and --shallow --strict rejected with exit code 2: Before, these combinations were not possible (separate commands). After, they are caught eagerly.

    • Why: Flag validation prevents nonsensical combinations.
    • Tests: e2e "rejects mutually exclusive verify modes", "rejects strict mode when schema verification is skipped"
  • db schema-verify is removed (no behavior change — removal): The command, its export, build entry, test file, fixture, and all references are deleted.

    • Why: Surface consolidation; one verb for verification.
    • Tests: Help snapshot confirms absence; suggest-command test excludes schema-verify
  • Error fix text updated across control-plane: errorMigrationPlanningFailed now suggests db verify --schema-only instead of db schema-verify.

    • Tests: errors.test.ts retryCommand test

Compatibility / migration / risk

  • Breaking CLI change: prisma-next db schema-verify no longer exists. Any external script using it will fail. This is intentional per the spec (NFR-3: no backward-compatibility scaffolding). The repo has no external consumers.
  • No semantic change to verification logic: client.verify() and client.schemaVerify() are unchanged. db sign is unaffected.
  • Recordings: All recording slugs and commands are migrated. Old SVG/ASCII files are deleted and new ones added.

Follow-ups / open questions

  • pnpm lint:deps: Should be run before merge to confirm no dead references remain in the dependency graph.

Non-goals / intentionally out of scope

  • No changes to client.schemaVerify() or family-level schema verification APIs
  • No changes to db sign, db update, or db introspect behavior (only guidance text updated)
  • No JSON envelope unification across verify modes (deferred per spec)
  • No deprecation alias or migration path for db schema-verify

Summary by CodeRabbit

  • New Features

    • Added --marker-only and --schema-only verification modes, plus --strict to fail on extra DB elements.
  • Changes

    • Default verification now checks marker presence/hash+target equality then schema verification.
    • --marker-only is incompatible with --schema-only/--strict (exits 2, PN-CLI-4012).
    • Replaced db schema-verify with db verify --schema-only; removed db-schema-verify export.
    • Terminology changed: “database signature” → “database marker”.
  • Documentation

    • CLI docs, guides, and recordings updated to reflect new flags and wording.

jkomyno added 2 commits March 19, 2026 15:27
Factor ~120 duplicated lines between executeDbVerifyCommand and
executeDbSchemaOnlyVerifyCommand into focused helpers:
renderVerifyHeader, resolveVerifyPaths, resolveVerifySetup,
createVerifyClient, and wrapVerifyError.

Also fix node:path -> pathe in e2e tests and add happy-path test
for --schema-only --strict mode.

Made-with: Cursor
@coderabbitai

coderabbitai Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: ea3a7de0-ff63-4f7b-8d33-9d64abc3118a

📥 Commits

Reviewing files that changed from the base of the PR and between c82cf03 and 49ec039.

📒 Files selected for processing (1)
  • packages/1-framework/3-tooling/cli/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/1-framework/3-tooling/cli/README.md

📝 Walkthrough

Walkthrough

Updated CLI verification surface: replaced db schema-verify with an expanded db verify flow plus --marker-only, --schema-only, and --strict flags; adjusted docs, README, recordings, exports, and error messages; extended an error API to format retry commands; added/updated CLI ASCII recordings and journey metadata.

Changes

Cohort / File(s) Summary
Docs & ADR
docs/CLI Style Guide.md, docs/architecture/.../ADR 154 - Component-owned database dependencies.md
Rewrote canonical docs to describe db verify default flow and new flags; ADR updated to list db verify / --schema-only as live-path commands.
Error handling & tests
packages/1-framework/1-core/migration/control-plane/src/errors.ts, packages/1-framework/1-core/migration/control-plane/test/errors.test.ts
Extended errorDatabaseConnectionRequired options with retryCommand; prefer retryCommand when building run hints; updated migration-planning error text to reference db verify --schema-only; tests adjusted/added.
CLI package & README
packages/1-framework/3-tooling/cli/package.json, packages/1-framework/3-tooling/cli/README.md
Removed ./commands/db-schema-verify export; README updated to document --marker-only, --schema-only, --strict, mutual-exclusion rules, and new verification flows.
Recording config
packages/1-framework/3-tooling/cli/recordings/config.ts
Journey steps renamed/rewired: replaced schema-verify steps with db-verify-schema-only variants, updated descriptions, and reworked drift scenario to drift-invalid-marker.
Recordings — greenfield & strict
packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/* (many files), packages/.../greenfield-setup/07-db-verify-strict.ascii
Replaced schema-verify recordings with db verify --schema-only variants; added db verify --strict recording; adjusted verify labels (marker vs signature), mode labels (tolerant/strict), JSON payload changes, and inserted locale warning lines.
Recordings — direct-update & drift suites
packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/*.ascii, .../drift-missing-marker/*.ascii, .../drift-stale-marker/*.ascii, .../drift-invalid-marker/*.ascii
Updated many asciicast fixtures to use db verify flows (--schema-only / --marker-only) and new mode labels; added marker-only pass case; replaced or removed schema-verify artifacts; numerous locale-warning and minor spacing changes.
Introspect recording port updates
packages/1-framework/3-tooling/cli/recordings/ascii/*/03-db-introspect-*.ascii
Standardized displayed DB port from 5433 → 5432 in multiple recordings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • saevarb
  • wmadden

Poem

🐰 Hop, hop — the CLI blooms anew tonight,
Marker and schema now checked in one light,
--marker-only, --schema-only, --strict parade,
Old exports gone, new recordings made.
Warnings scurry in the log — locale in sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cli): consolidate db verify and remove db schema-verify' clearly and directly summarizes the main change: consolidating database verification into a single command and removing an old command.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-verify
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Mar 19, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/runtime-executor

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/runtime-executor@243

@prisma-next/sql-runtime

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-runtime@243

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-paradedb@243

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-pgvector@243

@prisma-next/postgres

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

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-orm-client@243

@prisma-next/contract-authoring

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract-authoring@243

@prisma-next/contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract-ts@243

@prisma-next/ids

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

@prisma-next/psl-parser

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/psl-parser@243

@prisma-next/cli

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

@prisma-next/emitter

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

@prisma-next/eslint-plugin

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/eslint-plugin@243

@prisma-next/migration-tools

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/migration-tools@243

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/vite-plugin-contract-emit@243

@prisma-next/sql-contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract@243

@prisma-next/sql-errors

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-errors@243

@prisma-next/sql-operations

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-operations@243

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-schema-ir@243

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-psl@243

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-ts@243

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-emitter@243

@prisma-next/family-sql

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/family-sql@243

@prisma-next/sql-kysely-lane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-kysely-lane@243

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-lane-query-builder@243

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-relational-core@243

@prisma-next/sql-lane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-lane@243

@prisma-next/target-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-postgres@243

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-postgres@243

@prisma-next/driver-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-postgres@243

@prisma-next/core-control-plane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/core-control-plane@243

@prisma-next/core-execution-plane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/core-execution-plane@243

@prisma-next/config

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

@prisma-next/contract

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

@prisma-next/operations

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

@prisma-next/plan

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

@prisma-next/utils

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

commit: 4ab2157

Comment on lines +1 to +3
# Summary

Consolidate database verification onto `prisma-next db verify` and remove the parallel `prisma-next db schema-verify` command. `db verify` remains correctness-first by default (marker check + tolerant schema verification), keeps `--shallow` as an explicit marker-only escape hatch, and absorbs schema-only / strict structural checks under flags so there is one verb for all verification workflows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here's the plan.

TODO: delete this after review.

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

🧹 Nitpick comments (3)
packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii (1)

1-1: Remove environment-specific locale warnings from committed recording output.

These lines are shell-environment noise rather than CLI output, and they make the JSON recording harder to read. Please set locale explicitly in the recording harness and regenerate this fixture.

Also applies to: 33-33, 65-65, 97-97, 129-129, 161-161, 193-193, 196-196

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii`
at line 1, The committed ASCII recording contains environment-specific locale
warning lines ("bash: warning: setlocale: LC_ALL: cannot change locale
(C.UTF-8): No such file or directory"); update the recording harness to export a
stable locale (for example set LC_ALL=C.UTF-8 and LANG=C.UTF-8 or unset
LC_ALL/LANG to a known value) before spawning shells used by the harness, then
regenerate the fixture file
packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii
(and the other affected recordings at the listed positions) so the warning lines
are removed from the committed output. Ensure the change is made in the
test/recording bootstrap code (the recording harness initialization) so all
subsequent recordings no longer include the locale warnings.
packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/02-db-verify-shallow-pass.ascii (1)

1-1: Stabilize recordings by filtering locale warnings.

These setlocale lines are host-environment noise and create avoidable snapshot churn. Prefer normalizing locale in the recorder/harness so fixtures only capture CLI output.

Also applies to: 33-33, 65-65, 97-97, 129-129, 161-161, 193-193

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/02-db-verify-shallow-pass.ascii`
at line 1, Tests are brittle because the recorder captures host locale warnings
("bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file
or directory"); update the recording harness (the CLI recorder/fixture
normalizer) to strip or normalize that exact warning string (and its variants)
from captured stdout/stderr (e.g., add a filter in the recorder's
normalizeOutput / sanitizeRecording path) so the ascii fixtures
(drift-phantom/02-db-verify-shallow-pass.ascii and the other listed snapshots)
no longer include locale noise.
docs/CLI Style Guide.md (1)

138-141: Document incompatible db verify flag combinations.

Consider adding that --shallow cannot be combined with --schema-only or --strict (usage error / exit code 2), while --schema-only --strict is valid. That keeps this guide aligned with actual CLI behavior.

📝 Proposed doc tweak
 -  - `--shallow` performs marker-only verification.
 -  - `--schema-only` skips marker checks and verifies only that the live schema satisfies the contract.
 -  - `--strict` makes schema verification fail on unmanaged extra schema elements.
+  - `--shallow` performs marker-only verification.
+  - `--schema-only` skips marker checks and verifies only that the live schema satisfies the contract.
+  - `--strict` makes schema verification fail on unmanaged extra schema elements.
+  - `--shallow` is incompatible with `--schema-only` and `--strict` (usage error, exit code `2`).
+  - `--schema-only --strict` is supported.

As per coding guidelines "Keep docs current (READMEs, rules, links) - see .cursor/rules/doc-maintenance.mdc."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/CLI` Style Guide.md around lines 138 - 141, Update the "db verify" flag
docs to state that the CLI disallows combining --shallow with --schema-only or
--strict (these combinations should be described as a usage error returning exit
code 2), while explicitly noting that --schema-only can be used together with
--strict; mention this directly alongside the existing bullets for Default,
--shallow, --schema-only, and --strict so users see compatible vs incompatible
flag combinations for the db verify command.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/1-framework/3-tooling/cli/README.md`:
- Line 110: Update the README entry for the prisma-next db verify synopsis to
explicitly document rejected flag combinations: state that using --shallow
together with --schema-only or with --strict is invalid and results in a
usage/config error (PN-CLI-4012) with exit code 2; update the Options section
(and the nearby duplicate descriptions at the later reference) to call out these
exact combinations and their error code/exit behavior so users don’t assume
they’re supported.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/03-db-update-apply.ascii`:
- Line 1: The VHS recordings include locale-related warnings; update the
runVhs() invocation so the spawned vhs command is run with LANG=C or LC_ALL=C in
its environment to suppress setlocale warnings. Locate the runVhs() function and
modify the environment passed to the vhs execution (process spawn/options or env
merging) to include LANG=C (or LC_ALL=C) while preserving existing env vars,
then regenerate the affected recordings so snapshots no longer contain the
locale warning noise.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/04-db-update-noop.ascii`:
- Around line 34-35: Several step markers in the ASCII recording use the
malformed pattern "> No-op # ..." which gets treated as a shell command; update
the marker formatting to the correct form "> # No-op — ..." wherever the string
"> No-op #" appears (e.g., the occurrences around the comment lines currently
producing "bash: No-op: command not found") so the marker is a comment token
rather than a command, then regenerate the tape/fixture to ensure the ASCII
recording and SVG render correctly.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/05-db-verify.ascii`:
- Line 1: The golden recording contains host-specific locale noise: the line
starting with "bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8):
No such file or directory" should be removed; regenerate the fixture under a
stable locale (export LC_ALL or LANG to a known value before running the
commands) or update the recorder/post-processor to filter out stderr lines
matching that exact warning regex so the stored .ascii artifacts no longer
include the locale warning across all affected recordings.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/03-db-introspect-diverged.ascii`:
- Line 200: Recording shows Postgres at 127.0.0.1:5432 which conflicts with the
harness default port 5433; update either the recording or the harness to match.
Re-record the ascii fixture using the harness default (ensure
DEFAULT_DATABASE_URL in record.ts points to port 5433 and docker-compose.yaml
exposes 5433:5432) or, if 5432 is the new intended standard, update
DEFAULT_DATABASE_URL in record.ts and docker-compose.yaml to use 5432 and
regenerate the recordings so the recorded database URL and the harness default
are consistent. Ensure the change is applied to DEFAULT_DATABASE_URL (record.ts)
and the docker-compose service port mapping to prevent future snapshot
mismatches.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/04-db-update-recovery.ascii`:
- Around line 34-35: The transcript includes prompt lines like "> Recovery #
re-add missing column, re-sign marker ..." that are being interpreted as shell
commands; edit each such prompt line (e.g., the literal string "Recovery #
re-add missing column, re-sign marker" and the other occurrences around lines
66-67, 98-99, 130-131, 162-163, 194-195) so the comment indicator appears
immediately after the prompt (e.g., change "> Recovery # ..." to "> # Recovery
..." or "> # Recovery — ..." ), ensuring the shell prompt is followed by a shell
comment token so these headings are treated as comments and do not produce
"bash: Recovery: command not found".

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/05-db-verify-schema-only-pass.ascii`:
- Line 34: The recorded fixture header "# Schema-only verification passes after
recovery [schema restored, marker matches contract]" claims a pass but the
recorded result block contains the failure message "Database schema does not
satisfy contract", causing inconsistency; fix by either (A) updating the header
to reflect a failing scenario to match the recorded result, or (B) regenerate
the recorded result block so it shows a successful verification outcome (no
"Database schema does not satisfy contract" error) to match the header. Locate
the header string and the result block containing "Database schema does not
satisfy contract" in this fixture (and apply the same consistency fix to the
other similar fixtures mentioned) and ensure the title and recorded outcome
align.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/01-db-verify-fail.ascii`:
- Line 34: Rename the awkward scenario title string "fails Verify marker hash
does not match new contract [initialized with base, contract swapped to v2]" to
a clearer format like "Verify fails: marker hash does not match new contract
[initialized with base, contract swapped to v2]"; search for the identical title
occurrences elsewhere in the file (the other lines with the same wording) and
apply the same replacement so all scenario titles read "Verify fails: ..." for
consistent, more readable phrasing.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/03-db-update-recovery.ascii`:
- Around line 34-35: The line starting with "> Recovery # apply pending change,
update marker [base schema, v2 contract]" is being interpreted by bash as a
command ("Recovery") and causing "command not found" errors; change the marker
so it is a shell-safe comment or non-executable marker (for example replace the
leading "> Recovery" with a shell comment like "# Recovery — apply pending
change, update marker [base schema, v2 contract]" or any other line that begins
with "#" or another non-executable prefix) and apply the same change
consistently to all similar markers in the file to prevent bash from attempting
to execute them.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/04-db-init-idempotent.ascii`:
- Line 34: Update the step label string "re-run Idempotent expects no changes
[initialized, marker matches contract]" to a clearer phrasing such as
"Idempotent re-run expects no changes [initialized, marker matches contract]"
wherever it appears; search for the exact snippet "re-run Idempotent expects no
changes" in the ASCII recording and replace each occurrence (including repeats
at the same pattern) so the wording reads "Idempotent re-run expects no changes
..." to improve readability while preserving the bracketed status text.

---

Nitpick comments:
In `@docs/CLI` Style Guide.md:
- Around line 138-141: Update the "db verify" flag docs to state that the CLI
disallows combining --shallow with --schema-only or --strict (these combinations
should be described as a usage error returning exit code 2), while explicitly
noting that --schema-only can be used together with --strict; mention this
directly alongside the existing bullets for Default, --shallow, --schema-only,
and --strict so users see compatible vs incompatible flag combinations for the
db verify command.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/02-db-verify-shallow-pass.ascii`:
- Line 1: Tests are brittle because the recorder captures host locale warnings
("bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file
or directory"); update the recording harness (the CLI recorder/fixture
normalizer) to strip or normalize that exact warning string (and its variants)
from captured stdout/stderr (e.g., add a filter in the recorder's
normalizeOutput / sanitizeRecording path) so the ascii fixtures
(drift-phantom/02-db-verify-shallow-pass.ascii and the other listed snapshots)
no longer include locale noise.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii`:
- Line 1: The committed ASCII recording contains environment-specific locale
warning lines ("bash: warning: setlocale: LC_ALL: cannot change locale
(C.UTF-8): No such file or directory"); update the recording harness to export a
stable locale (for example set LC_ALL=C.UTF-8 and LANG=C.UTF-8 or unset
LC_ALL/LANG to a known value) before spawning shells used by the harness, then
regenerate the fixture file
packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii
(and the other affected recordings at the listed positions) so the warning lines
are removed from the committed output. Ensure the change is made in the
test/recording bootstrap code (the recording harness initialization) so all
subsequent recordings no longer include the locale warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 61156db9-a36a-4c2f-b8d5-b662f5384809

📥 Commits

Reviewing files that changed from the base of the PR and between 0043b0a and 70d14e6.

⛔ Files ignored due to path filters (39)
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/01-contract-emit-v2.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/02-db-update-dry-run.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/03-db-update-apply.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/04-db-update-noop.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/05-db-verify.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/02-db-schema-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/02-db-verify-schema-only-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/03-db-introspect-empty.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/04-db-init-recovery.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/05-db-verify-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/01-db-verify-false-positive.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/02-db-schema-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/02-db-verify-shallow-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/03-db-introspect-diverged.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/04-db-update-recovery.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/05-db-schema-verify-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/05-db-verify-schema-only-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/02-db-schema-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/02-db-verify-schema-only-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/03-db-update-recovery.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/04-db-verify-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/01-contract-emit.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/02-db-init-dry-run.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/03-db-init.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/04-db-init-idempotent.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/05-db-verify.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/06-db-schema-verify.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/06-db-verify-schema-only.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/07-db-schema-verify-strict.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/07-db-verify-strict.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/08-db-introspect.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/09-db-verify-json.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/10-db-schema-verify-json.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/10-db-verify-schema-only-json.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/test/__snapshots__/help.snapshot.test.ts.snap is excluded by !**/*.snap
  • projects/db-verify-consolidation/spec.md is excluded by !projects/**
📒 Files selected for processing (56)
  • docs/CLI Style Guide.md
  • docs/architecture docs/adrs/ADR 154 - Component-owned database dependencies.md
  • packages/1-framework/1-core/migration/control-plane/src/errors.ts
  • packages/1-framework/1-core/migration/control-plane/test/errors.test.ts
  • packages/1-framework/3-tooling/cli/CLI_RECORDING.md
  • packages/1-framework/3-tooling/cli/README.md
  • packages/1-framework/3-tooling/cli/package.json
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/01-contract-emit-v2.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/02-db-update-dry-run.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/03-db-update-apply.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/04-db-update-noop.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/02-db-verify-schema-only-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/03-db-introspect-empty.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/04-db-init-recovery.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/05-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/02-db-verify-shallow-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/03-db-introspect-diverged.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/04-db-update-recovery.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-phantom/05-db-verify-schema-only-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/02-db-verify-schema-only-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/03-db-update-recovery.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/04-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/01-contract-emit.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/02-db-init-dry-run.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/03-db-init.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/04-db-init-idempotent.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/06-db-verify-schema-only.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/07-db-schema-verify-strict.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/07-db-verify-strict.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/08-db-introspect.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/10-db-verify-schema-only-json.ascii
  • packages/1-framework/3-tooling/cli/recordings/config.ts
  • packages/1-framework/3-tooling/cli/src/cli.ts
  • packages/1-framework/3-tooling/cli/src/commands/db-introspect.ts
  • packages/1-framework/3-tooling/cli/src/commands/db-schema-verify.ts
  • packages/1-framework/3-tooling/cli/src/commands/db-verify.ts
  • packages/1-framework/3-tooling/cli/src/utils/formatters/help.ts
  • packages/1-framework/3-tooling/cli/src/utils/formatters/verify.ts
  • packages/1-framework/3-tooling/cli/test/utils/suggest-command.test.ts
  • packages/1-framework/3-tooling/cli/tsdown.config.ts
  • packages/1-framework/3-tooling/cli/vitest.config.ts
  • test/integration/test/cli-journeys/README.md
  • test/integration/test/cli-journeys/brownfield-adoption.e2e.test.ts
  • test/integration/test/cli-journeys/drift-marker.e2e.test.ts
  • test/integration/test/cli-journeys/drift-schema.e2e.test.ts
  • test/integration/test/cli-journeys/greenfield-setup.e2e.test.ts
  • test/integration/test/cli.db-schema-verify.e2e.test.ts
  • test/integration/test/cli.db-verify.e2e.test.ts
  • test/integration/test/fixtures/cli/cli-e2e-test-app/fixtures/db-schema-verify/prisma-next.config.with-db.ts
  • test/integration/test/utils/journey-test-helpers.ts
💤 Files with no reviewable changes (2)
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/07-db-schema-verify-strict.ascii
  • packages/1-framework/3-tooling/cli/package.json

@wmadden wmadden 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.

Left you a handful of comments on cosmetic issues. Let's avoid using indirect or jargon-y terms in our user-facing descriptions. Let's also avoid introducing the term "phantom drift" in the codebase and instead describe the problem directly: the marker doesn't match the schema, i.e. "invalid marker" or "stale marker"

Your agent has also replaced all mentions of schema-verify with verify --schema-only - many of these can be deleted, they're redundant

@@ -156,7 +156,7 @@ export function createDbIntrospectCommand(): Command {
'Inspect the database schema',
'Reads the live database schema and displays it as a tree structure. This command\n' +
'does not check the schema against your contract - it only shows what exists in\n' +
'the database. Use `db verify` or `db schema-verify` to compare against your contract.',
'the database. Use `db verify` or `db verify --schema-only` to compare against your contract.',

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.

Suggested change
'the database. Use `db verify` or `db verify --schema-only` to compare against your contract.',
'the database. Use `db verify` to compare against your contract.',

Comment on lines +203 to +353
'Schema verification skipped because --shallow was provided. Run `prisma-next db schema-verify` to detect structural drift.',
'Schema verification skipped because --shallow was provided. Run `prisma-next db verify --schema-only` to detect structural drift.',

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.

Let's avoid terms like "structural drift". Suggestion:

'Schema verification skipped because --shallow was provided'

Comment on lines +435 to +438
'Verifies the database marker first, then runs structural schema verification to catch drift\n' +
'such as manual DDL changes. Use `--shallow` for marker-only verification, `--schema-only`\n' +
'to skip marker checks and inspect only the live schema, and `--strict` to fail on extra\n' +
'schema elements when schema verification runs.',

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.

Same here, avoid "structural drift", "phantom drift" etc and speak in accessible terms:

    'Verifies the database marker first, then checks the database schema matches your contract. Use `--shallow` for marker-only verification, `--schema-only`\n' +
      'to skip marker checks and inspect only the live schema, and `--strict` to fail if the database includes elements not present in the contract',

Comment on lines +79 to +80
│ the database. Use \`db verify\` or \`db schema-verify\` to compare against your
│ contract.
│ the database. Use \`db verify\` or \`db verify --schema-only\` to compare against
│ your contract.

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.

Your agent has adopted a pattern of mentioning --schema-only anywhere that schema-verify was previously mentioned. Just say "use db verify", that's enough

@@ -129,17 +129,26 @@ exports[`help text snapshots > formats db verify help 1`] = `
│ --config <path> Path to prisma-next.config.ts
│ --shallow Skip structural schema verification and only check the
│ database marker
│ --schema-only Skip marker verification and only check whether the live
│ schema satisfies the contract
│ --strict Strict mode: extra schema elements cause failures

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.

Suggested change
│ --strict Strict mode: extra schema elements cause failures
│ --strict Strict mode:schema elements not present in the contract are considered an error

Comment on lines +145 to +151
│ Verifies the database marker first, then runs structural schema verification
│ to catch drift
│ such as manual DDL changes. Use \`--shallow\` for marker-only verification,
│ \`--schema-only\`
│ to skip marker checks and inspect only the live schema, and \`--strict\` to fail
│ on extra
│ schema elements when schema verification runs.

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.

See my phrasing above - this is indirect and relies on "drift", a term many people won't be familiar with

| `drift-missing-marker` | No marker in database, recovery via `db init` |
| `drift-stale-marker` | Marker hash mismatch after contract change, recovery via `db update` |
| `drift-phantom` | Manual DDL drift undetected by marker, caught by `db schema-verify` |
| `drift-phantom` | Manual DDL drift detected by `db verify`; `db verify --shallow` shows the marker-only escape hatch |

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.

Let's avoid introducing "phantom drift" into codebase vocabulary. "invalid marker" or "stale marker" eg would be a better description

Options:
- `--db <url>`: Database connection string (optional; defaults to `config.db.connection` if set)
- `--config <path>`: Optional. Path to `prisma-next.config.ts` (defaults to `./prisma-next.config.ts` if present)
- `--shallow`: Skip structural schema verification and only check the database marker

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.

Suggested change
- `--shallow`: Skip structural schema verification and only check the database marker
- `--signature-only`: Skip structural schema verification and only check the database marker

or

Suggested change
- `--shallow`: Skip structural schema verification and only check the database marker
- `--marker-only`: Skip structural schema verification and only check the database marker

@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

♻️ Duplicate comments (1)
packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/05-db-verify-schema-only-pass.ascii (1)

34-34: ⚠️ Potential issue | 🟠 Major

Regenerate this tape: “passes after recovery” conflicts with recorded failure.

Line 34 says schema-only verification passes after recovery, but Line 214 records PN-SCHEMA-0001 failure. That conflicts with the configured step intent in packages/1-framework/3-tooling/cli/recordings/config.ts:432-440 (dbState: schema restored, marker matches contract). Please regenerate this recording with the correct recovered DB state (or update scenario metadata if failure is intended).

Based on learnings: In packages/1-framework/3-tooling/cli/recordings/ascii/**, treat VHS-generated .ascii recordings as machine-generated artifacts and do not manually edit them.

Also applies to: 214-214

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/05-db-verify-schema-only-pass.ascii`
at line 34, The ASCII recording "05-db-verify-schema-only-pass.ascii" has
mismatched outcome text ("passes after recovery") versus the recorded
PN-SCHEMA-0001 failure; regenerate the VHS recording so the recorded tape
reflects the intended recovered DB state, or if the failure was intended, update
the scenario metadata's dbState and intent in the config entry that defines the
scenario (refer to the config key dbState and the scenario around the entry that
sets marker/contract expectations) so the .ascii output and PN-SCHEMA-0001
result align; do not manually edit the .ascii file—re-run the recorder to
produce a consistent tape and update the scenario metadata accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/1-framework/3-tooling/cli/README.md`:
- Line 267: Update the README entry that currently reads "Exit code 1 with
schema verification payload: Schema does not match the contract after marker
verification passed" to remove the over-constraining phrase and clarify that
this exit code and payload can occur regardless of marker verification (for
example when running "db verify --schema-only"); locate the exact line
containing that sentence and reword it to say something like "Exit code 1 with
schema verification payload: Schema does not match the contract (this can occur
even when marker verification is not performed, e.g. using 'db verify
--schema-only')" so the docs accurately reflect both code paths.

---

Duplicate comments:
In
`@packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/05-db-verify-schema-only-pass.ascii`:
- Line 34: The ASCII recording "05-db-verify-schema-only-pass.ascii" has
mismatched outcome text ("passes after recovery") versus the recorded
PN-SCHEMA-0001 failure; regenerate the VHS recording so the recorded tape
reflects the intended recovered DB state, or if the failure was intended, update
the scenario metadata's dbState and intent in the config entry that defines the
scenario (refer to the config key dbState and the scenario around the entry that
sets marker/contract expectations) so the .ascii output and PN-SCHEMA-0001
result align; do not manually edit the .ascii file—re-run the recorder to
produce a consistent tape and update the scenario metadata accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: e4d8327d-11e3-4d5b-8bd1-12e5adf7e4fc

📥 Commits

Reviewing files that changed from the base of the PR and between d6396f9 and c82cf03.

⛔ Files ignored due to path filters (15)
  • packages/1-framework/3-tooling/cli/recordings/svgs/direct-update/05-db-verify.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-invalid-marker/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-invalid-marker/02-db-verify-marker-only-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-invalid-marker/03-db-introspect-diverged.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-invalid-marker/04-db-update-recovery.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-invalid-marker/05-db-verify-schema-only-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-missing-marker/05-db-verify-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-phantom/04-db-update-recovery.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/01-db-verify-fail.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/drift-stale-marker/04-db-verify-pass.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/05-db-verify.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/recordings/svgs/greenfield-setup/07-db-verify-strict.svg is excluded by !**/*.svg
  • packages/1-framework/3-tooling/cli/test/__snapshots__/help.snapshot.test.ts.snap is excluded by !**/*.snap
  • projects/db-verify-consolidation/spec.md is excluded by !projects/**
📒 Files selected for processing (25)
  • docs/CLI Style Guide.md
  • packages/1-framework/3-tooling/cli/CLI_RECORDING.md
  • packages/1-framework/3-tooling/cli/README.md
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/02-db-verify-marker-only-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/03-db-introspect-diverged.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/04-db-update-recovery.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/05-db-verify-schema-only-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/05-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/04-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/07-db-verify-strict.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii
  • packages/1-framework/3-tooling/cli/recordings/config.ts
  • packages/1-framework/3-tooling/cli/src/commands/db-introspect.ts
  • packages/1-framework/3-tooling/cli/src/commands/db-verify.ts
  • packages/1-framework/3-tooling/cli/src/control-api/client.ts
  • packages/1-framework/3-tooling/cli/src/utils/formatters/verify.ts
  • packages/1-framework/3-tooling/cli/test/help.snapshot.test.ts
  • test/integration/test/cli-journeys/README.md
  • test/integration/test/cli-journeys/drift-schema.e2e.test.ts
  • test/integration/test/cli.db-verify.e2e.test.ts
✅ Files skipped from review due to trivial changes (9)
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/03-db-introspect-diverged.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/02-db-verify-marker-only-pass.ascii
  • docs/CLI Style Guide.md
  • packages/1-framework/3-tooling/cli/recordings/ascii/direct-update/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/05-db-verify.ascii
  • packages/1-framework/3-tooling/cli/CLI_RECORDING.md
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/07-db-verify-strict.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-invalid-marker/04-db-update-recovery.ascii
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-stale-marker/04-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/01-db-verify-fail.ascii
  • packages/1-framework/3-tooling/cli/recordings/config.ts
  • packages/1-framework/3-tooling/cli/recordings/ascii/drift-missing-marker/05-db-verify-pass.ascii
  • packages/1-framework/3-tooling/cli/recordings/ascii/greenfield-setup/09-db-verify-json.ascii

@jkomyno
jkomyno merged commit c9c2e91 into main Mar 20, 2026
11 checks passed
@jkomyno
jkomyno deleted the feat/cli-verify branch March 20, 2026 10:55
wmadden added a commit that referenced this pull request Apr 2, 2026
- Remove merge conflict markers in Migration System docs (kept the
  codec-hooks-driven paragraph as the most complete version)
- Delete orphaned db-schema-verify.ts (removed in main by PR #243,
  incorrectly preserved during rebase)
wmadden added a commit that referenced this pull request Apr 2, 2026
- Remove merge conflict markers in Migration System docs (kept the
  codec-hooks-driven paragraph as the most complete version)
- Delete orphaned db-schema-verify.ts (removed in main by PR #243,
  incorrectly preserved during rebase)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants