// storage/retention-policy-store.ts — SPEC-371: Persists data retention policy
// Layout: data/projects/{hash}/retention-policy.json
import { readJson, writeJson, projectDataDir, hashProjectPath } from './base-store.js';
const DEFAULT_POLICY = {
    retentionDays: 365,
    autoDelete: false,
    notifyBeforeDeleteDays: 7,
    updatedAt: new Date().toISOString(),
};
function policyFile(projectPath) {
    const projectId = hashProjectPath(projectPath);
    return `${projectDataDir(projectId)}/retention-policy.json`;
}
export async function loadRetentionPolicy(projectPath) {
    return readJson(policyFile(projectPath), { ...DEFAULT_POLICY });
}
export async function saveRetentionPolicy(projectPath, policy) {
    await writeJson(policyFile(projectPath), { ...policy, updatedAt: new Date().toISOString() });
}
//# sourceMappingURL=retention-policy-store.js.map