Skip to content

fix(metadata-protocol): the bare draft save beside a disabled package's rows writes the one enabled holder's draft - #39035

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38753-draft-save-cell
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38753-draft-save-cell

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #38753

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:作者在不指定包的情况下保存草稿时,如果同名条目有一个已停用包的数据和唯一一个启用包的数据,保存现在会写到启用包的草稿上,不再报冲突并点出已停用包的名字。
  • 为什么做:这是「停用的包一律不算数」这项工作的最后一格,前一个合并已修好删除和丢弃草稿,这次补上保存草稿。
  • 出错会怎样:最坏情况是这类草稿保存写到了启用包上而非报冲突;已停用包的数据不会被改动,撤回这次合并即可恢复原来的报错行为。
  • 要你做什么:无。

What changes

  • packages/metadata-protocol/src/protocol-save.ts, saveMetaItem: just before the ambiguous-draft-address refusal (disabledRowHoldersRefusal), a draft save naming no package whose draft rows are bound to a disabled package D and to the one enabled holder E the read naming no package counts is re-addressed to E (soleEnabledRowHolder): request.packageId = E, draftAddress cleared, followedBase = E, as the row-held-base follow a few lines above does, so the named-base rule and the late override re-judgment judge E. Before: 409 RESOURCE_CONFLICT naming D and E, while the bare read serves E and the bare publish save writes E's row. With two or more enabled holders soleEnabledRowHolder answers nothing and the refusal naming only the enabled holders stands.
  • The packagelessHolderRefusal docblock's "Known gap" paragraph is reworded: the delete, the draft discard and now the draft save all act at the one enabled holder first.
  • packages/rest/src/meta-disabled-package-doors.test.ts: four new cells on PR 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's fixture (both save orders, D shipping the name in code or not): the bare draft save's effect on the stored rows equals its effect without D (E's draft replaced, nothing else), D's rows byte-unchanged, no refusal. The second-enabled-shipper CONTROL now also pins the draft save's 409 naming the two enabled shippers, never D, with nothing written.
  • .changeset/38753-draft-save-cell.md: patch for @objectstack/metadata-protocol.

This is the last cell of #38753 (PR #38948 merged the rest as Part of), so this PR closes it.

Tests

Red first, fix, ablation (local, under the verify lock)
  • Red on 742b2442 (test only, fix absent): the four new draft-save cells failed with RESOURCE_CONFLICT:409:Name the package this save is for, then send it again ... dashboard 'one_shipper_dash' belongs to 2 packages ('app.disabled_demo', 'app.healthy_demo') ...; the other 11 cells of -t 38753 (the extended CONTROL included) passed.
  • Green on d059c60f after rebuilding @objectstack/metadata-protocol: -t 38753 15 passed / 82 skipped.
  • Ablation (scripts/ablation-replace.mjs --hold, anchor if (sole !== undefined) { turned into a branch that never runs): rebuilt, ablation-dist-preflight found the marker in dist/index.cjs and dist/index.js; the four draft-save cells went red with the same 409 naming D and E, 11 passed. Restore leg: blob equal to HEAD, git diff HEAD empty, git status --porcelain empty; rebuilt, preflight --absent (marker absent from all 24 built files, tree clean); -t 38753 15 passed.
Suites and typecheck on 4fecd59 (local, under the verify lock)
  • @objectstack/metadata-protocol, full suite: 381 files passed / 9 skipped; 23940 tests passed / 45 skipped.
  • pnpm turbo run typecheck --filter=@objectstack/metadata-protocol --filter=@objectstack/rest: 33 of 33 tasks passed (rest's test layer compiles under check:test-typecheck, 0 errors).
  • @objectstack/rest full suite and test:repo: not run locally; CI's Test Core shards are the evidence.
Gates on 4fecd59
  • dispatch-gates --commands derived 72 families; all 72 run locally with exit codes; --ran reconciliation: 69 run, 3 NOT MEASURED (check:dual-build-cjs-loads exits 3, it needs every package's dist/; check-comment-mask-corpus.mjs and check:query-options-erasure did not finish inside a 240 s per-gate cap). 68 of the 69 run exit 0.
  • pnpm check:closed-ceremony-text exits 1, and will be red in Lint & Repo Gates: see the acceptance notes.
  • overlap-check: clean against origin/main 444dce6, 0 open PR heads sharing a file.

Acceptance notes

  • protocol-enabled-holders.ts's module docblock and soleEnabledRowHolder's own docblock still describe its callers as "the bare delete and draft discard"; the draft save is now a third caller. That file is read-only on this claim's surface, so the wording is left; noted, not filed.
  • check:closed-ceremony-text goes red on this PR for a reason outside its diff. trackedFiles() in scripts/check-closed-ceremony-text.mjs reads git ls-files -z -- packages content/docs .changeset through execFileSync with Node's default 1 MiB maxBuffer (1,048,576 bytes). That output is 1,048,565 bytes on origin/main 444dce6 and 1,048,601 bytes on this head; adding .changeset/38753-draft-save-cell.md (36 bytes with its NUL) crosses the limit, and the gate dies with spawnSync git ENOBUFS in both its self-test and its sweep. Any PR that adds a tracked file under those roots now trips it. The script is outside this claim's file surface, so it is not edited here; reported for filing as a reproducible defect.

Verification

Run pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-disabled-package-doors.test.ts -t 38753 after building @objectstack/metadata-protocol: 15 pass, including the four "the bare draft save writes E's draft" cells.

Riskiest hunks: packages/metadata-protocol/src/protocol-save.ts (the new re-address block in saveMetaItem, and that followedBase now also carries the sole enabled holder into the named-base rule and the late override re-judgment).


Generated by Claude Code

…and the one enabled shipper (red)

The draft save naming no package, where the item's rows are bound to a
disabled package D and to E, the only enabled shipper, answers as without
D: it writes E's draft and leaves D's rows byte-unchanged. Red on main:
409 RESOURCE_CONFLICT naming D and E. The CONTROL with a second enabled
shipper now also pins the draft save's refusal naming the two enabled
shippers, never D.

Claude-Session: https://claude.ai/code/session_01WGufzhKEbEnW8pwZRgK2gJ
Co-authored-by: Claude <noreply@anthropic.com>
…older beside a disabled package's rows

Where a draft save naming no package finds its draft address ambiguous
because the rows are bound to a disabled package and to the one enabled
holder the read naming no package counts, it now writes that holder's
draft (soleEnabledRowHolder), followed as the row-held base is, instead of
refusing 409 naming the disabled package. The packagelessHolderRefusal
docblock's known-gap paragraph is reworded: the delete, the draft discard
and now the draft save all act at that holder first.

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

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 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 71 of 254 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 c748e7dfd647ca9b4e679d59425f358c9ff84b04 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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-02T04:36Z · Lint · repo & tooling gates is red at 4fecd593 on pnpm check:closed-ceremony-text: spawnSync git ENOBUFS at scripts/check-closed-ceremony-text.mjs:82 (trackedFiles, in --self-test). Not this PR's: the tracked-file listing under packages, content/docs and .changeset passes Node's 1 MiB default buffer once any PR adds a path there (this one adds its changeset). Fleet-wide, fix in flight as #39025 / PR #39027. Held: origin/main is merged in after #39027 lands, then CI re-runs. No re-arm before that.

…aft-save-cell

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

Copy link
Copy Markdown
Contributor Author

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

Final green head · 2026-12-02T05:21Z · zone osa-data
Head-sha: dc847f2

  • CI at this head: 39 success, 18 skipped, 0 failure (origin/main merged in after fix(scripts): tree-scaled git listings in two gate scripts read past the 1 MiB default buffer #39027). Diff: 3 files, +76 / −9 (85 lines ≤ 3000). Not governed. Fixes #38753 (the last cell; PR 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 the rest). Surface as amended (7334011948): protocol-save.ts only, plus test and changeset.
  • What: the bare draft save naming no package, with rows held by a disabled D and the only enabled shipper E, now re-addresses to E (soleEnabledRowHolder) before disabledRowHoldersRefusal, as the merged delete and discard do; the packagelessHolderRefusal docblock's "Known gap" paragraph is reworded.
  • Readings (dev report 7334958777): red first on 742b2442 (4 cells, each 409 naming app.disabled_demo); green 15 / 15 -t 38753; second-enabled-shipper control extended to the draft save (409 naming the two enabled shippers, never D, nothing written); ablation turns exactly the 4 cells red; metadata-protocol full suite 381 files / 23940 tests; typecheck 33/33. 72 derived gates: 69 run, 3 NOT MEASURED (CI ran them).
  • Noted, not filed: protocol-enabled-holders.ts docblocks still name two callers; the draft save is a third (file read-only on this claim).
  • Sent to osa-L1-a for L1.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

L1 review · PR #39035 (#38753) · head dc847f2 · 2026-12-02T05:24Z

ACCEPT, on head dc847f232e7004094d1b83b4c5b90faf22179def.

  • Face. Fixes #38753 is right: this is the card's last cell, and PR 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 delivered the rest. Checks are 39 success, 18 expected skips, 0 failed, 0 pending, and mergeable_state is clean. Not governed, +76/−9. Clause-②: no and Metadata-protocol: none hold, because a refused save now writes at the address the read already serves, and no key or export moves. The changeset is a patch on metadata-protocol.
  • Changeset flag. The flag on @objectstack/rest is one test file (meta-disabled-package-doors.test.ts). files[] is dist, so nothing ships and no entry is owed.
  • protocol-save.ts. For an ambiguous draft address, the new step runs after the row-held base (packagelessRowHeldBaseAddress) and before disabledRowHoldersRefusal. It re-addresses to soleEnabledRowHolder and sets followedBase, so the named-base rule and the late override re-judgment below judge that package exactly as a save naming it. That is the same order the merged delete and discard use (protocol-diff-delete-load.ts: row-held base ?? soleEnabledRowHolder). With two or more enabled holders, soleEnabledRowHolder answers undefined, so the refusal naming only the enabled ones stands. The control cell keeps that pinned.
  • Docblock. The Known-gap paragraph is reworded to the new behaviour and names the draft discard with the delete. It is true to the tree.
  • Changeset, read sentence by sentence. True: before is 409 RESOURCE_CONFLICT naming both, after is the enabled holder's draft, the disabled rows are untouched, and two or more enabled holders are still refused.

Next: zone landing. The merge closes #38753.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

2026-12-02T05:25Z · Landing: L1 ACCEPT on head dc847f2 (7335910466; no must-fix, no should-fix). Not governed, 85 lines ≤ 3000, no L2 owed, CI 39 success / 0 failure, mergeable clean. Ready for review and auto-merge (squash). Fixes #38753: the merge closes the card (its last cell; PR #38948 delivered the rest).

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

Projects

None yet

2 participants