Skip to content

fix(roast): 修正年度贡献数的错误归因 - #210

Open
ZJPex wants to merge 1 commit into
hikariming:mainfrom
ZJPex:fix/last-year-contribution-attribution
Open

fix(roast): 修正年度贡献数的错误归因#210
ZJPex wants to merge 1 commit into
hikariming:mainfrom
ZJPex:fix/last-year-contribution-attribution

Conversation

@ZJPex

@ZJPex ZJPex commented Aug 20, 2026

Copy link
Copy Markdown

关联 Issue

关联 #209(不自动关闭)。

问题

last_year_contributions 来自 GitHub 过去一年贡献日历的聚合计数,但锐评模型可能把它误写成 PR 数,并进一步据此推断贡献类型或仓库归属。

例如 Issue #209 中的 payload 同时包含:

  • last_year_contributions = 694
  • total_pr_count = 8
  • merged_pr_count = 5

原始 PR 统计是独立且正确的,错误发生在锐评生成阶段对字段语义的解释。

修复

  • 在中英文 system prompt 中明确要求按 context_notes.last_year_contributions_scope 解释年度贡献总数;
  • 在 TypeScript 和 Go 两条 roast prompt 路径中补充相同的字段语义;
  • 明确禁止把该聚合值写成 PR 数,或用它推断贡献类型、外部仓库/自有仓库分布;
  • 保留原始指标和评分逻辑,不修改 GitHub 数据采集;
  • 增加中英文回归测试,覆盖 694 次年度贡献、8 个 PR、5 个 merged PR 的组合。

验证

  • pnpm test -- src/lib/__tests__/prompt.test.ts:28/28 通过
  • Go 定向 roast prompt 回归:通过
  • pnpm typecheck:通过
  • pnpm lint:通过(仅有未修改文件中的既有 warning)
  • pnpm test:612/612 通过
  • go test ./...:通过
  • pnpm smoke:deployment:selftest:通过
  • pnpm smoke:backend:async:selftest:通过
  • pnpm smoke:backend:resilience:selftest:通过
  • pnpm build:通过

影响范围

该修改只约束新生成锐评对字段的解释,不改变贡献数、PR 数或评分结果。已经生成并缓存的旧锐评可能需要重新生成或等待缓存失效。

@ZJPex
ZJPex requested a review from hikariming as a code owner August 20, 2026 06:33
Copilot AI lite review requested due to automatic review settings August 20, 2026 06:33
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

@ZJPex is attempting to deploy a commit to the hikariming's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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