Skip to content

feat(research): 增加 claim verifier 核心 - #90

Merged
helsome merged 1 commit into
helsome:mainfrom
KKK-keria:feat/13-claim-verifier-core
Sep 20, 2026
Merged

helsome merged 1 commit into
helsome:mainfrom
KKK-keria:feat/13-claim-verifier-core

Conversation

@KKK-keria

@KKK-keria KKK-keria commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

改动说明

为 Issue #13 增加独立的 claim-level verifier core:

  • 支持 supported / contradicted / insufficient_evidence
  • claim 没有 evidence 时确定性返回 insufficient_evidence,不调用 JudgeClient
  • 有 evidence 时复用现有 JudgeClient 执行语义判断
  • Judge API 失败、非法 JSON、未知 status 均 fail closed,不会伪装成 supported
  • verifier 生成的 reason 只用于解释,不会成为新的 evidence
  • machine-readable 输出包含 claimIdstatusevidenceIdsreasonverifierVersion

关联 Issue

Related to #13

测试报告(正式审核前必填)

环境

  • Bun:1.4.2
  • OS:Microsoft Windows 11 家庭中文版 10.0.26200(AMD64)
  • 基线:upstream/main @ 9a042e7
  • 提交:91bfc462

实际执行命令与结果

npx --yes bun@1.4.2 test packages/shared/src/research/claim-verifier.test.ts
→ 9 passed / 0 failed / 21 assertions

npx --yes bun@1.4.2 run typecheck
→ core / i18n / shared / ui / electron 全部 exit 0

git diff --check upstream/main...HEAD
→ exit 0

已知失败 / Baseline

无。

  • 已提供实际测试命令与 pass/fail 结果
  • 已说明测试环境
  • 不存在需要说明的已知失败
  • 核心改动已有 focused tests

UI 截图(涉及 UI 时必填)

  • 本 PR 不涉及 UI 变化

Scope / 后续

本 PR 仅实现可独立审核的 Claim Verifier Core,不依赖尚未合并的 PR #67,也没有复制其临时类型。

本 PR 暂不包含:

  • ResearchClaim / EvidenceRef integration
  • claim-evidence mapping integration
  • ResearchRunner integration
  • passage/span provenance
  • Markdown export
  • UI
  • 真实 Deep Research E2E

在确认 PR #67 已合并到 upstream/main 之前,不开始上述正式 integration。

@KKK-keria
KKK-keria force-pushed the feat/13-claim-verifier-core branch from b79408b to 2c232cf Compare September 13, 2026 01:55
@KKK-keria
KKK-keria marked this pull request as ready for review September 13, 2026 01:56

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 verifier core 可以作为 #13 的独立增量先落:无 evidence 时确定性 insufficient、judge 失败/非法 JSON fail-closed、causal/root-cause 不凭 plausibility 放行,focused tests 也覆盖了关键分支。它当前没有接 production/report persistence,也不关闭 #13,因此真实 Deep Research E2E 留到 integration/final acceptance,不阻塞本 PR。

当前 main 已继续前进且 GitHub 显示不可直接合并,请只 rebase 最新 main 后重跑 claim-verifier focused test + typecheck/basic CI。后续正式接线时必须复用 #104 的统一 EvidenceClaim / verification status / evidence IDs,不要把本文件的临时输入类型发展成第二套持久化 contract。action_required 不作为质量失败。

@KKK-keria
KKK-keria force-pushed the feat/13-claim-verifier-core branch from 2c232cf to 91bfc46 Compare September 18, 2026 04:42

helsome commented Sep 18, 2026

Copy link
Copy Markdown
Owner

已看到当前 head 91bfc462 基于 9a042e7 重新整理后 GitHub 显示可直接合并,原先的代码方向 approval 仍成立。现在只差把验证材料刷新到这个 head:请实际重跑并回贴 claim-verifier.test.ts focused 结果,以及 typecheck/basic CI 的当前结果(若 CI 仍是首次贡献者 action_required,说明这一点即可;不要因此扩大测试范围)。PR 正文目前仍记录旧提交 2c232cf,在当前 head 的可复现结果补上前我先不执行 merge。

@KKK-keria

Copy link
Copy Markdown
Contributor Author

@helsome 已按要求在当前 head 91bfc462 重新验证:

  • npx --yes bun@1.4.2 test packages/shared/src/research/claim-verifier.test.ts → 9 passed / 0 failed / 21 assertions
  • npx --yes bun@1.4.2 run typecheck → core / i18n / shared / ui / electron 全部 exit 0
  • git diff --check upstream/main...HEAD → exit 0
  • GitHub Actions PR checksaction_required(首次贡献者审批,未扩大测试范围)

PR 正文已同步更新至当前 head;未新增 production integration。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前 head 91bfc462 的验证材料已补齐,且 Issue #13 由作者本人认领。这个 PR 明确只是 claim verifier core 的独立增量,不关闭 #13,也不冒充 production integration;真实 Deep Research E2E、持久化 mapping 和 UI 跳转继续留在父任务。代码按供应证据 fail-closed,空 evidence 不调用 judge,非法/失败 judge 不会被提升为 supported,focused 9/0 + Bun 1.4.2 全 workspace typecheck 报告与当前 head 对齐。action_required 只是首次贡献者 CI 授权,不作为质量失败。当前 main 自身仍有 #116 后的 TS2741,因此这里只刷新 APPROVE,不在 main 红灯期间合并。

@helsome
helsome merged commit dfa33b8 into helsome:main Sep 20, 2026
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.

2 participants