Skip to content

feat(cli)!: prisma dev no longer starts the Alchemy CLI; it applies your app, and each edit to it, in a worker thread of its own process - #411

Merged
wmadden-electric merged 59 commits into
mainfrom
claude/alchemy-dev-in-process
Nov 18, 2026
Merged

wmadden-electric merged 59 commits into
mainfrom
claude/alchemy-dev-in-process

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

prisma dev used to start the Alchemy CLI as a second process each time it applied your app. Now it does that work itself. This is what runs while prisma dev is applying an edit, before and after:

before                                      after
prisma dev                                  prisma dev
└─ alchemy deploy alchemy.run.ts            └─ (a worker thread, in the same process)
   reads .prisma-composer/dev/dev/alchemy.run.ts
   reads an app configuration file
   reads secrets from PRISMA_COMPOSER_NAMED_SECRETS

What you see in the terminal is the same, and an edit to your app definition still applies without a restart:

$ prisma dev
✔ converge
dev: ready
shop.echo: http://localhost:3201

# save an edit to module.ts
▸ rebuild 1
✔ updated shop.echo.deployment
✔ rebuild 1
dev: ready

The decision

Each time prisma dev applies the app, it starts a new worker thread inside the prisma process, and the thread ends when the work ends. That happens once at start and once for every edit.

"Applying the app" (the code calls it a converge) is three steps: import prisma.config.ts and the app definition, turn the app into the local resources it needs, and have Alchemy create or update those resources. The worker does all three. The main thread watches files, sends the worker plain data, and gets back progress events, output text and a result.

prisma deploy already runs Alchemy in process since #405. This PR does the same for prisma dev. destroy is the one command left that starts the Alchemy CLI.

Why a worker thread and not the main thread

prisma deploy runs this work on the main thread, so the obvious design was to do the same in prisma dev. It does not work, for one reason: Node and Bun import a module once and then keep it. prisma dev applies the app many times. On the main thread, the second run would get the app definition as it was at start, and your edit would be ignored. The old design never met this problem, because every run was a new process.

A new worker thread has its own module cache, in Node 24 and in Bun 1.3. So a worker started after your edit imports the files as they are on disk.

The worker also has to do the rest of the work, not only the import. An app definition is made of functions, and functions cannot be copied from one thread to another. So the thread that imports the app is the thread that applies it.

Nothing is lost by this. prisma dev needs no Prisma credentials, so everything the worker needs can be sent to it as plain data.

What changes for users

  • Nothing is written for Alchemy to read. prisma dev no longer writes .prisma-composer/dev/<environment>/alchemy.run.ts or an app configuration file, and no longer puts secrets in the PRISMA_COMPOSER_NAMED_SECRETS environment variable. Values go to the worker in memory.
  • An edit to an app definition file is applied on save, as before. That covers the app's entry file and every app file it imports. A file that an edit newly imports is watched from then on, even when it does not exist yet or does not parse.
  • Each run shows as one step, converge at start and rebuild <n> after an edit, with its resources inside. This holds for the terminal and for --json.
  • What your app prints while it is being applied is redacted and shown as dev messages. One limit: code that writes straight to a file descriptor, such as a logger with its own destination, is not covered.
  • Ctrl-C during a run asks the worker to stop and waits for it. If the worker has not stopped after 30 seconds, prisma dev ends it and says so.

Three kinds of edit still need a restart of prisma dev. It tells you so, and leaves the running app as it was:

  • Adding or removing a node (a service, a database, a variable). That rebuild fails with a message that says to restart. main has the same limit today.
  • Making the app root use a field of its input that it did not use at start. That rebuild fails with a message that names the field and says to restart.
  • Changing which platform variables the app reads. Rebuilds pause until the restart. main was meant to do this too, but its check ran in the first process, which held the app as it was at start, so it could never see such an edit. The check now runs in the worker and works.

One more case needs a restart under Bun only. If you write an import of a directory (./lib, meaning lib/index.ts) before the directory or its index.ts exists, Bun keeps that failed lookup for as long as the process runs. prisma dev says so when you create the file. An import of a file is not affected.

