Repository navigation
docs(design): a node's address is its logical ID on the platform (ADR-0051) - #352
Conversation
…-0051) Record that Composer writes each node's address, byte for byte, as the logicalId of the node's platform row and of its topology node. Add the rule to the architectural principles, glossary, core model, PDP data model and Alchemy lowering docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
State that a node name is its default provision ID, so changing it changes identity. Amend ADR-0006 and ADR-0024. Scope the single-writer rule, correct the supporting-row lists, keep the principle target-agnostic, and record the current status and open follow-ups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Root addresses may contain "-". Changing an identity is never a rename. Changing the root name leaves the old Project in place. Record the remaining follow-ups in the build-reporting plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
✅ Gizmo reviewed f04d98a — posted 1 inline comment(s) this pass. Open findings: 🟡 1 minor Change walkthroughThis PR is docs-only: it adds ADR-0051 — every node's address is written byte for byte as the The ADR itself. ADR-0051 states the rule, a worked example mapping addresses → topology nodes → platform rows, the reasoning (the platform joins on string equality), what the value is never (Alchemy resource ID, display name, platform Amendments and index. ADR-0006 and ADR-0024 each gain an amendment note, and the ADR index (README.md) gains matching notes plus a new ADR-0051 entry — the established amendment pattern in this repo. Restating the rule where readers look. A target-agnostic principle lands in architectural-principles.md, a new "Address and logical ID" entry in the glossary (correctly placed under "Core nouns"), a "Deployment identity" tie-in paragraph in core-model, and an "Identity: The lowering side. alchemy-lowering.md gains a "Platform identity" section with a per-node-kind table (which resource writes the Follow-ups. The build-reporting plan records five open items; all five were verified as accurate descriptions of current code, including the |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
There was a problem hiding this comment.
New findings: 🟡 3 minor · trace
Findings outside the diff
- 🟡 Minor · correctness packages/0-framework/3-tooling/cli/src/pipeline.ts — Documented identity invariant is violated by shipped code:
prisma deploy --namesubmits a topology root that matches no Project row
ADR-0051 declares the root node's topologylogicalIdand the Project row'slogicalIdmust be byte-identical, but withprisma deploy --name <n>they diverge: deploy.ts:578 loads the deploy graph withLoad(root, { id: opts.name })(so the Project'slogicalIdis the--namevalue), while pipeline.ts:129 loads the reported graph with plainLoad(entryModule.root)(so the topology root node is submitted under the module's own name). The platform's join onlogicalIdthen finds nothing for the root node. The PR documents this honestly as a defect in alchemy-lowering.md and tracks the fix in plan.md's follow-ups, but the invariant the docs now state is not yet true of the shipped code.
Recommended fix: Apply the tracked fix: have pipeline.ts load the reported graph with the same id override as the deploy child, e.g.Load(entryModule.root, opts.name ? { id: opts.name } : undefined), in the same change that ships ADR-0051's follow-ups. - 🟡 Minor · correctness packages/1-prisma-cloud/0-lowering/lowering/src/container.ts — Project display-name fallback can adopt a Project that already has a different
logicalId
ADR-0051 says identity islogicalIdand the display-name path exists only for Projects "created before they carried alogicalId", but container.ts:100-104 matches any Project whosenameequals the app name, including Projects that already have a differentlogicalId— the CLI would then adopt the wrong Project and deploy into it. The PR records this in plan.md's follow-ups, so it is tracked, but until the fallback is narrowed the docs' compatibility-path claim is broader than the code's behavior.
Recommended fix: Narrow the fallback as plan.md proposes: filter the display-name candidates top.logicalId == nullso a Project that already carries a differentlogicalIdis never adopted by name.
| Status: | ||
|
|
||
| - The Project carries its `logicalId` when Composer created it. Projects created before that are found by display name and have none. | ||
| - App, Database and Bucket need the `logicalId` prop that upstream alchemy added in [alchemy-run/alchemy#1849](https://github.com/alchemy-run/alchemy/pull/1849). Until Composer upgrades to a release that includes it, those rows have no `logicalId` and match no topology node. The upgrade must pass `logicalId: address` in the same change: an upgrade alone would write the Alchemy resource ID (`catalog-db`) onto every existing row. |
There was a problem hiding this comment.
🟡 Minor · consistency — Bucket logicalId writer attributed to upstream alchemy#1849, contradicting the cited ADR-0048
The status bullet says the App, Database and Bucket rows get their logicalId prop from "the upstream Alchemy resource that creates the row", citing ADR-0048 (ADR-0051 states the same at line 49). But ADR-0048 still says Composer "defines its own resources only where the upstream provider has no support yet (buckets, whose routes upstream deferred)". Current code uses upstream Prisma.Bucket/Prisma.BucketProvider() (providers.ts, descriptors/bucket.ts), so this ADR matches the code — but a reader following the citation lands in a document that states the opposite, and unlike ADR-0006/ADR-0024, ADR-0048 got no amendment note for a decision this ADR relies on.
Recommended fix
Add an amendment note to ADR-0048 (and its README index entry) recording that the bucket family now composes upstream's Prisma.Bucket provider, mirroring the ADR-0006/ADR-0024 amendment notes this ADR added — or soften the citation here and in ADR-0051.
Every node's address is its identity on Prisma Cloud. Composer writes it, byte for byte, as the
logicalIdof the node's platform row and of its node in the branch's application topology:Console and CI join topology nodes to rows, and one node across branches, by string equality on
logicalId. If the two strings differ at all, those reads find nothing.Why this needs an ADR
The rule existed only in the pdp-control-plane branch topology spec and one line of
.drive/projects/build-reporting/plan.md. Composer's own design docs never stated it. As a result, prisma/composer#344 wrote databaselogicalIds through a separate Composer resource. Upstream alchemy (alchemy-run/alchemy#1849) now has alogicalIdprop, but it defaults to Alchemy's resource ID (catalog-db), which is wrong for us.What the docs now say
id.name, so changing a name changes identity. That is not a rename. A rename changes a display name and nothing else.logicalId. Matching by display name is only a fallback.logicalIdfor each node kind, and the current statusprisma deploy --name, the topology root'slogicalIddiffers from the Project's.pipeline.tsloads the reported graph without the override. This is a code defect.logicalId: idon App, Database and Bucket in the same change.catalog-db.Docs only; no code changes.
Alternatives considered
These are in the ADR: using Alchemy's default, writing the field with a separate resource as #344 does, putting platform
ids in the topology, matching on display names, and having Console read Alchemy state.Agent: moby-95
🤖 Generated with Claude Code