实现示例function validEpoch(v: number): boolean { return v > 0 && Number.isInteger(v) }
type BuildCfg = { epoch: number; timezone: 'UTC' | 'Local' }
function evaluate(cfg: BuildCfg, now: number): { ok: boolean; errors: string[] } {
const errors: string[] = []
if (!validEpoch(cfg.epoch)) errors.push('epoch')
if (cfg.timezone !== 'UTC') errors.push('tz')
if (cfg.epoch > now) errors.push('future')
return { ok: errors.length === 0, errors }
}
审计与构建治理审计统一时间戳与时区设置;不合规阻断并输出修复建议。产物哈希比对与复验通过后再发布。

发表评论 取消回复