Breaking changes

  • renderDevStackFile is removed from @prisma/composer-cli/testing.
  • The error code DEV.STACK_WRITE_FAILED is retired. New codes: DEV.INTERRUPTED, DEV.CONVERGE_RUNNING, DEV.WORKER_THREAD, DEV.ENVIRONMENT_WRITE_FAILED.
  • A program that calls the dev operation with a cwd other than its own working directory will see its working directory change to cwd while each run lasts, and change back after. A worker thread cannot change directory, so the main thread does it.
  • @prisma/composer/deploy exports three new names for tooling: GRAPH_CHANGED_ERROR, ROOT_INPUT_UNREAD_ERROR and comparableProps. Under prisma deploy, a root input field that was not read at start is now reported under the name RootInputUnreadError in the engine failure's reasons; it was COMPOSE.GRAPH_INVALID.
  • The entry the host loads from the app's own install of Composer (@prisma/composer/internal/converge) has two more exports, localTargetProviders and devState. Its contract number stays 2, because no release has shipped contract 2.

Where to read

  • The decision record: docs/design/90-decisions/ADR-0067-prisma-dev-converges-in-a-worker-thread.md. It extends ADR-0066, the record for prisma deploy.
  • The worker: packages/0-framework/3-tooling/cli/src/operations/dev-converge-worker.ts.
  • The main thread's side of it: operations/dev-converge-in-worker.ts.
  • The data that crosses between them: operations/dev-converge.ts and operations/dev-converge-messages.ts.
  • The rule that one process applies one app at a time, shared with deploy: converge-process.ts.

Testing

  • Automated, with a real worker and an app on disk, under Bun and under Node. An edit to an imported file reaches the next run. A run is interrupted. A worker ignores the interruption. An edited file has a syntax error. A worker exits early. The app prints a secret through each console method that prints, through a method imported from node:console, and through process.stdout. The working directory is reached through a symlink. An edit adds a platform variable read. An edit imports a new file.
  • Automated, other. A deploy and a dev run in one process refuse each other. The built @prisma/composer and @prisma/composer-cli packages contain the worker file beside the code that starts it. local-dev-store.integration.ts passes through the real prisma dev.
  • By hand, on the store example (two Postgres databases, three services, a cron job and a Next.js front end run by next dev), under Bun: start, a schedule edit applied on save, Ctrl-C, --detach, dev stop.
  • By hand, on the root-input example, under Bun and Node: start, an edit applied on save, a syntax error and its fix, an added node, an added platform variable read, a newly imported file (also one that did not exist yet), a newly imported file in a directory that did not exist yet, a new root input field, Ctrl-C while idle and during a rebuild.
  • In every run by hand, no alchemy process ran, and no stack file or app configuration file was written.

Not in this PR

  • destroy still generates a stack file and starts the Alchemy CLI.
  • Applying an added or removed node without a restart.

Alternatives considered

  • Import the app in a child process or worker, send the result back, and apply it on the main thread. The app definition is made of functions, which cannot be sent.
  • A new child process for every run. It works. It needs a process start, a protocol between two processes, and exit codes, none of which a worker needs.
  • Tell the user to restart prisma dev after every edit to the app definition. Such an edit applied without a restart before this change, so this would be a step back.
  • Import edited files again on the main thread through a module loader hook. Node has such hooks and Bun does not, and each reload would keep the earlier copy of every module in memory.

Agent: dante-73 (opened by maat-73)

🤖 Generated with Claude Code

wmadden-electric and others added 9 commits October 30, 2026 16:33
Every alchemy pin is now https://pkg.alchemy.run/alchemy/972f294ae0c7982a8ebcb551fadd07d29c9c0fca, and effect with every @effect/* companion is 4.1.0, which that build needs as its peer.

The build is 2.0.0-beta.84 plus later commits. What changed for us:

- The Prisma provider moved out of alchemy into @alchemy.run/prisma, pinned at the same commit. Imports of alchemy/Prisma now use it.
- @distilled.cloud/prisma is pinned to the exact tarball @alchemy.run/prisma depends on, so there is one copy.
- alchemy/Test/Core moved to @alchemy.run/test, which is not published. Provider tests use scratchStack and runScratch from the new @internal/lowering/testing entry, a port of the parts we used.
- Prisma.CustomDomain now waits for the CNAME on real nameservers before it registers a domain; the public URL test stubs node:dns/promises.
- Alchemy has a new --adopt message for replacements; withComposerAdvice rewrites it.

