实现示例type OwnerChange = { pkg: string; from: string[]; to: string[]; time: number } function risk(ch: OwnerChange): number { const delta = Math.abs(ch.to.length - ch.from.length) const emptyRepoPenalty = ch.to.length === 0 ? 10 : 0 return delta * 2 + emptyRepoPenalty } function decide(ch: OwnerChange, thresholds: { block: number; warn: number }): 'block' | 'warn' | 'pass' { const s = risk(ch) if (s >= thresholds.block) return 'block' if (s >= thresholds.warn) return 'warn' return 'pass' } 审计与运行治理审计所有权变更并评分;阻断高风险包并触发冻结与复核。例外需到期与审批,支持回溯与对比。

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部
1.841826s