Skip to content

fix(service-analytics)!: query_dataset refuses measures and dimensions the dataset does not declare - #33958

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-A3-33745
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-A3-33745

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #33745

Clause-②: no (narrowing) — query_dataset stops accepting measures and dimensions the dataset does not declare; one CONTRACT_REVIEW_TIER review owed before the queue
Metadata-protocol: none
Skills-docs: none — skills/** and content/docs/** teach no raw field or ad-hoc count through query_dataset; the MCP-served skill text (packages/mcp/src/skill-md.ts) already says selection takes members "by the names list_datasets gives", which is what is now enforced.

维护者速读

  • 改了什么:AI 的数据集查询工具 query_dataset 现在只接受数据集里声明过的指标和维度;传入原始字段(如 amount)、临时的 count 或未声明的维度时,直接返回 400 INVALID_FIELD,并列出该用户可用的指标与维度。
  • 为什么改:之前这类请求会被分析服务临时拼出一个聚合并照常返回,答案的「来源」却把它标成数据集的正式指标(「来源:指标 amount · 数据集 …」),把非指标口径冒充成治理指标;ADR-0149 规定数据集是唯一的声明定义。
  • 风险与回滚:对 AI/MCP 调用方是收紧(BREAKING):以前能答的未声明成员现在被拒,模型需改选声明成员或退回对象查询(非指标口径)。REST 数据集接口、仪表盘、报表不走此工具,不受影响。回滚 = revert 本 PR。
  • 先看:packages/services/service-analytics/src/dataset-tools.ts 的 assertDeclaredMembers(判定与报错文案,只列本用户可见成员);同文件 queryDataset 中调用它的位置(在数据集解析之后、任何读取之前);测试 src/__tests__/dataset-tools.test.ts 新增的 describe 块。
  • 两分钟验证:pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dataset-tools.test.ts,预期 43 个用例全部通过,其中「refuses a member the dataset does not declare」一组 11 个。
  • 需要你做的:无,席位落地(落地前欠一次 CONTRACT_REVIEW_TIER 契约复审记录)。

What changes

  • createDatasetTools (@objectstack/service-analytics, the one executor behind the product AI's chat tool and the MCP query_dataset on both bridges) judges the selection against the dataset it resolved, after the dataset resolves and before anything is read. A name in selection.measures, selection.dimensions or a selection.timeDimensions entry's dimension that is not one of the dataset's own measures[].name / dimensions[].name is refused 400 INVALID_FIELD with member, param and cube (the dataset name), through invalidMemberError, the envelope the service's member-level refusals already answer. No new error code.
  • The message names the measures and dimensions this caller may use (the catalogue admission list_datasets lists from), never a withheld member or one over an internal field, and points at the D3 fallback (object query tools, 非指标口径).
  • Judged against every declared member, so a declared member the caller may not read still reaches the service's own field gate (403 PERMISSION_DENIED), unchanged. A missing or hidden dataset is still 404 NOT_FOUND first. totals.groupings and order keys are already judged downstream against the selected members.
  • query_dataset's tool description now states the rule.
  • Changeset .changeset/33745-query-dataset-declared-members.md: patch (Metadata-protocol: none), BREAKING banner, ADR-0087 disposition not-required (no-migration-prescription).

Tests

  • New top-level describe('query_dataset refuses a member the dataset does not declare') in packages/services/service-analytics/src/__tests__/dataset-tools.test.ts: a raw field as a measure, the ad-hoc count, a suffix spelling amount_sum, a dataset-qualified pipeline.revenue, an undeclared measure beside a declared one, a raw field as a dimension and as a time dimension — each INVALID_FIELD / 400 with member / param / cube, on both faces (queryDataset and execute), the service never called, no read. Plus: the message names only caller-usable members; a missing or hidden dataset stays NOT_FOUND; two CONTROLs (every declared measure, a derived one included, and dimensions are served; a declared time dimension reaches the service).
  • Red first on the origin/main executor: 7 failed / 35 passed (before the qualified-spelling case was added).
  • Ablation 1 (the call to assertDeclaredMembers removed, via scripts/ablation-replace.mjs, anchor 1 -> 0): 8 failed / 35 passed; restored, blob equal to HEAD, git diff HEAD empty.
  • Ablation 2 (the caller-visible filter on the named members widened to every declared member): 1 failed (expected ... not to contain 'margin_total'); restored the same way.

Acceptance notes

  • Hypothesis readings: H1 held (on origin/main the executor served measures: ['amount'], ['count'], dimensions: ['amount'], pipeline.revenue and pipeline.stage, each with provenance citing the raw name as a member). H2: the MCP tool (HTTP and stdio bridges, packages/runtime/src/domains/mcp.ts) and the chat registry face share this executor, so one refusal covers them; the REST door POST /analytics/dataset/query does NOT go through it (it calls AnalyticsService.queryDataset directly) and is not changed: it serves dashboards, reports and ad-hoc selections, and the card's ruling names the tool's executor. H3: a dataset declares no implicit count; count is minted by the service's inferMeasure, so it is refused here. H4: INVALID_FIELD / 400 (ADR-0149 D2 lists it among the codes the tool may answer; the tool invents no code).
  • A dataset.member qualified spelling of a DECLARED member is refused too: it is not a name list_datasets lists, and its provenance used to cite the raw spelling with no label. Called out in case a consumer relies on it.
  • The REST door's closed-member question and the ADR-0149 D2 line are on analytics: the REST dataset door still answers measures and dimensions the dataset does not declare (query_dataset refuses them since #33745) — close it, or say the closed set binds the AI tools only #34005 (maintainer decision).

Dogfood battery (head 3f717733a13e3d0b4cbd952afa4148c5b35b196c)

  • Local run: NOT MEASURED (the shared verify lock was held by long sibling suites; five attempts ended queue-timeout 99).
  • The battery of record is the merge group's required Dogfood Regression Gate, accepted as such by the seat (15:54Z condition, reading accepted 15:57Z). Its selector runs the full dogfood suite for this diff: in ci.yml the job's if: needs filter.outputs.core != 'false', and the filter job forces core to 'true' on merge_group; OS_SEED_ONLY is queue-verdict.outputs.covered == 'true', and queue-verdict runs on push only, so on merge_group all three shards run turbo run test --filter=@objectstack/dogfood in full. @objectstack/dogfood depends on @objectstack/service-analytics, so its test hash moves with this diff (no cache hit).
  • The tree it judges is this head merged into the queue base. A red shard ejects the PR from the queue; it is then reported here with its signature, never re-queued blind.
  • No dogfood path selects an undeclared member today (the only query_dataset callers select row_count / task_count), so the battery guards against regressions rather than exercising the refusal.

Verification

Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh — readings at the final head are in the os-dev report comment on the card. Head 3f717733 is a711894f with origin/main merged (net diff byte-identical, same patch-id).

🤖 Generated with Claude Code

… the dataset does not declare

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…et's description, add the changeset

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…vel describe in the dataset-tools harness

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
@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 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-analytics, touching 4 documentable anchor(s).

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

  • content/docs/api/data-api.mdx (via timeDimensions (literal, a string literal in assertDeclaredMembers))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via timeDimensions (literal, a string literal in assertDeclaredMembers))
  • content/docs/releases/v17/17-4.mdx (via timeDimensions (literal, a string literal in assertDeclaredMembers))
  • content/docs/releases/v17/17-6.mdx (via timeDimensions (literal, a string literal in assertDeclaredMembers))
  • content/docs/releases/v17/17-7.mdx (via timeDimensions (literal, a string literal in assertDeclaredMembers))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 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 — 10 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 03b4d2d1f49fdb8cc4f0004724979305d8902266 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 03b4d2d1f49fdb8cc4f0004724979305d8902266

⚠️ 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 03b4d2d1f49fdb8cc4f0004724979305d8902266 → 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

domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh

Request: review · PR #33958 · area S2 (A3) · Fixes #33745 · head a711894f6c030e88c8a8d23db674ad578f881080 · reviewer review-b

  • Face: narrowing declaration (Clause-②: no (narrowing); query_dataset refuses undeclared measures/dimensions with 400 INVALID_FIELD), so one CONTRACT_REVIEW_TIER review is owed before the queue. No packages/spec/**, no governed text.
  • os-dev report 6897049026 on Dataset executor: query_dataset accepts measures and dimensions the dataset does not declare (raw fields cited as metrics) #33745. CI at head: all success. 189 changed lines, 3 files.
  • Points for the reviewer: the REST door POST /analytics/dataset/query is left open on purpose (it serves dashboards and reports and has no provenance block; noted, not filed); a dataset-qualified spelling (pipeline.revenue) is refused too; dogfood battery NOT MEASURED (verify lock), and no dogfood path selects an undeclared member.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review claim · head a711894 · 2026-11-15T15:46Z

Contract-review-claim: session_01QsR2jTyY9BGjj9WBi7QgH6 · head a711894 · 2026-11-15T15:46Z

review (review-b, areas S2+S4): the CONTRACT_REVIEW_TIER record (face: narrowing declaration, query_dataset refuses undeclared measures and dimensions with 400 INVALID_FIELD) and the verdict follow on this PR.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a711894f6c030e88c8a8d23db674ad578f881080
Local-runs: none
Scope: packages/services/service-analytics/src/dataset-tools.ts, packages/services/service-analytics/src/tests/dataset-tools.test.ts + packages/services/service-analytics/src/analytics-service.ts, packages/services/service-analytics/src/dataset-executor.ts, packages/services/service-analytics/src/dataset-refusal.ts, packages/services/service-analytics/src/tests/preview-undeclared-measure-parity.test.ts, packages/core/src/package-scoped-resolution.ts, packages/spec/src/api/analytics.zod.ts, packages/spec/src/ai/dataset-tools.zod.ts, packages/rest/src/analytics-dataset-ai-tools-parity.test.ts, packages/mcp/src/skill-md.ts, packages/qa/dogfood/test/dataset-package-scoped-readers.dogfood.test.ts, docs/adr/0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md, docs/adr/0021-analytics-dataset-semantic-layer.md (the files after + are outside the diff: read, never reviewed)

Inputs read: card #33745 (body and all four comments), PR #33958 (body, file list, net diff against merge base 895783a1), the check-runs on the head. Three files in the diff; .changeset/** is read for ② only.

① Derived judgments

  1. query_dataset accept-set, measures: narrowed. Right. A name in selection.measures that is not one of the resolved dataset's measures[].name is refused 400 INVALID_FIELD before service.queryDataset is called. That removes four spellings the service used to mint (mintCallerMeasures / inferMeasure in analytics-service.ts): count, a bare raw field, a suffix spelling such as amount_sum, and a dataset-qualified spelling. Declared derived and duration measures are in dataset.measures, so they stay served (the CONTROL pins a derived one).
  2. query_dataset accept-set, dimensions and timeDimensions[].dimension: narrowed. Right. Same rule against dimensions[].name. compareTo.dimension needs no check of its own: the executor already requires it to name a selected time dimension (dataset-executor.ts, the compareTo resolver), and those are now judged. order keys and totals.groupings are judged by the executor against the selected members (dataset-executor.ts line 1246 and the spec's own order docblock), as the new docblock claims. runtimeFilter fields are not judged; a filter is not cited as a metric or a grouping, so that is outside the card.
  3. Dataset-qualified spelling of a DECLARED member (pipeline.revenue): now refused. Right, and it is a second narrowing the card's examples do not name. The catalogue lists bare names and the spec says selection.measures takes the name list_datasets lists (DatasetToolCatalogMeasureSchema.name), so the qualified form was never a listed name; the changeset calls it out.
  4. Refusal envelope: no new code. Right. invalidMemberError with member / param / cube; ADR-0149 D2 lists INVALID_FIELD among the codes the tool may answer.
  5. Refusal ordering: unchanged ahead of the new check. Right. Empty measures (400 VALIDATION_FAILED), failed or degraded read (503), unresolved admission (503), two admitted package holders (409) and missing or hidden dataset (404) all answer before assertDeclaredMembers. A declared member the caller may not read still reaches the service's field gate (403).
  6. What the refusal discloses: only what list_datasets already lists for this caller. Right. The usable lists are filtered by the admission taken for the resolved dataset. packageScopedHolderSource keeps item identity (package-scoped-resolution.ts line 511), so admissions.get(dataset) finds the admission for a package-held dataset as well as an environment one; were it ever missed, the lists read (none), which fails closed. The 400-versus-403 difference between an undeclared name and a declared but unreadable one existed before this PR (mint refusal versus field gate), so no new existence oracle.
  7. Public surface: the query_dataset tool description gains one sentence. Right. It is the text an MCP client receives with the tool, and it now states the rule the executor enforces. No spec schema, no JSON Schema, no export changes; Metadata-protocol: none is correct.
  8. Other faces: unchanged. Right as a description of the tree. AnalyticsService.queryDataset is untouched, so the REST door, the batch door, dashboards, reports and the draft preview still mint undeclared measures, as preview-undeclared-measure-parity.test.ts (analytics: the draft preview answers a dataset query naming a measure the dataset does not declare as a row count, where the live query refuses it INVALID_FIELD #28172) pins.

② Semver level

  • Changeset .changeset/33745-query-dataset-declared-members.md: @objectstack/service-analytics patch. Correct under AGENTS.md Post-Task Checklist 3: Metadata-protocol: none takes patch, and a non-protocol breaking change "ships patch and keeps its BREAKING banner and ADR-0087 disposition". minor beside none would be refused by check-changeset-no-major.
  • Clause-②: no (narrowing) is on the PR body and the changeset, same words. Correct: served became refused.
  • BREAKING carriers: the ! is on the PR title and the changeset subject; the changeset carries the **BREAKING** banner, says what a caller does instead (pick a declared member, bare name, or fall back to the object query tools), and carries exactly one ADR-0087 marker, not-required (no-migration-prescription). That category is admissible here: it is refused outright only on Metadata-protocol: narrowed, and nothing an author writes or stores changes.
  • Only service-analytics source moves; mcp, runtime and rest bind the executor and are not edited, so one entry is the whole publish.
  • Gate verdicts on the head: Check Changeset success, Lint & Repo Gates success (it carries check-adr-0087-registration and check-changeset-no-major), PR-body guards success.
  • Of the four carriers the seat's ruling F1 names, three are present (!, changeset note, ADR-0087 marker). The fourth, the dogfood battery, is not measured; see ③.

③ Boundary flags

  • REST door left open (dev: H2 false for REST; out_of_scope_findings, "noted, not filed"). Answered: accepted as the scope of this PR, see ④. Escalated: the residual needs a card of its own, not a note. The spec says of both doors that a selection "carries only the dataset's dimension and measure NAMES", and the REST door does not enforce that sentence. Whether to close it is a wider narrowing that touches pinned behaviour (analytics: the draft preview answers a dataset query naming a measure the dataset does not declare as a row count, where the live query refuses it INVALID_FIELD #28172), so it is the maintainer's call.
  • Dogfood battery NOT MEASURED at the head (lock contention). Answered on the tree: this does not block the queue on the evidence. Dogfood Regression Gate is a required context whose shards run in the merge group (AGENTS.md, "Two speeds"), so the queue run is the measurement and a red there stops the landing. The only dogfood callers of the tool select declared measures (row_count, task_count), and the one undeclared-shaped case there (measures: [] with dimensions: ['status']) is still answered by the earlier VALIDATION_FAILED check. Escalated to the seat: this record cannot waive ruling F1. NOT MEASURED is not green, so the seat either reads the queue's shards as the battery F1 asks for, or holds the PR until one local run is taken.
  • Deviation 1 (pins in the shared harness file, not a new file). Accepted: one top-level describe in dataset-tools.test.ts reusing bootWired.
  • Deviation 5 (qualified spelling of a declared member refused). Accepted, ① item 3.
  • Deviation 6 (patch, !, ADR-0087 marker). Accepted, ②.
  • Deviations 2 to 4 (footer, repo-wide lint and full dependent suites left to CI). Accepted: Lint · ESLint and Test Core 1/8 to 8/8 are success on the head.
  • No dogfood test for the refusal (outside the claim's file surface). Accepted for this PR; it belongs on the follow-up card with the parity row below.
  • Implicit count (dev: H3). Checked on the tree: no shipped dataset, skill, prompt or test reaches count through the tool. skill-md.ts teaches members "by the names list_datasets gives"; the QA checklist uses invoice_count; the dogfood suite uses declared count measures; every measures: ['count'] in the repo is on the cube door (/analytics/query), which this PR does not touch. The hotcrm, gallery and docs clones on this machine hold no query_dataset caller. Cloud's ask agent, the named consumer, could not be read from here; the card says it labels the fallback.
  • open_questions: empty. security_findings: none; none found here.

④ Design judgment

The narrowing makes the published design's own refusal real; it does not take a declared capability away.

  • The spec on main declares the selection as names from the dataset: DatasetSelectionSchema documents measures as "Measure names from the dataset (may include derived measures)" and its guidance says the selection "carries only the dataset's dimension and measure NAMES". ADR-0021 calls the dataset a "declarative, closed surface" whose point is that "the AI selects from declared measures/dimensions instead of inventing fields". ADR-0149 D3 requires provenance the model cannot invent, and rule 4 sends a question with no matching member to the object query tools, labelled as not a governed metric.
  • Minting an aggregate for an undeclared name is service behaviour pinned by tests (analytics: the draft preview answers a dataset query naming a measure the dataset does not declare as a row count, where the live query refuses it INVALID_FIELD #28172), not a capability the spec, the catalogue or the tool description ever offered an AI caller. Through the tool it produced the opposite of D3: composeProvenance cited the raw name as a measure of the dataset. Refusing it at the tool is the spec's sentence enforced where the false citation was made.
  • The REST split is coherent. The harm the card names exists only where provenance is composed, and only the tool composes it. ADR-0149 D4's binding statement runs one way ("everything callCtx refuses for the REST door it refuses for the AI") and still holds; nothing in D4 forbids the AI door being stricter, and the member check is not a permission gate placed in front of callCtx. The declared capability, a selection over declared members, answers identically on every face. Closing the service itself would also change dashboards, reports and the preview, which the card did not rule.
  • Tried and held: non-string and duplicate names; a declared dimension named as a measure; a package-held dataset's admission lookup; withheld and internal-field members in the message; compareTo, order and totals as side doors for an undeclared name; ordering against the 404, 409 and 503 answers.

Findings:

  • nit — packages/rest/src/analytics-dataset-ai-tools-parity.test.ts lists what the faces "may differ on, by contract" and names one item (404 versus 403 for an unreadable object). There is now a second by-contract difference and no parity row holds it. The spec docblock and reference page sentence "the AI has no private dialect" is still true of the shape and no longer of the accepted member names. Both are outside the diff: follow-up card, together with ADR-0149 D2 gaining one line for the closed-member rule.
  • nit — the CONTROL "a time dimension the dataset declares reaches the service" uses stage, a string dimension, and swallows the outcome with .catch. It proves the call reaches the service, not that a declared date dimension is served. Accepted deviation: the refusal side is pinned on both faces, and ablation 1 shows the pins bite.
  • nit — when members are withheld from the caller, the refusal lists the usable ones without saying others exist. ADR-0149 D2 wants the model able to say some metrics are not visible to this user; list_datasets still carries membersWithheld, so the information is one call away. Follow-up card.

No must-fix, no should-fix. The two escalations in ③ (the REST-door card, and F1's dogfood battery) are the seat's to act on.

Implemented-by: claude/area-A3-33745
Reviewed-by: session_01QsR2jTyY9BGjj9WBi7QgH6

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS

Head-sha: a711894f6c030e88c8a8d23db674ad578f881080
Area: S2 / A3 · Fixes #33745
Contract-review record: #33958 (comment) (CONTRACT_REVIEW_TIER, narrowing face, from an isolated run). Its verdict is PASS: no must-fix and no should-fix.

  1. Narrowing. query_dataset now refuses a measure or dimension the dataset does not declare, with 400 INVALID_FIELD, before the service is called (assertDeclaredMembers in dataset-tools.ts). This makes real the spec's own sentence on main ("Measure names from the dataset") and ADR-0021's closed surface. It takes no declared capability away.
  2. The REST door is left open on purpose. This is coherent: provenance is composed only by the tool, and ADR-0149 D4 still holds in its one direction. The REST door still does not enforce the spec sentence, though, so it needs its own card and a maintainer ruling (seat's call).
  3. Semver and declaration.
    • The changeset is patch with Metadata-protocol: none, which is what AGENTS.md prescribes for a non-protocol breaking change.
    • The ! is on the title and the changeset subject, the BREAKING banner is present, and the ADR-0087 marker is not-required (no-migration-prescription).
    • Clause-②: no (narrowing) matches the diff.
  4. Dogfood battery: NOT MEASURED. This is a condition on arming, not a fail. Ruling F1 makes the battery one of the four BREAKING carriers. The only dogfood callers of the tool use declared measures (row_count, task_count), and the required Dogfood Regression Gate runs in the merge group. Whether that queue run counts as F1's battery, or a local run comes first, is the seat's call before arming.
  5. Implicit count. No shipped skill, prompt, dataset or test reaches implicit count through the tool. Every measures: ['count'] call goes to the cube door (/analytics/query), which this PR leaves unchanged.
  6. Nits. These are accepted deviations or follow-up material and do not move the head:
    • The parity test's by-contract-difference list is now one row short.
    • ADR-0149 D2 should gain a line for the closed-member rule.
    • The time-dimension CONTROL uses a string dimension and swallows the outcome with .catch.
    • The refusal message does not say when further members are withheld from the caller.
  7. File surface. 3 files, all in the declared surface.
  8. Check-runs on the head: 35 success, 16 skipped, 0 failing or pending.

Arm only once the seat has settled item 4.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — FAIL (delta, ACCEPT read per review-checklist.md)

Head-sha: 3f717733a13e3d0b4cbd952afa4148c5b35b196c
Supersedes the verdict 6897184709 (head a711894f). The contract-review record 6897170965 (PASS) still covers this head:

  1. The head moved by a merge of origin/main only. The PR's net diff against merge base 03b4d2d1 is byte-identical to the reviewed diff: the same 3 files, +183/−6, and every +/− line equal.
  2. REWORK: the dogfood battery is still owed. This is the only blocking item. review-checklist.md requires, for ! or (narrowing), a dogfood_battery before the queue that is pinned to the head, full, and with its reds fixed or reported. Otherwise the verdict is REWORK. The PR body still says NOT MEASURED. The seat's 15:54Z condition stands: the merge-group Dogfood Regression Gate counts only if its selector runs shards for this diff, and otherwise a full local run on this head comes first. Either one clears this item, cited in the PR body with the head sha.
  3. Skills-docs: none — … is present. Its reason holds: packages/mcp/src/skill-md.ts already teaches members "by the names list_datasets gives".
  4. Check-runs on this head: 21 success, 16 skipped, 12 in progress, none failed. Arm only once all are green.

Once the battery is cited, only the battery line gets a re-read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS (delta)

Head-sha: 3f717733a13e3d0b4cbd952afa4148c5b35b196c
Supersedes the delta FAIL 6897319889 on this head. Contract-review record 6897170965 (PASS) covers it, and the net diff is byte-identical to the reviewed head.

  1. Dogfood battery: settled by the merge-group run, under the seat's 15:54Z condition. I read .github/workflows/ci.yml on origin/main:
    • The core output is 'true' on merge_group (line 329). The three dogfood shards therefore run on every queue entry, the full suite with no affected-only filter (lines 121–143).
    • queue-verdict is skipped on merge_group (line 194), so no borrowed verdict stands in for the shards.
    • @objectstack/dogfood depends on @objectstack/service-analytics, so the shards exercise this diff.
    • The required Dogfood Regression Gate thus measures this head in the queue, and a red there ejects it. The ACCEPT notes this as the battery.
  2. Nothing else is open. The four nits from the record are accepted deviations or follow-ups, and S2 files the REST-door card for the maintainer's decision.
  3. Check-runs on this head: 24 success, 16 skipped, 9 in progress, none failed. Arm only once all are green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh

席位核对

Head-sha: 3f717733a13e3d0b4cbd952afa4148c5b35b196c(a711894f 合入 origin/main,净 diff 同 patch-id)· 读于 2026-11-15T16:21Z

  • 形态:query_dataset 执行器在数据集解析之后、任何读取之前拒绝未声明的指标/维度(400 INVALID_FIELD,经既有 invalidMemberError,不新增错误码);3 个文件 +183/-6。Fixes #33745。
  • 前提实测:H1 在 origin/main 执行器上复现(原始字段、临时 count、pipeline.revenue 均被当作指标服务并写入来源);新增用例红先 7 failed,消融两次各自转红后还原、git diff HEAD 为空(见 PR 正文)。
  • 门禁 check-runs:37 success / 18 skipped / 0 failure,含 Test Core (1/8–8/8)、Type Check · workspace、Check Changeset、Lint & Repo Gates、PR-body guards、Governed Surface Queue Guard、Dogfood Regression Gate、Test UI、Live E2E UI。
  • 契约复审:收窄面(Clause-② no (narrowing))→ CONTRACT_REVIEW_TIER 记录 PASS 6897170965;review-b 复审 PASS 6897184709,增量 PASS 6897344953(现 head)。
  • 接受的偏差:本地 dogfood 未测(共享锁占用);电池以 merge group 的 Dogfood Regression Gate 为准(merge_group 上 filter.core 强制为 'true'、queue-verdict 仅 push,三分片全量;dogfood 依赖 service-analytics,无缓存命中)。红分片即出队并在此报签名,⛔ 不盲目重排。
  • 范围外去向:REST 数据集入口 POST /analytics/dataset/query 是否同样收紧,及 ADR-0149 D2 措辞 → analytics: the REST dataset door still answers measures and dimensions the dataset does not declare (query_dataset refuses them since #33745) — close it, or say the closed set binds the AI tools only #34005(needs-user-decision,席位批次)。Skills-docs: none。
  • 落地条款:check-governed-merges.mjs --pr 33958 = NOT governed,189 行 ≤ 3000;BREAKING 横幅 + ADR-0087 not-required (no-migration-prescription) 在 changeset。区内落地:ready + auto-merge。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset executor: query_dataset accepts measures and dimensions the dataset does not declare (raw fields cited as metrics)

1 participant