Skip to content

feat(prisma-cloud): deploy state moves behind the platform Alchemy state API, with a deploy lease - #209

Merged
wmadden-electric merged 10 commits into
mainfrom
claude/alchemy-state-api-composer-60c6f6
Aug 9, 2026
Merged

feat(prisma-cloud): deploy state moves behind the platform Alchemy state API, with a deploy lease#209
wmadden-electric merged 10 commits into
mainfrom
claude/alchemy-state-api-composer-60c6f6

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

At a glance

After this PR, a composer deploy stores its provisioning state in the platform itself, using Alchemy's own stock HTTP state client pointed at our Management API — plus a server-side lease that keeps two deploys of one stage from running at once:

const lease = await acquireDeployLease(client, { projectId, branchId, stack, stage });

const state = makeHttpStateStore({
  url: `https://api.prisma.io/v1/projects/${projectId}/branches/${branchId}/alchemy-state`,
  authToken: workspaceServiceToken,
  transformClient: (req) => req.setHeader("Alchemy-State-Lease-Id", lease.leaseId),
  id: "prisma-postgres",
});
// state.set / get / list / deleteStack … — Alchemy's stock client, unmodified

Before this PR, that same state lived in a small hidden Prisma Postgres database named prisma-composer-state that composer created inside every deploy stage, guarded by a Postgres advisory lock. All of that machinery is deleted here — about 1,200 lines of store, lock, and bootstrap code plus their tests.

The decision

Composer's deploy state moves behind the platform's new Alchemy state API, and deploy serialization moves from a client-held Postgres lock to a server-enforced lease. The server side shipped in prisma/pdp-control-plane#4816 (schema) and #4817 (API), merged 2026-08-07; the routes are experimental. This PR is the composer half: point the state layer at the API, wrap the run in the lease, and delete the interim store.

Why deploy state exists, and why it was a database

Alchemy (like Terraform) works by diffing the desired resource graph against a state store — its record of what it provisioned last time. Whoever can read that store deploys incrementally; whoever cannot, provisions duplicates. So composer hosts state where every credentialed machine can reach it. Until now that meant composer built its own store from public primitives: a prisma-composer-state database in each stage's Branch, bootstrapped on every deploy (find-or-create the database, verify ownership via a marker table, migrate the schema, mint a fresh connection string), and serialized by a session advisory lock with a liveness re-checker.

