@rehearsal-db/core 1.1.0 → 1.3.0
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 +43 -1
- package/COMPATIBILITY.md +40 -0
- package/README.md +7 -3
- package/dist/package.json +4 -1
- package/dist/src/cli/arguments.d.mts +1 -0
- package/dist/src/cli/arguments.mjs +5 -0
- package/dist/src/cli/basic_command_handlers.mjs +6 -0
- package/dist/src/cli/cli_commands.mjs +2 -0
- package/dist/src/cli/editor_command_handlers.mjs +24 -0
- package/dist/src/cli/project_commands.d.mts +8 -0
- package/dist/src/cli/runtime_commands.d.mts +2 -19
- package/dist/src/cli/runtime_commands.mjs +3 -90
- package/dist/src/cli/runtime_stack_runner.d.mts +41 -0
- package/dist/src/cli/runtime_stack_runner.mjs +104 -0
- package/dist/src/cli/runtime_workload_admission.d.mts +8 -0
- package/dist/src/cli/runtime_workload_admission.mjs +22 -0
- package/dist/src/cli/source_commands.d.mts +8 -0
- package/dist/src/cli/workload_command_handlers.d.mts +2 -0
- package/dist/src/cli/workload_command_handlers.mjs +38 -0
- package/dist/src/project/configuration_contract.d.mts +5 -0
- package/dist/src/project/configuration_normalization.d.mts +4 -0
- package/dist/src/project/configuration_resolution.d.mts +4 -0
- package/dist/src/project/configuration_resource_policy.d.mts +4 -0
- package/dist/src/project/configuration_resource_policy.mjs +20 -1
- package/dist/src/project/configuration_schema.mjs +1 -0
- package/dist/src/runtime/migration_history.d.mts +5 -1
- package/dist/src/runtime/migration_history.mjs +24 -6
- package/dist/src/runtime/migration_impact.d.mts +125 -0
- package/dist/src/runtime/migration_impact.mjs +278 -0
- package/dist/src/runtime/migration_impact_catalog.d.mts +18 -0
- package/dist/src/runtime/migration_impact_catalog.mjs +116 -0
- package/dist/src/runtime/migration_impact_plan.d.mts +47 -0
- package/dist/src/runtime/migration_impact_plan.mjs +297 -0
- package/dist/src/runtime/migration_impact_queries.d.mts +22 -0
- package/dist/src/runtime/migration_impact_queries.mjs +270 -0
- package/dist/src/runtime/migration_insights.d.mts +137 -0
- package/dist/src/runtime/migration_insights.mjs +143 -0
- package/dist/src/runtime/migration_insights_input.d.mts +13 -0
- package/dist/src/runtime/migration_insights_input.mjs +153 -0
- package/dist/src/runtime/migration_sql_lexer.d.mts +14 -0
- package/dist/src/runtime/migration_sql_lexer.mjs +204 -0
- package/dist/src/runtime/migration_sql_scan.d.mts +16 -0
- package/dist/src/runtime/migration_sql_scan.mjs +369 -0
- package/dist/src/runtime/plan.d.mts +2 -1
- package/dist/src/runtime/plan.mjs +4 -4
- package/dist/src/runtime/topology.d.mts +1 -1
- package/dist/src/runtime/topology.mjs +2 -2
- package/dist/src/runtime/workload_queue.d.mts +39 -0
- package/dist/src/runtime/workload_queue.mjs +211 -0
- package/dist/src/runtime/workload_queue_location.d.mts +1 -0
- package/dist/src/runtime/workload_queue_location.mjs +43 -0
- package/dist/src/runtime/workload_queue_store.d.mts +27 -0
- package/dist/src/runtime/workload_queue_store.mjs +182 -0
- package/dist/src/shared/cancellation.mjs +2 -0
- package/dist/src/shared/held_path_ancestry.d.mts +7 -0
- package/dist/src/shared/held_path_ancestry.mjs +110 -0
- package/dist/src/shared/operation_guard.mjs +1 -0
- package/dist/src/targets/migration_impact_runtime.d.mts +22 -0
- package/dist/src/targets/migration_impact_runtime.mjs +367 -0
- package/docs/README.md +20 -7
- package/docs/adapters.md +10 -0
- package/docs/architecture.md +84 -1
- package/docs/commands.md +189 -34
- package/docs/configuration.md +56 -6
- package/docs/getting-started.md +1 -1
- package/docs/index.md +1 -0
- package/docs/releasing.md +15 -9
- package/docs/roadmap.md +27 -6
- package/docs/runtime-lifecycle.md +10 -0
- package/docs/stability.md +4 -4
- package/docs/updating.md +73 -0
- package/docs/vscode.md +23 -17
- package/package.json +4 -1
package/docs/commands.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
Run commands from the project directory containing `rehearsal.config.mjs`. The examples
|
|
4
4
|
use `npx`, so a global install is not required.
|
|
5
5
|
|
|
6
|
+
## Participating local workloads
|
|
7
|
+
|
|
8
|
+
Core 1.3.0 and later builds advertising `rehearsalContracts.workloadQueue: 1` support
|
|
9
|
+
`npx --no-install rehearsal workloads --json`. This read-only command needs no
|
|
10
|
+
project configuration or Docker. Its version-1 `data` lists lifecycle ticket IDs,
|
|
11
|
+
commands, PIDs, phases (`choosing`, `queued`, `held`), owner liveness and creation
|
|
12
|
+
times. It reports `capacity: "not-measured"`: this is cooperative admission, not
|
|
13
|
+
a claim about spare host/VM memory. Project paths, migration SQL and credentials
|
|
14
|
+
are not included. Enable participation with
|
|
15
|
+
[`resources.workloadQueue`](configuration.md#resource-review-policies).
|
|
16
|
+
|
|
17
|
+
A dead holder blocks new admission until explicitly reviewed. Confirm its owned
|
|
18
|
+
commands and descendants have ended before running
|
|
19
|
+
`npx --no-install rehearsal workloads recover --confirm-workloads=<recoveryDigest>`.
|
|
20
|
+
The exact inspection digest binds only the dead held records; changed records,
|
|
21
|
+
missing confirmation and live owners refuse recovery. This operation clears local
|
|
22
|
+
queue metadata only. It does not stop processes/containers or alter databases.
|
|
23
|
+
Waiting requests can be cancelled; expiry never steals a live holder. Read-only
|
|
24
|
+
inspection does not clean stale records or create state directories.
|
|
25
|
+
|
|
6
26
|
## Guided mode
|
|
7
27
|
|
|
8
28
|
For editor-style review, `npx rehearsal inspect plan --json` returns a bounded,
|
|
@@ -10,6 +30,138 @@ versioned migration history with required predecessor links, statuses, warnings,
|
|
|
10
30
|
the exact complete candidate digest. Filters never change the required ordered suffix;
|
|
11
31
|
Rehearsal does not infer SQL safety from filenames.
|
|
12
32
|
|
|
33
|
+
### Static Migration Insights
|
|
34
|
+
|
|
35
|
+
In a core build advertising `rehearsalContracts.migrationInsights: 1`, run
|
|
36
|
+
`npx --no-install rehearsal inspect insights --json` to inspect pending SQL without
|
|
37
|
+
starting an engine, connecting to a database, running application commands or changing
|
|
38
|
+
files. This additive contract, introduced in core 1.2.0, does not change
|
|
39
|
+
`inspect plan` version 1. Older releases without the capability do not provide it.
|
|
40
|
+
|
|
41
|
+
The normal version-1 command envelope contains `data.schemaVersion: 1`, the exact
|
|
42
|
+
complete `candidateSha256`, candidate count, aggregate verdict and per-target entries.
|
|
43
|
+
Each entry binds its version, filename, SHA-256 and nullable safe workspace-relative
|
|
44
|
+
path to fixed findings. Findings expose only a rule, severity, one-based line and
|
|
45
|
+
UTF-16 column, fixed summary and suggestion—never SQL snippets, object names or row
|
|
46
|
+
values. Locations identify the static construct, not the origin of a later provider
|
|
47
|
+
error. Refresh after editing; editor navigation must recheck the source hash.
|
|
48
|
+
|
|
49
|
+
Rules flag table/column removal, truncation, UPDATE/DELETE without an outer WHERE,
|
|
50
|
+
NOT NULL requirements, new constraints and recognized CASCADE clauses. Comments,
|
|
51
|
+
strings, quoted identifiers and routine bodies are not reinterpreted as executable
|
|
52
|
+
statements. CTE mutations are considered separately from the outer statement.
|
|
53
|
+
|
|
54
|
+
Verdicts are `static_warnings`, `no_detected_warning`, and `unknown`.
|
|
55
|
+
**No detected warning does not mean safe, syntactically valid or database-verified.**
|
|
56
|
+
Coverage describes recognized lexical rules only. Unsupported statements, malformed
|
|
57
|
+
lexical input, runtime-dependent plain-string escaping and bounded/truncated analysis
|
|
58
|
+
remain unknown. A file can retain a warning while its overall coverage is unknown.
|
|
59
|
+
This is not a full PostgreSQL parser or a predictor of row loss, constraint compliance,
|
|
60
|
+
locks, rollback, permissions, production performance or external effects. Use the
|
|
61
|
+
ordinary reviewed rehearsal and application proof for actual behavior.
|
|
62
|
+
|
|
63
|
+
Input is limited to 10,000 SQL files across targets, 10,000 directory entries per
|
|
64
|
+
migration directory (including non-SQL entries), 1,000 pending candidates, 2 MiB per
|
|
65
|
+
file and 16 MiB total. Lexical analysis is bounded to 20,000 tokens and depth
|
|
66
|
+
128 per file; findings are bounded to 1,000 per file and 5,000 total. Symlinks, escaping
|
|
67
|
+
paths, unsafe filenames, invalid UTF-8 and changed input refuse inspection. Exceeded
|
|
68
|
+
lexical/finding bounds produce incomplete coverage rather than a safety verdict.
|
|
69
|
+
The CLI and these essential safety warnings remain free.
|
|
70
|
+
|
|
71
|
+
### Current-sandbox data impact
|
|
72
|
+
|
|
73
|
+
A build advertising `rehearsalContracts.migrationImpact: 1` adds two free,
|
|
74
|
+
optional commands, introduced in core 1.2.0. Check the installed capability rather
|
|
75
|
+
than assuming an older release provides them. It does not change migration-plan v1,
|
|
76
|
+
static Insights, failure diagnosis, or the gates for `run` and `migrate`.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx --no-install rehearsal inspect impact --target=primary --json
|
|
80
|
+
npx --no-install rehearsal measure impact --target=primary \
|
|
81
|
+
--confirm-candidates=<whole-plan-sha256-from-the-preview> --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Both commands require an explicit configured target name, even for `primary`.
|
|
85
|
+
`inspect impact` reads the reviewed project inputs only: it does not contact a
|
|
86
|
+
database, start an engine, run SQL, apply migrations, or change files. Its preview
|
|
87
|
+
binds planned aggregate kinds to the exact whole-project candidate digest, selected
|
|
88
|
+
target, baseline generation, and each candidate filename and hash. In a multi-target
|
|
89
|
+
project, confirmation still uses the **whole-plan** digest, not the selected target's
|
|
90
|
+
digest. Editing any target's pending migrations requires a fresh preview.
|
|
91
|
+
|
|
92
|
+
`measure impact` requires that exact confirmation and an already-running, verified,
|
|
93
|
+
ownership-proven disposable local sandbox. It refuses an unavailable, stale or
|
|
94
|
+
unmanaged runtime rather than starting, repairing or resetting it. The existing
|
|
95
|
+
project-operation lock prevents a concurrent Rehearsal mutation; operation lock files
|
|
96
|
+
and bounded local activity history may be written. A bounded read-only catalog
|
|
97
|
+
preflight retains eligible relation identities. The counts then use one
|
|
98
|
+
`REPEATABLE READ READ ONLY` transaction, which is rolled back after the counts.
|
|
99
|
+
Neither command executes pending migrations or application commands.
|
|
100
|
+
Measurements use the selected local sandbox's administrative connection, not the
|
|
101
|
+
application's role. They inspect stored data, not application permissions; RLS-enabled
|
|
102
|
+
or otherwise unsupported objects remain unknown. No application grants are changed.
|
|
103
|
+
|
|
104
|
+
Before the count snapshot, Rehearsal locks eligible measured relations in a fixed
|
|
105
|
+
order with `SHARE ROW EXCLUSIVE`. These locks temporarily block writers and
|
|
106
|
+
index/statistics/schema changes on that disposable sandbox; ordinary readers can
|
|
107
|
+
continue. They use the same 1-second lock wait and remaining total budget. Name
|
|
108
|
+
lookup also holds a bounded `SHARE` lock on the selected database's namespace
|
|
109
|
+
catalog to prevent concurrent schema renames; this temporarily blocks schema
|
|
110
|
+
catalog changes across that database and requires sufficient local privileges.
|
|
111
|
+
A relation name swapped to a view between preflight and locking may transiently lock that view's
|
|
112
|
+
dependencies inside the selected sandbox, but the retained-identity/type check
|
|
113
|
+
refuses its counts without executing the view query. This is not atomic name
|
|
114
|
+
resolution or protection against a compromised PostgreSQL server/catalog.
|
|
115
|
+
See PostgreSQL's [locking behavior](https://www.postgresql.org/docs/17/sql-lock.html).
|
|
116
|
+
|
|
117
|
+
The narrow recognizer supports simple, schema-qualified, unquoted SQL forms for:
|
|
118
|
+
|
|
119
|
+
| Recognized change | Aggregate on the current sandbox |
|
|
120
|
+
| --------------------------------------------------------------- | ------------------------------------------------------- |
|
|
121
|
+
| Drop a table, truncate one table, or delete without a predicate | Row count |
|
|
122
|
+
| Drop one column | Rows whose current column is not NULL |
|
|
123
|
+
| Set one column NOT NULL | Rows whose current column is NULL |
|
|
124
|
+
| Add a simple UNIQUE constraint | Rows in non-NULL duplicate groups, not only excess rows |
|
|
125
|
+
| Add a simple FOREIGN KEY with MATCH SIMPLE semantics | Non-NULL referencing rows with no match |
|
|
126
|
+
|
|
127
|
+
Measurements require PostgreSQL 17 or newer with server-side transaction deadlines,
|
|
128
|
+
ordinary non-inherited, non-partitioned heap tables without RLS, and supported built-in
|
|
129
|
+
column/operator semantics. Older or unsupported server semantics remain unknown;
|
|
130
|
+
Rehearsal never upgrades a database to obtain counts. Quoted identifiers, CHECK constraints,
|
|
131
|
+
UPDATE, predicates, CASCADE, expressions, routines, custom types/operators and other
|
|
132
|
+
unsupported forms remain unknown. The recognizer is not a PostgreSQL parser. A table
|
|
133
|
+
created or a column changed by an earlier pending migration is **not** simulated: all
|
|
134
|
+
counts describe the same current snapshot before any pending migration. Row counts
|
|
135
|
+
do not measure cascade, trigger or external effects, prove constraint validity, or
|
|
136
|
+
predict production locking, performance, data loss or safety.
|
|
137
|
+
|
|
138
|
+
The version-1 result includes the exact candidate/target bindings, `mode`
|
|
139
|
+
(`preview` or `measurement`), `measurementStatus`, nullable snapshot time and runtime
|
|
140
|
+
identity hash, per-file coverage/unknown reasons, and fixed operation/metric kinds
|
|
141
|
+
with lexical locations. Public counts are decimal **strings**, including `"0"`;
|
|
142
|
+
`null` means unavailable, never zero. No SQL, database object names or row contents
|
|
143
|
+
are returned. `planned` preview status may contain unsupported input and is not
|
|
144
|
+
measurement evidence. Measurement status is `measured`, `partial`, `unknown`, or
|
|
145
|
+
`not_required`. Partial or unknown measurement returns envelope `status: "not_ready"`
|
|
146
|
+
and exit `1`, retaining only the available evidence; neither a successful envelope
|
|
147
|
+
nor zero counts is a safety verdict.
|
|
148
|
+
|
|
149
|
+
The same bounded migration-input rules as static Insights apply. A review plans at
|
|
150
|
+
most 100 aggregates. Measurement uses a 1-second lock timeout, 5-second statement
|
|
151
|
+
timeout, 30-second total budget, 128 KiB output limit and 256 KiB generated-script
|
|
152
|
+
limit. The server transaction budget is reduced after runtime identity checks and
|
|
153
|
+
catalog preflight; it is never increased to compensate for a slow check.
|
|
154
|
+
Lock/statement/budget failures remain unknown instead of returning guessed counts.
|
|
155
|
+
Client cancellation is not by itself proof of immediate server-backend termination;
|
|
156
|
+
server-side deadlines additionally bound owned query/transaction lifetime.
|
|
157
|
+
Package-owned cancellation supports the ordinary cancellation signals,
|
|
158
|
+
releases the project lock and returns exit `130`; it does not reset or discard data.
|
|
159
|
+
Older editor versions may refuse the new `measure impact` operation kind in current
|
|
160
|
+
activity or retained history. This source command does not itself update the editor;
|
|
161
|
+
use the CLI until a compatible editor consumer is released.
|
|
162
|
+
Continue to use the normal reviewed rehearsal and application proof for actual
|
|
163
|
+
migration behavior.
|
|
164
|
+
|
|
13
165
|
`npx rehearsal configuration --json` identifies the exact active config, its source
|
|
14
166
|
fingerprint, validated field metadata, and saved named profiles. To validate an edit
|
|
15
167
|
without writing it, use `npx rehearsal configuration review --proposal=review.json --json`.
|
|
@@ -132,20 +284,22 @@ obsolete placeholder key.
|
|
|
132
284
|
|
|
133
285
|
## Check and inspect
|
|
134
286
|
|
|
135
|
-
| Command
|
|
136
|
-
|
|
|
137
|
-
| `npx rehearsal doctor`
|
|
138
|
-
| `npx rehearsal discover`
|
|
139
|
-
| `npx rehearsal support`
|
|
140
|
-
| `npx rehearsal activity`
|
|
141
|
-
| `npx rehearsal environments`
|
|
142
|
-
| `npx rehearsal resources`
|
|
143
|
-
| `npx rehearsal explain`
|
|
144
|
-
| `npx rehearsal run --dry-run`
|
|
145
|
-
| `npx rehearsal candidates`
|
|
146
|
-
| `npx rehearsal inspect baseline`
|
|
147
|
-
| `npx rehearsal inspect migrations`
|
|
148
|
-
| `npx rehearsal
|
|
287
|
+
| Command | What it does |
|
|
288
|
+
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
289
|
+
| `npx rehearsal doctor` | Check dependencies, inputs, and safety rules. |
|
|
290
|
+
| `npx rehearsal discover` | Explain detected facts, suggestions, and decisions. |
|
|
291
|
+
| `npx rehearsal support` | Print a privacy-safe report for a support request. |
|
|
292
|
+
| `npx rehearsal activity` | Report whether another Rehearsal operation is active. |
|
|
293
|
+
| `npx rehearsal environments` | Show owned runtimes, live resource use, and Docker capacity. |
|
|
294
|
+
| `npx rehearsal resources` | Browse images, volumes, container references, and cleanup explanations. |
|
|
295
|
+
| `npx rehearsal explain` | Show the exact plan without changing anything. |
|
|
296
|
+
| `npx rehearsal run --dry-run` | Show the same non-mutating plan. |
|
|
297
|
+
| `npx rehearsal candidates` | List pending migrations and their approval digest. |
|
|
298
|
+
| `npx rehearsal inspect baseline` | Show active and retained baseline metadata without row values. |
|
|
299
|
+
| `npx rehearsal inspect migrations` | Classify every historical and candidate migration. |
|
|
300
|
+
| `npx rehearsal inspect impact --target=<name>` | Preview exact aggregate kinds without contacting a database. |
|
|
301
|
+
| `npx rehearsal measure impact --target=<name> --confirm-candidates=<sha256>` | Read bounded aggregates from that current verified sandbox. |
|
|
302
|
+
| `npx rehearsal status` | Report baseline, candidates, and local runtime state. |
|
|
149
303
|
|
|
150
304
|
State-reporting commands accept `--json` for scripts. Scripts should use the JSON fields
|
|
151
305
|
and process exit code, not parse human-facing text.
|
|
@@ -359,7 +513,7 @@ Clients should disable conflicting actions unless the state is `idle`.
|
|
|
359
513
|
|
|
360
514
|
### Cancelling a mutation
|
|
361
515
|
|
|
362
|
-
`run`, `reset`, `migrate`, confirmed `refresh`, and direct or guided `open` preparation support
|
|
516
|
+
`run`, `reset`, `migrate`, `measure impact`, confirmed `refresh`, and direct or guided `open` preparation support
|
|
363
517
|
package-owned cancellation.
|
|
364
518
|
Send `SIGINT`, `SIGTERM`, `SIGHUP`, or `SIGTSTP` to the Rehearsal CLI process. Rehearsal
|
|
365
519
|
handles repeated delivery as one request, forwards it only to the detached process group
|
|
@@ -472,25 +626,26 @@ belonging to other projects are never included. This follows
|
|
|
472
626
|
|
|
473
627
|
## Common options
|
|
474
628
|
|
|
475
|
-
| Option | Meaning
|
|
476
|
-
| -------------------------------------- |
|
|
477
|
-
| `--help`, `-h` | Show the installed command reference.
|
|
478
|
-
| `--version`, `-V` | Print the installed package version and exit.
|
|
479
|
-
| `--json` | Return the versioned machine-readable result.
|
|
480
|
-
| `--verbose` | Show more safe detail.
|
|
481
|
-
| `--debug` | Show the most diagnostic detail; still review it before sharing.
|
|
482
|
-
| `--plain` | Disable decorative interactive prompts.
|
|
483
|
-
| `--config=<path>` | Use only this config for planning and every runtime action.
|
|
484
|
-
| `--target
|
|
485
|
-
| `--
|
|
486
|
-
| `--include-
|
|
487
|
-
| `--
|
|
488
|
-
| `--confirm-
|
|
489
|
-
| `--confirm-source-
|
|
490
|
-
| `--confirm-
|
|
491
|
-
| `--
|
|
492
|
-
| `--
|
|
493
|
-
| `--
|
|
629
|
+
| Option | Meaning |
|
|
630
|
+
| -------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
631
|
+
| `--help`, `-h` | Show the installed command reference. |
|
|
632
|
+
| `--version`, `-V` | Print the installed package version and exit. |
|
|
633
|
+
| `--json` | Return the versioned machine-readable result. |
|
|
634
|
+
| `--verbose` | Show more safe detail. |
|
|
635
|
+
| `--debug` | Show the most diagnostic detail; still review it before sharing. |
|
|
636
|
+
| `--plain` | Disable decorative interactive prompts. |
|
|
637
|
+
| `--config=<path>` | Use only this config for planning and every runtime action. |
|
|
638
|
+
| `--target=<name>` | Choose a setup provider or configured runtime target; impact commands require an explicit name. |
|
|
639
|
+
| `--confirm-candidates=<digest>` | Confirm the exact whole-plan candidates for run, migrate or impact measurement. |
|
|
640
|
+
| `--include-runtime` | Include this project's runtime in a cleanup preview. |
|
|
641
|
+
| `--include-images` | Include older unused Supabase images in a cleanup preview. |
|
|
642
|
+
| `--confirm-cleanup=<digest>` | Confirm the exact cleanup set printed by the preview. |
|
|
643
|
+
| `--confirm-source-access=<digest>` | Confirm one exact temporary source-access plan. |
|
|
644
|
+
| `--confirm-source-retirement=<digest>` | Confirm exact source-access retirement. |
|
|
645
|
+
| `--confirm-refresh=<digest>` | Confirm an exact refresh, runtime reset, and old-copy removal. |
|
|
646
|
+
| `--identity=<name>` | Choose one declared local identity association. |
|
|
647
|
+
| `--confirm-identity=<digest>` | Confirm that exact local identity plan. |
|
|
648
|
+
| `--write` | Apply a setup, policy, or cleanup preview. |
|
|
494
649
|
|
|
495
650
|
Run `npx rehearsal --help` to print the command list available in your installed version.
|
|
496
651
|
Run `npx rehearsal --version` to print only its version number. Add `--json` when a
|
package/docs/configuration.md
CHANGED
|
@@ -289,11 +289,29 @@ Colima. It warns at `diskWarningPercent` and refuses to start below
|
|
|
289
289
|
generated PostgreSQL configs reserve 2 GiB. Engines that do not expose a portable disk
|
|
290
290
|
measurement continue normally and report capacity as unavailable in `environments`.
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
292
|
+
Choose the smallest reviewed environment that supplies the proof's dependencies:
|
|
293
|
+
|
|
294
|
+
| Proof needs | Select | Retained dependencies and boundary |
|
|
295
|
+
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
296
|
+
| SQL migrations, schema, triggers, or sanitized relational data | `runtime.target: "postgresql"` | One PostgreSQL container; no native Supabase Auth, Storage, or Data API. |
|
|
297
|
+
| Supabase Auth, Storage, or Data API behavior | `runtime.target: "supabase"` with `supabase.serviceProfile: "application"` (the default) | Keep database, Auth, Storage, PostgREST, gateway, and local mail together. Direct SQL alone does not prove these application-facing paths. |
|
|
298
|
+
| Studio, Realtime, Edge Functions, analytics, or image transforms | Supabase with `serviceProfile: "full"` | Remove Rehearsal's exclusions, retain the application dependencies, and explicitly enable the needed services in the reviewed TOML. |
|
|
299
|
+
|
|
300
|
+
The application profile omits Studio, Realtime, Edge Functions, analytics, Vector, and
|
|
301
|
+
image transforms. These are reviewed bundles, not permission to trim individual services
|
|
302
|
+
with ad hoc CLI flags. Declare what the proof uses through
|
|
303
|
+
[`application.requiredServices`](#required-application-services); a conflicting profile
|
|
304
|
+
or disabled required service refuses before startup. Profile selection does not change
|
|
305
|
+
data retention, shared-engine ownership, or supported-platform boundaries.
|
|
306
|
+
|
|
307
|
+
Compare resource measurements only for the same exact package, fixture, engine, and
|
|
308
|
+
hardware. Test Lab's fresh-container startup measurement includes provisioning, health
|
|
309
|
+
checks, and baseline restoration on an already-running engine; record whether images
|
|
310
|
+
were cached. It does not measure VM boot or uncached-image downloads. Owned-container CPU/memory
|
|
311
|
+
samples are not host/VM memory reservations or an application-load soak test. Keep these
|
|
312
|
+
limits with the results rather than comparing mixed-version samples as an optimization.
|
|
313
|
+
Do not prune shared images or restart another project's engine to obtain a benchmark.
|
|
314
|
+
See [resource inspection](runtime-lifecycle.md#diagnosing-unexpected-activity).
|
|
297
315
|
|
|
298
316
|
After each Supabase start, Rehearsal changes only the exact target's containers to
|
|
299
317
|
Docker's `no` restart policy. Its database and Storage volumes remain intact,
|
|
@@ -368,7 +386,8 @@ inspection remain explicit command choices. See [CLI commands](commands.md).
|
|
|
368
386
|
|
|
369
387
|
### Resource review policies
|
|
370
388
|
|
|
371
|
-
|
|
389
|
+
Resource review limits apply to the configured project topology, not the shared Docker
|
|
390
|
+
engine. The optional workload queue instead coordinates participating local projects:
|
|
372
391
|
|
|
373
392
|
```ts
|
|
374
393
|
resources: {
|
|
@@ -376,6 +395,7 @@ resources: {
|
|
|
376
395
|
retainedEnvironmentCount: 2,
|
|
377
396
|
maximumBytes: null,
|
|
378
397
|
cleanupSchedule: "daily-preview",
|
|
398
|
+
workloadQueue: { enabled: true, waitTimeoutSeconds: 30 },
|
|
379
399
|
},
|
|
380
400
|
```
|
|
381
401
|
|
|
@@ -392,6 +412,36 @@ resources: {
|
|
|
392
412
|
shown on the next resource inspection. There is no daemon, operating-system scheduler,
|
|
393
413
|
or automatic deletion. An approved cleanup records an owner-only, project/policy-bound
|
|
394
414
|
review time; ordinary read-only inspection writes nothing.
|
|
415
|
+
- `workloadQueue` is optional and off when omitted. With `enabled: true`, participating
|
|
416
|
+
Rehearsal clients serialize their `start`, `reset`, `run` and `migrate` runtime phases
|
|
417
|
+
across projects for the same local OS user, boot and process namespace. Waiting is
|
|
418
|
+
bounded to `waitTimeoutSeconds` (integer 0–300; default 30); zero refuses immediately
|
|
419
|
+
when busy. Ctrl+C cancels the waiting request without interrupting its holder.
|
|
420
|
+
Stop, discard, inspection and cleanup remain available. `open` releases admission
|
|
421
|
+
after startup, before its interactive session; application proofs run outside this
|
|
422
|
+
first lifecycle-only queue. This does **not** measure available RAM, stop existing
|
|
423
|
+
runtimes, limit other tools, or promise an entire Docker/VM memory budget. All projects
|
|
424
|
+
that should cooperate must opt in. Older clients and different OS users/namespaces do
|
|
425
|
+
not participate. Local filesystems with coherent atomic file operations are required;
|
|
426
|
+
this is not a network-filesystem or distributed scheduler.
|
|
427
|
+
Configure it in the source configuration for now; the existing editor field-metadata
|
|
428
|
+
contract is unchanged so older supported Starter clients keep working.
|
|
429
|
+
|
|
430
|
+
Run `rehearsal workloads` (or `--json`) without Docker to inspect this queue. Waiting
|
|
431
|
+
requests whose processes have died can be removed automatically because guarded work
|
|
432
|
+
never began. A dead **holder** remains blocking: its child may still be running.
|
|
433
|
+
After checking its owned commands and descendants, use the exact digest shown by
|
|
434
|
+
inspection with `rehearsal workloads recover --confirm-workloads=<digest>`. Recovery
|
|
435
|
+
removes only those reviewed dead-holder metadata records. It never kills a process,
|
|
436
|
+
stops a container, removes data or treats age alone as permission to steal admission.
|
|
437
|
+
Live owners cannot be recovered, even after a wait expires. Malformed or inaccessible
|
|
438
|
+
state refuses admission; it is not silently deleted.
|
|
439
|
+
|
|
440
|
+
Queue state is private to the local OS user under `~/Library/Application Support/Rehearsal`
|
|
441
|
+
on macOS or `~/.local/state/rehearsal` on Linux/WSL, independent of `TMPDIR`. Advanced
|
|
442
|
+
launchers can set `REHEARSAL_USER_STATE_DIRECTORY` to one absolute local directory;
|
|
443
|
+
every cooperating client must use the same value. Do not delete or move active queue
|
|
444
|
+
state. Boot/namespace-separated records are retained, not automatically pruned.
|
|
395
445
|
|
|
396
446
|
Temporary files and application processes created by an operation are cleaned up by
|
|
397
447
|
that operation's existing ownership boundary. These policies do not turn a persistent
|
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 22, 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.
|
|
18
|
+
before choosing an install option. The helper's exact target 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/index.md
CHANGED
|
@@ -33,6 +33,7 @@ you want, then follow the links when a term or safety check is new.
|
|
|
33
33
|
| Set up my own project | [Getting started](getting-started.md) |
|
|
34
34
|
| Use the free visual workbench in VS Code | [Install VS Code Starter](vscode.md) |
|
|
35
35
|
| Try Rehearsal without touching my app | [Hands-on tutorial](tutorial.md) |
|
|
36
|
+
| Check changes, compatibility or updates | [Releases and updates](updating.md) |
|
|
36
37
|
| Understand what makes a copy safe | [Baselines](baselines.md) and [Sanitization](sanitization.md) |
|
|
37
38
|
| Look up a command or setting | [CLI commands](commands.md) and [Configuration](configuration.md) |
|
|
38
39
|
| Reduce Docker and Supabase resource use | [Container runtime lifecycle](runtime-lifecycle.md) |
|
package/docs/releasing.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Maintainers: publishing Rehearsal
|
|
2
|
+
|
|
3
|
+
**Audience: Rehearsal maintainers publishing a release.** To install or update
|
|
4
|
+
Rehearsal in your own project, use [Releases and updates](updating.md).
|
|
5
|
+
The publisher controls below are not steps that ordinary users need to perform.
|
|
2
6
|
|
|
3
7
|
This page defines required release controls, not a certification that a publisher is
|
|
4
8
|
currently ready. Verify the live repository, trusted-publisher identity and approval
|
|
@@ -15,9 +19,9 @@ back to a token or disable provenance. The release preflight described below enf
|
|
|
15
19
|
that refusal; an actual held approval and the npm account settings still need direct
|
|
16
20
|
verification. A local working tree is never the release source.
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
This runbook describes the current controls. Historical candidates and release incidents
|
|
23
|
+
belong in [release history](https://github.com/Ddupasquier/rehearsal-db/releases) and
|
|
24
|
+
[issues](https://github.com/Ddupasquier/rehearsal-db/issues), not the installation path.
|
|
21
25
|
|
|
22
26
|
## Trusted publication boundary
|
|
23
27
|
|
|
@@ -37,11 +41,9 @@ private therefore cannot preserve this release contract unchanged. Keep the revi
|
|
|
37
41
|
release source public; never silently remove provenance. See
|
|
38
42
|
[npm's trusted-publisher guidance](https://docs.npmjs.com/trusted-publishers/).
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
GitHub environment after publication, must remain revoked at npm, and cannot be consumed
|
|
44
|
-
by this workflow.
|
|
44
|
+
Bootstrap credentials are not part of the maintained release architecture. Any historical
|
|
45
|
+
bootstrap credential must remain removed from GitHub and revoked at npm; this workflow
|
|
46
|
+
cannot consume it. Do not replace a failing trusted publisher with a stored token.
|
|
45
47
|
|
|
46
48
|
A failed candidate does not permit moving or deleting its release tag. If its pinned
|
|
47
49
|
workflow needs a source correction, prepare a new version and artifact through the same
|
|
@@ -131,6 +133,10 @@ release-source migration.
|
|
|
131
133
|
|
|
132
134
|
1. Start from protected `main` on a dedicated ticketed release branch.
|
|
133
135
|
2. Verify the exact version, changelog, compatibility notes, and packed file list.
|
|
136
|
+
Reconcile the core, VS Code extension and Test Lab READMEs and affected guides with
|
|
137
|
+
their actual published versions and contracts. Keep candidate availability explicit,
|
|
138
|
+
link to the owning installation/update guide instead of duplicating version lists,
|
|
139
|
+
and retain dated historical evidence without presenting it as current acceptance.
|
|
134
140
|
3. Run `npm run release:verify`. It performs the package checks and every
|
|
135
141
|
installed-consumer scenario against one tarball, then records the exact package
|
|
136
142
|
version, SHA-256, environment, commands, timings, and results in
|
package/docs/roadmap.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# Next steps
|
|
2
2
|
|
|
3
|
-
Rehearsal core
|
|
4
|
-
[npm](https://www.npmjs.com/package/@rehearsal-db/core)
|
|
5
|
-
ordinary PostgreSQL migration rehearsals. The [free VS Code Starter
|
|
6
|
-
adds a visual workbench
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Rehearsal core is available on
|
|
4
|
+
[npm](https://www.npmjs.com/package/@rehearsal-db/core) for guided Supabase and
|
|
5
|
+
ordinary PostgreSQL migration rehearsals. The [free VS Code Starter preview](vscode.md)
|
|
6
|
+
adds a visual workbench through Marketplace and reviewed GitHub VSIX releases.
|
|
7
|
+
[Releases and updates](updating.md) explains how to find and install the published
|
|
8
|
+
versions; a roadmap or source version is not a publication claim. Neither requires
|
|
9
|
+
a purchase or account. Core is MIT-licensed; all features included in Starter are
|
|
10
|
+
free indefinitely for personal or commercial development.
|
|
9
11
|
|
|
10
12
|
Stable core, the editor preview and a future paid Pro offer have separate completion
|
|
11
13
|
boundaries. A downloadable preview does not imply that every native accessibility,
|
|
@@ -61,6 +63,25 @@ release or consumer upgrade remains unfinished:
|
|
|
61
63
|
- Remove consumer integration code only after its replacement passes and that deletion
|
|
62
64
|
is separately approved.
|
|
63
65
|
|
|
66
|
+
## Efficient local execution and optional managed runs
|
|
67
|
+
|
|
68
|
+
Efficient local profiles, data-preserving lifecycle controls, essential safety and the
|
|
69
|
+
complete CLI stay free. Resource improvements must preserve the services and representative
|
|
70
|
+
data needed to prove the chosen scenario; a database-only pass is not full application
|
|
71
|
+
acceptance. See [choosing a local profile](runtime-lifecycle.md#choosing-postgresql-or-supabase).
|
|
72
|
+
|
|
73
|
+
Optional managed execution is the paid-service direction: run demanding rehearsals
|
|
74
|
+
without a local database stack. It is not currently available. Its design must establish
|
|
75
|
+
explicit upload consent, isolated execution, credential and retention boundaries,
|
|
76
|
+
verifiable cleanup and bounded costs before a hosted launch. Sanitization does not
|
|
77
|
+
automatically authorize uploading a baseline. Pricing and commercial terms remain separate.
|
|
78
|
+
|
|
79
|
+
The [resource-efficiency initiative](https://github.com/Ddupasquier/rehearsal-db/issues/208)
|
|
80
|
+
coordinates existing lifecycle work and bounded remote/native feasibility. Experimental
|
|
81
|
+
upstream native runtimes are not a supported Rehearsal replacement merely because they
|
|
82
|
+
can omit Docker. Moving an application's production host does not itself reduce the
|
|
83
|
+
services a local rehearsal needs.
|
|
84
|
+
|
|
64
85
|
## Later database targets
|
|
65
86
|
|
|
66
87
|
Additional database, runtime, identity-provider and migration-tool integrations require
|
|
@@ -191,6 +191,16 @@ These observations help compare profiles, not promise a machine-wide memory budg
|
|
|
191
191
|
A cold-image or fresh-VM benchmark needs its own disposable, exclusive test environment.
|
|
192
192
|
Do not prune shared images or restart a shared engine to manufacture a cold measurement.
|
|
193
193
|
|
|
194
|
+
### Free local efficiency and planned managed execution
|
|
195
|
+
|
|
196
|
+
Efficient local profiles, the complete CLI and essential lifecycle/data protections stay
|
|
197
|
+
free. Choose the smallest profile that still proves the requested behavior; Rehearsal
|
|
198
|
+
does not silently remove declared Auth, Storage or API dependencies to save memory.
|
|
199
|
+
|
|
200
|
+
Optional managed execution is planned separately and is not available in this release.
|
|
201
|
+
Choosing a local profile does not upload data or authorize a hosted operation. See the
|
|
202
|
+
[product direction](roadmap.md#efficient-local-execution-and-optional-managed-runs).
|
|
203
|
+
|
|
194
204
|
## Scheduled review and stale-stop safety
|
|
195
205
|
|
|
196
206
|
Resource policies configure advisory retention, measured-volume budgets, and scheduled
|
package/docs/stability.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Stability and release verification
|
|
2
2
|
|
|
3
|
-
Rehearsal core
|
|
4
|
-
[npm](https://www.npmjs.com/package/@rehearsal-db/core). This page defines
|
|
3
|
+
Stable Rehearsal core releases are available on
|
|
4
|
+
[npm](https://www.npmjs.com/package/@rehearsal-db/core). This page defines the
|
|
5
5
|
compatibility promise and the verification policy for releases; it is not an
|
|
6
6
|
unfinished launch checklist. Stable core does not require every planned database,
|
|
7
7
|
editor interface, or paid feature.
|
|
8
8
|
|
|
9
9
|
The compatibility promise began with **1.0.0**. The separate
|
|
10
|
-
[VS Code Starter
|
|
10
|
+
[VS Code Starter preview](vscode.md) has its own editor acceptance and does
|
|
11
11
|
not turn a core release into a completed accessibility or provider walkthrough.
|
|
12
12
|
|
|
13
13
|
## What becomes a compatibility promise
|
|
@@ -98,7 +98,7 @@ baseline. Automatic compatible updates do not cross the 0.x-to-1.x version bound
|
|
|
98
98
|
review the changelog and deliberately select the stable version:
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
npm install --save-dev --save-exact @rehearsal-db/core@1.
|
|
101
|
+
npm install --save-dev --save-exact @rehearsal-db/core@1.3.0
|
|
102
102
|
npx --no-install rehearsal --version
|
|
103
103
|
npx --no-install rehearsal doctor
|
|
104
104
|
```
|
package/docs/updating.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Releases and updates
|
|
2
|
+
|
|
3
|
+
The CLI and VS Code extension update separately. Their version numbers do not need to
|
|
4
|
+
match. Updating a package does not run migrations or reset your database.
|
|
5
|
+
|
|
6
|
+
## What changed?
|
|
7
|
+
|
|
8
|
+
Read the [CLI release notes](https://github.com/Ddupasquier/rehearsal-db/releases) or
|
|
9
|
+
[extension release notes](https://github.com/Ddupasquier/rehearsal-vscode/releases)
|
|
10
|
+
for the version you plan to install. Each component has its own release history.
|
|
11
|
+
|
|
12
|
+
## Is my environment supported?
|
|
13
|
+
|
|
14
|
+
Rehearsal supports Node.js 22, 24 and 26 on macOS and Linux. On Windows, run database
|
|
15
|
+
commands in a WSL 2 Linux workspace; native PowerShell and Command Prompt are not
|
|
16
|
+
supported database runtimes. The WSL route remains a preview, not a claim of native
|
|
17
|
+
Windows database support. See [supported environments and limitations](https://github.com/Ddupasquier/rehearsal-db/blob/main/COMPATIBILITY.md)
|
|
18
|
+
and the [Windows setup guide](getting-started.md#windows-use-a-wsl-2-linux-workspace)
|
|
19
|
+
before installing.
|
|
20
|
+
|
|
21
|
+
## How do I update?
|
|
22
|
+
|
|
23
|
+
### VS Code extension
|
|
24
|
+
|
|
25
|
+
Open **Extensions**, find **Rehearsal DB** (`rehearsal-db.rehearsal-db`), and choose
|
|
26
|
+
**Update** when available. Save your work and reload only when you are ready, if VS Code
|
|
27
|
+
asks. For a direct download, follow the [verified VSIX instructions](vscode.md#direct-github-installation).
|
|
28
|
+
|
|
29
|
+
Prefer automatic updates? Open **Rehearsal: Check for Updates** and save the extension
|
|
30
|
+
and/or CLI options you want. They are independent, initially off, and can be disabled
|
|
31
|
+
later. An unavailable network, busy project or incompatible update may defer installation.
|
|
32
|
+
See [automatic updates](vscode.md#optional-automatic-updates) for consent and privacy details.
|
|
33
|
+
|
|
34
|
+
Using the legacy preview through 0.1.18? Follow the [one-time identity migration](vscode.md#move-from-a-preview-through-0118)
|
|
35
|
+
instead of installing both extension identities together.
|
|
36
|
+
|
|
37
|
+
### Project CLI package
|
|
38
|
+
|
|
39
|
+
Finish active Rehearsal commands first. Read the [release notes](https://github.com/Ddupasquier/rehearsal-db/releases),
|
|
40
|
+
then use your project's existing package manager and dependency location. For an npm
|
|
41
|
+
project that keeps Rehearsal in development dependencies, update to the reviewed 1.3.0
|
|
42
|
+
release only after it appears in the official registry:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install --save-dev --save-exact @rehearsal-db/core@1.3.0
|
|
46
|
+
npx --no-install rehearsal --version
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Review the package and lockfile changes before the next Rehearsal command.
|
|
50
|
+
|
|
51
|
+
## Breaking changes or known limitations?
|
|
52
|
+
|
|
53
|
+
Check the target release notes before upgrading. Breaking upgrades, the move from a
|
|
54
|
+
0.x preview to stable core, and local source/tarball installations need deliberate
|
|
55
|
+
review rather than an automatic switch. See the [compatibility promise](stability.md#what-becomes-a-compatibility-promise)
|
|
56
|
+
or [troubleshooting](troubleshooting.md) when an update is refused.
|
|
57
|
+
|
|
58
|
+
Do not delete keys, baselines or sandbox data to update. Updating does not authorize
|
|
59
|
+
production access or make an unsupported database or platform supported. Keep the
|
|
60
|
+
[data-safety boundaries](security-model.md) and explicit reset/discard warnings in
|
|
61
|
+
force; a successful rehearsal is not a guarantee that deployment is safe.
|
|
62
|
+
|
|
63
|
+
## Where can I verify the package's origin?
|
|
64
|
+
|
|
65
|
+
Use the official [npm package](https://www.npmjs.com/package/@rehearsal-db/core),
|
|
66
|
+
[VS Code Marketplace listing](https://marketplace.visualstudio.com/items?itemName=rehearsal-db.rehearsal-db)
|
|
67
|
+
or linked GitHub releases. npm provenance links the CLI package to its public release
|
|
68
|
+
source and build. For a direct VSIX download, follow the [SHA-256 verification steps](vscode.md#direct-github-installation).
|
|
69
|
+
Origin verification does not replace reviewing a release's compatibility or safety limits.
|
|
70
|
+
|
|
71
|
+
You do not need publisher credentials, GitHub deployment approvals or the maintainer
|
|
72
|
+
release checklist to install or update Rehearsal. Those belong to the
|
|
73
|
+
[maintainer publishing guide](releasing.md).
|