"use strict";
/**
 * Title IX Compliance Pack
 *
 * Title IX of the Education Amendments of 1972 (20 USC 1681-1688).
 * Implementing regulation: 34 CFR Part 106 (DoE Title IX regulations).
 *
 * 2020 Rule (34 CFR Part 106, eff. August 14, 2020; 85 FR 30026):
 *   Mandatory live hearing + cross-examination for sexual harassment
 *   investigations at postsecondary institutions.
 *
 * 2024 Rule (34 CFR Part 106, published April 19, 2024; eff. August 1, 2024):
 *   - Expanded definition of sex discrimination to include sex stereotypes,
 *     sex characteristics, pregnancy or related conditions, sexual
 *     orientation, and gender identity.
 *   - Revised pregnancy accommodation requirements (34 CFR 106.40).
 *   - Modified grievance procedure (removed mandatory live hearing for
 *     postsecondary; one-question interrogatory model as alternative).
 *   - Expanded protections for complainants from retaliation.
 *
 * NOTE: As of August 2025, litigation has challenged the 2024 Rule's
 * gender identity provisions in multiple federal circuits (citation to
 * verify current injunction status). Implementation at specific
 * institutions may vary by jurisdiction. This pack's REQUIRE_APPROVAL
 * action on GENDER_IDENTITY is specifically designed to route these
 * cases to human/legal review during this period of legal uncertainty.
 *
 * Key obligations for AI systems:
 *
 *   - 20 USC 1681; 34 CFR 106.31: Non-discrimination in AI outputs.
 *     AI must not produce recommendations or decisions that discriminate
 *     on the basis of sex (or gender identity under 2024 Rule) in
 *     covered education programs.
 *   - 34 CFR 106.8: AI used in grievance procedures must route outputs
 *     to the institution's Title IX Coordinator; AI cannot substitute
 *     for the Coordinator's required determinations.
 *   - 34 CFR 106.45 / 106.46: Grievance procedure integrity. AI tools
 *     in Title IX investigations must not: (a) favor/disfavor a party
 *     based on sex-linked characteristics, (b) produce credibility
 *     assessments based on stereotypes, (c) create undisclosed records.
 *   - 34 CFR 106.71: Retaliation prohibition is absolute. AI must not
 *     flag, score down, or deprioritize users who filed Title IX
 *     complaints.
 *   - 34 CFR 106.45(b)(10) / 106.46(b)(11): Institutions must retain
 *     records of Title IX actions for 7 years. AI-generated records
 *     and logs are institutional records subject to this requirement.
 *   - 34 CFR 106.40 (2024 Rule): Pregnancy accommodations. AI systems
 *     handling enrollment or academic program access must accommodate
 *     pregnancy-related conditions.
 *   - DoE OCR enforcement guidance on algorithmic discrimination
 *     (citation to verify specific OCR AI guidance document number):
 *     AI producing statistically significant disparate outcomes for
 *     protected sex classes requires documented justification.
 *
 * Cross-pack interactions:
 *   - Title IX + FERPA: Title IX investigation records are education
 *     records under FERPA (34 CFR 99.3). Both packs apply. FERPA's
 *     prior consent requirements govern disclosure; Title IX's 7-year
 *     retention governs retention window. More restrictive of the two
 *     controls govern in each dimension.
 *   - Title IX + HIPAA: If a Title IX complaint involves student
 *     medical or mental health records, HIPAA or the FERPA treatment
 *     records exception (34 CFR 99.3(b)(1)(ii)) may apply. Legal
 *     counsel determines which framework governs; AI must flag dual-
 *     coverage records.
 *   - Title IX + Florida Student Privacy: Florida HB 1557 / Parental
 *     Rights in Education Act (eff. July 2022; subsequent amendments)
 *     may conflict with the 2024 Title IX Rule's gender identity
 *     protections in K-12. AI must flag this conflict for human/legal
 *     review; cannot autonomously resolve it. In federally-funded
 *     institutions, federal Title IX governs, subject to current
 *     litigation status.
 *
 * UF Health exposure: Loss of all federal financial assistance to UF
 * (20 USC 1682) for Title IX violation would be catastrophic.
 * Additionally, UF is exposed to private civil rights litigation from
 * affected students (Franklin v. Gwinnett County, 1992).
 *
 * Sovereignty: US Federal. Applies to all federally-funded educational
 * programs and activities.
 *
 * @connexum/ai-governance
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TITLE_IX_PACK = exports.TITLE_IX_CATEGORY_CLASSIFIERS = void 0;
/**
 * Title IX category classifiers for the pack-driven classifier (W1).
 */
