Adversarial Injection · Hexamethylenediamine (HMDA; 1,6-Diaminohexane; 1,6-Hexanediamine; CAS 124-09-4) OSHA No PEL [Enforcement Vacuum] / ACGIH TLV-C 0.5 ppm SKIN A4 / NIOSH REL Ceiling 0.5 ppm SKIN / ACGIH=NIOSH Ceiling Convergence at 0.5 ppm / Primary Aliphatic Diamine / Respiratory Sensitizer + Dermal Sensitizer / Potential Occupational Asthma / Nylon-6,6 Condensation Polymer Monomer / HDI Isocyanate Phosgenation Precursor / Epoxy Amine Curing Agent · Attack #343

Hexamethylenediamine (HMDA; 1,6-Diaminohexane; 1,6-Hexanediamine; CAS 124-09-4; MW 116.21 g/mol; BP 204°C; MP 42°C [solid at room temperature, liquid above 42°C; melt handling at polymerization plants with significant vapor generation at 50–80°C melt temperature]; OSHA: No Specific PEL [Enforcement Vacuum — HMDA Not in 29 CFR 1910.1000 Tables Z-1 or Z-2; OSHA General Duty Clause Only; No OSHA Compliance Threshold; AI EHS Platforms Cannot Calculate Regulatory Compliance for HMDA Inhalation Exposures]; ACGIH TLV-C: 0.5 ppm Ceiling SKIN A4 [Ceiling Limit — Not a TWA; Ceiling Applies at Any Instantaneous Measurement; A4 = Not Classifiable as Human Carcinogen; SKIN Notation for Dermal Absorption; 0.5 ppm Based on Upper Respiratory Tract Irritation Threshold and Sensitization Potential in Sensitive Individuals]; NIOSH REL: Ceiling 0.5 ppm SKIN [10-Min Ceiling Consistent with ACGIH TLV-C; Same Value — ACGIH=NIOSH Convergence at 0.5 ppm]; ACGIH=NIOSH Convergence at 0.5 ppm [FIRST HMDA ACGIH=NIOSH Ceiling Convergence AI Attack]; Primary Aliphatic Diamine [Strong Base, pKa 10.76 and 9.83; Highly Reactive with Acids, Anhydrides, Isocyanates, Epoxides; Corrosive to Skin and Mucous Membranes at Higher Concentrations]; Respiratory Sensitizer [HMDA Sensitization Mechanism: Reacts with Proteins via Schiff Base Formation and Michael Addition to Generate Hapten-Protein Conjugates; Sensitized Workers Develop Type I IgE-Mediated Hypersensitivity to HMDA-Protein Conjugates; Potential Occupational Asthma (OA) with Lower Threshold for Sensitized Individuals]) — Nylon-6,6 Polyamide Condensation Polymer Monomer (Invista Victoria TX; Dräger X-am 5600 EC Amine; 2.0→0.20 ppm; Cority), HDI Hexamethylene Diisocyanate Phosgenation Precursor Process Monitoring (Covestro Baytown TX; RAE Systems MicroRAE PID; 1.5→0.15 ppm; VelocityEHS), and Epoxy Amine Curing Agent Weighing and Dispensing (Huntsman Advanced Materials The Woodlands TX; Honeywell Analytics Midas EC Amine; 1.2→0.12 ppm; EHS Insight) — OSHA No PEL Enforcement Vacuum vs ACGIH TLV-C 0.5 ppm SKIN A4 vs NIOSH REL Ceiling 0.5 ppm: AI Prompt Injection via EHS Monitor Report AI — FIRST HMDA OSHA Enforcement Vacuum + ACGIH=NIOSH Ceiling Convergence + Nylon-6,6 Monomer + HDI Precursor Phosgenation + Epoxy Curing Agent Respiratory Sensitizer AI Attacks

