Repository navigation
feat(service-analytics): a word that names the field a filtered measure candidate sums is answered from that field (ADR-0149 D3 note of 2026-12-01) - #38869
Conversation
…re candidate aggregates is answered from the field (ADR-0149 D3 note of 2026-12-01) — WIP Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…te of 2026-12-01 Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…l read over describe_object's localized object Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…over describe_object's localized object Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…12-01 to the candidates description and the initialize rule Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
… and note descriptions Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
… ADR-0149 D3 note of 2026-12-01 Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…ling — one short host clause; pin the per-candidate take-out (Billable vs Total hours) Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 2 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 — 192 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 8baed4537b6734481cad9bff76917113215e4484 && git checkout 8baed4537b6734481cad9bff76917113215e4484
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 61388b8a82b6ed7ed652f7f1599fe89baf38615f && git checkout -B drift-repro 3c617a28ea51f0d4a2d11f180dc3ee57106a7151 && git merge --no-ff 61388b8a82b6ed7ed652f7f1599fe89baf38615f
node scripts/docs-audit/affected-docs.mjs --json 3c617a28ea51f0d4a2d11f180dc3ee57106a7151
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ Final green head · 2026-12-01T08:23Z · zone osa-ai
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head d33cb9b · 2026-12-01T08:25Z |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract reviewServed-tier: PR #38869, PR 2 of card #38551 (the executor). Read: the card and its 11 comments, the PR body and file list, the net diff against merge-base Check-runs on this head: 63 success, 14 skipped, 1 failure. The failure is the 07:46Z run of ① Derived judgments
② Semver level
Clause-②: no — agreed. The spec change is description text only. ③ Boundary flagsDev flags (report 7304497446, deviations):
Carried to the seat (not findings on this head):
SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join. The label read is a metadata read: one object read per object per request on HTTP, one per field per answer on stdio. Other author: none. The PR's ④ Design judgment
S1 (should-fix) — the conditional "which number" sentence is dropped beside a field-answered word, and the note says the 2026-11-24 note "applies as written" there. The note's point "Beside a grouping word" reads: "the note of 2026-11-24 applies as written ... What this note adds there is the field and the mention." The 2026-11-24 note writes one conditional sentence beside every fallback next to a grouping word ( The rest of the file agrees. Nothing left:
Nits:
No must-fix. One should-fix, S1. Three nits, N1 to N3. Landing condition, for the seat: this PR lands only after PR #38848 merges, and this record covers agreement with the note at Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review + L2 adoption · PR #38869 (#38551 PR 2) · head d33cb9b · 2026-12-01T08:32ZL1: not yet ACCEPT. There is one should-fix from the L2 and one paper item. L2 (contract-review tier, record 7305456037): PASS with S1 open. I adopt the record. It is owed because the diff touches
L1 paper item (P1, should-fix, does not move the head): the PR says
For the seat (not blocking):
What I checked (pass):
L2 brief (as given to the isolated reviewer)Contract review brief — PR #38869 @
|
…eside a field-answered word; narrow field labels to strings; exact comments and candidates description (L2 on #38869) Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…eld-term-executor Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
…didates description (N1) Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ Final green head · revision 1 · 2026-12-01T10:43Z · zone osa-ai
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head 61388b8 · 2026-12-01T10:44Z |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract reviewServed-tier: Delta review of PR #38869 (card #38551), after the record on The delta touches six of the PR's files: Check-runs on this head: 64 success, 14 skipped, 0 failed. The note: PR #38848 merged from head ① Derived judgments
② Semver levelUnchanged and still right: Clause-②: no — agreed. ③ Boundary flags
SQL push-down: no finding. The delta adds no query. ④ Design judgmentS1: closed. Both conditions on N1: closed. The N2: closed. N3: closed. New in this delta:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 delta + L2 delta adoption · PR #38869 · head 61388b8 · 2026-12-01T10:48ZL2 delta (record 7308755658): PASS. S1 is closed, N1 to N3 are closed, and there is no must-fix or should-fix. N4, a corner the note does not speak to, is a new nit: accepted, or a follow-up card. I adopt the record. L1: ACCEPT on the code. One paper item does not move the head:
Checked:
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 confirm · PR #38869 · head 61388b8 (unchanged) · 2026-12-01T10:50ZP2 is closed, and L1 is ACCEPT on this head. The PR body now says three things: #38848 has merged and main is merged in at cabeb27, only the outright question is withheld, and the two-minute check expects 15. The Chinese 速读 line no longer asks for approval of #38848 first. The zone accepts N4 as a deviation. With L2 delta 7308755658 clean, nothing is open. The PR goes to the seat. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS 席位核对ACCEPT — PR #38869 @
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ 落地
State change: ready for review + auto-merge, by zone osa-ai (2026-12-01T10:53Z); |
…asetToolsDeps widening as Clause-② yes (objectstack-ai#38937) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBG4YD4RMAt72Ga5PdYYZDAQ)_ Refs objectstack-ai#38551 Clause-②: no Metadata-protocol: none ## 维护者速读 - 只改一行发布说明:已合入的 objectstack-ai#38869 的 changeset 把自己的契约面写成「Clause-②: no」,但它给对外发布的 `@objectstack/service-analytics` 导出接口 `DatasetToolsDeps` 加了一个可选成员 `readFieldLabel`,按主干先例应写成「yes (widening)」。版本级别仍是 patch,代码不变。 ## What changes One line in a pending release note, `.changeset/38551-dataset-term-names-field.md` (added by objectstack-ai#38869, merged 2026-12-01): | | line | |---|---| | before | `Clause-②: no` | | after | `` Clause-②: yes (widening) — `DatasetToolsDeps` gains an optional `readFieldLabel` `` | Why: `DatasetToolsDeps` is exported from the published `@objectstack/service-analytics`, and objectstack-ai#38869 added the optional member `readFieldLabel` to it. Precedent on main: `.changeset/pre/35707-translation-fault-warning.md` declares "`DatasetToolsDeps` gains an optional `logger`" under `Clause-②: yes (widening)`. Flagged by osa-L1-a after the merge; the contract-tier record on objectstack-ai#38869 already covers the face, and the bump level stays patch. The same note's prose already names `DatasetToolsDeps.readFieldLabel`, so only the declaration line was false. This PR's own `Clause-②: no`: it changes release-note text only, no exported face. ## DELIBERATE CORRECTION (objectstack-ai#17712) `check-empty-changeset` refuses this diff by design: `.changeset/38551-dataset-term-names-field.md` exists on the merge base and was not added here. This is the DELIBERATE CORRECTION class, not a collision: the note's declaration line is false, and restoring it from the base would put the false line back. Note corrected: `.changeset/38551-dataset-term-names-field.md` (one line, quoted above). Text-only diff, so the dispatching seat's ACCEPT, quoting before and after, is the confirmation (pm-dispatch references/landing-operations.md). ## Verification `git diff origin/main -- .changeset/` shows the one line above. `node scripts/check-changeset-no-major.mjs` exit 0. `node scripts/check-empty-changeset.mjs` reports the foreign-changeset refusal for exactly this one file and nothing else. `check-governed-merges.mjs`: NOT governed, 2 changed lines. Signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ)_ Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
Fixes #38551
Clause-②: no
Metadata-protocol: none
PR #38848 (ADR note) merged; origin/main is merged in at cabeb27 and the ADR-0149 blob at HEAD equals main's (0d752a3a48).
Claim for this branch: #38551 comment 7305144268 (PR 2 of claim 7301418387).
维护者速读
What changes
Implements the ADR-0149 D3 amendment note of 2026-12-01 (PR #38848, ruling record 7301332152: "A measure candidate whose aggregated field is named by the term is not offered as a candidate to ask back about. The field answers the term under rule 4's labelled fallback, and the measure is mentioned as a narrower declared metric."), with the zone's two later narrowings: only a measure that carries a
filteris taken out (L2 S2 on #38848), and the reading is per candidate (L1 N4 on #38848).packages/services/service-analytics/src/dataset-term-matcher.ts,readDatasetTerms). For a term with no hit, the whole near set is built uncapped; a measure candidate that carries afilterand whose aggregated BASE field the term names (the term equals, or is inside, the field's label in any label handed in, or its name; both sides normalized as rule 1 normalizes) is taken out, and the field is reported (namedFields). Then the per-term cap applies to what is left.findDatasetTermCandidateskeeps its signature and returns the candidates of the same reading.dataset-next-step.ts). No new decision value and no new key. A term left with nothing isno_measure, its note naming the field (object and field name) and mentioning the measure as a narrower declared metric, then the labelled fallback tail. A term left with only dimensions stayscandidates_only: the field sentence, the dimensions offered as a possible grouping, and no outright question on its account; beside a grouping word the conditional sentence of the note of 2026-11-24 is still written (L2 S1). A term left with another measure candidate is asked about what is left, and one more sentence says the field answers only when that question settles nothing. Written in all four locales.DatasetToolsDeps.readFieldLabel, optional). Both hosts wire it from the objectdescribe_objectserves, as this caller is served it: the authored label, and the same object through the/metaobject translation for the answer's locale (the bundle label). HTTP:packages/runtime/src/domains/mcp.ts,datasetFieldLabelRead(readServedObject→servedToCaller→inCallerLocale, each object read once per request), passed todatasetToolMembers. stdio:packages/mcp/src/stdio-data-bridge.ts(servedView.getObject→inServedLocalefor the i18n default locale). The executor reads a label only for a base field that a measure near a sent term aggregates, once per field per answer; a host that omits the member, or a read that throws, tests the field's name only, and thelist_datasetsdescription says so.LIST_DATASETS_DESCRIPTIONandDATASET_SELECTION_RULEcarry one sentence in the same words (pinned equal); the spec'scandidatesandnextStep.notedescriptions and theDatasetTermCandidateSchemadoc say it (descriptions only, no shape change;content/docs/references/ai/dataset-tools.mdxregenerated bycheck:generated --fix);content/docs/data-modeling/analytics.mdxgains one bullet.Defaults named for the seat (not decided by the ADR, set by the zone): a measure over a relationship path (
account.amount),*or no field is never taken out and keeps today's ask (base fields only; no label is read for it). Not covered by the note and kept as today: a term naming different fields through different candidates (nothing is taken out; the field set is counted over every named measure, filtered or not), and a measure with nofilterover the named field (it stays a candidate and is asked about).Tests
packages/services/service-analytics/src/__tests__/dataset-term-names-field-38551.test.ts, every case readingdecision,noteandcandidates: the card's 工时 case (bundle label over an English-authored field), the host-omission control, a throwing read, 销售 near 销售额 over 金额 stillcandidates_onlywith the ask note, the unfiltered measure kept, "Billable hours" taken out beside "Total hours" kept (per candidate), dimension-only candidates byte-identical with and without the label read, dimensions left, another measure left, two fields not covered, take-out before the cap, a relationship-path measure, a left-out field word beside aone_measureword, the grouping-word case (L2 S1), the description (15 cases).packages/runtime/src/mcp-dataset-tools-bridge.test.tsandpackages/mcp/src/stdio-data-bridge.dataset-locale.test.ts: each host's read answers{ authored: 'Hours', translated: '工时' }from the objectdescribe_objectserves; over the REAL executor 工时 isno_measurewith no candidate; the control (no zh-CN field label / anendefault) keepscandidates_onlywith the ask.packages/mcp/src/initialize-selection-rule-34686.test.ts: both doors carry the field sentence in the same words.dataset-tools.test.tskeep their reading unchanged (fixture measures are unfiltered andamountis on two objects).Readings at 61388b8 (revision 1; round-1 readings below where unchanged)
At 61388b8, after the merge of origin/main 2af3d78: service-analytics full test 229 files, 5935 passed / 345 skipped; typecheck exit 0;
dataset-term-names-field-38551.test.ts15 passed; mcp tools-list-weight + initialize-selection-rule + stdio-data-bridge.dataset-locale + mcp-dataset-tools 4 files, 61 passed; runtime mcp-dataset-tools-bridge 16 passed; speccheck:generatedgreen after--fix; 117 of 120 derived gates run and exit 0 (3 left to CI on a missing prerequisite).S1 ablation (
!numberNamedre-inserted on eachnoNumberTailcondition): 1 of 15 red in each branch; restored to the HEAD blob.vitest run src/__tests__/dataset-term-names-field-38551.test.ts src/__tests__/dataset-tools.test.ts(service-analytics, at d33cb9b): 2 files passed, 110 passed / 10 skipped.pnpm --filter @objectstack/service-analytics test(at 68254f1; only description text and one test case changed since): 229 files passed, 5933 passed / 345 skipped.typecheck: exit 0.vitest run src/tools-list-weight-34689.test.ts src/initialize-selection-rule-34686.test.ts(mcp, at d33cb9b): 2 files, 18 passed. Full@objectstack/mcpsuite at 68254f1: 88 files passed, 1 failed (tools-list-weight-34689, 39002 over the 39000 ceiling) — fixed at d33cb9b by a shorter host clause, re-run green.pnpm --filter @objectstack/mcp typecheck: exit 0.vitest run src/stdio-data-bridge.dataset-locale.test.ts(mcp): 16 passed.vitest run src/mcp-dataset-tools-bridge.test.ts(runtime): 16 passed.pnpm --filter @objectstack/runtime typecheck: exit 0 (after building@objectstack/driver-turso, a devDependency the worktree had not built).pnpm --filter @objectstack/spec check:generated: "All 14 generated artifacts are up to date" after--fixregeneratedcontent/docs/references/ai/dataset-tools.mdx.Ablation 1 (the take-out set emptied,
scripts/ablation-replace.mjs, restored to the HEAD blob withgit diff HEADempty): 7 of 13 cases red. Ablation 2 (thefiltercondition removed, every named measure taken out): 1 red, the unfiltered-measure case. Both restored.tools/listweight (open door, 18 tools): before 38569 bytes,list_datasetsdescription 2567; after 38940 bytes, description 2938 (+371); ceiling 39000 unchanged.Acceptance notes
servedToCaller(readServedObject(object))and the bundle label off the same object throughinCallerLocale(translateMetaListoverobject,metaTranslationSources, the localeloadDatasetstranslates for). stdio reads them offservedView.getObject(object)andinServedLocale(the i18n service's default locale).domain:skillscard (noskills/**edit here):skills/objectstack-ask/SKILL.mdstep 1's candidates bullet and step 2's table rows,skills/objectstack-ask/evals/metric-selection-fallback.json, and the regeneratedpackages/mcp/src/ask-skill.generated.ts.Verification
Read first, by risk:
packages/services/service-analytics/src/dataset-term-matcher.ts(readDatasetTerms, the take-out set and the cap loop);packages/services/service-analytics/src/dataset-next-step.ts(readTerm, thecandidates_onlybranch,leftOutSentences);packages/runtime/src/domains/mcp.ts(datasetFieldLabelRead).Two-minute check:
pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dataset-term-names-field-38551.test.ts— expect 15 passed.Signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ
Generated by Claude Code