Skip to content

[Finance Data] Define freshness, market-session, currency, and adjustment semantics #24

Open

Description

@helsome

Background

金融 Copilot 最危险的一类错误不是“完全没数据”,而是把 不同时间语义、币种、单位或复权口径的数据当成同一个事实。

例如:实时价与 15 分钟延迟价、上一交易日收盘价、财报期末值、TTM 指标、美元与港币、原始 OHLC 与复权 OHLC,如果只以普通 number/string 进入 Agent,上层几乎无法可靠判断其含义。

需要定义统一的 Financial Fact Envelope,让每个进入 Agent / report 的关键金融事实携带足够的语义和来源信息。

Requirements

Financial Fact / normalized data 至少按适用场景携带:

  • canonical instrument id;
  • field / metric identity;
  • value;
  • unit;
  • native currency;
  • as_of / period;
  • retrieved_at;
  • provider;
  • live / delayed / EOD / historical 状态;
  • exchange timezone / market session;
  • fiscal period / TTM / FY / quarter 语义;
  • raw / split-adjusted / dividend-adjusted 等 adjustment 语义;
  • FX conversion metadata(发生换算时)。

Rules

  • 不允许用本地 Date.now() 冒充数据本身的 as_of。
  • 货币转换后同时保留 native value/currency 和 conversion provenance。
  • 百分比、basis points、千/百万/十亿等单位必须结构化,避免靠文本猜测。
  • UI/Agent 能识别 stale data,并在重要回答中暴露关键时间口径。

Acceptance Criteria

  • quote、historical bars、fundamental metric 至少都使用统一的时间/单位语义。
  • live、delayed、EOD 数据在结构上可区分。
  • as_of 与 retrieved_at 明确分离。
  • currency/unit 不依赖自由文本解析。
  • adjusted 与 raw price series 不会被静默混用。
  • stale/freshness 状态可供 Agent 和 UI 消费。
  • 至少覆盖跨币种、延迟行情、财务周期、复权四类测试。
  • PR 必须展示真实金融数据结果,并证明 UI/Agent 可以回答“这个数是什么时间、什么币种、什么口径的数据”。

Non-goals

  • 不要求所有 provider 都提供完全相同的 metadata;缺失时必须显式标记 unknown,而不是猜测。

Activity

  1. github-actions commented on Sep 11, 2026

    @github-actions

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

  2. added
    claimed
    on Sep 11, 2026
  3. as992949791 commented on Sep 11, 2026

    @as992949791

    /claim

  4. github-actions commented on Sep 11, 2026

    @github-actions

    @as992949791 这个 Issue 已经由 @haloclt 认领。

  5. github-actions commented on Sep 11, 2026

    @github-actions

    该 Issue 已释放,可以重新认领。

  6. removed
    claimed
    on Sep 11, 2026
  7. xuilen commented on Sep 11, 2026

    @xuilen
    Contributor

    /claim

  8. github-actions commented on Sep 11, 2026

    @github-actions

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

  9. added
    claimed
    on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

claimed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions