"use strict";
/**
 * Wellbeing of Future Generations (Wales) Act 2015 Compliance Pack
 *
 * Statute: Wellbeing of Future Generations (Wales) Act 2015 (anaw 2).
 *   The world's first statute placing a sustainable-development duty
 *   on public bodies operating in Wales. Unique to Wales — no GB or
 *   UK-wide equivalent.
 *
 * Jurisdiction: Wales
 * Authority:
 *   - Future Generations Commissioner for Wales — independent statutory
 *     monitor and advocate
 *   - Welsh Government — policy + sponsoring department
 *   - Auditor General for Wales — audit of public bodies' compliance
 *   - Public Services Boards (PSBs) — local-area implementation
 *
 * Why this pack:
 *   - Public bodies operating in Wales (Welsh Government, NHS Wales,
 *     local authorities, fire / police, national parks, Natural
 *     Resources Wales, public services boards, etc.) are statutorily
 *     required to act in accordance with the sustainable-development
 *     principle and contribute to the seven well-being goals.
 *   - AI agents deployed by Welsh public bodies — or by suppliers
 *     contracting with them — must be assessed against the goals and
 *     against the five ways of working.
 *   - Distinct from anything in GB or NI; unique Welsh statute.
 *
 * Seven well-being goals (s.4):
 *   1. A prosperous Wales
 *   2. A resilient Wales
 *   3. A healthier Wales
 *   4. A more equal Wales
 *   5. A Wales of cohesive communities
 *   6. A Wales of vibrant culture and thriving Welsh language
 *   7. A globally responsible Wales
 *
 * Five ways of working (s.5 — sustainable-development principle):
 *   1. Long-term thinking
 *   2. Prevention
 *   3. Integration (across goals + bodies)
 *   4. Collaboration (across public bodies + sectors)
 *   5. Involvement (of those affected by decisions)
 *
 * AI-specific overlays:
 *   - Goal-impact assessment per AI deployment (which of 7 goals is
 *     impacted, positive or negative)
 *   - Five-ways-of-working evidence per material AI decision
 *   - Welsh language considerations (goal 6) — bilingual provision +
 *     accessibility
 *   - Long-term consequence analysis (way of working 1) — temporal
 *     impact horizon documented
 *
 * Out of scope:
 *   - GB Equality Act / NI Equality (separate jurisdictions)
 *   - Welsh language Welsh Language (Wales) Measure 2011 — separate
 *     statute (sibling pack candidate, not in this scope)
 *   - Environment (Wales) Act 2016 — separate statute
 *
 * @connexum/ai-governance
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WALES_WBFG_PACK = exports.WALES_WBFG_CATEGORY_CLASSIFIERS = void 0;
exports.WALES_WBFG_CATEGORY_CLASSIFIERS = {
    WBFG_GOAL_IMPACT: {
        references: [
            'WBFG (Wales) Act 2015 s.4 — seven well-being goals',
        ],
        classifier: (input) => {
            if (/\b(?:wbfg\s+(?:goal|impact)|future\s+generations\s+(?:goal|impact)|prosperous\s+wales|resilient\s+wales|healthier\s+wales|more\s+equal\s+wales|cohesive\s+communities\s+wales|vibrant\s+culture\s+wales|globally\s+responsible\s+wales)\b/i.test(input))
                return true;
            if (/\b(?:welsh\s+language\s+goal|cymraeg\s+goal|welsh\s+well[\s-]?being\s+goal)\b/i.test(input))
                return true;
            return false;
        },
    },
    FIVE_WAYS_EVIDENCE: {
        references: [
            'WBFG (Wales) Act 2015 s.5 — sustainable-development principle, five ways of working',
        ],
        classifier: (input) => {
            if (/\b(?:long[\s-]?term\s+thinking\s+wbfg|prevention\s+(?:wbfg|future\s+generations)|integration\s+wbfg|collaboration\s+wbfg|involvement\s+wbfg)\b/i.test(input))
                return true;
            if (/\b(?:five\s+ways\s+of\s+working|sustainable\s+development\s+principle\s+wales)\b/i.test(input))
                return true;
            return false;
        },
    },
    COMMISSIONER_ENGAGEMENT: {
        references: [
            'WBFG (Wales) Act 2015 — Future Generations Commissioner engagement',
        ],
        classifier: (input) => {
            if (/\b(?:future\s+generations\s+commissioner|fgc\s+wales|commissioner\s+wales\s+engagement)\b/i.test(input))
                return true;
            if (/\b(?:s\.?\s*20\s+wbfg|s\.?\s*21\s+wbfg|fgc\s+section\s+20|fgc\s+section\s+21)\b/i.test(input))
                return true;
            return false;
        },
    },
    PSB_LOCAL_PLAN: {
        references: [
            'WBFG (Wales) Act 2015 Part 4 — Public Services Boards',
        ],
        classifier: (input) => {
            if (/\b(?:public\s+services\s+board|psb\s+wales|local\s+well[\s-]?being\s+plan|well[\s-]?being\s+assessment\s+psb)\b/i.test(input))
                return true;
            return false;
        },
    },
    WELSH_LANGUAGE_PROVISION: {
        references: [
            'WBFG goal 6 — vibrant culture and thriving Welsh language',
            'Welsh Language (Wales) Measure 2011 overlap',
        ],
        classifier: (input) => {
            if (/\b(?:welsh\s+language\s+(?:provision|standard|service|version)|cymraeg\s+(?:provision|standard|service|version))\b/i.test(input))
                return true;
            if (/\b(?:bilingual\s+(?:provision|service|interface)|treat\s+welsh\s+no\s+less\s+favourably)\b/i.test(input))
                return true;
            return false;
        },
    },
    AUDIT_GENERAL_REPORT: {
        references: [
            'WBFG (Wales) Act 2015 s.15 — Auditor General audit',
        ],
        classifier: (input) => {
            if (/\b(?:auditor\s+general\s+wales|wao\s+wbfg|audit\s+wales\s+wbfg)\b/i.test(input))
                return true;
            if (/\b(?:s\.?\s*15\s+wbfg\s+audit|wbfg\s+audit\s+report)\b/i.test(input))
                return true;
            return false;
        },
    },
    CREDENTIALS: {
        references: ['Cross-pack secrets safety; WBFG artefacts must not embed credentials'],
        classifier: (input) => {
            if (/\b(?:api[_-]?key|apikey)\s*[=:]\s*["']?[A-Za-z0-9_\-\/+]{16,}["']?/i.test(input))
                return true;
            if (/\bpassword\s*[=:]\s*["']?[A-Za-z0-9!@#$%^&*_\-]{8,}["']?/i.test(input))
                return true;
            if (/-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----/.test(input))
                return true;
            return false;
        },
    },
};
exports.WALES_WBFG_PACK = {
    categoryClassifiers: exports.WALES_WBFG_CATEGORY_CLASSIFIERS,
    id: 'wales-future-generations',
    aliases: [
        'wales-wbfg',
        'wbfg',
        'wbfg-wales',
        'wellbeing-of-future-generations-wales',
        'future-generations-wales',
    ],
    name: 'Wellbeing of Future Generations (Wales) Act 2015',
    version: '1.0.0',
    description: 'World-first sustainable-development statute placing a duty on public bodies in Wales (Welsh Government, NHS Wales, local authorities, fire/police, national parks, Natural Resources Wales, PSBs). Seven well-being goals (prosperous, resilient, healthier, more equal, cohesive, vibrant culture and Welsh language, globally responsible) PLUS five ways of working (long-term, prevention, integration, collaboration, involvement). AI agents deployed by Welsh public bodies or their suppliers must be assessed against the goals and ways of working. Unique to Wales — no GB or UK-wide equivalent. Audited by Auditor General for Wales; monitored by the Future Generations Commissioner for Wales.',
    authority: 'Future Generations Commissioner for Wales + Welsh Government + Auditor General for Wales + Public Services Boards',
    industries: ['public-sector', 'healthcare', 'social-care', 'education', 'energy', 'transport', 'environment'],
    requiredModules: [
        {
            name: 'attestation-manager',
            required: true,
            reason: 'Per-AI-deployment goal-impact assessment (which of 7 goals impacted, positive/negative); five-ways-of-working evidence; FGC engagement record; PSB local-plan alignment; Auditor General audit response.',
            reference: 'WBFG (Wales) Act 2015 ss.3-5, 15, 20, Part 4',
        },
        {
            name: 'governance-runtime',
            required: true,
            reason: 'Default-deny on AI deployment touching Welsh public-body service paths without goal-impact assessment + five-ways-of-working evidence.',
            reference: 'WBFG (Wales) Act 2015 ss.3-5',
        },
        {
            name: 'audit-integrity',
            required: true,
            reason: 'Tamper-evident audit chain for goal-impact decisions, five-ways-of-working evidence revisions, FGC engagement, PSB plan revisions, Auditor General audit responses.',
            reference: 'WBFG s.15 Auditor General audit',
        },
        {
            name: 'data-classifier',
            required: true,
            reason: 'Surface WBFG evidence categories (goal impact, ways evidence, commissioner engagement, PSB plan, Welsh-language provision, audit-general report).',
            reference: 'WBFG evidence categorisation',
        },
        {
            name: 'transparency-injector',
            required: true,
            reason: 'Goal-6 Welsh language provision: bilingual interfaces; treat Welsh no less favourably than English; involvement (5th way) of those affected by AI decisions.',
            reference: 'WBFG goal 6; Welsh Language Measure 2011 overlap',
        },
        {
            name: 'approval-queue',
            required: true,
            reason: 'High-impact AI deployments routed for T2 review against the five ways of working; FGC engagement triggered for material decisions.',
            reference: 'WBFG ss.5, 20',
        },
        {
            name: 'event-bus',
            required: true,
            reason: 'FGC notice routing; PSB plan-revision events; Auditor General audit reminders; goal-impact threshold alerts.',
            reference: 'WBFG ss.20, 15',
        },
        {
            name: 'session-persistence',
            required: true,
            reason: 'WBFG evidence retained for the Auditor General audit cycle plus a buffer year (typically 3-year audit cycle + 6-year retention to align with public-records practice).',
            reference: 'Public Records Wales practice; WBFG audit cycle',
        },
        {
            name: 'supply-chain',
            required: true,
            reason: 'Sub-suppliers to Welsh public bodies acting under contracted public functions inherit the WBFG duty; flow-down evidence captured.',
            reference: 'WBFG public-function contractors',
        },
        {
            name: 'attestation-manager',
            required: true,
            reason: 'Long-term consequence analysis (way of working 1): temporal impact horizon documented; future-generations consequence chain captured.',
            reference: 'WBFG s.5(2)(a)',
        },
    ],
    moduleConfig: {
        'attestation-manager': {
            goalImpactAssessmentRequired: true,
            fiveWaysEvidenceRequired: true,
            fgcEngagementRecorded: true,
            psbLocalPlanAlignmentTracked: true,
            longTermConsequenceAnalysisRequired: true,
        },
        'governance-runtime': {
            welshPublicBodyDeploymentGateRequired: true,
            defaultDenyOnMissingGoalImpactAssessment: true,
        },
        'audit-integrity': {
            auditorGeneralEvidenceTrackingRequired: true,
        },
        'data-classifier': {
            enabledCategories: [
                'WBFG_GOAL_IMPACT',
                'FIVE_WAYS_EVIDENCE',
                'COMMISSIONER_ENGAGEMENT',
                'PSB_LOCAL_PLAN',
                'WELSH_LANGUAGE_PROVISION',
                'AUDIT_GENERAL_REPORT',
                'CREDENTIALS',
            ],
            credentialsAction: 'BLOCK',
        },
        'transparency-injector': {
            bilingualInterfaceRequired: true,
            welshLanguageNoLessFavourableRequired: true,
            involvementOfAffectedPersonsRequired: true,
        },
        'approval-queue': {
            fiveWaysReviewRequired: true,
            fgcEngagementForMaterialDecisionsRequired: true,
            reviewTier: 'T2',
        },
        'event-bus': {
            fgcNoticeRoutingRequired: true,
            psbPlanRevisionEventsRequired: true,
            auditorGeneralAuditRemindersRequired: true,
            goalImpactThresholdAlertsRequired: true,
        },
        'session-persistence': {
            retentionDaysMinimum: 2190, // 6 years
        },
        'supply-chain': {
            publicFunctionContractorWbfgFlowDownRequired: true,
        },
    },
    providerPolicy: {
        blockedProviders: ['deepseek', 'baidu', 'alibaba'],
        requiredCapabilities: ['DATA-RESIDENCY-UK-OR-EU', 'PROCESSOR-CONTRACT', 'WELSH-LANGUAGE-CAPABLE'],
        blockReasons: {
            deepseek: 'PRC jurisdiction. WBFG s.5 long-term and globally-responsible goals plus public-body procurement expectations preclude PRC routing.',
            baidu: 'PRC jurisdiction. Inadequate alignment with WBFG globally-responsible goal.',
            alibaba: 'PRC jurisdiction. Inadequate alignment with WBFG globally-responsible goal.',
        },
    },
    dataPolicy: {
        scanCategories: [
            'WBFG_GOAL_IMPACT',
            'FIVE_WAYS_EVIDENCE',
            'COMMISSIONER_ENGAGEMENT',
            'PSB_LOCAL_PLAN',
            'WELSH_LANGUAGE_PROVISION',
            'AUDIT_GENERAL_REPORT',
            'CREDENTIALS',
        ],
        categoryActions: {
            WBFG_GOAL_IMPACT: 'WARN',
            FIVE_WAYS_EVIDENCE: 'WARN',
            COMMISSIONER_ENGAGEMENT: 'WARN',
            PSB_LOCAL_PLAN: 'WARN',
            WELSH_LANGUAGE_PROVISION: 'WARN',
            AUDIT_GENERAL_REPORT: 'WARN',
            CREDENTIALS: 'BLOCK',
        },
        encryptionRequired: true,
        encryptionStandard: 'AES-256-GCM',
        minimumClassification: 'INTERNAL',
    },
    retentionPolicy: {
        auditLogRetentionDays: 2190, // 6 years
        sessionRetentionDays: 2190,
        incidentRetentionDays: 2190,
        reference: 'WBFG audit cycle; Public Records Wales practice',
        forceDelete: false,
        requiresLegalHoldSupport: true,
        sovereignty: ['gb-wls', 'gb', 'eu'],
    },
    incidentPolicy: {
        notificationDeadlineHours: 168, // 7 days for FGC + Auditor General notification
        reference: 'FGC engagement protocol; Auditor General audit cooperation',
        requiredRecipients: ['future-generations-commissioner', 'auditor-general-wales', 'public-body-sponsor', 'data-protection-officer'],
        formalNotificationRequired: false,
    },
    validators: [
        {
            id: 'wales-wbfg-goal-impact-assessment',
            description: 'Per-AI-deployment goal-impact assessment captured for each of the 7 well-being goals; positive / neutral / negative impact rated per goal.',
            reference: 'WBFG s.4',
            check: 'attestation_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'wales-wbfg-five-ways-evidence',
            description: 'Five ways of working evidence captured: long-term, prevention, integration, collaboration, involvement.',
            reference: 'WBFG s.5',
            check: 'attestation_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'wales-wbfg-fgc-engagement',
            description: 'Future Generations Commissioner engagement recorded for material AI decisions; s.20 / s.21 notices captured.',
            reference: 'WBFG ss.20, 21',
            check: 'monitoring_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-psb-alignment',
            description: 'PSB local well-being plan alignment captured for AI deployments in PSB scope.',
            reference: 'WBFG Part 4',
            check: 'attestation_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-welsh-language',
            description: 'Welsh language provision: bilingual interface; treat Welsh no less favourably than English; goal 6 evidence captured.',
            reference: 'WBFG goal 6; Welsh Language Measure 2011',
            check: 'transparency_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-long-term-consequence',
            description: 'Long-term consequence analysis (way of working 1) captured; temporal impact horizon documented.',
            reference: 'WBFG s.5(2)(a)',
            check: 'attestation_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-involvement-evidence',
            description: 'Involvement of those affected by decisions captured; consultation evidence recorded.',
            reference: 'WBFG s.5(2)(e)',
            check: 'attestation_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-auditor-general-audit',
            description: 'Auditor General for Wales audit-cycle responses captured; s.15 audit evidence current.',
            reference: 'WBFG s.15',
            check: 'audit_trail_exists',
            failSeverity: 'HIGH',
        },
        {
            id: 'wales-wbfg-supplier-flow-down',
            description: 'Public-function contractors WBFG flow-down recorded.',
            reference: 'WBFG public-function contractors',
            check: 'subservice_registry_active',
            failSeverity: 'MEDIUM',
        },
        {
            id: 'wales-wbfg-encryption',
            description: 'WBFG evidence encrypted at rest and in transit.',
            reference: 'UK GDPR Art. 32',
            check: 'encryption_active',
            failSeverity: 'MEDIUM',
        },
    ],
};
//# sourceMappingURL=wales-future-generations.js.map