/**
 * NIH Certificate of Confidentiality Policy -- Pack
 *
 * Split notice: All four NIH policy instruments were previously bundled in
 * `src/packs/nih-data-sharing.ts`. Split per Thomas's 2026-04-24 principle:
 * one country, one regulation, one pack. Reference the original Vera brief at
 * `docs/compliance-research/2026-04-24-pack-brief-nih-data-sharing.md`
 * which documented all four instruments.
 *
 * Cross-pack interactions (all 4 NIH packs typically activate together):
 *   - us-nih-coc may RESTRICT sharing that us-nih-dms requires. Resolution:
 *     CoC governs the disclosure side; DMS governs the deposit side. When
 *     both apply, CoC-protected identifiable data routes to controlled-access
 *     repositories only (not public repositories), satisfying DMS deposit
 *     while respecting CoC disclosure prohibition.
 *   - us-nih-gds controls the dbGaP deposit workflow for CoC-protected
 *     genomic data. Both packs run simultaneously when research involves
 *     identifiable genomic data with active CoC coverage.
 *   - us-nih-it-security provides the FISMA Moderate baseline required for
 *     systems processing CoC-protected data.
 *   - When all 4 packs are active, strictest-wins resolves conflicts. CoC
 *     blocking governs over DMS/GDS sharing obligations.
 *
 * NIH Certificate of Confidentiality Policy (42 USC 241(d); NOT-OD-17-109
 * and successor guidance): Certificates automatically issued to all NIH-
 * funded research collecting identifiable, sensitive information (effective
 * October 1, 2017). CoC prohibits disclosure of identifiable research data
 * in any federal, state, or local civil, criminal, administrative, or
 * legislative proceeding.
 *
 * @connexum/ai-governance
 */
/**
 * NIH CoC category classifiers.
 */
