@rehearsal-db/core 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/COMPATIBILITY.md +43 -0
  3. package/README.md +31 -12
  4. package/dist/package.json +2 -2
  5. package/dist/scripts/install/create_root_config.mjs +9 -2
  6. package/dist/src/cli/failure_output.d.mts +3 -0
  7. package/dist/src/cli/failure_output.mjs +48 -0
  8. package/dist/src/cli/rehearsal.mjs +15 -4
  9. package/dist/src/cli/runtime_action_handlers.mjs +11 -4
  10. package/dist/src/cli/runtime_commands.mjs +23 -24
  11. package/dist/src/cli/runtime_failure_summary.d.mts +1 -0
  12. package/dist/src/cli/runtime_failure_summary.mjs +30 -4
  13. package/dist/src/cli/runtime_planning.mjs +6 -0
  14. package/dist/src/project/install_scaffold.mjs +7 -0
  15. package/dist/src/project/project_discovery_metadata.mjs +9 -11
  16. package/dist/src/runtime/migration_failure.d.mts +28 -0
  17. package/dist/src/runtime/migration_failure.mjs +197 -0
  18. package/dist/src/runtime/migration_failure_source.d.mts +16 -0
  19. package/dist/src/runtime/migration_failure_source.mjs +68 -0
  20. package/dist/src/runtime/plan.mjs +26 -15
  21. package/dist/src/shared/diagnostics.mjs +5 -0
  22. package/dist/src/shared/host_platform.d.mts +16 -0
  23. package/dist/src/shared/host_platform.mjs +109 -0
  24. package/dist/src/shared/operation_guard.d.mts +4 -1
  25. package/dist/src/shared/operation_guard.mjs +18 -13
  26. package/dist/src/shared/operation_progress.mjs +35 -1
  27. package/dist/src/shared/operation_progress_storage.d.mts +27 -6
  28. package/dist/src/shared/operation_progress_storage.mjs +65 -9
  29. package/dist/src/shared/process_environment.d.mts +2 -1
  30. package/dist/src/shared/process_environment.mjs +47 -5
  31. package/dist/src/targets/port_start_failure.d.mts +15 -0
  32. package/dist/src/targets/port_start_failure.mjs +46 -0
  33. package/dist/src/targets/postgresql.mjs +8 -7
  34. package/dist/src/targets/postgresql_process.d.mts +8 -1
  35. package/dist/src/targets/postgresql_process.mjs +46 -2
  36. package/dist/src/targets/supabase_process.mjs +2 -1
  37. package/dist/src/targets/supabase_start_failure.mjs +5 -1
  38. package/docs/architecture.md +32 -2
  39. package/docs/commands.md +35 -0
  40. package/docs/getting-started.md +48 -0
  41. package/docs/index.md +15 -9
  42. package/docs/releasing.md +28 -24
  43. package/docs/roadmap.md +8 -3
  44. package/docs/stability.md +8 -4
  45. package/docs/troubleshooting.md +54 -2
  46. package/docs/tutorial.md +93 -8
  47. package/docs/vscode.md +220 -37
  48. package/package.json +2 -2
package/docs/vscode.md CHANGED
@@ -4,6 +4,22 @@ The Rehearsal extension turns the local CLI into a project-aware database-change
4
4
  workbench. It is for developers who want the safety of exact migration plans and disposable
5
5
  local runtimes without memorizing every command.
6
6
 
