<?php

declare(strict_types=1);

final class MyronQualityRuleRegistry
{
    /**
     * @return list<array{id:string,severity:string,message:string,remediation:string}>
     */
    public function rules(): array
    {
        return [
            [
                'id' => 'page.exists',
                'severity' => 'block',
                'message' => 'Page record exists.',
                'remediation' => 'Create or reload the page before publishing.',
            ],
            [
                'id' => 'template.current_version',
                'severity' => 'block',
                'message' => 'The selected template has a current version.',
                'remediation' => 'Choose a template with a current version before publishing.',
            ],
            [
                'id' => 'page.title',
                'severity' => 'block',
                'message' => 'Page title is present.',
                'remediation' => 'Add a page title before publishing.',
            ],
            [
                'id' => 'page.slug',
                'severity' => 'block',
                'message' => 'Page slug/path can be generated.',
                'remediation' => 'Provide a valid slug or page name before publishing.',
            ],
            [
                'id' => 'content.json',
                'severity' => 'block',
                'message' => 'Page content can be encoded as JSON.',
                'remediation' => 'Remove unsupported content values before publishing.',
            ],
            [
                'id' => 'content.headline',
                'severity' => 'warn',
                'message' => 'Page headline is present.',
                'remediation' => 'Add a headline to improve page clarity.',
            ],
            [
                'id' => 'content.body',
                'severity' => 'warn',
                'message' => 'Page body content is present.',
                'remediation' => 'Add body content to improve page usefulness.',
            ],
            [
                'id' => 'funnel.timer.deadline_bound_offer',
                'severity' => 'block',
                'message' => 'Timed offers must bind the visible deadline to the actual offer destination.',
                'remediation' => 'Connect the countdown deadline to checkout, offer eligibility, and expired routing before launch.',
            ],
            [
                'id' => 'funnel.subscription.online_cancel',
                'severity' => 'block',
                'message' => 'Subscription funnels must expose an online cancellation path.',
                'remediation' => 'Add online cancellation or retention-cancellation handling before enabling the funnel.',
            ],
            [
                'id' => 'funnel.archetype.cg.pressure',
                'severity' => 'block',
                'message' => 'Caregiver funnels cannot use pressure or false scarcity patterns.',
                'remediation' => 'Remove urgency, shame, or artificial scarcity components from CG archetype funnels.',
            ],
            [
                'id' => 'funnel.timer.deadline_anchor',
                'severity' => 'warn',
                'message' => 'Timed funnels should explain what event starts the deadline.',
                'remediation' => 'Add deadline anchor copy, such as opt-in time or cart enrollment time.',
            ],
            [
                'id' => 'funnel.offer.disclosure',
                'severity' => 'warn',
                'message' => 'Funnel offers should include clear price and terms disclosure.',
                'remediation' => 'Add price, renewal, refund, or material terms near the offer action.',
            ],
            [
                'id' => 'funnel.consent.capi',
                'severity' => 'warn',
                'message' => 'CAPI events should only emit when visitor consent is present.',
                'remediation' => 'Gate conversion API events behind consent state.',
            ],
        ];
    }
}
