Repository navigation
feat(mcp): a refused record read says what is not recorded, in the caller's language - #35198
Conversation
…s not recorded, in the caller's locale A refused query_records, aggregate_records or get_record keeps its coded refusal and carries notRecorded and ifNotRecorded beside it when the object, or a field the call named, is not in the caller's served schema. One shared sentence-locale picker in @objectstack/core, used by the dataset tools and the record tools. Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
… HTTP bridge's schema and locale answers, and the shared picker Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…on the HTTP not-found twin; add the changeset Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…te on both faces Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…e does not name whole Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 18 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 68 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1a399c0abe2b53038cd1b810f781fd426aff120b && git checkout 1a399c0abe2b53038cd1b810f781fd426aff120b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 756aba29a02c22c23d3a19a57b4f34046c3a2f26 df09a1b979dfbadd6417fe19127a4c047811e6ae && git checkout -B drift-repro 756aba29a02c22c23d3a19a57b4f34046c3a2f26 && git merge --no-ff df09a1b979dfbadd6417fe19127a4c047811e6ae
node scripts/docs-audit/affected-docs.mjs --json 756aba29a02c22c23d3a19a57b4f34046c3a2f26
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract review brief handed to the isolated reviewer (TIER_DEFAULT, declaration face), posted beside its record: Contract review brief — PR #35198 @
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Inputs: brief 6979408379; card #35138 (claim 6975089907, claim amendment 2 6976973578, os-dev report 6979330524 and area note 6979387847); PR #35198 (body and comments, the Docs Drift Check 6979326025 among them); the full diff against merge-base Face: the committed file list is one changeset plus files under ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
A dotted name in fields, orderBy, groupBy or an aggregation's field was taken whole, so a name reaching a related field through a served head was named as not recorded. Each sent name is now read by its first segment at the one place the members are decided. Adds a pin for the dotted case and a stdio twin over the shared ADR-0106 case table: the answer names only what the caller can see. Softens the picker's jsdoc to its stated scope. Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…pper Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
…stdio bridge makes Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Contract reviewServed-tier: Delta review: record 6979581416 on Face: unchanged. The delta touches no ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Final head for L1 · 2026-11-18T14:23ZHead-sha: |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review (#35138, PR 3) · 2026-11-18T14:25ZL1: ACCEPT Fixes vs Part of. This is PR 3 of the W0 plan. The body says Claim file surface. Amendment 2 gives PR 3 a list of files, and all 13 paths fall inside it.
The seat's rule (10:04Z) against the diff.
Each changeset sentence against the diff. The changeset is new and is not on
Tests. Clause-②: yes (widening). Record 6979581416 is PASS, and delta 6981334691 is PASS at this same head, with S1, N1 and N2 closed. N3 is PR-body prose, which 6981360244 corrects. Governance. CI at this head, from check-runs: 57 success and 11 skipped, with none failed or in progress. The PR is mergeable Must-fixNone. Should-fixNone. Notes
|
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Landing · 2026-11-18T14:27Z
Open findings: delta nit N3 (body prose, corrected in 6981360244); L1 notes N1 (a State: ready + auto-merge armed by area o1-B (lease Dev-effort: high · Rounds: 2 |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44324504354 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi Queue red: triage and one re-queue · 2026-11-18T14:52ZSignature (new; triage comment 6982087591, run 44324504354, queue commit Initial judgment: load or timing, not this PR. The three facts:
Head unchanged ( |
…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>
Requested by Warren · project thread
Refs #35138 (item notRecorded)
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
query_records/aggregate_records/get_record被拒绝时,若调用点名的对象或字段在调用者自己的 schema 里不存在,拒绝旁边多出notRecorded(点名的是哪个对象/字段,原样取自调用者的输入)和ifNotRecorded(按调用者语言的一句话:告诉用户"这项数据没有记录",不要报 0);新增@objectstack/core的共享句子语言选择器,数据集工具改用它,行为不变。isError、code、message、status)字节不变,只在拒绝旁追加两个成员;两个成员只由"调用者发送的名字"和"调用者被服务的 schema"构成,不点名调用者看不到的任何东西。回滚即 revert 本 PR。packages/mcp/src/mcp-http-tools.ts的notRecordedMembersOf/recordReadErrorResult(决定何时出现成员、成员由什么构成);packages/core/src/sentence-locale.ts(共享选择器);packages/services/service-analytics/src/dataset-next-step.ts(改用共享选择器)。pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/mcp-not-recorded.test.ts,预期 14 个用例全绿,其中 CONTROL 用例断言"看不到的字段/对象"与"不存在的字段/对象"成员文本逐字节相同。What changes
notRecorded/ifNotRecordedon a refused record read.query_records,aggregate_recordsandget_recordkeep their coded refusal byte for byte and, where the call named an object or a field that the caller's served schema (describeObject, thedescribe_objectanswer) does not show, render{ error, notRecorded, ifNotRecorded }:notRecorded:{ object }when the schema shows no such object;{ object, fields }with the field names the call sent that the schema does not show, in the order sent (read fromwherethrough$and/$or/$nor/$not, a dotted key by its head,fields,orderBy,groupBy, each aggregation'sfieldandfilter);ifNotRecorded: one sentence in the caller's language (en, zh-Hans, zh-Hant, ja), written in the executor (ADR-0149 M1: no wording in the spec).id,created_at,updated_at(answered on every object,PLATFORM_PROVISIONED_COLUMNS) are never named.@objectstack/core:pickSentenceLocale(locales, written)andplatformLocaleNamedBy(code), moved fromservice-analytics'dataset-next-step.ts.datasetToolSentenceLocalenow wraps it; its pins are unchanged and green.McpDataBridge.userTextLocales(). HTTP:userTextLocalesOf(ec), the ladder the dataset tools read on that door. stdio: the principal's ladder (what the dataset tools read there), then the i18n service's default. Absent or throwing:en.packages/mcp(NotRecordedMembers); nothing enterspackages/spec.Tests
packages/mcp/src/mcp-not-recorded.test.ts(14): unknown object on all three tools; unknown field onquery_recordsandaggregate_records; CONTROL: a field (and an object) the caller cannot see answers members byte-identical to one that does not exist, whatever refusal stands beside them; a readable existing field,id/created_at/updated_at, a successful read, a server fault and a failing schema read carry no member; zh / zh-Hant / ja / fallback / no-member / throwing locale; the stdio bridge'suserTextLocales.packages/runtime/src/domains/mcp-not-recorded.test.ts(5): over the real security layer (SecurityPlugin,ObjectQL,SqlDriver, protocol), the HTTP bridge's served schema shows neither a field the caller is denied nor an unknown field,describeObjectanswersnullfor an object the caller cannot read as for an unknown name, a read naming either is refused 4xx, CONTROL the staff reads both, anduserTextLocalesanswersuserTextLocalesOf(ec).packages/core/src/sentence-locale.test.ts(2): whole-code and prefix lookup, next rung,enfloor.userTextLocales; the HTTP twin instdio-data-bridge.not-found.test.tsnow servestask(as the stdio side does), so the PARITY pin still compares like with like.Package runs (head e4c3aa0, then the merge of origin/main at ee70211)
@objectstack/mcptypecheck (incl.check:test-typecheck) exit 0;vitest run: 72 files / 1285 tests passed at e4c3aa0, 73 files / 1306 tests passed at ee70211.@objectstack/core+@objectstack/service-analyticsvitest run: 161 files / 3734 tests and 218 files / 5592 passed, 335 skipped; typecheck exit 0 for both.@objectstack/runtimetypecheck exit 0;vitest run: 627 files / 12969 passed, 25 skipped (e4c3aa0 tree before the member move;src/domains/mcp*re-run at ee70211: 9 files / 289 passed).Ablations (each through scripts/ablation-replace.mjs: anchor hit once, blob changed, restored to the HEAD blob with an empty git diff HEAD)
Acceptance notes
ifNotRecordedis not described in the three tool descriptions; the sentence states its own instruction. The card's ask cards (#35113) are outside this PR's file surface.aggregate_recordsreads the served object a second way for option order and currency (servedFieldsOf, landed in this card's PR 2, throughservedObjectDefinitionOf); this PR readsdescribeObject, which tells an unserved object (null) from one it cannot read and leaves the search companion out, which that helper does not.pnpm check:dual-build-cjs-loadslocally: PREREQUISITE NOT MET (needs a full workspace build); CI runs it.Verification
Derived gate families (dispatch-gates --commands, head e4c3aa0)
76 derived, 75 exit 0, 1 NOT MEASURED (
pnpm check:dual-build-cjs-loads, exit 3, no full build).dispatch-gates --ran: 76 accounted, 75 run, 1 NOT-MEASURED. After merging origin/main (ee70211) re-run:check:type-check-coverage,check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,check:nul-bytes,check:doc-authoring,check:issue-citations,check:test-source-alias,check:cross-package-test-inputs,check:published-filesall exit 0;check:type-check-debthit the local 300 s timeout (exit 124, NOT MEASURED there; exit 0 at e4c3aa0).overlap-check.mjsbefore each push.Generated by Claude Code