Skip to content

docs(task-32): refresh MCP docs for split search#1908

Merged
earayu merged 1 commit into
mainfrom
dongdong/task-32-a2-mcp-docs
Apr 29, 2026
Merged

docs(task-32): refresh MCP docs for split search#1908
earayu merged 1 commit into
mainfrom
dongdong/task-32-a2-mcp-docs

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Apr 29, 2026

Summary

  • Replace stale 5-tool MCP docs with the current split tool surface across mcp.md, mcp-api.md, and dify.md
  • Document chunk-level search vs Graph element tools, including task celery indexing failed #32 evidence_refs composite-key flow into read_document_chunk
  • Remove stale search_collection/search_chat_files and rerank docs from the user-facing MCP integration pages

Validation

  • rg "5 个|五个|5 tools|five tools|search_collection|search_chat_files" docs/zh-CN/integration/mcp.md docs/zh-CN/integration/mcp-api.md docs/zh-CN/integration/dify.md -> no hits
  • git diff --check

@earayu earayu merged commit e759fc2 into main Apr 29, 2026
10 checks passed
@earayu earayu deleted the dongdong/task-32-a2-mcp-docs branch April 29, 2026 19:47
earayu added a commit that referenced this pull request Apr 29, 2026
#1912)

Closes task #48 (#32-A1b acceptance test) — verifies the cross-endpoint
contract introduced by PR #1909 (task #32-A1, commit 8d5ffa9): the
bounded ``evidence_refs`` carried on graph entities + relations must
re-compose a complete ``read_document_chunk(collection_id, document_id,
chunk_id)`` call without any additional lookup, so an agent following
spec § 3.1.1 chain (``query_graph_entities → entity → evidence_refs →
read_document_chunk → chunk content``) can succeed.

## What this file is

Patch-based per @ziang msg=db58d137 (option 1: lift the
``_patch_doc_lookup`` pattern from
``tests/unit_test/test_d10c_read_primitives_surface.py``). 4 tests
covering the 4 sub-criteria PM listed in #indexing优化:a5ab5969
msg=351dd874:

1. ``GraphEvidenceRef`` carries the exact composite key
   ``read_document_chunk`` needs (``document_id`` + ``chunk_id`` +
   optional ``parse_version``).
2. ``query_graph_entities`` (via ``_entity_to_search_view``) returns an
   entity whose ``evidence_refs[0]`` re-composes a successful
   ``read_document_chunk`` call returning the underlying chunk body.
3. ``expand_graph_subgraph`` carries ``evidence_refs`` on the relation
   side as well — Weston msg=7500e57d's BLOCKER fix is verified
   end-to-end, not just at projection layer.
4. ``get_entity_detail`` reuses ``_entity_to_search_view`` and chains
   identically — proves the projection is a single source of truth for
   both endpoints.

## What this file is not

Not a re-test of PR #1909's projection logic — that is already covered
by ziang's 23 unit tests in
``tests/unit_test/service/test_graph_search_service_layer.py`` and
``tests/unit_test/mcp/test_graph_tools.py``. This file's value-add is
*chained*: it verifies the data shape produced by the graph layer is
contract-compatible with ``read_document_chunk`` without re-testing
either side in isolation.

Not a live e2e — no real DB, vector connector, LLM provider, or
embedding pipeline. Per ziang msg=db58d137 + msg=49d3d8fd the
acceptance criterion is contract-shape compatibility, not a real
backend round-trip; runtime behaviour of either side is already
covered by their owning suites.

## Fixture coordinates (pinned with @ziang msg=49d3d8fd)

- ``document_id="doc1"``
- ``chunk_id="chunk-a"``
- ``parse_version="v1"``
- ``collection_id="col-acceptance-1"``

These match the minimal ``LineageMember`` shape ziang's PR #1909 unit
tests use, so a future change to ``_lineage_to_evidence_refs`` that
breaks the chain shows up here at the cross-endpoint boundary even if
ziang's per-endpoint unit tests still pass.

## Validation

