Repository navigation
fix(mcp): slim the open door's tools/list; the served SKILL.md carries the teaching and names validate_expression's variables - #35682
Conversation
…e served SKILL.md tools/list for an API key on a self-hosted app (17 tools) drops from 46,827 to 35,614 bytes; the descriptions this package owns drop from 17,602 to 8,162. Each description keeps what a call needs: the arguments, the confirmation a destructive call takes, and the refusal it may answer. Worked examples, answer-reading guidance and edge cases move to the SKILL.md /api/v1/mcp/skill serves, and to its Console mirror byte for byte. No tool is removed or renamed; no schema shape, required list or enum changes. A new measurement test prints the per-tool table and holds the total under a ceiling. Two pins move with the text: the My Pending filter example is now pinned on the served skill, and the flow-failure read order is pinned on the answer only, the descriptions pointing at its second block. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
…input The served skill and its Console mirror now list `variables?` in validate_expression's signature, and say that at a flow_condition the shadowed-read warning, and the binding of a bare name to the variable rather than the field, need it. The tool accepts it only there. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
The served skill's tool list is pinned by the Console's mirror test to the tools every caller is served; aggregate_records registers only where the host carries an aggregate member. Its moved text now sits under the query_records entry, worded for where it is offered. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
📓 Docs Drift CheckThis PR changes 1 package(s): 32 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 67adea88378c0285e323cabab012bd9542b6af85 && git checkout 67adea88378c0285e323cabab012bd9542b6af85
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ca4ec2a2f1b10ca1bde4af7acd56bc69d2c75f40 be505439137a685ce0d40b391b8f813be58b10ef && git checkout -B drift-repro ca4ec2a2f1b10ca1bde4af7acd56bc69d2c75f40 && git merge --no-ff be505439137a685ce0d40b391b8f813be58b10ef
node scripts/docs-audit/affected-docs.mjs --json ca4ec2a2f1b10ca1bde4af7acd56bc69d2c75f40
|
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head: |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1H9ixhgepGZ7fawhL L1 verdict (L1-a): CHANGES at head Gates on this head: 55 check-runs: 45 success, 10 skipped, 0 failed, 0 pending. Must-fix:
What I checked (holds):
Notes (non-blocking):
Next: fix 1 is a body edit. Fix 2 moves the head. I do a delta review on the new final green head. Generated by Claude Code |
…nfirmation refusal The slimmed description said a refusal ACTION_CONFIRMATION_REQUIRED means nothing ran, but dropped what to do about it: a decline, cancel, timeout or missing confirmation service now says do not retry unless the user asks. "Never runs on this call" beside "accept runs it once" read as a mixed signal; the action now runs only once the person approves it. The weight test's stub bridge gains createUploadLinkForNewRecord, which the runtime bridge serves, so the measured surface carries create_upload_link's new-record text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head: |
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): ACCEPT (delta) at head Delta Must-fix items are resolved:
Also in the delta:
Gates on this head: 59 check-runs: 47 success, 12 skipped, 0 failed, 0 pending. Note (non-blocking): the base told a client that on Not governed (no Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44677633825 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…kup and the approvals-waiting filter The slimmed description dropped the two lines the dogfood suites pin (ruling B colleague lookup; the pending-for-me approvals filter). Each comes back as one short sentence; the full guidance stays in SKILL.md. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head: |
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): ACCEPT (delta) at head Delta
Gates on this head: 59 check-runs: 47 success, 12 skipped, 0 failed, 0 pending. Note (non-blocking, L1 lesson): the review at Not governed. The seat re-enqueues it. Generated by Claude Code |
…the no_confirmation_service next step (objectstack-ai#37355) Fixes objectstack-ai#35778 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:连接开放 MCP 入口的 AI 客户端,初始化时会被告知使用指南在哪里下载;执行需人工确认的业务动作被拒时,工具说明会告诉它由人在应用里完成。 - 为什么做:上一轮把教学文字从工具说明挪进了使用指南,不读指南的客户端失去了指引,这里补回两句提示(属于"让自带 AI 的客户端在开放入口拿到受治理答案"这条主线)。 - 出错会怎样:只是给 AI 读的提示文字,说错了 AI 可能找错地址或多问一句,不会改数据;可直接撤回。 - 要你做什么:无。 ## What changes Items 1 and 2 of objectstack-ai#35778. **Item 3 (optional slimming of list_datasets / query_dataset, the spec `QueryDatasetInputSchema` and the validate_expression variable descriptions) is not taken**: the card marks it optional and measure-first, and it stays open on the card. 1. `packages/mcp/src/mcp-server-runtime.ts`: the open door's default `initialize` text (`DEFAULT_HTTP_INSTRUCTIONS`) gains one sentence: `Usage guide (SKILL.md): GET this endpoint's path plus /skill (by default /api/v1/mcp/skill).` - Where it is true: the runtime dispatcher mounts `GET PREFIX/mcp/skill` beside `PREFIX/mcp` from the same domain list (`packages/runtime/src/domains/mcp.ts` `createMcpDomains`, mounted in `dispatcher-plugin.ts` with the same `prefix`, default `/api/v1`), behind the same `isMcpServerEnabled()` switch, answered by the same `mcp` service (`renderSkill`), and anonymous, so it holds for every grant. `handleHttpRequest`'s only caller in this repo is that domain. The sentence is relative to the endpoint because the prefix is configurable. - Where it is not added: a host's per-request texts and a configured `instructions` stay whole (existing pins), and the stdio default names no URL, since a stdio server has no HTTP endpoint. 2. `packages/mcp/src/mcp-http-tools.ts`: `run_action`'s description gains one clause after the ACTION_CONFIRMATION_REQUIRED sentence: `On details.reason "no_confirmation_service" a person performs it in the app: do not make the same change with another tool.` - It restores the pre-objectstack-ai#35682 in-app hint, and adds the "not through another tool" half the qa record on objectstack-ai#34325 (6966146204) asks the refusal wording to carry. It is door-neutral: true on stdio and on Streamable HTTP. It does not anticipate objectstack-ai#34325's stdio-only sentence (use a client that supports confirmation), which belongs to the refusal text on that card, and stays consistent with ruling 6909391261 (HTTP keeps the hand-off path; cancel/timeout refused). Byte deltas: - tools/list on the API-key surface (`tools-list-weight-34689.test.ts`): 36,613 to 36,739 bytes (+126); `run_action` description 1,228 to 1,352 (+124). The ceiling of 38,000 is unchanged and still holds. - Default `initialize` text: +93 bytes (a bare bridge answers 533 characters). The 4,096-character bound pin on the longest default text still passes. ## Tests - New top-level describes in the existing harness files: - `initialize-selection-rule-34686.test.ts`: the pointer is in the first paragraph for five grants (no scope, data:read, data:write, metadata:write with an authoring injection, data:read with one). - `mcp-action-confirmation-handoff-33690.test.ts`: `run_action`'s tools/list description carries the clause. - Ablations, one-off, via `scripts/ablation-replace.mjs` (anchor hit 1 to 0, restored blob equal to HEAD, `git diff HEAD` empty). The tests import the source, so no dist rebuild sits in the path: - pointer removed: the new initialize pin fails (1 failed, 14 passed); - clause removed: the new run_action pin fails (1 failed, 28 passed). ## Acceptance notes - Not verified: a cloud host that calls `handleHttpRequest` from its own code and mounts the MCP endpoint without the runtime dispatcher. Such a host gets this default only when it injects no instructions of its own. If it serves no sibling `/skill` path, the sentence would not hold there; nothing in this repo is such a caller. ## Verification Two-minute check: `pnpm --filter @objectstack/mcp exec vitest run src/initialize-selection-rule-34686.test.ts src/mcp-action-confirmation-handoff-33690.test.ts src/tools-list-weight-34689.test.ts`. Expect 3 files passing, and a tools/list table line `| run_action | 1352 | 884 | 2236 |`. Readings at e3c3ac4: <details><summary>mcp build, typecheck, vitest (under os-verify-lock)</summary> - `@objectstack/mcp...` build: VERDICT command-exit 0. - `pnpm --filter @objectstack/mcp typecheck`, then the full `vitest run --maxWorkers=2`: VERDICT command-exit 0. Test Files 85 passed (85), Tests 1509 passed (1509). check:test-typecheck OK. </details> <details><summary>derived gate families</summary> - `dispatch-gates --commands --repo objectstack-ai/objectstack`: 68 families. - Results: 67 exit 0. `check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT MET: no whole-repo dist), so it is NOT MEASURED locally and left to CI. - `--ran` with exit codes: 68 derived, 67 run, 1 NOT-MEASURED, 0 UNRUN. - `overlap-check`: clean against origin/main. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Part of #34689
Fixes #33272
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
#34689: the open door's
tools/listis slimmed. Measured on this branch's base (c0716ed4) by the newpackages/mcp/src/tools-list-weight-34689.test.ts: the API-key surface of a self-hosted app (17 tools, the dataset descriptions being the real service-analytics definitions) through a realtools/listround-trip.c0716ed4)be505439)tools/listresponsepackages/mcpownsPer tool, bytes (description / input schema):
Round 3 (merge-queue regression, build 44677814137): query_records keeps two short lines the dogfood pins (ruling B) read — the
sys_usercolleague lookup and thesys_approval_requestpending-approver filter (+237 B;packages/qa/dogfoodcolleague-lookup and approval-read files pass 20/20 locally, unedited). Round 2 (L1 note 3): the weight test's stub bridge now servescreateUploadLinkForNewRecordlike the runtime bridge, so both columns were re-measured with it (round 1 read 46,827 → 35,614 without it); run_action regained "nothing ran; do not retry unless the user asks" (+90 B). The card read 40,341 bytes ona0326b06; the surface grew to 47,712 before this branch, so the before column is re-measured, not copied.Each description keeps what a call needs without the skill: its arguments, the confirmation a destructive call takes, the refusal it may answer and what to do then. What moved to the served SKILL.md (
packages/mcp/src/skill-md.ts, rendered at/api/v1/mcp/skill, and its Console mirror byte for byte):describe_object: the readonly / defaultValue / validation-message facts.query_records: thelatestPerandexpandworked examples, whatsourcenames, and the approvals-waiting-on-you filter (a new Conventions bullet). The person-field lookup was already there.aggregate_records: select-order, currency naming and the lookup-label rule, under thequery_recordsentry (it registers only where the host carries an aggregate member; the Console's tool-list pin holds the bullet list to every caller's tools).get_record: therelatedexample.run_action: theFLOW_FAILEDrelay (the answer's second text block already carries the reason, chosen in the console's read order).create_upload_link: the read-only,readonlyWhenand approval-lock cases (in the conditional file-tool lines).validate_expression: its description now names the facts to pass per site and points at the skill, which already listed every check by site; it gains the date-equality warning.The rest was cut outright where the answer already says it (the withheld-fields note, the recycle-bin restore route, which the skill keeps).
Tombstones, decided per tool.
aggregate_recordsaggregations[].distinct(its description 1,098 bytes): rides intools/list. It is the spec's ownAggregationNodeSchema, taken whole on purpose (the code forbids a local copy of the entry), and its description is the same string the refusal prints. Taking it out oftools/listalone needs a rewrite layer over the SDK's schema output, a new mechanism; shortening it changes the refusal's wording. Both are out of this card.run_action/resume_runretiredconfirm: refusal alone, unchanged: the member is already absent fromtools/listand refused with its prescription.No other tombstone is in
tools/list.#33272: the skill names
variables. The served SKILL.md and its Console mirror listvariables?invalidate_expression's signature, and say that at aflow_conditionthe shadowed-read warning, and the binding of a bare name to the variable rather than the field, need it. Checked against the merged contract (PR #33255): the handler refusesvariablesat any other site.Pins moved (old answer, then new answer, and the card behind it):
mcp-system-object-ai-read.test.ts([Decision] Should an approver be able to see and decide their pending approvals over MCP? #32442):query_records' description carried the My Pending filter, now the served skill carries it (mcp: slim the open door's tool list (40 KB at tools/list; validate_expression alone is 7.8 KB) #34689 moves worked examples to the skill).mcp-action-refusal-details.test.ts(MCP run_action: a business refusal inside the action's flow comes back as the engine chain ("Flow '…' failed: Node '…' failed: update_record(…) failed: 电子发票 is required"), while the console shows 「电子发票不能为空」 #32757):run_action's description taught the read orderdetails.errorMessage, thenuserMessage, thendetails.innerRefusal.message; now both descriptions point at the second text block, and the read order stays pinned on the answer in the same file (mcp: slim the open door's tool list (40 KB at tools/list; validate_expression alone is 7.8 KB) #34689).Every other description pin holds as it was, including the delete approval rule in both the description and the
confirmmember, the #34877 author's-or-platform's description sentence, the ranking andtotalGroupssentences, and the file-tool new-record wording.Tests
packages/mcp: vitest, typecheck
pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2on73c5d9bc:Test Files 80 passed (80),Tests 1440 passed (1440).pnpm --filter @objectstack/mcp typecheck(through the verify lock):VERDICT command-exit 0;check:test-typecheck: OK.ui/:pnpm exec vitest run apps/console/src/pages/developer/objectstack-skill.test.ts:Tests 13 passed (13)(the mirror equals the canonical render).Verification
Two-minute check:
pnpm --filter @objectstack/mcp exec vitest run src/tools-list-weight-34689.test.tsprints the table above and asserts the total stays under 38,000 bytes.Read first, by risk:
packages/mcp/src/mcp-http-tools.ts(therun_actionandvalidate_expressiondescription hunks);packages/mcp/src/skill-md.ts(the moved text); the two moved pins.Local derived gates
node scripts/pm/dispatch-gates.mjs --commandson73c5d9bcderived 71 families; all 71 run, exit codes captured before any pipe;--ranreconciliation:71 derived famil(ies) accounted for — 69 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).node scripts/check-plugin-teardown-shape.mjs --self-testexit 3 (its positive control is pinned to a commit this shallow checkout cannot reach);pnpm check:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET: about 48 packages have nodist/in this worktree).pnpm --dir ui exec vitest run scripts/exit 1:Test Files 2 failed | 169 passed, both failuresFailed to resolve entry for package "@objectstack/client"(not built here). The diff touches noui/scripts/input.CI runs all three.
Acceptance notes
list_datasets/query_datasetdescriptions (2,979 bytes) are the service-analytics definitions;query_dataset's 4,591-byte schema is the spec'sQueryDatasetInputSchema;validate_expression'svariablesitems carry the spec'sFlowVariableSchemadescriptions (1,838 bytes, one of them a 1,000-byte paragraph on record-reference inputs). They are the largest remaining blocks.aggregate_recordsskill text from its own bullet to underquery_recordsafter the Console's tool-list pin went red on it.Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
🤖 Generated with Claude Code