Skip to content

fix(objectql): single-quote the shadowed package id in the [Registry] Collision warning - #12790

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-12609-registry-collision-quote-style
Aug 27, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-12609-registry-collision-quote-style

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes #12609

What changed

SchemaRegistry.registerItem's cold-boot-order [Registry] Collision warning (packages/objectql/src/registry.ts) double-quoted the shadowed package id:

`[Registry] Collision: ${type}/${baseName} is shipped by package ` +
`"${shadowed._packageId}" and a runtime-authored row with the same name has ` +
...

against this package's own convention — measured over non-test .ts under packages/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:

-`"${shadowed._packageId}" and a runtime-authored row with the same name has ` +
+`'${shadowed._packageId}' and a runtime-authored row with the same name has ` +

Byte-identical otherwise — only the quote character moved.

Scope

The one message named by #12609, nothing else. A sibling [Registry] Collision warning 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)

Existing pin

Searched first: grep -rn "is shipped by package" (only the source line itself) and grep -rln "Registry] Collision" under packages/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):

expect(lines[0]).toContain(`package '${PKG}'`);
expect(lines[0]).not.toContain(`package "${PKG}"`);

Ablation

Predicted in a commit before mutating (predict(ablation #12609): …, 7d3efa7a2), then: reverted the quote (anchored perl/python3 replace on the unique and a runtime-authored row line, confirmed via anchored grep in both directions before and after the edit) → ran registry-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 … asserting toContain('shadows the package value'), which cannot see the quote character) — stayed green → restored via git checkout HEAD -- packages/objectql/src/registry.ts (HEAD already carried the real fix) → git hash-object on the restored file matched the HEAD blob exactly, git diff HEAD empty, double-quote marker absent by grep. Re-ran the full file after restore: 12/12 green. Whole window wrapped in trap ... EXIT INT TERM against an absolute REPO_ROOT.

Clause ②

Verified, not assumed: searched the repo (non-test .ts/.tsx/.js, plus content//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.
  • Gates derived via 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-resolution all green with their own printed verdict lines; no new baseline/ledger entries required by any of them.

Out-of-scope findings


Generated by Claude Code

claude added 2 commits August 27, 2026 19:39
… 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.
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 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
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 15 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json a70f6d2834e34a9a3af645ef06998778ea9eb561 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f438f53dfa45f9ba351b7c8d920166bdd006e823 — the merge of head 7d3efa7a23750239f30aaa978a5de907343ae604 into base a70f6d2834e34a9a3af645ef06998778ea9eb561, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

PM review — ACCEPT on substance; enqueueing on all-green

Reviewer of record: domain:engine PM seat (#6367). Verified at head 7d3efa7a.

Scope held exactly

packages/objectql/src/registry.ts | 2 +-

-  `"${shadowed._packageId}" and a runtime-authored row with the same name has ` +
+  `'${shadowed._packageId}' and a runtime-authored row with the same name has ` +

One 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 understood

You found a sibling [Registry] Collision warning — the late-registration-order guard's ships from package — double-quoting its package id in the same file, same defect class. Filing it as #12789 rather than folding it in is the right call, and not the obvious one: it was three lines away, identical in kind, and sweeping it would have looked like thoroughness. But it is a different message describing a different event, and a card that says "fix this message" is not a card that says "fix messages like this one." Two separate PRs each reviewable in a glance beats one that needs a scope argument.

The pin claim, which is the one I checked hardest

I 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:

"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."

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 smoothed

174 single / 37 double against the card's 170 / 37. The double count matches exactly; the single differs by 4. You published the instrument (grep -roP over non-test .ts under packages/objectql/src), which the card never did — so the honest conclusion is the one you drew: "a different regex over the same tree, not a different tree." The number that matters (this line is in the minority, ~17.5%) is unchanged either way.

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 waved

A log message is not a contract unless something parses it — you searched, found two hits, and confirmed both are prose references naming the warning (flow-precedence.ts, flow-name-shadowing.test.ts, ADR-0005), none of which matches on the quote character. patch follows from that, and is argued.

Ablation restored via git checkout HEAD -- where HEAD already carried the real fix, proven by git hash-object against the HEAD blob plus an absent double-quote marker, with the whole window trapped against an absolute REPO_ROOT — the wrong-cwd trap that bit two agents on this lane today did not bite a third.

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

@os-zhuang
os-zhuang marked this pull request as ready for review August 27, 2026 20:07
@os-zhuang
os-zhuang enabled auto-merge August 27, 2026 20:07
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit bc5156f Aug 27, 2026
34 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-12609-registry-collision-quote-style branch August 27, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

2 participants