fix(ADR-0048): rescope os lint naming/namespace-prefix to intra-package duplicates#1838
Merged
Merged
Conversation
…ge duplicates ADR-0048 §3.4 retired the per-item cross-package collision throw, but the naming/namespace-prefix lint rule was never updated to match. It fired on every bare-named UI/automation item (hotcrm: 63 false positives) and claimed the package would "collide on the registry key and fail at install" — both false. The rule now warns only on a genuine intra-package duplicate (type, name) pair within the linted config (the authoring-hygiene case §3.4 leaves to os lint). Unique bare names produce zero warnings. Message no longer claims an install failure. Runtime/registry behavior unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
ADR-0048 §3.4 retired the per-item cross-package metadata collision throw — two installed packages may legitimately ship the same bare name (e.g.
page/home), stored under distinct composite keys and disambiguated by package-scoped resolution. Theos lintnaming/namespace-prefixrule was never updated to match, so it still:What changed
packages/cli/src/commands/lint.ts— the rule now warns only on a genuine intra-package duplicate(type, name)pair within the linted config. This is the narrow authoring-time hygiene case ADR-0048 §3.4 explicitly leaves toos lint("an author shipping twopage/homein one package"). A unique bare name produces zero warnings. Detection is per-type (sopage/home+flow/homedon't false-trigger) and the warning points the duplicate occurrence back at the original declaration.The message no longer claims an install failure; it explains the items shadow each other on the registry key and that distinct packages may reuse the same name freely (the namespace prefix is an optional convention, not a collision-avoidance requirement). The
<ns>_-prefixedfixis offered only when a namespace is declared.Runtime/registry behavior is unchanged — this touches only the CLI lint rule, its tests, and the message.
Tests
packages/cli/test/lint-namespace-prefix.test.tsrewritten for the new contract:crm_-prefixed rename)fix)Full CLI suite: 316 passed.
Real-world check
Ran the freshly-built CLI against
../hotcrm:naming/namespace-prefixwarnings dropped 63 → 0 (total warnings 63 → 4; the remaining 4 are unrelated data-model rules).Changeset added (
@objectstack/cli: patch).🤖 Generated with Claude Code