Skip to content

fix(metadata-protocol): a disabled holder counts for nothing at _env, the bare delete and discard, and the bare read beside a package-less row - #38948

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38753-disabled-holder-counts-nothing
Dec 1, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38753-disabled-holder-counts-nothing

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Part of #38753
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:管理员在某个包被停用后,环境地址的读取不再报出已停用的包名;按名删除和丢弃草稿作用到唯一启用的那个包,回执里不再提已停用包的残留行,也不再把已停用包的代码说成"恢复到出厂默认";重复删除不再误删已停用包的隐藏定制;某些原本答"找不到"的读取会正常返回启用包的内容。
  • 为什么做:属于"停用的包就该全部消失"这条原则的收尾,替所有停用过包的环境解决报错和回执里点名已停用包、误删其隐藏定制、或明明有内容却读不到的问题。
  • 出错会怎样:最坏情况是某个环境地址的读取答错冲突对象或答"找不到",或删除回执措辞不准;停用包的已存数据从此不会被按名删除碰到,合并后可直接撤回。
  • 要你做什么:无。按名保存草稿那一格要改的文件正被另一个在途合并请求占用,等它合并后由派单席位补进本卡。

What changes

A disabled package holds no name and is never named (ADR-0150 D3, the disabled-holder family's ruling, and the maintainer principle quoted on the card: 「我觉得停用就该全部消失」). Four doors still counted one. All cells are judged by one rule, "the holders are the enabled ones", in the sibling module packages/metadata-protocol/src/protocol-enabled-holders.ts.

  1. The _env cell (the card's own). admitEnvironmentQualifier throws its marked refusal (a name the registry knows only through disabled packages) naming no package now, and the refusal carries a judgment under a registered symbol key. The three _env doors (RestServer's qualified route, its import door's _env/NAME spelling, the runtime dispatcher) used to rethrow the refusal naming the disabled package whenever the read naming no package served an item; they now hand that read's outcome to the judgment, which answers 409 not-held-by-qualifier naming the ENABLED package the read answers with (the plain read's packageId, or the _packageId a draft read stamps on its item), or admits _env when it names none. Where that read withholds the name, _env still answers its 404.
  2. Folded cell (bare delete and draft discard). Rows bound to a disabled package D and to E, the only enabled shipper: the bare delete and the bare draft discard re-address to E (soleEnabledRowHolder, asked at the call sites in protocol-diff-delete-load.ts after the row-held-base judgment), as the bare read serves E and the bare publish save writes E's row. Two or more enabled holders keep the refusal naming exactly them. Added this round: the same re-address where the rows (or the draft address) are bound to ONE package and it is disabled, beside an enabled holder, so a repeat bare delete or discard once E's row is gone answers E's no-op receipt instead of removing D's row or draft (measured on this branch before the fix: the repeat bare discard answered Draft discarded (package=D) and the repeat bare delete Customization overlay deleted (package=D), each removing a customization hidden with D).
  3. Folded cell (the delete receipt, the class-a finding of the previous report). The receipts of the delete and the discard, bare or naming E, said "still carries another overlay: its row bound to package 'D' remains" and "so nothing was deleted: its row bound to package 'D' remains", naming the disabled package, and the delete of E's row of a name only a disabled package ships in code answered "reset to artifact default". countedRowHolders drops a disabled package (and a disabled holder's customization pair) from the rows the receipt names; shippedByCountedPackage makes a name only disabled packages ship no artifact default. The table drop's verdict still counts every stored row (remains is unchanged; only the receipt reads the counted set).
  4. Folded cell (disabled code-only holder). One enabled package's row beside a package-less row, with a disabled package shipping the name in code only: servedRowHolderOf (protocol-meta-item-face.ts) serves the enabled package's row, as the same fixture answers without the disabled package (it answered 404).

Pins flipped (FROM to TO, each named):

  • packages/rest/src/meta-qualified-item-route.test.ts, the CONTROL "only a disabled holder in the registry, and an enabled package's unhydrated stored row": details.candidates FROM the disabled B TO the enabled C; plus the stored-draft CONTROL's _env draft reads and layered read now assert candidates C and that B appears nowhere.
  • packages/runtime/src/domains/meta-qualified-item-read.test.ts: the same two pins on the runtime dispatcher.
  • packages/objectql/src/package-scoped-exact-qualifier.test.ts (row 17 / R4-B2 pin, the S4 CONTROL): the marked refusal's candidates FROM the disabled X TO none, and X absent from its message; plus a new pin of the judgment (plain read, draft read, the read's own refusal, and the three admit cases).
  • packages/rest/src/meta-disabled-package-doors.test.ts, the S2 CONTROL "one bound package beside a disabled code holder is left as it was": FROM 404 on plain, layers and published TO the enabled package's row, compared in the same test with the fixture minus the disabled package's code item.
  • New in that file: the bare delete and draft discard (both save orders, D shipping in code or not, D's rows byte-unchanged, and a CONTROL with a second enabled shipper); the receipts of the discard, the delete and both repeats, bare and naming E, compared with the same fixture without D (seq aside) and never naming D; and the delete receipt of E's row beside a disabled code-only shipper, with and without a package-less row, compared with the fixture without that code item.
  • packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts near line 1732 is not flipped: that pin has two ENABLED shippers beside the disabled authored package, so its refusal naming the two shippers is genuine and stays verbatim.

Handover

Head: dec9a08c (merge of origin/main 645e6b1 at 5b84a860, then the receipt fold 123f1121 and its changeset line dec9a08c). Taken over from the previous dev's 4fd5608d: every commit read hunk by hunk and kept; the suites and gates that dev left unmeasured were re-run (Tests below).

Left (this PR stays Part of):

  • The draft save naming no package (rows bound to a disabled D and the only enabled shipper E) still answers 409 RESOURCE_CONFLICT naming D and E. Its judgment sits in packages/metadata-protocol/src/protocol-save.ts, which another open pull request holds, so it is not edited here; it joins this card by claim amendment once that one merges. The change it needs, in saveMetaItem just before the block that asks disabledRowHoldersRefusal for an ambiguous draft address: when soleEnabledRowHolder(host, singularType, request.name, member, draftAddress.candidates) answers a package, set request.packageId to it, clear draftAddress, and set followedBase to it (as the row-held-base follow does a few lines above). Unmeasured. The same file's packagelessHolderRefusal docblock carries a "Known gap" paragraph that is now wrong about the delete and the draft discard and needs rewording with it.

Tests

Readings on dec9a08 (local, under the verify lock; metadata-protocol and objectql on 123f112/dec9a08c, whose source is identical)
  • Red first: the five new receipt cells failed on 5b84a860 plus the re-address of the previous dev (4 cells: the delete receipt named app.disabled_demo, the repeat discard and delete removed D's draft and row; 2 cells: "reset to artifact default" where without the disabled code the delete answers "it no longer exists").
  • @objectstack/metadata-protocol, full suite: 379 files passed / 9 skipped; 23868 tests passed / 45 skipped.
  • @objectstack/objectql, full suite: 646 files, 14663 tests passed.
  • @objectstack/rest, local project, full: 444 files passed; 9162 passed / 351 skipped.
  • Targeted after the restore leg: rest meta-disabled-package-doors + meta-qualified-item-route + import-integration 594 passed; runtime meta-qualified-item-read + meta-disabled-holder-served-stack 644 passed; objectql package-scoped-exact-qualifier 472 passed.
  • turbo run typecheck for metadata-protocol, rest, runtime, objectql (after building driver-turso): 45 of 45 tasks passed.
  • @objectstack/runtime full suite: NOT MEASURED locally (it did not finish inside the 10-minute foreground cap); CI's Test Core shards are the evidence.
Ablations of this round (scripts/ablation-replace.mjs, rebuilt, dist preflight passed, restored and rebuilt)
  • A, countedRowHolders's filter dropped: the 4 receipt cells went red, the code-only cells stayed green.
  • B, shippedByCountedPackage forced true: the 2 code-only receipt cells went red, the rest stayed green.
  • C, the single-disabled-candidate re-address of the delete forced off: the 4 receipt cells went red (the repeat delete removed D's row).
  • D, the draft-address re-address of the discard forced off: the 4 receipt cells went red (the repeat discard removed D's draft).
  • Restore leg: all four markers absent from dist/, targeted pins green (counts above).
  • The previous dev's ablations A to C (the _env judgment, soleEnabledRowHolder, the servedRowHolderOf arm) stand as recorded on 4fd5608d; the code they mutate is unchanged.
Gates
  • dispatch-gates --commands on dec9a08 derived 76 families; all 76 run locally with exit codes, --ran reconciliation: 73 run, 3 NOT MEASURED (the teardown-shape self-test cannot read its pinned commit on a shallow clone; check:dual-build-cjs-loads needs every package's dist/; check:query-options-erasure did not finish in 240 s). CI's Lint & Repo Gates (with Lint · scoped · query-options erasure) is green on dec9a08.
  • overlap-check before each push: clean.

Acceptance notes

  • _env with NO registry holder and an enabled package's unloaded stored row serves that package's row at the environment's address (200), measured on 8338d070 by the previous dev. ADR-0150 D5 says _env answers the environment's own item. A different cell (no disabled package), reported for filing, not changed.
  • A package-less row beside ONE disabled package's row, with an enabled code shipper: the re-address added this round deliberately skips it (without the disabled package that delete removes the package-less row, not the shipper's, so "act at the shipper" would be wrong there). Read-only inference, not measured: the bare delete there may still address the disabled package's row. Recorded, not filed.
  • Where the read naming no package serves an item that names no package, the _env judgment admits (the environment's own item, as D5 reads it). No pinned fixture reaches that branch through a door; the objectql pin covers it.

Verification

Run pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-disabled-package-doors.test.ts -t 38753: 11 pass; every delete and discard receipt reads as without the disabled package and none names app.disabled_demo.

Riskiest hunks: packages/metadata-protocol/src/protocol-diff-delete-load.ts (the re-addressing call sites and the receipt's counted rows), packages/rest/src/meta-qualified-item-route.ts (admitEnvironmentAddress, now judges instead of rethrowing), packages/metadata-protocol/src/protocol-meta-item-face.ts (servedRowHolderOf, the new arm before both "as it was" exits).


Generated by Claude Code

… the bare delete and discard, and the bare read beside a package-less row (wip)

Claude-Session: https://claude.ai/code/session_01ADHkmNrdDzc1MxHJU3Tvyb
Co-authored-by: Claude <noreply@anthropic.com>
…ete and discard, and the bare read beside a disabled code holder

Claude-Session: https://claude.ai/code/session_01ADHkmNrdDzc1MxHJU3Tvyb
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

21 anchor(s) derived from 3 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 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 — 44 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 665dfc4d815013918dd255236362bf426663baa1 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 665dfc4d815013918dd255236362bf426663baa1

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ

2026-12-01T16:25Z · Flake reading before a one-time re-run of the failed jobs (readings-ci.md).

Head dec9a08c. The only red is Test Core (10/12) (job 142751478115, run 46677236846) and the Test Core aggregate it feeds. The log names one test in @objectstack/plugin-approvals: src/flow-route.integration.test.ts:817 "[#38838] a fan-out to two approval steps is refused at publish > an active save is refused with 422 INVALID_METADATA…", Error: Test timed out in 5000ms. It failed on the clock, not an assertion: 1 failed, 2259 passed in that package.

Why I judge it a flake: this PR touches only the meta delete, discard and _env doors (packages/metadata-protocol/src/protocol-enabled-holders.ts, protocol-diff-delete-load.ts, their tests); nothing on the flow publish save path. The dev ran the same file at dec9a08c locally: 24/24 passed. Every other Test Core shard and every other lane is green on this head.

Action: one re-run of the failed jobs of run 46677236846 via rerun-failed.mjs. A second failure is treated as real.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ

Final green head · 2026-12-01T16:48Z · zone osa-data
Head-sha: dec9a08

  • CI at this head: 41 success, 20 skipped, 0 failure, 0 running; mergeable_state clean. Test Core (10/12) went green on the one-time re-run of its failed job (flake reading 7317584274: a 5000 ms timeout in plugin-approvals flow-route.integration.test.ts:817, outside this diff).
  • Diff against merge base 645e6b1: 12 files, +682 / −80. Not governed (0 of 12 paths); 762 lines ≤ 3000. Part of #38753: the bare draft-save cell (protocol-save.ts) is still owed and joins by claim amendment after feat(spec)!: a view holds lists only; view-held forms are tombstoned #38908 merges.
  • This round (dev report 7317531505 on metadata-protocol: the _env draft and layered reads answer 409 naming a DISABLED registry holder, against the principle that a disabled holder counts for nothing #38753): merged main at 5b84a86 with no conflicts; class-a delete-receipt finding folded: countedRowHolders / shippedByCountedPackage in protocol-enabled-holders.ts, read by the delete and discard receipts in protocol-diff-delete-load.ts, so a disabled package's row is not named as a remaining overlay and its code is not called the artifact default. Same cell, found by the red-first pin: a repeated bare delete/discard removed the disabled package's row/draft; now re-addressed to the one enabled holder (soleEnabledRowHolder). 6 new pins red first, 11 green after; 4 ablations each turn their pins red. 76 derived gates: 73 run exit 0, 3 NOT MEASURED (shallow clone, missing dist/, a 240 s timeout); CI Lint & Repo Gates green.
  • Open for review: the repeat-delete re-address goes past the literal finding (dev deviation 2, in-place exemption); a bare delete beside a package-less row plus one disabled package's row with an enabled code shipper is deliberately not re-addressed (read-only inference, Acceptance notes); the _env class-b finding and the stale packagelessHolderRefusal docblock are routed, not fixed here.
  • Sent to osa-L1-a for L1 and the owed L2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review · PR #38948 (Part of #38753) · head dec9a08 · 2026-12-01T16:50Z

VERDICT: ACCEPT. No must-fix and no should-fix.

  • Face. l1-face at dec9a08 read 13 items and flagged one; nothing is unmeasured. Checks are 41 success, 20 expected skip and 0 failed, and mergeable_state is clean. Test Core (10/12) went green on its one recorded re-run (7317584274), a 5000 ms timeout in plugin-approvals, outside the diff. Part of #38753 is right: the bare draft-save cell in protocol-save.ts joins by claim amendment after feat(spec)!: a view holds lists only; view-held forms are tombstoned #38908.

  • The one flag, changeset, is cleared by reading. @objectstack/objectql is touched only by src/package-scoped-exact-qualifier.test.ts. objectql's files[] is dist/README/CHANGELOG, and its tsconfig excludes **/*.test.ts, so nothing of it ships. The changeset's three patch entries (metadata-protocol, rest, runtime) cover every shipped file.

  • Which L2 is owed: none. The released claim's dev named one, for "a new protocol symbol key read by three doors". I judged the face:

    • 0 of 12 paths match a recogniser.
    • ENVIRONMENT_READ_REFUSAL is a Symbol.for key exported only from the internal module protocol-enabled-holders.ts. packages/metadata-protocol/src/index.ts is unchanged and the package exports . alone. rest and runtime re-derive the key with Symbol.for(...) and do not import it. So it is an inter-package registry key, not a published export.
    • No exported interface or type of a published package gains a member, so Clause-②: no is right and no declaration face is owed.
    • Nothing an author writes moves, so Metadata-protocol: none is right.
    • The change sits in the wire answers of the _env doors and the bare delete and discard. This L1 judges it at the lane tier, below.
  • In-place exemption (dev deviation 2): accepted. It re-addresses a repeated bare delete or discard, once E's row or draft is gone, from the disabled D's row to E's no-op receipt. Four conditions make it in place:

    The guard is tight. soleEnabledRowHolder answers only when a candidate counts for nothing AND exactly one enabled holder remains. The single-candidate arm needs !unbound. So an enabled sole candidate, no enabled holder, a package-less row, two or more enabled holders and the environment's own item all keep their old answers. The table-drop verdict still counts every stored row (remains is unchanged), and only the receipt reads countedRowHolders.

  • Code read.

    • admitEnvironmentQualifier no longer names a disabled package: candidates: [], and the judgment is carried under the key.
    • The three _env doors restate the read's outcome. They answer 409 naming the ENABLED package that read answers with, or admit _env. Where that read withholds the name they keep 404.
    • In servedRowHolderOf, the oneEnabledBesideDisabled arm is limited to one enabled candidate beside a package-less row with a disabled code holder. The S2 CONTROL flip compares against the same fixture minus D's code item.
    • shippedByCountedPackage returns false only when every shipper is disabled. A name with no package stamp keeps true.
  • Pins flipped: each is named FROM → TO in the body. The meta-disabled-holder-served-stack pin that has two ENABLED shippers is rightly left verbatim.

  • Changeset. I read it sentence by sentence and it matches the diff. One wording point: it opens with "Three doors still counted one" and then lists four bullets. The receipt is not a door, so the count holds, though it reads oddly. That is no finding.

  • Routed, not owed here: the _env class-b cell, the stale packagelessHolderRefusal "Known gap" docblock (in protocol-save.ts, which goes with the draft-save cell), and the two Acceptance-note cells. Each is recorded for the seat's filing gate.

Next: the zone lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ

2026-12-01T16:52Z · Landing: L1 ACCEPT at head dec9a08 (7318356829), no must-fix or should-fix; L1 judged no L2 owed (0 of 12 paths match a recogniser, ENVIRONMENT_READ_REFUSAL is an internal Symbol.for key, not a published export). Not governed, 762 lines ≤ 3000, CI 41 success / 20 skipped / 0 failure, mergeable clean. Ready for review and auto-merge (squash). Part of #38753: the card stays open for the draft-save cell after #38908.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 16:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 670bc89 Dec 1, 2026
92 of 94 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38753-disabled-holder-counts-nothing branch December 1, 2026 17:25
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/l 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.

2 participants