check:npm-effect-resolution now also asserts a single alchemy in the npm tree. The upgrade-alchemy-effect skill explains how to pin a preview build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…slice 1 review

- check:publish-deps fails on a URL, git or file: dependency in a published package, and says to swap a pkg.alchemy.run preview for a release. It runs only in the publish workflow, so PR CI is unaffected.
- alchemy, @alchemy.run/prisma, @distilled.cloud/prisma, effect and the @effect/platform-* packages are pinned once, in the pnpm catalog.
- check:npm-effect-resolution also asserts one @alchemy.run/prisma and one @distilled.cloud/prisma; its comments describe the current peers.
- @prisma/composer drops @effect/sql-d1, @effect/sql-sqlite-do and @effect/vitest, which alchemy no longer needs.
- @internal/lowering/testing is now @internal/lowering/scratch-stack, and the scratch stack no longer takes a state it ignored.
- withComposerAdvice rewrites the Prisma provider's adoption advice too, and a test scans the provider sources for it.
- The DNS stub keeps the rest of node:dns/promises. ADR-0048 and the deploying guide are updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…aluation-5f1d17

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	docs/design/90-decisions/README.md
#	packages/1-prisma-cloud/0-lowering/local-target/src/compute.ts
#	packages/9-public/composer/package.json
#	pnpm-lock.yaml
#	test/integration/package.json
prisma deploy and the deploy operation now lower the app and call
Alchemist.plan and Alchemist.apply in process. No alchemy.run.ts is written
and no Alchemy child is spawned. destroy and prisma dev keep the stack file.

- lower() takes containers and preflight payloads as values; extensions read
  their payload as LowerContext.preflight. The env transports stay for the
  stack file.
- The report hook returns the summary as a value.
- Alchemy events become apply-resource steps under deploy.apply; log lines
  become messages.
- Failures are DEPLOY.ENGINE_FAILED with the cause; Ctrl-C is
  DEPLOY.INTERRUPTED and closes the scope, releasing the lease.
- prisma deploy needs PRISMA_SERVICE_TOKEN in the environment
  (DEPLOY.SERVICE_TOKEN_REQUIRED): cli-engine 0.9.0 has no public way to
  hand a command the active access token.
- convergeInProcess is the function slice 3 (dev) reuses.
- scratch-stack test harness rebuilt on alchemy/Alchemist.
- ADR-0064 supersedes ADR-0007 for deploy; amends ADR-0038/0043/0044.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…state

- Load lower and convergeInProcess from the app's own @prisma/composer
  (new @prisma/composer/internal/converge entry), resolved from the app
  directory; DEPS.ENGINE_UNRESOLVABLE when it cannot be loaded.
- lower() takes containers and preflight payloads as required values;
  transportedLowerInputs() reads both transports for the generated stack
  files. Core invariant 4 pins process.env to that helper.
- convergeInProcess refuses a second concurrent run
  (DEPLOY.CONVERGE_RUNNING) and a worker thread that would need chdir
  (DEPLOY.WORKER_THREAD); every process state change is inside the try;
  Alchemy interaction output goes to stderr; it takes the operation and
  returns typed failure reasons.
- The console redirect moved to the prisma deploy command.
- Messages, the engine failure and stack-building errors are redacted.
- The service-token check moved into the operation, before preflight and
  ensure. The command passes a token only for an environment credential,
  with that credential's workspace, and PRISMA_WORKSPACE_ID is removed
  when it names none. credentials carries the token; convergeEnv is gone.
- family/converge.ts is now family/dev-converge-child.ts.
- Docs: ADR-0044 registry, ADR-0064, ADR-0043, ADR-0049, ADR-0062,
  build-reporting.md, deploy-cli.md and the deploying guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
- Rename the app-loaded pair to AppConverge / loadAppConverge and the
  code to DEPS.CONVERGE_UNRESOLVABLE; add "converge" to the glossary.
