Skip to content

docs(migration): make the Protect-to-Stack conversion guide actionable - #1620

Draft
tobyhede wants to merge 4 commits into
mainfrom
docs/migration-guide-evidence
Draft

tobyhede wants to merge 4 commits into
mainfrom
docs/migration-guide-evidence

Conversation

@tobyhede

@tobyhede tobyhede commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make the Protect-to-Stack migration guide actionable when credentials are supplied explicitly and when the PostgreSQL application has already removed Protect. The guide now includes the PostgreSQL conversion core using Stack to decrypt the existing v2 source, backed by a live regression test against real Protect-written rows.

Changes

  • Show the four explicit credential fields accepted by Stack's Encryption configuration.
  • Include the PostgreSQL conversion sequence and complete initial-migration dependency preflight in the guide. Explain the write-maintenance window and existing safe refusal when conversion is repeated after success; link the complete executable example.
  • Use Stack to decrypt source v2 envelopes after Protect is removed, and compare that behavior with Protect and the expected plaintext in the PostgreSQL integration suite.
  • Replace relative example links with repository URLs and scope DynamoDB byte-preservation evidence explicitly to in-memory item objects.

Verification

Fresh independently audited guide-only runs used source guide SHA-256 46106cc0a71dbeb757bcb0b3889c6fc5741bac201afe807ed8cde0a035d3d649 and harness 5261d3a5c0ae6a4750a7a1102d08436a1d314725:

  • DynamoDB: 24 checks passed, 11 turns, empty friction report.
  • PostgreSQL: 15 checks passed, 9 turns, empty friction report.
  • Complete broker command/response evidence was reviewed; neither run retrieved supplementary documentation.
  • Runs used Claude Code 2.1.322 with claude-sonnet-5-5 on the existing Colima Linux host, outside CI.
  • This is one sample per store, not the ADR's convergence criterion, an actual AWS deployment test, or customer staging acceptance.
  • Source guide current-head CI passed. A separate intermittent harness observer failure remains under repair; these results do not claim all latest harness CI is green.

Latest guide-only update at 0ecabc3f62ee8a117c467981ce00d312e6cfc636:

  • 58 guide citation tests passed; E2E typecheck and git diff --check passed.
  • Compared the inline dependency query with the tested example's checkDependencies(tx, false): it preserves incoming foreign-key, PostgreSQL 18 primary-key NOT NULL, source-column NOT NULL, view, trigger, policy, RLS and inheritance checks. Initial conversion rejects every non-primary index.
  • The rerun clarification describes the existing shape check and transaction rollback; it adds no migration behavior.
  • Signed commit verified G. The edit itself changed only guide prose and the inline example; subsequent live guide-only verification is recorded above.

Prior executable regression evidence at 8fb583930bebd79c27a785a463dcf416a6bf1889:

  • Test JS / E2E passed: 40 DynamoDB compatibility tests, 23 cross-store/guide-example tests, and 10 PostgreSQL 18 upgrade tests. The Stack-decrypts-Protect-v2 test passed in both PostgreSQL runs.
  • Local Stack JavaScript/declaration build and E2E typecheck passed after building missing declarations; scoped Biome and diff checks passed. Existing platform/declaration-bundling warnings were reported.
  • CI tests use the in-tree Stack build; they do not establish a customer staging rehearsal or AWS deployment behavior.

Related

Refs #1604, #1603, #1540.

Review notes

The PostgreSQL snippet is the conversion core, not a general production backfill runner: follow the linked complete example's dependency preflight and the guide's supported mappings and rollback boundary. The guide targets Stack 1.2.1 and EQL v3, not EQL v4. Docs-site publication and customer-specific staging rehearsal remain outstanding.

The cited compatibility assertion compares stored item objects in memory. Name that scope beside the byte-preservation claim so readers do not infer an AWS persistence guarantee. Refs #1604.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.

@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0ecabc3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…als self-contained

The first real guide-only Runs (Claude Sonnet, isolated Migration Harness) found two gaps on the PostgreSQL path. Step 3 handed the conversion to e2e/migration-guide/postgres.ts, which a reader of the guide alone does not have, so the agent rebuilt it from the prose list. The guide never showed how to pass credentials to Encryption explicitly, so the agent read the package typings.

Step 3 now carries the core of the tested conversion script and says to run it as a one-off script in the maintenance window, not at application startup (the agent had put DDL in createApp). Both step 2s show Encryption's `config` with the four credential fields. Links into this repository are now absolute GitHub URLs, so they resolve from the published guide.

Refs #1603
Refs #1604
…onversion script

The in-guide conversion script decrypted the source with a Protect 10.2.1 client, but PostgreSQL step 2 had just uninstalled Protect. A real Claude Migrator recorded this as actionable friction and decrypted the v2 envelopes with Stack instead, a path no suite tested.

A new credentialed test in protect-postgres-upgrade proves Stack 1.x decrypts every Protect-written v2 envelope read from the eql_v2_encrypted columns to the same plaintext as Protect. The guide's script now decrypts the source with client.decrypt in both the validate and verify steps and cites that test. The executable example still cross-checks with the preserved Protect build, which the guide says.

Refs #1603
@tobyhede tobyhede changed the title docs(e2e): qualify in-memory migration evidence docs(migration): make the Protect-to-Stack conversion guide actionable Nov 11, 2026
Guide-only migration exposed an omitted safety check that required opening the example. Inline the tested initial-conversion checks and describe the existing refusal on a repeated conversion so the one-off procedure is self-contained without introducing new migration behavior.

Refs #1540, #1605.
tobyhede added a commit to cipherstash/docs that referenced this pull request Nov 12, 2026
Pin the customer page to the source revision that includes dependency checks directly and explains safe refusal on repeated conversion. Keep the added customer rehearsal checklist separate from the verified procedure.

Refs cipherstash/stack#1620.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant