fix: governance-drift 评论按漂移指纹去重(红队 RB-B2,ADR-0016) - #51
Conversation
漂移指纹=报告 sha256,嵌入评论隐藏标记;新评论前查最近 10 条, 指纹已存在且漂移未变化则跳过。漂移内容变化=新指纹=新评论。
|
Warning Review limit reached
Next review available in: 12 minutes Limit details: You’ve used all 3 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
PR Summary by Qodo按漂移报告指纹去重 governance-drift 评论
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
qodo 意见(High):对全量报告计算 sha256,但报告含每次运行都变的 字段——§8 回填时限秒数随时间增长、OK 行的检测窗口/commit 数随日期 漂移——同一未回填漂移每天得到新指纹,去重失效。 修复:指纹只取 DRIFT 行(OK 行是健康度波动非漂移语义)、归一化 "回填时限=NNNs"→"<AGE>s"、排序去重后 sha256。语义集合不变则指纹 跨日恒定;漂移新增/消除/实质变化才产生新指纹触发新评论。 验证:同一漂移跨日(AGE 秒数/OK 窗口/commit 数全变)指纹不变; 漂移集变化(换 commit sha)指纹变化。
1. 指纹比对改为该 issue 全部评论(原只看最近 10 条——同一指纹若在 更早的自动评论里会被漏检而重复发布;长期未回填漂移的旧报告正是 这种形态)。 2. 增 workflow 级 concurrency(group: governance-drift,排队不取消): "查指纹→写评论"非原子,两个并发运行可能都未发现指纹而各自评论; 串行化后后发运行等前者落评论后再查指纹,构成原子保护。
ADR-0016(决策 7,解决 .github #46 RB-B2)
问题(复核属实):漂移持续存在时(如破玻璃未回填的直推 commit——当前线上即有 2 项存量),
if:failure分支每日对同一 issue 追加一条全量报告评论,而if:success关闭分支永不可达——评论无限膨胀,真实变化被淹没在重复噪音里。修复:指纹去重——
sha256(drift-report.txt),以隐藏 HTML 注释嵌入每条报告:<!-- drift-fingerprint: FP -->语义变为:open issue + 无新评论 = 漂移未变化持续存在;新评论 = 漂移变化;关闭评论 = 漂移消除。噪音从"每日+1"降为"变化才+1"。
本地验证:YAML 解析通过。