- loadAppConverge refuses an app @prisma/composer at a version other
  than the host's (DEPS.CONVERGE_VERSION_MISMATCH, naming both), and
  resolves the install from the directory of prisma.config.ts.
- A rejected converge promise is DEPLOY.ENGINE_FAILED.
- The one-converge-per-process flag lives on globalThis under a
  Symbol.for key, so every install shares it.
- withProcessState restores the environment before the directory, and
  the running flag is set inside the try that clears it.
- An interrupted prisma deploy reports DEPLOY.INTERRUPTED as a message
  and ends with the engine abort, so it exits 130.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…on a failed chdir

- @prisma/composer/internal/converge-contract exports CONVERGE_CONTRACT;
  loadAppConverge reads it before loading the converge and refuses a
  different number with DEPS.CONVERGE_CONTRACT_MISMATCH, naming both
  contracts and both versions and saying which side to upgrade. Package
  versions may differ.
- A failed chdir back to a removed directory no longer replaces the
  converge outcome.
- ADR-0064, ADR-0044, the ADR index, deploy-cli.md, the glossary and the
  deploying guide follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ocess

prisma dev, and the dev operation, now lower the app against the local
target and run Alchemy's plan and apply in the prisma process, for the
first converge and every rebuild. No .prisma-composer/dev/<env>/alchemy.run.ts
is written and no Alchemy child is spawned. destroy keeps the child.

- The app's @prisma/composer/internal/converge also exports
  localTargetProviders and devState; CONVERGE_CONTRACT is 2.
- Each converge has its own scope, so the state lease is held only while it
  runs. Rebuilds stay one at a time and coalesce.
- Converge progress reaches the user as converge-resource and
  converge-message dev events; prisma dev renders them as steps and
  messages, with console stdout sent to stderr for the session.
- A failed first converge is DEV.CONVERGE_FAILED with the reasons; a failed
  rebuild is a converge-failed event with the cause, keeping the app. No
  stack file path or reproduce command.
- DevInput.signal interrupts a running converge: the first one fails with
  DEV.INTERRUPTED (prisma dev exits 130); stop() interrupts a rebuild's
  converge and waits for it before stopping services.
- The app is imported once per process, so an edit to the entry module or a
  service's authoring module is reported (definition-changed) and rebuilds
  pause until dev restarts.
- Deleted generate-dev-stack.ts, family/dev-converge-child.ts, the orphaned
  fake-child fixture, and renderDevStackFile from the testing entry.
  DEV.STACK_WRITE_FAILED becomes DEV.STATE_WRITE_FAILED.
- ADR-0064 extended to dev; deploy-cli.md, local-dev.md, guides, the skill
  and the amended ADRs updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…steps, dev codes

- dev records every app file (outside node_modules) the entry import
  loaded: under Node through the existing resolve hook (observe only), under
  Bun from the modules require.cache gained, which includes ES modules. A
  Bun.plugin onResolve sees only dynamic imports, so it is not used. These
  app definition files, plus each authoring module, are hashed and watched;
  an edit to any of them is definition-changed.
- One step tracker and one converge-event mapper for deploy and dev. Each
  dev converge is a step (dev.converge, dev.rebuild.<n>) with its resources
  inside it, and every step it opened is closed when it ends.
- A refused dev converge is DEV.CONVERGE_RUNNING or DEV.WORKER_THREAD, on
  the first converge and in a rebuild's converge-failed event.
- DEV.STATE_WRITE_FAILED is DEV.ENVIRONMENT_WRITE_FAILED.
- stop() waits only for a running converge; a rebuild still in its pipeline
  returns before converging.
- CONVERGE_CONTRACT stays 1: contract 1 was never published.
- The store integration test edits a sub-module's module.ts while dev runs
  and checks for the restart notice and that nothing converges.
- Docs use "app definition files" throughout; running-locally.md no longer
  overstates or understates what is detected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@prisma-gizmo

prisma-gizmo Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Gizmo reviewed f5ebd8a — posted 0 inline comment(s) this pass.

Open findings: none

Change walkthrough

