Skip to content

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

Closed

Description

@objectstack-fleet

epic:#34659#1 · hotlong · session_01Q4EjjMnXJdSZifpEN5i7aU

Filing gate: ④ a child of the cross-lane parent #34659 (the 「MCP 二期与问数」 epic), filed on the maintainer's word in this session's chat, 2026-11-18, verbatim: 「开源项目能做的尽量在开源项目做,云端等开源项目完全优化好再开工」, given in answer to this session's analysis of the hosted card on this defect.

Why

A member asks for a value they are not allowed to read, their own cost rate for example. The answer says the field is blank. Nothing leaks, and the person is misled: they conclude the data is missing and go and fill it in, or report a bug. The hosted product fixed this for its own agent; a client on the open MCP door still gets the misleading answer.

Who acts: the server lane (packages/mcp, packages/runtime/src/domains/mcp.ts, a read of packages/plugins/plugin-security). Reader: every MCP client asking on behalf of a user with a restricted field.

Evidence

  • The framework strips an unreadable field from every row it serves and leaves no marker: FieldMasker.maskRecord deletes the key (packages/plugins/plugin-security/src/field-masker.ts:448), and selecting a hidden field in fields is not refused. A row therefore cannot tell withheld from empty.
  • Objectstack main (read 2026-11-18): no withheldFields anywhere in packages/mcp/src/mcp-http-tools.ts, packages/mcp/src/stdio-data-bridge.ts or packages/runtime/src/domains/mcp.ts.
  • The hosted product measured the misleading answer on its ask set (a member's own cost rate read as blank) and fixed it in its own tools: its record tools return withheldFields and a note. That fix does not reach the open door.
  • On the open door the misleading answer is inferred from the code above; it was not reproduced there.

Scope

  • query_records and get_record results carry withheldFields: the fields the call asked for, or the object declares, that field-level security withheld from this caller's rows.
  • The bound, which is the security line of this card: only a field the caller's own served schema shows is ever named. A field removed from the caller's schema is never named, in this list or anywhere in the result. The framework's own answers decide both, asked as the caller; nothing is derived by comparing rows.
  • The same member on aggregate_records when a withheld field was asked for as a measure or a group, if the door does not already refuse it.
  • A short note in the result: these fields exist and are not visible to you; say so, never say they are empty.
  • HTTP and stdio alike. The ask-data skill and the served text gain one line.
  • Pins: a withheld field named; a field hidden from the schema not named; an empty readable field in neither list.

Done when

Out of scope

  • Any change to what field-level security withholds. Write paths.

Relations

Activity

  1. added
    area:ai
    on Nov 18, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch: p2 · domain:server · pm:queue, a child of epic #34659. Grading principle of 2026-11-18, item 3: an ask answer calls a field the caller may not read "blank" instead of "not visible to you". Nothing leaks, as the card states, so this is not item 2. It keeps the grade of its in-flight siblings (#34919 p2); the grade of the epic's children is with the maintainer.

    Security-touching: the result will say which fields field security withheld. The reviewer checks the card's bound (names only, never values, only fields the caller asked for or the object declares) against references/lanes/security.md before ACCEPT.

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 18, 2026
  4. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Regraded p2 → p1: an MCP ask-line card. The maintainer ranked the ask line first (「代码搭建已经可用,只是优化,mcp问数优先,其次是mcp搭建」, #34659 comment 6972918775). In triage's session he then agreed that the open cards under the ask parents #35150 and #35159 rise to p1 (「问数专题已按你的顺序重排 同意」). The MCP build and code-first lines stay p2. Any claim on the card is unchanged.

  5. added
    priority:p1
    and removed
    priority:p2
    on Nov 18, 2026
  6. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Regraded p1 → p2: the 09:2xZ raise is reverted. The maintainer, in triage's session: 「p1 是不是应该留给真的需要插队的」, then 「把刚才提到 p1 的 7 张问数卡改回 p2」. The order of epic #34659's work comes from the epic's own structure (the ask line #35150/#35159 first), not from priority labels. p1 is kept for cards that must jump ahead of epic work. Any claim on the card is unchanged.

  7. added
    priority:p2
    and removed
    priority:p1
    on Nov 18, 2026
  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

    Claim: PM loop round 1 (area o1-C, sub-epic #35159 first, seat 1 order 08:57Z) · 2026-11-18T09:43Z
    Session: session_01JQwxbWDsbbJizuYnDwBxT8
    Account: os-warren
    Branch: claude/issue-35137-withheld-fields
    Worktree: objectstack-issue-35137
    Domain: domain:server
    Seat: repo:objectstack#1
    File surface: packages/mcp/src/mcp-http-tools.ts (query_records, get_record, aggregate_records results and descriptions), packages/mcp/src/stdio-data-bridge.ts, packages/runtime/src/domains/mcp.ts, a read-only answer from packages/plugins/plugin-security (a caller-scoped "which declared fields are withheld" question, if none exists today), their tests, one changeset. ⛔ Not skills/**: the ask-data skill line goes to a separate domain:skills card (an implementation card's file surface carries no governed path).
    Container & model: M, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: yes (widening: a new result member withheldFields and a note on three tools)
    Metadata-protocol: none
    Responsibility: objectstack: FieldMasker.maskRecord deletes a withheld key and leaves no marker, and the MCP record tools say nothing, so a withheld field reads as blank | none | every MCP client asking for a field-level-secured field on a member's behalf
    Thread-read: 6974592383
    Premise: holds — measured on origin/main 55020c3: no withheldFields in the three door files; FieldMasker.maskRecord copies the row and deletes hidden keys with no marker.
    Security-touching: yes. The card's bound is the contract: only a field the caller's own served schema shows is ever named; a field removed from the caller's schema is never named anywhere in the result; the framework's own answers decide both, asked as the caller; nothing is derived by comparing rows. The contract review checks it against references/lanes/security.md before ACCEPT.
    Serial constraints cleared: area o1-D's #35145 widens the same handlers (mcp-http-tools.ts, stdio-data-bridge.ts, runtime domains/mcp.ts); whoever pushes second merges main and re-runs overlap-check. Capped-list key ruling (seat 1): truncated: true from a limit+1 probe, if this card touches a cap.
    Pre-claim lane: domain:server.
    Pre-claim deps: none.
    Prior rulings read: triage first touch 6971739882 (security-touching, reviewer checks the bound); regrade revert 6974554954 (order comes from the epic's structure, #35159 first).

    Lease o1-C (seat post #34366).

  9. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  10. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8
    os-dev-report

    {
     "issue": 35137,
     "status": "done",
     "branch": "claude/issue-35137-withheld-fields",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35179",
     "session": "session_01JQwxbWDsbbJizuYnDwBxT8",
     "premise_still_valid": true,
     "summary": "query_records and get_record now carry withheldFields (names only) plus withheldFieldsNote (one fixed sentence) when field-level security withheld a field, on HTTP and stdio alike. Both bridges answer a new optional McpDataBridge.fieldVisibilityOf: (a) the field names of the object as describe_object serves it to the caller and (b) security.getReadableFields for the caller. The shared tool layer (packages/mcp/src/mcp-http-tools.ts withheldFieldNames) names a field only if (a) shows it and (b) leaves it out, limited to the asked fields when fields is given. Nothing withheld = no member (chosen), so the result is byte-identical. No new security-service method was needed: getReadableFields is the existing caller-scoped answer, the exact complement of what FieldMasker deletes. aggregate_records was measured on the real security layer: a withheld measure or group key is already refused 403 PERMISSION_DENIED, so it is left unchanged. Measured reach of the bound: with default ADR-0106 schema masking, a field a plain member cannot read is also removed from their served schema, so it is never named for them. The member appears only for D4-exempt callers (manage_metadata, studio.access, setup.access) or where masking is off (D8). The card's done-when (a member persona answered 'not visible to you') is therefore not reachable under default masking without a ruling, so the PR says Part of #35137. Seat note honored: the note text lives in the single constant WITHHELD_FIELDS_NOTE in packages/mcp/src/mcp-http-tools.ts for the shared locale picker to adopt. No picker was added and truncated is untouched. Skills follow-up: skills/objectstack-ask/SKILL.md, section 4 'Fallback: object queries', should gain the bullet: '- `withheldFields` on a `query_records` or `get_record` answer names fields that exist but are hidden from you: say they are not visible to you, never that they are empty.'",
     "tests": "Head c1bbebce972. pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 (whole package, under lock): VERDICT command-exit 0, Test Files 72 passed (72), Tests 1282 passed (1282). The first run was red on 2 bridge-member classification tripwires, which were registered in the same PR. pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp src/mcp src/http-dispatcher.mcp: VERDICT command-exit 0, 22 files / 467 tests passed. Declared narrowing: the rest of the runtime suite was not run locally and is CI Test Core's. mcp + runtime typecheck: VERDICT command-exit 0, both check:test-typecheck OK. New pins: packages/mcp/src/query-records-withheld-fields.test.ts (11 cases: tool layer over the HTTP runtime + real stdio bridge behind the real tools) and 3 real-security-layer cases in packages/runtime/src/domains/mcp-object-schema-mask.test.ts. Ablation via scripts/ablation-replace.mjs deleting '    if (!served.has(name)) continue;': landed (anchor 1->0, blob 6e4e5938988b->62c1fee68547), 2 failed / 9 passed (tool-layer and stdio 'never named' pins), restored (blob == HEAD, git diff HEAD empty). The test imports the source directly, so no dist step applies. Aggregate probe: a one-off uncommitted test, restored with git checkout HEAD -- (diff empty).",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 69 families; 67 exit 0. pnpm check:dual-build-cjs-loads and pnpm check:type-check-debt exited 3 (PREREQUISITE NOT MET: no full build, and the verify lock was never acquired, VERDICT queue-timeout exit 99 behind a 24-minute holder from another lane), so they are NOT MEASURED and left to CI Lint & Repo Gates. dispatch-gates --ran on an exit-code record: 69 accounted, 67 run, 2 NOT-MEASURED, 0 UNRUN, exit 0. --tier: no path-derived mandate. check-governed-merges --branch HEAD: NOT governed, 494 lines, exit 0. overlap-check --branch=HEAD: VERDICT clean, exit 0 (0 open PR heads). Outside it, the area o1-D branch claude/issue-35145-mcp-latest-per-and-related-read (cfe4ed508a9, no PR) shares mcp-http-tools.ts, stdio-data-bridge.ts, index.ts and runtime domains/mcp.ts, with one textual conflict in mcp-http-tools.ts (local merge-tree). check:nul-bytes exit 0 and the control-byte self-scan found nothing. PR check-runs: in_progress at report time, not awaited.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "5 — 3 executed by the fleet-write relay as objectstack-fleet[bot]: POST /repos/objectstack-ai/objectstack/pulls (draft), POST /repos/objectstack-ai/objectstack/issues/35179/assignees (os-warren), POST /repos/objectstack-ai/objectstack/issues/35137/comments (this report, via post-stamped.mjs); plus 2 repository_dispatch POSTs carrying them; git push not counted",
     "open_questions": [
      {
       "question": "Under default ADR-0106 schema masking, the bound ('only a field the caller's own served schema shows is ever named') means a plain member's FLS-hidden field is never named, because the same field is masked out of their schema. Does the card's done-when scenario (member persona answered 'not visible to you') stand?",
       "options": [
        "A: keep the bound; the done-when persona is a D4-exempt user or a deployment with masking off, and the scenario card says so",
        "B: widen the bound (maintainer's word, per the card) so a field masked from the schema may be named when the caller asked for it by name",
        "C: drop the done-when persona and close on the framework half"
       ],
       "recommendation": "A, because the bound is the card's security line and the maintainer's to change. A is honest about where the member appears and needs no new disclosure. B discloses existence to a caller ADR-0106 D1 says the field does not exist for."
      }
     ],
     "security_findings": "withheld",
     "out_of_scope_findings": [
      "carrier: #35137 · the ask-data skill line (skills/objectstack-ask/SKILL.md section 4) and the example-app scenario stay on the card · noted, not filed"
     ]
    }
  11. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbabAdcWyApSTGBYJNY

    Ruling: option A, keep the bound: only a field the caller's own served schema shows is ever named · recorded 2026-11-18T11:45Z

    Warren chose 「A 保持现有边界」 on the decision card 「决定:对普通成员隐藏的字段,MCP 回答能否说出它存在?」 in this account's fleet project (card cmsg_01U5RdnAAmkSQmZbqh6FtqZ8R53WFXpsXCj8FiU2Pp84BU) at 2026-11-18T11:44Z. Not chosen: B (name a masked field when it is asked for by name, which needs an ADR-0106 amendment) and C (drop the persona and close on the framework half).

    What is ruled

  12. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8
    os-dev-report

    {
      "issue": 35137,
      "status": "done",
      "branch": "claude/issue-35137-withheld-fields",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35179",
      "session": "session_01JQwxbWDsbbJizuYnDwBxT8",
      "premise_still_valid": true,
      "summary": "Fix round for contract review 6977363432 S1 and ruling A (6977609191). The served-schema field list now comes from the same projection describe_object serves: each door builds its describe_object answer in one local function (HTTP describeForCaller in packages/runtime/src/domains/mcp.ts, stdio describeForPrincipal in packages/mcp/src/stdio-data-bridge.ts) and fieldVisibilityOf reads the field names off that answer (describedFieldNames), so any later filter on what describe_object lists propagates. Pins: the runtime 'served equals describe_object's field names' pin extended (real engine) to an object where the two could differ, a stdio twin of it, and a runtime masking-off (D8) member pin, so the ruled persona (D4-exempt or masking-off told, plain member under default masking never told) is pinned on both doors. N2 judged and left (wrapping the record only when something is withheld would make the record's position depend on the caller's field security; reason in the PR body); N1/N3 left as ordered. PR body now opens 'Fixes #35137' and names carriers #35191 (skill line) and #35113 (scenario). The previous body carried neither a line-1 attribution comment nor a signed trailer; the trailer was added as the last non-empty line (relay requires it for a PR-body issue_patch).",
      "tests": "At commit 0b2fcb10348 (pushed head 380c35a8641 = same tree 63b0601f63cb, trailer reworded): pnpm --filter @objectstack/mcp test -> VERDICT command-exit 0, Test Files 72 passed (72), Tests 1283 passed (1283). pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp -> VERDICT command-exit 0, Test Files 8 passed (8), Tests 289 passed (289). typecheck mcp+runtime -> VERDICT command-exit 0. Ablation (source imports, no dist in path; ablation-replace.mjs with on-disk proof and auto-restore to HEAD blob): HTTP anchor 'return { served: describedFieldNames(described), readable };' replaced with the round-1 derivation -> blob b28efe7b7b33->d00af3f275cc, 1 failed/79 passed (the extended runtime pin), restored, git diff HEAD empty; stdio same anchor -> blob 949d972f50fe->978cd2659f10, 1 failed/11 passed (the new stdio pin), restored.",
      "gates": "dispatch-gates --commands: 69 families run sequentially; 68 exit 0; pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs full build) = NOT MEASURED, CI Lint & Repo Gates runs it. --ran: 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN (exit 0). check-governed-merges --branch HEAD: NOT governed, 631 lines (exit 0). overlap-check --branch=HEAD: VERDICT clean (origin/main c787255a49, #35193, #35186 merge cleanly); no main merge needed. Derivation warned STALE TREE (base 55020c331 behind origin/main; scripts/check-route-envelope.mjs changed there) - CI reads the merge ref. PR check-runs on 380c35a8641 at report time: 11 success, 18 skipped, 15 in_progress, 0 failure.",
      "dogfood_battery": "n/a — no `!` in the PR title and Clause-② carries (widening), no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — git push (branch); relay issue_patch PR #35179 body (fleet-write run 44309666022, read-back identical 10326 bytes); post-stamped comment on #35137 (os-dev-report). One push attempt was refused locally by the commit-card-trailers pre-push hook (model name in co-author trailer) before any write; reworded to the model-free pair and pushed.",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": [
        "carrier: none · the aggregate door was not touched or re-described this round (the round-1 PR-body text about it was carried forward verbatim, not extended)"
      ]
    }
  13. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8
    os-dev-report

    {
    "issue": 35137,
    "status": "done",
    "branch": "claude/issue-35137-withheld-fields",
    "pr": "#35179",
    "session": "session_01JQwxbWDsbbJizuYnDwBxT8",
    "premise_still_valid": true,
    "summary": "M1 fixed. Merged origin/main twice: first at 9c29d73 (merge 0eaa53f), then, on the coordinator's update, at 1caee8c which includes #35199 latestPer (merge ce2f6fe, the pushed head). The stdio CONTROL pin in packages/mcp/src/query-records-withheld-fields.test.ts now expects main's page shape { object, records, hasMore: false } with no total (the fixture engine has no count, so main's counted-page path leaves total out); its point is kept: no withheldFields member, no note, readable answer asked as the principal (commit 69216b0). The second merge conflicted only in the query_records description in packages/mcp/src/mcp-http-tools.ts: both kept, latestPer sentences then WITHHELD_FIELDS_DESCRIPTION; the handler auto-merged with both behaviours (latestPer branch and probed page both feed withWithheldFields). No other pin in that file or in packages/runtime/src/domains/mcp-object-schema-mask.test.ts drifted. PR body Verification brought to ce2f6fe via relay issue_patch (line 1 Fixes #35137 and the signed trailer kept; read-back identical). Deviation: two pushes, not one: the first (380c35a..69216b0) was sent before the coordinator's #35199 update arrived; the second (69216b0..ce2f6fe) carries the re-merge. Commit 69216b0 uses the model-free trailer pair; the merge commits carry git's default message with no trailer.",
    "tests": "Head ce2f6fe, under the verify lock: pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 -> Test Files 74 passed (74), Tests 1315 passed (1315); pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp -> Test Files 8 passed (8), Tests 289 passed (289) (all 8 domains/mcp* suites incl. mcp-object-schema-mask.test.ts); typecheck mcp + runtime -> VERDICT command-exit 0, both check:test-typecheck OK. Before the re-pin (first merge): the withheld-fields file 1 failed / 11 passed, the CONTROL (expected total: 1, received hasMore: false). After re-pin at 69216b0: mcp 73/73 files, 1304/1304 tests; runtime domains/mcp 8/8, 289/289. No ablation: no tested behaviour changed, only a pin re-shaped to main's served result.",
    "gates": "dispatch-gates --commands at ce2f6fe (merge base 1caee8c): 69 families run in sequence, exit captured per command before any pipe. 67 exit 0 first pass; pnpm check:dts-closure exit 1 naming runtime and service-automation dist declarations missing, both present minutes later (written 14:50), re-run exit 0 (81 built packages, 260/260 declaration files); pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs every package built): NOT MEASURED locally, CI Lint & Repo Gates success. --ran: 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN (exit 0). check-governed-merges --branch HEAD: NOT governed, 631 lines (exit 0). overlap-check --branch=HEAD: VERDICT overlap exit 1: origin/main 1caee8c clean; #35202 and #35198 clean; #35193 conflicts in packages/mcp/src/stdio-data-bridge.ts and packages/runtime/src/domains/mcp.ts (one queues behind the other). PR check-runs on ce2f6fe: 37 success, 16 skipped, 0 failed; Test Core 1/10..10/10 success, Lint & Repo Gates success, TypeScript Type Check success, Build Core success.",
    "dogfood_battery": "n/a — no ! in the PR title and Clause-② is yes (widening), no (narrowing) arm",
    "mcp_calls": "0",
    "api_writes": "2 — relay issue_patch PATCH /repos//issues/35179 (PR body); post-stamped POST /repos//issues/35137/comments (this report). Plus two git pushes (not REST).",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": []
    }

  14. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8

    Close-out · 2026-11-18T15:46Z: PR #35179 merged as ec227fc7b1 at 2026-11-18T15:27:40Z (query_records and get_record name the fields field-level security withheld from the caller, bound ruled A in 6977609191). Reviews: L1 6977289014 + delta 6982338593, contract review 6977363432 + delta 6982359985; landing record 6982409501. Carriers stay open: #35191 (ask skill lines) and #35113 (persona line). Lease o1-C released.

  15. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions