Repository navigation
fix(metadata-protocol)!: global search leaves out the objects of a disabled package - #35367
Conversation
…bal search Claude-Session: https://claude.ai/code/session_01Utp6CbP6iSEGkWb5fn8yqd Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbP6iSEGkWb5fn8yqd Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): ⛔ 1 release-owned page(s) name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 10 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 7e7e69c86b1942a03ea65c7c2a58ef6706254030 && git checkout 7e7e69c86b1942a03ea65c7c2a58ef6706254030
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8b550f8193962a18091b79b8bc890cd63a91dc67 7e8e4e8aa12129e28635c1f2ade5c552c2b963cc && git checkout -B drift-repro 8b550f8193962a18091b79b8bc890cd63a91dc67 && git merge --no-ff 7e8e4e8aa12129e28635c1f2ade5c552c2b963cc
node scripts/docs-audit/affected-docs.mjs --json 8b550f8193962a18091b79b8bc890cd63a91dc67
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbP6iSEGkWb5fn8yqd 2026-11-19T07:01Z Final head for review: Area notes for the reviewer:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
…, level patch Claude-Session: https://claude.ai/code/session_01Utp6CbP6iSEGkWb5fn8yqd Co-authored-by: Claude <noreply@anthropic.com>
…arch-disabled-package
|
repo:objectstack#5 · os-bill · session_01Utp6CbP6iSEGkWb5fn8yqd 2026-11-19T07:47Z Final head for L2: |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: PR #35367 for card #35195. Net diff against ① Derived judgments
② Semver levelClause-②: yes (narrowing) — confirmed. A caller of the search door on an environment with a disabled package gets fewer hits than before; the Metadata-protocol:
Check Changeset on this head — two check-runs of that name, one red; the gate IS satisfied. Verified from the runs, not from the area's account:
All other check-runs on this head: success or skipped, no other failure. ③ Boundary flags
④ Design judgmentThe narrowing makes the published refusal real; it takes no declared capability away. The published meaning of a disable on Attempts to break it, all in the cited code:
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CbP6iSEGkWb5fn8yqd 2026-11-19T08:32Z Landing PR #35367 (card #35195) at head
State: ready + auto-merge armed by area pkg-2. On MERGED the area closes #35195 and clears its labels. |
Requested by Bill · project thread
Fixes #35195
Clause-②: yes (narrowing: global search stops returning a disabled package's records, the answer every data route already gives)
Metadata-protocol: none
Skills-docs: none — no skill teaches which objects the global search sweep covers, or what a package disable does per door; the change moves a runtime answer, not anything an author writes
维护者速读
GET /api/v1/search不再返回已停用包的对象记录;以停用包对象为引用标题目标时,命中只显示原 id,不再借出该记录的标题。OBJECT_PACKAGE_DISABLED,搜索却照样返回这些记录的标题和匹配片段,管理员无法如实承诺"停用即隐藏"。packages/metadata-protocol/src/protocol-record-reads.ts(sweep 循环里isObjectOfDisabledPackage那一行,与readReferenceTitles里同一判断)、packages/metadata-protocol/src/protocol.search-disabled-package-35195.test.ts、.changeset/35195-search-disabled-package.md。pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.search-disabled-package-35195.test.ts,预期 8 个用例全绿。What changes
searchAll(the body behindGET /api/v1/search) walksregistry.getAllObjects(), which still lists a disabled package's objects: the schema stays resolvable on purpose. Nothing on that path asked whether the object's package was disabled, so the records came back as hits whileGET /api/v1/data/:object/:idanswered404 OBJECT_PACKAGE_DISABLED.isObjectOfDisabledPackage(registry, name), the same optional-called predicate the data plane'sassertObjectRegisteredand the by-name/metareads ask, right beside the exposure decision. Such an object is never queried, never named, never counted intotalObjects, and the security service is never asked about it. An explicit?objects=naming it answers exactly as one naming no object (a sweep, not a by-name read, so no 404), the same answer an object the exposure decision refuses already gets.readReferenceTitlesasks the same predicate of the lookup TARGET, so an enabled object whosenameFieldpoints into a disabled package keeps the bare id, the answer an unreadable target gives. Without it the disabled record's title text still reached the response.getMetaItems({ type: 'page' }), which already omits a disabled package's items (isItemOfDisabledPackageinprotocol-meta-list-reads.ts).The registry member is not declared on the host type (
MetadataHostEngine.registryisany), so the guard uses the existing optional reader inprotocol-authoring-refusals.ts: a registry that cannot answer hides nothing.Tests
New file
packages/metadata-protocol/src/protocol.search-disabled-package-35195.test.ts, through the realsearchAllon the protocol, 8 cases:canReadObjectis never asked about it; the same for a context-less call; an explicitobjects=naming it equals the answer for a nonexistent object;case_5);isObjectPackageDisabledhides nothing.Ablation (both guards, source import, restore proven by blob)
scripts/ablation-replace.mjs(anchor 1 → 0, blob e880bb73d891 → b9abfc1b7690):Tests 3 failed | 5 passed (8): THE PIN, the context-less case and theobjects=case red, title and controls green. Restored: blob == HEAD,git diff HEADempty.Tests 1 failed | 7 passed (8):expected [ [ 'note_1', 'PDF export fails' ] ] to deeply equal [ [ 'note_1', 'case_5' ] ]. Restored: blob == HEAD,git diff HEADempty.The test imports
./protocol.jsrelatively (source), so nodist/leg applies.Package suite and typecheck
All at head
cc13fef3.pnpm --filter @objectstack/metadata-protocol build && … typecheck(tsc --noEmit, tsconfig includessrc/**/*, so the new test file is compiled): lockVERDICT command-exit 0.pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2(whole package):Test Files 359 passed | 9 skipped (368),Tests 23226 passed | 45 skipped (23271), lockVERDICT command-exit 0.Test Files 5 passed (5),Tests 57 passed (57).Acceptance notes
searchAll's method docblock inprotocol.ts(its stated contract) has no paragraph for the disabled-package skip; the reasoning sits at the guard inprotocol-record-reads.ts.protocol.tswas outside this card's file fence, so the docblock was left alone.servesExpansionTarget(protocol-query-validation.ts) judges an$expandtarget only by its declared exposure, not byisObjectPackageDisabled. Whether a data-route$expandinto a disabled package's object serves its fields was not measured here.protocol-meta-list-reads.tscitesprotocol.package-disable-enforcement.test.ts, which does not exist under that name inpackages/metadata-protocol/src.Verification
Head
cc13fef3(git rev-parse --short HEAD), merge base81c09477.Derived gate families (dispatch-gates --commands, 67)
--ranreconciliation:67 derived famil(ies) accounted for — 67 run, 0 NOT-MEASURED.check-plugin-teardown-shape.mjs --self-testexited 3 on the shallow clone (pinned fixture commit unreachable); after fetching that one commit: exit 0,48 cases pass.check:lean-entry-closureexited 3 (objectqldistabsent); after the dogfood closure build: exit 0,Admitted set held exactly (15 packages).check:type-check-debtexited 3 while the lock was held by the dogfood run; rerun with the lock free: exit 0,0 raw tsc error(s) total, none above its recorded number.check:dual-build-cjs-loads: exit 3, NOT MEASURED (needs every package built; 77disttrees absent). CI'sLint & Repo Gatescarries it.node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0,0 anchored files in the change set — nothing judged.node scripts/pm/overlap-check.mjs --branch=HEADbefore each push:VERDICT clean exit 0.Dogfood battery (narrowing arm), final head cc13fef
pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood testunder the lock:Test Files 482 passed | 3 skipped (485),Tests 4092 passed | 68 skipped (4160),VERDICT command-exit 0. No failures.test:repowas not run locally (no file of that project in the diff); CI'sTest Corecarries it.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CbP6iSEGkWb5fn8yqd