Repository navigation
fix(mcp): delete_record treats a request naming one matching record as the approval - #34453
Conversation
…the approval The delete_record tool description and its confirm member now say that a request in which the human names the record, with exactly one record matching, is the human's approval of that delete, so the agent sends confirm: true on that call; a name matching several records, or a request naming none, is listed and asked first. The gate is unchanged, and delete_records (bulk) keeps its preview-first rule. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 12 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 5cfc18e74fda42094a6c2f57859c924b96715dab && git checkout 5cfc18e74fda42094a6c2f57859c924b96715dab
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a7403bae14c7db5f21ad4a214198616aecf15f2 51462546a25ddeffb7577e1991b4d26edae88b44 && git checkout -B drift-repro 6a7403bae14c7db5f21ad4a214198616aecf15f2 && git merge --no-ff 51462546a25ddeffb7577e1991b4d26edae88b44
node scripts/docs-audit/affected-docs.mjs --json 6a7403bae14c7db5f21ad4a214198616aecf15f2 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw Final head · PR #34453 · Fixes #34340 · area o1-A · head dc4f0a0 · 2026-11-16T20:13Z Head
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · REWORK (L1, first read) · Head-sha: dc4f0a0 · 2026-11-16T20:15ZL1 thread L1-a for area o1-A, reading the final head named in 6927980065 against the dev report 6927898657 and card #34340 (p1, the maintainer's ruling 「点名单条就算确认」 quoted on the card). The diff has 3 files, +92/−4. What holds
Must fix
Should (this round, or on #34456 if the seat prefers)
Note (not blocking)
Checks and landing
|
…cord rule too The skill served at GET /api/v1/mcp/skill interpolates the two delete_record rule sentences (now module-level exports of mcp-http-tools.ts) instead of "Ask your human first"; the Console's byte-identical copy follows. The destructive-action gotcha and the workflow step say a delete the user named, with exactly one record matching, is already confirmed. The delete_record refusal says when to retry with confirm: true and when to ask first; its code, status and details are unchanged. connect-mcp.mdx states the same rule and the recycle-bin fact instead of "permanent". Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw Final head · PR #34453 · Fixes #34340 · area o1-A · head 5146254 · 2026-11-16T21:31Z Head
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, delta) · Head-sha: 5146254 · 2026-11-16T21:32ZL1 thread L1-a for area o1-A, reading the delta from my REWORK 6928040857 at
Note (not blocking)
Landing: not Tier H, and no L2 owed. The |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw Landing · PR #34453 · Fixes #34340 · head 5146254 · 2026-11-16T21:33Z
State change: ready, and auto-merge armed. If the queue build goes red, area o1-A dequeues and treats it as this PR's own fault. #34340 closes on merge through |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43961669170 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw Re-queue · PR #34453 · Fixes #34340 · head 5146254 · 2026-11-16T21:57Z The queue build 43961669170 went red on one test,
The area re-queues this PR once on the same head. If the next build turns red on the same signature without #34429 in the stack, the area dequeues and treats it as this PR's own fault. |
Fixes #34340
Clause-②: no
Metadata-protocol: none
Skills-docs: follow-up #34456 — skills/objectstack-ai/SKILL.md (the delete_record row of the MCP tools table still says "ask the human first, then retry")
维护者速读
delete_record的工具说明、confirm参数说明、同一服务器下发的技能文本(GET /api/v1/mcp/skill,及控制台"下载技能"的逐字副本)、拒绝提示和connect-mcp文档现在说同一条规则:用户点名要删的记录且恰好匹配一条,这句请求就是确认,agent 直接带confirm: true删(业务记录进回收站);名字匹配多条、没指明哪一条或是批量删除,先问用户。confirm: true仍被拒,428ACTION_CONFIRMATION_REQUIRED,details不变),批量delete_records不变;回滚即 revert 本 PR。packages/mcp/src/mcp-http-tools.ts(两句规则提为模块级导出、recordDeleteConfirmationRefusal新提示);packages/mcp/src/skill-md.ts(delete_record条目插值两句、两处"确认"限定);packages/mcp/src/mcp-delete-record-confirmation.test.ts(技能文本与拒绝提示两处钉子)。pnpm --filter @objectstack/mcp exec vitest run src/mcp-delete-record-confirmation.test.ts,预期 12 个用例全绿。What changes
The
delete_recordrule is two sentences, now module-level exports ofpackages/mcp/src/mcp-http-tools.ts(DELETE_NAMED_RECORD_IS_APPROVAL,DELETE_AMBIGUOUS_ASKS_FIRST; not re-exported from the package index, so the public surface is unchanged):Every text the MCP server gives an agent about
delete_recordnow says that rule:confirmmember carry both sentences (unchanged from r0, now read from the exports). The description drops "ask the human first, then retry" and keeps the gate sentence, the recycle-bin fact and therecycleBinEntryIdsentence.packages/mcp/src/skill-md.ts,GET /api/v1/mcp/skill): thedelete_recordentry interpolates the two exports in place of "Ask your human first; the flag asserts an approval, it does not obtain one." The destructive-action gotcha now reads "Confirm destructive actions (delete_record, bulk updates) with the user; adelete_recordthe user named, with exactly one record matching, is already confirmed.", and the workflow step reads "confirming destructive steps with the user (a delete the user named, with exactly one record matching, is already confirmed)."ui/apps/console/src/pages/developer/objectstack-skill.ts) is the served skill's byte-identical, import-free copy; the drift pins on both sides (packages/mcp/src/skill-md.test.ts,objectstack-skill.test.ts) hold it equal, so it takes the same text. The changeset adds'@object-ui/console': patchfor it.delete_recordcall (recordDeleteConfirmationRefusal) now says: "Deleting is destructive even where the recycle bin keeps the record. When the human's request named exactly this one record, that request is the approval: retry this call with 'confirm': true on the request. When the name matched more than one record, or the request is a bulk delete, ask the human first, then retry." This is a text change under the maintainer's ruling 「点名单条就算确认」 quoted on MCP delete_record: a user's request that names one record counts as the confirmation; ask only when it is ambiguous #34340 (routed by the seat, claim amendment on the card); no new decision is needed. The code (ACTION_CONFIRMATION_REQUIRED), status (428),detailsand the gate itself are unchanged.content/docs/ai/connect-mcp.mdx, thedelete_recordparagraph) state the same rule, and no longer call the delete "permanent": a deleted business record goes to the recycle bin until the deployment's retention ends (30 days by default); a record of a platform object (sys_,cloud_,ai_), or any record on a deployment with no recycle bin, is deleted permanently, in the wording of the tool's recycle-bin sentence.Unchanged: the gate,
delete_records(bulk, preview first, its refusal and texts), spec, ADRs andskills/**.Tests
packages/mcp/src/mcp-delete-record-confirmation.test.tsis the existing harness for this tool; the pins stay in it:confirmmember; control:delete_recordscarries neither and still says preview.MCPServerRuntime.renderSkill(), whatGET /api/v1/mcp/skillanswers) carries both sentences.code,status,detailsand the engine'sdeletenever called, the message carries the retry-or-ask rule.git grepfor "confirm with the human" / "human in the loop, then retry": the only other hits arerun_action's own runtime refusal and its double in this file, both untouched).Ablations (one-time,
scripts/ablation-replace.mjs, source import with no dist path, each under atraprestore and a HEAD-blob check; no permanent file):skill-md.ts: anchor${DELETE_NAMED_RECORD_IS_APPROVAL}replaced by a marker, anchor 1 -> 0, blob15da3d35bb0e->891e77a46003; the pin file went red (Tests 1 failed | 11 passed (12), "the skill the same server serves ... carries both sentences": expected the skill to contain "A request in which the human names th..."); restored to the HEAD blob15da3d35bb0e,git diff HEADempty.mcp-http-tools.ts: the refusal's "that request is the" clause replaced by the old "confirm with the human in the loop, then" wording plus a marker, anchor 1 -> 0, blob1cc59f6af811->11418cb7abdc; red (Tests 1 failed | 11 passed (12), "refuses a call without the member": expected the message to contain "When the human's request named exact..."); restored to the HEAD blob1cc59f6af811,git diff HEADempty.Acceptance notes
skills/objectstack-ai/SKILL.mdline 202 is not edited here: implementation-card file surfaces excludeskills/**, which gets its owndomain:skillscard (anddispatch-gates --tiermandates a higher model tier for that path). The follow-up is skills/objectstack-ai: delete_record treats a request naming one matching record as the approval (follow-up of #34340) #34456.CHANGELOG.mdentries that quote the old description are release-owned and stay.Verification
All at head
51462546a, worktree off merge base6aeb665f3;git merge-treeagainstorigin/maind5e6b2028clean; none of the 50 other open pull requests touches a file of this diff.Package test and typecheck (under the verify lock)
pnpm --filter '@objectstack/mcp^...' build, VERDICT command-exit 0pnpm --filter @objectstack/mcp test && pnpm --filter @objectstack/mcp typecheck: VERDICT command-exit 0; Test Files 66 passed (66), Tests 1226 passed (1226);tsc --noEmitandcheck:test-typecheckOKDerived gate families (dispatch-gates --commands, reconciled with --ran)
pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET: it reads every package'sdist/); CI runs it in Lint & Repo Gates.pnpm --dir ui exec vitest run scripts/was killed by the shared box's OOM killer on the first pass (SIGKILL, no verdict); rerun alone: Test Files 171 passed | 2 skipped (173), exit 0.check:skill-examplesrefused on the first pass (exit 3, the client SDK had no build); afterpnpm --filter '@objectstack/client-react...' buildit ran green, exit 0.dispatch-gates --ran: "101 derived famil(ies) accounted for — 100 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)."content/docs(check:doc-anchors,check:docs-redirects,check:doc-authoring,check:doc-frontmatter,check:docs-single-h1,check-affected-docs,check-drift-commentand the rest of the derived set) are in that run, all exit 0.CI on 5146254
Generated by Claude Code