This delta refines how prisma dev reports Bun's stuck directory-import lookups: instead of the worker appending a restart notice to the error summary, the worker returns a structured lookupKept flag and the main thread composes the message, with detection narrowed from "any named file now exists" to "the named directory has an index.ts now". Docs and tests are updated to match.

Worker/main-thread split (dev-converge-worker.ts, execute-dev.ts:232-239) — the old code mutated error.summary in the worker with user-facing prose; the new flow keeps the worker's result plain data (lookupKept?: true on the error variant of DevConvergeResult in dev-converge.ts:74-75) and appends the LOOKUP_KEPT notice to the failure message on the main thread, which owns redaction and presentation. This mirrors how the other restart notices (NODES_CHANGED, root-input) are already composed in execute-dev.ts.

Detection refinement (entry-resolution.ts:102-105) — the error-chain walk was extracted into appPathNamedBy without changing appFilesNamedBy's behavior; the new namesDirectoryWithIndex predicate fires only when the error names an app directory whose in-directory candidate (index.ts) exists. Creating a plain file such as lib.ts after a failed ./lib import no longer triggers the restart notice, matching Bun's actual caching behavior (only directory lookups stay stuck) and the documented rule that file imports are unaffected. The flag is still gated on process.versions.bun in the worker, so Node behavior is untouched.

Docs and tests — ADR-0067, its index entry in the ADR README, and the app-definition-watching paragraph in the running-locally guide now record the Bun directory-import exception in the same terms the code uses. The worker tests assert both sides: a parse error leaves lookupKept undefined, and the two-converge Bun scenario asserts the first failure carries no restart notice while the second carries the new wording, which matches the LOOKUP_KEPT constant exactly.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 14854423-cc98-4a00-94fc-e4def51df375
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: f5ebd8a

wmadden-electric and others added 3 commits November 3, 2026 10:56
@alchemy.run/prisma moves to 2.0.0-beta.85 with it, and @distilled.cloud/prisma to 1.0.0-rc.18, the version it depends on. effect stays at 4.1.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…my-deploy-in-process

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ev-in-process

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wmadden-electric and others added 14 commits November 5, 2026 13:38
…anch

Keep our catalog pins (alchemy and @alchemy.run/prisma 2.0.0-beta.85, @distilled.cloud/prisma 1.0.0-rc.18, effect 4.1.0) and scratch-stack test imports. Take #402's footprint check (no @effect/vitest, vitest or vite; no @alchemy.run/prisma without the Prisma Cloud package), its process-listener check on the provider import, its ADR-0048 amendment and its effect-family pin rule in the upgrade skill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…my-deploy-in-process

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ev-in-process

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…sma token optional

alchemy-run/alchemy#3101 and alchemy-run/distilled#1076 let PrismaEnvironment and Distilled Credentials omit the service token, so an HttpClient can authenticate requests itself. Pin alchemy, @alchemy.run/prisma and @distilled.cloud/prisma to the pr:3101:ab55f95 previews, and move effect and its companions to 4.1.2, the floor of that Distilled build's effect peer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…tate

LowerOptions.credentials carries what the caller already authenticated. Core passes it to each extension's providers() and to the state descriptor's create(), so an extension can use the engine's client inside the converge instead of reading a token from process.env.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…plied client

The Prisma provider bundle and the hosted state store now take the caller's Management API client (ctx.api under prisma deploy). Composer's own resources use it directly. Alchemy's providers, Distilled's operations and the state store get an Effect HttpClient that sends Management API requests through the client's per-method calls, with the body, query and headers unchanged and the response read as a stream; other hosts, such as presigned upload URLs, go to node's transport. PrismaEnvironment and Credentials carry only the base URL, so nothing but the client sets Authorization. Without a supplied client, one is built from PRISMA_SERVICE_TOKEN and used the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Deploy passes ctx.api and the active credential's workspace to lower() as values, so the providers authenticate through the engine's refreshing client. DEPLOY.SERVICE_TOKEN_REQUIRED, the command's serviceToken plumbing and the PRISMA_SERVICE_TOKEN and PRISMA_WORKSPACE_ID entries of the converge's environment overlay are removed. CONVERGE_CONTRACT goes to 2: an app on contract 1 would ignore the credentials and look for a token in the environment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
ADR-0064's credentials section now records that every Management API request goes through the engine's client, and why: cli-engine keeps tokens away from commands. The deploy-cli domain doc, ADR-0044's code list, the guides and the core-concepts skill drop DEPLOY.SERVICE_TOKEN_REQUIRED, and the guides again say prisma auth login is enough for prisma deploy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…its peer

