Skip to content

feat(mcp): query_records and get_record name the fields field-level security withheld from the caller - #35179

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35137-withheld-fields
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35137-withheld-fields

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Fixes #35137

Clause-②: yes (widening)
Metadata-protocol: none
Security-touching: yes

The card's two remaining halves have their own carriers: the ask-data skill line is carried by #35191, and the example-app scenario question by #35113. This PR is the framework half, built on the maintainer's ruling A recorded on the card (comment 6977609191): keep the bound.

维护者速读

  • 改了什么:MCP 的 query_records 与 get_record 在调用者有字段被字段级安全挡掉、而该字段又在调用者自己的 schema 里可见时,结果里多带 withheldFields(只给字段名,不给值)和一句固定说明;HTTP 与 stdio 两个入口一致。本轮:「调用者 schema 里有哪些字段」这一半改为直接取 describe_object 返回给该调用者的那份字段列表。
  • 为什么改:之前被挡掉的字段在行里直接消失,AI 客户端把它读成「空」;现在免于 schema 遮罩的调用者(D4)或关了 schema 遮罩的部署会被告知「对你不可见」,默认遮罩下的普通成员则永远不会被点名(该字段对他们不存在),即裁决 A。
  • 风险与回滚:只读、只加结果成员,无人被挡时结果逐字节不变;安全线是「调用者 schema 里看不到的字段永不点名」,由 withheldFieldNames 的求交一行和本轮的同源字段列表共同守住,各有消融证明;回滚即 revert 本 PR。
  • 先看:packages/runtime/src/domains/mcp.ts 的 describeForCaller 与 fieldVisibilityOf;packages/mcp/src/stdio-data-bridge.ts 的 describeForPrincipal 与 fieldVisibilityOf;packages/mcp/src/mcp-http-tools.ts 的 withheldFieldNames(served.has 一行)。
  • 两分钟验证:pnpm --filter @objectstack/mcp exec vitest run src/query-records-withheld-fields.test.ts,预期 12 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

  • McpDataBridge gains an optional member, fieldVisibilityOf(object), answering two framework answers asked as the caller: the field names the caller's own served schema shows, and the security service's readable answer for them (getReadableFields). Both bridges implement it.
  • The served-schema field list now comes from the same projection describe_object serves. Each door's describe_object answer is built by one local function (describeForCaller on the HTTP bridge in packages/runtime/src/domains/mcp.ts, describeForPrincipal on the stdio bridge in packages/mcp/src/stdio-data-bridge.ts), and fieldVisibilityOf reads its field names off that answer (describedFieldNames), so any later filter on what describe_object lists applies to withheldFields too.
  • The shared tool layer (packages/mcp/src/mcp-http-tools.ts) names a field as withheld only when the served schema shows it and the readable answer leaves it out; with fields in the call only asked fields are candidates. When the list is non-empty, the result carries withheldFields and withheldFieldsNote (one constant sentence, WITHHELD_FIELDS_NOTE). When it is empty, nothing is added. A missing member, an undefined answer or a throw adds nothing and never fails the read.
  • Who is told (ruling A): a caller served the whole schema (ADR-0106 D4 exempt) or any caller where object-schema masking is switched off (D8). A plain member under default masking is never told: the field does not exist in their schema.
  • query_records and get_record descriptions gain one sentence about the member.
  • aggregate_records is unchanged: measured on the real security layer, a withheld field asked as a measure or a group is already refused 403 PERMISSION_DENIED (see Verification).
  • No change to what field-level security withholds; no write path touched; no new security-service method (the existing getReadableFields is the caller-scoped answer).

Tests

  • packages/mcp/src/query-records-withheld-fields.test.ts (new): the tool layer over the HTTP runtime, and the stdio bridge behind the real tools. Pins: a withheld field named with the note; a field the served schema does not show never named anywhere in the serialized result, even when asked for in fields; a readable field with an empty value not named; only asked fields named; nothing withheld means no member and a byte-identical answer; a bridge that cannot answer or throws names nothing; the member beside a delegation narrowing. On stdio: a D4-exempt caller is told; a member under default masking whose schema hides the field never sees it named; with masking off (D8) the member is told; no security service means no member; and (round 2) the served list follows describe_object's field names on an object where the two could differ.
  • packages/runtime/src/domains/mcp-object-schema-mask.test.ts, on the real security layer (SecurityPlugin over ObjectQL + SqlDriver): the D4-exempt author's served list equals describe_object's field names and the denied field is withheld; the member under default masking is answered nothing; (round 2) with masking off the member's served list equals describe_object's field names and the denied field is withheld; an unrestricted member is withheld nothing and no security service answers nothing. And (round 2), on the real engine, the pin "served equals describe_object's field names" extended to an object where the two could differ.
  • The two bridge-member classification tripwires register the new member.

Choice stated: a caller with nothing withheld gets no member (not an empty list), so its result is unchanged.

Acceptance notes

  • Ruled persona: the card's done-when is met for a D4-exempt caller or a masking-off deployment, each pinned on both doors above; the plain-member-under-default-masking persona is never told, also pinned on both doors.
  • get_record keeps the two members on the record object, beside its field keys (contract review N2, judged and left): moving them beside the record would mean wrapping it (for example a record key) only when something is withheld, so where the record sits in the answer would change with the caller's field security, a shape split every client would have to branch on. The existing precedent for a notice on these tools (the delegation narrowing) also adds keys on the answer object. No collision is possible: field machine names are snake_case, these members camelCase.
  • The note text lives in one constant (WITHHELD_FIELDS_NOTE, packages/mcp/src/mcp-http-tools.ts) so a shared result-sentence locale picker can adopt it later; this PR adds no picker and does not touch truncated.

Verification

Readings for this round at head ce2f6fefa12: this branch merged with origin/main at 1caee8cbd36 (which includes #35199, query_records latestPer). Earlier rounds' readings (base 55020c331b) are kept below where nothing in this round touched them.

This round: main merged, the stdio control re-pinned
  • Main moved under the branch: query_records now reads a probe row past the page, and on the stdio door a page read with a limit is counted by engine.count. The stdio CONTROL pin's engine fixture has no count, so main serves that page as { object, records, hasMore: false } with no total. The pin at packages/mcp/src/query-records-withheld-fields.test.ts now expects exactly that shape; its point is unchanged: no withheldFields member, no note, and the readable answer asked as the principal.
  • The other pins in that file and in packages/runtime/src/domains/mcp-object-schema-mask.test.ts were checked for the same drift on the merged tree: none (results below).
  • Merge conflict in packages/mcp/src/mcp-http-tools.ts, the query_records description only: both halves kept, the latestPer sentences followed by WITHHELD_FIELDS_DESCRIPTION. The handler auto-merged with both behaviours: the latestPer branch and the probed page both feed withWithheldFields.
Tests (head ce2f6fe)
  • pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 (whole package, under the verify lock): VERDICT command-exit 0, Test Files 74 passed (74), Tests 1315 passed (1315).
  • pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp (all 8 domains/mcp* suites, mcp-object-schema-mask.test.ts among them): VERDICT command-exit 0, Test Files 8 passed (8), Tests 289 passed (289).
  • pnpm --filter @objectstack/mcp --filter @objectstack/runtime run typecheck: VERDICT command-exit 0; both check:test-typecheck: OK.
  • Before the re-pin (first merge, main 9c29d732a19): the withheld-fields file read 1 failed / 11 passed, the failing one being the stdio CONTROL (expected total: 1, received hasMore: false).
Gates (head ce2f6fe)
  • node scripts/pm/dispatch-gates.mjs --commands: 69 families for this diff (merge base 1caee8cbd), run in sequence; 67 exit 0 on the first pass. pnpm check:dts-closure exited 1 on that pass naming packages/runtime and packages/services/service-automation declarations as missing; both were present minutes later (written 14:50) and the re-run exits 0 (81 built packages, 260/260 declaration files present). pnpm check:dual-build-cjs-loads exits 3 (PREREQUISITE NOT MET: it reads every package's built output, only this diff's closure is built): NOT MEASURED locally, run by Lint & Repo Gates on this PR.
  • node scripts/pm/dispatch-gates.mjs --ran: 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN.
  • node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 631 changed lines.
  • node scripts/pm/overlap-check.mjs --branch=HEAD: VERDICT overlap exit 1. origin/main 1caee8cbd3 merges cleanly; feat(mcp): aggregate_records names a lookup group's record beside its id, read as the caller #35202 and feat(mcp): a refused record read says what is not recorded, in the caller's language #35198 merge cleanly; feat(mcp): aggregate_records orders, cuts and counts groups in the database #35193 conflicts in packages/mcp/src/stdio-data-bridge.ts and packages/runtime/src/domains/mcp.ts (it also conflicts with main on two other paths, judged not this branch's). One of the two lands behind the other.
  • PR check-runs on ce2f6fefa12: 37 success, 16 skipped, 0 failed, among them Test Core (1/10 to 10/10), Lint & Repo Gates, TypeScript Type Check and Build Core all success.
Ablation: the served list bypasses describe_object's answer (round 2)
  • HTTP: node scripts/ablation-replace.mjs --file packages/runtime/src/domains/mcp.ts --anchor 'return { served: describedFieldNames(described), readable };' --replacement (the round-1 derivation of the served list) -- pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-object-schema-mask.test.ts: mutation landed (anchor 1 to 0, blob b28efe7b7b33 to d00af3f275cc); 1 failed / 79 passed, the failing one being the extended pin; restored (blob equals HEAD, git diff HEAD empty).
  • stdio: the same anchor in packages/mcp/src/stdio-data-bridge.ts, replaced the same way, -- pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/query-records-withheld-fields.test.ts: mutation landed (blob 949d972f50fe to 978cd2659f10); 1 failed / 11 passed, the failing one being the new stdio pin; restored (blob equals HEAD).
  • Both tests import the source directly, so no build step stands between the mutation and the run.
Ablation: the schema intersection (round 1)

node scripts/ablation-replace.mjs --file packages/mcp/src/mcp-http-tools.ts --anchor ' if (!served.has(name)) continue;' --delete -- pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/query-records-withheld-fields.test.ts: mutation landed; 2 failed / 9 passed, the two failing being the tool-layer and the stdio "never named" pins; restored (blob equals HEAD, git diff HEAD empty).

aggregate_records: measured, already refused (round 1)

One-off probe on the real security layer (SecurityPlugin over ObjectQL + SqlDriver, the HTTP bridge), not committed: a field denied to the caller asked as a sum measure or as a groupBy key answers PERMISSION_DENIED / 403 for both a member and a schema-exempt author; an unrestricted member is served. So aggregate_records gains no member.


Generated by Claude Code

…ecurity withheld from the caller

Only a field the caller's served schema shows is named; both halves are the
framework's own answers, asked as the caller.

Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Co-authored-by: Claude <noreply@anthropic.com>
…ved schema shows the field

Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Co-authored-by: Claude <noreply@anthropic.com>
…te-response tripwires

Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Co-authored-by: Claude <noreply@anthropic.com>
@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 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/mcp, @objectstack/runtime, touching 12 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/mcp/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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 changed file(s) yielded no anchor (packages/mcp/src/index.ts) — pages documenting those are invisible to this run
  • 2 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 1caee8cbd363e06692317cabd3c5746ba0b976be → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 37799ebb962a5853fb7e1f1d188adb5a71dff7be — the merge of head ce2f6fefa12d4fb2a846af796fdf71d03b2b672d into base 1caee8cbd363e06692317cabd3c5746ba0b976be, 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 37799ebb962a5853fb7e1f1d188adb5a71dff7be && git checkout 37799ebb962a5853fb7e1f1d188adb5a71dff7be
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1caee8cbd363e06692317cabd3c5746ba0b976be ce2f6fefa12d4fb2a846af796fdf71d03b2b672d && git checkout -B drift-repro 1caee8cbd363e06692317cabd3c5746ba0b976be && git merge --no-ff ce2f6fefa12d4fb2a846af796fdf71d03b2b672d

node scripts/docs-audit/affected-docs.mjs --json 1caee8cbd363e06692317cabd3c5746ba0b976be

⚠️ 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 1caee8cbd363e06692317cabd3c5746ba0b976be → 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#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Final green head · 2026-11-18T11:26Z: c1bbebce97214da54499af216d3e97d71d39cb84 (dev report 6976419490 on #35137). CI: 37 success, 16 skipped, 0 red. Not governed, +488/-6 over 9 files. Clause-② yes (widening). Security-touching: yes (the card's bound). Part of #35137: the card's done-when persona waits for a maintainer ruling on the bound, and this PR does not land before that ruling is recorded on #35137. Owed: full L1-b and the seat contract review at this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Contract-review-claim: session_01JQwxbWDsbbJizuYnDwBxT8 · head c1bbebce97214da54499af216d3e97d71d39cb84 · 2026-11-18T11:27Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud

席位核对

L1 full · ACCEPT · Head-sha: c1bbebce97214da54499af216d3e97d71d39cb84 · card #35137 (Part of #35137) · read 2026-11-18T11:29Z

Net diff against merge base 55020c331b: 9 files, +488 / -6. Not governed. Security-touching.

Against the card

  • Part of is right.
    • This PR is the framework half: the result member, the note, both doors, the served text and the card's three pins.
    • Under the card's bound and the default object-schema masking, the done-when persona is not reachable. The ask-data skill line and the scenario round are not in this PR either.
    • The bound question is with the maintainer. Merging this PR must leave the card open.
  • The bound is held, and held in one place. A field is named only when the caller's own served schema shows it and the security service's readable answer for that caller leaves it out. Both answers are asked as the caller, and nothing is derived from rows.
    • withheldFieldNames skips any candidate the served set does not contain, even one the call asked for by name.
    • The ablation that deletes that one line turns the two "never named" pins red (tool layer and stdio), and restores clean.
    • The real-security-layer case pins the other direction: for a caller served the whole schema, exactly the denied field is named, so no schema field the read path keeps is reported as withheld.
  • The card's pins are present. A withheld field is named. A field hidden from the schema is not named anywhere in the serialized result. A readable field with an empty value is not named. Only asked fields are named when fields is given. Nothing withheld gives a byte-identical answer.
  • aggregate_records. The card asks for it only "if the door does not already refuse it". The body records a probe on the real security layer: a withheld measure or group key is already refused with a permission error. Leaving that door unchanged is within scope.
  • File surface. All 9 files are inside claim 6974815741's surface. The claim allowed a read of the security plugin, and no file there changes. The existing caller-scoped readable answer is used.

Read at the head

  • Tool layer (mcp-http-tools.ts).
    • The new bridge member is optional. A missing member, an undefined answer and a throw all name nothing, and the read never fails because of the probe.
    • Members are added only when the list is non-empty.
    • On query_records the members sit beside the existing delegation notice, and a test covers both together. get_record gets the members after its not-found path, so an unreadable id still answers as before.
    • The note is one constant and names no field and no value.
  • HTTP bridge (runtime/src/domains/mcp.ts). It reads the served schema through readObjectForCaller, the projection describe_object uses, and the readable answer from this request's security service with this request's execution context, the same context the reads use. If there is no security service, no served object or no readable answer, it answers undefined.
  • Stdio bridge. It reads through servedView (the object-schema mask view) and the principal resolvePrincipal gives, the same two the stdio reads use. The same undefined exits apply.
  • Exports. McpFieldVisibility is exported from @objectstack/mcp beside McpDataBridge. The two bridge-member classification tripwires register the new member.

Declarations, CI, merge

  • Changeset, read sentence by sentence. @objectstack/mcp and @objectstack/runtime are both patch. Clause-②: yes (widening) is right: two new result members, one new optional bridge member and a new exported type, and no reply loses a key. Metadata-protocol: none holds. Each sentence matches the code: names only, asked fields only when fields is given, the two-answer rule, no change without the member or the service, and aggregate_records unchanged.
  • Published docs. content/docs/ai/connect-mcp.mdx lists the record tools but no result members, so no published sentence becomes false. The served text gains its one line in both tool descriptions.
  • Check-runs at this head: 53 in total, all completed, none failed (37 success, 16 skipped).
  • Merges cleanly onto origin/main 910306b632.

Nits (none blocks)

  • The changeset names the exact capabilities that put a caller in the whole-schema posture. They are published ADR-0106 terms, but the seat should weigh them under the card's disclosure rule before landing.
  • The follow-up skill bullet is quoted in dev report 6976419490 but has no card yet. The card stays open for it, the scenario and the ruling. Filing the domain:skills card now would make that carrier visible.
  • Each query_records and get_record call now makes two more framework reads (the served schema and the readable answer), even for callers with nothing withheld. This is correct, but worth a look if MCP read latency is ever measured.

Not mine, still owed before landing

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Contract review

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

Read: card #35137 (body, triage 6971739882 / 6974332801 / 6974554954, claim 6974815741, dev report 6976419490), PR #35179 (body, 9-file list, net diff against merge base 55020c331b, every PR comment), the 53 check-runs on this head (37 success, 16 skipped, 0 failure: every derived gate family green, Test Core 10/10, Type Check debt ledger, Lint & Repo Gates, Check Changeset, PR-body guards), and, at this head, plugin-security (getReadableFields, computeReadableFields, the field mask and its fold), ADR-0106 D1/D4/D8 as the bridges implement them, and describe_object on both doors. Judged as option A of the open question (keep the bound).

① Derived judgments

  • Accept-set / public surface — McpDataBridge.fieldVisibilityOf? (new OPTIONAL member) and the exported type McpFieldVisibility: right. Optional with the diagnoseDelegation degradation contract: absent member, undefined answer or throw adds nothing and never fails the read. The only two implementers in-repo are the HTTP bridge (buildMcpBridge) and the stdio bridge; no wrapper re-lists bridge members, so no door silently drops it. Both bridge-member classification tripwires register it as reading no row. Every other implementer keeps compiling and behaving as before.
  • Result surface — withheldFields + withheldFieldsNote on query_records and get_record: right. Names only, never a value; the note and the two description sentences are constants that name no field. Absent when the list is empty, so an unrestricted caller's answer is byte-identical (pinned against a bridge with no member). Not added on a not-found get_record (the 404 is thrown first) nor on any error path.
  • Withheld half = the security service's own caller-scoped answer: right. getReadableFields, asked with the same execution context the read itself runs under (HTTP: the request's ec, the one callData receives; stdio: the same resolvePrincipal() context the engine read gets). It is the documented complement of the read mask's delete set (partial-mask columns count readable, the computed-field fold and the delegator intersection are included), so a withheld field is named from the framework's answer, never from comparing rows.
  • Served half = describe_object's mask for THIS caller: right on masking and on D4/D8 — the HTTP bridge reads readObjectForCaller (the /meta object door's masker and projection, resolved once per request, same as describe_object); stdio reads servedView, the same caller view describe_object's localized view wraps (translation renames nothing). The D4-exempt and D8-off cases are pinned on stdio and, on the real security layer, on HTTP. Not exact in every case — see S1.
  • Bound on asked fields: right. With fields given, only asked names are candidates and each must be in served; an asked name outside the caller's schema is never named anywhere in the serialized result (pinned on the tool layer and on real stdio; ablation of the intersection line turns both pins red). These two tools take no expand/nested projection, so no related-object path is opened.
  • aggregate_records unchanged: right. The card scoped it "if the door does not already refuse it"; the security layer's query guard already refuses an unreadable field as a group or measure, and that refusal is pinned in plugin-security's own suite. The dev's MCP-door probe was uncommitted (N1).
  • Descriptions: one sentence each on query_records and get_record — the card's "served text gains one line": right.