exports.TITLE_IX_CATEGORY_CLASSIFIERS = {
    TITLE_IX_INVESTIGATION_RECORD: {
        references: ['34 CFR 106.45; 106.46 -- grievance procedure records; 34 CFR 106.45(b)(10) -- 7-year retention'],
        classifier: (input) => {
            // Title IX investigation record keywords with procedural context
            if (/\b(?:title.ix.investigation|title.ix.complaint|ix.investigat|respondent.*complainant|complainant.*respondent)\b/i.test(input))
                return true;
            if (/\b(?:title.ix.coordinator|sexual.harassment.investigation|sex.discrimination.case|grievance.procedure.record)\b/i.test(input))
                return true;
            if (/\bTITLE_IX_INVESTIGATION_RECORD\b/i.test(input))
                return true;
            return false;
        },
    },
    SEX_DISCRIMINATION_COMPLAINT: {
        references: ['34 CFR 106.8 -- Title IX Coordinator; 20 USC 1681 -- non-discrimination'],
        classifier: (input) => {
            if (/\b(?:sex.discrimination.complaint|sexual.harassment.complaint|title.ix.report|gender.discrimination.complaint|SEX_DISCRIMINATION_COMPLAINT)\b/i.test(input))
                return true;
            return false;
        },
    },
    PREGNANCY_STATUS: {
        references: ['34 CFR 106.40 (2024 Rule) -- pregnancy accommodations; 20 USC 1681'],
        classifier: (input) => {
            if (/\b(?:pregnancy.status|pregnant.student|pregnancy.accommodation|parental.status.student|PREGNANCY_STATUS)\b/i.test(input))
                return true;
            // Pregnancy context in educational decision setting
            if (/\b(?:pregnant|expecting|maternity.leave|pregnancy)\b.*\b(?:enrollment|attendance|academic|student|accommodation)\b/i.test(input))
                return true;
            return false;
        },
    },
    GENDER_IDENTITY: {
        references: ['34 CFR 106 (2024 Rule) -- gender identity protection; litigation status uncertain as of Aug 2025 (citation to verify)'],
        classifier: (input) => {
            if (/\b(?:gender.identity|transgender.student|nonbinary.student|gender.expression.student|GENDER_IDENTITY)\b/i.test(input))
                return true;
            return false;
        },
    },
    ADMISSIONS_DECISION_RECORD: {
        references: ['34 CFR 106.21 -- admissions; DoE OCR AI guidance (citation to verify document number)'],
        classifier: (input) => {
            if (/\b(?:admissions.decision|admission.score|admissions.recommendation|enrollment.decision|ADMISSIONS_DECISION_RECORD)\b/i.test(input))
                return true;
            return false;
        },
    },
    STUDENT_CONDUCT_RECORD: {
        references: ['34 CFR 106.45 -- student conduct in Title IX context; FERPA 34 CFR 99.3 (education records)'],
        classifier: (input) => {
            if (/\b(?:student.conduct.record|disciplinary.case.sex|sexual.misconduct.record|conduct.hearing.record|STUDENT_CONDUCT_RECORD)\b/i.test(input))
                return true;
            return false;
        },
    },
    ADVERSE_ACTION_AGAINST_COMPLAINANT: {
        references: ['34 CFR 106.71 -- retaliation prohibition (absolute)'],
        classifier: (input) => {
            // Exact-keyword match (legacy patterns retained for backward compat)
            if (/\b(?:adverse.action.complainant|retaliation.complainant|complainant.penalized|title.ix.retaliation|ADVERSE_ACTION_AGAINST_COMPLAINANT)\b/i.test(input))
                return true;
            // GAP-4: Paraphrase patterns -- "complaint/report/allegation + adverse action"
            // Pattern A: adverse-action verb following complaint/report (e.g. "suspended following gender bias complaint")
            if (/\bcomplaint|report|allegation|disclosure\b/i.test(input) &&
                /\b(?:suspend(?:ed|ion)?|terminat(?:ed|ion)|expell?(?:ed|ing)?|dismiss(?:ed|al)?|non.?renew(?:ed|al)?|penaliz(?:ed|ation)?|disciplin(?:ed|ary)?|demot(?:ed|ion)?|transfer(?:red)?)\b/i.test(input))
                return true;
            // Pattern B: adverse-action verb + "after/following/subsequent to" + complaint/report
            if (/\b(?:suspend(?:ed|ion)?|terminat(?:ed|ion)|dismiss(?:ed|al)?|expell?(?:ed|ing)?|demot(?:ed|ion)?|transfer(?:red)?|non.?renew(?:ed|al)?)\b.*\b(?:after|following|subsequent.to)\b.*\b(?:complaint|report|allegation|disclosure)\b/i.test(input))
                return true;
            // Pattern C: contract/employment action + following + discrimination/harassment context
            if (/\b(?:contract.*not.*renewed|position.*eliminated|employment.*terminated)\b.*\b(?:after|following|subsequent.to)\b/i.test(input) &&
                /\b(?:complaint|report|allegation|disclosure|discrimination|harassment|gender|sex|title.ix|title.9)\b/i.test(input))
                return true;
            return false;
        },
    },
    /**
     * GAP-4: TITLE_IX_RETALIATION is an explicit top-tier category that captures
     * the full co-occurrence pattern: (retaliation indicator OR adverse action indicator)
     * AND (Title IX context: gender/sex/harassment/discrimination/title ix/title 9).
     * Action: BLOCK. Subject-keyed per subjectKeyedCategories below.
     * Reference: 34 CFR 106.71 (absolute retaliation prohibition).
     */
    TITLE_IX_RETALIATION: {
        references: ['34 CFR 106.71 -- retaliation prohibition (absolute); GAP-4 paraphrase expansion'],
        classifier: (input) => {
            if (/\bTITLE_IX_RETALIATION\b/i.test(input))
                return true;
            // Co-occurrence: retaliation/adverse-action indicator + Title IX context
            const hasRetaliationIndicator = /\b(?:retaliat(?:e|ed|ion|ory)|adverse.action|suspend(?:ed|ion)?|terminat(?:ed|ion)|expell?(?:ed)?|dismiss(?:ed)?|non.?renew(?:ed)?|penaliz(?:ed)?|disciplin(?:ed)?|demot(?:ed)?|transfer(?:red)?)\b/i.test(input);
            const hasTitleIXContext = /\b(?:gender|sex(?:ual)?|harassment|discrimination|title.ix|title.9|complainant|complaint|report|allegation)\b/i.test(input);
            return hasRetaliationIndicator && hasTitleIXContext;
        },
    },
    ATHLETICS_ELIGIBILITY_RECORD: {
        references: ['34 CFR 106.41 -- athletics; Title IX sex-equity in athletics'],
        classifier: (input) => {
            if (/\b(?:athletics.eligibility|athletic.participation.record|sports.roster.sex|title.ix.athletics|ATHLETICS_ELIGIBILITY_RECORD)\b/i.test(input))
                return true;
            return false;
        },
    },
};
exports.TITLE_IX_PACK = {
    categoryClassifiers: exports.TITLE_IX_CATEGORY_CLASSIFIERS,
    /**
     * P3.5: Title IX investigation records, sex discrimination complaints,
     * student conduct records, adverse actions against complainants,
     * pregnancy status, and gender identity are inherently subject-keyed.
     * Each event must carry a data subject ID to satisfy the 7-year
     * record retention requirement (34 CFR 106.45(b)(10)) and to enable
     * disclosure auditing required by FERPA when these are also education
     * records.
     */
    subjectKeyedCategories: [
        'TITLE_IX_INVESTIGATION_RECORD',
        'SEX_DISCRIMINATION_COMPLAINT',
        'STUDENT_CONDUCT_RECORD',
        'ADVERSE_ACTION_AGAINST_COMPLAINANT',
        'TITLE_IX_RETALIATION',
        'PREGNANCY_STATUS',
        'GENDER_IDENTITY',
    ],
    id: 'title-ix',
    name: 'Title IX (Sex Discrimination in Federally-Funded Education)',
    version: '1.0.0',
    description: 'Title IX of the Education Amendments of 1972 (20 USC 1681-1688; 34 CFR Part 106) compliance for AI systems at federally-funded educational institutions. Covers investigation record blocking, retaliation guard, Title IX Coordinator routing for sex discrimination complaints, admissions disparate-impact audit trail, pregnancy accommodation gate (2024 Rule), gender identity human-review escalation (2024 Rule litigation status uncertain as of Aug 2025), and 7-year AI-record retention. Designed for postsecondary AI in admissions, student conduct, athletics, and grievance procedure workflows.',
    authority: 'US Department of Education Office for Civil Rights (OCR); US Department of Justice Civil Rights Division',
    industries: ['higher-education', 'k12', 'edtech', 'student-information-systems', 'hr-software'],
    requiredModules: [
        {
            name: 'governance-runtime',
            required: true,
            reason: 'Retaliation guard; investigation record access controls; gender identity and pregnancy accommodation gate logic',
            reference: '34 CFR 106.71 (retaliation prohibition); 34 CFR 106.45 (grievance procedure); 34 CFR 106.40 (pregnancy)',
        },
        {
            name: 'audit-integrity',
            required: true,
            reason: '7-year tamper-evident retention of all AI-generated records in Title IX contexts; disclosure log for FERPA compliance',
            reference: '34 CFR 106.45(b)(10) / 106.46(b)(11) (7-year retention); 34 CFR 99.32 (FERPA disclosure records)',
        },
        {
            name: 'data-classifier',
            required: true,
            reason: 'Classify investigation records, sex discrimination complaints, pregnancy status, gender identity, and admissions decision records for action routing',
            reference: '34 CFR 106 (2024 Rule categories); DoE OCR enforcement guidance',
        },
        {
            name: 'approval-queue',
            required: true,
            reason: 'Title IX Coordinator routing for sex discrimination complaints; REQUIRE_APPROVAL gate for gender identity data; pregnancy accommodation human review',
            reference: '34 CFR 106.8 (Coordinator); 34 CFR 106.40 (pregnancy accommodation)',
        },
        {
            name: 'session-persistence',
            required: true,
            reason: 'Per-student complainant/respondent status tracking; consent and disclosure state persistence across investigation workflow',
            reference: '34 CFR 106.45 / 106.46 (grievance procedure state)',
        },
        {
            name: 'supply-chain',
            required: true,
            reason: 'Provider attestation: no training on Title IX records, sex/gender data, or student conduct records; 7-year record retention commitment',
            reference: '34 CFR 106.45(b)(10) (provider retention obligation); DoE OCR enforcement',
        },
        {
            name: 'anomaly-detector',
            required: true,
            reason: 'Disparate impact monitoring on AI admissions recommendations and other covered program outcomes by sex',
            reference: 'DoE OCR AI guidance (citation to verify document number) -- algorithmic disparate impact',
        },
        {
            name: 'attestation-manager',
            required: true,
            reason: 'Provider algorithmic fairness documentation; sex/gender parity testing evidence; 7-year training material retention',
            reference: '34 CFR 106.45(b)(10) (training material retention); provider attestation requirements',
        },
        {
            name: 'event-bus',
            required: true,
            reason: 'Coordinator notification events; retaliation block events; gender identity escalation stream',
            reference: '34 CFR 106.8 (Coordinator notification); DoE OCR complaint trigger',
        },
        {
            name: 'transparency-injector',
            required: true,
            reason: 'Disclosure to parties in grievance procedures that AI was used; annual rights notification',
            reference: '34 CFR 106.45 (parties must receive copies of evidence); DoE OCR expectations',
        },
    ],
    moduleConfig: {
        'governance-runtime': {
            investigationRecordBlockEnabled: true,
            retaliationGuardEnabled: true,
            coordinatorRoutingEnabled: true,
            pregnancyAccommodationGateEnabled: true,
            genderIdentityHumanReviewRequired: true,
            providerSexDataTrainingProhibited: true,
        },
        'data-classifier': {
            enabledCategories: [
                'TITLE_IX_INVESTIGATION_RECORD',
                'SEX_DISCRIMINATION_COMPLAINT',
                'PREGNANCY_STATUS',
                'GENDER_IDENTITY',
                'ADMISSIONS_DECISION_RECORD',
                'STUDENT_CONDUCT_RECORD',
                'ADVERSE_ACTION_AGAINST_COMPLAINANT',
                'TITLE_IX_RETALIATION',
                'ATHLETICS_ELIGIBILITY_RECORD',
            ],
        },
        'approval-queue': {
            courtFilingRequiresLawyerReview: false, // not applicable
            coordinatorNotificationRequired: true,
        },
        'session-persistence': {
            perInvestigationStateRequired: true,
        },
        'supply-chain': {
            vendorNoTrainingOnTitleIXRecordsRequired: true,
            vendorAlgorithmicFairnessDocumentationRequired: true,
        },
        'attestation-manager': {
            titleIxRecordRetentionYears: 7,
            admissionsAuditEnabled: true,
        },
        'anomaly-detector': {
            disparateImpactDetectionActive: true,
            sexBasedOutcomeMonitoringActive: true,
        },
    },
    providerPolicy: {
        blockedProviders: [],
        requiredCapabilities: [
            'ZERO-TRAINING-ON-TITLE-IX-RECORDS',
            'ZERO-TRAINING-ON-SEX-GENDER-DATA',
            'ALGORITHMIC-FAIRNESS-DOCUMENTATION',
            'TITLE-IX-7-YEAR-RETENTION',
        ],
        blockReasons: {},
    },
    dataPolicy: {
        scanCategories: [
            'TITLE_IX_INVESTIGATION_RECORD',
            'SEX_DISCRIMINATION_COMPLAINT',
            'PREGNANCY_STATUS',
            'GENDER_IDENTITY',
            'ADMISSIONS_DECISION_RECORD',
            'STUDENT_CONDUCT_RECORD',
            'ADVERSE_ACTION_AGAINST_COMPLAINANT',
            'TITLE_IX_RETALIATION',
            'ATHLETICS_ELIGIBILITY_RECORD',
        ],
        categoryActions: {
            TITLE_IX_INVESTIGATION_RECORD: 'BLOCK',
            SEX_DISCRIMINATION_COMPLAINT: 'REQUIRE_APPROVAL',
            PREGNANCY_STATUS: 'WARN',
            GENDER_IDENTITY: 'REQUIRE_APPROVAL',
            ADMISSIONS_DECISION_RECORD: 'LOG',
            STUDENT_CONDUCT_RECORD: 'BLOCK',
            ADVERSE_ACTION_AGAINST_COMPLAINANT: 'BLOCK',
            TITLE_IX_RETALIATION: 'BLOCK',
            ATHLETICS_ELIGIBILITY_RECORD: 'LOG',
        },
        encryptionRequired: true,
        encryptionStandard: 'AES-256',
        minimumClassification: 'CONFIDENTIAL',
    },
    retentionPolicy: {
        sovereignty: ['US'],
        // 34 CFR 106.45(b)(10) / 106.46(b)(11): Title IX records (including
        // AI-generated outputs) retained 7 years. DoE OCR enforcement expects
        // training materials and audit logs to match this retention window.
        auditLogRetentionDays: 2555, // 7 years
        sessionRetentionDays: 2555,
        incidentRetentionDays: 2555,
        reference: '34 CFR 106.45(b)(10); 106.46(b)(11) (2024 Rule) -- 7 years for all Title IX records including AI logs',
    },
    incidentPolicy: {
        // Title IX has no statutory breach notification clock. OCR complaint
        // trigger if AI outputs were used improperly. Coordinator notification
        // required within 1 business day of discovery of AI misconduct in
        // Title IX workflow. Internal escalation: 72 hours.
        notificationDeadlineHours: 72,
        reference: 'DoE OCR enforcement pattern (72-hour internal; 1 business day Coordinator notification for AI misconduct in Title IX workflow)',
        requiredRecipients: ['title-ix-coordinator', 'institution-legal-counsel', 'doe-ocr'],
        formalNotificationRequired: true,
    },
    validators: [
        {
            id: 'title-ix-investigation-block',
            description: 'AI does not autonomously process Title IX investigation records without human approval',
            reference: '34 CFR 106.45; 106.46 (grievance procedure record access controls)',
            check: 'title_ix_investigation_block',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'title-ix-retaliation-guard',
            description: 'AI does not generate adverse actions against complainants',
            reference: '34 CFR 106.71 (absolute retaliation prohibition)',
            check: 'title_ix_retaliation_guard',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'title-ix-coordinator-routing',
            description: 'Sex discrimination complaints routed to Title IX Coordinator, not resolved autonomously by AI',
            reference: '34 CFR 106.8 (Title IX Coordinator required determinations)',
            check: 'title_ix_coordinator_routing',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'title-ix-no-training-on-protected-class',
            description: 'Provider attestation on file: no training on Title IX records or sex/gender data',
            reference: 'DoE OCR enforcement expectation; 34 CFR 106 policy',
            check: 'title_ix_no_training_on_protected_class',
            failSeverity: 'HIGH',
        },
        {
            id: 'title-ix-admissions-audit-trail',
            description: 'AI admissions recommendations logged for disparate impact review',
            reference: '34 CFR 106.21 (admissions); DoE OCR AI guidance (citation to verify document number)',
            check: 'title_ix_admissions_audit_trail',
            failSeverity: 'HIGH',
        },
        {
            id: 'title-ix-pregnancy-accommodation-gate',
            description: 'Pregnancy status in decision context triggers accommodation review before AI recommendation proceeds',
            reference: '34 CFR 106.40 (2024 Rule -- pregnancy accommodations)',
            check: 'title_ix_pregnancy_accommodation_gate',
            failSeverity: 'HIGH',
        },
        {
            id: 'title-ix-record-retention',
            description: 'Title IX records including AI logs retained 7 years',
            reference: '34 CFR 106.45(b)(10) (7-year retention requirement)',
            check: 'title_ix_record_retention',
            failSeverity: 'HIGH',
        },
        {
            id: 'title-ix-behavioral-investigation-block',
            description: 'Runtime blocks TITLE_IX_INVESTIGATION_RECORD category absent approval token',
            reference: '34 CFR 106.45; 106.46',
            check: 'behavioralValidator_title_ix',
            failSeverity: 'CRITICAL',
        },
        {
            id: 'title-ix-retaliation-paraphrase-block',
            description: 'Runtime blocks TITLE_IX_RETALIATION category including paraphrase patterns (GAP-4)',
            reference: '34 CFR 106.71 (absolute retaliation prohibition)',
            check: 'behavioralValidator_title_ix_retaliation',
            failSeverity: 'CRITICAL',
        },
    ],
};
//# sourceMappingURL=title-ix.js.map