@rehearsal-db/core 1.0.1 → 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.
- package/CHANGELOG.md +34 -1
- package/README.md +1 -1
- package/dist/package.json +1 -1
- package/dist/src/cli/failure_output.d.mts +3 -0
- package/dist/src/cli/failure_output.mjs +48 -0
- package/dist/src/cli/rehearsal.mjs +3 -2
- package/dist/src/cli/runtime_action_handlers.mjs +11 -4
- package/dist/src/cli/runtime_commands.mjs +21 -7
- package/dist/src/cli/runtime_failure_summary.d.mts +1 -0
- package/dist/src/cli/runtime_failure_summary.mjs +30 -4
- package/dist/src/runtime/migration_failure.d.mts +28 -0
- package/dist/src/runtime/migration_failure.mjs +197 -0
- package/dist/src/runtime/migration_failure_source.d.mts +16 -0
- package/dist/src/runtime/migration_failure_source.mjs +68 -0
- package/dist/src/shared/diagnostics.mjs +5 -0
- package/dist/src/shared/operation_guard.d.mts +4 -1
- package/dist/src/shared/operation_guard.mjs +18 -13
- package/dist/src/shared/operation_progress.mjs +35 -1
- package/dist/src/shared/operation_progress_storage.d.mts +27 -6
- package/dist/src/shared/operation_progress_storage.mjs +65 -9
- package/dist/src/targets/port_start_failure.d.mts +15 -0
- package/dist/src/targets/port_start_failure.mjs +46 -0
- package/dist/src/targets/postgresql.mjs +8 -7
- package/dist/src/targets/postgresql_process.d.mts +8 -1
- package/dist/src/targets/postgresql_process.mjs +46 -2
- package/dist/src/targets/supabase_process.mjs +2 -1
- package/dist/src/targets/supabase_start_failure.mjs +5 -1
- package/docs/architecture.md +32 -2
- package/docs/commands.md +35 -0
- package/docs/getting-started.md +1 -1
- package/docs/troubleshooting.md +54 -2
- package/docs/tutorial.md +93 -8
- package/docs/vscode.md +41 -16
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Summarize provider startup evidence without retaining container logs or secrets. */
|
|
2
|
+
import { classifyPortStartupFailure, portStartupGuidance, } from "./port_start_failure.mjs";
|
|
2
3
|
const SERVICE_NAMES = Object.freeze({
|
|
3
4
|
db: "database",
|
|
4
5
|
auth: "auth",
|
|
@@ -18,7 +19,6 @@ const SERVICE_NAMES = Object.freeze({
|
|
|
18
19
|
const REASONS = Object.freeze([
|
|
19
20
|
["out_of_memory", /out of memory|oom[- ]killed|memory allocation failed/iu],
|
|
20
21
|
["disk_full", /no space left on device|disk quota exceeded/iu],
|
|
21
|
-
["port_in_use", /address already in use|port is already allocated/iu],
|
|
22
22
|
["image_architecture", /exec format error/iu],
|
|
23
23
|
["image_pull", /failed to pull|pull access denied|manifest unknown/iu],
|
|
24
24
|
[
|
|
@@ -40,6 +40,9 @@ export const summarizeSupabaseStartupFailure = ({ output, status, processErrorCo
|
|
|
40
40
|
reasons.add("process_timeout");
|
|
41
41
|
if (processErrorCode === "ENOBUFS")
|
|
42
42
|
reasons.add("provider_output_limit");
|
|
43
|
+
const portFailure = classifyPortStartupFailure(bounded);
|
|
44
|
+
if (portFailure)
|
|
45
|
+
reasons.add(portFailure);
|
|
43
46
|
for (const [code, pattern] of REASONS)
|
|
44
47
|
if (pattern.test(bounded))
|
|
45
48
|
reasons.add(code);
|
|
@@ -60,6 +63,7 @@ export const summarizeSupabaseStartupFailure = ({ output, status, processErrorCo
|
|
|
60
63
|
...(services.size
|
|
61
64
|
? [`Reported service states: ${[...services].slice(0, 16).join(", ")}.`]
|
|
62
65
|
: []),
|
|
66
|
+
...(portFailure ? [portStartupGuidance(portFailure, "supabase")] : []),
|
|
63
67
|
"Provider logs, paths, environment values and connection URLs are omitted. This summary does not establish the underlying cause.",
|
|
64
68
|
].join("\n");
|
|
65
69
|
};
|
package/docs/architecture.md
CHANGED
|
@@ -70,6 +70,24 @@ typed registry and produce the same result contract:
|
|
|
70
70
|
Command handlers receive an explicit context containing parsed flags, selected config,
|
|
71
71
|
guided state, and session-local caches. They return a rendered, text, or silent result;
|
|
72
72
|
only the shared output boundary creates JSON envelopes or writes final human output.
|
|
73
|
+
`runtime/migration_failure.mts` owns bounded provider-envelope SQLSTATE recognition,
|
|
74
|
+
fixed classification/remediation and closed safe diagnostic validation. Target drivers
|
|
75
|
+
never forward SQL or provider error details. The manager summary reconstructs that
|
|
76
|
+
fixed diagnostic across the child-process boundary; CLI JSON and private operation
|
|
77
|
+
history expose the same projection. Activity adds a separate `recentFailures` list,
|
|
78
|
+
leaving existing strict progress/recent receipt shapes unchanged for old clients.
|
|
79
|
+
The optional `source` projection is owned by `runtime/migration_failure_source.mts`.
|
|
80
|
+
For individually dispatched PostgreSQL files, it identifies the attempted execution
|
|
81
|
+
input by its reviewed filename, exact SHA-256 and baseline/candidate kind. The driver
|
|
82
|
+
hashes the bytes it loads before dispatch; changed reviewed bytes refuse execution.
|
|
83
|
+
Only a safe project-relative candidate path may be included, never an absolute path;
|
|
84
|
+
baseline inputs keep that path null. This is not attribution of the failing SQL's actual
|
|
85
|
+
origin: included scripts, functions and triggers can fail elsewhere. SQL line and column
|
|
86
|
+
remain null. Supabase batch execution currently supplies no file attribution, and
|
|
87
|
+
ambiguous or unavailable evidence is not inferred from candidate count or provider text.
|
|
88
|
+
`cli/failure_output.mts` preserves the outer category and cleanup warning when a
|
|
89
|
+
stack failure wraps the original migration error. It projects only a validated fixed
|
|
90
|
+
diagnosis from at most four original-error wrappers, never cleanup siblings or causes.
|
|
73
91
|
Session caches never appear in the public parsed-flags type.
|
|
74
92
|
Owned child output has a byte boundary. If a process floods it, Rehearsal sends TERM
|
|
75
93
|
and forcibly reaps only that owned process group after one second; a child ignoring
|
|
@@ -129,14 +147,18 @@ Each scenario remains independently runnable through its `test:fixture:*` script
|
|
|
129
147
|
complete release gate runs every catalog entry against the same immutable tarball and
|
|
130
148
|
writes its version, SHA-256, tool environment, commands, timings, and results under
|
|
131
149
|
`test-results/release-gate/`.
|
|
150
|
+
The existing Supabase scenario includes native syntax and populated-row constraint
|
|
151
|
+
failures, fixed public error/history diagnostics, reviewed corrections and independent
|
|
152
|
+
data/Storage preservation checks. It does not infer a rollback from a failed migration.
|
|
132
153
|
|
|
133
154
|
## Runtime lifecycle
|
|
134
155
|
|
|
135
156
|
`runtime/lifecycle_engine.mts` owns the target-neutral lifecycle contract. Both
|
|
136
157
|
PostgreSQL and Supabase use it to dispatch commands, verify active baseline inputs,
|
|
137
158
|
calculate and confirm the exact migration set, write target-bound receipts, validate
|
|
138
|
-
runtime markers, and
|
|
139
|
-
failure
|
|
159
|
+
runtime markers, and attempt owned failure cleanup without hiding the original error.
|
|
160
|
+
That cleanup can remove the disposable runtime; a failure message does not establish a
|
|
161
|
+
SQL transaction rollback, restoration of sandbox edits, or successful resource removal.
|
|
140
162
|
|
|
141
163
|
The files in `src/targets/` remain drivers. They prove ownership before deleting local
|
|
142
164
|
resources and implement only the behavior that genuinely differs: Docker PostgreSQL
|
|
@@ -144,6 +166,14 @@ containers and SQL setup on one side; Supabase CLI, Auth, Storage, and generated
|
|
|
144
166
|
on the other. An ordinary `stop` never enters rollback or discard, so later `start`
|
|
145
167
|
preserves the sandbox database and Storage contents.
|
|
146
168
|
|
|
169
|
+
CLI command completion and database lifecycle are separate. A successful `run` can finish
|
|
170
|
+
and release its project lock while the configured keep-until-stop database remains
|
|
171
|
+
running. The project-owned CLI proof has its own primary `application-proof` stage;
|
|
172
|
+
HTTP readiness is optional and is not a prerequisite for a database-only proof. Public
|
|
173
|
+
operation receipts record those past stages, not fresh proof of subsequently changed
|
|
174
|
+
configuration, baseline or migration bytes. Editor presentation consumes that evidence
|
|
175
|
+
without interpreting database liveness as an active command or successful proof.
|
|
176
|
+
|
|
147
177
|
Repository contracts keep each target driver at 900 lines or fewer and the shared
|
|
148
178
|
lifecycle engine at 300 lines or fewer. A new database target must use this lifecycle
|
|
149
179
|
boundary rather than copying an existing driver's orchestration.
|
package/docs/commands.md
CHANGED
|
@@ -238,6 +238,41 @@ provides a stable category, code, safe message, suggestions, diagnostic ID, and
|
|
|
238
238
|
context under `error`. Callers should use the category and code for decisions and show
|
|
239
239
|
the message and suggestions to people.
|
|
240
240
|
|
|
241
|
+
Failed migration execution additionally supplies `error.context.migrationFailure`:
|
|
242
|
+
schema version `1`, provider (`postgresql` or `supabase`), classification (`syntax`,
|
|
243
|
+
`schema`, `constraint`, `permission`, `connectivity`, `timeout_or_cancel`, or `unknown`),
|
|
244
|
+
nullable `sqlState`, evidence (`provider_sqlstate`, `unavailable`, or `ambiguous`),
|
|
245
|
+
fixed `summary` and fixed `suggestions`. Classification uses recognized native SQLSTATE
|
|
246
|
+
envelopes, never SQL-text guessing. Unknown evidence does not establish syntax failure.
|
|
247
|
+
Direct manager failures separately name the target in `error.context.target`; raw
|
|
248
|
+
SQL, row values, provider DETAIL, absolute paths and connection strings are not
|
|
249
|
+
included. Optional attempted-input metadata is described below; it does not locate
|
|
250
|
+
the failing SQL statement. Existing exit codes and `MANAGER_RUN_FAILED` / `MANAGER_MIGRATE_FAILED`
|
|
251
|
+
codes are unchanged. If cleanup also fails, the outer failure keeps its existing
|
|
252
|
+
category, exit and cleanup warning while retaining the original fixed migration
|
|
253
|
+
diagnosis. A diagnosis is not borrowed from a cleanup error, and is not evidence that
|
|
254
|
+
cleanup completed.
|
|
255
|
+
|
|
256
|
+
When PostgreSQL submits one known migration file, the diagnostic may include a closed
|
|
257
|
+
`source` object: schema version `1`, `kind` (`baseline` or `candidate`), `filename`,
|
|
258
|
+
`sha256`, nullable `workspaceRelativePath`, `line: null`, `column: null`, and
|
|
259
|
+
`evidence: "owned_execution_input"`. The loaded bytes must match the reviewed hash.
|
|
260
|
+
This identifies the attempted input, not the exact origin of failing SQL; statements,
|
|
261
|
+
functions and included files can fail elsewhere. No statement counting, provider caret,
|
|
262
|
+
or batch candidate count is converted into a source position. Baseline snapshot paths
|
|
263
|
+
are not exposed; unavailable or ambiguous attribution is omitted, including the
|
|
264
|
+
current Supabase batch path. The editor opens a project-local input only after fresh
|
|
265
|
+
containment, regular-file, identity and exact-byte checks; a changed file needs manual
|
|
266
|
+
review instead of a stale link.
|
|
267
|
+
|
|
268
|
+
`activity --json` may also provide `data.recentFailures`: up to 20 entries with
|
|
269
|
+
`operationId` and the same `diagnostic`, joined to a failed receipt in `data.recent`.
|
|
270
|
+
Missing means an older producer; `null` means private history is unavailable; `[]`
|
|
271
|
+
means no retained migration diagnosis. These are recent observations, not current
|
|
272
|
+
runtime verification. Existing `recent[]` and progress object fields are unchanged,
|
|
273
|
+
so older clients can ignore the new top-level projection. The local owner-only history
|
|
274
|
+
stores only this fixed safe projection, not arbitrary errors or terminal output.
|
|
275
|
+
|
|
241
276
|
Invalid positive-integer settings and rejected proposal structure or fields use
|
|
242
277
|
`configuration_invalid` with code `CONFIGURATION_INVALID` (exit `2`), including
|
|
243
278
|
baseline-retention settings and fields that require manual review. They are not
|
package/docs/getting-started.md
CHANGED
|
@@ -15,7 +15,7 @@ They are readable helpers, not native executables or bundled Node/Docker install
|
|
|
15
15
|
Existing Node.js 24 or 26 is required. The default only checks an existing project;
|
|
16
16
|
installation needs an explicit option and does not start a database. Review the
|
|
17
17
|
[shared behavior and release availability](https://github.com/Ddupasquier/rehearsal-db/blob/main/installers/README.md)
|
|
18
|
-
before choosing an install option. An exact core 1.0.
|
|
18
|
+
before choosing an install option. An exact core 1.0.2 install requires that version to
|
|
19
19
|
be published; a checked-in helper is not proof of publication.
|
|
20
20
|
|
|
21
21
|
### Windows: use a WSL 2 Linux workspace
|
package/docs/troubleshooting.md
CHANGED
|
@@ -68,7 +68,9 @@ owner-only startup receipt. This cannot stop a manually started engine.
|
|
|
68
68
|
When a container stays in `starting` or becomes `unhealthy`, Rehearsal reports a runtime
|
|
69
69
|
dependency failure rather than a migration failure. The safe diagnostic includes Docker
|
|
70
70
|
CPU, memory, and container counts; Colima also includes available VM memory when it can
|
|
71
|
-
be read.
|
|
71
|
+
be read. These measurements alone do not establish a capacity problem. Review the
|
|
72
|
+
reported startup evidence first; for a proven resource shortage, stop only stacks you
|
|
73
|
+
own or increase the engine's resources before retrying.
|
|
72
74
|
Rehearsal never changes engine settings or bypasses service health checks.
|
|
73
75
|
|
|
74
76
|
Supabase startup failures retain a bounded summary of recognized provider evidence,
|
|
@@ -135,7 +137,7 @@ docker pull postgres:17-alpine
|
|
|
135
137
|
npx rehearsal doctor
|
|
136
138
|
```
|
|
137
139
|
|
|
138
|
-
## A port is already in use
|
|
140
|
+
## A port is already in use or cannot be bound
|
|
139
141
|
|
|
140
142
|
Rerun `rehearsal setup` to select a different available block. Setup checks both active
|
|
141
143
|
listeners and whether every selected port can be bound, then checks again before writing.
|
|
@@ -143,6 +145,56 @@ For an existing configuration, choose unique non-privileged ports and mirror the
|
|
|
143
145
|
dedicated Supabase config when using Supabase. Do not stop an unrelated database to make
|
|
144
146
|
defaults fit.
|
|
145
147
|
|
|
148
|
+
`port_in_use` reports an occupied bind; `port_unavailable` reports a denied or
|
|
149
|
+
unavailable bind. Neither proves a memory shortage. On Windows/WSL, an excluded TCP
|
|
150
|
+
range or host access policy can prevent binding even when no listener is visible.
|
|
151
|
+
In **Windows PowerShell**, inspect the host without changing it:
|
|
152
|
+
|
|
153
|
+
```powershell
|
|
154
|
+
netsh interface ipv4 show excludedportrange protocol=tcp
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
If the configured port (for example the tutorial's `59422`) is excluded, select a
|
|
158
|
+
different available port outside those ranges. For PostgreSQL, review
|
|
159
|
+
`runtime.databasePort` in `rehearsal.config.mjs`. For Supabase, review the configured
|
|
160
|
+
runtime ports and matching dedicated Supabase configuration together. Keep loopback
|
|
161
|
+
binding. Do not delete reservations, disable host security, prune resources or stop
|
|
162
|
+
someone else's listener to make the default work. Access-denied output is evidence
|
|
163
|
+
of a bind problem, not proof of a particular Windows reservation.
|
|
164
|
+
|
|
165
|
+
Microsoft documents the [read-only excluded-port command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netsh-interface).
|
|
166
|
+
Windows database execution still uses the [WSL 2 compatibility preview](../COMPATIBILITY.md#operating-systems-and-execution-location), not native Windows database support.
|
|
167
|
+
|
|
168
|
+
## A candidate migration failed, but SQL and provider output are withheld
|
|
169
|
+
|
|
170
|
+
Rehearsal keeps SQL, row values, constraint names and raw provider output private.
|
|
171
|
+
When the provider supplies a recognized SQLSTATE envelope, it reports that code plus
|
|
172
|
+
a fixed explanation and next step. PostgreSQL codes are
|
|
173
|
+
[provider-defined conditions](https://www.postgresql.org/docs/17/errcodes-appendix.html),
|
|
174
|
+
not guesses from the SQL text:
|
|
175
|
+
|
|
176
|
+
| Code | Meaning | Next step |
|
|
177
|
+
| ----------------- | ---------------------- | ----------------------------------------------------------------------------------------- |
|
|
178
|
+
| `42601` | SQL syntax error | Review malformed statements and punctuation. |
|
|
179
|
+
| `23502` | NOT NULL violation | Review NULL values and backfill before enforcing the requirement. |
|
|
180
|
+
| `23503` | Foreign-key violation | Review missing referenced rows and migration ordering. |
|
|
181
|
+
| `23505` | Uniqueness violation | Review duplicates before enforcing uniqueness. |
|
|
182
|
+
| `23514` | CHECK violation | Existing or newly written rows do not satisfy the constraint; review/backfill them. |
|
|
183
|
+
| `42P01` / `42703` | Missing table / column | Review schema qualification and migration ordering; this is not a confirmed syntax error. |
|
|
184
|
+
|
|
185
|
+
Unknown, unsupported, oversized or conflicting evidence remains explicitly unknown;
|
|
186
|
+
it must not be labeled a syntax error from wording alone. JSON failures include the
|
|
187
|
+
versioned `error.context.migrationFailure` projection with provider, classification,
|
|
188
|
+
SQLSTATE, evidence, fixed summary and suggestions. PostgreSQL may identify its exact
|
|
189
|
+
attempted input file, not the actual origin of the failing SQL or a line/column location.
|
|
190
|
+
No automatic rewrite, retry, reset or hosted connection follows a diagnosis.
|
|
191
|
+
|
|
192
|
+
Inspect `rehearsal status` after failure. Owned runtime cleanup and baseline preservation
|
|
193
|
+
are separate facts; a failed operation does not prove SQL rollback or preservation of
|
|
194
|
+
your disposable sandbox edits. A warning that cleanup could not be confirmed requires
|
|
195
|
+
review before retrying. Follow the [break-and-fix tutorial](tutorial.md#5-break-a-migration-on-existing-data)
|
|
196
|
+
to practice safely on synthetic data.
|
|
197
|
+
|
|
146
198
|
## Baseline checksum mismatch
|
|
147
199
|
|
|
148
200
|
Do not edit the checksum or manifest. The artifact is no longer the reviewed input.
|
package/docs/tutorial.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This tutorial runs a complete PostgreSQL rehearsal in a temporary fictional project. It
|
|
4
4
|
does not use your application, production data, or a hosted database.
|
|
5
5
|
|
|
6
|
-
Allow about
|
|
6
|
+
Allow about ten minutes after downloading the database image. You need Git, Node.js 22,
|
|
7
7
|
24, or 26, npm, and a running Docker-compatible engine. Node.js 24 LTS is recommended.
|
|
8
8
|
|
|
9
9
|
## 1. Prepare Rehearsal
|
|
@@ -36,9 +36,14 @@ rehearsal_repo=$PWD
|
|
|
36
36
|
tutorial_dir=$(mktemp -d)
|
|
37
37
|
cp -R tests/fixtures/postgresql-project "$tutorial_dir/app"
|
|
38
38
|
cd "$tutorial_dir/app"
|
|
39
|
-
npm install --ignore-scripts --no-save "$rehearsal_repo"
|
|
39
|
+
npm install --ignore-scripts --no-save --install-links "$rehearsal_repo"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
`--install-links` installs a local package copy in this temporary project instead of
|
|
43
|
+
linking to the separate source checkout. Both the CLI and VS Code can use this copy;
|
|
44
|
+
the extension deliberately refuses a package that resolves outside the project or its
|
|
45
|
+
containing Git repository. Installation does not start or change a database.
|
|
46
|
+
|
|
42
47
|
The temporary project contains:
|
|
43
48
|
|
|
44
49
|
- one historical migration that creates a `widgets` table;
|
|
@@ -51,6 +56,12 @@ The fixture uses runtime ID `rehearsal-postgresql-fixture` and PostgreSQL port `
|
|
|
51
56
|
Run only one copy at a time, or choose a distinct `runtime.projectId` and free
|
|
52
57
|
`runtime.databasePort` in `rehearsal.config.mjs` before continuing. Rehearsal will not
|
|
53
58
|
replace another listener.
|
|
59
|
+
On Windows, run this tutorial inside WSL 2 on its Linux filesystem, with Linux Node
|
|
60
|
+
and Docker integration enabled. A Windows-excluded port can fail even without a
|
|
61
|
+
listener. If `59422` cannot be bound, inspect the Windows host's excluded TCP ranges
|
|
62
|
+
with `netsh interface ipv4 show excludedportrange protocol=tcp` in PowerShell,
|
|
63
|
+
then choose a different available `runtime.databasePort` before starting. Do not remove
|
|
64
|
+
reservations or stop unrelated services. See [port troubleshooting](troubleshooting.md#a-port-is-already-in-use-or-cannot-be-bound).
|
|
54
65
|
This is a database-only example, not a full application with a browser interface.
|
|
55
66
|
|
|
56
67
|
## 3. Create the baseline
|
|
@@ -77,10 +88,84 @@ Choose **Run a rehearsal**. The guide should show exactly one candidate:
|
|
|
77
88
|
Confirm it. Rehearsal creates a loopback-only PostgreSQL container, restores the baseline,
|
|
78
89
|
applies the candidate, and runs the fixture proof.
|
|
79
90
|
|
|
80
|
-
Success ends with
|
|
81
|
-
application
|
|
91
|
+
Success ends with the fixture's project-proof message. Here, the configured proof
|
|
92
|
+
checks the migrated database; it does not start a browser application. The rehearsal
|
|
93
|
+
command has finished even though its database can remain running. Continue with the
|
|
94
|
+
deliberate failure below, or use `rehearsal verify` to check the runtime.
|
|
95
|
+
|
|
96
|
+
## 5. Break a migration on existing data
|
|
97
|
+
|
|
98
|
+
This is the useful failure: the SQL is valid, but the synthetic row's new `description`
|
|
99
|
+
is NULL. Making that column required would work on an empty table and fail on this row.
|
|
100
|
+
|
|
101
|
+
Exit the guide. From the temporary app directory, copy the deliberately unsafe example
|
|
102
|
+
into a **new, unapplied** candidate:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cp demo/require-description.sql database/migrations/20260101000200_require_widget_description.sql
|
|
106
|
+
npx --no-install rehearsal
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Choose **Run a rehearsal** again. Review the two candidates, including the new
|
|
110
|
+
`20260101000200_require_widget_description.sql`, and confirm the exact plan.
|
|
111
|
+
The expected result is a failure, not a successful rehearsal:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
Migration SQLSTATE: 23502.
|
|
115
|
+
Rows do not satisfy a NOT NULL requirement.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The safe explanation recommends reviewing NULL values and backfilling incompatible
|
|
119
|
+
rows. SQL and provider row details remain private. A constraint failure is **not** a
|
|
120
|
+
syntax error: PostgreSQL reported that the data violates the requirement.
|
|
121
|
+
|
|
122
|
+
Rehearsal must not report the failed runtime as trusted. Its owned failure cleanup may
|
|
123
|
+
remove the disposable runtime; a cleanup warning means resources may remain. The
|
|
124
|
+
immutable baseline remains available. Do not infer a transaction rollback or preserved
|
|
125
|
+
sandbox edits from a failure message alone. No production database is involved.
|
|
126
|
+
|
|
127
|
+
## 6. Fix it, review again, and pass
|
|
128
|
+
|
|
129
|
+
Exit the guide. Replace **only this new, never-successfully-applied tutorial candidate**
|
|
130
|
+
with its data-preserving fix:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cp demo/backfill-and-require-description.sql database/migrations/20260101000200_require_widget_description.sql
|
|
134
|
+
npx --no-install rehearsal
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The fix first fills missing descriptions with a synthetic value, then enforces NOT NULL.
|
|
138
|
+
Choose **Run a rehearsal**, review the changed candidate and its **new digest**, and
|
|
139
|
+
confirm again. Rehearsal restores the same baseline and applies the corrected plan.
|
|
140
|
+
The application proof should now pass. Do not reuse an earlier confirmation or alter a
|
|
141
|
+
historical migration that was already deployed; real deployed history needs a forward
|
|
142
|
+
migration instead.
|
|
143
|
+
|
|
144
|
+
## 7. Continue in VS Code, or verify from the terminal
|
|
145
|
+
|
|
146
|
+
To continue in the editor, leave the guide, open this temporary `app` folder in VS Code,
|
|
147
|
+
and install [Rehearsal DB](vscode.md). On Windows, open the folder through **Remote -
|
|
148
|
+
WSL**, not in a native Windows extension host. Trust only this project after reviewing
|
|
149
|
+
its files, then choose **Rehearsal: Open Dashboard**. Refresh if the dashboard was
|
|
150
|
+
already open. Opening or refreshing the dashboard performs read-only inspection; it
|
|
151
|
+
does not rerun the rehearsal or reset its database.
|
|
152
|
+
|
|
153
|
+
If an earlier tutorial install reports that the package resolves outside its repository,
|
|
154
|
+
run the following from the same temporary `app` directory, using the source checkout
|
|
155
|
+
you built in step 1, then refresh the dashboard:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npm install --ignore-scripts --no-save --install-links "$rehearsal_repo"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This replaces the external package link with a project-local copy. Do not edit
|
|
162
|
+
Rehearsal's manifest or CLI paths to bypass the check. The baseline, project
|
|
163
|
+
configuration, privacy key and database do not need to be reset. If the original shell
|
|
164
|
+
was closed, set `rehearsal_repo` to the absolute path of that reviewed source checkout
|
|
165
|
+
first. A copy does not track later source edits; rebuild and explicitly reinstall it
|
|
166
|
+
when testing a changed checkout.
|
|
82
167
|
|
|
83
|
-
##
|
|
168
|
+
## 8. Verify and clean up
|
|
84
169
|
|
|
85
170
|
Exit the guide, then run:
|
|
86
171
|
|
|
@@ -97,9 +182,9 @@ directory remains on disk and can be deleted when you no longer need it.
|
|
|
97
182
|
|
|
98
183
|
## What you proved
|
|
99
184
|
|
|
100
|
-
You
|
|
101
|
-
|
|
102
|
-
cleaned up only its own runtime.
|
|
185
|
+
You saw valid SQL fail against existing data, used a safe database explanation to fix
|
|
186
|
+
the unapplied migration, reviewed the changed plan, and proved the correction against
|
|
187
|
+
the same baseline. Rehearsal verified the result and cleaned up only its own runtime.
|
|
103
188
|
|
|
104
189
|
Next, follow [Getting started](getting-started.md) in your own project. Start with synthetic
|
|
105
190
|
rows until the workflow and application proof are reliable.
|
package/docs/vscode.md
CHANGED
|
@@ -4,9 +4,9 @@ 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.
|
|
7
|
+
This guide targets **Free Starter 0.1.22**, named **Rehearsal DB** on
|
|
8
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.
|
|
9
|
+
with a [reviewed GitHub VSIX](https://github.com/Ddupasquier/rehearsal-vscode/releases/tag/v0.1.22)
|
|
10
10
|
for direct installation. The canonical extension ID is **`rehearsal-db.rehearsal-db`**,
|
|
11
11
|
published by **`rehearsal-db`**. The workbench and commands retain the **Rehearsal** brand.
|
|
12
12
|
All included features are free indefinitely for personal or commercial development.
|
|
@@ -66,13 +66,21 @@ real WSL core fixtures do not certify a native Remote-WSL editor walkthrough.
|
|
|
66
66
|
4. Follow **Next best step**. Review the detected project and active configuration;
|
|
67
67
|
setup, source access, migration execution and cleanup keep their own confirmations.
|
|
68
68
|
|
|
69
|
-
The release pairing described here is core **1.0.
|
|
69
|
+
The release pairing described here is core **1.0.2** with Starter **0.1.22**.
|
|
70
70
|
Install it once both versions appear in their official release channels.
|
|
71
71
|
The extension's minimum core is `0.1.0-rc.4`. A project that is not ready should show
|
|
72
72
|
setup guidance, not require you to build the extension. Opening the dashboard does not
|
|
73
73
|
start a database or run a migration. Use
|
|
74
74
|
[Getting started](getting-started.md) for the CLI and safe baseline inputs.
|
|
75
75
|
|
|
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
|
+
|
|
76
84
|
Native Windows inspection refusal is not database-runtime support. Browser-based
|
|
77
85
|
VS Code, Codespaces, SSH and Dev Containers have no end-to-end support claim.
|
|
78
86
|
Native Windows means the Windows Node/extension host, not a Windows desktop
|
|
@@ -84,10 +92,10 @@ distinction between desktop OS, extension host, architecture and actual database
|
|
|
84
92
|
### Direct GitHub installation
|
|
85
93
|
|
|
86
94
|
The verified GitHub VSIX is an alternative to Marketplace. Open the
|
|
87
|
-
[Starter 0.1.
|
|
88
|
-
Under **Assets**, download `rehearsal-db-0.1.
|
|
89
|
-
run `shasum -a 256 /path/to/rehearsal-db-0.1.
|
|
90
|
-
`sha256sum /path/to/rehearsal-db-0.1.
|
|
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
|
|
91
99
|
release's `SHA256SUMS`; stop if they differ. Do not substitute a local rebuild.
|
|
92
100
|
Then open **Extensions → … → Install from VSIX…** and choose the verified file.
|
|
93
101
|
Save your work and reload only if VS Code asks.
|
|
@@ -153,6 +161,21 @@ paused. Use the local address shown by the owning terminal. **Open application**
|
|
|
153
161
|
that address without running another CLI command. Press **Ctrl+C** once in the owning
|
|
154
162
|
terminal when done, then wait for its shell prompt and the configured lifecycle result.
|
|
155
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
|
+
|
|
156
179
|
## Optional automatic updates
|
|
157
180
|
|
|
158
181
|
Open **Rehearsal: Check for Updates** from the Command Palette, or use the dashboard's
|
|
@@ -199,7 +222,7 @@ route; do not delete its coordination lock while a package manager may still be
|
|
|
199
222
|
|
|
200
223
|
Manual updating stays available: download and verify the next reviewed VSIX, then repeat
|
|
201
224
|
**Install from VSIX…**. See the release's
|
|
202
|
-
[installation guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
225
|
+
[installation guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/README.md#install-and-open-your-project).
|
|
203
226
|
An ordinary core-package update is detected from its manifest, lockfile and installed
|
|
204
227
|
metadata without reloading VS Code. The header shows loaded extension and core versions
|
|
205
228
|
separately; installed → newest appears only after a successful release check. Unknown or
|
|
@@ -209,13 +232,15 @@ offline availability is not proof that you are up to date.
|
|
|
209
232
|
|
|
210
233
|
Passive inspection stays local. The extension includes no telemetry, advertising, hosted
|
|
211
234
|
database access, or account. It does not read environment files, credentials, private rows,
|
|
212
|
-
baseline contents, or project source
|
|
213
|
-
|
|
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.
|
|
214
239
|
|
|
215
240
|
## License, support and future Pro
|
|
216
241
|
|
|
217
|
-
Starter 0.1.
|
|
218
|
-
[free Starter license](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
242
|
+
Starter 0.1.22 carries the same
|
|
243
|
+
[free Starter license](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/LICENSE).
|
|
219
244
|
Its current review, configuration, comparison and reporting tools are included; they
|
|
220
245
|
are not a timed evaluation or a paid feature gate. Free use does not mean the extension
|
|
221
246
|
is MIT-licensed: its bundled terms govern copying and redistribution. Core remains MIT.
|
|
@@ -224,17 +249,17 @@ Future optional Pro editor workflows must be separately identified. They cannot
|
|
|
224
249
|
retroactively remove Starter rights already granted for a received version. Pro pricing,
|
|
225
250
|
billing and entitlements are not implemented; no payment is needed to use Starter.
|
|
226
251
|
Database and safety capabilities stay in the free CLI. The
|
|
227
|
-
[edition guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
252
|
+
[edition guide](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/docs/commercial-readiness.md)
|
|
228
253
|
owns the detailed boundary.
|
|
229
254
|
|
|
230
255
|
Preview describes stability, not a trial countdown. Support is best effort, with no
|
|
231
256
|
service-level agreement, database hosting, backups or production support. Before use,
|
|
232
|
-
read the release's [privacy statement](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
233
|
-
and [support policy](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
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).
|
|
234
259
|
Report editor problems in the
|
|
235
260
|
[Rehearsal issue tracker](https://github.com/Ddupasquier/rehearsal-db/issues), as
|
|
236
261
|
described in the support policy.
|
|
237
|
-
Use its [private security process](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.
|
|
262
|
+
Use its [private security process](https://github.com/Ddupasquier/rehearsal-vscode/blob/v0.1.22/SECURITY.md)
|
|
238
263
|
for vulnerabilities; never post credentials, private rows or baseline files publicly.
|
|
239
264
|
|
|
240
265
|
Historical VSIX files retain their bundled terms. Choose a reviewed release carrying
|
package/package.json
CHANGED