Repository navigation
fix(runtime): get_metadata_item without state answers the version a following save takes - #39022
Conversation
…cycle's version Claude-Session: https://claude.ai/code/session_01WGufzivFXq32jQSCUnECPj Co-authored-by: Claude <noreply@anthropic.com>
…'s description; pin it on the real protocol Claude-Session: https://claude.ai/code/session_01WGufzivFXq32jQSCUnECPj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzivFXq32jQSCUnECPj Co-authored-by: Claude <noreply@anthropic.com>
The merge commit 8d6f9b4 was written without the trailer pair; this empty commit carries it, and the tree is unchanged. Claude-Session: https://claude.ai/code/session_01WGufzivFXq32jQSCUnECPj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 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
Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 12e9134fe1fb4463aa794ed1573727eae88c098e && git checkout 12e9134fe1fb4463aa794ed1573727eae88c098e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c748e7dfd647ca9b4e679d59425f358c9ff84b04 070143a23f511df9d37dd101995f5d8fa888b12f && git checkout -B drift-repro c748e7dfd647ca9b4e679d59425f358c9ff84b04 && git merge --no-ff 070143a23f511df9d37dd101995f5d8fa888b12f
node scripts/docs-audit/affected-docs.mjs --json c748e7dfd647ca9b4e679d59425f358c9ff84b04 |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzivFXq32jQSCUnECPj Final green head for L1 · 2026-12-02T03:26Z · zone osa-build
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review · PR #39022 (#38982) · head 4ab29f3 · 2026-12-02T03:28ZACCEPT, on head
Next: zone landing. The merge closes #38982. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzivFXq32jQSCUnECPj Landing · 2026-12-02T03:29Z · zone osa-build
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzivFXq32jQSCUnECPj Dequeued, not this PR's defect · 2026-12-02T03:46Z · zone osa-build
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46803014842 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Picks up the gate fix for the closed-ceremony-text listing buffer (#39025), which the merge queue failed this PR on. Claude-Session: https://claude.ai/code/session_01WGufzivFXq32jQSCUnECPj Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzivFXq32jQSCUnECPj Final green head for L1 delta · 2026-12-02T05:19Z · zone osa-build
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 delta · PR #39022 (#38982) · head 070143a · 2026-12-02T05:20ZACCEPT, on head
Next: re-arm. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzivFXq32jQSCUnECPj Re-arm (once) · 2026-12-02T05:20Z · zone osa-build
|
Requested by Yibo Wang · project thread
Fixes #38982
Clause-②: no (the tool answer gains the
versionit already carries on a read withstate; no input parameter added, no package export moved)Metadata-protocol: none
维护者速读
What changes
get_metadata_itemread withoutstateserves the pending draft where one exists and the published item otherwise, through the protocol'spreviewDraftsread, which answers noversionon purpose (no single lifecycle's token describes it; it is the render path). The door therefore answered no token, and an agent that saved after such a read guessedifMatchand was refused.The door now reads each lifecycle's token by the strict read a
stateread makes (state: 'draft'first; onNO_DRAFT, the plain read), BEFORE the served read, and answers the token of the lifecycle the served item came from: the draft's when the answer saysdraft: true, the published item's otherwise. A read withstateis unchanged, and so is the protocol (packages/metadata-protocol/**untouched; thepreviewDraftsread keeps omittingversion).Why before and not after: a change landing between the token read and the served read leaves the token OLDER than what was served, and a save pinned to it is refused (409, naming the current version). Read after, the token could be NEWER than what was served and would pin a save to content the caller never saw. A draft published, discarded or first saved in between leaves no token of the served lifecycle, and the answer carries no
versionthen (PM mechanism assumption 3: no version rather than a wrong one).The tool description's sentence "a read without
stateanswers none" now says what the answer carries, and thatversion: nullmeans save withoutifMatch(the save refusesifMatch: nullwithVALIDATION_ERROR; a read withstate: 'active'of an item with no stored row already answerednull). Seat rulings D1 to D4 and ruling 5856774816 quoted in the file are untouched.Read first, by risk:
packages/runtime/src/domains/mcp-authoring.ts, theget_metadata_itembranch: the token reads ahead of thepreviewDraftsread, and theversionselection after the gate.packages/runtime/src/domains/mcp-authoring-38982-read-version.test.ts, the seconddescribe(a writer landing between the token reads and the served read).packages/runtime/src/domains/mcp-authoring.test.ts, the one pin whose recorded protocol calls gain the leadingstate: 'draft'read.Tests
New file, real metadata protocol over a SQLite file; every token is one a read answered and every save is the protocol's own judgement, no token built by hand:
state: 'active'read's; a save pinned to it is written;state: 'draft'read's and different from the published one; the published version is refused409 METADATA_CONFLICT(the card's case) and the answered one is written;version;version.Runs at head 8d6f9b4 (the merge of origin/main; 4ab29f3 after it is an empty trailer-carrying commit, same tree)
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2over the four files that import the authoring registry plussrc/domains/mcp*:Test Files 15 passed (15),Tests 451 passed (451), lock verdictcommand-exit 0.pnpm --filter @objectstack/runtime typecheck: exit 0,check:test-typecheck: OK — @objectstack/runtime's test layer compiles under packages/runtime/tsconfig.test.json.@objectstack/runtimesuite did not finish inside the container's foreground cap: NOT MEASURED locally, left to CI'sTest Core.Ablations (on-disk mutation through scripts/ablation-replace.mjs, restored to the HEAD blob, git diff HEAD empty after each)
version(the old behaviour): 4 of 6 new cases red (the three version cases and the re-saved-draft race); the two no-version race cases stay green, as they should.servedTokens.draft ?? servedTokens.active): the two no-version race cases red, the other four green.Acceptance notes
statestill makes one.servedOverride), the strict draft read does not. Where both an override draft and another draft of the name exist, the token answered is the one astate: 'draft'read answers, which may describe a different row from the one served. That is the existingstate: 'draft'read's address, unchanged here.describe(ruling record 6583487846). The dispatch's file surface names a new file and limitsmcp-authoring.test.tsto pins reading a changed node, so the new pins are in their own file; raised in the report.skills/**, outside this card's surface.Verification
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring-38982-read-version.test.ts(after building the runtime package's dependencies) printsTests 6 passed (6).Generated by Claude Code