- ``./.venv/bin/python -m pytest
  tests/integration/test_graph_evidence_refs_chain.py -v`` → **4 passed**
- ``git diff --check`` clean
- pre-commit ``make lint`` passed

Sister cleanups in the same task #32 Phase A batch (already merged):
- @ziang PR #1909 — backend ``GraphEvidenceRef`` + projection (task #44)
- @dongdong PR #1908 — MCP docs (task #45)
- @huangzhangshu PR #1906 — boundary test no-rerank (task #46)
earayu added a commit that referenced this pull request Apr 29, 2026
…esson #14 (#1916)

Phase A 全闭环 follow-up sediment(task #32 Phase A close 后启动)。
fold 7 lesson sediment 进 § 四(task #32 + task #35 多轮迭代实证累计)+
fix-forward task #45 PR #1908 NIT defer (mcp-api.md "Phase A 后" → "当前已携带",
per architect msg=04c7962e Option B + dongdong msg=1c08ac8a)。

§ 四 新增 7 lesson:

- Lesson #12 v6 sub-form (v6.1 function / v6.2 endpoint / v6.3 data type
  scope walk) — 架构师 msg=9c5c32d1 升级,task #36 PR #1899 fix-forward²
  L148 case 实战 surface

- Lesson #12 v7 (caller signature → backend schema → runtime fallback
  三层 grep) — task #34 rerank 调研 huangheng msg=e539848f own-up + 架构师
  msg=b12fec5d thoroughness=very thorough trace 实证

- Lesson #12 v7.1 (composite key invariant) — task #32 spec PR #1905
  Weston msg=7500e57d BLOCKER catch + huangheng + 架构师 double own-up

- Lesson #12 v7.1 sub-form (backend 投影层 + acceptance 跨 endpoint
  chained chain 双层 verify) — 架构师 msg=f04b36a8 升级,PR #1909 backend
  textbook (`8d5ffa97`) + PR #1912 acceptance textbook (`eb2a805b`) 配对

- Lesson #13 v2.1 (import-level dual-side rewrite — 删 source 必删 obsolete
  test 文件 / 函数) — task #17 PR #1884 first + task #36 PR #1899
  fix-forward¹ second

- Lesson #13 v2.2 (value-level dual-side rewrite — 删 source 字段 / 数据必
  同步 update stale assertion / count) — task #36 PR #1899 fix-forward²
  L103/L108 first + task #47 PR #1910 contract test second

- Lesson #13 v3 (boundary 不重复事实保证 invariant,只覆盖可能 drift 的
  contract) — 架构师 msg=036dd8b2 升格,task #46 PR #1906 first

- Migration chain 时序 invariant (enum hard-cut PR 必先 chain DELETE FROM
  旧 enum value migration) — task #47 PR #1910 first (`3c7d2f81b5e9` chain
  在 `a8f4c2d9e1b7` 后)

- Lesson #14 (架构 invariant 删除多轮迭代收尾 — sweeping cleanup directive
  单 PR 无法一次性 cover,多轮 grep gate verify + fix-forward task 是工程
  常态) — task #35 6 轮 fix-forward 实证 first (PR #1899/#1897/#1898/
  #1906/#1910/#1911 + task #40 final 验收)

§ 六 sediment 引用追加:
- PR #1909 (`8d5ffa97`) Lesson #12 v7.1 backend 层 textbook
- PR #1912 (`eb2a805b`) Lesson #12 v7.1 acceptance 层 textbook
- task #35 6 轮 fix-forward 收尾 Lesson #14 first-application demo

§ 八 修订记录追加本次 commit timeline。

mcp-api.md L88 fix-forward (per dongdong msg=f1975615 + 架构师 msg=04c7962e
Option B): "task #32 Phase A 后" → "当前已携带(task #32 Phase A 落地,
PR #1909 + PR #1912)"。Phase A 全闭环后用户面文档现状准确。

来源 directive: PM msg=0129c3c5 phase A close 后启动 follow-up 子 PR +
架构师 msg=62e58a18 Phase A close 后立即启动 directive。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant