Skip to content

[Registry] Collision warning is order-asymmetric: silent in the common cold-boot order (artifact first, then sys_metadata) #12027

Description

@claude

The defect

SchemaRegistry.registerItem emits its [Registry] Collision artifact-vs-DB warning under this guard (packages/objectql/src/registry.ts ~2920):

if(packageId&&collection.has(bareKey)){constdbOnly=collection.get(bareKey)asany;if(dbOnly&&!dbOnly._packageId){console.warn(`[Registry] Collision: ...`);}}

That fires only when the package registers second. In the opposite order — artifact loaded first, then the sys_metadata overlay rehydrated by loadMetaFromDb — the packaged item goes in under pkg:name, then the runtime row goes in under the bare namewith no packageId, so the packageId && half of the guard excludes it and nothing is logged. Both entries then coexist with no diagnostic at all.

ADR-0005 §Collision warning describes this warning as the thing that makes the silent shadowing "discoverable in startup logs". In the artifact-first order it does not make it discoverable.

Measured

With a real SchemaRegistry, a packaged flow and a same-named runtime row, spying on console.warn:

  • register package first, then runtime row -> 0[Registry] Collision warnings
  • register runtime row first, then package -> 1 warning

Both assertions passed on origin/main at 227c1788d5.

Why it matters

Artifact-first is the ordinary cold-boot order (artifact load at boot, loadMetaFromDb after), so the order that stays silent is likely the common one. Any consumer that collapses two same-named entries into one slot has no signal in that case.

Not in scope of the PR that found it

Found while implementing #11997 (deterministic precedence for same-named flows, PR #12026). That PR fixes the automation engine's own collapse and emits its own warning at the flow pull, so flows are covered; this is the registry-level diagnostic gap underneath, which affects every metadata type, and it was out of that card's scope.

Read at origin/main227c1788d55da8f94127137bcf75ba2bf08b15d8. Unassigned, not claimed.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions