Skip to content

test(objectql): guard overlay-only cross-package collision provenance (ADR-0048 #1828)#3252

Merged
os-zhuang merged 1 commit into
mainfrom
claude/adr-0048-metadata-dedupes-yje377
Jul 19, 2026
Merged

test(objectql): guard overlay-only cross-package collision provenance (ADR-0048 #1828)#3252
os-zhuang merged 1 commit into
mainfrom
claude/adr-0048-metadata-dedupes-yje377

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Test-only follow-up to #3231 (ADR-0048 #1828, already merged).

Why

#3231 fixed the unscoped metadata list collapse and a provenance bug in SchemaRegistry.getArtifactItem — but that second bug was invisible to the unit suite and only surfaced by dogfooding a real collision against the running server. The unit tests added in #3231 all register a backing artifact for the colliding name, so the list-decorate step resolves each row's provenance via the composite artifact and never exercises the bare-key fallback that was broken.

This adds the missing case so the fix is locked at the unit level.

What

A getMetaItems test with two packages that have only a sys_metadata overlay each (no registered artifact) shipping the same type/name:

  • The list-decorate step grafts each row's artifact via getArtifactItem(type, name, <row's own package>).
  • With no composite artifact, it must not fall back to the other package's bare-key hydrated overlay — otherwise both rows get stamped with the last-hydrated package's _packageId.

Reverting the getArtifactItem package-scope guard fails this test (expected 'Globex home' to be 'Acme home'), so it genuinely guards the fix — not a vacuous assertion.

Verification

Test-only; no runtime change, so no changeset (the PR carries skip-changeset).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DKFjwN2EVXPB2CJwNzPs8c


Generated by Claude Code

… (ADR-0048 #1828)

Adds the getMetaItems case that unit tests missed and dogfooding caught:
two packages with ONLY a sys_metadata overlay each (no registered
artifact) shipping the same `type/name`. The list-decorate step grafts
each row's artifact via `getArtifactItem(type, name, <row's own package>)`;
with no composite artifact it must not fall back to the OTHER package's
bare-key hydrated overlay, or both rows get stamped with the last-hydrated
package's `_packageId`.

Reverting the `getArtifactItem` package-scope guard fails this test
(`expected 'Globex home' to be 'Acme home'`), so it locks the fix.
Test-only; no runtime change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKFjwN2EVXPB2CJwNzPs8c
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 19, 2026 6:23am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

13 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx (via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx (via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx (via @objectstack/objectql)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/objectql)
  • content/docs/kernel/services.mdx (via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx (via @objectstack/objectql)
  • content/docs/plugins/index.mdx (via @objectstack/objectql)
  • content/docs/plugins/packages.mdx (via @objectstack/objectql)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/implementation-status.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang os-zhuang added skip-changeset PR has no user-facing published change; bypasses the changeset gate and removed size/s tests labels Jul 19, 2026 — with Claude
@os-zhuang
os-zhuang marked this pull request as ready for review July 19, 2026 11:07
@os-zhuang
os-zhuang merged commit b46217a into main Jul 19, 2026
30 of 31 checks passed
@os-zhuang
os-zhuang deleted the claude/adr-0048-metadata-dedupes-yje377 branch July 19, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants