Skip to content

Commit f76de5a

Browse files
committed
docs(adr): ADR-0149 D3 scopes the ask-back to a term with a measure candidate
An amendment note after rule 5 records the sentence the list_datasets description and the MCP initialize rule already carry: a word whose candidates are all dimensions is at most a possible grouping, never asked about and never a stop for a matched measure. Two sentences that stated the question for every candidate are amended in place (rule 1's parenthesis, and the third point of the candidates note), and the new note quotes what they first said. No decision beyond the shipped texts. Claude-Session: https://claude.ai/code/session_016WV4d1Dv2AVwokgRqfdKp2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent ffac85a commit f76de5a

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎docs/adr/0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Both `DatasetMeasureSchema` and `DatasetDimensionSchema` gain two optional keys.
148148

149149
The rule is stated once here and carried in three places: the tool descriptions (for MCP clients), cloud's planner (the product's enforcement), and the D5 evaluation (the measurement).
150150

151-
1. **Normalize** the question's candidate terms and every match target the same way: NFKC, case-fold, trim, collapse whitespace, fold `_` and `-` to a space. Match targets are a member's `name`, its `label` in every locale, and each `synonym`. Equality after normalization is a **hit**; a substring, a stem or an embedding neighbour is **not** a hit (it may be offered in rule 3's question, never acted on).
151+
1. **Normalize** the question's candidate terms and every match target the same way: NFKC, case-fold, trim, collapse whitespace, fold `_` and `-` to a space. Match targets are a member's `name`, its `label` in every locale, and each `synonym`. Equality after normalization is a **hit**; a substring, a stem or an embedding neighbour is **not** a hit (it may be offered in rule 3's question, never acted on; scoped by the amendment note of 2026-11-19 after rule 5: a word whose candidates are all dimensions is at most a possible grouping, never asked about).
152152

153153
> **Amendment note (2026-11-17, [#34870](https://github.com/objectstack-ai/objectstack/issues/34870) — PR #34928): "its `label` in every locale" means every locale of an inline label map, plus the one translation-bundle label resolved for the caller's locale; a word in another language hits only as an authored `synonym`.**
154154
> Ruled by the maintainer on [#34720](https://github.com/objectstack-ai/objectstack/issues/34720), option text verbatim 「A+C 本语言标签+同义词」 (ruling record [`6946563869`](https://github.com/objectstack-ai/objectstack/issues/34720#issuecomment-6946563869)). This note qualifies the label target and changes no other word of rule 1: the normalization, equality as the only hit, and the `name` and `synonym` targets stand as written.
@@ -171,12 +171,23 @@ Why the platform computes `matches` instead of leaving the whole rule to the mod
171171
>
172172
> - **What counts as a hit does not change.** This note changes no word of rule 1: equality after normalization is a hit, and a substring, a stem or an embedding neighbour is not. `matches` is computed as before, and rules 2, 3 and 5 read it as before.
173173
> - **A term with no hit in any listed dataset gets `candidates`.** The `list_datasets` output of [D2](#d2--two-tools-one-definition-one-executor-two-transports) gains one optional member beside the ones D2 lists, which stand as written. For such a term it names the members the platform offers as possible readings, each a pointer `{ term, dataset, member }` to a member listed in the same answer, so only a member this caller may read is ever offered. This is rule 1's parenthesis as a platform answer: a non-hit "may be offered in rule 3's question, never acted on". The list carries no score. Its order is the listing order: terms as sent, datasets as listed, a dataset's measures before its dimensions (rule 5: a dimension alone is not an answer), held to `LIST_DATASETS_MAX_CANDIDATES_PER_TERM` per term. A term with a hit has no candidates and an answer with none to offer carries no `candidates` key, so an answer in which every term sent has a hit, like an answer to a call that sent no `terms`, is what it was. Which members are near enough to offer is the executor's rule; this record and the spec say what a candidate is, not how it is found.
174-
> - **With candidates, the AI asks in rule 3's form and acts on none.** The question lists each candidate's label, dataset label and description, as rule 3 lists several hits. The AI does not pick one, does not prefer the first, and does not treat a candidate as a hit under rule 2: the choice is the person's.
174+
> - **With a measure among a term's candidates, the AI asks in rule 3's form and acts on none.** The question lists each candidate's label, dataset label and description, as rule 3 lists several hits. The AI does not pick one, does not prefer the first, and does not treat a candidate as a hit under rule 2: the choice is the person's. A term whose candidates are all dimensions gets no question: it is at most a possible grouping, under the amendment note of 2026-11-19 below, which scoped this point.
175175
> - **With no candidate, rule 4 is unchanged.** No hit and nothing offered is the labelled fallback to the object query, as written; [M2](#m2--what-the-ai-does-when-no-dataset-covers-the-question) stays ruled A.
176176
> - **Rule 4 is named here because its path changes and its matching does not.** A term with no hit used to go straight to the fallback; a clarifying question may now come first. The term still has no hit, so rule 4 still governs it when the question settles nothing.
177177
> - **Why the platform offers them, and not only the client's wording.** A tool result is read by every client that made the call; a tool description is read only after the client chose the tool, and a skill only when it is installed and triggered (the grounds of fork F1 on #34691). It is the reason given above for `matches`: every consumer gets the same answer.
178178
> - **State on `main`.** This PR declares the shape and changes no executor. The executor that fills `candidates`, and the tool descriptions that carry this branch to the model, land with [#34763](https://github.com/objectstack-ai/objectstack/issues/34763); until then no answer carries the key. In [D6](#d6--enforce-or-remove-every-key-names-its-reader-in-its-first-implementation-card)'s terms the pending half is named here, by card, and not hidden.
179179
180+
> **Amendment note (2026-11-19, [#35158](https://github.com/objectstack-ai/objectstack/issues/35158) — this PR): the question of the note above is owed only for a term with a measure among its candidates; a term whose candidates are all dimensions is at most a possible grouping.**
181+
> Scoped on [#35005](https://github.com/objectstack-ai/objectstack/issues/35005), a card filed on the maintainer's word, verbatim 「立卡」; the card's scope reads "a candidate on a dimension or time word never blocks a matched measure, and is at most offered as a grouping". The executor and the two texts that carry the rule to a model apply it on `main` since PR #35156 (commit `7ed18b50e1`, contract review record [`6973927307`](https://github.com/objectstack-ai/objectstack/pull/35156#issuecomment-6973927307)). This note brings the record to the sentence those texts share and decides nothing they do not already say.
182+
>
183+
> - **The sentence.** `list_datasets`' description (`packages/services/service-analytics/src/dataset-tools.ts#LIST_DATASETS_DESCRIPTION`) and the MCP `initialize` rule (`packages/mcp/src/mcp-server-runtime.ts#DATASET_SELECTION_RULE`) both read: "A word whose candidates are all dimensions is at most a possible grouping: never ask about it, and it never stops a matched measure." A test holds the two to that one sentence (`packages/mcp/src/initialize-selection-rule-34686.test.ts`).
184+
> - **A term with a measure among its candidates keeps the note above.** The AI asks in rule 3's form, lists that term's candidates and acts on none of them. A measure hit on another term is still answered under rule 2, beside the question; with no measure hit, nothing is computed until the person answers.
185+
> - **A term whose candidates are all dimensions is a possible grouping, not a question.** It is the ordinary shape of a grouping or time word: 「按行业」 near a dimension labelled 行业, "this quarter" near one named `quarter`. Asked 「按行业看销售额」, a person whose measure word had its hit was still asked about the grouping word. The AI now asks nothing about such a term, answers the measure hit as rule 2 says, and groups the answer only as the question asks.
186+
> - **Rule 5 still holds for it.** A possible grouping is not a number. Without a measure hit the AI still needs one, or asks which number is meant: a question about the missing measure, not about the term.
187+
> - **What does not change.** What counts as a hit (rule 1), and `matches`. The `candidates` list: it names both kinds as before, a dataset's measures before its dimensions, and no candidate becomes a hit. The four `nextStep.decision` values: a term whose candidates are all dimensions is still in `candidates_only`, and only the sentence the executor writes for it differs (`packages/services/service-analytics/src/dataset-next-step.ts#composeDatasetNextStep`). Rule 4, for a term with no hit and no candidate.
188+
> - **Sentences amended in place, and what they first said.** Rule 1's parenthesis read "(it may be offered in rule 3's question, never acted on)": neither half holds for a dimension offered to such a term, which is put in no question and may be the grouping the question asked for. The third point of the note above opened "With candidates, the AI asks in rule 3's form and acts on none." and ended at "the choice is the person's." Two sentences that name the question in passing stand as written and are read with this scope: the headline of the note above ("offered for a question") and the option C point of the note under rule 1 ("offer such a word for a question").
189+
> - **State on `main`.** The executor and both texts landed with PR #35156. This PR changes no executor and no shape. It brings three copies to the same sentence: the `candidates` description of `packages/spec/src/ai/dataset-tools.zod.ts#ListDatasetsOutputSchema`, the doc comment of `packages/spec/src/ai/dataset-tools.zod.ts#DatasetTermCandidateSchema`, and step 2 of the published ask skill (`skills/objectstack-ask/SKILL.md`), which `GET /mcp/skill` serves.
190+
180191
### D4 — Permissions: the tools add no gate and bypass none
181192

182193
Measured in [Context](#the-executor-and-its-gate-chain-measured-on-originmain). The binding statements:

0 commit comments

Comments
 (0)