@rehearsal-db/core 0.1.0-rc.8 → 0.1.0-rc.9

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 CHANGED
@@ -5,7 +5,15 @@ a Changelog, and versions will follow Semantic Versioning after the package exis
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ## [0.1.0-rc.8] - Unreleased candidate
8
+ ## [0.1.0-rc.9] - 2026-10-17
9
+
10
+ ### Fixed
11
+
12
+ - Wrong or stale source-access approval and review-required privacy drafts report
13
+ actionable configuration refusals instead of internal failures. Source access,
14
+ privacy review and baseline-preservation requirements are unchanged.
15
+
16
+ ## [0.1.0-rc.8] - 2026-10-17
9
17
 
10
18
  ### Added
11
19
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rehearsal-db/core",
3
- "version": "0.1.0-rc.8",
3
+ "version": "0.1.0-rc.9",
4
4
  "private": false,
5
5
  "description": "Catch PostgreSQL and Supabase migrations that pass on empty databases but fail on real data—before deploy.",
6
6
  "repository": {
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Validate and normalize the complete reviewed privacy policy version 2.
3
3
  */
4
+ import { RehearsalError } from "../shared/diagnostics.mjs";
4
5
  import { validatePrivacyDependencyGraph } from "./privacy_dependency_graph.mjs";
5
6
  import { validatePrivacyRecipe } from "./privacy_recipe_validation.mjs";
6
7
  import { ACTIONS, BINDING_NAME, DEFAULT_PATH_MAXIMUM_BYTES, DEFAULT_PATH_MAXIMUM_SEGMENTS, ENVIRONMENT_KEY, HEX_64, assertKnownKeys as knownKeys, isPrivacyObject as isObject, validateIdentifier as identifier, validateNonEmpty as nonEmpty, validatePositiveInteger as positiveInteger, } from "./privacy_validation_shared.mjs";
@@ -19,7 +20,18 @@ export const validateExecutablePrivacyPolicy = (policy) => {
19
20
  throw new Error("Executable privacy policies must use policyVersion 2.");
20
21
  }
21
22
  if (policy.draft === true) {
22
- throw new Error("The privacy policy is still a REVIEW REQUIRED draft.");
23
+ throw new RehearsalError({
24
+ category: "configuration_invalid",
25
+ code: "CONFIGURATION_INVALID",
26
+ message: "The privacy policy is still a REVIEW REQUIRED draft.",
27
+ expected: "A complete, explicitly reviewed and approved privacy policy.",
28
+ actual: "REVIEW REQUIRED draft.",
29
+ refused: "This draft policy was not accepted for source export or baseline activation.",
30
+ suggestions: [
31
+ "Review every exported table, column, recipe and source-data boundary, and obtain explicit privacy approval before completing this draft.",
32
+ "Do not remove the draft marker merely to bypass review. After approval, rerun rehearsal baseline refresh.",
33
+ ],
34
+ });
23
35
  }
24
36
  if (typeof policy.migrationCutoff !== "string" ||
25
37
  !/^\d{14}$/u.test(policy.migrationCutoff)) {
@@ -3,6 +3,7 @@
3
3
  * Plans contain no credentials or raw owner identifiers.
4
4
  */
5
5
  import { createHash } from "node:crypto";
6
+ import { RehearsalError } from "../shared/diagnostics.mjs";
6
7
  const IDENTIFIER = /^[a-z][a-z0-9_]{0,62}$/u;
7
8
  const ENVIRONMENT_KEY = /^[A-Z][A-Z0-9_]{1,127}$/u;
8
9
  const SHA256 = /^[a-f0-9]{64}$/u;
@@ -539,7 +540,16 @@ export const assetEndpointFingerprint = (value) => {
539
540
  };
540
541
  export const assertSourceAccessConfirmation = (plan, confirmation) => {
541
542
  if (confirmation !== plan.digest) {
542
- throw new Error(`Source access confirmation does not match this exact plan. Expected ${plan.digest}.`);
543
+ throw new RehearsalError({
544
+ category: "configuration_invalid",
545
+ code: "CONFIGURATION_INVALID",
546
+ message: `Source access confirmation does not match this exact plan. Expected ${plan.digest}.`,
547
+ refused: "This confirmation check did not open a source connection or change source access.",
548
+ suggestions: [
549
+ "Run rehearsal source plan and review the complete current plan.",
550
+ "Only after explicit approval, rerun rehearsal source apply --confirm-source-access=<reviewed-full-sha256> using that plan's exact digest.",
551
+ ],
552
+ });
543
553
  }
544
554
  return plan;
545
555
  };
package/docs/commands.md CHANGED
@@ -244,6 +244,12 @@ baseline-retention settings and fields that require manual review. They are not
244
244
  baseline corruption or internal failures. Review never writes configuration or
245
245
  executes proposed commands; unexpected faults retain their existing classification.
246
246
 
247
+ A wrong or stale source-access confirmation and an executable privacy policy still
248
+ marked as a review-required draft also return `configuration_invalid` /
249
+ `CONFIGURATION_INVALID` (exit `2`). Review a fresh `source plan` before confirming it;
250
+ complete the privacy review before retrying `baseline refresh`. These refusals do not
251
+ grant source access, export rows, or replace the current baseline.
252
+
247
253
  Editor integrations should resolve the project's installed `@rehearsal-db/core`
248
254
  manifest and its declared `rehearsal` binary. They should not import private package
249
255
  files, search for a global installation, invoke through a shell, or parse styled output.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rehearsal-db/core",
3
- "version": "0.1.0-rc.8",
3
+ "version": "0.1.0-rc.9",
4
4
  "private": false,
5
5
  "description": "Catch PostgreSQL and Supabase migrations that pass on empty databases but fail on real data—before deploy.",
6
6
  "repository": {