feat(naming-spec): @pgpmjs/naming-spec — PGPM naming spec v1 (derived change paths) - #1547
Merged
Conversation
…: derived change paths)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ctory/flat styles + alterationPathFor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New zero-dependency leaf package
@pgpmjs/naming-spec: the PGPM naming spec as a pure projection. A change path is never authored and never identity — it is rendered on demand from an object's identity, so regrouping, renaming schemes, or repartitioning packages can never break identity-keyed consumers (diff, dependency resolution).The reference implementation is constructive-db's
db_depsSQL package (db_deps.table_deps,column_deps,procedure_deps,next_alteration, ...); this is the TypeScript rendering of the same spec, byte-for-byte compatible with the generatedapplication/constructiveplan.pathFor(identity, { style })— total, deterministic:alterationPathFor(parent, n)— the conflict/re-alteration convention:<parent>/alterations/alt0000000042, mirroringdb_deps.next_alteration(strips any existing suffix so a parent can be renumbered; the counter is caller state, rendering is pure).PGPM_NAMING_SPEC_VERSION = 1;ObjectIdentitydeclared structurally (identical toidentityOf's output in pgsql-parser#326) — parsing stays in the parser repo, pgpm conventions stay here.Verified no duplicate change names exist in any constructive-db
pgpm.plan(the alt counter is what keeps it that way). Phase 1 of constructive-planning#1329; follow-ups:defaultChangeNamedelegates toidentityOf+pathFor, and db-deps gains parity tests against this package.Note:
pnpm run lintfails identically in existing pgpm packages (ESLint 9 flat-config migration pending repo-wide) — not introduced here; tests and build pass.Link to Devin session: https://app.devin.ai/sessions/562099f8b3d94877b5ab57ec8bb90bec
Requested by: @pyramation