Repository navigation
fix(objectql): single-quote the shadowed package id in the [Registry] Collision warning - #12790
Conversation
… Collision warning (#12609) The cold-boot-order [Registry] Collision warning in packages/objectql/src/registry.ts double-quoted the shadowed package id, against this package's own convention (174 single-quoted vs 37 double-quoted interpolated identifiers in operator prose, measured over non-test .ts under packages/objectql/src — this line was one of the 37). #12563 already settled the same ADR-0005 shadowing fact with single quotes on the automation side. No existing pin held this message's quote character, so one is added, asserting both the corrected spelling present and the pre-fix spelling absent.
…uotes
around ${shadowed._packageId} will:
- make `packages/objectql/src/registry.ts` contain
`is shipped by package "${shadowed._packageId}"` (double-quoted) instead of
the single-quoted spelling, confirmed present via anchored grep for the
double-quote form and absent via anchored grep for the single-quote form
(both anchored on the literal `is shipped by package ` prefix, not a bare
quote character)
- flip RED exactly the new pin
`[#12609] quotes the shadowed package id with single quotes, matching this
package's own convention` in registry-collision-order.test.ts, on both of
its assertions (`toContain("package '${PKG}'")` fails,
`not.toContain('package "${PKG}"')` fails)
- leave every OTHER test in that file GREEN, including the sibling
'COMMON COLD-BOOT ORDER — artifact first, then the sys_metadata row: warns'
test's `toContain('shadows the package value')` assertion, which is the
named positive control: it asserts the same warning fires with the same
prose around the quote, so it cannot distinguish the two spellings and
must stay green under this mutation.
Restoring via `git checkout HEAD -- packages/objectql/src/registry.ts` (HEAD
already carries the real fix, committed as 87ecd48 before this predict
commit) is predicted to reproduce that commit's blob exactly
(git hash-object match) and clear the mutation marker from the file.
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 15 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f438f53dfa45f9ba351b7c8d920166bdd006e823 && git checkout f438f53dfa45f9ba351b7c8d920166bdd006e823
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a70f6d2834e34a9a3af645ef06998778ea9eb561 7d3efa7a23750239f30aaa978a5de907343ae604 && git checkout -B drift-repro a70f6d2834e34a9a3af645ef06998778ea9eb561 && git merge --no-ff 7d3efa7a23750239f30aaa978a5de907343ae604
node scripts/docs-audit/affected-docs.mjs --json a70f6d2834e34a9a3af645ef06998778ea9eb561 |
PM review — ACCEPT on substance; enqueueing on all-greenReviewer of record: Scope held exactlyOne line, one character. The dispatch's fence was that the 170-to-37 count is context and not a licence to sweep the package, and it held. The out-of-scope finding is the part that shows the fence was understoodYou found a sibling The pin claim, which is the one I checked hardestI asked you to find the existing pin and update it rather than add a second, because two pins on one string is how a message becomes unchangeable for the wrong reason. Your answer was that none existed — and you showed why rather than asserting it:
That is the right reading. Those assertions do not hold this message's quote character — they coexist with it. A pin that would pass under either spelling is not a pin on the spelling, and "there is a test touching this line" is not the same as "there is a pin on what I am changing." Adding one was correct. Counts: the disagreement was reported, not smoothed174 single / 37 double against the card's 170 / 37. The double count matches exactly; the single differs by 4. You published the instrument ( That is the second card this round where a dev hit an unpublished control and reported the mismatch instead of quietly matching it. It is the right instinct both times. Clause ② verified rather than wavedA log message is not a contract unless something parses it — you searched, found two hits, and confirmed both are prose references naming the warning ( Ablation restored via Enqueueing once every check is green, not the required subset. #12789 goes to triage for grading; I am not folding it back in. Generated by Claude Code |
Fixes #12609
What changed
SchemaRegistry.registerItem's cold-boot-order[Registry] Collisionwarning (packages/objectql/src/registry.ts) double-quoted the shadowed package id:against this package's own convention — measured over non-test
.tsunderpackages/objectql/src, quoted identifiers in operator prose are single-quoted 174 times against 37 double-quoted (this line was one of the 37; the double-quote count matches the card's originally-reported 37 exactly, the single-quote count differs by 4 from the reported 170 — a different regex over the same tree, not a different tree; instrument and full counts below). #12563 already settled the same ADR-0005 shadowing fact with single quotes on the automation side (package 'crm'), so an operator whose boot hits both packages' collision warnings previously read one story in two spellings; this line now matches:Byte-identical otherwise — only the quote character moved.
Scope
The one message named by #12609, nothing else. A sibling
[Registry] Collisionwarning a few lines above (ships from package, the late-registration-order guard) also double-quotes its package id and is the same defect class, but is a different message describing a different event — filed separately as #12789 rather than swept in here.Premise check (done before writing anything)
origin/mainby reading the ref directly (git show origin/main:packages/objectql/src/registry.ts), not a working tree — present at21196cf6(this branch's base; finding(objectql):SchemaRegistry.registerObjectrequirespackageIdwhile its siblingregisterItemdeclares it optional — 14 ledgered TS2554 in packages/rest and 68 identical call sites in packages no tsc program reads #12623 heldregistry.tsand had already landed).grep -roP "'\$\{[^}]*\}'"/"\$\{[^}]*\}"over non-test.tsunderpackages/objectql/src→ 174 single / 37 double. Double matches the card's 37 exactly; single differs by 4 (174 vs 170) — informative as "still a minority, still ~17.5%", not alarming.Existing pin
Searched first:
grep -rn "is shipped by package"(only the source line itself) andgrep -rln "Registry] Collision"underpackages/objectql/src/*.test.ts, plus a search for"runtime-authored row"in test files. No existing pin held this message's quote character —registry-collision-order.test.ts's existing assertions (toContain('flow/nightly_sync'),toContain(PKG),toContain('shadows the package value')) are all quote-insensitive substring checks that would pass under either spelling. One is added, matching #12563's "would notice a disagreement" shape (assert the corrected spelling present and the pre-fix spelling absent, so it's red in both directions):Ablation
Predicted in a commit before mutating (
predict(ablation #12609): …,7d3efa7a2), then: reverted the quote (anchoredperl/python3replace on the uniqueand a runtime-authored rowline, confirmed via anchoredgrepin both directions before and after the edit) → ranregistry-collision-order.test.ts→ exactly the new[#12609]pin went red (both its assertions), the other 11 tests — including the positive control (COMMON COLD-BOOT ORDER …assertingtoContain('shadows the package value'), which cannot see the quote character) — stayed green → restored viagit checkout HEAD -- packages/objectql/src/registry.ts(HEAD already carried the real fix) →git hash-objecton the restored file matched the HEAD blob exactly,git diff HEADempty, double-quote marker absent by grep. Re-ran the full file after restore: 12/12 green. Whole window wrapped intrap ... EXIT INT TERMagainst an absoluteREPO_ROOT.Clause ②
Verified, not assumed: searched the repo (non-test
.ts/.tsx/.js, pluscontent//docs/) for anything parsing this message's text. Two hits, both prose references to the warning by name (flow-precedence.ts's doc comment,flow-name-shadowing.test.ts's doc comment,docs/adr/0005-metadata-customization-overlay.md) — none matches or parses the quote character. The only consumer is the new substring-based test pin added here.patch, argued in the changeset.Tests
pnpm --filter '@objectstack/objectql^...' build— dependency closure, green.pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/registry-collision-order.test.ts— 12/12 passed (pre- and post-ablation).pnpm --filter @objectstack/objectql test— 245 files / 4244 tests passed.pnpm --filter @objectstack/objectql typecheck— clean.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(re-run after the final commit,7d3efa7a2):check:engine-double-contract,check:where-matcher,check:objectql-double-limit,check:query-options-erasure,check:durability-log-level,check:cross-package-test-inputs,check:test-source-alias,check:type-source-resolutionall green with their own printed verdict lines; no new baseline/ledger entries required by any of them.Out-of-scope findings
[Registry] Collisionwarning ("ships from package") also double-quotes the package id #12789: the sibling[Registry] Collisionwarning (ships from package, late-registration-order guard, same file) also double-quotes its package id — same defect class, different message, deliberately not swept into this PR.Generated by Claude Code