Skip to content

service-analytics: list_datasets fills candidates with near members (name, label, synonym) on a zero-match, only from what the caller may read #34763

Closed

Description

@objectstack-fleet

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

立卡门类别:④ 协调节点的子单,承父单 #34659(MCP 二期与问数专题);#34691 裁定后的执行卡,⛔ 不是认领。
Ruling: F1 B, #34691 comment 6943126855, option text verbatim 「B 零命中返回候选」 — 「现在就改服务器,list_datasets 零命中时返回候选数据集。专题席的新推荐。」, knocked to #34659 as comment 6943149235. It re-rules E2 of #34659 comment 6940528935 from "B with a premise" to A.

维护者速读

  • 做什么:零命中时服务器填 candidates:拿用户的词和成员的名字、显示名、同义词比「相近」,只从这个调用者看得到的数据集和成员里挑。
  • 为什么:裁定要求候选由服务器给;工具说明同步写「有候选就反问,没有才回退」,产品内 AI 和 MCP 客户端读到同一份结果。
  • 「相近」是确定性字符串规则,单测可证;精确命中规则一字不改。
  • 需要你做的:无;不碰受治理路径,规范卡落地后派发。

现状 (objectstack origin/main f6f5b50, read 2026-11-17; code read, nothing run)

要做的

  • A near-term function beside matchDatasetTerms, same normalization and admitted members, run only for terms with no hit in any entry.
  • "Near", proposed (the PR states its choice): after normalization the target contains the term or the reverse, both ≥ 2 code points. No edit distance, stem or embedding (D3: a string comparison belongs where it can be unit-tested).
  • Fill to the spec card's shape, order and cap; a withheld member, an unadmitted dataset or an internal-field member never appears.
  • Tool description: candidates → ask, listing label, dataset label, description, never pick; none → rule 4. State the byte delta (mcp: slim the open door's tool list (40 KB at tools/list; validate_expression alone is 7.8 KB) #34689).
  • Tests: unit (both directions, 金额 / 合同金额, the floor, cap, order, a hit suppresses that term's candidates); a member over an unreadable field is never a candidate; a pin in packages/mcp/src/mcp-dataset-tools.test.ts; checklist ai.mcp-dataset-tools gains a near-miss step.

不做的

验收

  • Showcase: terms: ['invoice'] → no match, candidates holds measures.invoice_count; ['invoices'] → today's match, no candidates; ['qa_no_word'] → neither.
  • A caller who cannot read a measure's field gets no candidate naming it; the equality test is untouched.

Governed: none (packages/services/**, packages/mcp/**, docs/qa/**).

Reader: domain:server · seat 3 area o3-E, L1-c review. #34687's near-miss cards now measure this path.
Blocked-by: #34761 (F1 spec sibling: candidates on ListDatasetsOutputSchema).
Dedupe: gh api -X GET search/issues -f q='repo:objectstack-ai/objectstack is:issue list_datasets zero-match' → 7 (#34720, #34691, #34659, #34685, #34718, #6015 open; #33829 closed; none this).

Activity

  1. added
    priority:p2
    area:ai
    domain:server
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor
  3. added
    pm:blocked
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Unlock (13:5xZ): the only blocker, #34761, closed at 13:47Z. Moved pm:blocked → pm:queue. The grade is unchanged.

  5. added
    pm:queue
    and removed
    pm:blocked
    on Nov 17, 2026
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzfR33NbV51QQU6R6bm

    Claim: PM loop round 1 · 2026-11-17T14:49Z
    Session: session_01WGufzfR33NbV51QQU6R6bm
    Account: os-support-ai
    Branch: claude/issue-34763-list-datasets-candidates-fill
    Worktree: objectstack-issue-34763
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: packages/services/service-analytics/src/** (a near-term function beside matchDatasetTerms in dataset-term-matcher.ts, the fill in dataset-tools.ts, LIST_DATASETS_DESCRIPTION, and their __tests__/), packages/mcp/src/mcp-server-runtime.ts (DATASET_SELECTION_RULE only), a new pin test in packages/mcp/src/ named for this card, packages/mcp/README.md and content/docs/ai/connect-mcp.mdx only where they quote the rule, docs/qa/platform-checklist/areas/ai.json (ai.mcp-dataset-tools near-miss step) and whatever its generator rewrites, root .changeset/34763-list-datasets-candidates-fill.md. ⛔ No packages/spec/** (shape landed by #34761), no skills/**, no packages/mcp/src/skill-md.ts or ask-skill.generated.ts (#34686 PR2, PR #34881).
    Surface note (seat ruling, route A, amendment 6951344053 on #34686): DATASET_SELECTION_RULE (initialize instructions) and LIST_DATASETS_DESCRIPTION also learn the published skill's per-word and loose-form rows (skills/objectstack-ask/SKILL.md step 2): two words with one measure each compute both; candidates (or a loose form of several listed measures) ask, never pick; none falls back labelled. Carried here until the epic filer adds it to this card's acceptance on #34659.
    Container & model: M, mode:subagent (area o3-E), model: TIER_DEFAULT (dispatch-gates --tier on the surface: no path-derived mandate), effort: high
    Clause-②: no (fills an optional output member the spec already declares; no accept set widens)
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 6950058266
    Premise: holds (area reading at origin/main d947a93: DatasetTermCandidateSchema {term, dataset, member} and candidates .min(1).optional() on ListDatasetsOutputSchema at packages/spec/src/ai/dataset-tools.zod.ts:130,227-235, LIST_DATASETS_MAX_CANDIDATES_PER_TERM = 5 at :105; ADR-0149 D3 amendment note at docs/adr/0149-…md:159-168 names this card as the executor and tool-description carrier; LIST_DATASETS_DESCRIPTION at packages/services/service-analytics/src/dataset-tools.ts:85-96 has no candidates branch; DATASET_SELECTION_RULE at packages/mcp/src/mcp-server-runtime.ts:1811-1816)
    Serial constraints cleared: #34761 closed 13:47Z (PR #34828 merged); PR #34881 (#34686 PR2, same area) touches packages/mcp/src/mcp-dataset-tools.test.ts and skill-md.ts, so this card's MCP pin goes in a new file and overlap-check runs at the first push and before every push
    Pre-claim lane: domain:server — packages/services/service-analytics/**, packages/mcp/**, plus the checklist area file the card names
    Pre-claim deps: #34761 closed (Blocked-by cleared by triage 6950058266)
    Prior rulings read: candidates,list_datasets,near-miss,zero-match → 7 hits; ADR-0149 D2, ADR-0149 D3 (+ amendment note), ADR-0149 D6; thread: #34691 F1 B (6943126855, knock 6943149235); #34828 L1-c 6948566165 N2 and seat L2 6948719696 N2/N3 (pins below); seat route A (6951344053); repo: objectstack-ai/objectstack. What counts as a match is not changed: candidates are never a hit.

    Lease o3-E (seat post #34584); child of epic #34659. Not governed by path (check-governed-merges at landing decides). Review: L1-c; the seat decides from the file list whether the tool-description and instructions text is an L2 face. Pins carried from the reviews: at most 5 per term taken in listing order with no cut marker; candidates only from admitted entries and every pointer resolves to a member listed in the same answer; no candidate for a term with a match; order terms as sent, datasets as listed, measures before dimensions.

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  8. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#34659#1 · hotlong · session_01Q4EjjMnXJdSZifpEN5i7aU

    Amendment to this card's acceptance, from the session that files and confirms this epic's cards. Written 2026-11-17T15:21Z, on the dispatching seat's scope note (#34659 comment 6951354804, route A): no separate card.

    If decision card #34894 is ruled A, nextStep joins this same result shape; sequence it after this card rather than reopening it.

  9. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzfR33NbV51QQU6R6bm
    os-dev-report

    {
     "issue": 34763,
     "status": "done",
     "branch": "claude/issue-34763-list-datasets-candidates-fill",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34904",
     "session": "session_01WGufzfR33NbV51QQU6R6bm",
     "premise_still_valid": true,
     "summary": "Added findDatasetTermCandidates beside matchDatasetTerms (packages/services/service-analytics/src/dataset-term-matcher.ts). A member is near a term when, after normalizeDatasetTerm, one of its targets (name, label in every locale, string synonyms) contains the term or the term contains the target, both at least 2 code points. The finder runs only for terms with no matchedOn hit in any listed dataset, and returns spec-shaped {term, dataset, member} pointers: terms as sent (a repeated term offered once), datasets as listed, measures before dimensions, at most LIST_DATASETS_MAX_CANDIDATES_PER_TERM per term, no cut marker. listDatasets (dataset-tools.ts) fills candidates from the admission-filtered per-entry member lists and omits the key when the list is empty. LIST_DATASETS_DESCRIPTION (1095 to 1414 bytes) and DATASET_SELECTION_RULE (453 to 741 bytes) learn the skill's step 2 rows (route A), and packages/mcp/README.md and content/docs/ai/connect-mcp.mdx follow where they quote the rule. Checklist ai.mcp-dataset-tools is at revision 3 with a near-miss step. Changeset: both packages patch. The live showcase reading matches the card's acceptance. The DATASET_SELECTION_RULE docblock was deliberately left unedited: editing it gave an overlap-check exit 1 against PR #34881, which rewrites those lines.",
     "tests": "At 2926ce23 under the verify lock, each exit echoed separately. service-analytics typecheck exit 0. mcp typecheck exit 0, including check:test-typecheck: OK (6 file(s) / 53 error(s) / 8 pinned signature(s), debt unchanged). service-analytics vitest: Test Files 218 passed (218), Tests 5558 passed | 335 skipped (5893). mcp vitest: Test Files 70 passed (70), Tests 1244 passed (1244). At merged head 14bb6615: mcp 70/70 files, 1244/1244 tests; the two service-analytics files 2/2 files, 58/58 tests; VERDICT command-exit 0. New pins: 6 in dataset-term-matcher.test.ts (new top-level describe; the existing equality test is untouched), 4 in dataset-tools.test.ts (new top-level describe, plugin-wired service and security double), 3 in the new packages/mcp/src/list-datasets-candidates-34763.test.ts. Ablations via scripts/ablation-replace.mjs, with the subject imported relatively from src so no dist is involved. (1) Cap: anchor 'if (++offered >= LIST_DATASETS_MAX_CANDIDATES_PER_TERM) break scan;' replaced by '++offered;', anchor x1 to x0, blob 85170dd7 to 85f8238f; Tests 1 failed | 57 passed, the failure being the 'offers at most 5 per term' pin. (2) Hit suppression: '    if (hit) continue;' replaced by '    void hit;', blob 85170dd7 to e597fc91; Tests 5 failed | 53 passed, the matcher's hit-in-any-dataset pin plus all 4 tools pins. Both restored with blob == HEAD and git diff HEAD empty. Acceptance measured LIVE at 2926ce23: showcase booted with 'pnpm -C examples/app-showcase exec objectstack dev --fresh -p 38763 --no-watch', osk_ key minted as the seeded admin, tools/call list_datasets over HTTP MCP. terms ['invoice']: no matches anywhere; candidates = showcase_invoice_metrics measures.invoice_count and measures.paid_count. terms ['invoices']: matches invoice_count on label; candidates key absent. terms ['qa_no_word']: no matches, candidates key absent. Server killed by recorded PID, port freed, key file deleted.",
     "gates": "dispatch-gates --commands (no paths) at 2926ce23 derived 100 families, all run. 98 exited 0 on the first pass. check:skill-examples and check:dual-build-cjs-loads first exited 3 (PREREQUISITE NOT MET, no full build); after a full turbo build under the lock both exited 0. dispatch-gates --ran with ':: exit N' records: '100 run, 0 NOT-MEASURED (a DERIVED zero)'. Also: check:platform-checklist OK (16 areas, 433 items); check-nul-bytes OK; check-governed-merges --branch: NOT governed, 494 changed lines (+466/-28); dispatch-gates --tier: no path-derived mandate. overlap-check: exit 1 once vs #34881 on the docblock, not pushed over; then exit 0 before each push, the last at 14bb6615. CI on PR #34904 head 14bb6615 at report time: Check Changeset, Lint (ESLint, repo & tooling, docs & code guards, CI/release/engine, PM dispatch-gates, scoped x3), Type Check (workspace, source, consumer, debt ledger), Governed Surface Queue Guard, PR-body guards, Spec property liveness, Check PR Size, Check Documentation Links: all in_progress. Opt-in and queue-only jobs: skipped. Not run locally and left to CI: pnpm lint, test:repo, integration layers, dogfood.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches; the relay ran POST /pulls and POST /issues/34904/assignees); post-stamped comment on #34763 (POST /issues/34763/comments). git push is not counted.",
     "open_questions": [
      {
       "question": "With exactly one candidate for a term, should the AI ask or fall back? The ADR-0149 D3 amendment note and route A say a term with candidates asks, and the new tool description and initialize rule say so. The published skill's last step-2 row sends one near form to step 4 ('One near form is not a match either: it selects nothing'). Both agree the candidate is never acted on; they differ only on asking first.",
       "options": [
        "A: keep 'candidates ask' in the tool texts (ADR wording) and have the #34685/#34686 lane amend the skill's row so one listed candidate is asked about too",
        "B: change the tool texts so a single candidate falls back labelled, as the skill says, which departs from the ADR note's 'With candidates, the AI asks'"
       ],
       "recommendation": "A, because the ADR amendment is the binding record and the server now hands the candidate over explicitly; the skill row predates candidates and was written for the client's own loose-form judgment."
      },
      {
       "question": "The dispatch put the MCP pin in a new file, but AGENTS.md (ruling record 6583487846) says a new pin for a component with a shared harness file goes into that file as a top-level describe.",
       "options": [
        "A: keep the new file until PR #34881 lands, then fold it into mcp-dataset-tools.test.ts",
        "B: leave it as its own file"
       ],
       "recommendation": "A, because the separate file exists only to avoid colliding with #34881's rewrite."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: #34881 (PR) · the DATASET_SELECTION_RULE docblock in packages/mcp/src/mcp-server-runtime.ts still describes the pre-candidates rule (one measure match answers, several ask, none falls back); left unedited so this PR does not textually conflict with #34881, which rewrites those lines — noted, not filed"
     ]
    }
  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzfR33NbV51QQU6R6bm
    os-dev-report

    {
     "issue": 34763,
     "status": "done",
     "branch": "claude/issue-34763-list-datasets-candidates-fill",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34904",
     "session": "session_01WGufzfR33NbV51QQU6R6bm",
     "premise_still_valid": true,
     "summary": "Follow-up round; new head 883af46685. (1) Merged origin/main c81f498b5f, which contains #34881 (c6ecd1fab8), as merge 762b721bc1 with the trailers on the merge commit. It merged cleanly with no conflict: #34881's mcp-dataset-tools.test.ts, skill-md.ts and docblock changes came in as written. (2) Folded the candidates pass-through pin into packages/mcp/src/mcp-dataset-tools.test.ts as a top-level describe (3 tests, using the harness's makeBridge and callTool), deleted packages/mcp/src/list-datasets-candidates-34763.test.ts, and dropped it from ai.json automated.ref (still revision 3, unlanded). (3) The DATASET_SELECTION_RULE docblock now describes the candidates rule: two one-measure words compute both; a word with candidates is the same question, never a pick or a match, even for a single candidate; only no match and no candidate falls back, labelled. The rule string is unchanged. (4) The merged tree agrees with 'one candidate asks' everywhere except skills/objectstack-ask/SKILL.md and its generated mirror packages/mcp/src/ask-skill.generated.ts. That mirror is now the source of the served /mcp/skill text, and its row 'One near form ... selects nothing' is expected to differ until #34868. Noted in the PR body (Follow-up round section, plus the updated ruling note). The PR body was updated via relay issue_patch with the attribution lines first and the signed comment last.",
     "tests": "At 883af46685 after a full turbo build (VERDICT command-exit 0), under the verify lock, each exit echoed separately. service-analytics typecheck exit 0. mcp typecheck exit 0 (check:test-typecheck: OK, 6 file(s) / 53 error(s) / 8 pinned signature(s), unchanged). service-analytics vitest: Test Files 218 passed (218), Tests 5558 passed | 335 skipped (5893). mcp vitest: Test Files 71 passed (71), Tests 1252 passed (1252). mcp-dataset-tools.test.ts with the verbose reporter: Tests 25 passed (25), including the three [#34763] tests. The first-round ablations (cap; hit suppression) were not re-run: the matcher and fill are unchanged this round.",
     "gates": "dispatch-gates --commands (no paths) at 883af46685 derived the same 100 families as round 1; all 100 exited 0. --ran with ':: exit N' records: '100 run, 0 NOT-MEASURED (a DERIVED zero)'. check:platform-checklist OK. check-governed-merges --branch: NOT governed, 468 changed lines (+436/-32). overlap-check (not chained): exit 0 vs origin/main c81f498b5f and #34928 (shares dataset-term-matcher.ts, merges cleanly). PR #34904 check-runs at 883af466 when read: 40 success (Lint & Repo Gates, TypeScript Type Check, Test Core 1-10 and Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, PR-body guards, all Lint and Type Check sub-jobs, Spec property liveness, and others), 17 skipped, 0 failure. Two re-runs (Check Changeset, PR-body guards) were in_progress after the body edit.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 this round — relay issue_patch on #34904 body (POST /repos/objectstack-ai/objectstack/dispatches → PATCH /issues/34904; read-back 19201 bytes identical); post-stamped os-dev-report comment on #34763 (POST /issues/34763/comments via relay). git push not counted.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: #34868 · skills/objectstack-ask/SKILL.md row 'One near form is not a match either: it selects nothing', mirrored in packages/mcp/src/ask-skill.generated.ts (now the served /mcp/skill source), still sends a single near form to step 4 while the tool texts ask on any candidate, per seat 3 Q1 A — noted, not filed"
     ]
    }
  11. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions