Repository navigation
feat(prisma)!: allow a caller-built PrismaEnvironment without a service token - #3101
Conversation
…ce token A host can now authenticate Management API requests in its own HttpClient. PrismaEnvironmentShape.serviceToken is optional, and the client, the Credentials bridge and the deployment and build log request builders set Authorization only when a token is present. The Authorization header on DeploymentLogsRequest and BuildLogsRequest is optional as a result. Env and profile resolution still require a token. Bumps submodules/distilled to the Distilled change that makes Credentials.apiToken optional. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ive Database suite Replace the one-off HostAuthenticatedTransport test, which faked the Management API and called the Project provider's read directly, with a live case in Database.test.ts. It deploys a Project and a Database through providers built from the public pieces, with a PrismaEnvironment that has no service token and an HttpClient that wraps the real one and adds the token itself. It checks that no request reached that HttpClient with an Authorization header already set, then destroys and verifies both are gone. LogsClient.test.ts gains a case for log requests built 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]>
Point submodules/distilled at 316230dcf, the tip of the Distilled branch that makes Credentials.apiToken optional. Move it to that change's merged commit on distilled main once the Distilled PR merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Point submodules/distilled at 27e36ba66, the new tip of the Distilled branch. It only rewords the credentials docs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:3101:61e056d@alchemy.run (5)pnpm install https://pkg.alchemy.run/@alchemy.run/prisma/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3101:61e056dTransitive Dependencies (6)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@distilled.cloud/s3/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3101:61e056dpnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3101:61e056dPublished |
…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]>
# Conflicts: # submodules/distilled
# Conflicts: # submodules/distilled
…into prisma-transport-auth
# Conflicts: # submodules/distilled
|
@wmadden before we merge this, can you explain why Composer needs to authenticate through the Composer and Alchemy run in the same process, so Composer can read the login token from the CLI and hand it to Alchemy directly: Layer.succeed(Prisma.PrismaEnvironment, {
type: "serviceToken",
source: { type: "stored" },
baseUrl: "https://api.prisma.io",
serviceToken: Redacted.make(loginToken),
});Keeping the token out of Alchemy doesn't protect anything when both run in one program, so we don't see what the The If the concern is that the login token expires and the CLI refreshes it, we'd rather fix that in Alchemy: let serviceToken: cli.getAccessToken, // Effect<Redacted<string>>, run per requestIs there a reason that wouldn't work for Composer? |
|
@sam-goodwin good question. The reason isn't to hide the token from Alchemy. It's to let the Composer gives Alchemy an A token passed to Alchemy, through an env var or the programmatic API, can't do that without Alchemy reimplementing it. The env var is still a good fallback, especially in CI. But now that Alchemy has a programmatic API, I'd rather plug it into the system we already rely on for authentication. On logs: this change doesn't break log tailing for anyone. When a token is present, from |
…s Alchemy in the prisma process (#405) * Move alchemy to the preview build of commit 972f294 and effect to 4.1.0 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]> * Block publishing preview pins, pin the alchemy set once, and address 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]> * Run deploy through alchemy/Alchemist in the prisma process 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]> * Address slice 2 review: app install, values-only lower, safe process 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]> * Address slice 2 round 2 review: version check, shared flag, exit 130 - 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]> * Check a converge contract, not the package version; keep the outcome 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]> * Pin alchemy 2.0.0-beta.85 from npm instead of the preview build @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]> * build(deps): pin the alchemy and distilled previews that make the Prisma 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]> * feat(core): lower() hands the caller's credentials to providers and state 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]> * feat(prisma-cloud): send every Management API request through the supplied 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]> * feat(cli): prisma deploy works with a prisma login session 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]> * docs: deploy authenticates through ctx.api 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]> * build(deps): pin alchemy to the tarball @alchemy.run/prisma names as 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]> * fix(prisma-cloud): address slice 4 review of deploy through ctx.api - 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]> * fix(prisma-cloud): send state store requests through ctx.api in a real 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]> * ci: build lowering dependencies before the logical-id resolution check The check runs lowering source directly, which now imports @internal/foundation/errors from its built dist. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(cli): keep the converge contract at 2 No release has shipped contract 2, so the merge with main does not need a new number. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix: scan provider subdirectories and catch aliased or path preview pins The adoption-message test now reads the provider source recursively. check:publish-deps unwraps npm: aliases and flags bare path specs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix: check:publish-deps flags GitHub user/repo shorthand specs Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test: pin that scoped registry specs pass check:publish-deps Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test(cli): run the module() entry deploy test through the in-process converge Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * build(deps): move Alchemy from the #3101 preview to the 2.0.0-beta.87 release alchemy and @alchemy.run/prisma 2.0.0-beta.87, @distilled.cloud/prisma 1.0.0-rc.20, and effect with its companions at 4.1.4 replace the pkg.alchemy.run preview pins, so check:publish-deps passes. beta.87 changes two types Composer uses: - PrismaEnvironment holds an Effect that Alchemy runs on every request. - Provider lifecycle methods must fail with Provider.ProviderError. The new providerFailure helper in @internal/lowering keeps tagged errors and wraps others with the same message; OrmMigrationError gains a _tag so it still reaches callers unwrapped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(deploy): address the consolidation review of the in-process deploy - Deploy refuses a plain value Load read that holds a known secret (CONFIG.SECRET_AS_PLAIN_VALUE) before anything is created. - lower() reads containers and preflight payloads from the environment when the caller passes neither, and the generated stack files import only lower again, so dev and destroy work across Composer versions. - Deploy passes the graph's node addresses to lower(), so the second Load's address check runs. - DeploymentSummary carries the preflight findings; prisma deploy renders the end-of-report list from it. - toProviderError moves to core; a wrapped failure is reported as the error it wraps, and any tagged object keeps its tag and message. - Alchemy's terminal output and the command's console redirect are redacted. - PRISMA_API_URL conflicts are the structured error wherever they arise. - Renames: AppConvergeEntry, loadAppConvergeEntry, LowerOptions.preflightPayloads, DeployStep.resourceId, managementApiHttpClientLayer, tokenClientOrigin, preflightView. - A type test pins the five converge contract 2 shapes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs: match the deploy refusal, the lower() fallback and the renames Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(deploy): the rest of the consolidation review fixes The previous commit held only the file moves and the restored stack generators; this one holds the code and tests its message describes: the secret refusal on deploy, the lower() environment fallback, the address check, findings on DeploymentSummary, toProviderError in core, redacted terminal and console output, the structured URL conflict, the renames and the converge contract type test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(adr): ADR-0065 records the fallback, the second Load check and the secret refusal Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(redaction): find each secret in its JSON and util.inspect escaped forms A secret with a newline, quote or backslash is escaped when JSON.stringify or util.format prints it, so the plain search missed it in a failure reason built from a thrown object and in redirected console output. The one matcher every redaction path uses now also searches for those escaped forms. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(core): lower() reads the transports only when both values are absent, and reads the findings there too Both containers and preflightPayloads present uses the values; both absent reads both, and the preflight findings, from the environment through transportedLowerInputs; exactly one throws. A 0.39.0 host whose generated deploy file hands the findings through PRISMA_COMPOSER_PREFLIGHT_FINDINGS keeps its closing list. The doc comment, ADR-0065 and deploy-cli.md state the rule in the same words. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * refactor(lowering): providers() and prismaStateLayer() resolve a supplied client's origin at their top managementApiOrigin(clientSupplied) hid a synchronous throw and an environment read behind an Effect and a boolean. Both callers now call suppliedClientOrigin(process.env) openly before any layer is built, so DEPLOY.MANAGEMENT_API_URL_CONFLICT is still thrown to the caller, and use tokenClientOrigin() inside the layer otherwise. The providers doc comment is cut to what a caller needs. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(deploy): Alchemy's terminal text becomes message events; the provider wrapper and the secret check get their own surfaces - The deploy operation prints nothing itself. Its handler for ConvergeRequest.output turns Alchemy's terminal text into info message events, one per complete line, redacted, and sends the last partial line when the converge ends on every path. A throw from the output handler no longer fails the apply. - Core exports wrappedProviderError, which returns the original error of a provider failure toProviderError wrapped. The converge's failureReasons uses it and recognises a structured error with CliStructuredError.is. ProviderFailure and PROVIDER_FAILURE_TAG are no longer exported. - refuseSecretsIn moves to secret-as-plain-value.ts, and each caller passes its own sentence instead of a carrier name. - The operations describe title says "the app converge entry". Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test(deploy): pin the nested contract shapes, and show the closing list comes from the summary The converge contract type test writes out PreflightFindings, AppConfigurationRead, Bundle and DeployedNode's address and entities, so a change inside one fails it; opaque types stay by reference. The command test gives the summary and the preflight-findings event different findings and asserts the closing list is the summary's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(examples): the email example says deploy never uploads its secret Since #426 prisma deploy copies no local value to Prisma Cloud. The comment now says to set EMAIL_DELIVERY_CREDENTIAL with prisma project env add. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test(core): type the findings fixture in the transport test Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs: ADR-0065 and deploy-cli match the round 2 fixes Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(adr): ADR-0044 says where the Management API URL conflict is raised Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test(cli): build the fake token so the secret scanner does not flag it Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * refactor(cli): split the secret refusal by what it checks, and correct the documents after the merge Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(deploy): remove the unreachable findings transport and correct messages that describe a second process A host on Composer 0.39 or earlier can no longer reach lower() on this version, because the app configuration file changed, so nothing can set PRISMA_COMPOSER_PREFLIGHT_FINDINGS. Its reader and reserved-name check are removed. Error messages no longer say a deploy has a second process or writes a file. The secret refusal names the platform secret. The app configuration file reader says the usual cause of a wrong shape is a host and an app on different Composer versions. ADR-0065, the glossary, deploy-cli.md and the guide state which commands fail across versions, when each command refuses a secret in a plain value, and that destroy knows only the secrets its config list holds. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…our app, and each edit to it, in a worker thread of its own process (#411) * Move alchemy to the preview build of commit 972f294 and effect to 4.1.0 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]> * Block publishing preview pins, pin the alchemy set once, and address 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]> * Run deploy through alchemy/Alchemist in the prisma process 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]> * Address slice 2 review: app install, values-only lower, safe process 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]> * Address slice 2 round 2 review: version check, shared flag, exit 130 - 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]> * Check a converge contract, not the package version; keep the outcome 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]> * Run prisma dev's converges through alchemy/Alchemist in the prisma process 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]> * Address slice 3 review: complete app-file detection, shared converge 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]> * Pin alchemy 2.0.0-beta.85 from npm instead of the preview build @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]> * build(deps): pin the alchemy and distilled previews that make the Prisma 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]> * feat(core): lower() hands the caller's credentials to providers and state 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]> * feat(prisma-cloud): send every Management API request through the supplied 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]> * feat(cli): prisma deploy works with a prisma login session 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]> * docs: deploy authenticates through ctx.api 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]> * build(deps): pin alchemy to the tarball @alchemy.run/prisma names as 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]> * fix(prisma-cloud): address slice 4 review of deploy through ctx.api - 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]> * fix(prisma-cloud): send state store requests through ctx.api in a real 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]> * ci: build lowering dependencies before the logical-id resolution check The check runs lowering source directly, which now imports @internal/foundation/errors from its built dist. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(cli): keep the converge contract at 2 No release has shipped contract 2, so the merge with main does not need a new number. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix: scan provider subdirectories and catch aliased or path preview pins The adoption-message test now reads the provider source recursively. check:publish-deps unwraps npm: aliases and flags bare path specs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix: check:publish-deps flags GitHub user/repo shorthand specs Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test: pin that scoped registry specs pass check:publish-deps Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * test(cli): run the module() entry deploy test through the in-process converge Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(drive): alchemy-programmatic-api project folder and handover Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(drive): record follow-ups from the #405 consolidation and the open dev reload design Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * docs(drive): record the worker-thread decision for dev converges and 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]> * feat(dev): run each prisma dev converge in a new worker thread 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]> * docs: ADR-0067, prisma dev converges in a new worker thread of the prisma 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]> * fix(dev): address the review of the converge worker - 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]> * docs: align the dev worker documents with the review fixes 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]> * fix(dev): address the second review of the converge worker - 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]> * docs: align the dev worker documents with the second review 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]> * fix(dev): decode worker output as UTF-8 streams and build the worker 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]> * fix(dev): address the third review of the converge worker - 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]> * docs: align the dev worker documents with the third review Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(dev): address the fourth review of the converge worker - 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]> * docs: align the dev worker documents with the fourth review Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> * fix(dev): watch the TypeScript file of a missing import whose name has 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]> * fix(dev): add the restart note for a kept directory lookup where dev 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]> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
A host can now authenticate Prisma Management API requests in its own
HttpClient, for example to refresh a session and retry after a 401. LeaveserviceTokenout of thePrismaEnvironmentyou provide, and Alchemy sends noAuthorizationheader.Prisma Composer runs Alchemy inside the
prismaCLI. The CLI's client sets the bearer token and handles a rejected session itself, soprisma loginfollowed byprisma deployneeds no service token in the environment. A host that can hand Alchemy a current token can still return it from thePrismaEnvironmentEffect (#3122).Prisma.providers()and env/profile resolution still require a token.Log streams open their own WebSocket, so a host
HttpClientcan't authenticate them. Without a token,ComputeandDeploymentlog tailing fails with aConfigErrorinstead of connecting without auth.Breaking:
AuthorizationonDeploymentLogsRequestandBuildLogsRequestis now optional.