Skip to content

[Copilot Evidence] Add unified inline citations and a source inspector #30

Open

Description

@helsome

Background

#13 已经要求 Deep Research 建立 claim ↔ evidence 的双向关系,但 Copilot 日常问答还需要一个统一、稳定的 citation UX:用户不应该看到裸 URL,也不应该只能在回答末尾看到一串来源列表。

更重要的是,Folio 的 evidence 不只来自网页,还会来自结构化金融 API(#29)、本地文档和 research source,因此 citation UI 必须统一处理不同 evidence type。

Related: #13 #20 #27 #29

Requirements

Inline citation rendering

  • citation 与具体 claim/text range 绑定,而不是只挂在整条 message 尾部;
  • streaming 期间 citation 到达后可稳定插入,不造成正文重复或重排错位;
  • 同一 source/evidence 多次引用使用稳定编号/id;
  • copy/export/reload 后 citation identity 不丢失。

Source inspector

点击 inline citation 后,在 source drawer/popover/inspector 中展示适用信息:

Navigation

  • 文档/网页 evidence 能定位到具体 passage 时,优先 deep-link/highlight 具体 evidence;
  • structured financial evidence 跳转到可解释的数据详情,而不是伪造一个网页 URL;
  • unavailable source 仍可展示已保存 provenance,并明确标记不可访问。

Acceptance Criteria

  • Copilot answer 中 citation 能绑定到具体 claim/text range。
  • 至少统一支持 web evidence 和 structured financial evidence 两类来源。
  • citation 可在 streaming 中增量出现且不会重复编号/闪烁错位。
  • 点击 citation 能看到 provenance/as_of/retrieved metadata。
  • source drift、stale data、provider conflict 等状态能在 inspector 中显式呈现。
  • conversation reload、copy/export 后 citation reference 仍然可解释。
  • keyboard navigation / basic accessibility 可用。
  • PR 必须附一条真实 Copilot 回答,混合至少一个网页来源与一个金融 API 事实,并录制从正文 citation 打开对应 evidence 的完整路径。

Non-goals

Activity

  1. lhy-dcf commented on Sep 11, 2026

    @lhy-dcf
    Contributor

    /claim

    我来认领这个 Issue。计划先梳理现有 Copilot message、streaming 与 evidence/provenance 数据契约,再实现稳定的 inline citation identity、统一 source inspector、重载/复制后的引用保真,以及覆盖增量渲染与可访问性的测试。

  2. github-actions commented on Sep 11, 2026

    @github-actions

    @lhy-dcf 已认领该 Issue,并已自动设为 Assignee。提交 PR 时请在描述中写 Closes #30。

  3. github-actions commented on Sep 21, 2026

    @github-actions

    @lhy-dcf 这个 Issue 已认领超过 7 天,目前没有发现关联的 open PR,也没有看到最近 7 天的进度更新。

    如果仍在推进,请在 3 天内 留一条简短进度说明(包括正在等待的前置依赖也可以);如果已经有 PR,请贴出链接。若 3 天内没有回应,认领会自动释放,方便其他贡献者接手。

  4. 3 remaining items

  5. yu1128-L commented on Oct 3, 2026

    @yu1128-L
    Contributor

    /claim

  6. added
    claimedClaimed by a contributor and currently in progress
    on Oct 3, 2026
  7. github-actions commented on Oct 3, 2026

    @github-actions

    @yu1128-L 已认领该 Issue,并已自动设为 Assignee。提交 PR 时请在描述中写 Closes #30。

  8. github-actions commented on Oct 11, 2026

    @github-actions

    @yu1128-L 这个 Issue 已认领超过 7 天,目前没有发现关联的 open PR,也没有看到最近 7 天的进度更新。

    如果仍在推进,请在 3 天内 留一条简短进度说明(包括正在等待的前置依赖也可以);如果已经有 PR,请贴出链接。若 3 天内没有回应,认领会自动释放,方便其他贡献者接手。

  9. removed
    claimedClaimed by a contributor and currently in progress
    on Oct 15, 2026
  10. github-actions commented on Oct 15, 2026

    @github-actions

    @yu1128-L 在提醒后 3 天内没有进度回应,且仍未发现关联的 open PR;本次认领已自动释放。Issue 保持开放,可以重新认领。

  11. yu1128-L commented on Oct 15, 2026

    @yu1128-L
    Contributor

    /claim

    继续接手 #30。当前 main 已完成 citation 契约(#88)、行内/块引用渲染与基础 a11y(#286),但 Source Inspector 对非金融来源仍只有 noEnvelope 一句兜底,CitationSource.url 从未渲染成链接,delayed / provider conflict(reconciliation)也未透出。

    计划(scope:#30 Part 2,聚焦 Source Inspector 的 provenance 完整性):

    1. Source Inspector 为非金融来源(news / document / tool)渲染真实 provenance:title、kind、provider、tool name、retrieved/as_of、live source link、tool 参数;
    2. 透出 delayed 与 reconciliation(provider conflict)状态,与既有 stale/fallback 一起显式呈现;
    3. source 列表支持方向键 roving focus,补齐 keyboard navigation;
    4. 双语 i18n key + focused 测试。

    不会重新实现 #13 verifier;提交 PR 时写 Refs #30。

  12. github-actions commented on Oct 15, 2026

    @github-actions

    @yu1128-L 已认领该 Issue,并已自动设为 Assignee。提交 PR 时请在描述中写 Closes #30。

  13. yu1128-L commented on Oct 15, 2026

    @yu1128-L
    Contributor

    进展:#30 Part 2 已提交 PR #322(https://github.com/helsome/folio/pull/322)。

    本轮补的是 Part 1 之后剩下的来源检查器缺口:

    • 非金融来源(新闻/文档/工具)之前只渲染 agent.sources.noEnvelope 一句兜底,现在展示标题、类型、提供方、工具参数、抓取时间;
    • CitationSource.url 之前被采集但从未渲染,现在作为可点击的外部链接展示(target="_blank" rel="noreferrer");
    • 状态区补上 delayed(延时数据)与 reconciliation(多提供方对账,含 providers + method),与既有 stale / fallback 并列;
    • 来源列表改为 listbox/option 语义 + roving tabIndex,支持 ArrowUp / ArrowDown / Home / End;
    • 中英文文案与单测同步补齐,i18n:check 通过。

    验证(Windows,Bun 1.4.2):相关单测 34 pass / 0 fail;bun run typecheck 五个包全部通过;bun run i18n:check key parity 1499 ≡ 1499。

    仍未完成:验收标准最后一条要求"真实 Copilot 回答混合至少一个网页来源与一个金融 API 事实,并录制完整打开路径"。本环境没有可用的 Anthropic 凭据(只有非 Anthropic 的 key),无法录制真实模型回答,因此该 PR 使用 Refs #30 而非 Closes,这条验收仍留在 issue 上。如果仓库维护者能提供可用的模型凭据或指定录制方式,我可以补上这段录制。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

claimedClaimed by a contributor and currently in progress

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions