feat: 为研究报告引入 claim 身份与 claim↔evidence 双向映射 - #67
Open
eric7h wants to merge 1 commit into
Open
Conversation
8 tasks
helsome
requested changes
Sep 11, 2026
helsome
left a comment
Owner
There was a problem hiding this comment.
这条作为 #13 的 claim↔evidence 数据关系增量是合理的,不要求你补 verifier 或真实 Deep Research E2E。当前只补测试报告环境一致性:请注明 OS,并用仓库固定的 Bun 1.4.2 至少重跑本 PR 三个 focused test(claim-evidence / runner / markdown export),给出实际命令与 pass/fail。你现在记录的全仓 340 failures 来自 Bun 1.3.5,已经不能作为当前 main 的有效 baseline;无需为了它重跑全仓。补齐 focused 1.4.2 结果即可继续审核。
5 tasks
报告里的 EvidenceRef 此前只有一个自由文本 claim 字段:既没有稳定 id, 也无法从某条证据反查引用它的结论,重新加载后没有任何可依赖的映射。 本次只做 issue helsome#13 的数据关系这一层,不含 verifier 与 UI 跳转: - core:EvidenceRef 增加稳定 id 与 claimId;新增 ResearchClaim, ResearchReport 增加可选 claims 列表 - shared:新增 claim-evidence 模块。id 全部由报告自身携带的数据派生 (section key / run id / capability id / 位置),因此重载与导出后能 重建出与组装时完全一致的映射;提供 claim→evidence、evidence→claim 双向查询,以及无证据 claim 的检测 - runner:组装报告时为每个 section 写入 claim 与双向链接;capability 失败的 section 仍保留 claim,但以空 evidence 暴露出来 - export:Markdown 证据行携带 claim id,可选出完整映射 JSON;无证据的 claim 单独列出,不再混在正文里冒充已证实结论 向后兼容:新增字段全部可选,历史报告按 section key + 位置派生 id, 渲染结果与改动前一致。
eric7h
force-pushed
the
feat/13-claim-evidence-links
branch
from
September 13, 2026 01:10
5145a16 to
7d20221
Compare
Author
|
已按反馈补齐,谢谢确认 scope。
三个 focused test,实际命令与结果: bun test packages/shared/src/research/claim-evidence.test.ts \
packages/shared/src/research/runner.test.ts \
packages/shared/src/export/markdown.test.ts --isolate
# → 27 pass / 0 fail (163 expect() calls)改动工作区与类型检查: bun test packages/shared --isolate # 897 pass / 0 fail
bun test packages/core --isolate # 36 pass / 0 fail
bun run typecheck # core / i18n / shared / ui / electron 全部 exit 0顺带用 1.4.2 跑了一次全仓 PR 描述已同步更新。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动说明
Deep Research 报告的
EvidenceRef此前只有一个自由文本claim字段:没有稳定 id,也无法从某条证据反查引用它的结论,重新加载后没有任何可依赖的映射。本 PR 只做 issue #13 里的数据关系这一层 —— claim 身份、claim ↔ evidence 双向映射,以及让它在组装、持久化、重载、导出之间保持一致;不含 verifier,也不含 UI 跳转。
EvidenceRef增加稳定id与claimId;新增ResearchClaim;ResearchReport增加可选claims列表claim → evidence、evidence → claim双向查询,以及“无证据 claim”检测已 rebase 到最新
main(4eca2d1)。packages/shared/src/research/runner.ts与 #80(持久化检查点与崩溃恢复)、#59(canonical instrument identity)有重叠,冲突按两边都保留的方式解决:evidence 仍然写入instrumentId,同时带上稳定的id/claimId并登记进claims。关联 Issue
Related to #13 —— 只覆盖该 Issue 的 claim / evidence 数据关系部分,不关闭整个 Issue。
验证
环境:macOS 15.7.3(Darwin 24.6.0,arm64);Bun 1.4.2,与
.github/workflows/pr.yml里固定的BUN_VERSION: '1.4.2'一致。三个 focused test(本 PR 涉及的文件),实际命令:
bun test packages/shared/src/research/claim-evidence.test.ts \ packages/shared/src/research/runner.test.ts \ packages/shared/src/export/markdown.test.ts --isolate结果:27 pass / 0 fail(163 expect() calls)
改动工作区全量与类型检查:
附带确认:改用 Bun 1.4.2 后,全仓
bun test --isolate为 1365 pass / 7 skip / 0 fail。之前描述里记录的 340 个失败确实只来自本机旧的 Bun 1.3.5,与 main 无关,该记录作废。UI 截图(涉及 UI 时必填)
未触碰
packages/ui,没有可见渲染差异:Markdown 导出只在证据行追加了 claim id,原有文本不变,既有的toContain断言全部保持通过。Scope / 后续
本 PR 是 issue #13 的第一步。
未完成、留给后续 PR:
supported/contradicted/insufficient_evidence)向后兼容:新增字段全部可选;读取历史报告时按 section key + 位置派生 id,既有渲染与导出结果不变。