S1 (should-fix) — the served-schema half is not computed exactly as describe_object serves it in every case, so the card's bound is not held structurally on both doors; a possible security observation went to the seat privately. The fix is local to the two fieldVisibilityOf implementations (or one shared derivation), with the existing "served equals describe_object's field names" pin extended to the case where they can differ.

N1 (nit) — the aggregate_records "already refused" premise rests on an uncommitted probe at the MCP door; a one-case pin there would keep the reason the tool gains no member from drifting.

N2 (nit) — on get_record the two members are merged into the record object itself, beside its field keys (no collision: field machine names are snake_case by the spec regex). A client that echoes a fetched record back into a write carries two non-field keys; query_records keeps them on the wrapper. A design choice the card allows, stated here so it is a choice.

N3 (nit) — content/docs/ai/connect-mcp.mdx § The security model lists the surfaces that name fields to a caller; the new member is consistent with it but not listed. Docs-drift is advisory and the skill line is already carried on the card.

② Semver level

  • Changeset .changeset/35137-mcp-withheld-fields.md: @objectstack/mcp patch, @objectstack/runtime patch. Right: Metadata-protocol: none (no authorable key, value or type changes; this is a result member and an optional bridge member), so the level follows the kind and is patch. Both published packages the diff moves are named; no third package publishes from this diff.
  • Clause-②: yes (widening) is line-initial in both the PR body and the changeset body: right — a new optional result member and note on two tools, a new optional bridge member and a new exported type, nothing taken away. Check Changeset and the PR-body guards are green on this head.

③ Boundary flags

  • open_questions[0] (does the done-when member persona stand under default schema masking — A keep the bound / B widen / C drop the persona): escalated, not ruled here. The PR is built on A, says Part of #35137, and the seat's comment holds landing until the maintainer's ruling is recorded on the card; that hold is the right state and is part of this verdict.
  • Dev flag: two gate families NOT MEASURED locally (dual-build CJS load, type-check debt): answered by the head's check-runs — Lint & Repo Gates, Type Check · debt ledger and Build Core are success.
  • Dev flag: textual overlap with the area o1-D branch for mcp: one read that answers "each X with its latest Y" and reads several related objects, in place of a chain of calls the client stitches #35145 (no PR yet) in the shared MCP tool file: answered by the claim's serial constraint (whoever lands second merges main and re-runs overlap-check); nothing owed on this head.
  • Dev flag: the ask-data skill line and the example-app scenario stay on the card (no governed path in this diff): answered; the card stays open through Part of.
  • Dev flag: security_findings: withheld: the seat's to read; this record adds S1's private note beside it.
  • SQL push-down (Prime Directive 5): no finding. The new probe is one schema projection and one readable-fields answer per tool call, never per row or per field, and no ids are materialised and no join is done in the app. The probe runs after diagnoseDelegation rather than beside it — a latency nit at most, not a push-down question.

Implemented-by: claude/issue-35137-withheld-fields
Reviewed-by: session_01JQwxbWDsbbJizuYnDwBxT8

VERDICT: PASS

…m the same projection describe_object serves

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud

席位核对

L1 delta · REWORK (one red test on the merge ref) · Head-sha: 380c35a8641080b1bdaa0e8c6076baa24121c9c3 · card #35137 (Fixes #35137) · read 2026-11-18T13:19Z

I read the delta only, from c1bbebce97 (my ACCEPT 6977289014) to this head: one commit, 4 files, +135 / -42. The code is right. What blocks is CI.

Must fix

  • M1: Test Core (9/10) is red (job 134820624120). The stdio CONTROL case at src/query-records-withheld-fields.test.ts:285 ("nothing withheld, or no security service…") expects { object, records, total: 1 }. On the merge ref it gets { object, records, hasMore: false }.
    • Main has since changed the stdio query answer to the hasMore page shape and dropped total (CI tests the PR merged onto main).
    • This is a real conflict with main, not a flake. The PR's own runs were on its stale base 55020c331b, which is why they were green.
    • Fix: merge main and pin the control answer as main now serves it. The pin should still prove what it is there for: no withheldFields and no note, and the readable answer asked as the principal. Then re-run the package suite on the merged tree.

The delta, read

  • The served list now comes from describe_object's own answer. Each door builds that answer in one function: describeForCaller on HTTP, describeForPrincipal on stdio. describe_object and fieldVisibilityOf both call it, and describedFieldNames reads the names off it.
    • On HTTP the extraction moves the old describeObject body unchanged: readServedObject, then servedToCaller, then inCallerLocale, then describeServedObject. The stdio extraction is unchanged too.
    • The candidate set can only shrink. A column the served definition carries but describe_object does not list (the search companion is pinned on both doors) is never a candidate, so the bound gets tighter, never looser.
    • The two ablations restore the round-1 derivation, and each turns its new pin red.
  • Ruled persona (ruling A, 6977609191). The bound is unchanged. A whole-schema caller and a masking-off member are told, both pinned. A plain member under default masking is never told, pinned on both doors.
  • Fixes #35137. The body names the remaining halves' carriers: Ask skill: teach withheldFields and top-N aggregate (orderBy, limit, totalGroups) #35191 for the skill line and scenarios: the open ask cards cover the ten question kinds the hosted ask set asks, so an ask regression is caught here first #35113 for the scenario question.

Should fix before landing (card hygiene, not this diff)

Not mine, still owed

…cords page shape

Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Co-authored-by: Claude <noreply@anthropic.com>
…thheld-fields

# Conflicts:
#	packages/mcp/src/mcp-http-tools.ts
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Head for delta review · 2026-11-18T14:58Z: ce2f6fefa12d4fb2a846af796fdf71d03b2b672d (delta c1bbebce..ce2f6fef: the round answering contract review S1 6977363432 and the maintainer's ruling A 6977609191, then the round answering L1-b M1 6979759939 — main merged twice, the second time with #35199, and the stdio control pin re-shaped to main's page result; dev reports 6979373052 and 6982233531 on #35137). CI: 34 success, 18 skipped, Check Changeset re-running after the body edit, 0 red. Fixes #35137; the skill line is carried by #35191 and the scenario question by #35113 (persona line 6979780844). Owed: L1-b delta and the seat contract review delta, then landing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Contract-review-claim: session_01JQwxbWDsbbJizuYnDwBxT8 · head ce2f6fefa12d4fb2a846af796fdf71d03b2b672d · 2026-11-18T14:58Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud

席位核对

L1 delta · ACCEPT · Head-sha: ce2f6fefa12d4fb2a846af796fdf71d03b2b672d · card #35137 (Fixes #35137) · delta 380c35a8..ce2f6fef, answering M1 in 6979759939 · read 2026-11-18T15:00Z

What the delta changes

The delta is two merges of main and one test commit. I compared the PR's net diff against its own merge base at both heads (55020c331b..380c35a8 and 1caee8cbd3..ce2f6fef). Both are the same 9 files, +603 / -28, and they differ in exactly two lines:

  • The query_records description. The withheld-fields sentence is now appended after main's latest-per-group sentence instead of after the person-field sentence. Both texts are kept whole, and the order reads correctly.
  • The stdio control pin (M1). It now expects main's page shape, { object, records, hasMore: false }, instead of total: 1. Its point is unchanged: an unrestricted caller's answer carries no withheld-fields members.

Read at the head

  • The handler after the merge. Both branches of query_records (the latest-per-group answer and the probed page) produce result, and result alone goes through withWithheldFields. So the withheld-fields rule applies to both answer shapes, and an unrestricted caller's answer is unchanged in both.
  • No other file moved. The changeset, the runtime describe path and the stdio bridge are byte-identical to the head I read before.
  • S1 is done. The scenario persona line is on scenarios: the open ask cards cover the ten question kinds the hosted ask set asks, so an ask regression is caught here first #35113 (6979780844) and states the bound as a rule.
  • Merges cleanly onto origin/main 084156de5e.
  • Check-runs at this head: 57 in total, all completed, none failed (39 success, 18 skipped).

Still owed before landing (not mine)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Contract review

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

Delta from c1bbebce97 (contract review 6977363432) to this head. Read: the ruling 6977609191 on #35137, dev reports 6979373052 and 6982233531, L1-b delta 6979759939, head note 6982265326, the PR body at this head, the round-2 commit 380c35a8641, the re-pin commit 69216b02fde, the two main merges (0eaa53f500d, ce2f6fefa12, the second carrying #35199), the PR's net diff against the new merge base 1caee8cbd36 compared file by file with the round-1 net diff, carriers #35191 and #35113 with the persona line 6979780844, and the 57 check-runs on this head (39 success, 18 skipped, 0 failure; Test Core 10/10, Lint & Repo Gates, TypeScript Type Check, Build Core, and Check Changeset and the PR-body guards re-run green after the body edit).

① Derived judgments

S1: closed. Both doors now take the served list from describe_object's own answer, so the two lists are equal by construction, not because two derivations happen to agree. On HTTP, describeObject is the same function fieldVisibilityOf calls (describeForCaller). On stdio, describeObject returns describeForPrincipal, which fieldVisibilityOf also calls. Both read names off that answer with describedFieldNames. The extracted bodies are the old describe_object bodies unchanged: on HTTP the served object, the caller's mask, the caller's locale, then the describe projection; on stdio the localized caller view with its declaration, then the same projection. So describe_object serves exactly what it served before. Pinned where the two lists can differ: the real-engine runtime pin is extended, and a stdio twin is added. Each of the two ablations restores the round-1 derivation and turns its own pin red. The candidate set can only have shrunk. The private note went to the seat.

  • Persona pinning against ruling A (6977609191): matches. The bound is unchanged. A D4-exempt caller is told, pinned on stdio and on HTTP's real security layer. A masking-off (D8) member is told, pinned on stdio, with a new runtime pin on HTTP. A plain member under default masking is never told, even when asking for the field by name, pinned on both doors. Ruling A asks for exactly this split and nothing wider.
  • The merges keep both latestPer and withheldFields on every path: right. Compared with round 1, the PR's net diff of the shared tool file differs only in where the description sentence is attached: it now follows the latestPer sentences instead of the person-field sentence. The handler hunk is byte-identical. At this head, the latestPer branch and the probed-page branch both build result through servedQueryPage, and withWithheldFields runs once on that result before the delegation notice. get_record's line is unchanged. The members spread onto the page wrapper beside hasMore / truncated with no key collision. The latestPer group keys are never candidates: the candidates are still only the asked fields or the served list, each filtered through served.has.
  • Re-pinned stdio CONTROL (69216b02fde): right. It now expects main's page shape (hasMore: false, no total) and still checks what it is there for: no member, no note, and the readable answer asked as the principal. No other pin moved. This answers L1-b M1 6979759939.
  • Did anything widen the bound: no. The served half is now a subset of what it was. The withheld half, the intersection line, the constant note and the descriptions are unchanged. No new tool, path or error text names a field. The changeset, the exported type and the optional bridge member are unchanged from round 1.
  • Fixes #35137 with carriers Ask skill: teach withheldFields and top-N aggregate (orderBy, limit, totalGroups) #35191 / scenarios: the open ask cards cover the ten question kinds the hosted ask set asks, so an ask regression is caught here first #35113: right. This PR is the card's complete framework half under ruling A, which also rewrote the done-when persona. The served-text line is in this diff. The skill line is carried by Ask skill: teach withheldFields and top-N aggregate (orderBy, limit, totalGroups) #35191, which is open, cites this card and starts after this merge. The scenario question is carried by scenarios: the open ask cards cover the ten question kinds the hosted ask set asks, so an ask regression is caught here first #35113, whose persona line 6979780844 moves the question to the ruled persona, which answers L1-b's card-hygiene S1. The live "not visible to you" answer on an example app is now owed by scenarios: the open ask cards cover the ten question kinds the hosted ask set asks, so an ask regression is caught here first #35113's round, not by this PR.
  • Earlier nits: N2 judged and left, with a stated reason (wrapping the record only when something is withheld would make its position depend on the caller's field security); I accept the reason. N1 and N3 are left as ordered.

No must-fix, no should-fix.

② Semver level

  • The changeset is unchanged: @objectstack/mcp patch and @objectstack/runtime patch, Metadata-protocol: none. That is still the right level: this round only moves the served derivation and re-pins tests. Nothing it adds is authorable or published.
  • Clause-②: yes (widening) is still line-initial in the PR body and the changeset body: right. Check Changeset re-ran green after the body edit.

③ Boundary flags

  • open_questions: none open. Round 1's bound question was ruled A (6977609191), and this head is built and pinned on A.
  • Dev flag: one gate family NOT MEASURED locally (dual-build CJS load). Answered: Lint & Repo Gates is green on this head. The local check that failed and passed on re-run (dts-closure) is covered by Build Core and the type checks, also green.
  • Dev flag: overlap-check names feat(mcp): aggregate_records orders, cuts and counts groups in the database #35193 as conflicting in the stdio bridge and the runtime MCP domain. That is a sequencing matter for the seat: whichever lands second merges main. Nothing is owed on this head.
  • Dev flag: two pushes instead of one, and merge commits with git's default message. Process only; no finding.
  • security_findings: none this round, and none from this review beyond S1's closure.
  • SQL push-down (Prime Directive 5): no finding. The probe is still one describe answer and one readable-fields answer per tool call, never per row or per field. It now also pays the caller-locale pass of the describe answer. That is the price of structural equality, and it is per call.

Implemented-by: claude/issue-35137-withheld-fields
Reviewed-by: session_01JQwxbWDsbbJizuYnDwBxT8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

Landing · 2026-11-18T15:03Z · head ce2f6fefa12d4fb2a846af796fdf71d03b2b672d

Probe Reading
L1 ACCEPT 6977289014; delta ACCEPT 6982338593 at this head
Contract review PASS 6977363432; delta PASS 6982359985 at this head (S1 closed)
CI on head 39 success, 18 skipped, 0 red
check-governed-merges NOT governed, ~631 lines
K (first-parent behind main) 2

Status: ready + auto-merge. Fixes #35137. Carriers stay open: #35191 (ask skill lines), #35113 (persona line).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 18, 2026 15:03
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit ec227fc Nov 18, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35137-withheld-fields branch November 18, 2026 15:27
os-warren pushed a commit that referenced this pull request Nov 18, 2026
…totalGroups, #35179 withheld fields) into the aggregate order and cut

Three adjacent-insertion conflicts, each resolved keeping both sides: the
McpDataBridge members aggregateGroups and #35198's userTextLocales (the
interface in mcp-http-tools.ts and the runtime HTTP bridge in
domains/mcp.ts), and both members in the write-response tripwire roster.
#35179's withheld-field naming applies to query_records and get_record
only and merged without conflict; #35201 touches service-analytics only.

Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…und counts every kind (objectstack-ai#36065)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D7UBkcmf1Qy7iEMxarYt8wU)_
Fixes objectstack-ai#35113
Fixes objectstack-ai#35098
Clause-②: yes (widening) — new optional card key `askKind` on
`QuestionSchema` and `DatasetQuestionSchema`; new exports `ASK_KINDS`,
`AskKind`, `AskKindSchema`, `questionTurnKind`, `checkAskKinds`,
`askTurns`, `askKindCounts` and `AskTurn` (package root); `kindTally`,
`kindCell` and `KindTally` (`./runner`); new optional fields
`QuestionResult.askKind`, `DatasetQuestionResult.askKind` and
`HalfScores.kinds` (`./runner`)
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:用户无感;开源评测里两张问数场景卡(订单到回款、差旅报销)的每道题都标明了题型,每轮问数评测的记录按十种题型分别计数,另外差旅报销卡的建应用说明写清了第二步由哪位财务审批。
- 为什么做:「MCP
二期与问数」专项要求开源卡覆盖托管问数集的十种题型,让问数退化当天在开源仓、零成本被发现;差旅卡那句话含糊,让部分构建把第二步审批派给了财务经理。
- 出错会怎样:只影响评测卡的打分与评测报告,不碰产品代码,可直接撤回;两张卡的指纹变了,评测日序列在此处分段。
- 要你做什么:无

## What changes

**Card one: the ten ask kinds.** Each question and dataset question of
the two open dataset cards (`order_to_cash`, `travel_expense`) now names
its ask kind (`askKind`), one of the ten kinds the hosted ask set asks:
`count`, `group_sum`, `top_n`, `time_range`, `join`, `owner_latest`,
`business_term`, `ambiguous`, `forbidden`, `unanswerable` (D6 = A on
objectstack-ai#34659: the kinds, never the hosted fixture; no hosted question is
copied).

- Premise reading: the card counted only the five dataset questions per
card. The ten ordinary questions per card already ask the figure kinds,
the `forbidden` leak reading as a member persona, and `unanswerable`.
Counted per turn (a question once per persona it lists, as the runner
asks it), the two cards already ask every kind at least twice. So no
question is added: the change names the kinds, holds them to the cards,
and makes a round report them. Adding figure questions also risks the
near-miss trap objectstack-ai#35544 hit (a lifted word that near-misses a dataset
measure).
- Per turn, `forbidden` is read off the card: a turn asked as a persona
whose truth is `withheld` is a `forbidden` ask whatever kind the
question names.
- The loader (`checkAskKinds`, `packages/qa/scenarios/src/ask-kinds.ts`)
refuses a kind its question contradicts, at `askKind`: `top_n` needs a
`topN` truth, `time_range` an `in_window` filter, `join` a relation
path, `group_sum` a `groupBy`, `count` none, `owner_latest` a `groupBy`
ending on a person field (a declared lookup to an object a persona's
`record` names, such as `employee`, or a declared user-handle field),
`business_term` exactly the `metric_selected` dataset questions,
`ambiguous` exactly the `asked_back` ones, `unanswerable` exactly the
`unanswerable` truths, and a declared `forbidden` only on a question
withheld from every persona it lists. A card that names one kind names
the kind of every question and dataset question, all or none. A card
that names no kind loads as it did before kinds existed, with dataset
questions or without, so no card the released loader accepted is
refused.
- The runner stamps each turn's kind on its result (`askKind` on every
question and dataset-question result). The scorecard counts the asks
kind by kind (`HalfScores.kinds`) and adds `Run · kinds` / `Iterate ·
Run · kinds`, all ten kinds in order, a kind not asked shown as `0
asked`. `summary` sums the row. A card that names no kind, and an older
record, show no row.
- `docs/qa/scenarios/README.md` gains an "Ask kinds" section: the ten
kinds with the rule each is held to, and the per-card count table (no
kind at zero). A test holds the cards to the table's figures. It keeps
them as a literal, because reading the README from the package's tests
would be an undeclared cross-package input
(`check:cross-package-test-inputs`).

| Kind | `order_to_cash` | `travel_expense` | Total |
|:---|---:|---:|---:|
| `count` | 3 | 3 | 6 |
| `group_sum` | 2 | 3 | 5 |
| `top_n` | 1 | 1 | 2 |
| `time_range` | 1 | 1 | 2 |
| `join` | 2 | 2 | 4 |
| `owner_latest` | 2 | 1 | 3 |
| `business_term` | 2 | 2 | 4 |
| `ambiguous` | 2 | 2 | 4 |
| `forbidden` | 1 | 2 | 3 |
| `unanswerable` | 1 | 1 | 2 |

**Card two (folded in): the step-2 approver in the `travel_expense`
prose.** The detailed prompt said "the department manager first (a
manager's own claim goes to the finance manager), then Finance". Finance
has two members, and the same sentence names one of them the finance
manager, so builds could route step 2 to that manager (e14). Every
seeded step-2 row and the persona name the Finance officer (e13). The
prose now reads "then a Finance officer (Finance staff other than the
finance manager)", and the Chinese text says the same. The expected
approver, the seed rows, the `$comment` and the
`manager_approves_step_one` operation are unchanged. This follows the
reading on that card (comment 7061940514, option B), in its own commit.

## Tests

- New top-level describes in the existing harnesses:
- `test/dataset-cards.test.ts`: every question of both cards names a
kind; across the cards no kind is asked fewer than twice;
`department_budgets` is `forbidden` as `employee` and `group_sum` as
`dept_manager`; each card's per-kind count equals the README table's
figures; 18 refusal cases, each at its `askKind` path, including
`owner_latest` on a status (`orders_by_status`) and on a product
category across a lookup (`booked_by_category`); `owner_latest` across a
lookup to a person (`overdue_by_owner`, `account.owner`) loads; a
declared `forbidden` withheld from every listed persona loads; a card
without dataset questions may name no kinds; a card with dataset
questions that names no kind loads (the released card shape). The two
missing-kind refusal cases aim at a card that names exactly one kind: a
question left without one when only a dataset question names one, and a
dataset question left without one when only a question names one.
- `test/runner/orchestrate.test.ts`: the offline ask round below; the
`Run · kinds` row and the record's tally on a hand-built half; a card
that names no kinds has no kinds tally and no row.

<details><summary>Package suite, typecheck (head 580727e)</summary>

- `pnpm --filter @objectstack/scenarios typecheck && pnpm --filter
@objectstack/scenarios exec vitest run --maxWorkers=2` under the verify
lock at 580727e: `VERDICT command-exit 0`, Test Files 40 passed (40),
Tests 1236 passed (1236). The same command, after a package build, at
1748bfc: 40/40, 1236/1236.
- Dependency closure first: `pnpm --workspace-concurrency=2 --filter
'@objectstack/scenarios^...' build`, `VERDICT command-exit 0`.

</details>

<details><summary>Contract fix round at a6052bd (F1 of contract record
7063179133, fix (a); S1 stays fixed)</summary>

- `checkAskKinds` now sets `required` from the card's own declarations:
true when any question or dataset question names an `askKind`. Before,
it was `card.run.datasetQuestions !== undefined`, which refused a
released card with dataset questions and no kinds. The dataset-question
branch now refuses a missing kind only when `required` holds, as the
question branch already did. The loader message reads "a card that names
one ask kind names the kind of every question it asks". `groupsByPerson`
stays module-private (cf467bf).
- Texts aligned with the rule: the loader message, the `askKind` TSDoc
on `QuestionSchema` and `DatasetQuestionSchema`, the card README row 4,
the "Ask kinds" opening sentence and the sentence under its table, the
package README bullet, and the 35113 changeset sentence.
- Tests: the dependency closure built (`VERDICT command-exit 0`), then
`pnpm --filter @objectstack/scenarios build && … typecheck && … exec
vitest run --maxWorkers=2` under the verify lock at a6052bd: `VERDICT
command-exit 0`, Test Files 40 passed (40), Tests 1240 passed (1240).
- Ablation 1, `required` set to `false` through
`scripts/ablation-replace.mjs`: mutation landed (anchor 1 to 0, blob
e4ae344 to 8622ef5f5761). `test/dataset-cards.test.ts`: 2 failed,
48 passed. The 2 are the re-aimed missing-kind cases. Restored, blob
equal to HEAD, `git diff HEAD` empty.
- Ablation 2, `required` set back to the old rule
(`card.run.datasetQuestions !== undefined`): mutation landed (blob
e4ae344 to e1ddde9972e2); 1 failed, 49 passed. The 1 is the new
case for a card with dataset questions and no kind. Restored, blob equal
to HEAD, `git diff HEAD` empty.
- The subject resolves to `src/` (the suite imports `../src/index.js`),
so no rebuild was needed between the legs.
- Gates at a6052bd: `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack` derived 70 families (merge base
8145424). Each ran once, with its exit code captured before any pipe:
68 exited 0. `node scripts/check-plugin-teardown-shape.mjs --self-test`
and `pnpm check:dual-build-cjs-loads` exited 3 (a shallow clone, and no
full build), as in the earlier round. Both are NOT MEASURED locally and
run in CI. `dispatch-gates --ran` (with exit codes): 70 derived, 68 run,
2 NOT-MEASURED, 0 UNRUN.
- `node scripts/pm/overlap-check.mjs --branch=HEAD` before the push:
VERDICT clean. It merges cleanly with origin/main (30b0987) and with
objectstack-ai#36092, which shares the package README.

