/**
 * DO-178C Avionics Software Compliance Pack
 *
 * RTCA DO-178C / EUROCAE ED-12C -- "Software Considerations in Airborne
 * Systems and Equipment Certification." The mandatory software life-cycle
 * standard for civil avionics certification under FAA 14 CFR §21.31, EASA
 * CS-25.1309, Transport Canada AWM 525, ANAC RBHA, and CASA CASR Part 21.
 *
 * Standards referenced (citations only; no verbatim text from the standard):
 *   - RTCA DO-178C (2011) -- Software Considerations in Airborne Systems
 *     and Equipment Certification (joint with EUROCAE ED-12C)
 *   - RTCA DO-330 -- Software Tool Qualification Considerations
 *   - RTCA DO-331 -- Model-Based Development and Verification Supplement
 *   - RTCA DO-332 -- Object-Oriented Technology and Related Techniques
 *   - RTCA DO-333 -- Formal Methods Supplement
 *   - RTCA DO-326A / ED-202A -- Airworthiness Security Process Specification
 *   - FAA AC 20-115D -- DO-178C as accepted means of compliance
 *   - EASA CM-SWCEH-002 -- Software Aspects of Certification
 *   - FAA Order 8110.49 Chg 2 -- Software Approval Guidelines
 *   - SAE ARP4754A / ED-79A -- Guidelines for Civil Aircraft Systems Dev
 *   - SAE ARP4761 -- Safety Assessment Process
 *
 * Software Levels (DO-178C §2.2 -- Failure Condition Categories):
 *   - Level A (Catastrophic) -- failure prevents continued safe flight
 *     and landing; multiple fatalities; loss of aircraft
 *   - Level B (Hazardous / Severe-Major) -- large reduction in safety
 *     margins; serious / fatal injuries to small number of occupants
 *   - Level C (Major) -- significant reduction in safety margins; physical
 *     distress or significant occupant workload; injuries possible
 *   - Level D (Minor) -- slight reduction in safety margins; slight
 *     increase in crew workload; minor inconvenience
 *   - Level E (No Effect) -- no effect on aircraft operation, crew
 *     workload, or safety
 *
 * Process objectives scale with level (DO-178C Annex A tables):
 *   - Level A: 71 objectives (66 with independence)
 *   - Level B: 69 objectives (47 with independence)
 *   - Level C: 62 objectives (28 with independence)
 *   - Level D: 26 objectives (5 with independence)
 *   - Level E: no objectives (outside DO-178C scope)
 *
 * Structural-coverage requirements (DO-178C §6.4.4.2):
 *   - Level A: Modified Condition / Decision Coverage (MC/DC) at 100%
 *     PLUS decision coverage PLUS statement coverage
 *   - Level B: decision coverage PLUS statement coverage
 *   - Level C: statement coverage
 *   - Level D + E: not required
 *
 * Tool Qualification (DO-330):
 *   Tools that automate, eliminate, or reduce verification activities
 *   must be qualified at Tool Qualification Level (TQL) 1 through 5.
 *   AI-assisted code generation, automated static analysis, automated
 *   test generation, and model-based design tools targeting Level A/B
 *   software typically require TQL-1 through TQL-3 qualification.
 *
 * Retention:
 *   DO-178C §11.1 software life cycle data must be retained for the
 *   operational life of the airborne system. FAA Order 8110.49 and
 *   EASA Part 21 align retention with airworthiness certificate
 *   lifetime (typical commercial aircraft: 25-30 years; effective
 *   minimum: 18 years per §11.4 and Part 21 Subpart Q).
 *
 * @connexum/ai-governance
 */
/**
 * DO-178C category classifiers.
 *
 * Covers software-level declarations (A through E), software life cycle
 * data items (requirements, design, verification procedures), MC/DC
 * coverage records, and tool qualification data per DO-330.
 */
export const DO_178C_CATEGORY_CLASSIFIERS = {
    /**
     * SOFTWARE_LEVEL_A -- Catastrophic failure condition (DO-178C §2.2).
     * Failure prevents continued safe flight and landing. Strictest process
     * burden; 71 objectives, 66 with independence; MC/DC coverage required.
     * Unauthorised changes to Level A items are BLOCKED.
     */
    SOFTWARE_LEVEL_A: {
        references: [
            'DO-178C §2.2 -- failure condition categorisation',
            'DO-178C Annex A Table A-1 through A-10 -- Level A objectives',
            'DO-178C §6.4.4.2 -- Modified Condition/Decision Coverage requirement',
        ],
        classifier: (input) => {
            if (/\b(?:DO.?178C?\s+Level\s+A|Level\s+A\s+(?:software|airborne|avionics)|software\s+(?:level|criticality)\s+A)\b/i.test(input))
                return true;
            if (/\b(?:catastrophic\s+(?:failure|hazard|condition)|level_a_software|LEVEL_A_AVIONICS)\b/i.test(input))
                return true;
            if (/\b(?:flight.?critical\s+software|continued\s+safe\s+flight\s+and\s+landing)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_LEVEL_B -- Hazardous / Severe-Major failure (DO-178C §2.2).
     * Large reduction in safety margins; serious / fatal injuries to small
     * number of occupants. 69 objectives; 47 with independence; decision
     * coverage required (MC/DC not mandated unless coupled to Level A).
     */
    SOFTWARE_LEVEL_B: {
        references: [
            'DO-178C §2.2 -- failure condition categorisation',
            'DO-178C Annex A Table A-1 through A-10 -- Level B objectives',
            'DO-178C §6.4.4.2 -- decision coverage requirement',
        ],
        classifier: (input) => {
            if (/\b(?:DO.?178C?\s+Level\s+B|Level\s+B\s+(?:software|airborne|avionics)|software\s+(?:level|criticality)\s+B)\b/i.test(input))
                return true;
            if (/\b(?:hazardous\s+(?:failure|condition)|severe.?major\s+(?:failure|condition)|level_b_software)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_LEVEL_C -- Major failure condition (DO-178C §2.2).
     * Significant reduction in safety margins; physical distress; injuries
     * possible. 62 objectives; 28 with independence; statement coverage.
     * Anomalies require REVIEW (approval queue routing).
     */
    SOFTWARE_LEVEL_C: {
        references: [
            'DO-178C §2.2 -- failure condition categorisation',
            'DO-178C Annex A Table A-1 through A-10 -- Level C objectives',
            'DO-178C §6.4.4.2 -- statement coverage requirement',
        ],
        classifier: (input) => {
            if (/\b(?:DO.?178C?\s+Level\s+C|Level\s+C\s+(?:software|airborne|avionics)|software\s+(?:level|criticality)\s+C)\b/i.test(input))
                return true;
            if (/\b(?:major\s+(?:failure|hazard|condition)\s+(?:airborne|avionics|aircraft)|level_c_software)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_LEVEL_D -- Minor failure condition (DO-178C §2.2).
     * Slight reduction in safety margins; slight crew workload increase;
     * minor inconvenience. 26 objectives; 5 with independence; no structural
     * coverage required. ALLOWED with logging.
     */
    SOFTWARE_LEVEL_D: {
        references: [
            'DO-178C §2.2 -- failure condition categorisation',
            'DO-178C Annex A Table A-1 through A-10 -- Level D objectives',
        ],
        classifier: (input) => {
            if (/\b(?:DO.?178C?\s+Level\s+D|Level\s+D\s+(?:software|airborne|avionics)|software\s+(?:level|criticality)\s+D)\b/i.test(input))
                return true;
            if (/\b(?:minor\s+(?:failure|hazard|condition)\s+(?:airborne|avionics|aircraft)|level_d_software)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_LEVEL_E -- No-effect failure condition (DO-178C §2.2).
     * No effect on aircraft operation, crew workload, or safety. Out of
     * DO-178C scope; logging only for traceability of classification rationale.
     */
    SOFTWARE_LEVEL_E: {
        references: [
            'DO-178C §2.2 -- failure condition categorisation (Level E rationale)',
        ],
        classifier: (input) => {
            if (/\b(?:DO.?178C?\s+Level\s+E|Level\s+E\s+(?:software|airborne|avionics)|software\s+(?:level|criticality)\s+E)\b/i.test(input))
                return true;
            if (/\b(?:no.?effect\s+(?:failure|condition)|level_e_software|non.?safety.?related\s+software)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_REQUIREMENT_DATA -- DO-178C §11.9 high-level + low-level
     * software requirements data items. High-level requirements derived
     * from system requirements; low-level requirements derived from
     * software architecture. Foundational artefact for all levels A-D.
     */
    SOFTWARE_REQUIREMENT_DATA: {
        references: [
            'DO-178C §11.9 -- Software Requirements Data',
            'DO-178C §5.1 -- Software Requirements Process',
        ],
        classifier: (input) => {
            if (/\b(?:software\s+requirements?\s+(?:data|specification|document|record)|HLR\s+(?:document|record)|LLR\s+(?:document|record))\b/i.test(input))
                return true;
            if (/\b(?:high.?level\s+software\s+requirements?|low.?level\s+software\s+requirements?|derived\s+software\s+requirements?)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_DESIGN_DATA -- DO-178C §11.10 software architecture and
     * low-level requirements decomposition. Required for Level A, B, C.
     */
    SOFTWARE_DESIGN_DATA: {
        references: [
            'DO-178C §11.10 -- Design Description',
            'DO-178C §5.2 -- Software Design Process',
        ],
        classifier: (input) => {
            if (/\b(?:software\s+(?:architecture|design)\s+(?:document|description|record|data)|software\s+design\s+process)\b/i.test(input))
                return true;
            if (/\b(?:design\s+description\s+document|DDD\s+(?:record|update|review)|architecture\s+description\s+document)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * SOFTWARE_VERIFICATION_PROCEDURE -- DO-178C §11.13 verification
     * procedures and §11.14 verification results. Includes test cases,
     * test procedures, review records, and analysis records.
     */
    SOFTWARE_VERIFICATION_PROCEDURE: {
        references: [
            'DO-178C §11.13 -- Software Verification Cases and Procedures',
            'DO-178C §11.14 -- Software Verification Results',
            'DO-178C §6 -- Software Verification Process',
        ],
        classifier: (input) => {
            if (/\b(?:software\s+verification\s+(?:procedure|case|result|record|cases\s+and\s+procedures)|SVCP\s+(?:document|record))\b/i.test(input))
                return true;
            if (/\b(?:test\s+(?:procedure|case)\s+(?:airborne|avionics|DO.?178)|verification\s+(?:procedure|result)\s+document)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * MC_DC_COVERAGE_RECORD -- Modified Condition / Decision Coverage
     * records (DO-178C §6.4.4.2). MANDATORY at 100% for Level A. Each
     * condition in a decision must be shown to independently affect the
     * decision outcome.
     */
    MC_DC_COVERAGE_RECORD: {
        references: [
            'DO-178C §6.4.4.2 -- structural coverage analysis',
            'DO-178C Annex A Table A-7 obj 8 -- MC/DC for Level A',
            'CAST-6 / CAST-10 -- MC/DC clarification position papers',
        ],
        classifier: (input) => {
            if (/\b(?:MC.?DC\s+(?:coverage|record|analysis|report|result)|modified\s+condition\s*\/?\s*decision\s+coverage)\b/i.test(input))
                return true;
            if (/\b(?:structural\s+coverage\s+(?:record|analysis|report|gap)|coverage\s+record\s+(?:airborne|avionics|DO.?178))\b/i.test(input))
                return true;
            if (/\b(?:decision\s+coverage\s+record|statement\s+coverage\s+record|branch\s+coverage\s+record\s+(?:DO.?178|airborne))\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * TOOL_QUALIFICATION_DATA -- DO-330 Tool Qualification Plan + Tool
     * Operational Requirements + Tool Qualification Reports. Required for
     * any tool whose output is used to satisfy DO-178C objectives without
     * independent verification (TQL-1 through TQL-5 per criteria).
     */
    TOOL_QUALIFICATION_DATA: {
        references: [
            'DO-330 -- Software Tool Qualification Considerations',
            'DO-178C §12.2 -- Tool Qualification',
            'DO-330 §11 -- Tool Qualification Data Items',
        ],
        classifier: (input) => {
            if (/\b(?:tool\s+qualification\s+(?:plan|data|report|level|TQL|criteria)|TQL.?[1-5])\b/i.test(input))
                return true;
            if (/\b(?:DO.?330\s+(?:plan|qualification|data|TOR)|tool\s+operational\s+requirements?)\b/i.test(input))
                return true;
            if (/\b(?:qualified\s+tool\s+(?:airborne|avionics|DO.?178)|tool\s+qualification\s+criteria\s+1\s+criteria\s+[23])\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * LIFECYCLE_DATA_ITEM -- DO-178C §11 software life cycle data items.
     * Catch-all for the 22 documented data items (PSAC, SDP, SVP, SCMP,
     * SQAP, software requirements data, design description, source code,
     * executable object code, verification cases/procedures/results,
     * configuration management records, quality assurance records,
     * problem reports, software accomplishment summary, etc.).
     */
    LIFECYCLE_DATA_ITEM: {
        references: [
            'DO-178C §11 -- Software Life Cycle Data',
            'DO-178C §11.1 through §11.22 -- 22 documented data items',
        ],
        classifier: (input) => {
            if (/\b(?:PSAC|SDP|SVP|SCMP|SQAP|SECI|SAS)\b/.test(input))
                return true;
            if (/\b(?:plan\s+for\s+software\s+aspects\s+of\s+certification|software\s+development\s+plan|software\s+verification\s+plan)\b/i.test(input))
                return true;
            if (/\b(?:software\s+configuration\s+management\s+plan|software\s+quality\s+assurance\s+plan|software\s+accomplishment\s+summary)\b/i.test(input))
                return true;
            if (/\b(?:software\s+life\s+cycle\s+(?:data|environment\s+configuration\s+index)|life\s+cycle\s+data\s+item\s+(?:airborne|avionics|DO.?178))\b/i.test(input))
                return true;
            return false;
        },
    },
};
/**
 * DO-178C Avionics Software Compliance Pack.
 *
 * Pack ID: 'do-178c'
 * Jurisdiction: International (RTCA / EUROCAE joint standard; adopted
 *   globally by FAA, EASA, Transport Canada, ANAC Brazil, CASA Australia,
 *   JCAB Japan, CAAC China, Civil Aviation Administration India).
 *
 * Guard-layer wiring:
 *   - G1-G4 (audit, logging, classification, session): always active
 *   - G5-G6 (supply-chain, approval-queue): Level C, B, A
 *   - G7-G8 (attestation, anomaly-detection): Level B, A
 *   - G9 (transparency): Level A only (most stringent disclosure)
 *   - Approval Queue: always active (mandatory for problem-report triage)
 *
 * Human-in-loop tier:
 *   - T1: Level D + E (basic engineering review)
 *   - T2: Level A + B + C (DER / certification authority involvement)
 */
export const DO_178C_PACK = {
    categoryClassifiers: DO_178C_CATEGORY_CLASSIFIERS,
    /**
     * Verification procedures, MC/DC coverage records, and lifecycle data
     * items are subject-keyed per software item / configuration item.
     */
    subjectKeyedCategories: [
        'SOFTWARE_VERIFICATION_PROCEDURE',
        'MC_DC_COVERAGE_RECORD',
        'LIFECYCLE_DATA_ITEM',
        'TOOL_QUALIFICATION_DATA',
    ],
    id: 'do-178c',
    name: 'DO-178C Avionics Software',
    version: '1.0.0',
    contentHash: '60b66c325c9c19accee850613d93ae2e2d08973ca1af00be778f9a133d41c4ed',
    description: 'RTCA DO-178C / EUROCAE ED-12C Software Considerations in Airborne Systems ' +
        'and Equipment Certification. Mandatory software life-cycle standard for ' +
        'civil avionics certification under FAA 14 CFR 21.31, EASA CS-25.1309, ' +
        'Transport Canada AWM 525, and equivalent jurisdictions. Five software ' +
        'levels (A catastrophic through E no-effect) drive scaled process ' +
        'objectives, structural coverage requirements (MC/DC for Level A), and ' +
        'tool qualification per DO-330. Applies to fixed-wing, rotary-wing, eVTOL, ' +
        'UAS / drone, and embedded avionics software including AI-assisted code ' +
        'generation targeting safety-critical airborne systems.',
    authority: 'RTCA / EUROCAE (joint standard); FAA + EASA acceptance per AC 20-115D / CM-SWCEH-002',
    industries: [
        'avionics',
        'aerospace',
        'commercial-aviation',
        'general-aviation',
        'rotorcraft',
        'evtol',
        'uas-drone',
        'embedded-avionics',
        'flight-control-software',
        'engine-control-software',
        'cockpit-display-systems',
        'air-traffic-management',
        'satellite-avionics',
        'space-systems-airborne',
    ],
    requiredModules: [
        {
            name: 'governance-runtime',
            required: true,
            reason: 'Software level (A/B/C/D/E) tracking; mandatory for every DO-178C process gate. ' +
                'Level A requires verification at every life-cycle phase including MC/DC structural coverage.',
            reference: 'DO-178C §2.2 -- failure condition categorisation; §4 -- software planning process',
        },
        {
            name: 'audit-integrity',
            required: true,
            reason: 'Tamper-evident records for software life cycle artefacts (PSAC, SDP, SVP, ' +
                'requirements data, design data, verification results, problem reports, ' +
                'software accomplishment summary). Immutability required for FAA / EASA ' +
                'certification submission packages.',
            reference: 'DO-178C §11 -- Software Life Cycle Data; §11.4 -- record retention',
        },
        {
            name: 'data-classifier',
            required: true,
            reason: 'Software level signal detection; lifecycle data item categorisation; ' +
                'MC/DC coverage record identification; tool qualification artefact tracking.',
            reference: 'DO-178C §2.2 -- level categorisation; §11 -- data items',
        },
        {
            name: 'supply-chain',
            required: true,
            reason: 'Tool qualification per DO-330; previously developed software (PDS) tracking; ' +
                'COTS component qualification under §12.1.4. AI-assisted code generation tools, ' +
                'static analysers, and test generators targeting Level A/B require TQL-1 to TQL-3 ' +
                'qualification and full chain-of-custody for every output used to satisfy objectives.',
            reference: 'DO-178C §12.1 -- previously developed software; §12.2 -- tool qualification; DO-330',
        },
        {
            name: 'approval-queue',
            required: true,
            reason: 'Problem report triage and closure approval per software level. Level A and B ' +
                'changes require Designated Engineering Representative (DER) or Authorised ' +
                'Representative review. Level C anomalies enter approval queue for Software ' +
                'Quality Assurance (SQA) review prior to closure.',
            reference: 'DO-178C §6.6 -- review activities; §11.17 -- problem reports',
        },
        {
            name: 'attestation-manager',
            required: true,
            reason: 'Software conformity attestations; Stage of Involvement (SOI) audit evidence ' +
                '(SOI #1-#4); Software Accomplishment Summary (SAS) sign-off; tool qualification ' +
                'attestations; MC/DC coverage attestations for Level A.',
            reference: 'DO-178C §11.20 -- Software Accomplishment Summary; §9 -- certification liaison',
        },
        {
            name: 'session-persistence',
            required: true,
            reason: 'Software life cycle data must persist for the operational life of the airborne ' +
                'system (commercial aircraft 25-30 years; rotorcraft / general aviation similar). ' +
                'Continuity of audit trail across sessions is mandatory for in-service issue ' +
                'investigation and recertification.',
            reference: 'DO-178C §11.4 -- software life cycle data control category and retention',
        },
        {
            name: 'anomaly-detector',
            required: true,
            reason: 'Real-time detection of software anomaly signals in AI-generated code targeting ' +
                'airborne systems. Flags conditions that may require Problem Report initiation ' +
                'under §11.17 and immediate impact assessment for Level A and B.',
            reference: 'DO-178C §11.17 -- Problem Reports; §6.6 -- review-detected anomalies',
        },
        {
            name: 'transparency-injector',
            required: true,
            reason: 'AI-generated code provenance disclosure to Software Quality Assurance, ' +
                'Designated Engineering Representatives, and certification authorities. ' +
                'Tool qualification status disclosure on every output that satisfies an ' +
                'objective without independent verification.',
            reference: 'DO-178C §8 -- Software Configuration Management; §12.2 -- tool qualification disclosure',
        },
        {
            name: 'event-bus',
            required: true,
            reason: 'Problem report lifecycle event routing; SOI audit milestone events; ' +
                'tool qualification status events; software conformity event tracking; ' +
                'in-service issue notification routing.',
            reference: 'DO-178C §11.17 -- problem report lifecycle; §9 -- certification liaison process',
        },
    ],
    moduleConfig: {
        'governance-runtime': {
            softwareLevelTrackingRequired: true,
            do178cLevelAProcessRequired: true,
            do178cLevelBProcessRequired: true,
            do178cLevelCProcessRequired: true,
            do178cLevelDProcessRequired: true,
            mcDcCoverageRequiredForLevelA: true,
            decisionCoverageRequiredForLevelB: true,
            statementCoverageRequiredForLevelC: true,
        },
        'approval-queue': {
            levelAChangeApprovalRequired: true,
            levelBChangeApprovalRequired: true,
            levelCAnomalyClosureApprovalRequired: true,
            derReviewRequiredForLevelAB: true,
            humanInLoopTierLevelDE: 'T1',
            humanInLoopTierLevelABC: 'T2',
        },
        'attestation-manager': {
            softwareAccomplishmentSummaryAttestationRequired: true,
            mcDcCoverageAttestationRequiredForLevelA: true,
            toolQualificationAttestationRequired: true,
            soiAuditEvidenceRequired: true,
            conformityReviewSignOffRequired: true,
        },
        'supply-chain': {
            toolQualificationInventoryRequired: true,
            do330ToolQualificationLevelTrackingRequired: true,
            previouslyDevelopedSoftwareEvaluationRequired: true,
            cotsComponentQualificationRequired: true,
            aiCodeGenToolQualificationRequired: true,
        },
        'anomaly-detector': {
            softwareAnomalySignalDetectionActive: true,
            levelAAnomalyImmediateEscalationRequired: true,
            levelBAnomalyImmediateEscalationRequired: true,
        },
        'transparency-injector': {
            aiGeneratedCodeProvenanceDisclosureRequired: true,
            toolQualificationStatusDisclosureRequired: true,
        },
        'event-bus': {
            problemReportLifecycleEventsActive: true,
            soiAuditMilestoneEventsActive: true,
            toolQualificationStatusEventsActive: true,
            conformityReviewEventsActive: true,
        },
    },
    providerPolicy: {
        blockedProviders: ['deepseek', 'baidu', 'alibaba'],
        requiredCapabilities: ['DO-178C-READY', 'AVIONICS-SW-LIFECYCLE'],
        blockReasons: {
            deepseek: 'PRC jurisdiction; cannot support DO-178C tool qualification chain-of-custody or ' +
                'airborne-software life-cycle records under PRC data law constraints; FAA / EASA ' +
                'certification authority access requirements incompatible.',
            baidu: 'PRC jurisdiction; airborne software provenance and tool qualification records ' +
                'incompatible with PRC data residency obligations and dual-use export controls ' +
                'on civil aviation software.',
            alibaba: 'PRC jurisdiction; Level A and B software artefacts must remain under verifiable ' +
                'non-PRC jurisdiction control per FAA / EASA bilateral aviation safety agreements ' +
                '(BASA) and ITAR / EAR dual-use technology controls.',
        },
    },
    dataPolicy: {
        scanCategories: [
            'SOFTWARE_LEVEL_A',
            'SOFTWARE_LEVEL_B',
            'SOFTWARE_LEVEL_C',
            'SOFTWARE_LEVEL_D',
            'SOFTWARE_LEVEL_E',
            'SOFTWARE_REQUIREMENT_DATA',
            'SOFTWARE_DESIGN_DATA',
            'SOFTWARE_VERIFICATION_PROCEDURE',
            'MC_DC_COVERAGE_RECORD',
            'TOOL_QUALIFICATION_DATA',
            'LIFECYCLE_DATA_ITEM',
        ],
        categoryActions: {
            // Level A: unauthorised changes to Level A items are BLOCKED
            SOFTWARE_LEVEL_A: 'BLOCK',
            // Level B: unauthorised changes BLOCKED (DER review required)
            SOFTWARE_LEVEL_B: 'BLOCK',
            // Level C: anomalies enter approval queue for SQA review
            SOFTWARE_LEVEL_C: 'REVIEWED',
            // Level D: logging sufficient
            SOFTWARE_LEVEL_D: 'LOG',
            // Level E: outside DO-178C scope; logging for traceability of classification
            SOFTWARE_LEVEL_E: 'LOG',
            // Requirements data: REVIEWED (changes require traceability sign-off)
            SOFTWARE_REQUIREMENT_DATA: 'REVIEWED',
            // Design data: REVIEWED (architecture changes require impact assessment)
            SOFTWARE_DESIGN_DATA: 'REVIEWED',
            // Verification procedures: logged for traceability
            SOFTWARE_VERIFICATION_PROCEDURE: 'LOG',
            // MC/DC coverage records: REVIEWED (Level A coverage gaps require analysis)
            MC_DC_COVERAGE_RECORD: 'REVIEWED',
            // Tool qualification data: REVIEWED (TQL changes require re-evaluation)
            TOOL_QUALIFICATION_DATA: 'REVIEWED',
            // Lifecycle data items: logged for SOI audit traceability
            LIFECYCLE_DATA_ITEM: 'LOG',
        },
        encryptionRequired: true,
        encryptionStandard: 'AES-256-GCM',
        minimumClassification: 'RESTRICTED',
    },
    retentionPolicy: {
        /**
         * DO-178C §11.4 software life cycle data control category 1 (CC1) and 2 (CC2)
         * must be retained for the operational life of the airborne system. FAA Order
         * 8110.49 Chg 2 + EASA Part 21 Subpart Q align retention with airworthiness
         * certificate lifetime. Commercial aircraft service life is typically 25-30
         * years. Effective minimum retention is 18 years (6570 days) to cover the
         * shortest credible airworthiness certificate lifecycle (general aviation +
         * rotorcraft + UAS) with margin for in-service issue investigation.
         */
        sovereignty: ['international'],
        auditLogRetentionDays: 6570, // 18 years -- airworthiness certificate lifetime baseline
        sessionRetentionDays: 6570,
        incidentRetentionDays: 6570,
        reference: 'DO-178C §11.4 -- software life cycle data control categories and retention. ' +
            'Cross-reference: FAA Order 8110.49 Chg 2 -- software approval; EASA Part 21 ' +
            'Subpart Q -- continued airworthiness obligations. Effective minimum: 18 years.',
    },
    incidentPolicy: {
        /**
         * In-service software issues affecting Level A or B systems are typically
         * reportable under FAA 14 CFR 21.3 (manufacturer service difficulty reports),
         * EASA Part 21A.3A (occurrence reporting), and ICAO Annex 13 (accident /
         * incident reporting). FAA SDR clock is 24 hours for catastrophic / hazardous
         * conditions; EASA mandatory occurrence report (MOR) clock is 72 hours.
         * Using 24 hours as the strictest cross-jurisdictional baseline.
         */
        notificationDeadlineHours: 24, // FAA SDR baseline for hazardous/catastrophic
        reference: 'FAA 14 CFR 21.3 -- Service Difficulty Reports (24h for hazardous/catastrophic); ' +
            'EASA Part 21A.3A -- Mandatory Occurrence Reports (72h); ICAO Annex 13 -- ' +
            'accident and incident investigation. DO-178C §11.17 problem report lifecycle ' +
            'feeds these jurisdictional reporting clocks.',
        requiredRecipients: [
            'designated-engineering-representative',
            'software-quality-assurance',
            'certification-liaison',
            'continued-airworthiness',
            'flight-safety',
        ],
        formalNotificationRequired: true,
    },
    validators: [
        {
            id: 'do178c-software-level-assigned',
            description: 'Software level (A, B, C, D, or E) assigned and documented with rationale ' +
                'derived from system safety assessment (SAE ARP4754A / ARP4761) and traceable ' +
                'to failure condition categorisation per §2.2',
            reference: 'DO-178C §2.2 -- failure condition categorisation; ARP4754A safety assessment',
            check: 'do178c_software_level_assigned',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-psac-active',
            description: 'Plan for Software Aspects of Certification (PSAC) on file; describes ' +
                'system overview, software overview, certification considerations, software ' +
                'life cycle, software life cycle data, schedule, and additional considerations',
            reference: 'DO-178C §11.1 -- Plan for Software Aspects of Certification',
            check: 'do178c_psac_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-development-plan',
            description: 'Software Development Plan (SDP) established; defines software life cycle ' +
                'model, development environment, standards, methods, tools, and deliverables',
            reference: 'DO-178C §11.2 -- Software Development Plan',
            check: 'do178c_development_plan_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-verification-plan',
            description: 'Software Verification Plan (SVP) established; defines verification methods, ' +
                'environment, independence requirements, and reverification criteria for changes',
            reference: 'DO-178C §11.3 -- Software Verification Plan; §6 -- verification process',
            check: 'do178c_verification_plan_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-requirements-data',
            description: 'High-level and low-level software requirements documented; traceable to ' +
                'system requirements; derived requirements identified and justified',
            reference: 'DO-178C §11.9 -- Software Requirements Data; §5.1 -- requirements process',
            check: 'do178c_requirements_data_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-design-description',
            description: 'Design Description Document (DDD) on file; software architecture documented; ' +
                'software components identified; data and control flow described',
            reference: 'DO-178C §11.10 -- Design Description; §5.2 -- design process',
            check: 'do178c_design_description_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-mc-dc-coverage-level-a',
            description: 'Level A: Modified Condition / Decision Coverage at 100% achieved AND ' +
                'verified; gaps in MC/DC require analysis-of-uncovered-code with deactivated ' +
                'code or dead code rationale per CAST-6 / CAST-10 guidance',
            reference: 'DO-178C §6.4.4.2 -- structural coverage; Annex A Table A-7 obj 8 (Level A MC/DC)',
            check: 'do178c_mc_dc_coverage_level_a_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-decision-coverage-level-b',
            description: 'Level B: Decision coverage at 100% achieved AND verified; statement ' +
                'coverage achieved as prerequisite; coverage gaps analysed for dead / ' +
                'deactivated code rationale',
            reference: 'DO-178C §6.4.4.2 -- structural coverage; Annex A Table A-7 obj 7 (Level B decision)',
            check: 'do178c_decision_coverage_level_b_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-tool-qualification',
            description: 'Tool qualification per DO-330 active for every tool whose output is used to ' +
                'satisfy DO-178C objectives without independent verification; TQL-1 through ' +
                'TQL-5 assigned per §12.2.2 criteria; AI code-gen tools targeting Level A/B ' +
                'qualified at TQL-1 to TQL-3',
            reference: 'DO-330 -- Software Tool Qualification Considerations; DO-178C §12.2',
            check: 'do178c_tool_qualification_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-config-management',
            description: 'Software Configuration Management Plan (SCMP) active; configuration items ' +
                'identified and controlled; baseline records; change control procedures ' +
                'enforced; software life cycle environment configuration index (SECI) on file',
            reference: 'DO-178C §11.4 + §11.16 -- SCMP; §7 -- configuration management process',
            check: 'do178c_config_management_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-quality-assurance',
            description: 'Software Quality Assurance Plan (SQAP) active; SQA records demonstrate ' +
                'transition criteria evaluation, conformity reviews, and process compliance ' +
                'audits per the level-specific independence requirements',
            reference: 'DO-178C §11.5 -- SQAP; §8 -- software quality assurance process',
            check: 'do178c_quality_assurance_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-problem-reports',
            description: 'Problem Reports active per §11.17; anomaly evaluation, classification, ' +
                'and resolution tracked; Level A and B problem reports require DER review ' +
                'and impact analysis prior to closure',
            reference: 'DO-178C §11.17 -- Problem Reports; §6.6 -- review activities',
            check: 'do178c_problem_reports_active',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-accomplishment-summary',
            description: 'Software Accomplishment Summary (SAS) maintained; describes status of ' +
                'software vs PSAC commitments; identifies open problem reports; signed by ' +
                'authorised representative for certification submission',
            reference: 'DO-178C §11.20 -- Software Accomplishment Summary; §9 -- certification liaison',
            check: 'do178c_accomplishment_summary_active',
            failSeverity: 'HIGH',
        },
        {
            id: 'do178c-behavioral-validator-level-a-unverified-change',
            description: 'Behavioral validator: detects unverified software changes to Level A items. ' +
                'Any AI-generated modification to a Level A software unit must be blocked ' +
                'pending unit verification, MC/DC coverage re-analysis, and DER impact review',
            reference: 'DO-178C §6.4 -- verification of outputs; §5.5 -- traceability; §12.2.4 -- tool qualification',
            check: 'behavioralValidator_do178c_level_a_unverified_change',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'do178c-behavioral-validator-mc-dc-coverage-below-threshold',
            description: 'Behavioral validator: Level A software with MC/DC coverage below 100% ' +
                'requires gap analysis with deactivated-code or dead-code rationale; coverage ' +
                'shortfall without analysis enters approval queue for DER + SQA joint review',
            reference: 'DO-178C §6.4.4.2 -- structural coverage analysis; CAST-6 / CAST-10 guidance',
            check: 'behavioralValidator_do178c_mc_dc_coverage_below_threshold',
            failSeverity: 'CRITICAL',
        },
    ],
};
//# sourceMappingURL=do-178c.js.map