7
+ This guide targets **Free Starter 0.1.22**, named **Rehearsal DB** on
8
+ [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=rehearsal-db.rehearsal-db),
9
+ with a [reviewed GitHub VSIX](https://github.com/Ddupasquier/rehearsal-vscode/releases/tag/v0.1.22)
10
+ for direct installation. The canonical extension ID is **`rehearsal-db.rehearsal-db`**,
11
+ published by **`rehearsal-db`**. The workbench and commands retain the **Rehearsal** brand.
12
+ All included features are free indefinitely for personal or commercial development.
13
+ No account, payment card, purchase, trial period, or license activation is required.
14
+ The CLI is separately available on [npm](https://www.npmjs.com/package/@rehearsal-db/core)
15
+ under the MIT license. There is no paid CLI tier.
16
+ Confirm the target version appears in its official channel before installing. A guide
17
+ or checked-in version does not mean that publication has completed.
18
+
19
+ Already using the GitHub preview through 0.1.18? Follow the
20
+ [one-time migration steps](#move-from-a-preview-through-0118) before installing the new
21
+ identity. This is not an automatic rename or uninstall.
22
+
7
23
  ## What you can do
8
24
 
9
25
  - See what Rehearsal detected, what it suggests, and what still needs your decision.
@@ -14,6 +30,11 @@ local runtimes without memorizing every command.
14
30
  - Export a privacy-safe verification report and review bounded local activity.
15
31
  - Keep the sidebar and open workbench current when another terminal changes the project's
16
32
  Rehearsal package, lockfile, manifest, or known configuration.
33
+ - Browse resource inventories in independent pages of 5, 10 or 25 cards, rather than
34
+ one unbounded list.
35
+ - Read a configuration diff before choosing **Apply changes** or **Cancel**, then
36
+ return to the project from the saved result.
37
+ - Choose independent, initially off automatic-update options for the extension and CLI.
17
38
 
18
39
  The extension does not become a second database engine. Rehearsal core still owns data
19
40
  boundaries, baselines, migration digests, runtime isolation, locks, rollback, and cleanup.
@@ -22,6 +43,11 @@ boundaries, baselines, migration digests, runtime isolation, locks, rollback, an
22
43
 
23
44
  Use desktop VS Code 1.101 or newer on macOS or Linux and a supported Node.js release
24
45
  (22, 24, or 26). You do not need the extension source repository or Test Lab.
46
+ For a Windows desktop, use the [WSL 2 Linux-workspace setup](getting-started.md#windows-use-a-wsl-2-linux-workspace).
47
+ With editor 0.1.21, native Windows inspection and foreground actions refuse before launching a child
48
+ process and directs you to Remote-WSL. Install the extension into the Linux extension
49
+ host and keep the project on its Linux filesystem. WSL compatibility remains a preview;
50
+ real WSL core fixtures do not certify a native Remote-WSL editor walkthrough.
25
51
 
26
52
  1. Open your application's folder in VS Code—the one containing `package.json` and
27
53
  your migrations. Install Rehearsal there if it is missing:
@@ -30,61 +56,218 @@ Use desktop VS Code 1.101 or newer on macOS or Linux and a supported Node.js rel
30
56
  npm install --save-dev @rehearsal-db/core
31
57
  ```
32
58
 
33
- 2. Open the [reviewed GitHub prereleases](https://github.com/Ddupasquier/rehearsal-vscode/releases).
34
- Download the chosen release's `.vsix` and `SHA256SUMS`. Compare the file's SHA-256
35
- with that release's checksum; do not substitute an unreviewed rebuild.
36
- 3. In VS Code, open **Extensions → … → Install from VSIX…** and choose that file.
37
- Reload the extension host if VS Code asks.
38
- 4. Review Workspace Trust, then open the Command Palette and choose
59
+ 2. Open **Extensions** and search **`@id:rehearsal-db.rehearsal-db`**, or open the
60
+ [official Rehearsal DB listing](https://marketplace.visualstudio.com/items?itemName=rehearsal-db.rehearsal-db).
61
+ Confirm publisher **`rehearsal-db`** and the full extension ID, then choose **Install**.
62
+ The similar-looking legacy ID `rehearsal-db.rehearsal` is not the canonical package.
63
+ If you prefer a direct download, use the verified GitHub VSIX instructions below.
64
+ 3. Review Workspace Trust, then open the Command Palette and choose
39
65
  **Rehearsal: Open Dashboard**. The Rehearsal sidebar also has a dashboard button.
40
- 5. Follow **Next best step**. Review the detected project and active configuration;
66
+ 4. Follow **Next best step**. Review the detected project and active configuration;
41
67
  setup, source access, migration execution and cleanup keep their own confirmations.
42
68
 
43
- The extension needs `@rehearsal-db/core@0.1.0-rc.4` or newer. A project that is not ready
44
- should show setup guidance, not require you to build the extension. Use
69
+ The release pairing described here is core **1.0.2** with Starter **0.1.22**.
70
+ Install it once both versions appear in their official release channels.
71
+ The extension's minimum core is `0.1.0-rc.4`. A project that is not ready should show
72
+ setup guidance, not require you to build the extension. Opening the dashboard does not
73
+ start a database or run a migration. Use
45
74
  [Getting started](getting-started.md) for the CLI and safe baseline inputs.
46
75
 
47
- ## Updates
76
+ For the database-only [tutorial](tutorial.md), open that same tutorial folder in VS Code.
77
+ A local npm link outside the project can work in the CLI but fail the editor's package
78
+ containment check. **Project package link needs repair** explains the verified link
79
+ case: install a reviewed published package/tarball, or copy the reviewed local folder
80
+ with `npm install --ignore-scripts --no-save --install-links /path/to/rehearsal-db`,
81
+ then refresh. This does not reset your baseline or database. A copied package does not
82
+ track subsequent edits to the original checkout; do not bypass the containment check.
83
+
84
+ Native Windows inspection refusal is not database-runtime support. Browser-based
85
+ VS Code, Codespaces, SSH and Dev Containers have no end-to-end support claim.
86
+ Native Windows means the Windows Node/extension host, not a Windows desktop
87
+ connected to WSL. iOS/iPadOS, Android, BSD and unlisted systems are not
88
+ supported by this desktop/local-runtime release. Consult the
89
+ [platform matrix](https://github.com/Ddupasquier/rehearsal-db/blob/main/COMPATIBILITY.md#operating-systems-and-execution-location) for the
90
+ distinction between desktop OS, extension host, architecture and actual database proof.
91
+
92
+ ### Direct GitHub installation
93
+
94
+ The verified GitHub VSIX is an alternative to Marketplace. Open the
95
+ [Starter 0.1.22 release](https://github.com/Ddupasquier/rehearsal-vscode/releases/tag/v0.1.22).
96
+ Under **Assets**, download `rehearsal-db-0.1.22.vsix` and `SHA256SUMS`. In a terminal,
97
+ run `shasum -a 256 /path/to/rehearsal-db-0.1.22.vsix` on macOS or
98
+ `sha256sum /path/to/rehearsal-db-0.1.22.vsix` on Linux. Compare the result with that
99
+ release's `SHA256SUMS`; stop if they differ. Do not substitute a local rebuild.
100
+ Then open **Extensions → … → Install from VSIX…** and choose the verified file.
101
+ Save your work and reload only if VS Code asks.
102
+
103
+ ### Move from a preview through 0.1.18
104
+
105
+ Earlier GitHub previews use `rehearsal-db.rehearsal`, a separate VS Code identity.
106
+ Their released 0.1.18 bytes, tag and checksum remain available and unchanged. Its updater
107
+ looks for `rehearsal-<version>.vsix`, so it ignores the canonical
108
+ `rehearsal-db-<version>.vsix` family instead of silently switching identities.
109
+
110
+ 1. Finish Rehearsal commands in all open project windows. If a sandbox app is open,
111
+ press **Ctrl+C** once in its owning terminal and wait for its normal shell prompt
112
+ and configured lifecycle result. Save your work.
113
+ 2. Explicitly uninstall the legacy extension: in **Extensions**, search
114
+ **`@id:rehearsal-db.rehearsal`**, then use its gear menu → **Uninstall**.
115
+ 3. Save remaining files and run **Developer: Reload Window**. Ensure the old extension
116
+ is no longer installed in each profile where you will use the canonical version.
117
+ 4. Install **Rehearsal DB**, ID **`rehearsal-db.rehearsal-db`**, using Marketplace or the
118
+ verified canonical VSIX above. Reload if asked, reopen the dashboard and review your
119
+ update preferences.
120
+
121
+ The canonical extension refuses activation whenever VS Code still reports the legacy ID.
122
+ Not currently active is not proof that an installed extension is disabled; uninstalling
123
+ and reloading is the supported route. The extension does not automatically uninstall,
124
+ disable or rename your existing installation, interrupt a command or force a reload.
125
+
126
+ This identity change does not reset or modify databases, Storage, project configuration,
127
+ keys or baselines. Private per-extension view state, activity history and metadata-check
128
+ consent are not copied to the new identity; re-select views and review consent there.
129
+ Shared VS Code user settings, including `rehearsal.automaticUpdates`, retain your existing
130
+ values. Review or disable those flags before migration if desired. Do not run database
131
+ cleanup or **Reset Saved Editor State** as a migration step.
132
+
133
+ ## Everyday editor workflow
134
+
135
+ Use **Overview** for the next safe step, **Migrations** to review the complete ordered
136
+ candidate set, and **Environments** for local resource inventory. Filters and sorting
137
+ apply to the full inventory before pagination. Each list has its own **Previous/Next**
138
+ controls and **5/10/25** page size. Paging preserves drafts and selections; bulk image
139
+ selection selects safe candidates on the current page only. Off-page selections remain
140
+ counted and can be cleared before the exact cleanup review. Display filters never narrow
141
+ database cleanup ownership or the required migration set.
142
+
143
+ For configuration, change only the values you intend to change, then choose
144
+ **Review exact configuration diff** or **Review name & protection**. The review tab
145
+ keeps the full diff readable. **Cancel** makes no changes; **Apply changes** saves the
146
+ reviewed change. Wait for **Saved**, then choose **Return to project**. Concurrent edits
147
+ refuse safely instead of overwriting someone else's work; a saved confirmation is tied
148
+ to the exact bytes read back from disk, not merely a completed write request.
149
+
150
+ Commands reuse the same Rehearsal terminal for a project only after its previous command
151
+ has a confirmed exit and its directory still matches. A running sandbox or manually
152
+ entered foreground command is never interrupted to make room for another action. If
153
+ shell integration or completion evidence is unavailable, finish the command and close
154
+ that terminal before retrying. An idle database lock is not proof that a terminal is free.
155
+
156
+ **Open sandbox** is a persistent hands-on session, not a task that should finish while
157
+ you browse. Overview distinguishes **Opening sandbox**, **Sandbox running** and
158
+ **Closing sandbox** from core phase evidence. Missing evidence says **Sandbox session
159
+ open**, not ready. Project inspection waits for that session; the app itself is not
160
+ paused. Use the local address shown by the owning terminal. **Open application** opens
161
+ that address without running another CLI command. Press **Ctrl+C** once in the owning
162
+ terminal when done, then wait for its shell prompt and the configured lifecycle result.
163
+
164
+ An active command, a recorded completed/failed rehearsal and a database left running
165
+ are separate states. **Database sandbox running** does not mean a rehearsal command
166
+ is still executing. A database-only project can review migrations and **Verify** without
167
+ configuring browser launch. A configured proof is not a passed proof: recorded success
168
+ requires a completed primary application-proof stage and is historical, not a fresh
169
+ verification of later edits. Missing, stale, failed or ambiguous evidence stays explicit.
170
+
171
+ With core 1.0.2, **Activity & reports** retains bounded, safe explanations for recognized
172
+ migration failures and their next steps after refresh. Unsupported provider evidence stays
173
+ unknown. When exact PostgreSQL input provenance is available, the source action opens
174
+ only the unchanged approved local migration; changed files or dirty buffers are refused.
175
+ That link identifies submitted input, not a proven failing SQL origin or line/column.
176
+ Supabase batch attribution may remain unknown. Follow the tutorial's reviewed correction
177
+ and new candidate digest; the editor never rewrites or retries SQL automatically.
178
+
179
+ ## Optional automatic updates
180
+
181
+ Open **Rehearsal: Check for Updates** from the Command Palette, or use the dashboard's
182
+ **Check for updates** action. The prompt has two independent, initially unchecked choices:
183
+
184
+ - **Automatically keep the Rehearsal extension up to date**
185
+ - **Automatically keep Rehearsal CLI dependencies up to date**
186
+
187
+ Check the options you want, then choose **Save preferences**. Checking a box alone does
188
+ not save consent: **Later**, **Skip versions**, or closing the tab do not opt you in.
189
+ These choices are stored only in machine-scoped VS Code user settings, not your
190
+ repository or Settings Sync. A project cannot authorize automatic installation. You can
191
+ also edit the user setting directly:
192
+
193
+ ```json
194
+ "rehearsal.automaticUpdates": { "extension": true, "cli": false }
195
+ ```
196
+
197
+ Extension updates download only the official GitHub release, verify the checksum,
198
+ package identity and engine compatibility, and hand the local VSIX to VS Code's
199
+ installer. Rehearsal never forces a window reload; VS Code may ask you to reload when
200
+ you are ready to activate installed code. Keep the previous reviewed VSIX for rollback.
201
+ Canonical automatic updates require `rehearsal-db-<version>.vsix` and embedded identity
202
+ `rehearsal-db.rehearsal-db`; they do not automatically import or replace a legacy package.
203
+
204
+ CLI updates require the separate CLI opt-in. They update compatible registry-backed npm
205
+ dependencies in trusted, idle projects, preserve the dependency group, pin the exact
206
+ checked version and update the lockfile with install scripts disabled. Busy or
207
+ unknown-completion terminals, dirty dependency files, another window's update, offline
208
+ services and unverifiable artifacts defer the update rather than guessing. Breaking
209
+ upgrades, unsupported package managers and local/candidate provenance remain manual.
210
+ No migration, database lifecycle action or forced editor reload is requested.
211
+
212
+ Enabled automatic options check at project opening and daily while the editor stays
213
+ open; there is no separate background daemon. npm/GitHub receive ordinary connection
214
+ information and requested public releases, not project files, database data, credentials
215
+ or installed-version reports. Metadata-only advisory checks keep their separate consent.
48
216
 
49
- GitHub VSIX installations do not auto-update. Download and verify the next reviewed
50
- release, then use **Install from VSIX…** again. Keep the previous reviewed file for
51
- rollback. See the extension's [installation guide](https://github.com/Ddupasquier/rehearsal-vscode#install-and-open-your-project)
52
- for checksum commands and the optional command-line installer.
217
+ Turn either option off to revoke its future automatic work. **Rehearsal: Configure
218
+ Update Checks → Disable updates** turns both automatic options off on this computer and
219
+ stops this project's release checks. Existing installations are not rolled back. An
220
+ interrupted package-manager update with unknown completion requires the support recovery
221
+ route; do not delete its coordination lock while a package manager may still be running.
53
222
 
54
- Updating the project's core package is separate: its manifest, lockfile and installed
55
- metadata trigger a narrow read-only refresh automatically. You do not reload the VS Code
56
- window after an ordinary core-package update. Replacing the VSIX may require VS Code's
57
- one-time extension-host reload so the new extension code becomes active.
223
+ Manual updating stays available: download and verify the next reviewed VSIX, then repeat
224
+ **Install from VSIX…**. See the release's
225
+ [installation guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/README.md#install-and-open-your-project).
226
+ An ordinary core-package update is detected from its manifest, lockfile and installed
227
+ metadata without reloading VS Code. The header shows loaded extension and core versions
228
+ separately; installed → newest appears only after a successful release check. Unknown or
229
+ offline availability is not proof that you are up to date.
58
230
 
59
231
  ## Privacy boundary
60
232
 
61
233
  Passive inspection stays local. The extension includes no telemetry, advertising, hosted
62
234
  database access, or account. It does not read environment files, credentials, private rows,
63
- baseline contents, or project source. User-approved package operations and external links
64
- may use their own services.
235
+ baseline contents, or project source during passive inspection. An explicit migration
236
+ source action reads only the selected local input to check its approved bytes before
237
+ opening it in the editor; it does not upload SQL. User-approved package operations and
238
+ external links may use their own services.
65
239
 
66
- ## Licensing and planned editions
240
+ ## License, support and future Pro
67
241
 
68
- The approved direction is a complete free MIT CLI, a useful free VS Code Starter, and
69
- optional paid Pro editor workflows. The [extension's edition guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/main/docs/commercial-readiness.md)
70
- owns that planned split. Database and safety capabilities stay in the free CLI.
242
+ Starter 0.1.22 carries the same
243
+ [free Starter license](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/LICENSE).
244
+ Its current review, configuration, comparison and reporting tools are included; they
245
+ are not a timed evaluation or a paid feature gate. Free use does not mean the extension
246
+ is MIT-licensed: its bundled terms govern copying and redistribution. Core remains MIT.
71
247
 
72
- The split is not implemented yet: current preview artifacts retain their bundled 14-day
73
- evaluation and per-user license, without a technical trial countdown or feature paywall.
74
- GitHub VSIX installations do not auto-update, so each reviewed delivery includes its exact
75
- version, compatible core range, checksum, privacy statement, license, and support policy.
248
+ Future optional Pro editor workflows must be separately identified. They cannot
249
+ retroactively remove Starter rights already granted for a received version. Pro pricing,
250
+ billing and entitlements are not implemented; no payment is needed to use Starter.
251
+ Database and safety capabilities stay in the free CLI. The
252
+ [edition guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/docs/commercial-readiness.md)
253
+ owns the detailed boundary.
76
254
 
77
- Technical GitHub prereleases are already public; they are not a Marketplace listing or
78
- an announcement of paid availability. A development candidate is not a released artifact
79
- merely because it has the same version number. Read the release's license, privacy and
80
- support documents before evaluation.
255
+ Preview describes stability, not a trial countdown. Support is best effort, with no
256
+ service-level agreement, database hosting, backups or production support. Before use,
257
+ read the release's [privacy statement](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/PRIVACY.md)
258
+ and [support policy](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/SUPPORT.md).
259
+ Report editor problems in the
260
+ [Rehearsal issue tracker](https://github.com/Ddupasquier/rehearsal-db/issues), as
261
+ described in the support policy.
262
+ Use its [private security process](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/SECURITY.md)
263
+ for vulnerabilities; never post credentials, private rows or baseline files publicly.
81
264
 
82
- Starter/Pro license terms and Marketplace distribution still need approval. Paid Pro
83
- availability also needs reviewed seller identity, checkout/refund arrangements and support
84
- ownership. Do not send payment based on an unofficial download or message. Native Windows,
85
- browser-based VS Code, Codespaces, SSH and Dev Containers are not yet claimed as supported.
265
+ Historical VSIX files retain their bundled terms. Choose a reviewed release carrying
266
+ the Starter license; a development candidate is not released merely because its version
267
+ number matches. The [release list](https://github.com/Ddupasquier/rehearsal-vscode/releases)
268
+ is the authority for downloadable artifacts and their checksums.
86
269
 
87
270
  ## Try the free engine first
88
271
 
89
272
  Start with [Getting started](getting-started.md). A successful CLI rehearsal proves the
90
- project and local runtime are compatible before you evaluate the visual workflow.
273
+ project and local runtime are compatible before you use the visual workflow.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rehearsal-db/core",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "Catch PostgreSQL and Supabase migrations that pass on empty databases but fail on real data—before deploy.",
6
6
  "repository": {
@@ -78,7 +78,7 @@
78
78
  "test:fixture:resources": "npm run build && node scripts/verification/run_scenario.mjs resources",
79
79
  "release:verify": "npm run build && node scripts/verification/release_gate.mjs",
80
80
  "check": "npm run check:syntax && npm run typecheck && npm run test && npm run docs:build && npm run format:check && npm run package:audit",
81
- "check:syntax": "find scripts tests -type f -name '*.mjs' -exec node --check {} +",
81
+ "check:syntax": "node scripts/verification/check_syntax.mjs",
82
82
  "typecheck": "npm run build && tsc --project tsconfig.json",
83
83
  "format": "prettier --write .",
84
84
  "format:check": "prettier --check .",