Skip to content

refactor: one component name, each namespace adding only the prefix it needs - #8

Merged
y1o1 merged 1 commit into
developfrom
refactor/component-naming
Jul 26, 2026
Merged

refactor: one component name, each namespace adding only the prefix it needs#8
y1o1 merged 1 commit into
developfrom
refactor/component-naming

Conversation

@y1o1

@y1o1 y1o1 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

auth-auth-provider was a symptom. The cause is that one string was doing three jobs — directory, npm package, container image — so a prefix that is correct in one namespace is wrong in another. Naming the image explicitly (#7) hid that. This fixes it.

The rule

A name carries exactly the disambiguation its namespace does not already provide:

component   provider | policy-verifier
directory   packages/create-${c}    inside the auth repo — "auth" is already
                                    given by where the file is
npm         create-auth-${c}        scope is provin-line, not auth
image       auth-${c}               org is provin-line, not auth

So the publish matrix carries the component again and every identifier derives from it.

What moves

before after
dir packages/create-auth-provider packages/create-provider
dir packages/auth-provider-did packages/provider-did
dir packages/auth-provider-dplaax-module packages/provider-dplaax-module
npm @provin-line/create-policy-verifier @provin-line/create-auth-policy-verifier
npm @provin-line/policy-verifier-dplaax-module @provin-line/auth-policy-verifier-dplaax-module

This deliberately breaks the directory↔package-name mirror. pnpm resolves by the name in package.json, and the alternative was keeping a prefix that says "auth" to a reader who is already inside the auth repository.

All six packages are unpublished on npm, which is the only reason this is a refactor and not a breaking change.

The same conflation was live in the generators — and there it broke things

const TRANSITIVE_PROVIN_PACKAGE_DIRS = ["auth-provider-did", ...]
`@provin-line/${dir}`                   // used as an npm name
`path:/packages/${dir}`                 // and as a directory

One list, two meanings. After the rename it would have emitted a git spec pointing at packages/auth-provider-dida path that no longer exists, so a generated scaffold would have failed to install rather than merely read oddly.

Now { name, dir } pairs, with a comment saying why they are separate. The generator test caught this; that is the test earning its place.

Also corrected while in here

  • the verifier's bin and its Usage: line still said create-policy-verifier
  • two assertions escaped the slash — @provin-line\/create-policy-verifier — so a literal search could not see them
  • one expected array needed reordering: the rename moved auth-policy-verifier-dplaax-module ahead of did-dplaax in a sorted list

The lockfile is nine lines, and that took two attempts

resolution/integrity changes: zero.

Getting there meant reverting two accidents:

  1. pnpm install --lockfile-only re-resolved dependencies unrelated to any rename (picomatch and tinyglobby swapped out, among others) — 488 lines
  2. make instances then wrote the generated instances' own dependencies into the root lockfile, because pnpm counts them as workspace projects — 413 lines

The committed lockfile is the base one with importer keys and link: targets substituted, validated with --frozen-lockfile so nothing was re-resolved to make it pass.

Verification

frozen-lockfile install ✓   build ✓   typecheck ✓
484 package tests + integration ✓
make instances ✓            make smoke ✓

Plus the CI assertion reproduced locally — a fresh generation is byte-identical to instances/ — and confirmation that the generated overrides key on @provin-line/auth-provider-did while pointing at /packages/provider-did.

Not yet verified

The published images are currently the ones #7's per-entry image: produced. The derived form should yield the same names, but publish-images has not been dispatched against this change, so that is unproven until it runs.

🤖 Generated with Claude Code

…t needs

auth-auth-provider was a symptom. The cause is that a single string was doing
three jobs at once — directory, npm package, container image — so a prefix
correct for one namespace was wrong in another. Naming the image explicitly
(the previous commit) hid that; this fixes it.

The rule is that a name carries exactly the disambiguation its namespace does
not already provide:

    component  provider | policy-verifier
    directory  packages/create-${c}     inside the auth repo — "auth" is
                                        already given by where the file is
    npm        create-auth-${c}         scope is provin-line, not auth
    image      auth-${c}                org is provin-line, not auth

So the publish matrix carries the component again and every identifier derives
from it, rather than the image being spelled out per entry.

Directories lose the prefix their location already implies:
create-auth-provider → create-provider, auth-provider-did → provider-did,
auth-provider-dplaax-module → provider-dplaax-module. npm names gain it where
it was missing: create-policy-verifier → create-auth-policy-verifier,
policy-verifier-dplaax-module → auth-policy-verifier-dplaax-module. That
deliberately breaks the directory↔package-name mirror; pnpm resolves by the
name in package.json, and the alternative was keeping a prefix that says
"auth" to a reader who is already inside the auth repository.

Every one of the six packages is unpublished on npm, which is the only reason
this is a refactor and not a breaking change.

The same conflation was live in both generators, and there it was not
cosmetic:

    const TRANSITIVE_PROVIN_PACKAGE_DIRS = ["auth-provider-did", ...]
    `@provin-line/${dir}`                        // used as an npm name
    `path:/packages/${dir}`                      // and as a directory

One list, two meanings. After the rename it would have emitted a git spec
pointing at packages/auth-provider-did, a path that no longer exists — so a
generated scaffold would have failed to install rather than merely read
oddly. Now { name, dir } pairs, with a comment saying why they are separate.
The generator test caught it; that is the test earning its place.

Also corrected while in here: the verifier's `bin` and its usage line still
said create-policy-verifier, and two assertions escaped the slash in
@provin-line\/create-policy-verifier so a literal search could not see them.
One generator test's expected array had to be reordered — the rename moved
auth-policy-verifier-dplaax-module ahead of did-dplaax in a sorted list,
which is the assertion doing its job.

The lockfile diff is nine lines and touches no resolution or integrity field.
That took two attempts: `pnpm install --lockfile-only` re-resolved dependencies
that had nothing to do with renaming anything (picomatch and tinyglobby swapped
out, among others), and `make instances` then wrote the generated instances'
own dependencies into the ROOT lockfile, because pnpm counts them as workspace
projects. Both were reverted; the committed lockfile is the base one with the
importer keys and link targets substituted, validated by --frozen-lockfile so
nothing was re-resolved to make it pass.

Verified: frozen-lockfile install, build, typecheck, every package test (484
passing plus integration), make instances, make smoke, and the CI assertion
that a fresh generation is byte-identical to instances/ — including that the
generated overrides key on @provin-line/auth-provider-did while pointing at
/packages/provider-did.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@y1o1
y1o1 merged commit 1f2159c into develop Jul 26, 2026
3 checks passed
@y1o1
y1o1 deleted the refactor/component-naming branch July 26, 2026 15:28
@y1o1 y1o1 mentioned this pull request Jul 26, 2026
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.

1 participant