import type { GovernancePlanExtension } from "./types.js"; export declare const DECISIONS_DIR = ".soloforge/state/governance/decisions"; declare const SCHEMA_VERSION = 1; declare const VALID_STATUSES: readonly ["generated", "failed", "skipped"]; /** Governance 跳过原因(未触发 governance 的统计,覆盖率审计用)。 */ export type GovernanceSkipReason = "NO_CHANGE_CONTEXT" | "NO_TASK_CONTEXT" | "NO_POLICY_MATCH"; /** Governance 决策记录(最小字段:审计 + 重建)。 */ export interface GovernanceDecisionRecord { schema_version: typeof SCHEMA_VERSION; id: string; taskId: string; createdAt: number; /** governance 结果扩展;failed 时 null。 */ governanceResult: GovernancePlanExtension | null; policyIds: string[]; requirementIds: string[]; status: (typeof VALID_STATUSES)[number]; /** Policy 来源链(可追溯,可选;旧 record 无此字段,backward compatible)。 */ policyMetadata?: { policyId: string; version?: string; source?: string; }[]; /** 跳过原因(status=skipped 时记录;旧 record 无此字段兼容)。 */ skipReason?: GovernanceSkipReason; } /** GovernanceDecisionStore — governance 决策持久化(独立目录,atomicWrite + fail-close)。 */ export declare class GovernanceDecisionStore { private readonly projectRoot; constructor(projectRoot: string); private filePath; /** 保存决策(atomicWrite,覆盖同 id)。 */ save(record: GovernanceDecisionRecord): Promise; /** 读取决策(无 → null;损坏 JSON/schema → throw fail-close,不伪装不存在)。 */ get(id: string): Promise; } export {};