Repository navigation
feat(cli): doctor --upgrade-check read-only upgrade preview (#116) - #118
Merged
Merged
Conversation
synloq doctor --upgrade-check opens the stand database read-only and reports fresh-install/current/pending/newer schema states with a human-readable description of the pending migration and the 3-command upgrade path (install, upgrade-check, init) — without writing anything. Extracts CURRENT_SCHEMA_VERSION from sqlite.ts; adds docs/guide/update.md documenting the upgrade flow and the forward-only downgrade policy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #116 (part a + c; part b —
initas the single upgrade command — is already the behavior: it reconciles, reuses credentials, migrates, and regenerates; this PR documents and previews it).What
synloq doctor --upgrade-check— a read-only upgrade preview:{ "state": "pending", // fresh-install | current | pending | newer | unreadable "databasePath": "...", "schemaVersion": 5, "expectedSchemaVersion": 5, "pendingMigration": "v5→v6 adds the per-role memory notes table (automatic, additive)", "upgradePath": [ "npm install -g synloq@latest (or: npx synloq@latest …)", "synloq doctor --upgrade-check (re-run this preview)", "synloq init --project-root <project> (reconciles, migrates, regenerates channel configs)" ] }readOnly: trueconnection with the samebusy_timeoutdiscipline as every other connection ([P1] Intermittent STORAGE_FAILURE (SQLite write failed) on live message writes #68): the preview waits out a live relay writer and never migrates, never writes, never creates objects — a test pins that a v5 database is byte-for-byte untouched after the check.newerstate fail-loud: a database written by a newer release gets an explicit "upgrade synloq first" message instead of an opaque open failure.CURRENT_SCHEMA_VERSIONextracted from the inline gate literals insqlite.ts(no behavior change); the migration-notes table describes what each pending step does.Docs
docs/guide/update.mddocuments the 3-command upgrade path, whatinitdoes on an existing stand (credential reuse, reconcile, migrate, regenerate), post-upgrade channel restart, and the forward-only downgrade policy with restore instructions.DoD mapping
"Upgrade from 0.1.0 to next minor is: install, upgrade-check, init — no manual file edits" — the command path is now exactly that; the guide documents it. Verified on copied stands by the new tests (fresh/current/pending-without-writes/newer).
Note
#106 (schema v6) will set
CURRENT_SCHEMA_VERSION = 6and add its own migration note line — small expected conflict with this PR's constant extraction; whoever merges second resolves mechanically.Verified: full
pnpm verify109 files / 957 tests PASS.