Skip to content

fix(metadata-protocol): the registry heal retires a removed non-holder row's bare-slot entry when the pair relation names no single base (ADR-0150 D5) - #33825

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/area-E1-32620
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/area-E1-32620

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Fixes #32620
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:租户删掉自己对"两个包同名项"的定制后,注册表修复(heal)现在会把该定制留在裸槽位里的条目清掉,不再挑任何一个包。
  • 为什么改:此前删完后直到下次重载,点名该定制包的读取仍返回已删除的内容,点名两个原持有包的读取则被拒绝,且候选里是一个早已不存在的行(flow、permission 两种类型实测复现)。
  • 风险与回滚:只改一处判断,清除动词本身仍拒绝删除打包制品,不会误删任何持有包的条目;回滚即 revert 本 PR,回到"记日志、条目保留、重载后自愈"。
  • 先看:packages/metadata-protocol/src/protocol-registry-hydration.ts 中 restoreArtifactRegistryView 的 catch 分支(条件去掉 boundPackageOf(packageId) !== undefined),再看 packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts 新增的 describe。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-registry-heal-packageless-refusal.test.ts,预期 7 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

Ruling: epic seat ruling 6818436831 (epic:#31527#2), seat ruling A, "extend the retire", on the same footing as seat ruling 6812637203 Q2.

A stored row bound to a non-holder (an installed package holding no item of the name, ADR-0146) on a name two packages hold, where the pair relation names zero or several bases: after its delete, the heal's baseline read is refused and the walk stops with an error line. On main the removed row's bare-slot entry was then kept. It is now retired with removeOverlayEntry, the verb the package-less case (Q2) already uses, which refuses a packaged artifact. No holder is picked and no baseline is registered. Declared move: entry kept → retired, Clause-②: no.

  • restoreArtifactRegistryView's catch: the retire no longer requires a package-less row. A package-scoped refusal is the only refusal readHealBaseline lets through for a bound row, and it reaches it only after the row's own package answered a settled miss, so the row is a non-holder's. A peer that does not know the binding (HEAL_BINDING_UNKNOWN) keeps the logged stop, as before.
  • registryHealStoppedMessage gains one case, slot-retired. For the package-slotted types whose bound row lives in its own package slot (metadata-protocol: after a restart, two stored rows of one name that each name a different holder leave only the last one loaded, for every package-slotted type (tool, webhook, …) #33127), that slot is already retired above the catch, and the bare slot holds nothing to remove. The line said "the registry entry is left as it was and may serve the removed row". It now says the row's own package slot was retired.
  • No change to protocol.ts, the objectql registry, or any spec surface.

Which types reproduced at a557fa38 (the premise, measured)

The measurement booted a real SchemaRegistry with a real MetadataManager holding two holders' items, hydrated one stored row bound to a non-holder, and then deleted it through deleteMetaItem naming that package. It covered every PACKAGE_SLOTTED_METADATA_TYPES member plus dashboard and report, in both registration orders, with and without composite holder slots in the registry.

  • Reproduces: flow, permission, with holders served by the service and no composite slot in the registry. Before the delete, the bare slot held row:other. After it, the bare slot still held row:other, the read naming the non-holder served row:other, and each holder's read was refused with the non-holder as its only candidate. These are exactly the card's three bullets. These two types are the package-slotted types excluded from takesPackageOverlaySlot, so their bound row sits in the bare slot.
  • Does not reproduce: api, agent, skill, action, email_template, picklist, mapping, dataset, webhook, tool, connector. fix(objectql,metadata-protocol)!: a stored row bound to a package lives in that package's own registry slot, so each address serves its own row in every order (ADR-0150 D3/D4) #33513 already retires the bound row's own package slot, and the bare slot is empty. For these types only the line changes.
  • With composite holder slots, nothing reproduces: either tier 1 heals or the delete door refuses (403 NOT_OVERRIDABLE).
  • PM hypothesis 2 partly falsified. dashboard and report never reach this branch, because their store is not package-slotted and the bare read is not refused (no heal line). email_template is clean. See Acceptance notes for what dashboard and report do instead.

Tests

  • packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts: a new top-level describe on a real SchemaRegistry, sharing the file's one engine double. It covers flow and permission, each in both registration orders. Before the delete: the row is in the bare slot, and a holder's read is the 409 naming the non-holder. After it: the bare slot is empty, the non-holder's read serves nothing, each holder's read answers its own item, the bare read is the 409 naming both holders, the list shows the two holders only, and the line says the entry was retired. CONTROL action: the holders serve exactly as before, and the line says the row's own package slot was retired.
  • packages/metadata-protocol/src/protocol.registry-heal-package-read.test.ts: the recording-double pin "a row of a package that pairs no holder, on a name two packages hold" flips from tier3: [] to tier3: ['action|digest'] (the declared move). A sibling case covers the verb answering false, where the line says no entry was retired.

Ablation, once: the fix was committed first, then the bound-row exclusion was put back through scripts/ablation-replace.mjs, with a marker that must reach dist/.

  • objectql pins resolve @objectstack/metadata-protocol through dist/, so the mutated package was rebuilt and ablation-dist-preflight passed (exit 0) before the run. The mutated run had 5 failed, 2 passed (7): all four flow/permission cases failed with expected 'row:other' to be undefined, and the CONTROL failed with expected '[Protocol] the registry heal after th…' to contain 'retired from its own package's slot'. After the restore, git diff HEAD was empty, the blob hash matched HEAD, the package was rebuilt, and the dist marker was absent. The restored run was 7 passed.
  • metadata-protocol pins resolve source. The mutated run had 2 failed, 15 passed (17); restored, 17 passed.
  • The first objectql ablation leg was a no-op: the lock queue timed out before the rebuild, and the preflight caught it (dist reading failed). That run was discarded and redone as above.

Acceptance notes

  • dashboard and report (not package-slotted in the store), measured only in the no-composite shape. After a non-holder row's delete, tier 2's bare baseline read returns one holder's item, the one the service registered last, so the bare slot then serves that holder and the other holder's read is refused naming it. This branch is not this card's (no refusal, no heal line), and whether the no-composite shape is reachable for those types in a real boot was not measured. It is recorded for the seat, not filed.

Verification

Readings at head 7fce425024 (origin/main merged in), unless stated:

  • @objectstack/metadata-protocol: the whole suite passed, 340 files / 22884 tests, 9 files and 43 tests skipped, read at 6ba132b569. The merge then changed protocol-save.ts and registry-question.ts, so the heal file was re-run at the head: 17/17. typecheck exit 0.
  • @objectstack/objectql: typecheck exit 0. The objectql closure was rebuilt after the merge, then the 29 test files that drive the delete heal (restoreArtifactRegistryView, deleteMetaItem, or a heal line) were run: 680/680 passed. The full objectql suite was NOT MEASURED locally, because the shared verify lock queue-timed out twice. That run is left to CI's Test Core.
  • Derived gates (dispatch-gates --commands, 67 families): 66 exited 0. check:dual-build-cjs-loads exited 3 with PREREQUISITE NOT MET (no full-repo dist/ in this worktree), so it is NOT MEASURED and left to CI. --ran reconciliation: 67 derived, 67 run, 0 unrun.
  • ESLint over the three touched source and test files exited 0. PR body gates: check-closing-keyword-parity and check-partof-closing-keyword exited 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 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 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 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.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 10 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 1e65a389e12e7c07e2121378d1d0755226c2ad60 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 08ae2c1ecae5570b290094ca5cda7e8fd8c5b26c — the merge of head 7fce4250247ba5678e817e8570bd662f93dd200d into base 1e65a389e12e7c07e2121378d1d0755226c2ad60, 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 08ae2c1ecae5570b290094ca5cda7e8fd8c5b26c && git checkout 08ae2c1ecae5570b290094ca5cda7e8fd8c5b26c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1e65a389e12e7c07e2121378d1d0755226c2ad60 7fce4250247ba5678e817e8570bd662f93dd200d && git checkout -B drift-repro 1e65a389e12e7c07e2121378d1d0755226c2ad60 && git merge --no-ff 7fce4250247ba5678e817e8570bd662f93dd200d

node scripts/docs-audit/affected-docs.mjs --json 1e65a389e12e7c07e2121378d1d0755226c2ad60

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

Request: review · PR #33825 · area S4 (E1) · Fixes #32620 · head 7fce425

Clause-② no · Metadata-protocol none · patch changeset. Ruling 6818436831. Report on #32620 (comment 6893828566). Reviewer: review-b. Please check the two named deviations: the real-SchemaRegistry pin sits in an objectql test file outside the claimed surface, and the direct-dependent suites were left to CI.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review claim · head 7fce425 · 2026-11-15T11:48Z

review (review-b, areas S2+S4). Verdict follows on this PR.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS

Head-sha: 7fce4250247ba5678e817e8570bd662f93dd200d

review (review-b, areas S2+S4) · 2026-11-15T11:50Z

I read the full diff at this head against GitHub: 4 files, +182/−32. I also read card #32620, the epic ruling 6818436831, report 6893828566 and readHealBaseline / restoreArtifactRegistryView on this tree. check-governed-merges --pr 33825 reports NOT governed.

Ruling conditions (6818436831)

  1. Retire the entry with removeOverlayEntry: met.
    • The guard drops boundPackageOf(packageId) !== undefined.
    • I checked the change is no wider than the ruling. For a bound row, readHealBaseline lets a package-scoped refusal through only on one path:
      • the row's own package read settles a miss, so the package is a non-holder;
      • the bare read is refused;
      • the pair relation yields bases.length !== 1.
    • A holder's row returns its own item before any bare read. So the newly admitted case is exactly the ruled one.
    • HEAL_BINDING_UNKNOWN (a peer on a package-less cluster signal) still keeps the logged stop, as round 2's should-fix 2 asked.
    • At that point no row of the name is stored, because the remaining-rows branch returns first. So the bare entry the verb removes is the removed row's own, and the verb still refuses a packaged artifact.
  2. Declare kept → retired, Clause-②: no: met. The body and changeset both say "entry kept → retired" with Clause-②: no and Metadata-protocol: none. No export, type or key moves. patch.
  3. Pin on a real SchemaRegistry: met.
    • The objectql describe runs flow and permission, each in both registration orders. It asserts:
      • before the delete: the row is in the bare slot, and the holder read is the 409 naming the non-holder;
      • after the delete: the bare slot is empty, the non-holder read serves nothing, each holder serves its own item, the bare read is a 409 RESOURCE_CONFLICT naming both holders, and getMetaItems lists the two holders only.
    • An action control holds the package-slot path.
    • Ablation (bound-row exclusion restored, through the built dist with the preflight marker present): 5 red / 2 green, and 7/7 after restore. The discarded no-op first leg is reported honestly.
  4. Cite the ruling: met (body line 18, and the code comments).

Deviations judged

Flipped pin

protocol.registry-heal-package-read.test.ts: tier3 goes from [] to ['action|NAME'], which is the declared move. The sibling retireAnswers: false case pins the "No registry entry was retired" line, so the verb's answer is still what the line says (round 2's should-fix 1).

For the seat (not this PR)

The report's out-of-scope finding, class a, is a candidate with unmeasured reach. For dashboard / report (not package-slotted), the tier-2 bare baseline read after a non-holder delete is not refused. It re-registers the item the MetadataService registered last into the bare slot: a pick between two holders, against ADR-0150 D3. It is noted, not filed. The seat should measure its reach in a real boot, or dismiss it on the record.

Check-runs at this head (read at review time)

  • 15 success, including Lint · ESLint, Type Check · source gates, Type Check · debt ledger, Check Changeset, PR-body guards and Governed Surface Queue Guard.
  • 16 skipped.
  • 17 still running: Build Core, Test Core 1–8/8, Type Check · workspace and consumer gates, five Lint jobs, and Live E2E UI. None had failed.
  • Landing waits for all of them, and for Test Core above all, because it carries the dependents' reading.

Author. objectstack-fleet[bot] (relay write). The claim is 6892357189.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

席位核对

ACCEPT · area S4 (E1) · Head-sha: 7fce4250247ba5678e817e8570bd662f93dd200d

  • Review: review-b PASS on this head (comment 6893880330); all four conditions of ruling 6818436831 met; the objectql pin file, the slot-retired log fold and the dependents-left-to-CI deviation accepted, the last as a landing condition.
  • Landing condition (metadata-protocol is shared): Build Core and Test Core 1–8 plus the Test Core aggregate success on this head; they carry the dependents' reading.
  • Governed: check-governed-merges --pr 33825 NOT governed; under the 3000-line threshold.
  • Checks on this head: 51 check-runs, each success or an expected skip (UI, docs, opt-in harness and queue-only jobs skipped by the selector).
  • Declarations: Clause-②: no, Metadata-protocol: none, patch changeset; kept → retired declared.
  • Card relation: Fixes #32620.
  • Out-of-scope finding filed by the seat as metadata-protocol: after a non-holder row is deleted, the heal tier-2 bare baseline read picks the last-registered holder of a two-holder dashboard/report name #33832 (routed to S5).

Landing under the area authorising line: ready + auto-merge.

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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant