/**
 * AS9100D / AS9110C / AS9120B Aerospace Quality Management Systems Compliance Pack
 *
 * AS9100 Rev D (2016, aligned to ISO 9001:2015) — international aerospace quality
 * management standard published by SAE International and the International Aerospace
 * Quality Group (IAQG). Three variant standards share the same framework:
 *
 *   AS9100D — Aerospace manufacturing (Tier 1 / 2 / 3 suppliers to prime contractors)
 *   AS9110C — Maintenance, Repair and Overhaul (MRO) organizations
 *   AS9120B — Aerospace distributors (stockist, broker, franchise distributor)
 *
 * Required by every primary aerospace OEM and their supply chains:
 *   Boeing (D6-82479 / D6-82479-1), Airbus (EN9100), Lockheed Martin, Northrop Grumman,
 *   Raytheon Technologies, BAE Systems, Embraer, Bombardier, Honeywell,
 *   Pratt & Whitney, GE Aerospace, Safran, Rolls-Royce, L3Harris, HEICO.
 *
 * Regulatory acceptance:
 *   - FAA Order 8100.16 — Production Approval Holder supply-chain requirements
 *   - EASA Part 21 Subpart G (Production Organisation Approvals) + Part 21 Subpart J
 *     (Design Organisation Approvals) — include QMS requirements aligned with AS9100D
 *   - Transport Canada (TCCA) Airworthiness Manual Chapter 561 / 573
 *   - JCAB (Japan) — AS9100 accepted under JCAB bilateral agreements
 *   - ANAC (Brazil) — RBHA / RBAC 21 production organisation requirements
 *   - CAAC (China) — CCAR-21 Section D production organisation requirements
 *
 * ISO 9001:2015 alignment + aerospace-specific additions (Annex SL high-level structure):
 *   Clause 4  — Context of the organization (stakeholder needs + scope of QMS)
 *   Clause 5  — Leadership (incl. AS9100D §5.1.1.1 — Product Safety Policy; top management
 *               must establish, implement, and maintain a documented product safety policy)
 *   Clause 6  — Planning (incl. AS9100D §6.1 — Risks + Opportunities; §8.1.4 — Counterfeit
 *               Parts Prevention plan — unique aerospace-specific clause)
 *   Clause 7  — Support (incl. AS9100D §7.5 — special process qualification and records;
 *               documented evidence of process qualification is mandatory for heat treatment,
 *               welding, NDT/NDE, plating, composites — any process where defects cannot
 *               be fully detected by inspection alone)
 *   Clause 8  — Operation (incl. AS9100D §8.1.2 — Configuration Management baseline +
 *               change control; §8.5.4 — Foreign Object Debris/Damage (FOD) prevention
 *               program; §8.5.5 — Post-Delivery Activities including warranty, airworthiness
 *               data, and customer support; §8.5.3 — Customer and External Property —
 *               tooling, drawing packages, and customer-furnished equipment)
 *   Clause 9  — Performance evaluation (incl. AS9100D §9.1.1 — On-Time Delivery (OTD)
 *               and Product Conformity (First-Pass Yield / Escape Rate) mandatory metrics
 *               for all aerospace suppliers — tracked and reported to customers quarterly)
 *   Clause 10 — Improvement (CAPA aligned with FAR 21 + EASA Part 21J — Corrective Action
 *               and Preventive Action with root-cause analysis, effectiveness verification,
 *               and mandatory escalation when safety impact is identified)
 *
 * Key aerospace-specific clauses with no ISO 9001:2015 equivalent:
 *   §5.1.1.1  — Product Safety Policy (mandatory written policy + training records)
 *   §6.1.2.1  — Risk Management (FMEA, FTA, or equivalent risk analysis tool mandatory)
 *   §8.1.2    — Configuration Management (CM baseline, change control, CM records)
 *   §8.1.4    — Counterfeit Parts Prevention (approved sources, verification methods,
 *               quarantine and reporting procedures, supply chain risk mitigation)
 *   §8.5.1.2  — Special Processes (operator qualification, equipment approval, procedure
 *               qualification — NADCAP accreditation is the primary industry mechanism)
 *   §8.5.4    — FOD Prevention (Foreign Object Debris/Damage program, training, inspection)
 *
 * OASIS (Online Aerospace Supplier Information System):
 *   IAQG operates OASIS — the global database where AS9100/AS9110/AS9120 certification
 *   records are published by IAQG-authorized certification bodies (CBs). Audit findings
 *   are publicly visible to OEM customers via OASIS. Certification lapse or major findings
 *   trigger supply-chain qualification suspension at most OEMs.
 *
 * IAQG Americas Aerospace Quality Group (AAQG) / Europe Asia Pacific Aerospace Quality
 * Group (EAQG) — regional IAQG bodies that administer AS9100 certification via
 * IAQG-approved CBs (BSI, Bureau Veritas, DNV, Intertek, SGS, TÜV SÜD, Lloyd's Register,
 * NQA, SAI Global, LRQA).
 *
 * Retention:
 *   18-year airworthiness lifetime baseline (6570 days). Matches DO-178C (avionics software)
 *   and FAA Order 8100.16 production approval records baseline. Some aircraft type records
 *   (e.g., commercial transport category) require records for the aircraft operational life
 *   + 2 years, which can exceed 30 years for long-life aircraft programs.
 *
 * Incident reporting:
 *   FAA SDR (Service Difficulty Report — 14 CFR §121.703, §135.415) and EASA Part 21J
 *   occurrence reporting requirements: 24 hours for safety-significant occurrences.
 *   Boeing/Airbus contractual discrepancy reporting: typically 24-72 hours.
 *
 * Sister standard to DO-178C (avionics software functional safety — typically run together
 * for software-bearing Line Replaceable Units). Pairs with DO-330 (tool qualification),
 * SAE ARP4754A (aircraft system development), SAE ARP4761 (safety assessment), AS9117
 * (delegated product release verification), NADCAP (special process accreditation),
 * ITAR/EAR (export control applicable to most aerospace programs).
 *
 * @connexum/ai-governance
 */
/**
 * AS9100D / AS9110C / AS9120B category classifiers.
 *
 * Covers aerospace quality management system artefacts:
 *   - Configuration management baselines and change records
 *   - Counterfeit parts prevention records and quarantine documentation
 *   - Special process qualification evidence (NADCAP, heat treat, weld, NDT)
 *   - FOD prevention program records
 *   - Product safety policy documentation and training records
 *   - First Article Inspection (FAI) records per AS9102
 *   - Nonconformance reports and CAPA records
 */
export const AS_9100_CATEGORY_CLASSIFIERS = {
    /**
     * SAFETY_CRITICAL_RECORD — Product safety policy documentation, safety impact
     * CAPA, and safety-significant occurrence records (AS9100D §5.1.1.1 + §10.2).
     * Safety-impacting nonconformances and CAPA records require immediate escalation
     * to the product safety officer and customer quality representative.
     * AI-generated changes to safety-critical records are BLOCKED pending
     * DER/CVE liaison review and product safety officer sign-off.
     */
    SAFETY_CRITICAL_RECORD: {
        references: [
            'AS9100D §5.1.1.1 — Product Safety Policy',
            'AS9100D §10.2 — Nonconformity and Corrective Action (CAPA with safety impact)',
        ],
        classifier: (input) => {
            if (/\b(?:product[_\s-]safety[_\s-](?:policy|record|report|finding|impact)|safety[_\s-]significant[_\s-]occurrence|safety[_\s-]impact[_\s-]capa)\b/i.test(input))
                return true;
            if (/\b(?:as9100[_\s-]safety|aerospace[_\s-]safety[_\s-]record|der[_\s-]review|cve[_\s-]liaison[_\s-]review)\b/i.test(input))
                return true;
            if (/\b(?:airworthiness[_\s-](?:concern|finding|record)|faa[_\s-]sdr[_\s-]report|easa[_\s-]occurrence[_\s-]report)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * COUNTERFEIT_PARTS_RECORD — Counterfeit parts prevention and detection records
     * (AS9100D §8.1.4). Counterfeit part detection or quarantine events require
     * immediate escalation. IAQG counterfeit part reporting may involve ERAI, GIDEP.
     * Changes to approved source lists or counterfeit part verification procedures
     * require quality manager and customer quality representative review.
     */
    COUNTERFEIT_PARTS_RECORD: {
        references: [
            'AS9100D §8.1.4 — Counterfeit Parts Prevention',
            'SAE AS5553 — Counterfeit Electronic Parts; Avoidance, Detection, Mitigation, and Disposition',
        ],
        classifier: (input) => {
            if (/\b(?:counterfeit[_\s-]parts?|counterfeit[_\s-]components?|suspect[_\s-]counterfeit|unapproved[_\s-]parts?)\b/i.test(input))
                return true;
            if (/\b(?:approved[_\s-]source[_\s-]list|asl[_\s-]deviation|gidep[_\s-]alert|erai[_\s-]report|as5553[_\s-]record)\b/i.test(input))
                return true;
            if (/\b(?:as9100_counterfeit|counterfeit_parts_prevention|cpl_record|suspect_unapproved_part)\b/.test(input))
                return true;
            return false;
        },
    },
    /**
     * CONFIGURATION_MANAGEMENT_RECORD — Configuration management baseline and change
     * control records (AS9100D §8.1.2). Configuration baselines define the approved
     * design / manufacturing configuration at a given point in the product lifecycle.
     * Configuration changes require formal approval through the engineering change order
     * (ECO) / engineering change request (ECR) process. AI-generated configuration
     * changes are REVIEWED — they enter the approval queue for CM lead sign-off.
     */
    CONFIGURATION_MANAGEMENT_RECORD: {
        references: [
            'AS9100D §8.1.2 — Configuration Management',
            'AS9100D §8.3.6 — Design and Development Changes (design configuration control)',
        ],
        classifier: (input) => {
            if (/\b(?:configuration[_\s-]management|configuration[_\s-]baseline|config[_\s-]baseline|engineering[_\s-]change[_\s-](?:order|request)|ECO|ECR)\b/i.test(input))
                return true;
            if (/\b(?:cm[_\s-]record|configuration[_\s-]item|as9100[_\s-]cm|drawing[_\s-]revision[_\s-]baseline)\b/i.test(input))
                return true;
            if (/\b(?:configuration_management_record|cm_baseline|as9100d_cm)\b/.test(input))
                return true;
            return false;
        },
    },
    /**
     * SPECIAL_PROCESS_RECORD — Special process qualification, operator certification,
     * and equipment approval records (AS9100D §8.5.1.2). Special processes include
     * heat treatment, welding, brazing, non-destructive testing (NDT/NDE), chemical
     * processing, plating, painting, composite fabrication, and any process where
     * defects cannot be fully verified by subsequent inspection alone. NADCAP
     * accreditation is the aerospace industry primary mechanism for special process
     * qualification. Changes require process engineer + quality manager review.
     */
    SPECIAL_PROCESS_RECORD: {
        references: [
            'AS9100D §8.5.1.2 — Special Processes',
            'NADCAP — National Aerospace and Defense Contractors Accreditation Program',
        ],
        classifier: (input) => {
            if (/\b(?:special[_\s-]process(?:es)?|nadcap[_\s-](?:accreditation|record|audit|approval|certification)|heat[_\s-]treatment[_\s-](?:record|spec|cert))\b/i.test(input))
                return true;
            if (/\b(?:welding[_\s-](?:qualification|procedure|certification)|ndt[_\s-](?:record|cert|procedure)|nde[_\s-](?:record|cert)|non[_\s-]destructive[_\s-](?:test|inspection))\b/i.test(input))
                return true;
            if (/\b(?:as9100_special_process|composite[_\s-]process[_\s-]cert|plating[_\s-]process[_\s-]record|painting[_\s-]process[_\s-]cert)\b/.test(input))
                return true;
            return false;
        },
    },
    /**
     * FOD_PREVENTION_RECORD — Foreign Object Debris/Damage (FOD) prevention program
     * records (AS9100D §8.5.4). FOD events — discovery of foreign objects in
     * assembled hardware or detection of damage caused by foreign objects — require
     * immediate investigation and corrective action. FOD program records include
     * inspection reports, training records, and FOD walk/sweep documentation.
     * AI-generated changes to FOD procedures require quality manager review.
     */
    FOD_PREVENTION_RECORD: {
        references: [
            'AS9100D §8.5.4 — Foreign Object Debris Prevention',
            'NAS 412 — Foreign Object Damage/Foreign Object Debris Prevention Program',
        ],
        classifier: (input) => {
            if (/\b(?:FOD|foreign[_\s-]object[_\s-](?:debris|damage|prevention|detection|event)|fod[_\s-](?:walk|sweep|inspection|program|event|report))\b/i.test(input))
                return true;
            if (/\b(?:as9100_fod|nas[_\s-]412[_\s-]record|foreign_object_debris_record)\b/.test(input))
                return true;
            return false;
        },
    },
};
/**
 * AS9100D / AS9110C / AS9120B Aerospace Quality Management Systems Compliance Pack.
 *
 * Pack ID: 'as-9100'
 * Jurisdiction: International — required by every primary aerospace OEM (Boeing,
 *   Airbus, Lockheed Martin, Northrop Grumman, Raytheon, BAE Systems, Embraer,
 *   Bombardier, Honeywell, Pratt & Whitney, GE Aerospace). FAA Order 8100.16
 *   production approval; EASA Part 21G + Part 21J; Transport Canada; JCAB; ANAC.
 *
 * Guard-layer wiring:
 *   - G1-G4 (audit, logging, classification, session): always active
 *   - G5 (supply-chain): always active — approved-source-list + counterfeit parts
 *   - G6 (approval-queue): always active — special process + CM + safety-impact CAPA
 *   - G7 (attestation): always active — FAI, NADCAP cert, DER/CVE liaison sign-off
 *   - G8 (anomaly-detector): always active — counterfeit-parts-detected behavioral block
 *   - G9 (transparency): always active — provenance disclosure to QMS auditors
 *
 * Human-in-loop tier:
 *   - T1: Routine QMS records (quality manager review)
 *   - T2: Safety impact, counterfeit parts, configuration baseline changes
 *         (product safety officer + customer quality rep + regulatory affairs sign-off)
 *   - T3: FAA SDR / EASA occurrence report (DER/CVE liaison + regulatory affairs)
 */
export const AS_9100_PACK = {
    categoryClassifiers: AS_9100_CATEGORY_CLASSIFIERS,
    /**
     * Safety critical and counterfeit parts records are subject-keyed per
     * part number / configuration item — traceability to specific aircraft
     * components is mandatory for airworthiness accountability under AS9100D
     * §8.1.2 (configuration management) + §10.2 (CAPA).
     */
    subjectKeyedCategories: [
        'SAFETY_CRITICAL_RECORD',
        'COUNTERFEIT_PARTS_RECORD',
        'CONFIGURATION_MANAGEMENT_RECORD',
        'SPECIAL_PROCESS_RECORD',
    ],
    id: 'as-9100',
    aliases: ['as9100', 'as9110', 'as9120', 'aerospace-qms'],
    name: 'AS9100D / AS9110C / AS9120B Aerospace Quality Management Systems',
    version: '1.0.0',
    description: 'AS9100D / AS9110C / AS9120B (2016) — aerospace quality management standard family ' +
        'published by SAE International + IAQG (International Aerospace Quality Group). ' +
        'AS9100D for manufacturing, AS9110C for MRO, AS9120B for distribution. Builds on ' +
        'ISO 9001:2015 (Annex SL clauses 4-10) with aerospace-specific additions: §5.1.1.1 ' +
        'Product Safety Policy (mandatory written policy), §6.1 Risk + Opportunity Management ' +
        '(FMEA / FTA), §8.1.4 Counterfeit Parts Prevention (approved-source-list + quarantine), ' +
        '§8.1.2 Configuration Management (CM baseline + change control), §8.5.1.2 Special ' +
        'Processes (NADCAP accreditation — heat treat, weld, NDT, composites, plating), ' +
        '§8.5.4 FOD Prevention (Foreign Object Debris/Damage program), §9.1.1 On-Time Delivery ' +
        '+ Product Conformity metrics (mandatory quarterly supplier metrics). CAPA aligned with ' +
        'FAR 21 + EASA Part 21J. Required by Boeing, Airbus, Lockheed Martin, Northrop Grumman, ' +
        'Raytheon, BAE Systems, Embraer, Bombardier, Honeywell, Pratt & Whitney, GE Aerospace. ' +
        'FAA Order 8100.16 + EASA Part 21G/21J recognized. 15 validators including CRITICAL ' +
        'behavioral validator for counterfeit-parts-detected immediate escalation. 18-year ' +
        'airworthiness retention (6570 days). 24h FAA SDR + EASA Part 21J occurrence reporting. ' +
        'Reviewer tier: ASQ CQA Aerospace / IAQG AAQG Lead Auditor. Sister standard: DO-178C ' +
        '(avionics software functional safety — run together for software-bearing LRUs).',
    authority: 'SAE International + International Aerospace Quality Group (IAQG); recognized by ' +
        'FAA Order 8100.16, EASA Part 21J + Part 21G, Transport Canada Airworthiness Manual ' +
        'Chapter 561/573, JCAB, ANAC RBHA/RBAC 21, CAAC CCAR-21; required by every primary ' +
        'aerospace OEM (Boeing, Airbus, Lockheed Martin, Northrop Grumman, Raytheon, BAE Systems, ' +
        'Embraer, Bombardier, Honeywell, Pratt & Whitney, GE Aerospace)',
    industries: [
        'aerospace-manufacturing',
        'aerospace-mro',
        'aerospace-distribution',
        'tier-1-aerospace-supplier',
        'tier-2-aerospace-supplier',
        'commercial-aviation',
        'defense-aviation',
        'space-systems',
    ],
    requiredModules: [
        {
            name: 'governance-runtime',
            required: true,
            reason: 'Product safety policy (§5.1.1.1) enforcement mandatory for all AS9100D-governed AI ' +
                'operations — every AI-generated artefact touching an AS9100D QMS process must pass ' +
                'product safety policy gate before proceeding. Counterfeit parts prevention (§8.1.4) ' +
                'requires approved-source-list enforcement and immediate escalation on detection. ' +
                'Configuration management baseline (§8.1.2) enforced — no AI-generated change ' +
                'proceeds without CM lead verification. Special process qualification (§8.5.1.2) ' +
                'required — NADCAP-governed process records gated. FOD prevention (§8.5.4) program ' +
                'compliance enforced. On-time delivery + product conformity metrics (§9.1.1) must ' +
                'be tracked. CAPA safety-impact immediate escalation enforced (§10.2).',
            reference: 'AS9100D §5.1.1.1 (Product Safety Policy); §8.1.4 (Counterfeit Parts); §8.1.2 (CM); §8.5.1.2 (Special Processes); §8.5.4 (FOD); §9.1.1 (Metrics); §10.2 (CAPA)',
        },
        {
            name: 'audit-integrity',
            required: true,
            reason: 'Tamper-evident records for AS9100D QMS lifecycle artefacts: configuration management ' +
                'baselines and change records (§8.1.2), counterfeit parts prevention records including ' +
                'quarantine disposition (§8.1.4), special process qualification evidence and NADCAP ' +
                'certificates (§8.5.1.2), FOD inspection and event records (§8.5.4), First Article ' +
                'Inspection (FAI) records per AS9102, CAPA records with root-cause analysis (§10.2), ' +
                'product safety policy training records (§5.1.1.1). Required for IAQG OASIS audit ' +
                'evidence, OEM customer source approval maintenance, FAA surveillance audit packages, ' +
                'EASA Part 21G/21J production approval documentation, and NADCAP performance review.',
            reference: 'AS9100D §7.5 — Documented information; §8.1.2 — CM records; §8.1.4 — counterfeit parts records; §10.2 — CAPA records',
        },
        {
            name: 'data-classifier',
            required: true,
            reason: 'AS9100D category signal detection: safety critical record identification (§5.1.1.1 + ' +
                '§10.2 safety-impact CAPA — CRITICAL escalation path); counterfeit parts / suspect ' +
                'unapproved parts detection (§8.1.4 — CRITICAL behavioral block); configuration ' +
                'management baseline artefact identification (§8.1.2 — approval-queue routing); ' +
                'special process qualification evidence classification (§8.5.1.2 — NADCAP records); ' +
                'FOD prevention program document detection (§8.5.4); on-time delivery and product ' +
                'conformity metric artefacts (§9.1.1 — supplier scorecard classification).',
            reference: 'AS9100D §5.1.1.1; §8.1.2; §8.1.4; §8.5.1.2; §8.5.4; §9.1.1; §10.2',
        },
        {
            name: 'supply-chain',
            required: true,
            reason: 'AS9100D §8.4 — Externally provided processes, products and services (purchasing ' +
                'controls + supplier qualification). Approved-source-list (ASL) enforcement: ' +
                'AI-generated supplier selections must be validated against the ASL before ' +
                'purchasing is initiated. Counterfeit parts supply-chain risk assessment (§8.1.4) ' +
                'requires vendor traceability to original equipment manufacturer (OEM) or franchised ' +
                'distributor. NADCAP special process supplier qualification status verification ' +
                '(§8.5.1.2). Delegated product release / source inspection management (AS9117). ' +
                'ITAR / EAR export control supply-chain classification enforcement.',
            reference: 'AS9100D §8.4 — Control of externally provided processes, products and services; §8.1.4 — counterfeit parts supply-chain risk',
        },
        {
            name: 'approval-queue',
            required: true,
            reason: 'AS9100D requires formal approval gates for: configuration management changes ' +
                '(§8.1.2 — CM lead + design authority sign-off); special process qualification ' +
                'changes (§8.5.1.2 — process + quality engineer sign-off); CAPA with safety ' +
                'impact (§10.2 — product safety officer + customer quality rep sign-off); ' +
                'design and development changes (§8.3.6 — design authority + DER/CVE review). ' +
                'On-time delivery and product conformity metric acceptability gates (§9.1.1 — ' +
                'quality manager review before submission to customer OEM supplier scorecard).',
            reference: 'AS9100D §8.1.2 (CM change approval); §8.3.6 (design change); §8.5.1.2 (special process); §10.2 (CAPA escalation)',
        },
        {
            name: 'attestation-manager',
            required: true,
            reason: 'AS9100D attestation requirements: First Article Inspection (FAI) conformance per ' +
                'AS9102 — full dimensional + material + functional conformance attestation by ' +
                'qualified inspector before production approval; NADCAP special process ' +
                'certification attestation (§8.5.1.2); design authority attestation for engineering ' +
                'change (§8.3.6); DER (Designated Engineering Representative) or CVE (Compliance ' +
                'Verification Engineer) attestation for FAA/EASA regulatory design changes; ' +
                'product safety officer attestation for safety-impacting CAPA closure (§10.2); ' +
                'supplier certification of conformance (CofC) chain-of-custody attestation.',
            reference: 'AS9100D §5.1.1.1 (product safety officer attestation); §8.1.4 (counterfeit parts disposition attestation); AS9102 (FAI attestation)',
        },
        {
            name: 'session-persistence',
            required: true,
            reason: 'AS9100D QMS records and airworthiness documentation must persist for the full ' +
                '18-year airworthiness retention baseline (6570 days). Configuration management ' +
                'baselines and change records (§8.1.2) must be traceable across the full product ' +
                'lifecycle — for commercial transport aircraft this routinely exceeds 30 years. ' +
                'CAPA records (§10.2) must remain available for FAA surveillance, EASA Part 21G ' +
                'production organization approval renewal, and IAQG OASIS certification body audits. ' +
                'Counterfeit parts quarantine and disposition records (§8.1.4) must be permanently ' +
                'retained for ERAI / GIDEP reporting traceability.',
            reference: 'AS9100D §7.5 — Documented information: 18-year airworthiness lifecycle baseline; FAA Order 8100.16 production records retention',
        },
        {
            name: 'anomaly-detector',
            required: true,
            reason: 'Real-time detection of counterfeit or suspect-unapproved parts events (§8.1.4 — ' +
                'CRITICAL immediate escalation to quality manager + customer quality rep + regulatory ' +
                'affairs). Detection of AI-generated changes to configuration baselines without CM ' +
                'lead verification (§8.1.2 — CRITICAL block). Safety-impacting nonconformance ' +
                'detection (§10.2 — immediate escalation to product safety officer + DER/CVE liaison). ' +
                'FOD event detection requiring immediate production halt and investigation (§8.5.4). ' +
                'On-time delivery or product conformity metric threshold breach requiring escalation ' +
                'to quality manager + supply-chain management (§9.1.1 customer scorecard risk).',
            reference: 'AS9100D §8.1.4 — counterfeit parts anomaly; §8.1.2 — CM anomaly; §10.2 — safety-impact CAPA trigger; §8.5.4 — FOD event',
        },
        {
            name: 'transparency-injector',
            required: true,
            reason: 'AI-generated QMS documentation provenance disclosure to AS9100D quality managers, ' +
                'IAQG-trained AAQG lead auditors, ASQ CQA Aerospace-certified auditors, and OEM ' +
                'customer quality representatives. Required for IAQG OASIS audit evidence to ' +
                'distinguish AI-generated content from human-authored quality records. FAA-accepted ' +
                'quality management records must have a clear human-responsible author of record — ' +
                'AI-generated content must be disclosed and attested by a qualified signatory. ' +
                'Provenance disclosure on every AI output used in a QMS record without independent ' +
                'manual verification by a qualified quality engineer.',
            reference: 'AS9100D §7.5 — Documented information control; FAA Order 8100.16 — production records accountability',
        },
        {
            name: 'event-bus',
            required: true,
            reason: 'AS9100D QMS lifecycle event routing: counterfeit-parts-detected event (§8.1.4 — ' +
                'CRITICAL immediate escalation + customer notification + ERAI/GIDEP reporting); ' +
                'configuration baseline change event (§8.1.2 — CM lead + design authority routing); ' +
                'safety-impacting CAPA event (§10.2 — product safety officer + DER/CVE liaison + ' +
                'regulatory affairs routing); FAA SDR / EASA Part 21J occurrence report 24h ' +
                'deadline routing; NADCAP certificate expiry events (§8.5.1.2 — production ' +
                'suspension trigger); OTD / product conformity metric threshold events (§9.1.1 — ' +
                'customer scorecard risk routing); FOD event (§8.5.4 — production halt routing).',
            reference: 'AS9100D §8.1.4 — counterfeit parts event; §8.1.2 — CM event; §10.2 — CAPA event; FAA SDR 14 CFR §121.703 + §135.415 — 24h reporting',
        },
    ],
    moduleConfig: {
        'governance-runtime': {
            productSafetyPolicyRequired: true,
            counterfeitPartsPreventionRequired: true,
            configurationManagementBaselineRequired: true,
            specialProcessQualificationRequired: true,
            fodPreventionRequired: true,
            designReviewApprovalRequired: true,
            supplierQualificationRequired: true,
            postDeliverySupportRecordsRequired: true,
            onTimeDeliveryMetricsRequired: true,
            productConformityMetricsRequired: true,
            capaImmediateEscalationOnSafetyImpact: true,
        },
        'approval-queue': {
            configurationManagementChangeApprovalRequired: true,
            specialProcessChangeApprovalRequired: true,
            safetyImpactCapaApprovalRequired: true,
            designChangeApprovalRequired: true,
            humanInLoopTierRoutine: 'T1',
            humanInLoopTierSafetyImpact: 'T2',
            humanInLoopTierFaaEasaReport: 'T3',
        },
        'attestation-manager': {
            firstArticleInspectionAttestationRequired: true,
            nadcapCertificateAttestationRequired: true,
            derCveLiaisonAttestationRequired: true,
            productSafetyOfficerAttestationRequired: true,
            supplierCertificateOfConformanceRequired: true,
        },
        'supply-chain': {
            approvedSourceListEnforcementRequired: true,
            counterfeitPartsRiskAssessmentRequired: true,
            nadcapSupplierStatusVerificationRequired: true,
            itarEarClassificationRequired: true,
            supplierCofCChainOfCustodyRequired: true,
        },
        'anomaly-detector': {
            counterfeitPartsDetectedImmediateEscalationRequired: true,
            safetyImpactNonconformanceImmediateEscalationRequired: true,
            configurationBaselineUnauthorizedChangeBlockRequired: true,
            fodEventProductionHaltRequired: true,
        },
        'transparency-injector': {
            aiGeneratedQmsDocumentProvenanceDisclosureRequired: true,
            humanSignatoryAttestationForFaaRecordsRequired: true,
        },
        'event-bus': {
            counterfeitPartsDetectedEventsActive: true,
            configurationBaselineChangeEventsActive: true,
            safetyImpactCapaEventsActive: true,
            faaSdrEasaOccurrenceReportDeadlineEventsActive: true,
            nadcapCertExpiryEventsActive: true,
            otdProductConformityThresholdEventsActive: true,
            fodEventProductionHaltEventsActive: true,
        },
    },
    providerPolicy: {
        blockedProviders: ['deepseek', 'baidu', 'alibaba'],
        requiredCapabilities: ['AS9100-READY', 'AEROSPACE-QMS', 'ITAR-EAR-COMPLIANT'],
        blockReasons: {
            deepseek: 'PRC-jurisdiction LLM providers cannot meet ITAR + EAR + FAA Order 8100.16 + ' +
                'EASA Part 21J supply-chain provisions for aerospace QMS environments. AS9100D ' +
                'quality records, configuration management baselines, counterfeit parts prevention ' +
                'data, and CAPA records for defense-related aerospace programs are subject to ITAR ' +
                '(22 CFR §120-130) and EAR (15 CFR §730-774) export control regulations. PRC data ' +
                'localisation law (National Security Law / CSL / DSL) creates an unresolvable ' +
                'conflict with ITAR §123 and EAR §734 — routing aerospace QMS data through PRC- ' +
                'jurisdiction services creates an unlicensed export violation. FAA Order 8100.16 ' +
                'production approval records and EASA Part 21G/21J design organization approval ' +
                'documentation must remain under verifiable non-PRC data sovereignty.',
            baidu: 'PRC-jurisdiction LLM; AS9100D aerospace QMS records, configuration management ' +
                'baselines, and counterfeit parts prevention data for defense programs subject to ' +
                'ITAR (22 CFR §120-130) + EAR (15 CFR §730-774). PRC CSL/DSL data-localisation ' +
                'obligations are incompatible with ITAR §123 and EAR §734 export control requirements. ' +
                'IAQG OASIS certification records and NADCAP special process data must remain outside ' +
                'PRC data jurisdiction for US DoD program compliance (DFARS 252.204-7012 + CMMC) and ' +
                'FAA/EASA production approval documentation integrity.',
            alibaba: 'PRC-jurisdiction LLM; aerospace QMS records subject to ITAR/EAR export control ' +
                'cannot be routed through PRC data jurisdiction per FAA Order 8100.16, EASA Part ' +
                '21G/21J, and DoD DFARS 252.204-7012 requirements. Configuration management baselines ' +
                'for military aircraft programs (AS9100D) are ITAR-controlled technical data requiring ' +
                'export licence or licence exception before any disclosure outside US or NATO ' +
                'jurisdiction. PRC CSL/DSL creates an unlicensed export violation for such data. ' +
                'Counterfeit parts prevention records under AS9100D §8.1.4 must be traceable in ' +
                'ERAI and GIDEP — both require non-PRC data infrastructure for US compliance.',
        },
    },
    dataPolicy: {
        scanCategories: [
            'SAFETY_CRITICAL_RECORD',
            'COUNTERFEIT_PARTS_RECORD',
            'CONFIGURATION_MANAGEMENT_RECORD',
            'SPECIAL_PROCESS_RECORD',
            'FOD_PREVENTION_RECORD',
        ],
        categoryActions: {
            // Safety critical: AI-generated changes BLOCKED — product safety officer + DER/CVE required
            SAFETY_CRITICAL_RECORD: 'BLOCK',
            // Counterfeit parts: BLOCK — immediate escalation; no compensating control path
            COUNTERFEIT_PARTS_RECORD: 'BLOCK',
            // CM records: REVIEWED — approval queue for CM lead + design authority sign-off
            CONFIGURATION_MANAGEMENT_RECORD: 'REVIEWED',
            // Special process: REVIEWED — NADCAP / process engineer review before acceptance
            SPECIAL_PROCESS_RECORD: 'REVIEWED',
            // FOD: REVIEWED — quality manager review before returning to production
            FOD_PREVENTION_RECORD: 'REVIEWED',
        },
        encryptionRequired: true,
        encryptionStandard: 'AES-256-GCM',
        minimumClassification: 'RESTRICTED',
    },
    retentionPolicy: {
        /**
         * 18-year airworthiness lifetime baseline (6570 days).
         * Matches DO-178C (avionics software) and FAA Order 8100.16 production
         * approval records baseline. For commercial transport aircraft the aircraft
         * operational life can exceed 30 years — apply the product-specific lifetime
         * requirement when it exceeds the 18-year baseline.
         *
         * Counterfeit parts quarantine and disposition records (§8.1.4): permanently
         * retained for ERAI / GIDEP traceability — not subject to the 18-year limit.
         */
        sovereignty: ['us', 'eu', 'gb', 'ca', 'au'],
        auditLogRetentionDays: 6570, // 18 years — airworthiness lifetime baseline
        sessionRetentionDays: 6570,
        incidentRetentionDays: 6570,
        reference: 'FAA Order 8100.16 — Production Approval Holder records: airworthiness lifetime baseline. ' +
            'AS9100D §7.5 — Documented information: retained per regulatory requirements and customer ' +
            'contracts. EASA Part 21G — Production Organisation Approvals records retention. ' +
            'Transport Canada Airworthiness Manual Chapter 561 — production approval records. ' +
            'Airworthiness lifetime baseline: 18 years (6570 days); aircraft programs may require longer.',
    },
    incidentPolicy: {
        /**
         * FAA SDR (Service Difficulty Report — 14 CFR §121.703, §135.415):
         *   Safety-significant occurrences reported within 96 hours (mandatory SDR).
         *   Malfunction and defect reports for manufacturers: 24h for safety-significant.
         *
         * EASA Part 21J occurrence reporting:
         *   Design organisation approval (DOA) holders: 24h for safety-significant
         *   occurrences per EASA Part 21 §21.A.3B + AMC 21.A.3B.
         *
         * Conservative baseline for aerospace QMS: 24h for safety-significant occurrences.
         * Boeing DPR / Airbus NCR contractual discrepancy reporting: typically 24-72h.
         */
        notificationDeadlineHours: 24, // 24h — FAA SDR safety-significant + EASA Part 21J occurrence baseline
        reference: 'FAA 14 CFR §21.3 — Manufacturer defect reporting (24h for safety-significant). ' +
            'EASA Part 21 §21.A.3B — DOA occurrence reporting (24h for safety-significant events). ' +
            'FAA 14 CFR §121.703 / §135.415 — SDR reporting (96h statutory; 24h OEM contractual). ' +
            'Boeing D6-82479 / Airbus EN9100 — OEM contractual discrepancy reporting timelines.',
        requiredRecipients: [
            'quality-manager',
            'configuration-management-lead',
            'product-safety-officer',
            'customer-quality-rep',
            'regulatory-affairs',
            'der-cve-liaison',
        ],
        formalNotificationRequired: true,
    },
    validators: [
        {
            id: 'as9100-product-safety-policy',
            description: 'Product Safety Policy established, documented, implemented, and maintained per ' +
                'AS9100D §5.1.1.1: top management has defined and published a written aerospace ' +
                'product safety policy; policy includes commitment to product safety in design, ' +
                'manufacturing, and support; all personnel with product safety responsibilities ' +
                'have been trained on the policy; policy reviewed at management reviews (§9.3); ' +
                'product safety representative designated with defined authority. This clause has ' +
                'no ISO 9001:2015 equivalent — it is an AS9100D-specific leadership requirement. ' +
                'Missing or undocumented product safety policy is a CRITICAL nonconformance that ' +
                'triggers OEM source approval suspension in most first-tier aerospace supply chains.',
            reference: 'AS9100D §5.1.1.1 (Product Safety Policy)',
            check: 'as9100_product_safety_policy',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'as9100-counterfeit-parts-prevention',
            description: 'Counterfeit Parts Prevention plan established and implemented per AS9100D §8.1.4: ' +
                'approved source list (ASL) maintained and enforced for procurement of aviation-safety ' +
                'parts; counterfeit parts prevention training active for procurement and incoming ' +
                'inspection staff; suspect parts verification procedures documented (visual inspection, ' +
                'x-ray, chemical analysis, electrical test as appropriate); counterfeit parts ' +
                'quarantine procedure active — suspect parts segregated from conforming stock; ' +
                'ERAI and/or GIDEP reporting procedure established for confirmed counterfeit parts; ' +
                'customer notification procedure documented. This clause (§8.1.4) has no ISO 9001:2015 ' +
                'equivalent. Discovery of a counterfeit part without a documented prevention plan ' +
                'is a CRITICAL finding with immediate OEM customer notification required.',
            reference: 'AS9100D §8.1.4 (Counterfeit Parts)',
            check: 'as9100_counterfeit_parts_prevention',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'as9100-configuration-management',
            description: 'Configuration Management (CM) program established per AS9100D §8.1.2: CM baseline ' +
                'defined and documented for each configuration item (CI); configuration change control ' +
                'process active — no engineering change proceeds without formal change authority (ECO/ECR ' +
                'process); product build records (travellers / routers) traceable to configuration ' +
                'baseline; configuration audit (functional + physical CAs) performed at product ' +
                'lifecycle gates; CM records retained for the airworthiness lifetime of the product. ' +
                'This clause (§8.1.2) has no ISO 9001:2015 equivalent. Absent CM baseline or ' +
                'unauthorized configuration change is a CRITICAL nonconformance — triggers customer ' +
                'notification and engineering investigation.',
            reference: 'AS9100D §8.1.2 (Configuration Management)',
            check: 'as9100_configuration_management',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'as9100-special-process-controls',
            description: 'Special process controls established per AS9100D §8.5.1.2: all special processes ' +
                '(heat treatment, welding, brazing, NDT/NDE, chemical processing, plating, composite ' +
                'fabrication) identified; process qualification evidence on file (procedure approval + ' +
                'equipment qualification + operator certification); NADCAP accreditation or equivalent ' +
                'third-party process qualification active where customer-required (Boeing and Airbus ' +
                'routinely require NADCAP for heat treat, welding, NDT, chemical processing, composites); ' +
                'special process qualification status verified before production run; lapsed NADCAP ' +
                'or process qualification triggers production suspension. This clause (§8.5.1.2) ' +
                'has no ISO 9001:2015 equivalent.',
            reference: 'AS9100D §8.5.1.2 (Special Processes)',
            check: 'as9100_special_process_controls',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-fod-prevention',
            description: 'Foreign Object Debris/Damage (FOD) Prevention program established per AS9100D §8.5.4: ' +
                'FOD prevention plan documented; FOD prevention training active for all production ' +
                'and inspection personnel; FOD inspections scheduled and documented at appropriate ' +
                'production stages; clean work environment standards enforced; FOD event investigation ' +
                'procedure active — any FOD discovery triggers production halt, investigation, and ' +
                'corrective action; FOD sweep records retained. This clause (§8.5.4) has no ISO ' +
                '9001:2015 equivalent. Customer-required FOD program (NAS 412 or equivalent) must ' +
                'be demonstrably implemented — missing FOD program is an OEM-reportable finding.',
            reference: 'AS9100D §8.5.4 (Foreign Object Debris)',
            check: 'as9100_fod_prevention',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-risk-and-opportunity-management',
            description: 'Risk and opportunity management process active per AS9100D §6.1: risks and opportunities ' +
                'for the QMS and product safety determined; risk analysis tools applied (FMEA, FTA, or ' +
                'equivalent per §6.1.2.1 — this is an AS9100D addition to ISO 9001:2015 §6.1); ' +
                'risk register maintained and reviewed at management reviews (§9.3); counterfeit parts ' +
                'risk assessment integrated (§8.1.4); supply-chain risk assessment documented (§8.4); ' +
                'risk treatment actions with owners and timelines tracked; residual risk accepted by ' +
                'quality manager or product safety officer (for safety-significant risks). FMEA or ' +
                'equivalent required for all design and manufacturing processes at customer request.',
            reference: 'AS9100D §6.1 (Risks + Opportunities)',
            check: 'as9100_risk_and_opportunity_management',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-design-development-controls',
            description: 'Design and Development (D&D) controls established per AS9100D §8.3: D&D planning ' +
                'per §8.3.2 (project plan, reviews, verification, validation gates); design inputs ' +
                'per §8.3.3 (requirements derived from customer needs, regulatory requirements, ' +
                'airworthiness standards); design outputs per §8.3.4 (specifications, drawings, ' +
                'manufacturing instructions traceable to requirements); design reviews per §8.3.4 ' +
                '(formal gate reviews with defined attendees and action tracking); design verification ' +
                'per §8.3.5 (test results confirming output meets input requirements); design ' +
                'validation per §8.3.5 (type testing or representative testing); design change control ' +
                'per §8.3.6 (ECO/ECR process with classification review — safety-significant changes ' +
                'require DER/CVE and customer notification). First Article Inspection per AS9102.',
            reference: 'AS9100D §8.3 (Design + Development)',
            check: 'as9100_design_development_controls',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-purchasing-controls',
            description: 'Purchasing and supplier controls established per AS9100D §8.4: approved source list ' +
                '(ASL) maintained covering all externally-provided aviation-safety parts, materials, ' +
                'and services; supplier qualification process documented (initial qualification + ' +
                'ongoing performance monitoring); customer-approved / customer-designated sources ' +
                'used where contractually required (Boeing and Airbus D1-4426 lists, Airbus AQMS ' +
                'approved suppliers); purchasing documents include applicable technical specifications, ' +
                'standards references, and quality requirements; incoming inspection or source ' +
                'inspection per §8.4.3; supplier performance tracked against quality metrics ' +
                '(on-time delivery + conformity + escapes). Delegation of supplier selection outside ' +
                'ASL requires quality manager approval.',
            reference: 'AS9100D §8.4 (Purchasing + supplier controls)',
            check: 'as9100_purchasing_controls',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-product-realisation',
            description: 'Production and service provision controls established per AS9100D §8.5: controlled ' +
                'conditions for production maintained — approved workmanship standards, qualified ' +
                'operators, qualified equipment, approved materials, environmental controls; ' +
                'manufacturing planning (routers / travellers / job cards) traceable to approved ' +
                'engineering documentation; in-process inspection and test points defined and ' +
                'documented; first-off inspection and statistical process control (SPC) where ' +
                'required by customer or process risk; process monitoring and measurement equipment ' +
                'calibrated per §7.1.5; production records traceable to specific serial/lot numbers; ' +
                'post-delivery activities including warranty, airworthiness data supply, and ' +
                'customer support documented per §8.5.5.',
            reference: 'AS9100D §8.5 (Production + service provision)',
            check: 'as9100_product_realisation',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-identification-traceability',
            description: 'Product identification and traceability program established per AS9100D §8.5.2: ' +
                'all products, parts, and materials identified throughout the production lifecycle; ' +
                'serialized or lot-controlled identification maintained for aviation-safety parts; ' +
                'traceability of materials to original mill certifications / certificates of conformance; ' +
                'traceability of production records (inspection, test, special process) to specific ' +
                'part/serial numbers; traceability of design configuration (drawing revision, ' +
                'specification revision) to specific manufactured items; suspect or nonconforming ' +
                'parts segregated and identified to prevent inadvertent use. Counterfeit parts ' +
                'traceability to approved source required per §8.1.4 integration.',
            reference: 'AS9100D §8.5.2 (Identification + Traceability)',
            check: 'as9100_identification_traceability',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-customer-property',
            description: 'Customer and external property controls established per AS9100D §8.5.3: customer- ' +
                'furnished equipment (CFE), customer-furnished material (CFM), customer-owned tooling, ' +
                'customer drawings and technical data packages, and customer-supplied software ' +
                'identified and segregated; incoming condition verified before acceptance; property ' +
                'loss or damage reported to customer; intellectual property (IP) protection per ' +
                'customer contract and applicable export control (ITAR/EAR technical data). ' +
                'Customer-furnished GFE (Government Furnished Equipment) subject to additional ' +
                'tracking per DoD FAR Supplement (DFARS) §252.245-7002 through §252.245-7004 ' +
                'when applicable to US government contracts.',
            reference: 'AS9100D §8.5.3 (Customer + External Property)',
            check: 'as9100_customer_property',
            failSeverity: 'MEDIUM',
        },
        {
            id: 'as9100-post-delivery-support',
            description: 'Post-delivery support activities established per AS9100D §8.5.5: warranty repair ' +
                'and return processes documented; airworthiness data provision to operators, maintenance ' +
                'organizations, and regulators defined (AD compliance data, service information letters, ' +
                'airworthiness limitations); post-delivery product surveillance or field monitoring ' +
                'active for safety-significant issues; customer field support responsibilities ' +
                'defined; post-delivery nonconformances reported through the CAPA process (§10.2); ' +
                'FAA SDR reporting for safety-significant post-delivery issues (14 CFR §21.3 / ' +
                '§121.703 / §135.415); EASA Part 21J post-delivery occurrence reporting; in-service ' +
                'data feedback loop to design and manufacturing for product improvement.',
            reference: 'AS9100D §8.5.5 (Post-Delivery Support)',
            check: 'as9100_post_delivery_support',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-on-time-delivery-conformity',
            description: 'On-Time Delivery (OTD) and Product Conformity (first-pass yield / escape rate) ' +
                'performance metrics established and tracked per AS9100D §9.1.1: OTD metric ' +
                'calculated and reported to OEM customers on the frequency specified by contract ' +
                '(typically monthly); product conformity metric (first-pass yield %, PPM escape rate, ' +
                'field escape rate) tracked; supplier scorecard performance thresholds maintained; ' +
                'metrics reviewed at management review (§9.3); metric degradation triggers corrective ' +
                'action (§10.2); OTD and conformity data submitted to Boeing Supply Chain Portal, ' +
                'Airbus SupplyOn, or equivalent OEM supplier performance management system as required. ' +
                'AS9100D §9.1.1 explicitly requires these two metric categories — no ISO 9001:2015 ' +
                'equivalent makes this mandatory.',
            reference: 'AS9100D §9.1.1 (Performance metrics)',
            check: 'as9100_on_time_delivery_conformity',
            failSeverity: 'MEDIUM',
        },
        {
            id: 'as9100-corrective-action',
            description: 'Nonconformity and Corrective Action (CAPA) process established per AS9100D §10.2: ' +
                'all nonconformances documented and classified by severity; root-cause analysis (RCA) ' +
                'performed using structured methods (5-why, Ishikawa/fishbone, 8D, or equivalent); ' +
                'corrective action plan with owners and target completion dates; escape-point analysis ' +
                'and detection-gap closure; effectiveness verification before CAPA closure; safety- ' +
                'impacting nonconformances escalated immediately to product safety officer (§5.1.1.1) ' +
                'and DER/CVE liaison with FAA/EASA notification per §21.3 / Part 21J where required; ' +
                'supplier CAPA tracking for externally-sourced nonconformances (§8.4); preventive ' +
                'action to eliminate potential nonconformances before occurrence. CAPA records ' +
                'retained for airworthiness lifetime.',
            reference: 'AS9100D §10.2 (Nonconformity + CAPA)',
            check: 'as9100_corrective_action',
            failSeverity: 'HIGH',
        },
        {
            id: 'as9100-behavioral-validator-counterfeit-parts-detected',
            description: 'Behavioral validator: detects counterfeit or suspect-unapproved aerospace parts ' +
                'in any AI-generated procurement, supplier selection, or material acceptance context. ' +
                'Any AI-generated output that references, recommends, accepts, or fails to flag ' +
                'potential counterfeit parts in the aerospace supply chain must be blocked ' +
                'immediately. Counterfeit aviation-safety parts are a direct airworthiness hazard — ' +
                'no partial-pass path exists. The counterfeit-parts-detected event triggers ' +
                'immediate escalation to: quality manager, configuration management lead, product ' +
                'safety officer, customer quality representative, and regulatory affairs liaison. ' +
                'ERAI and/or GIDEP reporting initiated per §8.1.4 procedure. Production halt ' +
                'for affected assemblies pending disposition authority review. No compensating ' +
                'control path — counterfeit-parts-detected is an absolute CRITICAL block.',
            reference: 'AS9100D §8.1.4 (Counterfeit Parts) — behavioral validator: counterfeit-parts-detected immediate-escalation',
            check: 'behavioralValidator_as9100_counterfeit_parts_detected',
            failSeverity: 'CRITICAL',
        },
    ],
};
//# sourceMappingURL=as-9100.js.map