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): close the review findings on the release-train coupling
Seven findings from the code-review pass, all addressed:
1. compareVersions gets a strict shape gate (^\d+\.\d+\.\d+ with optional
well-formed prerelease; build metadata rejected): empty prerelease
('1.0.0-'), '+metadata', truncated/extra cores, and parseInt trailing
garbage ('9.9.10rc') all previously slipped the NaN-only guard and could
classify a malformed install as 'ahead', suppressing the reinstall
guidance. One gate now encodes the whole not-comparable policy; the NaN
check is subsumed. Test matrix covers every class.
2. Mixed ahead+missing no longer silently manufactures a cross-train
mismatch: when missing packages are about to be installed beside newer
ones, the warning says the pairing may not match and to update stash
first.
3. The ahead warning prints the exact update command (devInstallCommand of
stash@<highest installed>) — lockstep guarantees that release exists —
instead of an uncommanded "matching release".
4. @cipherstash/prisma-next JOINS the fixed group (per Dan: the prisma-next
package should line up to the train version too). The changeset's
"can never go stale" claim is now actually true — no residual exclusion.
5. release-train.test.ts gains the growth guard: the changesets fixed group
must equal RELEASE_TRAIN_MANIFESTS exactly, so a future train package
can't silently version outside the lockstep.
6. skills/stash-cli skew sentence is direction-aware (align when older;
update stash — never downgrade — when newer), fixing the now-wrong
unconditional "align versions before continuing".
7. Companion changesets for @cipherstash/wizard and @cipherstash/prisma-next
so their CHANGELOGs explain the version-line jump onto the train.
Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
`Installed versions are newer than this release of stash:\n ${aheadLines(ahead)}\nYour installs are likely fine — update the stash CLI to the matching release instead of downgrading.`,
// Installing MISSING packages now would pin them to this CLI's older
214
+
// embed, pairing them with the newer installed packages — a combination
215
+
// no lockstep release ever shipped. Say so instead of silently
216
+
// manufacturing the mismatch.
217
+
constmissingNote=
218
+
missing.length>0
219
+
? `\nNote: ${missing.join(', ')} will be installed at THIS release's versions, which may not match the newer packages above — for a consistent set, update stash first and re-run init:\n ${updateCmd}`
`Installed versions are newer than this release of stash:\n ${aheadLines(ahead)}\nYour installs are likely fine — update the stash CLI to the matching release instead of downgrading.${missingNote}`,
223
+
)
224
+
}
225
+
207
226
// Interactively, skewed packages can be aligned in the same install run.
208
227
// Non-interactive runs never mutate an existing install: agents/CI get
209
228
// the warning + exact commands above and keep going.
`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 warns if an already-installed package's resolved version differs from the release's — treat that warning as a real problem and align versions before continuing.
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 warns if an already-installed package's resolved version differs from the release's. Treat that warning as a real problem — but 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).
0 commit comments