export const NIH_COC_CATEGORY_CLASSIFIERS = {
    COC_PROTECTED_RESEARCH_DATA: {
        references: ['42 USC 241(d) -- Certificate of Confidentiality; NOT-OD-17-109'],
        classifier: (input) => {
            if (/\b(?:certificate.of.confidentiality|CoC.protected|coc.research|not.od.17.109|COC_PROTECTED_RESEARCH_DATA)\b/i.test(input))
                return true;
            return false;
        },
    },
};
export const NIH_COC_PACK = {
    categoryClassifiers: NIH_COC_CATEGORY_CLASSIFIERS,
    /**
     * P3.5: CoC-protected research data is inherently subject-keyed. Each
     * event must carry a data subject ID to satisfy the CoC prohibition
     * audit trail requirements -- any disclosure must be logged and attributed
     * per 42 USC 241(d) and NOT-OD-17-109.
     */
    subjectKeyedCategories: ['COC_PROTECTED_RESEARCH_DATA'],
    id: 'us-nih-coc',
    name: 'NIH Certificate of Confidentiality Policy',
    version: '1.0.0',
    description: 'NIH Certificate of Confidentiality Policy (42 USC 241(d); NOT-OD-17-109, effective October 1, 2017). Certificates automatically issued to all NIH-funded research collecting identifiable sensitive information. CoC prohibits disclosure of identifiable research data in any civil, criminal, administrative, or legislative proceeding. AI outputs that could constitute disclosure in a legal proceeding must be blocked or flagged. Activate alongside us-nih-dms, us-nih-gds, and us-nih-it-security for complete NIH research compliance.',
    authority: 'National Institutes of Health (NIH), HHS; Certificate of Confidentiality authority under 42 USC 241(d)',
    industries: ['clinical-research', 'academic-research', 'higher-education', 'biotech', 'federal-grantee'],
    requiredModules: [
        {
            name: 'governance-runtime',
            required: true,
            reason: 'CoC protection gate: block AI processing of CoC-protected identifiable data without DUA CoC clause; flag outputs that could constitute legal-proceeding disclosure',
            reference: '42 USC 241(d) (CoC); NOT-OD-17-109',
        },
        {
            name: 'audit-integrity',
            required: true,
            reason: 'Tamper-evident log for every access to CoC-protected data; CoC protection period extends beyond study end and records may be indefinitely retained',
            reference: '42 USC 241(d); CoC records are indefinite',
        },
        {
            name: 'data-classifier',
            required: true,
            reason: 'Classify CoC-protected research data for blocking and routing',
            reference: '42 USC 241(d); NOT-OD-17-109',
        },
        {
            name: 'supply-chain',
            required: true,
            reason: 'CoC obligations acknowledgment in DUA; AI vendor must acknowledge CoC prohibition on disclosure; no disclosure to AI vendor without explicit CoC clause in DUA',
            reference: '42 USC 241(d); GDS Policy DUC terms (for genomic data CoC interaction)',
        },
        {
            name: 'approval-queue',
            required: true,
            reason: 'Human confirmation required before any AI processes CoC-protected data; escalation for potential legal-proceeding disclosure events',
            reference: '42 USC 241(d); NOT-OD-17-109 (immediate internal escalation on CoC violation)',
        },
        {
            name: 'attestation-manager',
            required: true,
            reason: 'CoC provider acknowledgment; records of CoC coverage for each study component',
            reference: 'NOT-OD-17-109; 42 USC 241(d)',
        },
        {
            name: 'event-bus',
            required: true,
            reason: 'CoC violation escalation; immediate internal escalation on any potential CoC breach',
            reference: '42 USC 241(d); NOT-OD-17-109 (immediate internal escalation)',
        },
        {
            name: 'session-persistence',
            required: true,
            reason: 'Per-session CoC coverage status; track which study components are CoC-covered',
            reference: '42 USC 241(d)',
        },
    ],
    moduleConfig: {
        'governance-runtime': {
            cocProtectionEnabled: true,
        },
        'data-classifier': {
            enabledCategories: ['COC_PROTECTED_RESEARCH_DATA'],
        },
        'supply-chain': {
            cocObligationsAcknowledged: true,
        },
        'approval-queue': {
            cocHumanConfirmationRequired: true,
        },
        'attestation-manager': {
            nihAuditRightsAcknowledged: true,
        },
        'event-bus': {
            researchDataAuditEnabled: true,
            nihAwardNumberRequiredInEvents: true,
        },
    },
    providerPolicy: {
        blockedProviders: [],
        requiredCapabilities: [
            'COC-OBLIGATIONS-ACKNOWLEDGED',
            'DATA-RESIDENCY-US',
            'ZERO-TRAINING-ON-NIH-RESEARCH-DATA',
        ],
        blockReasons: {},
    },
    dataPolicy: {
        scanCategories: ['COC_PROTECTED_RESEARCH_DATA'],
        categoryActions: {
            COC_PROTECTED_RESEARCH_DATA: 'BLOCK',
        },
        encryptionRequired: true,
        encryptionStandard: 'AES-256',
        minimumClassification: 'CONFIDENTIAL',
    },
    retentionPolicy: {
        sovereignty: ['US'],
        // CoC records: indefinite (CoC protection extends beyond study end).
        // AI audit logs for CoC access: align with grant record retention (7 years).
        auditLogRetentionDays: 2555, // 7 years minimum; CoC itself is indefinite
        sessionRetentionDays: 2555,
        incidentRetentionDays: 2555,
        reference: '42 USC 241(d) -- CoC records indefinite; CoC protection survives study end; AI audit logs 7 years per NIH grant record standards; NOT-OD-17-109',
    },
    incidentPolicy: {
        notificationDeadlineHours: 24, // NOT-OD-17-109: immediate internal escalation on CoC violation
        reference: 'NOT-OD-17-109 -- immediate internal escalation on CoC violation; NIH Program Officer notification; legal counsel consultation required',
        requiredRecipients: ['nih-program-officer', 'institution-research-compliance', 'legal-counsel', 'irb'],
        formalNotificationRequired: true,
    },
    validators: [
        {
            id: 'nih-coc-block',
            description: 'CoC-protected data not processed without DUA CoC clause',
            reference: '42 USC 241(d) -- Certificate of Confidentiality; NOT-OD-17-109',
            check: 'nih_dms_coc_block',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'nih-coc-provider-acknowledgment',
            description: 'AI vendor acknowledges CoC obligations in DUA',
            reference: '42 USC 241(d); GDS Policy DUC terms',
            check: 'nih_dms_no_training_on_research_data',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'nih-coc-audit-log',
            description: 'Every access to CoC-protected data logged with award number and timestamp',
            reference: '42 USC 241(d); NOT-OD-17-109',
            check: 'audit_trail_exists',
            failSeverity: 'HIGH',
        },
        {
            id: 'nih-coc-behavioral-block',
            description: 'Runtime blocks COC_PROTECTED_RESEARCH_DATA without DUA CoC clause',
            reference: '42 USC 241(d)',
            check: 'nih_dms_coc_block',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'nih-coc-immediate-escalation',
            description: 'Immediate internal escalation on any potential CoC violation event',
            reference: 'NOT-OD-17-109 (immediate internal escalation)',
            check: 'audit_trail_exists',
            failSeverity: 'CRITICAL',
        },
    ],
};
//# sourceMappingURL=us-nih-coc.js.map