npm ls compares dependency specs, so the pr:3101 URL and the tarball URL the provider names as its alchemy peer count as different packages even though one redirects to the other, and check:npm-effect-resolution failed on an invalid alchemy. Pinning the tarball URL makes the specs match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ev-in-process

Brings slice 4 (deploy authenticates through ctx.api) into the dev branch. Conflicts were in ADR-0044, ADR-0064 and the ADR index, where the dev amendments and the removal of DEPLOY.SERVICE_TOKEN_REQUIRED are combined, and in CLI tests that now pass the dev converge entries alongside credentials without a token.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
- The deploy HttpClient (renamed deployHttpClientLayer) removes every
  request's own Authorization, so only the supplied client authenticates.
  The state store no longer strips it itself.
- With a supplied client, Management API requests are recognised by the
  origin from PRISMA_MANAGEMENT_API_URL, as the prisma CLI reads it. A
  PRISMA_API_URL naming another host fails with
  DEPLOY.MANAGEMENT_API_URL_CONFLICT before any container is resolved.
- Rebuilt JSON error bodies keep a JSON string's quotes.
- One choice between the supplied client and a token-built one
  (suppliedOrFromEnv), used by the providers and the state store.
- providers({ credentials }) takes an input object, like preflight.
- ContainerCredentials is renamed CallerCredentials, in its own module.
- PrismaEnvironment no longer claims an environment service token when a
  client is supplied.
- Tests: Authorization removal, env-built client keeps its token, JSON
  string error body, byte/form/stream bodies with a 401 retry under bun
  and node, env-only path sends Bearer, host conflict and match, and the
  state store over a supplied client.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ev-in-process

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l deploy

The deploy HTTP client provided its custom Fetch only while building
FetchHttpClient.layer. The fetch client reads Fetch when it sends, from
the context it was first built in, and a real deploy has already built
FetchHttpClient.layer in the same layer memo map. The state store reused
that instance, sent its requests with global fetch and the empty bearer
token, and got HTTP 401 under a prisma login session.

Provide Fetch on each Management API request instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ev-in-process

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wmadden-electric and others added 5 commits November 18, 2026 12:08
…the follow-ups from the #405 merge

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Each dev converge now runs in a new worker thread, which imports the
config and the app as they are on disk, so an edit to an app definition
file rebuilds and converges instead of pausing dev. The main thread holds
the one-converge flag and changes to dev's cwd for the worker's life,
forwards its events and output through the existing redacted paths, and
turns an interruption, a crash or an early exit into an outcome.

An edit that adds or removes a node fails the rebuild saying dev must be
restarted. The definition-changed event is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…isma process

Records why the app graph cannot be handed between threads, what crosses to the worker, how interruption and output are handled, and the limit that adding or removing a node still needs a restart. Amends the records, glossary, domain docs, guides and skill that described the dev stack file, the dev app configuration file and PRISMA_COMPOSER_NAMED_SECRETS.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
- Replace the worker's console methods and forward warnings under Bun, so
  nothing the app prints reaches the terminal unredacted.
- Give the worker the cwd as the process resolves it, so a relative or
  symlinked cwd converges.
- Compare the start graph's value reads with the edited app's in the
  worker, and pause with value-reads-changed when they differ.
- Watch the app files a rebuild's import newly loads.
- Send only each bundle's dir and entry; the in-thread seam clones the job.
- Register the resolve hook before importing prisma.config.ts.
- Keep a structured error's code, why and fix across the thread.
- An aborted dev signal stops the session.
- Rename the runner to runDevConvergeInWorker; correct the help text, the
  stop-timeout message and code text about dev's second process.
