// engine/spec-migrator/planu-canonical-policy.ts — SPEC-1017
// Single source of truth for the strict Planu managed directory contract.
export const PLANU_CANONICAL_POLICY = {
    canonicalRootFiles: ['conventions.json', 'context.md', 'session-context.md', 'session.json'],
    canonicalRootDirs: ['releases', 'specs'],
    canonicalSpecFiles: ['spec.md'],
    canonicalSpecDirs: [],
    forbiddenHostAssetRootDirs: ['agents', 'skills', 'rules', 'hooks'],
    generatedRuntimePatterns: [
        'planu/index.html',
        'planu/roadmap.html',
        'planu/status.json',
        'planu/CHANGELOG.md',
        'planu/.housekeeping-history.jsonl',
        'planu/audits/',
        'planu/handoffs/',
        'planu/data/',
        'planu/state/',
        'planu/.locks/',
        'planu/specs/data/',
        'planu/specs/*/technical-report.html',
        'planu/specs/*/reference/',
        'planu/specs/*/test-stubs.ts',
        'planu/specs/*/.analysis.json',
        'planu/specs/*/prompt.md',
        'planu/specs/*/implementation-brief.md',
        'planu/specs/*/risk-register.md',
    ],
    legacyMergeBeforeDeleteFiles: [
        'technical.md',
        'plan.md',
        'PLAN.md',
        'progress.md',
        'HU.md',
        'FICHA-TECNICA.md',
        'PROGRESS.md',
    ],
};
const ROOT_FILE_SET = new Set(PLANU_CANONICAL_POLICY.canonicalRootFiles);
const ROOT_DIR_SET = new Set(PLANU_CANONICAL_POLICY.canonicalRootDirs);
const SPEC_FILE_SET = new Set(PLANU_CANONICAL_POLICY.canonicalSpecFiles);
const SPEC_DIR_SET = new Set(PLANU_CANONICAL_POLICY.canonicalSpecDirs);
const LEGACY_MERGE_SET = new Set(PLANU_CANONICAL_POLICY.legacyMergeBeforeDeleteFiles);
export function isCanonicalPlanuRootFile(name) {
    return ROOT_FILE_SET.has(name);
}
export function isCanonicalPlanuRootDir(name) {
    return ROOT_DIR_SET.has(name);
}
export function isCanonicalSpecFile(name) {
    return SPEC_FILE_SET.has(name);
}
export function isCanonicalSpecDir(name) {
    return SPEC_DIR_SET.has(name);
}
export function mustMergeBeforeDeleteSpecFile(name) {
    return LEGACY_MERGE_SET.has(name);
}
export function isCanonicalReleaseFile(relativeToPlanu) {
    return relativeToPlanu === 'releases/pending.json';
}
export function canonicalContractText() {
    return [
        'planu/',
        '  conventions.json',
        '  context.md',
        '  session-context.md',
        '  session.json',
        '  releases/',
        '    pending.json',
        '  specs/',
        '    SPEC-XXX-slug/',
        '      spec.md',
        '',
        'Evidence artifacts are Planu runtime data and are stored outside planu/specs/.',
        '',
        'Host adapters are written outside planu/:',
        '  Claude Code: .claude/agents, .claude/skills, .claude/rules',
        '  Codex: AGENTS.md, .agents/skills, .codex/agents',
        '  Gemini: GEMINI.md, .gemini/skills',
        '  Cursor: .cursor/rules/planu.mdc',
    ].join('\n');
}
//# sourceMappingURL=planu-canonical-policy.js.map