Repository navigation
feat(mcp): list_objects and describe_object return the authored object and field description - #34814
Conversation
…t and field description Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir
…or an unreadable field Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir
… pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 37 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 47b9262eb7bf405ab094dbcfe906aae9e29318a6 && git checkout 47b9262eb7bf405ab094dbcfe906aae9e29318a6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3bbda33b78fff2681db9c09732347bc62ffc4cc6 5619e007c7ad77f20c5fd1851bd694ca6afcd709 && git checkout -B drift-repro 3bbda33b78fff2681db9c09732347bc62ffc4cc6 && git merge --no-ff 5619e007c7ad77f20c5fd1851bd694ca6afcd709
node scripts/docs-audit/affected-docs.mjs --json 3bbda33b78fff2681db9c09732347bc62ffc4cc6
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT · 2026-11-17T11:40ZHead-sha: fbc4d13 席位核对PR shape. Draft, base Scope vs claim. Seven files, all inside the restated claim's surface: Declaration. Governed / changeset. Check-runs at fbc4d13. 53 runs, every one Code read. One rule, applied in four places (object and field in each twin Tests. Two new suites, four cases each (HTTP bridge from the real Docs made false? Area call (system columns keep their description). Inside the card ("return the object's and the field's existing description … with the byte cost stated"); the cost is stated ( Must-fixNone. Should-fixNone. Notes
Next: seat L2 at TIER_DEFAULT for the |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: ① Derived judgmentsNet diff
should-fix: the changeset (ships as CHANGELOG) and PR body say the caller gets "the same text the nit: "(where the author wrote one)" in both tool descriptions. On app-crm every served field description comes from a platform-injected column. ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
…o locale /meta translates object and field labels and descriptions per request locale; the MCP object tools serve the authored source-locale text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir
|
repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir Landing · area o3-F · 2026-11-17T12:10Z
State change: ready for review + auto-merge (merge queue). Card #34721 closes on merge via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44080802901 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir Re-queue · area o3-F · 2026-11-17T12:50Z · head |
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir
Fixes #34721
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
list_objects与describe_object现在把作者写在对象和字段上的description一并返回(只在写了时出现),HTTP 与 stdio 两条通道同形。describe_object每个对象约 +1.1 KB,其中约 1.0 KB 来自平台注入的 8 个系统列的说明。回滚即 revert 本 PR。packages/runtime/src/domains/mcp.ts(HTTP 通道的describeServedObject与listObjectSummaries)、packages/mcp/src/mcp-server-runtime.ts(stdio 孪生与authoredDescription)、packages/mcp/src/mcp-http-tools.ts(两条工具描述)。pnpm --filter @objectstack/runtime exec vitest run src/domains/mcp-object-descriptions-34721.test.ts,预期 4 passed:可读字段带说明,被拒字段及其说明都不出现。What changes
describe_objectaddsdescriptionto the object and to each field, andlist_objectsadds it to each object, when the definition as the caller is served it carries a non-blank string there. Otherwise the key is absent, so an object or field with no description is answered exactly as before. The key is the existingdescriptionofObjectSchemaandFieldSchema; no metadata key is added.packages/runtime/src/domains/mcp.ts,describeServedObjectandlistObjectSummaries) and the stdio bridge (packages/mcp/src/mcp-server-runtime.tsdescribeServedObject,packages/mcp/src/stdio-data-bridge.tslistObjects). Each package carries one helper,authoredDescription, the two named as twins.McpObjectSummary(exported) gains an optionaldescriptionmember.descriptionas prose on the object and on readable fields (packages/metadata-core/src/object-schema-fls-references.ts,description: keep): the same authored text the/metaobject door serves the same caller when the request names no locale. With a request locale/metatranslates object and field labels and descriptions; the MCP object tools do not localize labels or descriptions, and this PR leaves that as it was.Tests
packages/runtime/src/domains/mcp-object-descriptions-34721.test.ts(HTTP bridge, realSecurityPluginon a realObjectQLover SQLite, bridge built by the real/mcpentry): a member denied one field is returned the object description and a readable field's description, and neither the denied field nor its description text; the unrestricted control is returned that field's description; a field with no description or a blank one, and an object with none, carry nodescriptionkey;list_objectsreturns the object description and no key on an object without one.packages/mcp/src/stdio-data-bridge.object-descriptions-34721.test.ts(stdio bridge behind the real tools over an in-memory MCP client, security from the shared ADR-0106 double): the same four cases.scripts/ablation-replace.mjs, which proves the mutation landed and restores to the HEAD blob): deleting the field line...authoredDescription(f),turns 2 of 4 tests red on each transport (the readable-field and control cases); restore read back withgit diff HEADempty. Both suites import the source under test by relative path, so no build sits between the mutation and the run.Acceptance notes
examples/app-crm(admin, HTTP MCP, tool text bytes, before onf02f4f63, after on this branch):list_objects691 to 1193 (+502, all 7 objects carry a description).describe_object:crm_account2738 to 3849,crm_activity3791 to 4935,crm_contact2455 to 3558,crm_lead5351 to 6474,crm_opportunity5310 to 6413, about +1.1 KB each. Of that, about 1.05 KB per object is the descriptions of the 8 platform-injected columns (organization_id,created_at,created_by,updated_at,updated_by,owner_id,owning_business_unit_id,queue), the same text on every object; for examplecrm_accountwould be 2803 without them. No hand-authored app-crm field carries a description today. Whether to serve descriptions onsystem: truefields is left to the seat; this PR follows the ruling (each field's existing description).descriptionas prose); the same fields' text is already served to the same caller by the/metaobject door, so no new exposure.Verification
Live reading on app-crm, before and after
Before (
f02f4f63):list_objectsobjects keyedname, label, fieldCount;describe_object crm_accountfield keysname, type, label, required, readonly, system; zerodescriptionkeys in either. The same caller'sGET /api/v1/meta/object/crm_accountserves the object description and descriptions on 9 fields.After (this branch, rebuilt):
list_objects7 of 7 objects withdescription;describe_object crm_accountobject description present, 8 of 12 fields with one, e.g.{"name":"owner_id","type":"lookup","label":"Owner","description":"Record owner (auto-stamped to the creating user on insert; reassignable). Drives owner-scoped views, reports and notifications.","required":false,"readonly":false,"system":true}.Package tests and typecheck
Run at
c204778e. The final headfbc4d13ddiffers only by one module-top import in the new runtime test; atfbc4d13dthat file andpnpm --filter @objectstack/runtime typecheckwere rerun green.pnpm --filter @objectstack/mcp test: Test Files 67 passed (67), Tests 1230 passed (1230).pnpm --filter @objectstack/runtime test: Test Files 612 passed (612), Tests 11342 passed, 19 skipped (11361).pnpm --filter @objectstack/mcp typecheck,pnpm --filter @objectstack/runtime typecheck: exit 0 (the lock's VERDICT command-exit 0).Derived gate families (dispatch-gates --commands)
Full set run at
c204778e; the reruns named below at the final headfbc4d13d.69 derived, 68 exit 0, 1 NOT MEASURED:
node scripts/check-plugin-teardown-shape.mjs --self-testexit 3, reason: shallow clone, its positive-control commit is unreachable here; CI runs it.pnpm check:test-source-aliasfirst exited 1 on the new runtime test (the dispatcher reach loads@objectstack/metadatalazily); fixed with a module-top import as the sibling suite does, rerun exit 0. After that last commit,check:cross-package-test-inputs,check:nul-bytes,check:undeclared-dep-imports,check:tier-file-adoption,check:issue-citationsrerun, exit 0.dispatch-gates --ran: 69 accounted, 68 run, 1 NOT-MEASURED (derived from the recorded exit 3).Generated by Claude Code