Skip to content

feat(mcp): list_objects and describe_object return the authored object and field description - #34814

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34721-object-descriptions
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34721-object-descriptions

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir

Fixes #34721
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:MCP 的 list_objects 与 describe_object 现在把作者写在对象和字段上的 description 一并返回(只在写了时出现),HTTP 与 stdio 两条通道同形。
  • 为什么改:问数回退到对象工具时,客户端靠读工具返回来挑对象和字段;作者写的说明(如「金额,不含税」)原先拿不到,只能猜。维护者已定不加 synonyms,本卡即其替代。
  • 风险与回滚:只增不减,未写说明的对象/字段输出逐字节不变;按调用者字段权限读取,读不到的字段连同其说明一起不出现。体积:app-crm 上 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_object adds description to the object and to each field, and list_objects adds 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 existing description of ObjectSchema and FieldSchema; no metadata key is added.
  • Both transports answer the same shape: the HTTP bridge (packages/runtime/src/domains/mcp.ts, describeServedObject and listObjectSummaries) and the stdio bridge (packages/mcp/src/mcp-server-runtime.ts describeServedObject, packages/mcp/src/stdio-data-bridge.ts listObjects). Each package carries one helper, authoredDescription, the two named as twins.
  • The two tool descriptions name the key. McpObjectSummary (exported) gains an optional description member.
  • Field-level security: the text is read off the object the caller is served (ADR-0106 D5), so a field the caller cannot read is removed whole, its description with it. The ADR-0106 projection keeps description as prose on the object and on readable fields (packages/metadata-core/src/object-schema-fls-references.ts, description: keep): the same authored text the /meta object door serves the same caller when the request names no locale. With a request locale /meta translates 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, real SecurityPlugin on a real ObjectQL over SQLite, bridge built by the real /mcp entry): 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 no description key; list_objects returns 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.
  • Ablation, once per transport, after committing the fix (via 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 with git diff HEAD empty. Both suites import the source under test by relative path, so no build sits between the mutation and the run.

Acceptance notes

  • Byte cost, measured on examples/app-crm (admin, HTTP MCP, tool text bytes, before on f02f4f63, after on this branch): list_objects 691 to 1193 (+502, all 7 objects carry a description). describe_object: crm_account 2738 to 3849, crm_activity 3791 to 4935, crm_contact 2455 to 3558, crm_lead 5351 to 6474, crm_opportunity 5310 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 example crm_account would be 2803 without them. No hand-authored app-crm field carries a description today. Whether to serve descriptions on system: true fields is left to the seat; this PR follows the ruling (each field's existing description).
  • A readable field's or the object's description is free text the ADR-0106 projection does not scan for denied field names (it treats description as prose); the same fields' text is already served to the same caller by the /meta object door, so no new exposure.
  • The reading is on the card: comment 6945187409.

Verification

Live reading on app-crm, before and after

Before (f02f4f63): list_objects objects keyed name, label, fieldCount; describe_object crm_account field keys name, type, label, required, readonly, system; zero description keys in either. The same caller's GET /api/v1/meta/object/crm_account serves the object description and descriptions on 9 fields.

After (this branch, rebuilt): list_objects 7 of 7 objects with description; describe_object crm_account object 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 head fbc4d13d differs only by one module-top import in the new runtime test; at fbc4d13d that file and pnpm --filter @objectstack/runtime typecheck were 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).
  • New runtime test file rerun after the last commit: Tests 4 passed (4).
Derived gate families (dispatch-gates --commands)

Full set run at c204778e; the reruns named below at the final head fbc4d13d.

69 derived, 68 exit 0, 1 NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test exit 3, reason: shallow clone, its positive-control commit is unreachable here; CI runs it. pnpm check:test-source-alias first exited 1 on the new runtime test (the dispatcher reach loads @objectstack/metadata lazily); 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-citations rerun, exit 0. dispatch-gates --ran: 69 accounted, 68 run, 1 NOT-MEASURED (derived from the recorded exit 3).


Generated by Claude Code

@github-actions github-actions Bot added size/m 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 Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/mcp, @objectstack/runtime, touching 6 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/authorization.mdx (via buildMcpBridge (symbol, a top-level function))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 37 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 3bbda33b78fff2681db9c09732347bc62ffc4cc6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 47b9262eb7bf405ab094dbcfe906aae9e29318a6 — the merge of head 5619e007c7ad77f20c5fd1851bd694ca6afcd709 into base 3bbda33b78fff2681db9c09732347bc62ffc4cc6, 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 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3bbda33b78fff2681db9c09732347bc62ffc4cc6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT · 2026-11-17T11:40Z

Head-sha: fbc4d13
Reviewer: seat 3 L1-c, for card #34721 (claim restated 6946526042, reading 6945187409, dev report 6946496562).

席位核对

PR shape. Draft, base main, Fixes #34721. Both "Done when" items are met in this PR: the reading is on the card (6945187409), and the change carries the pin (readable field's description returned, unreadable one withheld). No other issue number next to a closing verb.

Scope vs claim. Seven files, all inside the restated claim's surface: mcp-server-runtime.ts (describeServedObject + helper), stdio-data-bridge.ts and runtime/src/domains/mcp.ts (the projections), mcp-http-tools.ts (McpObjectSummary, two tool descriptions), two new card-named tests, the changeset. authoredDescription is a module export in mcp-server-runtime.ts but not re-exported from packages/mcp/src/index.ts (which takes only MCPServerRuntime and two types from that module), so the only public widening is McpObjectSummary.description.

Declaration. Clause-②: yes (widening) / Metadata-protocol: none in the body, the changeset and the restated claim, which agree. The widening is an optional member on an exported type plus an optional key in two tools' output; no metadata key is added (ObjectSchema.description and FieldSchema.description are existing z.string().optional() keys). That is a published-type widening, not locale keys only, so it goes to the seat's L2 at TIER_DEFAULT before landing (o3-F already said so).

Governed / changeset. check-governed-merges --pr 34814: 0 of 7 paths, NOT governed, 426 lines. @objectstack/mcp and @objectstack/runtime (both published) are the two packages whose src/** moved, both named, at patch (right for Metadata-protocol: none).

Check-runs at fbc4d13. 53 runs, every one success or skipped: Lint & Repo Gates, TypeScript Type Check, Test Core + 10 shards, Check Changeset, PR-body guards, Governed Surface Queue Guard, Live E2E UI.

Code read. One rule, applied in four places (object and field in each twin describeServedObject; object in each listObjects projection): spread { description } only for a non-blank string, so an object or field that authors none keeps its old shape byte for byte. Both twins read off the object as the caller is served it (ADR-0106 D5), so a field the caller cannot read is gone before the helper sees it. object-schema-fls-references.ts lists description: keep on the field block, which is why the /meta door already serves the same text to the same caller (the reading's control). No new exposure.

Tests. Two new suites, four cases each (HTTP bridge from the real /mcp entry over real SecurityPlugin + ObjectQL + SQLite; stdio bridge behind the real tools over an in-memory MCP client): readable field's description returned and denied field withheld with its text; an unrestricted CONTROL member gets that same description (so the withheld case is not green by absence); no key when none or blank; list_objects with and without. Ablation on each transport (delete the field-level spread): 2 of 4 red each, restored to the HEAD blob. Package suites and typechecks with real output in the body.

Docs made false? content/docs/ai/connect-mcp.mdx names the two tools as "Discover which objects exist and their fields" and packages/mcp/README.md as "List objects…" / "Object schema: fields + features": still true. The two tool descriptions are updated in the diff. No packages/spec .describe() text speaks to the MCP output.

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 (describe_object about +1.1 KB per app-crm object, about 1.05 KB of it the 8 platform-injected columns; list_objects +502 B).

Must-fix

None.

Should-fix

None.

Notes

Next: seat L2 at TIER_DEFAULT for the Clause-②: yes (widening); o3-F lands after it. A later push owes an L1-c delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Contract review

Served-tier: TIER_DEFAULT
Head-sha: fbc4d13d78789d63384096294333fc338854b6d9
Local-runs: none

① Derived judgments

Net diff f02f4f63..fbc4d13d, 7 files. Public surface: @objectstack/mcp exports only .; McpObjectSummary (re-exported from index.ts) gains optional description?: string. authoredDescription and ServedObjectDef are not on the entry; the runtime helper is module-local. Tool outputs: list_objects and describe_object (object and each field) add description.

  • Additive and optional: yes, a spread after label, no key removed or retyped.
  • Absent when none: yes, non-string or blank yields no key; pinned on both doors ('description' in false, exact toEqual on list).
  • Same on both doors: yes. HTTP listObjectSummaries / describeServedObject and stdio listObjects / shared describeServedObject; listObjectsDiagnosed routes through listObjects on each. Read off the ADR-0106 caller-served object, so a denied field leaves with its text (pinned).
  • Localization: neither door localizes list_objects / describe_object text. The HTTP bridge calls translateMetaList only for datasets; object labels are served source-locale on both doors. Descriptions match label handling exactly, so no door split. ADR-0149 D2 binds list_datasets, not these tools.

should-fix: the changeset (ships as CHANGELOG) and PR body say the caller gets "the same text the /meta object door serves them". That holds only with no request locale: /meta translates objects.NAME.description and the injected-column fallbacks per locale (translateMetadataDocument); MCP does not. Narrow the sentence. File the object-tool localization gap (labels and descriptions) as its own card (Prime Directive 10).

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

Clause-②: yes (widening) and Metadata-protocol: none appear on both the PR body and the changeset. No metadata key is added. Patch on @objectstack/mcp and @objectstack/runtime is correct for none. Check-runs on the head: all completed, every gate-carrying job success, the rest skipped (opt-in or queue lanes). None pending.

③ Boundary flags

  • Open question (descriptions on system: true columns): area ruled A. I concur, since /meta already serves that text and the byte cost (about 1.05 KB per object) is stated.
  • Out-of-scope note (description prose not scanned for denied names): agreed, no new exposure beyond /meta. Noted correctly, not filed.
  • SQL push-down: n/a, a metadata projection with no query, join or id materialisation.

Implemented-by: claude/issue-34721-object-descriptions
Reviewed-by: session_01WGufzgh1zkZzDXL36ckWAG

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir

Landing · area o3-F · 2026-11-17T12:10Z

Probe Reading
L1 ACCEPT 6947004356 at fbc4d13d78789d63384096294333fc338854b6d9; head since moved to 5619e007c7 by a prose-only commit (changeset text only, plus the matching body sentence), the L2 should-fix
L2 (Clause-②: yes (widening), TIER_DEFAULT) PASS 6947074946 at fbc4d13d; its one should-fix (the /meta parity sentence holds only with no request locale) is the prose-only head move above, which keeps both records
Checks on head 5619e007c7 39 success, 18 skipped, 0 failure / pending
check-governed-merges.mjs --pr 34814 NOT governed (0 of 7 paths hit the register); 426 changed lines ≤ 3000
K (first-parent, PRBASE 3bbda33b from Test Core's affected-set base..origin/main) 0 < 15; no merge=os-regen path in the diff

State change: ready for review + auto-merge (merge queue). Card #34721 closes on merge via Fixes.

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44080802901 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {"object":"sys_activity","records":[],"total":0,"hasMore":false}: expected 200 to be 403 // Object.is equality
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 28 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir

Re-queue · area o3-F · 2026-11-17T12:50Z · head 5619e007c7 unchanged; ejected as an inherited bystander behind root #34817, anchor #34829 closed by triage (main green, not a flake), re-queue requested in 6948527357 on #34585. Reviews 6947004356 / 6947074946 and landing probes 6947659549 stand.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reading first: do list_objects and describe_object return the descriptions an author wrote on objects and fields

2 participants