Declare a public service in code with publicUrl(): a named hostname per environment, or the service's prisma.build URL #400
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #400"
general
weight: 0.35
wmadden
At a glance
An app now says in code which service the internet reaches, and at which hostname in each environment:
In production the same code attaches
shop.comtowebas a custom domain.What this PR changes
1.
publicUrl({ name, url, target }),publicUrl.hostname(h)andpublicUrl.prismaBuild()in@prisma/composer-prisma-cloud.2. On Prisma Cloud, a named hostname becomes one custom domain on the target service, attached after the service's new deployment is live.
publicUrl.prismaBuild()creates nothing and reports the service's existingprisma.buildURL.3. Both the deploy and
prisma devcheck every public URL's resolvedurlbefore any of the app's resources are created or changed. Two public URLs naming the same hostname fail the same check.4. Under
prisma dev, a named hostname creates nothing, and the session prints one warning per public URL that names one. To carry that warning, core's preflight input gains an optionalwarn, and the CLI's dev command gains atarget-warningevent.5. The compute service's lowering adds its platform id,
serviceId, to its outputs.6. ADR-0060 now says a deploy never replaces a serving hostname with one that cannot serve yet. The guide, the agent skill and
examples/env-paramdescribe and use public URLs.A public URL is a node wired to a service's HTTP interface
ADR-0060 decided that traffic from the internet reaches a service only through a public URL, a node in the graph that the author provisions where the hostname is decided. A service exposes an HTTP interface (
expose: { http: rawHttpContract }). The public URL depends on that interface and exposes nothing, because nothing inside the graph calls it: its caller is the internet.publicUrl()builds that node with core'sresource(), using the support the previous slice added for a resource wired at construction (prisma/composer#396). So core learns nothing about public URLs. The node has one dependency,target, typed as a raw HTTP dependency, so wiring a public URL to an RPC or Postgres interface fails the type check. Itsurlis stored in the resource'sprops, where Load's second pass resolves aresolve()value per environment.urltakes one of two strategies, both plain objects so aresolve()callback can return them.publicUrl.hostname('shop.com')names a hostname; a bare string means the same.publicUrl.prismaBuild()means the service's own<id>.<region>.prisma.buildhostname. Leavingurlout throws. A hostname is trimmed, has one trailing dot dropped and is lowercased, and anything that is not a plain DNS name throws at construction: a scheme, a path, a port, a*label, or an IP address.How a named hostname reaches Prisma Cloud today
The platform's record for a hostname that exists before DNS (the RoutingUrl) is not built yet; that is a later slice. Until then a named hostname lowers to Alchemy's existing
Prisma.CustomDomain. Two consequences follow from how that resource and the platform behave:appis taken from the service'sDeploymentoutput, not itsApp, so Alchemy creates the domain only after the promote. That is why the compute lowering now outputsserviceId.Prisma Management API request failed (domain-ownership-required); alchemy-run/alchemy#2698 makes it name the record, and Composer picks that up with a version bump.The hostname is part of the custom domain's Alchemy resource id (
shop.site.domain.shop.com). Changing a public URL's hostname is then a new resource plus the removal of the old one. Alchemy runs every create before it deletes anything a program no longer declares, and a failed create stops the run. So if the platform refuses the new hostname, the deploy fails and the old one keeps serving. With the node's address alone as the id, Alchemy refuses any hostname change outright.That is the rule Will set for this project, now recorded in ADR-0060: a deploy never replaces a serving hostname with one that cannot serve yet. Removing the public URL, or switching it to
publicUrl.prismaBuild(), is an explicit choice and goes through. When the RoutingUrl arrives, a hostname change updates the row in place and the platform accepts an unready hostname, so the project plan has that slice check the rule explicitly.Two limits stay until later slices, and the guide states both:
publicUrl.prismaBuild().prisma devLocal dev runs the same lowering against local providers (ADR-0041). A new local custom-domain provider records the hostname and calls nothing. The extension's dev preflight warns once per public URL that names a hostname; the warning travels through the new optional
warnon core's preflight input and atarget-warningdev event. Deploy passes nowarn.Tests
public-url.test.tsandpublic-url.test-d.tscover the node's shape, the missingurl, a table of invalid hostnames in all three forms, and the type error for a non-HTTPtarget.control-lowering.test.tschecks that each strategy lowers as described, including aresolve()value of each kind and a public URL on a module's forwarded interface. It checks the custom domain's id and that itsappcomes from theDeployment.public-url-apply.test.tsruns Alchemy's real apply engine and the realPrisma.CustomDomainprovider against a fake Management API. It proves four things:- a refused hostname fails the deploy;
- a refused hostname change sends no delete, and the old domain stays;
- an accepted change creates the new domain before deleting the old one;
- moving a hostname to another service is refused.
urlthat is not a hostname or strategy, and on a duplicate hostname, before calling the platform or writing dev state.examples/env-paramdeployed to production and to a preview; its smoke test checks thepublic-urlentity. The application topology read back from both Branches lists the public URL with its edge from the service's HTTP interface. A production deploy naming an unprepared hostname failed with the platform's ownership error, and production kept serving.prisma devprinted the warning and served the service. The record is in.drive/projects/public-urls/slices/p1-public-url/qa.md.Alternatives considered
Prisma.CustomDomaincannot exist without both records, so doing it now would mean skipping the domain and asking for a redeploy, which is also throwaway.Agent: hermione-26
🤖 Generated with Claude Code