// engine/universal-rules/rules/planu-approval-gates.ts — Universal rule: approval and done gates
function buildBody() {
    return `# Planu Approval and Done Gates

Auto-generated by \`init_project\`. Do not edit manually.

## Approval Gate

Before moving a spec to \`approved\`, run and pass:

1. \`challenge_spec\`
2. \`check_readiness\`
3. BDD criteria completeness
4. files-to-create / files-to-modify ownership
5. test plan and verification commands
6. independent \`planu-spec-reviewer\` evidence in \`review_feedback\`

The spec author, planner, or implementation agent must not self-approve the spec. If reviewer evidence is missing, malformed, or written by any agent other than \`planu-spec-reviewer\`, stop before approval and produce the missing review first.

User pressure or force-approval language does not bypass reviewer evidence. Record forced intent in the audit trail, but keep the status blocked until \`planu-spec-reviewer\` approves the spec.

## Done Gate

Before moving a spec to \`done\`, run \`validate\` and require independent \`planu-implementation-reviewer\` evidence.

The implementation reviewer must be different from the implementation agent. If validation passes but reviewer evidence is missing, malformed, or written by the implementer, keep the spec out of \`done\`.

If implementation intentionally diverged from the approved spec, run \`reconcile_spec\` first and make the divergence explicit before marking done.

## Hard Blocks

- Do not approve specs with placeholders.
- Do not approve specs without \`planu-spec-reviewer\` evidence.
- Do not mark done without validation evidence.
- Do not mark done without \`planu-implementation-reviewer\` evidence.
- Do not let the same agent write the spec, implement it, and approve its own work.
- Do not hide intentional drift; reconcile it.
`;
}
export const planuApprovalGatesRule = {
    id: 'planu-approval-gates',
    name: 'Planu Approval Gates',
    description: 'Requires challenge/readiness before approval and validate/reconcile before done.',
    category: 'safety',
    applicableHosts: ['all'],
    defaultEnabled: true,
    buildContent: (_host) => buildBody(),
};
//# sourceMappingURL=planu-approval-gates.js.map