@rehearsal-db/core 1.0.2 → 1.2.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 +56 -4
- package/COMPATIBILITY.md +41 -4
- package/README.md +8 -4
- package/dist/package.json +3 -1
- package/dist/src/cli/arguments.mjs +1 -0
- package/dist/src/cli/basic_command_handlers.mjs +4 -0
- package/dist/src/cli/editor_command_handlers.mjs +24 -0
- package/dist/src/project/configuration_contract.d.mts +1 -0
- package/dist/src/project/configuration_normalization.mjs +2 -1
- package/dist/src/project/configuration_rendering.mjs +3 -2
- package/dist/src/project/configuration_resolution.mjs +0 -2
- package/dist/src/project/project_detection.d.mts +2 -0
- package/dist/src/project/project_detection.mjs +1 -0
- package/dist/src/project/runtime_project_identity.d.mts +5 -0
- package/dist/src/project/runtime_project_identity.mjs +41 -0
- package/dist/src/project/setup.mjs +3 -1
- 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/policy.d.mts +2 -0
- package/dist/src/runtime/policy.mjs +13 -1
- package/dist/src/runtime/privileges.d.mts +25 -0
- package/dist/src/runtime/privileges.mjs +198 -0
- package/dist/src/runtime/topology.d.mts +1 -1
- package/dist/src/runtime/topology.mjs +2 -2
- package/dist/src/shared/cancellation.mjs +1 -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/dist/src/targets/supabase.mjs +1 -0
- package/docs/README.md +20 -7
- package/docs/adapters.md +10 -0
- package/docs/architecture.md +75 -1
- package/docs/commands.md +169 -34
- package/docs/configuration.md +42 -9
- package/docs/getting-started.md +4 -4
- package/docs/index.md +1 -0
- package/docs/releasing.md +15 -11
- package/docs/roadmap.md +49 -9
- package/docs/runtime-lifecycle.md +15 -4
- package/docs/runtime-policies.md +145 -0
- package/docs/stability.md +8 -4
- package/docs/updating.md +73 -0
- package/docs/vscode.md +30 -19
- package/package.json +3 -1
package/docs/commands.md
CHANGED
|
@@ -10,6 +10,138 @@ versioned migration history with required predecessor links, statuses, warnings,
|
|
|
10
10
|
the exact complete candidate digest. Filters never change the required ordered suffix;
|
|
11
11
|
Rehearsal does not infer SQL safety from filenames.
|
|
12
12
|
|
|
13
|
+
### Static Migration Insights
|
|
14
|
+
|
|
15
|
+
In a core build advertising `rehearsalContracts.migrationInsights: 1`, run
|
|
16
|
+
`npx --no-install rehearsal inspect insights --json` to inspect pending SQL without
|
|
17
|
+
starting an engine, connecting to a database, running application commands or changing
|
|
18
|
+
files. This additive contract does not change `inspect plan` version 1. It is new
|
|
19
|
+
development work, not a capability of the original tested core 1.1.0 candidate.
|
|
20
|
+
|
|
21
|
+
The normal version-1 command envelope contains `data.schemaVersion: 1`, the exact
|
|
22
|
+
complete `candidateSha256`, candidate count, aggregate verdict and per-target entries.
|
|
23
|
+
Each entry binds its version, filename, SHA-256 and nullable safe workspace-relative
|
|
24
|
+
path to fixed findings. Findings expose only a rule, severity, one-based line and
|
|
25
|
+
UTF-16 column, fixed summary and suggestion—never SQL snippets, object names or row
|
|
26
|
+
values. Locations identify the static construct, not the origin of a later provider
|
|
27
|
+
error. Refresh after editing; editor navigation must recheck the source hash.
|
|
28
|
+
|
|
29
|
+
Rules flag table/column removal, truncation, UPDATE/DELETE without an outer WHERE,
|
|
30
|
+
NOT NULL requirements, new constraints and recognized CASCADE clauses. Comments,
|
|
31
|
+
strings, quoted identifiers and routine bodies are not reinterpreted as executable
|
|
32
|
+
statements. CTE mutations are considered separately from the outer statement.
|
|
33
|
+
|
|
34
|
+
Verdicts are `static_warnings`, `no_detected_warning`, and `unknown`.
|
|
35
|
+
**No detected warning does not mean safe, syntactically valid or database-verified.**
|
|
36
|
+
Coverage describes recognized lexical rules only. Unsupported statements, malformed
|
|
37
|
+
lexical input, runtime-dependent plain-string escaping and bounded/truncated analysis
|
|
38
|
+
remain unknown. A file can retain a warning while its overall coverage is unknown.
|
|
39
|
+
This is not a full PostgreSQL parser or a predictor of row loss, constraint compliance,
|
|
40
|
+
locks, rollback, permissions, production performance or external effects. Use the
|
|
41
|
+
ordinary reviewed rehearsal and application proof for actual behavior.
|
|
42
|
+
|
|
43
|
+
Input is limited to 10,000 SQL files across targets, 10,000 directory entries per
|
|
44
|
+
migration directory (including non-SQL entries), 1,000 pending candidates, 2 MiB per
|
|
45
|
+
file and 16 MiB total. Lexical analysis is bounded to 20,000 tokens and depth
|
|
46
|
+
128 per file; findings are bounded to 1,000 per file and 5,000 total. Symlinks, escaping
|
|
47
|
+
paths, unsafe filenames, invalid UTF-8 and changed input refuse inspection. Exceeded
|
|
48
|
+
lexical/finding bounds produce incomplete coverage rather than a safety verdict.
|
|
49
|
+
The CLI and these essential safety warnings remain free.
|
|
50
|
+
|
|
51
|
+
### Current-sandbox data impact
|
|
52
|
+
|
|
53
|
+
A source build advertising `rehearsalContracts.migrationImpact: 1` adds two free,
|
|
54
|
+
optional commands. This is unpublished development work, not a capability of an
|
|
55
|
+
already-installed release. It does not change migration-plan v1, static Insights,
|
|
56
|
+
failure diagnosis, or the gates for `run` and `migrate`.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx --no-install rehearsal inspect impact --target=primary --json
|
|
60
|
+
npx --no-install rehearsal measure impact --target=primary \
|
|
61
|
+
--confirm-candidates=<whole-plan-sha256-from-the-preview> --json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Both commands require an explicit configured target name, even for `primary`.
|
|
65
|
+
`inspect impact` reads the reviewed project inputs only: it does not contact a
|
|
66
|
+
database, start an engine, run SQL, apply migrations, or change files. Its preview
|
|
67
|
+
binds planned aggregate kinds to the exact whole-project candidate digest, selected
|
|
68
|
+
target, baseline generation, and each candidate filename and hash. In a multi-target
|
|
69
|
+
project, confirmation still uses the **whole-plan** digest, not the selected target's
|
|
70
|
+
digest. Editing any target's pending migrations requires a fresh preview.
|
|
71
|
+
|
|
72
|
+
`measure impact` requires that exact confirmation and an already-running, verified,
|
|
73
|
+
ownership-proven disposable local sandbox. It refuses an unavailable, stale or
|
|
74
|
+
unmanaged runtime rather than starting, repairing or resetting it. The existing
|
|
75
|
+
project-operation lock prevents a concurrent Rehearsal mutation; operation lock files
|
|
76
|
+
and bounded local activity history may be written. A bounded read-only catalog
|
|
77
|
+
preflight retains eligible relation identities. The counts then use one
|
|
78
|
+
`REPEATABLE READ READ ONLY` transaction, which is rolled back after the counts.
|
|
79
|
+
Neither command executes pending migrations or application commands.
|
|
80
|
+
Measurements use the selected local sandbox's administrative connection, not the
|
|
81
|
+
application's role. They inspect stored data, not application permissions; RLS-enabled
|
|
82
|
+
or otherwise unsupported objects remain unknown. No application grants are changed.
|
|
83
|
+
|
|
84
|
+
Before the count snapshot, Rehearsal locks eligible measured relations in a fixed
|
|
85
|
+
order with `SHARE ROW EXCLUSIVE`. These locks temporarily block writers and
|
|
86
|
+
index/statistics/schema changes on that disposable sandbox; ordinary readers can
|
|
87
|
+
continue. They use the same 1-second lock wait and remaining total budget. Name
|
|
88
|
+
lookup also holds a bounded `SHARE` lock on the selected database's namespace
|
|
89
|
+
catalog to prevent concurrent schema renames; this temporarily blocks schema
|
|
90
|
+
catalog changes across that database and requires sufficient local privileges.
|
|
91
|
+
A relation name swapped to a view between preflight and locking may transiently lock that view's
|
|
92
|
+
dependencies inside the selected sandbox, but the retained-identity/type check
|
|
93
|
+
refuses its counts without executing the view query. This is not atomic name
|
|
94
|
+
resolution or protection against a compromised PostgreSQL server/catalog.
|
|
95
|
+
See PostgreSQL's [locking behavior](https://www.postgresql.org/docs/17/sql-lock.html).
|
|
96
|
+
|
|
97
|
+
The narrow recognizer supports simple, schema-qualified, unquoted SQL forms for:
|
|
98
|
+
|
|
99
|
+
| Recognized change | Aggregate on the current sandbox |
|
|
100
|
+
| --------------------------------------------------------------- | ------------------------------------------------------- |
|
|
101
|
+
| Drop a table, truncate one table, or delete without a predicate | Row count |
|
|
102
|
+
| Drop one column | Rows whose current column is not NULL |
|
|
103
|
+
| Set one column NOT NULL | Rows whose current column is NULL |
|
|
104
|
+
| Add a simple UNIQUE constraint | Rows in non-NULL duplicate groups, not only excess rows |
|
|
105
|
+
| Add a simple FOREIGN KEY with MATCH SIMPLE semantics | Non-NULL referencing rows with no match |
|
|
106
|
+
|
|
107
|
+
Measurements require PostgreSQL 17 or newer with server-side transaction deadlines,
|
|
108
|
+
ordinary non-inherited, non-partitioned heap tables without RLS, and supported built-in
|
|
109
|
+
column/operator semantics. Older or unsupported server semantics remain unknown;
|
|
110
|
+
Rehearsal never upgrades a database to obtain counts. Quoted identifiers, CHECK constraints,
|
|
111
|
+
UPDATE, predicates, CASCADE, expressions, routines, custom types/operators and other
|
|
112
|
+
unsupported forms remain unknown. The recognizer is not a PostgreSQL parser. A table
|
|
113
|
+
created or a column changed by an earlier pending migration is **not** simulated: all
|
|
114
|
+
counts describe the same current snapshot before any pending migration. Row counts
|
|
115
|
+
do not measure cascade, trigger or external effects, prove constraint validity, or
|
|
116
|
+
predict production locking, performance, data loss or safety.
|
|
117
|
+
|
|
118
|
+
The version-1 result includes the exact candidate/target bindings, `mode`
|
|
119
|
+
(`preview` or `measurement`), `measurementStatus`, nullable snapshot time and runtime
|
|
120
|
+
identity hash, per-file coverage/unknown reasons, and fixed operation/metric kinds
|
|
121
|
+
with lexical locations. Public counts are decimal **strings**, including `"0"`;
|
|
122
|
+
`null` means unavailable, never zero. No SQL, database object names or row contents
|
|
123
|
+
are returned. `planned` preview status may contain unsupported input and is not
|
|
124
|
+
measurement evidence. Measurement status is `measured`, `partial`, `unknown`, or
|
|
125
|
+
`not_required`. Partial or unknown measurement returns envelope `status: "not_ready"`
|
|
126
|
+
and exit `1`, retaining only the available evidence; neither a successful envelope
|
|
127
|
+
nor zero counts is a safety verdict.
|
|
128
|
+
|
|
129
|
+
The same bounded migration-input rules as static Insights apply. A review plans at
|
|
130
|
+
most 100 aggregates. Measurement uses a 1-second lock timeout, 5-second statement
|
|
131
|
+
timeout, 30-second total budget, 128 KiB output limit and 256 KiB generated-script
|
|
132
|
+
limit. The server transaction budget is reduced after runtime identity checks and
|
|
133
|
+
catalog preflight; it is never increased to compensate for a slow check.
|
|
134
|
+
Lock/statement/budget failures remain unknown instead of returning guessed counts.
|
|
135
|
+
Client cancellation is not by itself proof of immediate server-backend termination;
|
|
136
|
+
server-side deadlines additionally bound owned query/transaction lifetime.
|
|
137
|
+
Package-owned cancellation supports the ordinary cancellation signals,
|
|
138
|
+
releases the project lock and returns exit `130`; it does not reset or discard data.
|
|
139
|
+
Older editor versions may refuse the new `measure impact` operation kind in current
|
|
140
|
+
activity or retained history. This source command does not itself update the editor;
|
|
141
|
+
use the CLI until a compatible editor consumer is released.
|
|
142
|
+
Continue to use the normal reviewed rehearsal and application proof for actual
|
|
143
|
+
migration behavior.
|
|
144
|
+
|
|
13
145
|
`npx rehearsal configuration --json` identifies the exact active config, its source
|
|
14
146
|
fingerprint, validated field metadata, and saved named profiles. To validate an edit
|
|
15
147
|
without writing it, use `npx rehearsal configuration review --proposal=review.json --json`.
|
|
@@ -132,20 +264,22 @@ obsolete placeholder key.
|
|
|
132
264
|
|
|
133
265
|
## Check and inspect
|
|
134
266
|
|
|
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
|
|
267
|
+
| Command | What it does |
|
|
268
|
+
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
269
|
+
| `npx rehearsal doctor` | Check dependencies, inputs, and safety rules. |
|
|
270
|
+
| `npx rehearsal discover` | Explain detected facts, suggestions, and decisions. |
|
|
271
|
+
| `npx rehearsal support` | Print a privacy-safe report for a support request. |
|
|
272
|
+
| `npx rehearsal activity` | Report whether another Rehearsal operation is active. |
|
|
273
|
+
| `npx rehearsal environments` | Show owned runtimes, live resource use, and Docker capacity. |
|
|
274
|
+
| `npx rehearsal resources` | Browse images, volumes, container references, and cleanup explanations. |
|
|
275
|
+
| `npx rehearsal explain` | Show the exact plan without changing anything. |
|
|
276
|
+
| `npx rehearsal run --dry-run` | Show the same non-mutating plan. |
|
|
277
|
+
| `npx rehearsal candidates` | List pending migrations and their approval digest. |
|
|
278
|
+
| `npx rehearsal inspect baseline` | Show active and retained baseline metadata without row values. |
|
|
279
|
+
| `npx rehearsal inspect migrations` | Classify every historical and candidate migration. |
|
|
280
|
+
| `npx rehearsal inspect impact --target=<name>` | Preview exact aggregate kinds without contacting a database. |
|
|
281
|
+
| `npx rehearsal measure impact --target=<name> --confirm-candidates=<sha256>` | Read bounded aggregates from that current verified sandbox. |
|
|
282
|
+
| `npx rehearsal status` | Report baseline, candidates, and local runtime state. |
|
|
149
283
|
|
|
150
284
|
State-reporting commands accept `--json` for scripts. Scripts should use the JSON fields
|
|
151
285
|
and process exit code, not parse human-facing text.
|
|
@@ -359,7 +493,7 @@ Clients should disable conflicting actions unless the state is `idle`.
|
|
|
359
493
|
|
|
360
494
|
### Cancelling a mutation
|
|
361
495
|
|
|
362
|
-
`run`, `reset`, `migrate`, confirmed `refresh`, and direct or guided `open` preparation support
|
|
496
|
+
`run`, `reset`, `migrate`, `measure impact`, confirmed `refresh`, and direct or guided `open` preparation support
|
|
363
497
|
package-owned cancellation.
|
|
364
498
|
Send `SIGINT`, `SIGTERM`, `SIGHUP`, or `SIGTSTP` to the Rehearsal CLI process. Rehearsal
|
|
365
499
|
handles repeated delivery as one request, forwards it only to the detached process group
|
|
@@ -472,25 +606,26 @@ belonging to other projects are never included. This follows
|
|
|
472
606
|
|
|
473
607
|
## Common options
|
|
474
608
|
|
|
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
|
-
| `--
|
|
609
|
+
| Option | Meaning |
|
|
610
|
+
| -------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
611
|
+
| `--help`, `-h` | Show the installed command reference. |
|
|
612
|
+
| `--version`, `-V` | Print the installed package version and exit. |
|
|
613
|
+
| `--json` | Return the versioned machine-readable result. |
|
|
614
|
+
| `--verbose` | Show more safe detail. |
|
|
615
|
+
| `--debug` | Show the most diagnostic detail; still review it before sharing. |
|
|
616
|
+
| `--plain` | Disable decorative interactive prompts. |
|
|
617
|
+
| `--config=<path>` | Use only this config for planning and every runtime action. |
|
|
618
|
+
| `--target=<name>` | Choose a setup provider or configured runtime target; impact commands require an explicit name. |
|
|
619
|
+
| `--confirm-candidates=<digest>` | Confirm the exact whole-plan candidates for run, migrate or impact measurement. |
|
|
620
|
+
| `--include-runtime` | Include this project's runtime in a cleanup preview. |
|
|
621
|
+
| `--include-images` | Include older unused Supabase images in a cleanup preview. |
|
|
622
|
+
| `--confirm-cleanup=<digest>` | Confirm the exact cleanup set printed by the preview. |
|
|
623
|
+
| `--confirm-source-access=<digest>` | Confirm one exact temporary source-access plan. |
|
|
624
|
+
| `--confirm-source-retirement=<digest>` | Confirm exact source-access retirement. |
|
|
625
|
+
| `--confirm-refresh=<digest>` | Confirm an exact refresh, runtime reset, and old-copy removal. |
|
|
626
|
+
| `--identity=<name>` | Choose one declared local identity association. |
|
|
627
|
+
| `--confirm-identity=<digest>` | Confirm that exact local identity plan. |
|
|
628
|
+
| `--write` | Apply a setup, policy, or cleanup preview. |
|
|
494
629
|
|
|
495
630
|
Run `npx rehearsal --help` to print the command list available in your installed version.
|
|
496
631
|
Run `npx rehearsal --version` to print only its version number. Add `--json` when a
|
package/docs/configuration.md
CHANGED
|
@@ -229,6 +229,10 @@ approval sequence.
|
|
|
229
229
|
|
|
230
230
|
`runtimePolicy` replaces common restore adapters with reviewed schemas, allowlisted
|
|
231
231
|
extensions, managed triggers, local-only singleton rows, and structural expectations.
|
|
232
|
+
The [runtime policy guide](runtime-policies.md#explicit-data-api-grants) also owns the
|
|
233
|
+
least-privilege Data API migration checklist and core 1.1.0's optional read-only
|
|
234
|
+
required/forbidden privilege declarations. Earlier releases do not accept that new
|
|
235
|
+
declaration. Rehearsal never infers or automatically grants API access.
|
|
232
236
|
`identityPolicy` declares a hashed verified-email or provider-subject matcher, copied
|
|
233
237
|
placeholder, safe signup defaults, required role/reference transfers, Storage path
|
|
234
238
|
rewrites, and token checks. Provider credentials stay in the local Supabase runtime
|
|
@@ -285,11 +289,29 @@ Colima. It warns at `diskWarningPercent` and refuses to start below
|
|
|
285
289
|
generated PostgreSQL configs reserve 2 GiB. Engines that do not expose a portable disk
|
|
286
290
|
measurement continue normally and report capacity as unavailable in `environments`.
|
|
287
291
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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).
|
|
293
315
|
|
|
294
316
|
After each Supabase start, Rehearsal changes only the exact target's containers to
|
|
295
317
|
Docker's `no` restart policy. Its database and Storage volumes remain intact,
|
|
@@ -300,8 +322,10 @@ Rehearsal stacks.
|
|
|
300
322
|
`keep-until-stop` preserves today's interactive behavior, while `stop-after-run` stops
|
|
301
323
|
the targets after proofs, proof failures, or interruption. `lifecycle.open` uses
|
|
302
324
|
`keep-until-stop` or `stop-on-application-exit` after the app closes. Every mode stops
|
|
303
|
-
only Rehearsal's configured targets
|
|
304
|
-
|
|
325
|
+
only Rehearsal's configured targets; lifecycle selection does not enable engine shutdown.
|
|
326
|
+
The separately opted-in `stopOwnedColimaWhenIdle` policy above is the only guarded Colima
|
|
327
|
+
shutdown path. Ordinary stopping keeps database and Storage volumes and all sandbox
|
|
328
|
+
edits; it does not reset or discard them.
|
|
305
329
|
See [Container runtime lifecycle](runtime-lifecycle.md).
|
|
306
330
|
|
|
307
331
|
### Foreground application idle shutdown
|
|
@@ -637,8 +661,17 @@ The VS Code Local Resources manager reviews an exact diff before changing either
|
|
|
637
661
|
See [Local Resources](runtime-lifecycle.md#local-resources-manager) for image and volume rules.
|
|
638
662
|
|
|
639
663
|
Use unique, non-privileged ports that do not overlap. `projectId` accepts lowercase
|
|
640
|
-
letters, numbers, and hyphens
|
|
641
|
-
only this project.
|
|
664
|
+
letters, numbers, and hyphens: 2–40 characters for Supabase, or 2–63 for PostgreSQL.
|
|
665
|
+
It labels the local Docker resources so cleanup targets only this exact project.
|
|
666
|
+
Overlong configured IDs are refused before a provider starts; Rehearsal never truncates
|
|
667
|
+
them or adopts resources using a shortened prefix. Review existing resources before
|
|
668
|
+
changing a configured ID, and use a distinct reviewed identity for a new disposable
|
|
669
|
+
runtime rather than assuming that a renamed config owns old containers or volumes.
|
|
670
|
+
|
|
671
|
+
For new setup only, the generated `<project-name>-rehearsal` ID stays unchanged when it
|
|
672
|
+
fits the selected provider. Longer new IDs use a readable prefix and a deterministic
|
|
673
|
+
hash suffix within that provider's limit. Setup uses the same exact ID in the generated
|
|
674
|
+
Rehearsal config and Supabase TOML. Existing configuration files are never rewritten.
|
|
642
675
|
|
|
643
676
|
Application and readiness URLs must use a different port from the configured database,
|
|
644
677
|
API, and Studio services. Editing a URL does not rewrite your framework's development
|
package/docs/getting-started.md
CHANGED
|
@@ -12,17 +12,17 @@ Separate setup folders are available for
|
|
|
12
12
|
[macOS](https://github.com/Ddupasquier/rehearsal-db/tree/main/installers/macos) and
|
|
13
13
|
[Linux](https://github.com/Ddupasquier/rehearsal-db/tree/main/installers/linux).
|
|
14
14
|
They are readable helpers, not native executables or bundled Node/Docker installers.
|
|
15
|
-
Existing Node.js 24 or 26 is required. The default only checks an existing project;
|
|
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. An exact core 1.0
|
|
18
|
+
before choosing an install option. An exact core 1.1.0 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
|
|
22
22
|
|
|
23
23
|
The Windows compatibility route is Linux execution inside **WSL 2**, not a native
|
|
24
|
-
PowerShell/Command Prompt database runtime.
|
|
25
|
-
boundary explicit; native Windows version/help/discovery do not authorize runtime work.
|
|
24
|
+
PowerShell/Command Prompt database runtime. Since core 1.0.1 and extension 0.1.21, that
|
|
25
|
+
boundary is explicit; native Windows version/help/discovery do not authorize runtime work.
|
|
26
26
|
|
|
27
27
|
1. Follow Microsoft's [WSL installation guide](https://learn.microsoft.com/en-us/windows/wsl/install)
|
|
28
28
|
to prepare a WSL 2 Linux distribution, such as Ubuntu 24.04. Do not use WSL 1.
|
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
|
|
@@ -138,7 +140,9 @@ release-source migration.
|
|
|
138
140
|
4. When an unfamiliar developer is available, have them follow clean-project onboarding.
|
|
139
141
|
Correct and retest the first confusing, missing, or wrong instruction. Record when
|
|
140
142
|
this human observation was unavailable; automated checks must not impersonate it.
|
|
141
|
-
5.
|
|
143
|
+
5. Confirm package metadata keeps `private: false` for this public npm package. Any
|
|
144
|
+
metadata change belongs in the reviewed release change; do not toggle visibility
|
|
145
|
+
or package privacy as an incidental publishing step.
|
|
142
146
|
6. Record the exact tarball filename, SHA-1, SHA-256, allowlisted files, unpacked size,
|
|
143
147
|
executable, declared runtime dependency inventory, and dependency audit result.
|
|
144
148
|
7. Review the release change and its exact artifact evidence.
|
|
@@ -195,7 +199,7 @@ This is mutual exclusion, not a guaranteed ordered queue: reconcile a superseded
|
|
|
195
199
|
pending workflow before deliberately requesting another run.
|
|
196
200
|
|
|
197
201
|
The objective promotion checklist and compatibility boundary live in
|
|
198
|
-
[Stability and
|
|
202
|
+
[Stability and release verification](stability.md).
|
|
199
203
|
|
|
200
204
|
The trusted publisher allows `npm dist-tag` only so this workflow can maintain those two
|
|
201
205
|
tags without a stored npm token. A manual workflow run from `main` can repair the correct
|
package/docs/roadmap.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# Next steps
|
|
2
2
|
|
|
3
|
-
Rehearsal core **1.
|
|
3
|
+
Rehearsal core **1.1.0 is available on
|
|
4
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
|
|
5
|
+
ordinary PostgreSQL migration rehearsals. The [free VS Code Starter 0.1.23 preview](vscode.md)
|
|
6
|
+
adds a visual workbench and is distributed through Marketplace and reviewed GitHub
|
|
7
|
+
VSIX releases. Neither requires a purchase or account. Core is MIT-licensed; all
|
|
8
|
+
features included in Starter are free indefinitely for personal or commercial development.
|
|
9
|
+
|
|
10
|
+
Stable core, the editor preview and a future paid Pro offer have separate completion
|
|
11
|
+
boundaries. A downloadable preview does not imply that every native accessibility,
|
|
12
|
+
provider or real-user acceptance observation has been completed. Publication does not
|
|
13
|
+
authorize a new database operation or migrate a running legacy extension.
|
|
7
14
|
|
|
8
15
|
The standalone workflow keeps the rehearsal engine in the package while application
|
|
9
16
|
meaning and privacy decisions remain project-owned. The sequence below explains its
|
|
@@ -30,10 +37,18 @@ Track the full breakdown in
|
|
|
30
37
|
For questions or feature requests, use
|
|
31
38
|
[GitHub issues](https://github.com/Ddupasquier/rehearsal-db/issues).
|
|
32
39
|
|
|
33
|
-
##
|
|
40
|
+
## Verification and supported-journey work
|
|
41
|
+
|
|
42
|
+
The [release verification policy](stability.md) owns promotion requirements. The
|
|
43
|
+
[Environment Workbench epic](https://github.com/Ddupasquier/rehearsal-db/issues/130)
|
|
44
|
+
and its children track remaining editor acceptance; the issue tracker owns current
|
|
45
|
+
status and pickup order, not this page. Supported-journey compatibility work,
|
|
46
|
+
including the [Supabase grant-preservation review](https://github.com/Ddupasquier/rehearsal-db/issues/199),
|
|
47
|
+
is distinct from adding new database families or paid features.
|
|
34
48
|
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
For each exact candidate, retain the checks already proved and complete the missing
|
|
50
|
+
observations. The following describe evidence boundaries, not a claim that a shipped
|
|
51
|
+
release or consumer upgrade remains unfinished:
|
|
37
52
|
|
|
38
53
|
- Install the exact packed candidate in clean Supabase and PostgreSQL consumers.
|
|
39
54
|
- Exercise two unrelated synthetic schemas, bounded large data, interruption, drift,
|
|
@@ -46,8 +61,33 @@ consumer migrations. Record the observed results for each exact candidate separa
|
|
|
46
61
|
- Remove consumer integration code only after its replacement passes and that deletion
|
|
47
62
|
is separately approved.
|
|
48
63
|
|
|
64
|
+
## Efficient local execution and optional managed runs
|
|
65
|
+
|
|
66
|
+
Efficient local profiles, data-preserving lifecycle controls, essential safety and the
|
|
67
|
+
complete CLI stay free. Resource improvements must preserve the services and representative
|
|
68
|
+
data needed to prove the chosen scenario; a database-only pass is not full application
|
|
69
|
+
acceptance. See [choosing a local profile](runtime-lifecycle.md#choosing-postgresql-or-supabase).
|
|
70
|
+
|
|
71
|
+
Optional managed execution is the paid-service direction: run demanding rehearsals
|
|
72
|
+
without a local database stack. It is not currently available. Its design must establish
|
|
73
|
+
explicit upload consent, isolated execution, credential and retention boundaries,
|
|
74
|
+
verifiable cleanup and bounded costs before a hosted launch. Sanitization does not
|
|
75
|
+
automatically authorize uploading a baseline. Pricing and commercial terms remain separate.
|
|
76
|
+
|
|
77
|
+
The [resource-efficiency initiative](https://github.com/Ddupasquier/rehearsal-db/issues/208)
|
|
78
|
+
coordinates existing lifecycle work and bounded remote/native feasibility. Experimental
|
|
79
|
+
upstream native runtimes are not a supported Rehearsal replacement merely because they
|
|
80
|
+
can omit Docker. Moving an application's production host does not itself reduce the
|
|
81
|
+
services a local rehearsal needs.
|
|
82
|
+
|
|
49
83
|
## Later database targets
|
|
50
84
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
85
|
+
Additional database, runtime, identity-provider and migration-tool integrations require
|
|
86
|
+
their own reviewed capability contracts and independent acceptance. Research or a roadmap
|
|
87
|
+
ticket is not a support claim. MySQL, MongoDB, SQLite and other database families are not
|
|
88
|
+
supported by this PostgreSQL/Supabase release. They remain separate future work rather
|
|
89
|
+
than prerequisites for the current local workflow.
|
|
90
|
+
|
|
91
|
+
The complete CLI and its database/safety capabilities stay free. Optional paid Pro
|
|
92
|
+
workflows, licensing and commercial readiness remain separate owner decisions; this
|
|
93
|
+
roadmap does not approve a paywall, price, billing service or new distribution operation.
|
|
@@ -27,8 +27,8 @@ then repeat the command.
|
|
|
27
27
|
|
|
28
28
|
Setting `autoStartColima: true` is an explicit convenience opt-in. If Docker is
|
|
29
29
|
unavailable and the `colima` command exists, Rehearsal runs plain `colima start` and
|
|
30
|
-
reports it. Rehearsal does not resize Colima
|
|
31
|
-
|
|
30
|
+
reports it. Rehearsal does not resize Colima. Engine shutdown remains off unless the
|
|
31
|
+
separate ownership-guarded policy below is explicitly enabled. Starting Docker can also wake unrelated containers that use Docker's
|
|
32
32
|
`always` or `unless-stopped` restart policy. Rehearsal changes only the selected
|
|
33
33
|
Supabase stack to Docker's `no` restart policy after it starts successfully.
|
|
34
34
|
|
|
@@ -84,8 +84,9 @@ lifecycle: {
|
|
|
84
84
|
`run` accepts `keep-until-stop` or `stop-after-run`. `open` accepts
|
|
85
85
|
`keep-until-stop` or `stop-on-application-exit`. The bounded choices stop every
|
|
86
86
|
configured Rehearsal target in reverse dependency order after the command finishes,
|
|
87
|
-
fails after startup, times out, or is interrupted.
|
|
88
|
-
engine.
|
|
87
|
+
fails after startup, times out, or is interrupted. Lifecycle choices govern targets,
|
|
88
|
+
not engine ownership; they do not enable Colima shutdown. The separate
|
|
89
|
+
`stopOwnedColimaWhenIdle` policy still requires its own opt-in and ownership checks.
|
|
89
90
|
|
|
90
91
|
Stopping is non-destructive: database and Storage volumes, applied migrations, and
|
|
91
92
|
sandbox edits remain available to `start` or `open`. Only the existing explicit `reset`
|
|
@@ -190,6 +191,16 @@ These observations help compare profiles, not promise a machine-wide memory budg
|
|
|
190
191
|
A cold-image or fresh-VM benchmark needs its own disposable, exclusive test environment.
|
|
191
192
|
Do not prune shared images or restart a shared engine to manufacture a cold measurement.
|
|
192
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
|
+
|
|
193
204
|
## Scheduled review and stale-stop safety
|
|
194
205
|
|
|
195
206
|
Resource policies configure advisory retention, measured-volume budgets, and scheduled
|