Skip to content

feat(cli): ADR-0048 follow-up — namespace-prefix lint warning - #1804

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0048-followup
Jun 13, 2026
Merged

feat(cli): ADR-0048 follow-up — namespace-prefix lint warning#1804
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0048-followup

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Summary

Implements the deferred §4 follow-up of ADR-0048 (cross-package metadata collision, merged in #1796).

ADR-0048 added a runtime guard: a cross-package clash on a bare-named item's registry key (org/type/name) now fails loudly at registration with MetadataCollisionError. This PR shifts that detection left to authoring timeos lint now nudges authors to prefix bare-named metadata with the package namespace, so the clash is unlikely to ever reach install.

What it does

New naming/namespace-prefixwarning in lintConfig:

  • Fires when a bare-named UI/automation item — app / page / dashboard / flow / action / report / dataset — has a name not prefixed with manifest.namespace.
  • Exemptions (no false positives): an app named exactly after the namespace (ADR-0019 single-app convention, e.g. crm), and sys_-reserved names.
  • Untouched: objects (already prefix-enforced as an error in defineStack), object-derived views, and doc (its own strict build-time lint).
  • Warning-only / never fatal: os lint exits non-zero only on errors, and os build does not run lintConfig — so no example build or CI run breaks from this.

Also marks the ADR-0048 §4 lint follow-up as implemented.

Test plan

  • New packages/cli/test/lint-namespace-prefix.test.ts — 7 cases: warns on bare name, accepts prefixed, exempts app-named-after-namespace, exempts sys_, covers all 7 types, silent without a namespace, leaves objects/views alone.
  • Lint suite green locally (data-model-rules + score + metadata-eval + new): 38 passed.
  • cli typecheck clean.

🤖 Generated with Claude Code

Shifts the cross-package metadata collision detection (ADR-0048 runtime
MetadataCollisionError) left to authoring time. `os lint` now emits a
non-fatal `naming/namespace-prefix` warning when a bare-named
UI/automation item (app/page/dashboard/flow/action/report/dataset) is not
prefixed with the package namespace — the clash these names risk fails
loudly at registration; this nudges authors to prefix before it ever gets
there.
- Exempts an app named after the namespace (ADR-0019 single-app
convention, e.g. `crm`) and `sys_`-reserved names.
- Objects (already prefix-enforced as an error) and object-derived views
are untouched; `doc` keeps its own build-time strict lint.
- Warning-only: never fails `os lint` (only errors exit non-zero) and
`os build` does not run lintConfig, so example builds are unaffected.
- Marks the ADR-0048 §4 lint follow-up as implemented.
Tests: 7 cases (warn/accept/app-exemption/sys_/all-types/no-namespace/
objects-views-untouched). Full lint suite green (38).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercelBot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 13, 2026 2:50am

Request Review

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang