Skip to content

fix(metadata-protocol): the merged list files a stored row's copy under its package column, not its body's _packageId - #38699

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jxaxyy
Nov 30, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jxaxyy

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #38573

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:托管环境上,元数据列表(含技能列表)里一条已保存的技能只按它所属应用列出一次,不再同时挂到正文里写的另一个应用下;没有所属应用的旧记录不再被当成别的应用的。
  • 为什么做:AI 区,应用技能归属;替云端的应用技能卡(cloud#4973)解决协议路径上的归属错误。
  • 出错会怎样:影响托管环境的元数据列表读取;只改读取、不改存储,撤回此改动即恢复原样。
  • 要你做什么:无。

What changes

getMetaItems lays the stored sys_metadata rows over the items the metadata service lists (protocol-meta-list-reads.ts, the runtime merge). On a hosted kernel that service is a primed MetadataManager: its list answers the BODY of each stored row it read, and a body can carry a _packageId stamp naming another package than the row's package column. The stored rows themselves are served with the column's binding (withRowBinding), but the service's copy re-entered under its body stamp, so for a row bound to P with a body stamped Q:

  • the env-wide list served it twice (P and Q);
  • a list scoped to Q served it as Q's item (the line-764 package filter read the stamp);
  • a legacy row with an empty column stood in for Q's slot and was listed as Q's.

The merge now reads the service through IMetadataService.listPackageBindings (#37039) when the service offers it, and restates each item a stored row holds (source: 'row') with that row's column through withRowBinding, the rule every other read of a stored row already states its package by. An item no stored row holds (source: 'registration') keeps its body unchanged, so #7654's package-less override over a code baseline still stands in for the code package. A service without listPackageBindings is read through list as before (the contract says such a service cannot tell the two apart).

Responsibility: the runtime merge slotted service items by item._packageId since before #37039 added a binding read; the fix and its consumer contract both live in this repository, and cloud's SkillRegistry (cloud PR #5223) already reads the protocol's merged list as the row binding.

Tests

New top-level describe in the existing harness packages/metadata-protocol/src/protocol.meta-list-runtime-baseline-dedup.test.ts (the runtime-merge harness), pins on skill and agent:

  • a row bound to P with a body stamped Q is listed once, under P; a legacy row is listed under no package;
  • the list scoped to Q holds neither;
  • the list scoped to P holds its row once;
  • a registration item stays under its registration package;
  • CONTROL: a service without listPackageBindings still reads bodies (both slots, as before).

Red on origin/main 5ac1ee0 with only the test added: 4 failed / 13 passed (the env-wide and Q-scoped cases on both types; the received list was differs|com.example.crm, differs|com.example.policy, legacy|com.example.crm). Green with the fix: 17/17.

Local runs (heads 36ab001 and 88569ee)
  • pnpm --filter @objectstack/metadata-protocol test: Test Files 374 passed, 9 skipped; Tests 23698 passed, 45 skipped; lock VERDICT command-exit 0.
  • pnpm --filter @objectstack/metadata-protocol typecheck: VERDICT command-exit 0.
  • Derived gate families (dispatch-gates.mjs --commands, 67, --ran reconciled 67/67) at 36ab001: 63 exit 0; check:test-source-alias exit 1 (this harness reached the protocol's lazy @objectstack/lint load inside a case), fixed in 88569ee with a module-top import and re-run exit 0.
  • NOT MEASURED (exit 3, prerequisite): check:dual-build-cjs-loads and check:lean-entry-closure need every package's dist/ (no full build in this container); check-plugin-teardown-shape.mjs --self-test needs an unshallow clone (checker health only, not a PR verdict). CI runs all three.
  • Focused file at 88569ee: 17/17.

Acceptance notes

  • Each getMetaItems call with a metadata service that offers listPackageBindings now runs one more loader walk for row columns (MetadataManager.listPackageBindings is uncached; DatabaseLoader reads through its row cache). Not measured on a live kernel.
  • The by-name read (readItemFromMetadataService) was not examined for the same body-stamp question; this PR changes the list only.

Verification

pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.meta-list-runtime-baseline-dedup.test.ts — expect 17 passed; revert the source hunk and expect 4 failed.


Generated by Claude Code

…er its package column (#38573)

The `metadata` service merge in getMetaItems slotted a hosted kernel's
primed copy of a stored row by the `_packageId` its body carries, so a
row bound to P with a body stamped Q was listed under P and Q, a list
scoped to Q served it as Q's, and a legacy row with no column was listed
as Q's. Read the service through listPackageBindings when it offers it
and restate each row-held item's binding from the row's column
(withRowBinding), as the stored rows are served. Pins on skill and agent.

Claude-Session: https://claude.ai/code/session_01JQwxbYAjtLtucYL4W61z6Q
Co-authored-by: Claude <noreply@anthropic.com>
…runtime-merge harness (#38573)

Claude-Session: https://claude.ai/code/session_01JQwxbYAjtLtucYL4W61z6Q
Co-authored-by: Claude <noreply@anthropic.com>
@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 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/metadata-protocol, touching 6 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/kernel/contracts/metadata-service.mdx (via listPackageBindings (symbol, a method of interface BindingService))
What this run could not see
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 e130fd43b6f8ff5ce7744ab39e22abd09e0314fe → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json e130fd43b6f8ff5ce7744ab39e22abd09e0314fe

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs e130fd43b6f8ff5ce7744ab39e22abd09e0314fe → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

维护者速读

  • 用户能看到什么变化:元数据列表(如技能列表)里,一条存储的记录按它自己所属的包列出。以前如果记录内容里写的包和记录本身的包不一致,同一条技能会在两个应用下各出现一次,按另一个包筛选时也会被列进去。
  • 风险:只改合并列表时取包的方式;没有提供包绑定读取的元数据服务,行为和以前一样。
  • 要你做什么:无;发布冻结解除后席位入队。

席位核对

ACCEPT · L1 · area o2-A · Head-sha 88569ee83639d1d1912450f638aec3d503108483 · 2026-11-30T06:30Z

  • Face: not governed (check-governed-merges --pr 38699). Clause-②: no / Metadata-protocol: none / @objectstack/metadata-protocol patch accepted. The claim's yes was corrected to none in amendment 7269803456: this changes which package a stored row is served under, not what an author can write.
  • Design read against the diff: the list merge in protocol-meta-list-reads.ts reads listPackageBindings when the metadata service offers it, and files each source: 'row' item under its row's column through withRowBinding. Registration items keep their registration binding. A service without listPackageBindings reads list as before.
  • Contract read: MetadataPackageBinding.data is "the body, exactly as list answers it" (packages/spec/src/contracts/metadata-service.ts:226-239). A degraded binding read still lists every item, at its registration binding (MetadataManager.listPackageBindings), so the swap from list drops no item.
  • Pins: 4 red on 5ac1ee0bc8: a row bound to P with a body stamped Q, which before the fix was listed under both and served on a Q-scoped list, and a legacy row. The pins cover a skill and an agent, plus a registration case and a control. Package: 23,698 passed, typecheck clean (report 7269788862).
  • Premise: the card's repro file under pm-orders/cloud/seat3/reports/ does not exist. The dev rebuilt the shape from cloud's skill-row-binding-4973 test.
  • Checks at this head: 39 success, 16 skipped, 0 failed.
  • Changeset: read sentence by sentence against the diff, true.
  • Serial: seat 3's open fix(metadata-protocol)!: same-name reads that name no package answer the environment's doc first and read a disabled holder as absent #38640 changes neighbouring metadata-protocol files, not this one. Whichever lands second merges main.
  • Landing: Tier S (not governed). Held as a draft under the release freeze; the seat readies and enqueues it when the freeze lifts. Fixes #38573 closes the card on merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

2026-11-30T07:10Z · Landing · seat ACCEPT 7270724673 at 88569ee836 stands (head unchanged). All checks green, mergeable_state clean against main.

  • The release freeze does not apply: Warren (os-warren) answered in os-warren's fleet project timeline at 2026-11-30T07:08Z 「目前已经开发中的不用冻结」, which exempts work already in development.
  • Tier S (not governed): ready for review and auto-merge in this stroke. The queue re-runs every check on the merged tree.
  • Fixes #38573 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 30, 2026 07:11
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46371865560 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/package-move-in.dogfood.test.ts > dogfood: POST /packages/:id/move-in, the move door (#38150) > A3 (#37468) and the set rule: flow, dataset and report
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected 404 to be 200 // Object.is equality
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • test/package-move-in.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 2 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

…rvice's list footing (#38573)

The merged list read asked listPackageBindings on every call, uncached.
Inside a package move's transaction a flow re-sync waited up to 281 ms
for it, so the moved flow was armed after the move answered and the
dogfood move-in A3 read 404 at the package's address (queue build
46371865560). Memoize the binding read per (service, type) on the
service's revision counter (ADR-0156 D2) and the service's own list
bounds (30 s, 2 s degraded); a service without a revision is read every
time.

Claude-Session: https://claude.ai/code/session_01JQwxbYAjtLtucYL4W61z6Q
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbYAjtLtucYL4W61z6Q

Patch round · head b9f0665 (merge of origin/main 751e839 at aca2c1d)

Patch round after the queue ejection (build 46371865560, package-move-in.dogfood A3: 404 at the moved flow's package address). listPackageBindings is uncached (it walks the loaders again and reads the row columns), while the list it replaced is memoized by the service. Measured on the merged tree: inside a package move's transaction the flow engine's re-sync (syncMutatedFlows reading getMetaItemsForExecution) waited up to 281 ms on it, against 0.1 ms for list, so the moved flow was armed after the move answered and the next read missed it. Removing this PR's source hunk on the same tree: 24/24. The binding read now lives in listed-package-bindings.ts (listedPackageBoundItems), kept per (service, type) on the service's revision counter (ADR-0156 D2, the counter meta-compile-cache.ts already keys on) and the service's own list bounds (30 s, 2 s for a degraded answer); a read the counter moved under, or a failed one, is not kept; a service with no numeric revision is read every time (no counter guessed). The new module is a sibling because the list-reads file is over 1,000 lines. This changes the design the ACCEPT read: the binding answer can now be as old as the service's list memo, never older.

Pins and runs

Patch round pins, src/listed-package-bindings.test.ts (8): one binding read while the revision stands and the bound has not passed (BEFORE: one per call); re-read on a revision move, per type; re-read past 30 s, or 2 s for a degraded answer; nothing kept from a read the revision moved under or a failed read; no revision reads every time; no listPackageBindings answers list bodies. Ablation at b9f0665 (memo removed on disk, rebuilt): this file 2 failed / 6 passed, and package-move-in.dogfood A3 failed again (1 failed / 23 passed); restored, both green.

Patch-round runs (head b9f0665, merged with origin/main 751e839)
  • pnpm --filter @objectstack/metadata-protocol test: Test Files 375 passed, 9 skipped; Tests 23718 passed, 45 skipped.
  • pnpm --filter @objectstack/metadata-protocol typecheck: green.
  • pnpm --filter @objectstack/dogfood test (full battery, one lock hold, VERDICT command-exit 0): Test Files 495 passed, 3 skipped; Tests 4187 passed, 68 skipped.
  • Derived gates (67): 65 exit 0; check:type-check-debt exit 3 on the first pass (lock queue timeout behind the battery), re-run exit 0; check-plugin-teardown-shape.mjs --self-test exit 3 (needs an unshallow clone; checker health only, NOT MEASURED).

Correction to the PR body's Acceptance notes

The first note ("one more loader walk … uncached") no longer holds: the binding read is memoized on the service's revision and list bounds, so a write that bypasses the service and changes only a row's package column is seen within the bound list already has. The body is unchanged because the relay refuses a body whose first line is not a seat signature, and the body's first two lines are the project attribution.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

维护者速读

  • 用户能看到什么变化:元数据列表(如技能列表)里,一条存储的记录按它自己所属的包列出,不再因为记录内容里写了另一个包而在两个应用下各出现一次。
  • 这一轮补了什么:上次入队时,包迁入的自测失败了(迁入后流程晚了一步才生效)。原因是新的读取没有缓存,事务里要等锁。现在这一读和原来的列表读用同一套缓存规则,有改动就立即失效,迁入自测 24/24 通过。
  • 风险:只改合并列表时取包的方式和这一读的缓存;没有提供包绑定读取的元数据服务,行为和以前一样。
  • 要你做什么:无,席位直接入队。

席位核对

ACCEPT · L1 · area o2-A · Head-sha b9f066554af02b20354b7edd503d9d2bc43ee91a · 2026-11-30T08:54Z

Supersedes ACCEPT 7270724673 (at 88569ee836): the design changed.

  • Cause, as measured by the dev (PR comment 7273449078): A3 reproduced 404 on the merged tree and went green without this PR's source hunk on the same tree. The bindings and list answers were identical item for item, so it was latency. listPackageBindings is uncached, while the list it replaced is memoized by MetadataManager. Inside the move's transaction the flow re-sync (syncMutatedFlows → getMetaItemsForExecution) waited up to 281 ms on it, against 0.1 ms for list, and armed the moved flow after the move answered.
  • Fix read against the diff: listed-package-bindings.ts#listedPackageBoundItems keeps one in-flight-or-finished read per (service, type) and serves it again only while the service's revision stands where it stood, within the service's own list bounds (30 s; 2 s degraded).
    • The key matches the list memo's own (MetadataManager.listCache is keyed by type on a per-scope service instance), so no answer crosses services.
    • revision moves on every path invalidateListCache covers: local writes, repository events, a cluster peer's write, HMR and artifact ingest. So the answer is never older than list's.
    • A read the counter moved under is answered and not kept; a failed read is not kept.
    • A service with no numeric revision is read every time; one with no listPackageBindings reads list.
    • The items are shared between callers, as list's memoized items already were. The merge reassigns filtered arrays and does not mutate them.
  • Pins: 8 in listed-package-bindings.test.ts. The ablation (memo removed) turns 2 pins and A3 red. The 4 pins of the first round stand.
  • Gates: package-move-in dogfood 24/24 and the full battery (4187 passed, 68 skipped, 495 files) at the head; metadata-protocol 23718 passed; typecheck green. Checks at this head: 39 success, 16 skipped, 0 failed.
  • Face: not governed, Clause-②: no, Metadata-protocol: none, 317 lines. Claim amended 7273494041 (admits the module and its test).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

2026-11-30T08:55Z · Re-landing · seat ACCEPT 7273503695 at b9f066554a (supersedes 7270724673). This PR left the queue at 2026-11-30T07:36Z as the root of anchor #38725. A3 is now reproduced green at this head: package-move-in 24/24 and the full dogfood battery passed. All checks green.

  • The release freeze does not apply: Warren (os-warren) answered in os-warren's fleet project timeline at 2026-11-30T07:08Z 「目前已经开发中的不用冻结」.
  • Tier S (not governed): auto-merge in this stroke. Fixes #38573 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 5bb397d Nov 30, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-jxaxyy branch November 30, 2026 09:22
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… that name no package give the answer the read names (objectstack-ai#38752)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9BzWvmsAKskRGFXQ4iwDJDW)_

Fixes objectstack-ai#34452

Refs objectstack-ai#34346, objectstack-ai#34417, objectstack-ai#33904, objectstack-ai#34258 (the fold's members, closed into
objectstack-ai#34452 on 2026-11-20) and objectstack-ai#33127 (heal 2 only)

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no key an author writes changes; the moved answers
are writes, a restart and action reads that name no package, which the
skills already teach as "name the package"

## 维护者速读

-
用户能看到什么变化:同名元数据在不点名包时,写入、重启后的读取、动作的读取,都和读取给出同一个答案:停用包当作不存在,环境自己的条目先答,不再随保存或注册顺序变化。
- 为什么做:这是同名读取折叠组 objectstack-ai#34452 的写门与水合半边(读门半边是已合并的 objectstack-ai#38640),合并即关 objectstack-ai#34452;四张成员卡与
objectstack-ai#33127(只修第二处 heal 2)随折叠组关闭。
- 出错会怎样:不点名包、去写或读共享名字的调用方,会改拿 409 冲突或环境自己的条目;点名包就能拿回原来那份。改动可以整体撤回。
- 要你做什么:无(契约复审由席位送审)。

## What changes

Five criteria, one commit each, on `main` after objectstack-ai#38640:

1. **objectstack-ai#34346** (9d731b0): two enabled packages ship a name, and its
stored rows are bound to a disabled package D and to one of them, E. The
bare publish save, the bare draft save and the bare delete now refuse
409 naming the two enabled holders, as the bare read does. They never
name D, and they write or remove nothing. `?package=E` saves and deletes
as before. Before, the publish save wrote E's row (200), and the draft
save and the delete refused naming E and D.
(packages/metadata-protocol/src/protocol-save.ts,
protocol-diff-delete-load.ts)
2. **objectstack-ai#34417** (0a14e90, criterion rewritten by the seat to ruling
6942962369): the environment's package-less doc row, hydrated after the
artifacts registered (`loadMetaFromDb`), answers first on every bare
door, on both transports and in both registration orders. Each holder's
exact address (the plain read and `/layers`) reads that holder's own
doc. Before, the hydrator grafted the first registered holder's envelope
onto the row, so `?package=FIRST` served the environment's row under
that holder's name and the bare doors refused 409.
(protocol-registry-hydration.ts)
3. **objectstack-ai#33127 heal 2** (a8bf411, `Refs`): for the three healed overlay
types, a package-less row with no holder served wears no envelope and is
recorded with no holder, by the hydrator and by the heal alike. The
enable that later serves one holder builds the row under that holder's
envelope, as the hydrator lays it then. Before, the lookup that names no
package answered a disabled holder's artifact, and the heal dropped the
record. No door's answer moves (registry-only; the pins are in
packages/objectql/src/package-scoped-exact-qualifier.test.ts).
4. **objectstack-ai#33904** (616d76d, b61bcd2, 73c2de8 and 9910fbc, ADR-0150 D4,
ruling 6942962369): a package's action of a name on one object, and the
environment's own package-less action of the name on another object that
no package's action of the name binds, are separate items at D4's key
`(package, objectName, name)`. One predicate,
`holdsEnvironmentOwnAction` (sys-metadata-repository.ts), reads the
environment's own action off the item's active rows. The read naming no
package serves its row and version, the merged list slots an action by
`(name, object)` where a package's action of the name binds that object,
an object-less action being a key of its own (elsewhere, by name as on
`main`, so a platform item and the environment's object-less row of its
name stay one slot, which `/actions/_env/OBJECT/NAME` reads as the
platform item's key: runtime action-package-addressing.test.ts), and the
delete naming no package removes the environment's row and retires the
registry's bare-slot entry it left. With no such row, every door answers
as before. Before, the plain read, `/layers` `effective` and
`/published` served the package's item, the list named only it, and the
delete removed the package's row. The same holds with the package's
action object-less and the environment's on an object (73c2de8; before
it, the list named only the package's).

**List cells with no environment-own action** (73c2de8, declared in the
changeset bullet "The merged action list where a package binds the
object" and in the `environment-action-on-another-object-answers-first`
entry). Two packages P1 on `account` and P2 on `contact`, a package-less
row on `account`: FROM the row listed under both packages and P2's own
action dropped, TO the row listed as P1's customization and P2's own
action listed. A list scoped to a code package on `account`, the
environment's row on `contact` passed as a stand-in: FROM the package's
slot serving the environment's body, TO the package's own action. A
platform action of the name (no package, no stored row) on `lead`, or
object-less, beside a package's action on `account` or object-less
(9910fbc, the contract review's S3): FROM the platform action dropped,
TO both listed (the bound variant moved at 616d76d, the object-less one
at 73c2de8); the bare read already refuses that name 409 naming both,
so the list now names the two candidates the refusal names. Pins:
packages/metadata-protocol/src/protocol.action-list-slot-key.test.ts,
red on `main` (8) and on b61bcd2 (3: the object-less cells).
5. **objectstack-ai#34258** (fa54140, ADR-0150 D3/D4): a package-less action row is
withheld or served by the holders at its own `(object, name)` key, not
the name's. With two or more holders bound to the key, the envelope
lookup (`lookupArtifactItem`, protocol-artifact-lookup.ts) lends the ONE
enabled holder's envelope; with two enabled holders, or none, it answers
as before. The face's withhold judges the key's holders
(`actionKeyHoldersOf`, protocol-meta-item-face.ts). Before, a disabled
and an enabled holder on the row's object made the row wear the disabled
one's envelope when it registered first, and the read withheld it (404).
And an enabled package holding the name on another object kept a key
whose every holder is disabled served.

**Narrowing cell.** Every holder on the row's object disabled (A and B
on `account`), an enabled C holding the name on `contact`, the
environment's row on `account`: the read naming no package moves FROM
200 serving the row (the name's holders were judged, and C is enabled)
TO 404, as a key whose every holder is disabled answers with no other
holder of the name. The `!` and `Clause-②: no (narrowing)` cover it.
Pin: rest `[objectstack-ai#34258]` "A and B disabled on `account`, C enabled on
`contact`" (the "objectstack-ai#34258 key" ablation arm turns it red). The changeset
bullet, the `package-less-action-row-judged-at-its-key` entry and the
pin title give it as FROM 200 → TO 404 (b0e3f1d, text only).

Plus (10c011f) four ADR-0087 semantic entries under step 19:
`bare-write-beside-disabled-row-refused-naming-shippers`,
`hydrated-doc-row-wears-no-holder-envelope`,
`environment-action-on-another-object-answers-first` and
`package-less-action-row-judged-at-its-key`. Also the changeset
`.changeset/34452-same-name-writes-and-hydration.md` (BREAKING banner,
FROM and TO per criterion; objectstack-ai#33127 heal 2 noted as moving no door).

What `Fixes objectstack-ai#34452` leaves open, each with its home:

- objectstack-ai#34452's scope appendix 7259555802 listed an `_env` cell (the `_env`
draft and layered reads answering 409 naming the disabled registry
holder). It is moved out of this PR on the seat's ruling, because it is
a different mechanism: `admitEnvironmentQualifier` falls back to
registry holders, disabled ones included. Filed as objectstack-ai#38753.
- objectstack-ai#33127 heal 1 (see Acceptance notes): filed as objectstack-ai#38754.
- A bare read of a name whose every holder is disabled answers 404: not
to be done, ruled on objectstack-ai#34348 (7187668758).
- With ONE enabled shipper beside a disabled one, the bare draft save
and the bare delete still refuse 409 naming the disabled package: filed
by the seat as objectstack-ai#38769, closed as a duplicate into objectstack-ai#38753 (the
`packagelessHolderRefusal` docblock names it as a known gap, citing
objectstack-ai#38753).
- The hydrated doc row's envelope with one shipper: filed by the seat as
objectstack-ai#38770.

## Tests

Flipped pins (each pinned the FROM the criterion moves):
-
packages/runtime/src/domains/meta-disabled-holder-artifact-door.test.ts:
the review M1 CONTROL that pinned objectstack-ai#34417's FROM is replaced by the
criterion's `[objectstack-ai#34417]` pin.
-
packages/metadata-protocol/src/protocol.packageless-save-address.test.ts:
the objectstack-ai#33904 FROM pins (the read and the delete naming no package
answering P's item) now assert the TO.
-
packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts
and action-list-packageless-other-object.dogfood.test.ts: the objectstack-ai#33904
FROM legs (read, delete, list) now assert the TO.

New pins:
- `[objectstack-ai#34346]` in
packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts:
the three bare writes refuse naming the two shippers and nothing moves,
plus a `?package=E` CONTROL.
- `[objectstack-ai#34417]` in meta-disabled-holder-artifact-door.test.ts: both
transports, both registration orders.
- `[objectstack-ai#33127 heal 2]` in
packages/objectql/src/package-scoped-exact-qualifier.test.ts: the enable
while no holder is served, and the hydrator run in that state.
-
packages/runtime/src/domains/meta-environment-action-other-object-33904.test.ts
(new file): every door naming no package, the list, a restart, the
delete, the version, plus CONTROLs with no environment row.
- packages/metadata-protocol/src/protocol.action-list-slot-key.test.ts
(new file, 73c2de8): the list's slot key, cell by cell with each FROM
in the title, plus five CONTROLs (a platform action on the package's
object sharing its slot, a customization on the package's object, an
object-less customization, a platform item with the environment's
object-less row kept one slot, another type slotted by name).
- `[objectstack-ai#33904] P's action OBJECT-LESS, the environment's on \`task\`` in
protocol.packageless-save-address.test.ts (73c2de8): the list names
both, the bare read serves the environment's, the bare delete removes
the environment's row.
- `[objectstack-ai#34258]` in packages/rest/src/meta-qualified-item-route.test.ts: two
disabled holders on the key beside an enabled one on another object
(404, both orders), plus the card's CONTROL (one disabled and one
enabled on the key: served as C's customization).

## Acceptance notes

- objectstack-ai#33127 heal 1 (S1) is not done, on the seat's ruling (objectstack-ai#38754): an
install sends no notice, so there is no trigger for it. With an install
in that state, every door answers 409 naming E and F in all three
states. Only the registry's scoped read of E and the execution list keep
the row until the next unscoped hydration. Reported to the seat.
- objectstack-ai#34258: the name-grain stored-row check (`enabledRowHolds`) stays as
on `main`. A key-grain filter was written and ablated. It turned no pin
red, because a sealed holder's rows are declined first
(`declinesStoredRow`), so it was dropped as unreachable.
- The envelope lookup keeps its earlier answer for two enabled holders
at one key (`protocol-artifact-lookup.action-owner-key.test.ts` CONTROL,
unchanged). The bare read refuses that name before any envelope.
- Rebased over objectstack-ai#38594 (merged), which added `rollback` to the
disabled-holders verb. The two helpers this PR adds
(`enabledHoldersRefusal`, `disabledRowHoldersRefusal`) take every verb
but `rollback`: no rollback door calls them, and the 409 message has no
rollback wording.

## Verification

Head 5db4acc. It adds two commits to 73c2de8: 9910fbc (the contract
review's S3: the platform-action list cell declared in the changeset
bullet and the `environment-action-on-another-object-answers-first`
entry, the count corrected to three cells, three pins and a CONTROL; no
code moves) and 5db4acc (N5: the known-gap note cites objectstack-ai#38753). On them,
under the lock (`VERDICT command-exit 0` each): spec build,
`gen:migration-registry` no diff, spec migrations 209/209, spec
`test:repo` 1608/1608, the two metadata-protocol list and save-address
files 120/120 (the list file 13/13), typecheck of metadata-protocol and
spec; gate families 1 to 81 of the 103 ran on 9910fbc and 82 to 103
plus `check-issue-citations` on 5db4acc (the two differ by one
comment), every one exit 0, `dispatch-gates --ran`: 103 derived, 103
run, 0 NOT-MEASURED; overlap-check `VERDICT clean exit 0` against
`origin/main` 6ba8ddd. On 73c2de8 every CI check passed, `Dogfood
battery (opt-in)` included (66 success, 13 skipped); a new run is owed
on this head.

On 73c2de8, on `main` cb8d853 (after objectstack-ai#38640, objectstack-ai#38594, objectstack-ai#38699 and
objectstack-ai#38712), in this container, heavy runs under
`scripts/pm/os-verify-lock.sh` (shared box).

73c2de8 answers the contract review (S1, S2, N1 to N3): a package's
object-less action is a list key of its own, the two list cells that
moved are measured, pinned and declared FROM and TO, and three text
fixes (the `packagelessHolderRefusal` docblock keeps its known gap; the
bare-write entry's surface excludes a stored package-less row; the
hydrated-doc entry counts a disabled shipper). On it, under the lock
(`VERDICT command-exit 0`, held 1h27m40s): `pnpm build` 123/123;
`gen:migration-registry` no diff; spec migrations 209/209;
metadata-protocol 23813 passed / 45 skipped; runtime, the whole package,
658 files, 12568 passed / 27 skipped; rest 9099 / 351 skipped; objectql
14570; the two dogfood files 6/6; `test:repo` of objectql, rest,
runtime, spec, core and types; typecheck of metadata-protocol, runtime,
rest, spec and objectql; all 103 derived gate families exit 0
(`dispatch-gates --ran`: 103 derived, 103 run, 0 NOT-MEASURED);
overlap-check `VERDICT clean exit 0` against `origin/main` bb86347.

b61bcd2 fixes two CI reds of b0e3f1d, both from objectstack-ai#33904's list slot:
the local helper's name `actionObjectKey` was the objectstack-ai#14878 dead member the
tree-wide repo pins refuse (renamed `actionSlotSuffix`), and slotting
EVERY action by object split a platform item from the environment's
object-less row of its name, so `/actions/_env/lead/approve` served the
platform item instead of 404 (runtime action-package-addressing.test.ts;
bisected with rebuilt dists: `main` and the first three commits green,
616d76d red). On b61bcd2, under the lock (`VERDICT command-exit 0`):
metadata-protocol 23803 passed / 45 skipped; runtime, the WHOLE package,
658 files, 12568 passed / 27 skipped; `test:repo` of runtime, objectql,
rest, spec, core and types; rest 9099 / 351 skipped; the two dogfood
files 6/6; typecheck of metadata-protocol and runtime;
`check:issue-citations`, `check-nul-bytes`, `check:adr-symbol-anchors`,
`check:slot-lookup`, `check:type-check-debt`,
`check:query-options-erasure`, `check:undeclared-dep-imports`, each exit
0; overlap-check clean. The earlier local runtime reading covered
`src/domains` only, which is how this cell was missed.

b0e3f1d (the L1 delta) changes text only: the changeset bullet, the
entry, a pin title and two docblocks. On it, under the lock (`VERDICT
command-exit 0`): spec build, `gen:migration-registry` (no diff), spec
migrations 209/209, the CLI `migrate-meta-engine-guidance` pin 3/3,
`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, rest `meta-qualified-item-route.test.ts`
439/439, metadata-protocol typecheck, `check:upgrade-guide`,
`check:issue-citations`, `check-nul-bytes`, each exit 0; overlap-check
clean.

<details><summary>Suites</summary>

Under the verify lock: `VERDICT command-exit 0` (held 1h12m59s).

| run | exit | result |
|:--|:--|:--|
| `pnpm install --frozen-lockfile` | 0 | |
| `pnpm --filter @objectstack/spec gen:migration-registry` | 0 | no diff
|
| `pnpm --filter @objectstack/spec exec vitest run src/migrations` | 0 |
5 files, 209 tests |
| `pnpm build` | 0 | 123/123 tasks |
| `pnpm --filter @objectstack/metadata-protocol test` | 0 | 376 passed,
9 skipped files; 23803 passed, 45 skipped tests |
| `pnpm --filter @objectstack/objectql test` | 0 | 641 files, 14570
tests |
| `pnpm --filter @objectstack/rest test` | 0 | 442 files; 9099 passed,
351 skipped tests |
| `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2
src/domains` | 0 | 245 files; 7487 passed, 6 skipped tests |
| dogfood, the two files this PR changes
(`action-save-packageless-other-object`,
`action-list-packageless-other-object`) | 0 | 2 files, 6 tests |
| `typecheck` of metadata-protocol, runtime, rest, spec, objectql | 0
each | |

The full dogfood battery is not run locally: this PR's title carries
`!`, so it is owed by the opt-in CI lane (`Dogfood battery (opt-in)`) on
this head. For reference, an earlier full dogfood run on the same
commits over `main` 830ff8b passed: 495 passed and 3 skipped files,
4187 passed and 68 skipped tests.

That earlier run also found three type errors after the rebase onto
objectstack-ai#38594 (the verb above, and an `undefined` narrowing in
`lookupArtifactItem`). They were fixed in the commits that introduced
them, and the runs above are on the fixed head.

</details>

<details><summary>Ablation (dev-ablation.md: commit first, mutate with
ablation-replace, rebuild, dist preflight, run, restore from HEAD, prove
an empty git diff HEAD, rebuild, preflight --absent)</summary>

Run on the branch before the rebuild from `main`. The code is the same,
apart from the two type-only fixes named under Suites, which move no
runtime path.

| arm | mutation | pins red | restored |
|:--|:--|:--|:--|
| objectstack-ai#34346 | the bare-write refusal beside a disabled binding made
conditional (two guards in protocol-save.ts) | runtime `[objectstack-ai#34346]` 4 |
diff empty, marker absent |
| objectstack-ai#34417 | the hydrated environment doc grafts the holder's envelope
again | artifact-door `[objectstack-ai#34417]` 2 | diff empty, marker absent |
| objectstack-ai#33127 heal 2 | the no-holder-served branch and its record made
conditional | objectql `[objectstack-ai#33127 heal 2]` 2 | diff empty, marker absent |
| objectstack-ai#33904 predicate | `holdsEnvironmentOwnAction` answers false |
metadata-protocol 3, runtime 3 | diff empty, marker absent |
| objectstack-ai#33904 list slot | the list slots actions by name again |
metadata-protocol 2, runtime 2 | diff empty, marker absent |
| objectstack-ai#33904 list slot, b61bcd2 | arm A: by name again; arm B: every bound
object joins the slot (the b0e3f1d rule) | A: metadata-protocol 2,
runtime 2, dogfood list 2; B: runtime `action-package-addressing` 1 |
each: `git status --porcelain` empty, rebuilt, marker absent |
| objectstack-ai#33904 list slot, 73c2de8 | an object-less action is no key of its
own again (the b61bcd2 rule) | metadata-protocol 3 (the two object-less
list cells and the object-less pin in packageless-save-address); runtime
0 | `git status --porcelain` empty, rebuilt, marker absent |
| objectstack-ai#33904 delete heal | the bare-slot entry is not retired on delete |
runtime 1 | diff empty, marker absent |
| objectstack-ai#34258 lookup | the one enabled holder at the key no longer lends the
envelope | rest `[objectstack-ai#34258]` 1 (the CONTROL) | diff empty, marker absent |
| objectstack-ai#34258 key | the face's key-grain withhold made conditional | rest
`[objectstack-ai#34258]` 1 | diff empty, marker absent |
| objectstack-ai#34258 stored rows | a key-grain filter on `enabledRowHolds` (since
dropped) | 0: unreachable, see Acceptance notes | diff empty, marker
absent |

The lookup leg was run again after the fix kept the earlier answer for
two enabled holders (the lookup CONTROL in metadata-protocol had gone
red in the full suite): 1 red, restored. An `ablation-dist-preflight
--absent` reading exits 3 while untracked files are in the tree, even
when the dist reading passes; the final readings were taken on a clean
tree.

</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 103 families for
this diff. All 103 ran on 73c2de8, again across 9910fbc and 5db4acc
(see Verification), and before them on 10c011f, after the build above,
each with `< /dev/null`, and every one exited 0. This includes
`check:type-check-debt`, `check:query-options-erasure` and the
`migrate-meta-engine-guidance` CLI pin.

`dispatch-gates --ran`: 103 derived, 103 run, 0 NOT-MEASURED, 0 UNRUN.

`node scripts/pm/overlap-check.mjs`: merges cleanly with `origin/main`
6ba8ddd, `VERDICT clean exit 0`.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmQmQ1jpFsNcARMbY56

<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmQmQ1jpFsNcARMbY56 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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

Development

Successfully merging this pull request may close these issues.

Protocol merged skill list serves a primed copy of a stored row under its body's _packageId, not the row's package column

2 participants