You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): honest Drizzle EQL outcome + close test gaps (review on #687)
Differential review (Codex) found the completion gate still reported a
successful, complete setup for `stash init --drizzle` before EQL was in the
database: the Drizzle path only *generates* a v2 migration (applied later with
`drizzle-kit migrate`), yet `installEqlStep` returned `eqlInstalled: true` for
every non-throwing outcome — the exact false-success this PR removes elsewhere.
- `installCommand` now returns a structured `InstallOutcome`
(`installed` | `already-installed` | `migration-generated` | `dry-run`).
- `installEqlStep` maps `migration-generated` to a new `eqlMigrationPending`
state (EQL not in the DB yet) instead of `eqlInstalled`.
- The init summary reports it honestly — "○ EQL migration generated — apply it
with `drizzle-kit migrate`" — and excuses it from the "Setup incomplete"
hard-fail (exit 0), the same treatment Prisma Next already gets.
- Changeset + stash-cli skill updated to match.
Test-gap review: added the previously-uncovered branches —
- init summary's three-way encryption-client checkmark (scaffolded / kept);
- the Drizzle migration-pending gate (cross-layer: outcome → step → summary);
- handoff-claude / handoff-codex launch-prompt skills clause (stripped build
drops the skills dir; codex keeps AGENTS.md).
Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
`stash init` installs the CLI as a project dev dependency, so subsequent commands can drop the `npx`. The CLI is package-manager aware — before init, use whichever one-shot runner your project uses (`npx`, `pnpm dlx`, `bunx`, `yarn dlx`). Installs are **pinned to the exact `@cipherstash/*` versions this CLI release shipped with** (never bare dist-tags, which can lag behind a release), and init flags any already-installed `@cipherstash/*` package whose resolved version differs from the release's. The fix depends on direction, and init says which applies: an **older** install should be aligned to the release (init offers the exact command); a **newer** install must NOT be downgraded — update the `stash` CLI to the matching release instead (init prints that command too). **Non-interactively, an older ("behind") skew is fatal** — init refuses with a non-zero exit and the align command rather than scaffolding against mismatched packages and reporting a false success. Interactively it offers to align. Likewise, if the EQL extension isn't installed at the end (and the integration isn't Prisma Next, which installs it via `migration apply`), init reports **"Setup incomplete"** and exits non-zero — it never claims a setup is complete when encryption would fail at query time.
39
+
`stash init` installs the CLI as a project dev dependency, so subsequent commands can drop the `npx`. The CLI is package-manager aware — before init, use whichever one-shot runner your project uses (`npx`, `pnpm dlx`, `bunx`, `yarn dlx`). Installs are **pinned to the exact `@cipherstash/*` versions this CLI release shipped with** (never bare dist-tags, which can lag behind a release), and init flags any already-installed `@cipherstash/*` package whose resolved version differs from the release's. The fix depends on direction, and init says which applies: an **older** install should be aligned to the release (init offers the exact command); a **newer** install must NOT be downgraded — update the `stash` CLI to the matching release instead (init prints that command too). **Non-interactively, an older ("behind") skew is fatal** — init refuses with a non-zero exit and the align command rather than scaffolding against mismatched packages and reporting a false success. Interactively it offers to align. Likewise, if the EQL extension isn't installed at the end, init reports **"Setup incomplete"** and exits non-zero — it never claims a setup is complete when encryption would fail at query time. Integrations that install EQL through a migration are the exception and exit 0: **Prisma Next** installs it via `migration apply`, and the **Drizzle** flow *generates* an EQL migration, which init reports honestly as "EQL migration generated — apply it with `drizzle-kit migrate`" rather than claiming the extension is already installed.
0 commit comments