That store worked, but it cost a database quota slot per stage, appeared in the Console where a user could delete it out from under live deployments, and carried real proof burden (the lock's crash-release behaviour was verified against one specific driver — ADR-0012 records why). Our own ADRs called it an interim and named "a platform-side state API" as the end state. That API now exists, so the interim dies: ADR-0012's recorded pick-up trigger — "the platform-side state API lands … this record closes as obsolete" — has fired.

How it works now

The state client is Alchemy's, unmodified. The server implements Alchemy's stock HttpStateApi wire contract verbatim, so composer's prismaStateLayer (packages/1-prisma-cloud/0-lowering/lowering/src/state/layer.ts) just builds the stock makeHttpStateStore from the pinned alchemy@2.0.0-beta.67 — the pin is unchanged, and the layer's public type is unchanged, so nothing upstream of it moves. Auth is the same workspace service token composer already deploys with.

The lease replaces the lock. Alchemy's contract has no locking concept, so the server adds one object: a per-(stack, stage) lease. Composer acquires it before the run, heartbeats it every 20 s on a background fiber, and releases it when the run ends (state/lease.ts). The old lock's two properties carry over in simpler form:

  • Contention fails fast. A second deploy of the same stage gets a 409 naming the current holder and stops immediately — no queueing, same operator experience as the advisory lock.
  • Crash recovery needs no bookkeeping. A crashed deploy's lease simply expires (TTL 60 s). The lock got this from Postgres connection lifetimes; the lease gets it from a clock.

Enforcement moved server-side, which deletes a whole class of client code: every state operation without a live lease fails 409, a status the stock client treats as fatal (no retry), so a lost lease stops a deploy after at most one extra request. The old client-side liveness re-checker has no replacement because it has no job left. The lease id is a capability token: it is held Redacted, and its header is added to effect's log-redaction names (mutation-tested).

What happens to existing stages

No data migration, matching the precedent ADR-0034 set for the previous store move. A stage deployed with an older composer has live resources but no API-hosted state, and deploying over it with fresh state would silently re-provision duplicates — the exact failure hosted state exists to prevent. So the existing empty-scope check is re-pointed at the API and made stricter: if the state scope is empty but the Branch already has live resources (apps, databases — including the old prisma-composer-state database itself — or buckets), the deploy refuses and tells the operator to destroy with the previous composer version or delete the stage/branch, then redeploy fresh. Legacy state databases are never read and never deleted: deleting a stage's Branch cleans its one up; production's is a documented one-slot manual cleanup. docs/guides/deploying.md § "Upgrading from an older state store" walks through it.

Tests and live proof

The wire contract is exercised by the real stock client, not a mock of it: an in-process fake of the server (double-encoded fqn, 200 + JSON null for absent values, PUT echo, lease enforcement) sits on a real TCP port, and the pinned client drives the full StateService round-trip against it. Request-counted tests prove the fail-fast claims: contention is one request, and a lost lease fails the next state operation in exactly one request.

Proven live against api.prisma.io: examples/bucket deployed end-to-end to an ephemeral stage with zero databases created on the Branch; a deploy against a held lease failed immediately naming the holder; an identical redeploy was a pure no-op; destroy removed the stage Branch and its state with it. Workspace typecheck/lint/test green; cast ratchet flat.

Docs follow the code: new ADR-0045 records the decision; ADR-0010 and ADR-0012 get supersession banners; ADR-0034 a partial one (its Branch-scoping and lifetime reasoning carries over). @prisma/management-api-sdk moves ^1.50.0^1.57.0 for the typed lease routes.

Alternatives considered

  • Keep the per-stage state database — rejected: quota slot and Console visibility per stage, user-deletable live state, bootstrap ceremony on every run, and our own ADRs already recorded it as interim.
  • A composer-specific state protocol — rejected: the server implements Alchemy's existing versioned contract, so composer's client is zero new code and zero new protocol decisions.
  • Client-side liveness checking on top of the lease — rejected: the server already fails every leaseless operation, and the stock client already treats that failure as fatal; re-checking client-side would duplicate an enforced guarantee with an unenforced one.
  • Migrating legacy state into the API — deferred, not rejected: the refusal-on-legacy-stage guard is the safe default, and a one-time copy can layer on later without rework if destroy-then-redeploy proves too costly in practice.

🤖 Generated with Claude Code

Rewrites the hosted state layer around alchemy's stock HTTP state client
pointed at /v1/projects/{p}/branches/{b}/alchemy-state, with a server-side
deploy lease acquired around the run (heartbeat every 20s on a forked
fiber; released as a finalizer; 409 contention fails fast naming the
holder). The migration guard survives re-pointed: an empty API scope with
live Compute apps on the branch refuses loudly — the stage predates the
platform state API.

Deletes the interim machinery it replaces: the per-stage
prisma-composer-state database bootstrap/ownership/deletion, the SQL
store and schema, the Postgres session advisory lock and its liveness
checker, the destroy teardown that deleted the state database, and the
self-spawned Postgres test harness. The postgres dependency is gone from
every package. Bumps @prisma/management-api-sdk to ^1.57.0 for the typed
lease routes. New tests drive the REAL stock client against an
in-process fake of the state API wire contract.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
The destroy teardown that read the shell token is gone with the interim
state store; the invariant list follows.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
- drop the architecture.config.json entry for the deleted teardown.ts
- seed a replaced-status resource in the getReplacedResources test so it
  proves inclusion as well as exclusion
- rewrite the CI Postgres-service comment to name the suites that still
  use it, and drop the stale "no Postgres connection" clause from the
  state layer test
- register the Alchemy-State-Lease-Id header with effect's header
  redaction (Headers.CurrentRedactedNames), merged into the state
  layer's outputs, so a logged failed request renders the lease id as
  <redacted>

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
… layer merge

The round-2 test provided redactLeaseHeader directly, so deleting the
Layer.merge line in layer.ts would have left it green. The new test
renders the header inside runLayer (the full stateLayerAgainst context)
and asserts <redacted>; the standalone test shrinks to the control
showing effect's default redaction does not cover the header. Also
rewraps a ragged comment in layer.test.ts.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Records the decision D1 implemented: state behind the Management API
(alchemy's stock HttpStateApi wire contract per Branch, stock client),
with a server-side per-(stack, stage) deploy lease. Supersedes ADR-0010
(advisory lock -> lease, fail-fast contention preserved) and the storage
half of ADR-0034 (Branch scoping and lifetime stand); closes ADR-0012 as
obsolete via its own pick-up trigger. Banners on all three; index updated.

Prose docs updated to the new story: layering.md's provisioning-state
spectrum (the platform-hosted step is now real; server-side runs is the
remaining future step), deploy-cli.md, the deploying guide (state
paragraph, destroy order, a combined legacy-upgrade section covering both
older store generations and the up-front refusal), the glossary state
store entry, and gotchas.md's reference to the deleted bootstrap code.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
- admit the wire-contract fake and its drift obligation instead of
  claiming no test suite of our own
- state the honest experimental-routes consequence: a route move breaks
  installed versions until users upgrade; the /version probe detects
  contract drift but does not prevent the break
- attribute the TTL clamp and the encryption/key-length facts inline to
  the server PRs, the only place a reader can check them

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@wmadden-electric, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bca128d4-065b-4b92-abc7-1dc240429a2c

📥 Commits

Reviewing files that changed from the base of the PR and between 1043d81 and 1801bbe.

📒 Files selected for processing (2)
  • docs/design/03-domain-model/layering.md
  • docs/guides/deploying.md

Summary by CodeRabbit

  • New Features

    • Deploy state is now hosted through the platform API and scoped to each environment branch.
    • Deploys use server-managed leases with renewal and fail-fast contention handling.
    • State operations support platform-based inspection and resource management.
  • Bug Fixes

    • Improved handling and guidance for legacy state environments and empty deployment scopes.
    • Branch cleanup removes associated deployment state while preserving production state.
  • Documentation

    • Updated deployment guides and decision records to reflect the new state model and migration process.

Walkthrough

The PR moves Prisma Cloud deploy state from Composer-owned PostgreSQL databases to Alchemy’s HTTP state API, scoped to each Branch. The state layer now resolves branches, acquires server-side deploy leases, sends lease headers with state requests, and maintains lease heartbeats. PostgreSQL bootstrap, migrations, advisory locks, teardown deletion, and related exports are removed. Tests now use an in-process state API fake and cover state operations, leases, migration guards, cleanup, and branch resolution. Documentation and ADRs describe the new lifecycle and migration procedure.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: moving deploy state to the platform Alchemy state API and adding deploy leases.
Description check ✅ Passed The description directly explains the state API migration, deploy leases, legacy-stage guard, tests, documentation, and live verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/alchemy-state-api-composer-60c6f6
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/alchemy-state-api-composer-60c6f6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/empty-scope.test.ts`:
- Around line 43-53: Extend the test around check(state) in “the message says
the stage predates the platform state API and how to cut over” to assert that
the error message also contains the required fresh-redeployment instruction.
Keep the existing assertions for legacy-stage wording, the previous Composer
version, and stage deletion unchanged.

In
`@packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/fake-state-api.ts`:
- Around line 99-103: Update FakeStateApi.stop() to resolve immediately when
this.server is absent, and track/force-close any open sockets before awaiting
server.close() so shutdown does not wait on keep-alive connections. Preserve
rejection of close errors and ensure the returned promise always settles
deterministically.

In `@packages/1-prisma-cloud/0-lowering/lowering/src/state/empty-scope.ts`:
- Around line 13-33: Update scopeOccupied to check all legacy resource types for
the branch, rather than relying only on app resources. Include Database and
Connection resources alongside Apps, and return true when any such resource
exists so failOnEmptyScopeWithLiveApps cannot proceed with an empty platform
state.

In `@packages/1-prisma-cloud/0-lowering/lowering/src/state/layer.ts`:
- Around line 94-101: Update the empty-scope handling around scopeOccupied and
failOnEmptyScopeWithLiveApps to detect all Composer-managed resource types on
the branch, not only applications, before allowing the deployment to proceed.
Extend or replace the guard so database- and bucket-only legacy stages with live
resources are rejected, while truly resource-free scopes retain the current
behavior, and add a regression test covering a database-only legacy stage.

In `@packages/1-prisma-cloud/0-lowering/lowering/src/state/lease.ts`:
- Around line 154-161: Update the lease-release response handling in the
Effect.flatMap callback to treat every non-2xx status as a failure and emit a
warning, rather than returning Effect.void for non-404 responses. Preserve the
existing specific message for status 404, and provide an appropriate failure
warning for other unsuccessful statuses such as 409 and 5xx.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 88198151-f152-4684-8960-1876ec59bfde

📥 Commits

Reviewing files that changed from the base of the PR and between f8b2e48 and 76b26da.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (45)
  • .github/workflows/ci.yml
  • architecture.config.json
  • docs/design/03-domain-model/glossary.md
  • docs/design/03-domain-model/layering.md
  • docs/design/10-domains/deploy-cli.md
  • docs/design/90-decisions/ADR-0010-deploys-hold-a-session-advisory-lock.md
  • docs/design/90-decisions/ADR-0012-the-state-store-speaks-sql-directly.md
  • docs/design/90-decisions/ADR-0034-deploy-state-lives-in-the-stage-branch.md
  • docs/design/90-decisions/ADR-0045-deploy-state-lives-behind-the-platform-state-api.md
  • docs/design/90-decisions/README.md
  • docs/guides/deploying.md
  • gotchas.md
  • packages/1-prisma-cloud/0-lowering/lowering/package.json
  • packages/1-prisma-cloud/0-lowering/lowering/src/client.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/exports/state.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/bootstrap.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/delete.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/empty-scope.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/fake-management-api.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/fake-state-api.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/harness.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/layer.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/lock.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/ownership.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/service.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/state-api.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/state.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/transient.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/bootstrap.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/delete.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/discovery.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/empty-scope.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/errors.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/layer.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/lease.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/lock.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/schema.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/service.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/transient.ts
  • packages/1-prisma-cloud/1-extensions/target/src/__tests__/invariants.test.ts
  • packages/1-prisma-cloud/1-extensions/target/src/__tests__/teardown.test.ts
  • packages/1-prisma-cloud/1-extensions/target/src/control/extension.ts
  • packages/1-prisma-cloud/1-extensions/target/src/teardown.ts
  • packages/9-public/composer-prisma-cloud/package.json
  • packages/9-public/composer/package.json
💤 Files with no reviewable changes (19)
  • architecture.config.json
  • packages/1-prisma-cloud/0-lowering/lowering/src/exports/state.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/ownership.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/service.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/schema.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/delete.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/state.test.ts
  • packages/1-prisma-cloud/1-extensions/target/src/teardown.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/service.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/transient.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/lock.ts
  • packages/1-prisma-cloud/1-extensions/target/src/tests/teardown.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/transient.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/bootstrap.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/bootstrap.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/harness.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/discovery.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/tests/lock.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/delete.ts

Comment thread packages/1-prisma-cloud/0-lowering/lowering/src/state/layer.ts
Comment thread packages/1-prisma-cloud/0-lowering/lowering/src/state/lease.ts Outdated
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…h resources

- the cutover guard now lists databases and buckets alongside Compute
  apps (Connections excluded: children of databases), so a legacy stage
  holding only a database or bucket is refused instead of silently
  re-provisioned; renamed to failOnEmptyScopeWithLiveResources, message
  reworded, regression tests for database-only / bucket-only / mixed
  branches; docs (ADR-0045, deploying guide) match the new wording
- releaseDeployLease logs a warning for every non-2xx release response
  (the lease stays live until TTL), keeping the specific 404 message
- FakeStateApi.stop() is deterministic: resolves immediately with no
  server and destroys open keep-alive sockets before close()

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@prisma/composer@209
npm i https://pkg.pr.new/@prisma/composer-prisma-cloud@209

commit: 1801bbe

@wmadden-electric wmadden-electric changed the title feat(prisma-cloud): adopt the platform Alchemy state API for deploy state feat(prisma-cloud): deploy state moves behind the platform Alchemy state API, with a deploy lease Aug 9, 2026
…uched

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric enabled auto-merge (squash) August 9, 2026 11:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design/03-domain-model/layering.md`:
- Around line 123-128: Qualify the concurrency guarantees in the layering
description and the corresponding statement in docs/guides/deploying.md (line
39) so they apply only while the server-side per-(stack, stage) lease remains
live. Do not claim that deployers can never race after lease expiry unless lease
loss actively interrupts the running apply.

In `@docs/guides/deploying.md`:
- Line 39: Update docs/guides/deploying.md lines 39-39 and 110-110 to describe
state lifetime separately: clarify what happens when a stage is deleted, when
production is destroyed, and when the Project itself is deleted. Remove or
qualify the claim that the production Branch always survives so it remains
consistent with the documented removal of an empty Project and its default
Branch.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 876fe750-0558-42dc-a651-115e544b38b4

📥 Commits

Reviewing files that changed from the base of the PR and between 76b26da and 1043d81.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • docs/design/03-domain-model/glossary.md
  • docs/design/03-domain-model/layering.md
  • docs/design/10-domains/deploy-cli.md
  • docs/design/90-decisions/ADR-0010-deploys-hold-a-session-advisory-lock.md
  • docs/design/90-decisions/ADR-0012-the-state-store-speaks-sql-directly.md
  • docs/design/90-decisions/ADR-0034-deploy-state-lives-in-the-stage-branch.md
  • docs/design/90-decisions/ADR-0045-deploy-state-lives-behind-the-platform-state-api.md
  • docs/guides/deploying.md
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/empty-scope.test.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/fake-management-api.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/__tests__/fake-state-api.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/empty-scope.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/layer.ts
  • packages/1-prisma-cloud/0-lowering/lowering/src/state/lease.ts

Comment thread docs/design/03-domain-model/layering.md
Comment thread docs/guides/deploying.md Outdated
…rdown state lifetimes

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric merged commit de78022 into main Aug 9, 2026
15 checks passed
@wmadden-electric
wmadden-electric deleted the claude/alchemy-state-api-composer-60c6f6 branch August 9, 2026 11:45
wmadden-electric added a commit that referenced this pull request Aug 9, 2026
Integration fixes after rebasing onto main (PR #209 replaced the SQL
state store with the platform state API):

- legacy-resources.test.ts round-trip suite now drives the REAL hosted
  layer (stateLayerAgainst -> stock HTTP client -> on-read migration)
  against the in-process fake state API instead of the deleted SQL
  store and Postgres harness; the pure migration and provider
  acceptance tests are unchanged
- the adoption ADR is renumbered ADR-0046 (main took 0043-0045);
  references updated
- lockfile regenerated on main's pins (effect beta.103 constellation,
  @prisma/management-api-sdk ^1.57.0, no postgres) plus
  @effect/platform-node for the upstream providers

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
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.

2 participants