Repository navigation
fix(analytics): a grouping or time word with only a near dimension does not stop a matched measure - #35156
Conversation
…es not stop a matched measure The list_datasets nextStep note asked the user about any word with candidates, including a word whose candidates are all dimensions, so 「按行业看销售额」 got a question back. Such a word is now offered as a possible grouping and never asked about; a word with a measure among its candidates keeps the question. The list_datasets description and the MCP initialize rule state the scoped rule in the same words. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 19 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 6470a6dc6f986504b2cb2589a7078223587354d7 && git checkout 6470a6dc6f986504b2cb2589a7078223587354d7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 348340734a935b304af47824cb20ece502869757 9c885ebac598533a4c07ba9ef2709bc28147b1c8 && git checkout -B drift-repro 348340734a935b304af47824cb20ece502869757 && git merge --no-ff 9c885ebac598533a4c07ba9ef2709bc28147b1c8
node scripts/docs-audit/affected-docs.mjs --json 348340734a935b304af47824cb20ece502869757
|
|
repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8 Final green head · 2026-11-18T08:56Z: Seat reading of the dev's open question (a lone word whose candidates are all dimensions keeps The governed copies of the rule (ADR-0149 D3 note, |
|
repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8 Contract-review-claim: session_01JQwxbWDsbbJizuYnDwBxT8 · head |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 full · REWORK (PR body only; the code has nothing to fix) · Head-sha: Net diff against merge base Must fix
Should fix (seat-side, not this diff)
Checked, holds
Nits (no change asked)
Not mine, still owed before landing
|
|
repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8 Contract reviewServed-tier: Inputs read: card #35005 body and its three comments (triage 6963243189, claim 6972020316 with the narrowing Premise, dev report 6973197402); PR #35156 body, file list (6 files, +286/-28), the net diff against merge-base ① Derived judgmentsThe diff changes no accepted input and no output shape. It changes three texts that reach a model: the
② Semver level
③ Boundary flags
Findings S1 (should-fix) — N1 (nit) — The ask clause beside the shared sentence is worded differently in the two doors. They mean the same thing, and the scoped sentence the card requires is identical and pinned. N2 (nit) — The per-term cap of 5 (measures before dimensions within each dataset, dataset by dataset) can cut a later dataset's measure candidate and make a word read as grouping-only. The note matches what the answer lists, so this is noted only. N3 (nit) — #35158 should treat ADR-0149 rule 1's "(… never acted on)" as owed, not optional. No must-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8 Contract reviewServed-tier: Delta round on the same head. I re-read the PR head (still ① Derived judgmentsNo change to the diff, so no new derived judgment. The PR body now opens ② Semver levelUnchanged: ③ Boundary flags
Findings S1: closed N3: closed No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 body re-read · ACCEPT · Head-sha: The head commit is the same one my REWORK read, so the code findings in 6973888624 stand. This re-read covers the PR body and the items carried to the card. REWORK items
Recorded deviation (the seat owns it)
Still owed before landing
|
|
repo:objectstack#1 · os-warren · session_01JQwxbWDsbbJizuYnDwBxT8 Landing · 2026-11-18T09:07Z · head
Status: ready + auto-merge. |
Part of #35005
Clause-②: no
Metadata-protocol: none
维护者速读
list_datasets的nextStep.note不再为「候选全是维度」的词追问。「按行业看销售额」里 销售额 精确命中、「按行业」只靠近维度 行业,现在 note 直接让模型计算 销售额,并把 行业 作为「可能的分组」点名,明确说不要就它追问;候选里有指标的词(如单独的「销售」)照旧追问、不计算。list_datasets工具说明和 MCPinitialize规则用同一句话写明这条限定。decision、terms、matches、candidates对任何输入都与改前一致(规范对candidates_only的定义不动)。回滚即 revert 本 PR。packages/services/service-analytics/src/dataset-next-step.ts(readTerm的groupingOnly与candidates_only分支);packages/services/service-analytics/src/dataset-tools.ts(说明文字);packages/mcp/src/mcp-server-runtime.ts(DATASET_SELECTION_RULE)。pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dataset-tools.test.ts,预期 79 个测试全过,其中[#35005]一组 7 个覆盖「按行业+销售额 不追问」与「单独 销售 仍追问」。skills/objectstack-ask的对应句子由单独的domain:skills卡改(治理面,不在本 PR)。What changes
dataset-next-step.ts:readTermkeeps the candidate kind (it was already on the membermemberOfreturns; the type dropped it) and marks acandidates_onlyreading whose candidates are all dimensions asgroupingOnly. The note offers such a word as a possible grouping (groupingCandidateHit+groupingCandidateTail, four locales) and never emits the ask-first sentence for it, underone_measure(left-out words) and undercandidates_only(reported words). A word with a measure among its candidates is unchanged: asked about beside a matched measure, andcandidates_onlywith compute-nothing when nothing matched. When every reportedcandidates_onlyword is grouping-only (a lone "this quarter"), the note offers the grouping and adds the existinggroupingTail(ask which number is meant), as for a word that equals a dimension.terms,matchesandcandidatesare unchanged for every input. The spec definescandidates_onlyas "matched no member and has entries incandidates", so a lone grouping-only word stayscandidates_only(see Acceptance notes).LIST_DATASETS_DESCRIPTIONandDATASET_SELECTION_RULEboth now carry the identical sentence "A word whose candidates are all dimensions is at most a possible grouping: never ask about it, and it never stops a matched measure.", and scope the ask-back to "a word with a measure among its candidates".patchchangeset for@objectstack/service-analyticsand@objectstack/mcp.Tests
service-analyticsdataset-tools.test.ts: a new[#35005]describe over a dataset with one 销售额 / Revenue measure, a Churn Rate measure, and Industry (行业) / Quarter (季度) dimensions. Pins: 「按行业」+销售额 isone_measure, no ask-first sentence, grouping offered,candidatesstill listsdimensions.industry(four locales); "this quarter"+"revenue" and 本季度+销售额 likewise; bare 销售 stillcandidates_onlywith compute-nothing (four locales); revenue+churn still asks about churn (four locales); a word near both a measure and a dimension keeps the question; both kinds at once; a lone "this quarter" keepscandidates_only, offers the grouping and asks which number. Plus a description pin for the scoped sentence.mcpinitialize-selection-rule-34686.test.ts: theinitializerule and the reallist_datasetsdescription (fromgetDatasetToolDefinitions) both contain the scoped sentence, and the unscoped form is gone from both.const groupingOnly = decision === 'candidates_only' && offered.every((m) => m.kind === 'dimensions');replaced byconst groupingOnly = false;viascripts/ablation-replace.mjs(anchor 1 to 0, blob bfd1844761e7 to df278719790e): 4 of the 7 new pins red (the grouping ones); the bare-measure, churn and mixed-kind controls stayed green as they should. Restored: blob equals HEAD,git diff HEADempty. The suite imports the executor by relative path, so no dist is involved.Acceptance notes
no_measureinstead ofcandidates_only. The spec'sDatasetNextStepDecisiondescribesno_measureas "has no entry incandidates", so that relabel would change the published meaning of a decision value. This PR keeps the decision and scopes only the note; whether to relabel is a question for the seat.skills/objectstack-ask/SKILL.mdstep 2 still asks for every word with candidates. Both are governed surfaces left to the follow-updomain:skillscard named in the claim.service-analytics. The scenario cards (docs/qa/scenarios/*.json) belong to the eval seat and are not touched here.Verification
Local runs at 9c885eb
pnpm --filter '@objectstack/mcp^...' build: VERDICT command-exit 0.pnpm --filter @objectstack/service-analytics test: Test Files 218 passed (218), Tests 5592 passed, 335 skipped.pnpm --filter @objectstack/mcp test: Test Files 71 passed (71), Tests 1267 passed (1267).pnpm --filter @objectstack/service-analytics typecheckandpnpm --filter @objectstack/mcp typecheck(which includescheck:test-typecheck): exit 0. Both edited test files are in their package's tsc program (--listFiles).dispatch-gates --commandsderived 70 families; all 70 run,--ranreconciliation: 69 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, PREREQUISITE NOT MET: it reads every package's dist and only the mcp closure was built). CI runs it.overlap-check --branch=HEAD: VERDICT clean exit 0 (origin/main and feat(mcp): the open draft door saves and discards drafts, and each save answers with its publish verdict #35103 merge cleanly).Generated by Claude Code