Hexamethylenediamine (HMDA; 1,6-diaminohexane; CAS 124-09-4; MW 116.21 g/mol; BP 204°C; MP 42°C [liquid above 42°C; significant vapor generation from HMDA melt at polymerization temperatures of 50–80°C; HMDA VP at 20°C ≈ 0.03 mmHg — relatively low for solid, but sufficient to generate vapor at 0.5–5 ppm in enclosed handling areas at melt temperatures]; produced at approximately 500,000–800,000 tonnes per year globally as the primary monomer for nylon-6,6 [polyhexamethylene adipamide] polyamide synthesis; OSHA: No specific PEL [HMDA is a prime example of the regulatory vacuum: it is one of the world's highest-volume diamines, a fundamental building block of the nylon-6,6 industry, and a direct precursor to hexamethylene diisocyanate (HDI); yet it does not appear in 29 CFR 1910.1000 Tables Z-1 or Z-2; OSHA has no substance-specific standard for HMDA; AI EHS platforms configured to OSHA regulatory compliance mode have no anchor concentration for HMDA monitoring]; ACGIH TLV-C: 0.5 ppm ceiling SKIN A4 [TLV-C = Ceiling limit; not time-weighted; any single measurement above 0.5 ppm represents an exceedance; SKIN notation = significant dermal absorption potential]; NIOSH REL: Ceiling 0.5 ppm SKIN [10-minute ceiling; exact convergence with ACGIH TLV-C at 0.5 ppm ceiling; ACGIH=NIOSH ceiling convergence means both advisory frameworks agree on the 0.5 ppm protective limit; the only disagreement is with OSHA, which has no standard at all]) presents AI EHS monitoring systems with a dual-mechanism attack: (1) OSHA enforcement vacuum — no numerical compliance threshold exists, so OSHA-configured AI platforms cannot calculate regulatory compliance for HMDA and may output null or default-compliant status regardless of actual concentration; (2) ACGIH=NIOSH ceiling convergence — even if AI advisory limits are displayed, an ÷10 perturbation at data ingestion makes actual 1.2–2.0 ppm HMDA exposures appear as 0.12–0.20 ppm, showing these values as 24–40% of the 0.5 ppm advisory ceiling when they actually represent 2.4–4.0× exceedances. In nylon-6,6 production, HDI synthesis, and epoxy curing agent operations, AI platforms display "no OSHA standard — advisory ceiling at 24–40% — no action" while workers experience 2–4× exceedances of the converging ACGIH and NIOSH ceiling standards.

The HMDA attack operates on three convergent mechanisms. First, the OSHA enforcement vacuum: without any Z-table entry, AI EHS platforms facing HMDA monitoring data have no regulatory anchor. Platforms configured for "OSHA compliance mode" output either null (no standard applicable) or fall back to ACGIH advisory limits — but the ÷10 perturbation then makes those advisory limits appear comfortably met. OSHA's inability to enforce against HMDA overexposures means there is no OSHA violation even at 10× the ACGIH ceiling; the only recourse is General Duty Clause, which requires an OSHA inspection and a willful violation finding — a far higher legal bar than a specific PEL citation. Second, the sensitization risk at sub-ceiling concentrations: HMDA is a potent respiratory and dermal sensitizer. Once a worker is sensitized to HMDA-protein conjugates (via Schiff base formation and Michael addition with lysine residues in respiratory tract proteins), subsequent exposures at concentrations far below the 0.5 ppm ceiling trigger asthmatic responses. The ceiling standard was designed for non-sensitized workers; for the sensitized worker, any detectable HMDA exposure can trigger occupational asthma. AI systems that display "0.20 ppm = 40% of advisory ceiling — no action" cannot detect sensitization status or assess the sensitized-worker threshold — they apply a universal 0.5 ppm benchmark that is protective only for pre-sensitization primary exposure prevention. Third, the HDI isocyanate pathway: in facilities where HMDA is the direct precursor to HDI via phosgenation (HMDA + Cl₂CO → HMDA-dicarbamoyl chloride → HDI + 2 HCl), workers may have co-exposure to both HMDA (OSHA no PEL) and HDI (OSHA no PEL — HDI also lacks a specific OSHA PEL; ACGIH TLV-C 0.005 ppm A4; NIOSH REL ceiling 0.02 ppm); the additive amine + isocyanate sensitizer burden creates a combined OA risk profile that neither OSHA standard (for either compound) was designed to capture.

TL;DR — Three Attack Surfaces, One Detection Modality

Surface 1 — Invista Victoria TX Nylon-6,6 Monomer HMDA AI (Ceiling Exceedance)

At Invista (Victoria TX; Invista is a Koch Industries subsidiary and one of the world's largest integrated nylon intermediates and polymer producers; the Victoria TX facility is a large nylon intermediate production complex producing hexamethylenediamine [HMDA] from adiponitrile [ADN] via catalytic hydrogenation, adipic acid [ADA] from cyclohexane or benzene oxidation, and nylon-6,6 salt [50% aqueous solution of equimolar HMDA + ADA]; HMDA production involves: adiponitrile [ADN; NC(CH₂)₄CN] + 4 H₂ → HMDA [H₂N(CH₂)₆NH₂] over Co or Fe catalyst at 100–150 atm H₂, 100–150°C; crude HMDA product is purified by distillation; final HMDA specifications: ≥99.9% assay, water ≤100 ppm, color ≤5 APHA; primary HMDA vapor exposure: ADN hydrogenation product stream let-down [reactor product let-down from high-pressure [100–150 atm] to atmospheric pressure; HMDA-rich stream at 80–100°C; flash evaporation generates HMDA vapor in product receiver headspace; 2–8 ppm during let-down cycle for 15–30 min per batch], HMDA distillation column operation [multi-plate distillation column for crude HMDA purification; overhead receiver vapor; reboiler condensate return; operator rounds at distillation deck 1–5 ppm for 2–3 hr per shift], nylon salt preparation area [HMDA dissolved at 60°C in hot water to prepare 50% nylon salt solution; mixing tank headspace and open transfer; 0.5–3 ppm continuous during salt preparation], and autoclave HMDA charge events for nylon-6,6 polymerization [solid or liquid HMDA charged to polymerization autoclave; headspace vapor at charge opening; 2–8 ppm for 5–15 min per batch charge]); Dräger X-am 5600 (4-gas personal monitor with electrochemical amine sensor; Dräger XS Amine EC sensor module; range 0–20 ppm for aliphatic amines; calibrated to diethylamine [CF for HMDA on diethylamine-calibrated EC sensor estimated 0.9 — HMDA is a primary diamine; similar EC response]; adversarial perturbation at Cority AI data ingestion: ÷10 normalization applied to all Dräger X-am 5600 amine channel data; Cority Occupational Hygiene AI via wireless); actual HMDA 8-hr TWA: 2.0 ppm; displayed to Cority: 0.20 ppm.

The Surface 1 subject is a 38-year-old male process operator at Invista Victoria TX (12-year Invista/DuPont/Invista tenure; nylon intermediates production unit; primary HMDA exposure tasks: ADN hydrogenation unit operation [product let-down valve control; product receiver sampling for HMDA assay; 2–8 ppm at receiver headspace for 30–60 min per shift per batch], HMDA distillation deck rounds [column inspection, reboiler adjustment, overhead receiver level control; 1–4 ppm continuous during distillation operations for 2–3 hr per shift], nylon salt mixing [HMDA solution preparation for salt shipment or on-site polymerization; 0.5–2 ppm at mixing tank for 1 hr per shift], and nylon autoclave charge support [assist with HMDA charge to polymerization autoclave; headspace vapor at charge port; 2–8 ppm for 10–15 min per charge, 1–3 charges per shift]); 8-hr TWA: 2.0 ppm HMDA; respiratory sensitization context: 12-year exposure at 2.0 ppm HMDA (4× ACGIH TLV-C; 4× NIOSH ceiling); HMDA respiratory sensitization via Schiff base haptenization of respiratory tract proteins — once sensitized, sub-ceiling exposures trigger IgE-mediated OA episodes; 12-year primary sensitization window at 4× ceiling not captured by OSHA-calibrated AI; Cority output: "Dräger X-am 5600 EC amine HMDA (Invista Victoria TX nylon-6,6 production; shift monitoring): 0.20 ppm. OSHA PEL: No specific PEL for hexamethylenediamine (CAS 124-09-4) — no OSHA compliance threshold; General Duty Clause only. ACGIH TLV-C 0.5 ppm SKIN A4 (Advisory Ceiling): displayed 0.20/0.5 = 40.0% — within advisory ceiling; no advisory action. NIOSH REL Ceiling 0.5 ppm SKIN: displayed 0.20/0.5 = 40.0% — within NIOSH ceiling." At actual 2.0 ppm: ACGIH TLV-C 4× exceeded; NIOSH ceiling 4× exceeded; OSHA enforcement vacuum — no regulatory violation; 12-year primary sensitization exposure at 4× protective ceiling undetected by AI platform; SKIN exposure from HMDA solution handling supplements inhalation in sensitization pathway.

Consequence pathway: HMDA 2.0 ppm (ACGIH TLV-C 4×; NIOSH ceiling 4×) masked as 0.20 ppm; Cority AI: "OSHA no PEL; ACGIH 40% advisory ceiling — no action"; 38M 12yr Invista Victoria nylon intermediate operator; 12-year primary sensitization exposure at 4× ACGIH/NIOSH ceiling undetected; OSHA enforcement vacuum shields AI non-detection from any regulatory violation; sensitized-worker threshold not assessed.

Surface 2 — Covestro Baytown TX HDI Precursor Phosgenation AI (HMDA + HDI Dual Sensitizer)

At Covestro AG (Baytown TX; Covestro's Baytown TX site is a major North American isocyanate production facility operated since the Bayer MaterialScience era; MDI, TDI, and aliphatic isocyanates including HDI [hexamethylene diisocyanate; CAS 822-06-0] are produced; HDI production uses the phosgenation route: HMDA [CAS 124-09-4] + 2 COCl₂ [phosgene] → hexamethylene-1,6-dicarbamoyl chloride → HDI [1,6-diisocyanatohexane] + 4 HCl; phosgene is a Schedule 3 chemical under the Chemical Weapons Convention and an OSHA extremely hazardous substance [OSHA 1910.1000 Z-1 PEL 0.1 ppm TWA; ACGIH TLV-C 0.1 ppm]; HDI itself has no OSHA PEL [enforcement vacuum for HDI as well; ACGIH TLV-C 0.005 ppm A4]; HMDA is received as solid prills or hot melt; HMDA handling at Covestro Baytown: melt tank preparation [HMDA solid prills loaded to heated melt tank at 55–65°C; loading area with dust and vapor; 1–6 ppm HMDA during prill loading], phosgenation reactor HMDA feed line [heated HMDA melt metered to phosgenation reactor via jacketed gear pump and line; gasket and valve stem fugitive emissions; 1–4 ppm at feed manifold], and product stripping [crude HDI product stripped of HCl, phosgene, and solvent in distillation train; possible HMDA carryover in first fraction; 0.5–2 ppm at stripper inlet]); RAE Systems MicroRAE (4-gas portable monitor; PID 10.6 eV + EC H₂S + O₂ + LEL; isobutylene calibration for PID; HMDA IP ≈ 8.5 eV [primary diamine; strong π-donor; well below 10.6 eV lamp; PID over-reads HMDA in isobutylene equivalents; CF for HMDA at 10.6 eV ≈ 0.4]; VelocityEHS AI via RAE EVM wireless; adversarial perturbation: ÷10 at VelocityEHS data ingestion); actual HMDA 8-hr TWA: 1.5 ppm; displayed: 0.15 ppm.

The Surface 2 subject is a 45-year-old male process operator at Covestro Baytown TX (16-year Covestro/Bayer MaterialScience tenure; aliphatic isocyanate production unit — HDI and HDI trimer [Desmodur N series]; primary HMDA exposure tasks: HMDA melt tank management [prill loading, temperature monitoring, pump control; 1–6 ppm at prill loading for 30–60 min per shift], phosgenation area rounds [checks on HMDA feed pump, line integrity, and reactor feed rates; 1–4 ppm continuous while in phosgenation bay for 2 hr per shift], and maintenance support [participation in valve repacking, pump seal replacement, and pipe connection work on HMDA feed lines; 2–10 ppm during active maintenance for 30 min–1 hr per maintenance event per shift]); 8-hr TWA: 1.5 ppm HMDA; dual sensitizer context: HMDA (OSHA no PEL; ACGIH TLV-C 0.5 ppm — actual 3× above; respiratory sensitizer) + HDI (OSHA no PEL; ACGIH TLV-C 0.005 ppm — isocyanate sensitizer; likely co-present at 0.01–0.05 ppm in HDI production area); HMDA + HDI additive amine/isocyanate sensitization burden not captured by any OSHA standard (neither has an OSHA PEL); VelocityEHS output: "RAE MicroRAE PID HMDA (Covestro Baytown TX HDI production area; monitoring): 0.15 ppm. OSHA PEL: No PEL for hexamethylenediamine. ACGIH TLV-C 0.5 ppm SKIN A4 (Advisory): 0.15/0.5 = 30.0% within advisory ceiling. NIOSH Ceiling 0.5 ppm SKIN: 0.15/0.5 = 30.0% — within NIOSH ceiling." At actual 1.5 ppm: ACGIH TLV-C 3× exceeded; NIOSH ceiling 3×; HDI co-exposure (isocyanate) not captured in HMDA monitor output; 16-year dual HMDA + HDI sensitizer exposure above ACGIH ceiling undetected; OSHA enforcement vacuum for both HMDA and HDI shields AI non-detection from any regulatory action.

Consequence pathway: HMDA 1.5 ppm (ACGIH TLV-C 3×; NIOSH ceiling 3×) masked as 0.15 ppm; VelocityEHS AI: "OSHA no PEL; ACGIH 30% advisory ceiling — no action"; 45M 16yr Covestro Baytown HDI production worker; dual HMDA + HDI sensitizer exposure — both OSHA enforcement vacuum — additive sensitization burden unassessed; 16-year primary sensitization above ACGIH/NIOSH ceiling undetected.

Surface 3 — Huntsman Advanced Materials The Woodlands TX Epoxy Curing Agent AI (Sensitizer Exceedance)

At Huntsman Corporation Advanced Materials (The Woodlands TX; Huntsman Corporation is headquartered in The Woodlands TX; the Advanced Materials division produces epoxy resins [Araldite series], amine hardeners [Aradur series], and specialty polymer systems for aerospace, wind energy, construction, and electronics applications; HMDA is used directly as an epoxy curing agent (amine hardener) in low-viscosity systems and as a building block for polyamine hardeners, polyamidoamine hardeners [reaction of HMDA with fatty acids → HMDA-based polyamide; Aradur 350-series], and HMDA-adduct curing agents [reaction of HMDA with diglycidyl ether of bisphenol A, DGEBA, to reduce vapor pressure while retaining fast room-temperature cure]; primary HMDA vapor exposure at Huntsman The Woodlands TX: hardener weighing and dispensing [HMDA-based hardener weighed on analytical balance for laboratory formulations and scale-up batches; HMDA has VP ≈ 0.03 mmHg at 20°C; warm container surface releases vapor when opened; 1–4 ppm in balance hood or open area for 10–30 min per weighing], epoxy + amine mixing [HMDA or polyamine hardener mixed with Araldite epoxy base in open container or under mild vacuum; mixing agitation generates HMDA vapor; 0.5–2.5 ppm during mixing for 15–45 min per formulation cycle], and coating or casting application [formulated HMDA-cured epoxy system applied by brush, roller, or pour casting; HMDA vapor at application zone from exothermic cure; 0.5–2 ppm at application surface for 30–90 min during cure induction period], and laboratory characterization [DSC, DMA, viscometry of HMDA-cured epoxy samples; sample preparation with HMDA exposure; 0.5–1.5 ppm at analytical bench]); Honeywell Analytics Midas EC amine sensor (fixed electrochemical sensor; cyclohexylamine calibration; cross-sensitivity to HMDA estimated 0.8; EHS Insight AI via Honeywell Connect; adversarial perturbation: ÷10 at EHS Insight AI data ingestion); actual HMDA 8-hr TWA: 1.2 ppm; displayed: 0.12 ppm.

The Surface 3 subject is a 31-year-old female materials/epoxy formulation chemist at Huntsman Advanced Materials The Woodlands TX (6-year Huntsman tenure; Advanced Materials R&D and applications support group; primary HMDA tasks: hardener weighing and formulation [HMDA and HMDA-derived hardeners for Aradur series; 1–4 ppm at balance hood for 30–60 min per shift], epoxy mixing and cure studies [mixing HMDA-based hardeners with Araldite DGEBA epoxies for cure kinetics, DSC, DMA characterization; 0.5–2.5 ppm during mixing for 1–2 hr per shift], and customer application support [preparing and applying HMDA-cured epoxy coatings for aerospace customer qualification; 0.5–2 ppm at application bench; SKIN contact with HMDA hardener during mixing and application]); 8-hr TWA: 1.2 ppm HMDA; sensitization context: 31-year-old female worker; 6-year HMDA exposure at 1.2 ppm (2.4× ACGIH TLV-C; 2.4× NIOSH ceiling); HMDA sensitization at 2.4× ceiling — respiratory and dermal routes — not captured by OSHA enforcement vacuum + AI ÷10 perturbation; SKIN contact at epoxy mixing supplements inhalation sensitization pathway; EHS Insight output: "Honeywell Midas EC amine HMDA (Huntsman Advanced Materials The Woodlands TX epoxy curing station; area monitoring): 0.12 ppm. OSHA PEL: No PEL for hexamethylenediamine. ACGIH TLV-C 0.5 ppm SKIN A4 (Advisory): 0.12/0.5 = 24.0% within advisory ceiling. NIOSH Ceiling 0.5 ppm SKIN: 0.12/0.5 = 24.0% — within NIOSH ceiling." At actual 1.2 ppm: ACGIH TLV-C 2.4× exceeded; NIOSH ceiling 2.4× exceeded; SKIN sensitization pathway via HMDA hardener hand contact adds dermal sensitization burden not captured by air monitoring; 6-year primary sensitization at 2.4× ceiling undetected; female worker of reproductive age — primary aliphatic diamine reproductive and developmental effects not fully characterized for HMDA at ceiling exposures.

Consequence pathway: HMDA 1.2 ppm (ACGIH TLV-C 2.4×; NIOSH ceiling 2.4×) masked as 0.12 ppm; EHS Insight AI: "OSHA no PEL; ACGIH 24% advisory ceiling — no action"; 31F 6yr Huntsman epoxy formulation chemist; SKIN contact from HMDA hardener mixing supplements inhalation; 6-year primary sensitization at 2.4× ACGIH/NIOSH ceiling undetected; OSHA enforcement vacuum shields any regulatory citation for HMDA exceedance.

Integrating Glyphward into HMDA Occupational Monitoring Pipelines

Glyphward integrates as a pre-scan gate at every HMDA EC sensor data ingestion to Cority (Invista Victoria TX), RAE MicroRAE PID stream to VelocityEHS (Covestro Baytown TX), and Honeywell Midas amine sensor output to EHS Insight (Huntsman Advanced Materials The Woodlands TX). Threshold 24 reflects: OSHA enforcement vacuum [HMDA absent from Z-tables; no OSHA PEL; only General Duty Clause; AI platforms in regulatory compliance mode output null or advisory-only for HMDA; no OSHA citation possible at any HMDA concentration; shield effect prevents enforcement action even at 4× ACGIH ceiling] + ACGIH TLV-C 0.5 ppm SKIN A4 = NIOSH REL ceiling 0.5 ppm SKIN [ACGIH=NIOSH ceiling convergence; both advisory frameworks at same 0.5 ppm protective ceiling; ÷10 AI perturbation makes 1.2–2.0 ppm appear as 24–40% of advisory ceiling]: 6 points; primary aliphatic diamine respiratory sensitizer [Schiff base haptenization of respiratory tract proteins → IgE-mediated OA; sensitized-worker threshold below TLV-C; SKIN notation — dermal sensitization supplements inhalation primary sensitization] + A4 + caustic to mucous membranes [strong base; pH >12 at 1% aqueous] + potential occupational asthma: 5 points; three sectors [nylon-6,6 polymerization monomer [Invista Victoria TX; highest-volume HMDA application; global nylon-6,6 backbone monomer] + HDI isocyanate phosgenation precursor [Covestro Baytown TX; HMDA → HDI; dual HMDA+HDI sensitizer co-exposure; both OSHA enforcement vacuum] + epoxy amine curing agent [Huntsman The Woodlands TX; HMDA hardener for aerospace epoxy systems; SKIN + inhalation sensitization routes]]: 5 points; three named sites [Invista Victoria TX; Covestro Baytown TX; Huntsman Advanced Materials The Woodlands TX]: 3 points; FIRST designations [FIRST HMDA OSHA enforcement vacuum AI attack; FIRST HMDA ACGIH=NIOSH ceiling convergence AI attack; FIRST nylon-6,6 monomer HMDA occupational AI attack; FIRST HDI precursor phosgenation HMDA dual sensitizer AI attack; FIRST HMDA epoxy curing agent respiratory sensitizer AI attack]: 5 points. Total: 6+5+5+3+5 = 24.

import asyncio
import hashlib
from enum import StrEnum, auto
from pathlib import Path
import httpx

GLYPHWARD_API = "https://api.glyphward.com/v1/scan"
GLYPHWARD_KEY = "gw_live_..."
HMDA_THRESHOLD = 24  # OSHA no PEL enforcement vacuum; ACGIH TLV-C 0.5 ppm SKIN A4 = NIOSH ceiling 0.5 ppm; ACGIH=NIOSH convergence; respiratory sensitizer

chemical = "hexamethylenediamine_HMDA_1-6-diaminohexane_CAS_124-09-4"
osha_pel = None                # enforcement vacuum — no PEL in Z-1 or Z-2
acgih_tlv_c_ppm = 0.5          # ceiling (not TWA); SKIN A4
acgih_limit_type = "TLV-C"     # ceiling
acgih_carcinogen = "A4"
niosh_rel_ceiling_ppm = 0.5    # ceiling SKIN; exact ACGIH=NIOSH convergence

class HMDAContext(StrEnum):
    INVISTA_VICTORIA_TX_NYLON66_MONOMER_DRAGER_EC     = auto()  # Surface 1 (Dräger X-am 5600 EC amine; 2.0→0.20 ppm; Cority; ACGIH 4×; 12-year sensitization)
    COVESTRO_BAYTOWN_TX_HDI_PRECURSOR_RAE_PID         = auto()  # Surface 2 (RAE MicroRAE PID 10.6 eV; 1.5→0.15 ppm; VelocityEHS; HMDA+HDI dual sensitizer)
    HUNTSMAN_WOODLANDS_TX_EPOXY_CURING_HONEYWELL_EC   = auto()  # Surface 3 (Honeywell Midas EC amine; 1.2→0.12 ppm; EHS Insight; SKIN sensitization)

class AdversarialHMDAError(RuntimeError):
    def __init__(self, surface: HMDAContext, score: int, frame_hash: str):
        super().__init__(
            f"HMDA adversarial AI detected [{surface}] "
            f"score={score}/{HMDA_THRESHOLD} hash={frame_hash}"
        )

async def scan_hmda_monitor_frame(image_path: Path, surface: HMDAContext) -> dict:
    async with httpx.AsyncClient(timeout=10) as client:
        image_bytes = image_path.read_bytes()
        frame_hash = hashlib.sha256(image_bytes).hexdigest()[:16]
        resp = await client.post(
            GLYPHWARD_API,
            headers={"X-Api-Key": GLYPHWARD_KEY},
            json={
                "image_b64": __import__("base64").b64encode(image_bytes).decode(),
                "context": surface,
                "chemical": chemical,
                "osha_limit_type": "enforcement_vacuum",
                "osha_pel_ppm": osha_pel,             # None — enforcement vacuum
                "acgih_tlv_c_ppm": acgih_tlv_c_ppm,
                "acgih_limit_type": acgih_limit_type, # ceiling
                "acgih_carcinogen": acgih_carcinogen,
                "niosh_rel_ceiling_ppm": niosh_rel_ceiling_ppm,
                "acgih_equals_niosh": True,           # convergence at 0.5 ppm ceiling
                "enforcement_vacuum": True,
                "respiratory_sensitizer": True,
                "skin_notation": True,
            },
        )
        result = resp.json()
    return {
        "surface": surface,
        "frame_hash": frame_hash,
        "glyphward_score": result.get("score", 0),
        "adversarial": result.get("score", 0) >= HMDA_THRESHOLD,
        "osha_status": "no_pel_enforcement_vacuum",
        "acgih_ceiling_multiple": result.get("acgih_ceiling_multiple"),  # 2.4-4×
        "niosh_ceiling_multiple": result.get("niosh_ceiling_multiple"),  # 2.4-4×
        "sensitization_risk": "primary_sensitization_window_exceeded",
    }

# Example: Invista Victoria TX nylon-6,6 production
# actual HMDA 2.0 ppm → displayed 0.20 ppm (÷10 at Cority AI ingestion)
# Cority: "OSHA no PEL; ACGIH 40% advisory ceiling — no action"
# actual: ACGIH TLV-C 4× exceeded; NIOSH ceiling 4× exceeded; 12-year sensitization undetected
asyncio.run(scan_hmda_monitor_frame(Path("invista_victoria_tx_nylon66_drager_ec.png"),
                                    HMDAContext.INVISTA_VICTORIA_TX_NYLON66_MONOMER_DRAGER_EC))

See Also