</details>

<details><summary>Ablations (each restored, blob equal to HEAD, git diff
HEAD empty)</summary>

- `node scripts/ablation-replace.mjs --file
packages/qa/scenarios/src/loader.ts --anchor ' checkAskKinds(card,
personaTruths, refuse);' --delete -- … vitest run
test/dataset-cards.test.ts`: mutation landed (anchor 1 to 0, blob
4a0967e to bd8e244d0a16); 15 failed, 31 passed. The 15 are the
refusal cases the check owns. The closed-set case stays green, as it
should, because the schema refuses it.
- `ask-kinds.ts`, the per-turn `forbidden` reading replaced by the
declared kind: mutation landed (blob 6fe408d to 46cad08937e0); 4
failed (the offline round, no kind under two, the per-turn `forbidden`
case, the README table).
- `ask-kinds.ts`, the `owner_latest` person check reduced to "any
`groupBy`" (head 436ed39): mutation landed (blob 7da9b01 to
9e6a2cf23b43); 2 failed, 47 passed, the two non-person `owner_latest`
cases. The first attempt used a replacement that is a substring of the
anchor. The tool refused it before running anything because the count
did not rise, so that attempt measured nothing. It was redone with a
distinct replacement.
- The subject resolves to `src/`: the suites import `../src/…`, not a
built `dist/`, so no rebuild was needed between the legs.

</details>

<details><summary>Gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` (merge base
8145424): 70 families, each run once with its exit code captured
before any pipe. 67 exited 0.
- `pnpm check:cross-package-test-inputs` exited 1 on the first pass. The
test read the card README from outside the package. The test now holds a
literal instead, and the rerun at 580727e exits 0.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` exits 3,
because its fixture is pinned to a commit this shallow clone cannot
reach. `pnpm check:dual-build-cjs-loads` exits 3, because it reads every
package's build. Both are NOT MEASURED locally and run in CI.
- Rerun at 580727e after the test-only commit:
`check:test-source-alias`, `check:type-check-coverage`,
`check:type-check-debt`, `check:issue-citations`, `check:nul-bytes`,
`check:doc-authoring` and `check:closed-ceremony-text` all exit 0. The
derived list is unchanged.
- `dispatch-gates --ran`: 70 derived, 68 run, 2 NOT-MEASURED (exit 3), 0
UNRUN.
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean. It
merges cleanly with origin/main and with objectstack-ai#35886, which shares the
package README.

- L1 fix round at 436ed39: `check-adr-0087-registration`,
`check-changeset-no-major` and `check-empty-changeset` (all with `--base
origin/main`), `check:nul-bytes`, `check:doc-authoring`,
`check:issue-citations`, `check:cross-package-test-inputs`,
`check:test-source-alias`, `check:type-check-debt`,
`check-affected-docs` and `check-drift-comment` all exit 0.
`overlap-check`: VERDICT clean, merging cleanly with origin/main, objectstack-ai#36077
and objectstack-ai#36066.
- L1 fix round tests at 436ed39: the dependency closure was built,
then `pnpm --filter @objectstack/scenarios typecheck && … vitest run
test/dataset-cards.test.ts test/runner/orchestrate.test.ts` gave
`VERDICT command-exit 0`, Test Files 2 passed (2), Tests 213 passed
(213).

</details>

## Acceptance notes

- **Done-when, the round:** no live model round ran in this container.
The live driver needs a permission mode other than Auto (packages
README, "Permission mode"). The offline path ran instead: `runHalf` over
each dataset card on the in-memory app, with a driver that answers
questions from the computed truth and dataset questions with no route.
Every turn's result carries its kind. `kindTally` matches the README
counts, and `Run · kinds` names all ten kinds with a measured count on
each card. The first live round on the verified build will show the row.
- **The FLS "not visible to you" question (comments 6971648229 and
6979780844):** objectstack-ai#35179 shipped the framework half. `query_records` /
`get_record` now name the withheld field for a caller served the whole
schema (ADR-0106 D4) or on a deployment with masking off (D8). The open
runner's personas are plain members (`create-user` with `role: 'user'`)
on a default `objectstack dev` host, so the ruled caller cannot be asked
on the open cards today. The existing `withheld` grader already passes
"not visible to you" and fails "blank". What is missing is the caller: a
schema-exempt persona, or a recorded masking-off round. That runner
choice is not in this PR; the seat routes it as its own card. The README
says no open card asks it yet. The `forbidden` turns here are the member
leak reading under default masking.
- `docs/qa/scenarios/builds/travel_expense.provenance.json` records the
card's new sha256 (`abe91b8f…` to `29162eef…`), following objectstack-ai#35764. The
build file is unchanged.
- The verified build `builds/travel_expense.json` was authored against
the pre-objectstack-ai#35098 prompt, which said "then Finance". Ask rounds install
that build and do not re-author it, so the prose change reaches only
scratch and door builds.
- Ask-round records split at both cards' new hashes (`summary` refuses
to mix card hashes).

## Verification

- Read first: `packages/qa/scenarios/src/ask-kinds.ts`
(`questionKindProblem`, `questionTurnKind`), then `kindTally` /
`kindCell` in `packages/qa/scenarios/src/runner/scorecard.ts`, then the
two cards' `askKind` lines.
- Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run
test/dataset-cards.test.ts -t kind`. Expect 31 passed, 19 skipped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5pb2t8Z8C64PkPyVt1 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/l 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.

mcp: query_records and get_record say which fields field-level security withheld, so an answer says "not visible to you", not "blank"

2 participants