Repository navigation
docs(skills): add objectstack-ask, a skill for answering business questions over MCP - #34792
Conversation
…stions over MCP Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT · 2026-11-17T11:33ZHead-sha: 4b17fdd 席位核对PR shape. Draft, base Scope vs claim. Ten files, each inside the claim's file surface (widened by Premise corrected 6944554445): Governed / tier. Changeset. Check-runs at 4b17fdd. 70 runs, every one Re-run here at 4b17fdd. The skill against the served text (the area's ask). I read Every name the skill uses exists. Checked at this head: Registration. DISPLAY row, generated README and skills-reference regenerated (count 11 → 12), Value density, read from the customer agent's seat. 1457 tokens, loaded only on its trigger; the two pointer lines (23 and 28 tokens) sit in existing headroom. The description's trigger names the live-MCP setting and excludes metadata building and code queries, so a builder session should not load it. Acceptable for the job. Must-fixNone. Should-fix
Notes
Next: seat L2 at CONTRACT_REVIEW_TIER, then os-zhuang (Tier H). A later push owes an L1-c delta read. |
…y carries
Cases 2, 3 and 6 required meta-wording a correct reply need not use
("which one they mean", "compute nothing yet", an English flag name in
a Chinese reply). Each case now asserts the fixture's own labels, the
question shape, and the user's language. Cases 1, 4 and 5 carried the
same defect in milder form (contract field names, a Chinese token in an
English reply, one exact phrase) and are reworded the same way.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (delta) · 2026-11-17T11:48ZHead-sha: 63c79bc
S1 closed. Re-read every case's assertions as a reply would meet them:
The area's call to keep tool names in Notes (no action owed on this PR).
Check-runs on this head were still pending when read; the area merges |
… hand-over) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (delta) · 2026-11-17T11:49ZHead-sha: 1a8bd8b 1a8bd8b is a merge of |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: PR #34792 for card #34685, read at the head above (a merge of Remainder, the lane seat's ACCEPT at
① Derived judgments
② Semver level
Clause-②: no. Agreed. ③ Boundary flagsDev report 6945937382, deviations:
Dev report 6945937382, open questions:
Dev report 6947110992, open question: keep tool names in Out-of-scope findings: the served text has no near-miss row (carrier #34686); no committed gate checks the SQL push-down: no code path in the diff. The skill's own teaching is on the right side of Prime Directive 5: ④ Design judgment
Holds:
Findings: S1 (should-fix) — Step 2, row 2 drops D3 rule 3's "answer to the word". The row reads "Several measures match (two members, or one word in two datasets) → ask the user which one they mean". Rule 3 is per word: "More than one hit (two datasets, or two members, answer to the word)", and the S2 (should-fix) — the Both fixes change Nits (no action owed on this head; prose faces only, or a carrier):
No must-fix. Two should-fix, S1 and S2, open on this head; their fix earns a delta review, and the delta record names them by id. Implemented-by: VERDICT: PASS |
…ys members Contract review should-fixes on the objectstack-ask skill. - Step 2 rows 1-2 are per word (ADR-0149 D3 rule 3, "answer to the word"): each measured word with exactly one measure computes, so a two-metric question computes both; one word with several measures asks back. - The membersWithheld row says members (measures or groupings), which is what the flag reports; eval case 6 follows. - The fallback row says one near form is not a match either. - Eval case 7 pins a two-metric question. - The skill's token ratchet row is re-measured: 1457 -> 1522, pinned at it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (delta) · 2026-11-17T12:26ZHead-sha: 94affc6
L2 S1 (rows judged per word) — closed. Row 1 now reads "Each word for a thing measured matches exactly one measure → compute; two words with one measure each are two metrics, not a choice: compute both, one L2 S2 ( L2 N1 — closed. Row 5 adds "One near form is not a match either: it selects nothing", the seat's Q1 A in words. Token ceiling 1457 → 1522. Re-run here at 94affc6: Evals. My consistency pass at this head: ids 1–7 distinct, every Served-text alignment. The PR body's Check-runs at 94affc6 when read (12:2xZ): none failed; Note.
Next: seat L2 delta on this head, then os-zhuang. A later push owes an L1-c delta read (merge-only gets a one-line confirm). |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Delta review of record 6947390250 (head 1a8bd8b).
① Derived judgments
② Semver levelUnchanged. The changeset is not in the delta and its text still describes the skill truthfully ("One measure match is computed", "Several matches are a question"). Clause-②: no. Agreed. ③ Boundary flags
④ Design judgmentS1: closed. Row 1 reads "Each word for a thing measured matches exactly one measure", with "two words with one measure each are two metrics, not a choice: compute both, with one S2: closed. The row reads "members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist." That is what N1 of the first record: fixed on the prose face. Row 5 adds "One near form is not a match either: it selects nothing", which is the seat's Q1 A stated outright.
Eval case 7 shape. Same keys as cases 1 to 6 ( Nits (no action owed on this head):
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG 席位记录 · 2026-11-17T12:30ZHead-sha: 维护者速读(终稿)
席位意见:建议批准。两轮修订后判定表与 ADR-0149 D3「按词作答」一致, 席位核对
|
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzfR33NbV51QQU6R6bm
Fixes #34685
Clause-②: no
Metadata-protocol: none
Served-tier: CONTRACT_REVIEW_TIER
维护者速读
objectstack-ask(105 行,1522 token),教已连上 MCP 的客户端怎么回答业务问题;另在objectstack-ai和objectstack-query的聚合规则里各加一行指向它。list_datasets的工具描述和GET /mcp/skill页面里,客户端选工具之前读不到,常常直接用aggregate_records算数而不走指标口径。skills/objectstack-ask/SKILL.md第 2 步的判定表(按词逐个判定;近似词那一行是新规则);scripts/check-skills-token-ratchet.mjs末尾新增的定价行(定价权在维护者);packages/create-objectstack/src/created-summary.test.ts的符号链接用例(目录数过 10 后改走折叠分支)。node scripts/check-skills-token-ratchet.mjs,预期末行「58 authored bundle file(s) within their ceilings」。skills/**文件,Tier H)。What changes
skills/objectstack-ask/SKILL.md. Its reader is a client that answers a question over a live environment through the MCP toolslist_datasets,query_dataset,list_objects,describe_object,query_recordsandaggregate_records. The steps, in order: lift the business words; calllist_datasetswith them asterms, in the user's own words; decide bymatches; compute withquery_datasetand citeprovenance; otherwise fall back to the object tools and open the answer with the 非指标口径 line; say what is missing when the data cannot answer; then the answer-writing rules.skills/objectstack-ask/evals/metric-selection-fallback.json. Seven cases: one for each branch (one match, several matches, near-miss, no metric (labelled fallback), data cannot answer,membersWithheld), and a two-metric question added in fix round 2.DISPLAYrow inpackages/spec/scripts/build-skill-docs.ts;skills/README.mdandcontent/docs/ai/skills-reference.mdxare regenerated bygen:skill-docs. One ceiling row inscripts/check-skills-token-ratchet.mjs, pinned at the measurement.skills/objectstack-ai/SKILL.md(the MCP section) andskills/objectstack-query/rules/aggregation.md.packages/create-objectstack/src/created-summary.test.ts.objectstack-askjoinsSKILLS. The list is now eleven long, aboveCOLLAPSE_AT(10), so the symlink case now asserts on the collapsed line for each link farm (entriesequals the number of links,bytesequals the links' own bytes). The old comment in that test named this as the move to make when the catalog passes ten..changeset/34685-ask-data-skill.md:@objectstack/skillsatpatch.create-objectstackhas no entry, because only its test file moved.packages/mcp/**orpackages/runtime/**.Why
The procedure for answering a business question was written in the
list_datasetstool description and on the served/mcp/skillpage. A client loads a tool's description only after it picks the tool, so a client without a skill often answered fromaggregate_recordsand never reached the governed metric (card evidence). The epic ruling (D5 A, record 6940528935 on the epic card) puts the procedure in the published skills package.Tests
All readings are on head
4b17fddc, with the working tree clean.pnpm --filter create-objectstack exec vitest run --maxWorkers=2 src/created-summary.test.ts(under the verify lock)Test Files 1 passed (1),Tests 12 passed (12); lock lineVERDICT command-exit 0node scripts/check-skills-token-ratchet.mjsnode scripts/check-skills-token-ratchet.mjs --self-testnode scripts/check-skill-compatibility-version.mjsand--self-test@objectstack/mcp 18.xand is not exempt)pnpm --filter @objectstack/spec run check:skill-docspnpm --filter @objectstack/spec run check:skill-examplesmust_containand 13must_not_containentries, 0 violations: everymust_containoccurs in itsexpected_outputand inSKILL.md; nomust_not_containoccurs in itsexpected_outputnode ui/scripts/check-skill-eval-tokens.mjs--listnames noobjectstack-askrow: that gate does not read this bundleNo ablation: the diff changes no behaviour that a test pins. The test edit follows the list length.
Acceptance notes
Alignment with the served text
Skill lines are
skills/objectstack-ask/SKILL.md; served lines arepackages/mcp/src/skill-md.ts(DATASET_TOOL_LINES, 265-291), read atf02f4f63.terms;matchessays which member each names_and-aside), never by similarityquery_datasetquery_records/aggregate_recordsand say the answer is not from a governed metriclist_datasetstool description carriesmembersWithheld: true: say so, never say the metric does not existprovenance, not from memory; explain the number with the measure'sdescriptionEvery name the skill uses, checked against the code
list_datasets,query_datasetpackages/spec/src/ai/dataset-tools.zod.ts:43,45; registered atpackages/mcp/src/mcp-http-tools.ts:2289,2309termsdataset-tools.zod.ts:69matches, withterm,member(measures.NAMEordimensions.NAME),matchedOndataset-tools.zod.ts:161,85-89membersWithheld, datasetobjectdataset-tools.zod.ts:154,153partial,warningon thelist_datasetsanswerdataset-tools.zod.ts:173,177label,descriptiondataset-tools.zod.ts:125,129,149,150datasetName,selectiondataset-tools.zod.ts:217,221selection.measures,.dimensions,.runtimeFilter,.dateGranularity,.order,.limitpackages/spec/src/api/analytics.zod.ts:680,678,687,705,725,732provenance(dataset label, measure labels),truncated,warningon thequery_datasetanswerdataset-tools.zod.ts:270(236-243),272,279list_objects,describe_object({ objectName }), fieldoptions(value and label)mcp-http-tools.ts:2524,2582,2596,2588query_records,aggregate_records, andtruncatedon the aggregate answermcp-http-tools.ts:2860,2955,3039The skill names no
candidatesfield.Where the text departs from the card's starting text
list_datasetsagain withouttermsto read the unfiltered catalogue. The code shows a call withtermsalready returns every dataset the caller may query, with all its members;termsonly addsmatches(packages/services/service-analytics/src/dataset-tools.ts:409-440, line 439). So the skill says the answer already in hand is the catalogue, and that a call withouttermsreturns the same list.metadata.domain: process. The skill teaches no schema, so it carriesSKILL.mdalone, as the README's skill anatomy says forprocess. The README describesprocessas a delivery-process skill; this skill is a procedure, not a delivery process. A new domain value would need a hand edit to the README outside this card's file surface.compatibility: Requires an environment served by @objectstack/mcp 18.x. The compatibility gate needs a pinned major; the skill binds to the MCP tools, not to a spec schema.list_datasetsamong the tools goes straight to the fallback (the pair registers only when the host's bridge carries it,mcp-http-tools.ts:2286);partial/warning;truncatedon both answers;selection.dateGranularity,order,limit.Token readings (
ceil(utf8 bytes / 4), the ratchet's convention)skills/objectstack-ask/SKILL.mdskills/objectstack-ai/SKILL.mdskills/objectstack-query/rules/aggregation.mdSKILL.mdfiles togetherBoth pointer lines fit inside existing headroom, so no existing row moves and nothing was cut. The new ceiling row is a pricing act the ratchet's header reserves to the maintainer; this PR is Tier H and the approval is that word.
Not done here
packages/mcp/src/skill-md.tsstill lacks the near-miss row until the sibling server card renders it from this skill.Verification
Local gates: the
dispatch-gates --commandsderivation for this diff, run after the final commit4b17fddc, then--ranwith recorded exit codes:✓ dispatch-gates --ran: 120 derived famil(ies) accounted for — 118 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).node scripts/check-plugin-teardown-shape.mjs --self-test(exit 3: its fixture commit is not reachable in this shallow clone) andpnpm check:dual-build-cjs-loads(exit 3: it needs a fullpnpm build). Both are left to CI.pnpm check:changeset-gate-self-testsexited 1 on the first run, because the commit-signing server answered 503 inside its temporary repositories. A second run exited 0.pnpm --workspace-concurrency=2 --filter '@objectstack/lint...' buildand--filter '@objectstack/client-react...' build, bothVERDICT command-exit 0under the verify lock.node scripts/pm/overlap-check.mjsbefore the push:VERDICT clean exit 0(one open PR sharesskills/objectstack-ai/SKILL.mdand merges cleanly).test:repo, the repo-widepnpm lintand the rest of the farm are CI's.Fix round 1
Head
63c79bc1(was4b17fddc). One file moved:skills/objectstack-ask/evals/metric-selection-fallback.json.SKILL.mdis byte-identical. This answers the L1 review's should-fix S1 (comment 6946869842): an eval case asserts only what any correct reply carries. It replaces the "Eval self-consistency" row under Tests.must_containbeforemust_containnowquery_dataset,provenance,runtimeFilterquery_datasetlabel,description,which one they meanOpen Pipeline,Weighted Pipeline,Opportunities,Forecast,?must_not_containgains the machine namesopen_amountandweighted_amount(the skill says to show labels).expected_outputgives a sample question.compute nothing yetSales,Accounts,Targets,?expected_outputgives a sample question and names each dataset.describe_object,aggregate_records,非指标口径,valuedescribe_object,aggregate_records,priorityvaluewas one wording of the option rule.expected_outputnow says the line is in the user's language.does not record it,weightweight,limitmust_not_containdropsassuming, which a correct refusal can use ("without assuming a weight").membersWithheld,may not read财务汇总,毛利率must_not_containkeeps不存在and drops the Englishdoes not exist.expected_outputgives a sample Chinese sentence.Limits of the shape, stated once: a substring list cannot tell a negated mention from a use, so
must_not_containentries that name a tool (cases 1 to 3) can still trip on a correct reply that says which tool it does not call; and no single Chinese token for "not permitted" holds across correct replies (无权, 没有权限, 不能查看), so case 6 asserts the dataset label and the user's word only. The disclosure line in case 4 and the permission wording in case 6 are held byexpected_output.Check script (scratch, not committed), run on
63c79bc1, exit 0. For eachmust_contain: it occurs in the case'sexpected_output, and in the case's own prompt or inSKILL.md. For eachmust_not_contain: it does not occur inexpected_output.Gates on
63c79bc1, derived for the one changed file (dispatch-gates --commandswith that path), then--ranwith recorded exit codes:✓ dispatch-gates --ran: 31 derived famil(ies) accounted for — 19 run, 12 NOT-MEASURED (12 DERIVED from a recorded exit 3).pnpm check:nul-bytes,pnpm check:skill-links,pnpm check:skill-compatibility,pnpm check:skill-identifier-livenessandpnpm check:skill-frame-sync.check-closing-keyword-parityand its self-test,check-comment-mask-corpus,check:doc-formula-expressions,check:ci-filter-parity,check:doc-authoring,check:driver-memory-census,check:dts-closure,check:dual-build-cjs-loads,check:lean-entry-closure,check:pm-governed-merges,check:sourcemap-no-sources-content. All are left to CI.node scripts/pm/overlap-check.mjsbefore the push:VERDICT clean exit 0(againstorigin/mainat3bbda33band two open PR heads that share a file).origin/main(3bbda33b). No merge was made in this round.Fix round 2
Head
94affc64(was1a8bd8ba). Three files moved:skills/objectstack-ask/SKILL.md, its eval file, and the skill's one row inscripts/check-skills-token-ratchet.mjs. This answers the contract review on this PR (record 6947390250): should-fixes S1 and S2, and nit N1. N2 to N4 are left as the record says.query_datasetper dataset."Rows 1 and 2 now follow ADR-0149 D3 rule 3 ("answer to the word"): the count of hits is taken per word. They do not contradict the served text (
packages/mcp/src/skill-md.ts:279-282, "One measure match ... Several matches (two datasets or two members)"), which states the same two outcomes without saying per what; the skill now says it.Evals:
营收matchingmeasures.revenueand赢单率matchingmeasures.win_ratein one dataset (销售分析). Expected: both are computed in onequery_datasetcall and the user is not asked which is meant.must_contain:query_dataset,营收,赢单率,销售分析;must_not_contain:aggregate_records,非指标口径. No ask-back phrase is inmust_not_contain: a correct reply can say it does not need to ask, so every candidate phrase could occur in one. An ask-back reply makes no tool call, somust_contain: query_datasetis what fails it, on the same terms as cases 1 to 3.expected_outputsays members (measures or groupings), and its sample sentence reads 「财务汇总里有您无权查看的指标或分组,毛利率可能是其中之一」. Its assertions are unchanged.Token ratchet, the
skills/objectstack-ask/SKILL.mdrow: 1457 → 1522, pinned at the measurement, zero headroom. The file is 5848 → 6105 bytes (+257); less the 20-byte stamp line, 5828 → 6085 priced bytes;ceil(6085 / 4) = 1522(+65). It stays 105 lines. No other row moves. Nothing was cut to pay for it: the row is this PR's own new row, and the only text in the surface this round was allowed to touch is the four rows above. Whole-package readings now: allSKILL.mdfiles together 61564 tokens (was 61499 in the table above); authored bundle 191124 (was 191059); whole shipped tree 256372 (was 255871; the eval file is 2236, was 1800, unpriced).Checks on
94affc64:must_contain, each in itsexpected_outputand in its prompt orSKILL.md; 16must_not_contain, none in itsexpected_output;VERDICT ok: 0 violationsnode scripts/check-skills-token-ratchet.mjsnode scripts/check-skills-token-ratchet.mjs --self-testnode scripts/check-skill-compatibility-version.mjspnpm --filter @objectstack/spec run check:skill-docs(build-skill-docs.ts --check)node scripts/check-nul-bytes.mjsnode scripts/pm/overlap-check.mjs, before the pushVERDICT clean exit 0(againstorigin/mainat3bbda33band two open PR heads that share a file)The description in the frontmatter is unchanged, so nothing was regenerated.
The case 7 lines of the eval check script's output (cases 1 to 6 print as in fix round 1):
Gates on
94affc64.dispatch-gates --commandsderives 120 commands for the PR's whole diff. Derived for the three files this round moved (dispatch-gates --commandswith those paths) it is 54 commands, all run, then--ranwith the recorded exit codes:✓ dispatch-gates --ran: 54 derived famil(ies) accounted for — 49 run, 5 NOT-MEASURED (5 DERIVED from a recorded exit 3).49 exited 0, among them the token ratchet and its self-test,
check:skill-docs,check:skill-links,check:skill-compatibility,check:skill-identifier-liveness,check:skill-frame-sync,check:doc-authoring,check:nul-bytesandcheck:pm-dispatch-gates.NOT MEASURED, reason: this round's worktree has an install and no build, and each printed PREREQUISITE NOT MET (exit 3):
check:doc-formula-expressions,check:dts-closure,check:dual-build-cjs-loads,check:lean-entry-closure,check:sourcemap-no-sources-content. All five read built output that a skill text edit does not move; they are left to CI.The other derived commands read files this round did not move. They were run on
4b17fddc(the Verification section above) and are CI's on this head.No merge of
mainwas made in this round.Human Minimum
packages/specholds no runtime logic. (One row in a spec build script; no schema touched.)pnpm lintis left to CI.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed (gen:skill-docs).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code