- Pin localTargetProviders and devState in the converge contract test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The worker checks the platform variables the app reads and pauses on a change; newly imported files are watched; dev holds no state lease; the error registry lists the codes dev raises and retires DEV.STACK_WRITE_FAILED.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric wmadden-electric changed the title Run prisma dev converges in the prisma process prisma dev runs each converge in a worker thread of the prisma process, with no Alchemy child Nov 18, 2026
wmadden-electric and others added 2 commits November 18, 2026 13:34
- Replace every function on the worker's console, including Bun's
  console.write.
- A failed import still returns the app files it recorded and the file
  its error names, so dev watches a file an edit imports before it exists.
- Compare value-reads props in a plain form both sides share.
- A first converge that sees other reads names them and no longer blames
  the module body.
- DevConvergeResult is an outcome, an error envelope or
  value-reads-changed.
- Correct two core messages for all three commands.
- Take the real path of cwd once in executeDev; a directory mismatch inside
  the worker is reported as an internal fault.
- Document DevInput.cwd and signal, and holdingConvergeProcess.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The decision record sample matches the code, the limits on redaction and on which edits still need a restart are stated, and the skill no longer says prisma dev starts Alchemy as a child.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric marked this pull request as ready for review November 18, 2026 02:49
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo 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.

New findings: 🟡 2 minor · trace

@wmadden-electric wmadden-electric changed the title prisma dev runs each converge in a worker thread of the prisma process, with no Alchemy child feat(cli)!: prisma dev no longer starts the Alchemy CLI; it applies your app, and each edit to it, in a worker thread of its own process Nov 18, 2026
wmadden-electric and others added 6 commits November 18, 2026 18:14
…from an exports shim

A character split across two chunks of the worker's stdout or stderr no longer prints as replacement characters. The worker build entry now points at src/exports like every other entry. The record-app-files test passes its paths as arguments instead of writing them into a script.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
- Build the console replacement from console.Console, so app code that imports node:console under Bun is redacted; leave the inspector-only console methods alone.
- Watch every file the resolve hook would try for a missing import, and a file whose directory does not exist yet through its nearest existing ancestor.
- Stop appFilesNamedBy on a looping cause chain and on a file URL with no local path.
- Core exports propsAsData, which describes resource props as plain data, Values and Dates included; value reads compare through it.
- Core names the error for a root input field an earlier Load did not read, and prisma dev reports it in its own words.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…-process

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	docs/design/10-domains/local-dev.md
#	docs/design/90-decisions/README.md
#	docs/guides/running-locally.md
#	packages/0-framework/3-tooling/cli/src/dev/__tests__/value-reads-change.test.ts
#	skills/prisma-composer-core-concepts/SKILL.md
- A failed import that names an existing directory now names the index
  file inside it, never the directory, so dev no longer watches a
  directory recursively. A missing path with a TypeScript extension is
  named alone.
- comparableProps (was propsAsData) moves to @internal/core/deploy, off
  the @prisma/composer root entry.
- Dev prints core's sentence, which names the field, after its own
  message for a root input field it did not read; on the first converge
  it gives the causes at start instead.
- The worker's console.write behaves as Bun's: no separator, byte
  arrays and ArrayBuffers as text, the byte count returned.
- Comments corrected or removed as the review asked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo 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.

New findings: none · trace

@prisma-gizmo prisma-gizmo 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.

No Gizmo finding is open and the head commit has been reviewed. Approving.

…s a dot, and say when Bun keeps a failed directory lookup

The rule for which files an import can resolve to lives in sourceCandidates alone again, so a missing ./app.config watches app.config.ts. Under Bun, a directory import that failed once keeps failing for the life of the process; the rebuild now says to restart prisma dev.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo 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.

New findings: 🟡 1 minor · trace

…reports the failure

The worker returns the import error unchanged with a flag; the main thread adds the sentence, and only when the import names a directory that now has an index.ts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

@prisma-gizmo prisma-gizmo 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.

New findings: none · trace

@prisma-gizmo prisma-gizmo 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.

No Gizmo finding is open and the head commit has been reviewed. Approving.

@wmadden-electric
wmadden-electric merged commit bb87e01 into main Nov 18, 2026
33 of 35 checks passed
@wmadden-electric
wmadden-electric deleted the claude/alchemy-dev-in-process branch November 18, 2026 10:20
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.

3 participants