Repository navigation
fix(metadata-protocol,rest,runtime): beside a disabled package, the bare read, /layers and /published serve the one enabled holder of a doc, view or other type the registry does not read by package - #34354
Conversation
…bled holder beside a disabled one, for every type the registry does not read by package servedHolderAddressOf re-addressed the bare read, /layers and /published to the served holder only for a type the registry reads by package. For a doc, view, translation, hook and the rest, the layer read by name alone (the metadata service's copy of the package registered last, or the registry's first composite) could be the disabled holder's: the face withheld it and the read answered 404, and /layers served the disabled body. An object and an action keep their own judges. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…or by its status Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…disabled package hold serves the enabled holder for every type the read re-addresses The mixed-owner arm of both /published doors judged only a type the registry reads by package, so once the read naming no package served the enabled holder of a doc, the snapshot exit served the metadata service's copy, the disabled holder's body. The arm now covers every type that read re-addresses, all but an action. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…he function that reads it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
📓 Docs Drift CheckThis PR changes 3 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 44 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 b5095d092a59a91d0f5abf1480c3e9e9cb914c91 && git checkout b5095d092a59a91d0f5abf1480c3e9e9cb914c91
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f59a4aa040910debf0f060a329b3a094c190c082 662c7c973e2cba355fec914518320c7ce4d1c8e1 && git checkout -B drift-repro f59a4aa040910debf0f060a329b3a094c190c082 && git merge --no-ff 662c7c973e2cba355fec914518320c7ce4d1c8e1
node scripts/docs-audit/affected-docs.mjs --json f59a4aa040910debf0f060a329b3a094c190c082
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft Final head declared · PR #34354 (
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34354 · L1-b · 2026-11-16T10:18ZHead-sha: L1 ACCEPT · area o1-D 定稿评论 6913215493 所钉 head。
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft Landing · PR #34354 · area o1-D · 2026-11-16T10:19Z
State change: ready + auto-merge now. On merge, |
Requested by Steedos · project thread
Fixes #34041
Clause-②: no
Metadata-protocol: none
维护者速读
/layers和/published现在都返回启用包的条目。覆盖 doc、view、translation、hook 等所有“注册表不按包读取”的类型(object、action、package 除外)。/layers甚至把停用包的正文当作 effective 返回。packages/metadata-protocol/src/protocol-meta-item-face.ts(servedHolderAddressOf去掉 readsByPackage 门槛,新增SERVED_HOLDER_JUDGED_ELSEWHERE);packages/rest/src/meta-item-history-routes.ts与packages/runtime/src/domains/meta.ts中/published的 mixed-owner 分支(同一条件,两处孪生)。pnpm --filter @objectstack/runtime exec vitest run src/domains/meta-disabled-holder-artifact-door.test.ts,预期 23 passed,[#34041]组在两种注册顺序下全部为绿。What changes
ADR-0150 D3 says a disabled package holds no name. For a type the registry reads by package, the read naming no package already took the served holder's address when a disabled package also holds the name (
servedHolderAddressOf, #32183). Every other type read the layer it finds by name alone. That layer is the metadata service's copy, which belongs to the package registered last, or else the registry's first composite. Either one could be the disabled holder's. The face then withheld it, so the plain read answered 404, and/layersserved the disabled body aseffective.servedHolderAddressOf(protocol-meta-item-face.ts) no longer requiresreadsByPackage(type). It re-addresses every type except thoseSERVED_HOLDER_JUDGED_ELSEWHEREnames:object(one owner, refused with its disabled package),action(its bare judgejudgeBareActionReadalready serves the one enabled holder; measured unchanged) andpackage. Read at the served holder's address, the read is that holder's exact read, which never answers another package's service copy (serviceCopyOfAnotherPackage, fix(metadata-protocol): an exact?package=read never answers another package's metadata-service copy of a doc, view or other type the exact qualifier does not judge #34241). Its callers inprotocol-meta-item-reads.tsandprotocol-meta-layered-reads.tsneeded no edit./publisheddoor twins (rest/src/meta-item-history-routes.ts,runtime/src/domains/meta.ts): the mixed-owner arm'sreadsByPackage(type) === trueconjunct becomes "type is notaction" (objectandpackageare excluded there already). Without this, once the plain read served the enabled holder, the snapshot exit served the metadata service'sgetPublishedcopy, which is the disabled holder's body (measured: 200beta docon both transports). The claim amendment (comment 6908475841) widened the file surface to these two files.FROM → TO
One enabled holder (alpha) and one disabled holder (beta) of a name, for each of
doc,view,translation,field,seed,datasource,external_catalog,object_extension,hook,job,sharing_rule,queueandassignment_rule:GET /meta/TYPE/NAME, when the layer read by name is beta's (the service copy with beta registered last, or the registry's first composite with beta registered first and no copy)/layers, same stateseffective= beta's bodyeffective= alpha's item/published(doc, composed rig, beta registered last)action,object,package; a name no disabled package holdsPUT /meta/doc/NAMEbeside a disabled holderNOT_OVERRIDABLE(sealed)Nothing served becomes refused, so
Clause-②: noholds as claimed. No authorable key, value or type moves, soMetadata-protocol: noneholds too.Tests
packages/objectql/src/package-scoped-exact-qualifier.test.ts, a new top-level describe[#34041]beside the metadata-protocol: an exact read of a doc (?package=A) of a name two packages ship can answer the other package's doc, because the metadata service keeps a doc by name alone #34040 type enumeration. It holds an enumeration pin (every type the registry does not read by package is pinned, one-holder, or judged elsewhere). Per type, in both orders, with beta disabled, the plain read and/layersserve alpha in each of three service states (no copy, alpha's copy, beta's copy), and with both disabled there is no item. CONTROLs: a doc with two enabled holders is refused 409 naming both, before and after a disable and re-enable; an action is unchanged; a view with no disabled holder reads as before.packages/runtime/src/domains/meta-disabled-holder-artifact-door.test.ts, a newdescribe.each[#34041]on the composed artifact rig (theMetadataPluginartifact door plusAppPlugin), on both transports and in both orders. With beta disabled, the plain read,/layers(code and effective) and/publishedservealpha docand never# beta. CONTROL: with both disabled, every door answers 404; with both re-enabled, every door refuses 409 naming both.Reverse verification against origin/main 01598d9 (before the fix)
Tests 28 failed | 4 passed. Example, view with beta registered last and the service keeping beta's copy: Received[undefined, "beta view"], Expected["alpha view", "alpha view"].404 undefined, Expected200 "alpha doc".dispatcher doc/shared_doc/publishedandrest doc/shared_doc/published, Received200 "beta doc".Ablation (ablation-replace; restore blob equals HEAD; git diff HEAD empty; tree clean)
readsByPackagegate put back inservedHolderAddressOf(metadata-protocol resolves throughdist/in both suites, so it was rebuilt;ablation-dist-preflightfound the marker in 2 built files, and after restore and rebuild--absentfound it in none of 24). objectql:Tests 28 failed | 352 passed (380), e.g. Receivedundefined, "beta view". Rig:1 failed | 22 passed, with all six door rows red. The first attempt at this leg was a no-op: the build folded its string marker away, preflight reported it ABSENT, and nothing ran. It was redone with a marker that reachesdist/./publishedarm (runtime aliases@objectstack/resttosrc): rig1 failed | 22 passed, the only red rowrest doc/shared_doc/published, Received"beta doc"./publishedarm: rig1 failed | 22 passed, the only red rowdispatcher doc/shared_doc/published, Received"beta doc".Acceptance notes
servedPackagelessSaveAddress(protocol-save.ts, not edited) asks the same judgment. For a doc beside a disabled holder, the bare save is refused 403NOT_OVERRIDABLE(a sealed managed package) both before and after this change, in both orders, so the save is unchanged. This was measured with a scratch probe on the composed rig.Verification
_env, and its package-less customization is withheld (ADR-0150 D3, D4) #33995's edits to the same face and door files; merge-tree was clean and the merge had no conflict): rebuilt;typecheckexit 0 for metadata-protocol, objectql, rest and runtime. NOT MEASURED at this head: the suites, the two pin files and the derived gates. Reason: a maintainer order to hand off now stopped that run, so the readings below are from the previous head. The next seat (or CI) re-runs them.Suites, typecheck and gates at the previous head 42610dc (origin/main 3b1307e merged in), under the shared verify lock
Touched packages and their direct dependents:
--project unit: 421 passed and 2 failed on the first run, becausepackages/cliitself was not built. Afterpnpm --filter @objectstack/cli build, those 2 files pass (29 tests).The rest:
typecheck: metadata-protocol, objectql, rest and runtime all exit 0.check:type-check-debt: exit 0.--no-inline-configon the 5 touched source and test files: exit 0.dispatch-gates --commands: 73 derived, all 73 run. 72 exit 0.check:query-options-erasureexit 0, on a rerun after a 300 s local timeout under contention.check:dual-build-cjs-loadsanswered PREREQUISITE NOT MET: it needs every package built, so it is NOT MEASURED locally and is left to CI.--ranreconciliation: 73 derived, 73 run, 0 UNRUN.git merge-tree --write-tree: clean against origin/main, origin/claude/area-E1-32849-nomember (884050f, then 013010a) and PR fix(metadata-protocol,rest,runtime)!: a name only disabled packages hold answers 404 at_env, and its package-less customization is withheld (ADR-0150 D3, D4) #33995 (0f5f95d, the one open PR that touched these files; it has since merged). PR fix(metadata-protocol,rest,runtime)!: a name only disabled packages hold answers 404 at_env, and its package-less customization is withheld (ADR-0150 D3, D4) #33995 first conflicted on an adjacent insertion inprotocol-meta-item-face.ts. Moving the new constant belowservedHolderAddressOfmade it clean.Generated by Claude Code
🤖 Generated with Claude Code