Skip to content

[Portfolio Context] Add Watchlist and Portfolio context as explicit, versioned Copilot inputs #37

Open

Description

@helsome

Background

金融 Copilot 如果不知道用户当前关注哪些标的、持有哪些仓位、成本和投资假设,就很难做真正连续的研究;但如果直接把一份隐式的“用户画像”塞进 prompt,也会带来过期、不可追踪和错误引用的问题。

需要把 Watchlist / Portfolio 设计成 显式、结构化、可版本化的上下文源,并且每次 Agent run 都能知道自己实际使用了哪一版上下文。

Related: #21 #23 #24 #29 #34

Requirements

Watchlist

至少支持:

  • watchlist id / name;
  • canonical instrument ids;
  • tags / groups;
  • optional thesis / notes;
  • created_at / updated_at。

Portfolio

首版允许本地手工维护或导入,至少支持:

  • portfolio id / name;
  • instrument id;
  • quantity / weight;
  • optional cost basis;
  • native currency;
  • optional user notes / thesis;
  • as_of / updated_at。

如果未来接入券商/账户数据,应通过 adapter 接入,而不是重写 Agent contract。

Context injection

  • 用户可以选择当前 conversation/run 是否使用某个 watchlist/portfolio;
  • Agent 只接收任务需要的最小相关 context,不应把所有仓位无条件塞入每个 prompt;
  • 每个 run 保存使用的 context snapshot/version;
  • portfolio 后续发生变化时,历史 run 仍能知道当时使用的是哪一版;
  • context 中的 ticker 必须经过 [Finance Data] Add canonical instrument identity and symbol resolution #23 canonical instrument resolution。

Copilot UX

支持自然问题,例如:

  • “我的持仓里今天哪些公司有新公告?”
  • “对比我 watchlist 里这几家公司最近一个季度的利润率变化。”
  • “这条新闻对我的组合暴露有什么影响?”

回答中的事实仍必须走正常 evidence/provenance,而不能因为来自 portfolio context 就绕过证据。

Privacy / Safety

Acceptance Criteria

  • Watchlist 和 Portfolio 有独立结构化 schema,并持久化。
  • 使用 canonical instrument id,而不是只保存 ticker string。
  • Copilot run 可以显式绑定某个 watchlist/portfolio context。
  • run manifest 能记录实际使用的 context snapshot/version。
  • 修改 portfolio 后,旧 run 的 context 不被静默改写。
  • Agent 能基于 watchlist/portfolio 触发真实金融数据/搜索工具,并产生正常 evidence。
  • context 不会泄漏到无关 conversation 或 branch。
  • PR 必须用至少 5 个真实标的创建 watchlist/portfolio,并完成一次真实 Copilot E2E:基于该组合查询金融数据/公告,最终回答带 evidence,同时证明历史 run 使用的 portfolio snapshot 可追溯。

Non-goals

  • 不实现券商交易或自动下单。
  • 不要求首版计算完整税务/会计 P&L。
  • 不把 Portfolio 当成隐藏、不可审计的 user profile。

Activity

  1. Cordis798 commented on Sep 11, 2026

    @Cordis798

    claim

  2. github-actions commented on Sep 11, 2026

    @github-actions

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

  3. github-actions commented on Oct 19, 2026

    @github-actions

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

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

  4. removed
    claimedClaimed by a contributor and currently in progress
    on Oct 23, 2026
  5. github-actions commented on Oct 23, 2026

    @github-actions

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

  6. 2859493743 commented on Nov 10, 2026

    @2859493743

    /claim

  7. github-actions commented on Nov 10, 2026

    @github-actions

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

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