/** * promote 证据门禁(纯函数,无 IO)——`omk list` 读侧判据的写侧对应。 * * 把「这份当前版本是否值得 ship」收成一组可拦截原因(spec evidence-gated-management.md §5 mandatory four * + §7 default gate)。默认只放行 verdict=PROGRESS(omk default-strict:影响「值得 ship」判定的默认必须严格); * CAUTIOUS 需显式 `acceptCautious`;其余 verdict 一律拦。可比性核对(judge prompt 是否还是当前评委)用 * **注入**的当前 judge hash 集合,故本模块不依赖 grading 层、保持叶子可测。 * * force(越门)不在此处:门禁只产「客观判定」。CLI 拿到结果后决定是否 `--force` 越过——但**无当前证据时 * 无 evidence 可锚定,force 也越不过**(返回的 evidence 为 undefined,CLI 据此拒绝空证据 promote)。 */ import type { ManagedArtifactRecord, ManagedEvidenceRef } from '../types/index.js'; export type PromoteBlockKind = 'drifted' | 'no_current_evidence' | 'incomparable' | 'verdict_blocked'; export interface PromoteBlock { /** 限定判别字(裸 kind 留给 ArtifactKind,见 terminology-spec §5.4);这是「拦截原因」分类、非持久。 */ blockKind: PromoteBlockKind; /** 供 CLI 拼 i18n 参数的可读细节(被拦的 verdict / judge hash 等)。 */ detail?: Record; } export interface PromoteGateInput { record: ManagedArtifactRecord; /** 当前源内容 hash;undefined = 源不可达 / 解析失败(probeSourceState reachable:false)。 */ currentContentHash?: string; /** 接受 CAUTIOUS(默认只接受 PROGRESS)。 */ acceptCautious?: boolean; /** 当前 omk 的 judge prompt hash 集合(debias on/off 两变体)。CLI 用 getJudgePromptHash 算好注入, * 使本模块不依赖 grading 层。空集 / 省略 = 跳过可比性核对(只在无法取 judge hash 时)。 */ currentJudgeHashes?: ReadonlySet; } export interface PromoteGateResult { /** 无任何拦截原因 → 门禁通过。 */ ok: boolean; blocked: PromoteBlock[]; /** 非拦截级提醒(如 judgePromptHash 缺失、无从核对可比性)。 */ warnings: PromoteBlock[]; /** 命中判定的当前有效证据;无当前证据时 undefined —— CLI 据此判定「force 也不能空证据 promote」。 */ evidence?: ManagedEvidenceRef; drifted: boolean; } export declare function evaluatePromoteGate(input: PromoteGateInput): PromoteGateResult;