Skip to content

feat(automation): 为每日情报简报项绑定稳定证据引用与快照版本 - #154

Open
Theater-ahyeon wants to merge 1 commit into
helsome:mainfrom
Theater-ahyeon:feat/portfolio-daily-intelligence
Open

Theater-ahyeon wants to merge 1 commit into
helsome:mainfrom
Theater-ahyeon:feat/portfolio-daily-intelligence

Conversation

@Theater-ahyeon

Copy link
Copy Markdown

改了什么

Refs #103(增量切片:简报证据溯源与快照绑定)

按 Issue #103 的验收标准,组合情报简报(Daily Intelligence Digest)中的每一项结论不应仅是自由文本,而必须能够定位到稳定的证据引用与所依据的上下文快照:

  1. packages/shared/src/automation/brief.ts
    • BriefItem 新增 evidenceRefs?: string[]contextVersion?: string
    • watchlistItems(研报差异项):自动将 diff.changes 里的底层证据标注提取为 evidenceRefs,并以 diff-${diff.id} 标记上下文快照版本;
    • thesisItems(论点异动项):同样提取底层证据引用与 diff 标识;
    • automationItems:对实质变化运行标记对应的运行证据锚点与 run 上下文版本。
  2. packages/shared/src/automation/brief.test.ts
    • 补充针对 evidenceRefscontextVersion 的断言用例,确保简报项能够稳定追溯到来源数据。

为什么要改

Issue #103 明确要求:

The produced digest links each material item to stable evidence/source identities; factual claims are not backed only by free-text model output.
The result records the exact portfolio/watchlist snapshot/version used, and later portfolio edits do not rewrite the historical run context.

此前 DailyBrief 的各个 BriefItem 仅包含展示性文案和基本标题,无法直接挂钩到底层数据能力(如 company.valuationmarket.quote 等运行证据)与上下文版本。本 PR 补齐该数据连接,让简报消费方或后续 Inspector 能够直接根据 evidenceRefs 展示证据详情。

兼容性与 UI 影响

  • 无可见 UI 变化:纯共享领域模型与简报构建器字段增量,不破坏现有 DailyBrief 渲染及下游解构;
  • 完全向后兼容:旧数据中无证据引用时该字段缺省,现有展示逻辑不受影响。

验证

环境:Bun 1.4.2 / Windows 11 (10.0.26200)

bun test packages/shared/src/automation/brief.test.ts
→ 9 passed / 0 failed (26 expect calls)

bun test packages/shared/src/automation
→ 54 passed / 0 failed (139 expect calls across 5 files)

bun run typecheck
→ core / i18n / shared / ui / electron 全部 exit 0

@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.

当前增量方向可以保留,但这里有一个会冻结错误 evidence identity 的 correctness blocker,需要先修:BriefItem.evidenceRefs 被声明为“stable evidence / source references”,实际写入的却是 ResearchDiff.change.evidence 的自由文本 provenance(测试里就是 capability:... run:... fetchedAt:...),以及合成的 automation-run:${run.id}:material。这些值目前不是可解析的 canonical sourceId/evidenceId,后续 Inspector 无法据此稳定定位证据;这与 #103 本切片声称的“stable evidence/source identities”不一致,也会与正在收敛的 #100 unified evidence contract 产生第二套身份。

最小修改即可:要么让这里消费真实 canonical sourceId / evidenceId(推荐在 #100/#104 契约可用后接入),并加一个“引用可 resolve 到对应 evidence/source”的 focused assertion;要么把字段明确收窄/改名为 provenance/correlation anchors,并同步 PR 描述,不把它声称为稳定证据 identity。contextVersion 本身不需要因为这个问题扩大设计,也不要求完整 #103 E2E。作者现有 Bun/OS、9/0 focused、54/0 automation 和全 workspace typecheck 报告可继续沿用到未受影响部分;当前 head Actions 是 action_required,我没有把它当成质量失败。

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