Files
Genarrative/scripts
suzmii 8e2b81007a fix(scripts): 让 Rust 告警取数确定性(挂进 npm run lint;clean 本 profile 包 + fresh 完整性断言 + 精确包集 + first-party 过滤)
接法:挂进 npm run lint(CI 的 Repository checks 与推 master 时的 pre-push 共用那条命令),不新增 job/hook;此前自造的 pre-push 触发接线(.husky/pre-push 改动、scripts/pre-push-rust-warnings.mjs、额外 CI job)已撤。
确定性:profile 专属 target 目录 + 对本 profile first-party 包逐个 cargo clean -p <包名> + 取数后 fresh 完整性断言(每个包必须出现 compiler-artifact 且 fresh=false,否则 exit 1 报测量不完整);只收 first-party 路径前缀下的告警。
修掉两个口径 bug:包集把 AGC 壳下的 vendor/ 路径依赖误算成自己(改精确目录判定);normalizeId 只取 id 的 # 片段导致server-rs 27 个同版本成员碰撞(断言永远为假)。
否决“整体清空 target 目录”:实测 AGC 壳清空后需重建 tauri/webkit 全链依赖 15-25 分钟。
实测:A 干净 agc-windows 1/1·14/14 exit 0、server-rs 27/27·0/0 exit 0;B 播种 unused import → agc-windows 15 条/新增 1、server-rs 1 条/新增 1,均 exit 1 并逐条打印;C 撤销 → 均 exit 0;负向测试(GENARRATIVE_WARNCHECK_SKIP_CLEAN 漏清一个成员)→ 26/27 + 测量不完整 → exit 1。
基线:agc-windows 14 条 / server-rs 0 条 / agc-linux 首采(首次 CI 只采集不判失败,需一次 --update-baseline)。
文档:dev 运维「Rust 编译告警门禁」同步接法、首采、开关、否决清空的原因与局限。
2026-10-07 19:57:17 +08:00
..
2026-09-22 12:42:27 +08:00
2026-09-14 18:15:12 +08:00