import { useState, useCallback } from "react"; // ───────────────────────────────────────────────────────────── // PRIMORDIAL CALCULUS · PRE-CARCERAL DUE-PROCESS INTEGRITY LAYER // HIR × OAM APPLICATION · Created from Collin D. Weber's OSF Package // ───────────────────────────────────────────────────────────── const THREAT_CATEGORIES = [ { id: "warrant", label: "Warrant Integrity", code: "WI", oamPressures: [ { key: "I_oam", label: "Institutional Penetration", desc: "Bureaucratic rubber-stamp displacing judicial scrutiny of probable cause" }, { key: "K", label: "Compliance Rigidity", desc: "System resists scrutiny of warrant basis; deviation from template is penalized" }, { key: "R_oam", label: "Ideological Saturation", desc: "Pre-conviction narrative embedded in warrant language before any finding" }, ], hirChecks: [ { key: "H", label: "Honesty", question: "Does the warrant affidavit accurately reflect the actual factual basis, free from exaggeration or omission?" }, { key: "I_hir", label: "Integrity", question: "Is the stated basis structurally consistent with the supporting documents and timeline?" }, { key: "R_hir", label: "Respect", question: "Were the subject's Fourth Amendment protections meaningfully preserved — not merely formally invoked?" }, ], description: "Warrants become degraded when institutional pressure (high I_oam) and compliance rigidity (high K) replace genuine judicial review. The HIR check restores Honesty to the factual basis, Integrity to internal consistency, and Respect to the constitutional threshold.", }, { id: "report", label: "Police Report Fidelity", code: "RF", oamPressures: [ { key: "D", label: "Accumulated Degradation", desc: "Sedimented departmental norms normalizing selective or misleading documentation" }, { key: "Ac", label: "Alchemical Continuity (loss)", desc: "Depletion of the living capacity for honest judgment — replaced by template-filling" }, { key: "M", label: "Coercive Enforcement Index", desc: "Narrative shaped by enforcement outcome desired rather than events witnessed" }, ], hirChecks: [ { key: "H", label: "Honesty", question: "Does the written report faithfully reflect what was observed, without omission of exculpatory detail?" }, { key: "I_hir", label: "Integrity", question: "Are the sequence of events, timings, and officer roles internally consistent throughout?" }, { key: "F", label: "Fidelity", question: "Does the report maintain stable truth-alignment — consistent language for comparable events across the document?" }, ], description: "Report degradation occurs when accumulated departmental norms (high D) and depleted human judgment (low Ac) convert documentation into enforcement narrative. Honesty, Integrity, and Fidelity are the restorative checks.", }, { id: "bodycam", label: "Bodycam Discrepancy", code: "BD", oamPressures: [ { key: "M", label: "Coercive Enforcement Index", desc: "Footage disabled, lost, or withheld under enforcement pressure" }, { key: "K", label: "Compliance Rigidity", desc: "Institutional resistance to accountability via visual record" }, { key: "D", label: "Accumulated Degradation", desc: "Pattern of bodycam failures in high-stakes encounters signals systemic degradation" }, ], hirChecks: [ { key: "H", label: "Honesty", question: "Is the visual record complete, unedited, and consistent with what the written report claims occurred?" }, { key: "F", label: "Fidelity", question: "Where footage exists, does it maintain stable correspondence with the written timeline and witness accounts?" }, { key: "C", label: "Cohesion", question: "Do all video sources (body, dash, surveillance) fit together without unexplained gaps or contradictions?" }, ], description: "Bodycam discrepancies sit at the intersection of coercive enforcement pressure (high M) and compliance rigidity (high K). Fidelity and Cohesion checks detect where visual and written records diverge — a critical signal of record tampering or selective documentation.", }, { id: "evidence", label: "Evidence Gap Analysis", code: "EG", oamPressures: [ { key: "N", label: "Social Harm / Agency Loss", desc: "The subject's capacity to contest evidence is already eroded before any proceeding" }, { key: "G_oam", label: "Agency Erosion Multiplier", desc: "Each unexplained gap compounds the subject's downstream agency loss" }, { key: "I_oam", label: "Institutional Penetration", desc: "Chain-of-custody procedures replaced by pro forma documentation" }, ], hirChecks: [ { key: "I_hir", label: "Integrity", question: "Is the chain of custody complete, documented, and internally consistent from collection to courtroom?" }, { key: "C", label: "Cohesion", question: "Does the full evidence set cohere — no missing items, unexplained absences, or late-appearing materials?" }, { key: "R_hir", label: "Respect", question: "Was the subject's right to contest evidence preserved — through timely disclosure and proper preservation?" }, ], description: "Evidence gaps compound agency loss (high N) through the agency erosion multiplier (G_oam), which magnifies the effect of each gap downstream. Integrity and Cohesion checks map the structural completeness of the evidentiary record.", }, { id: "criminalization", label: "Wrongful Criminalization Risk", code: "WC", oamPressures: [ { key: "D", label: "Accumulated Degradation", desc: "Full OAM trajectory: each prior degradation (D) compounds into terminal system failure" }, { key: "N", label: "Social Harm / Agency Loss", desc: "Subject's independent agency within the proceeding is fully eroded" }, { key: "Ac", label: "Alchemical Continuity (loss)", desc: "Human judgment displaced at every node; the person becomes a case number" }, ], hirChecks: [ { key: "H", label: "Honesty", question: "Across all record sources, is there a consistent, honest account — or does the picture only cohere under a prosecutorial frame?" }, { key: "C", label: "Cohesion", question: "Does the totality of the record cohere without reliance on assumption, inference, or template-filling?" }, { key: "Rn", label: "Resonance", question: "Is the cumulative documentary record sufficient to support a fair proceeding — or has degradation made resonance impossible?" }, ], description: "Wrongful criminalization is the terminal OAM state: D accumulated, N maximized, Ac depleted. The Resonance (Rn) check is the final gateway — it asks whether the full record, after all degradation pressures, can still support due process.", }, ]; const HIR_BASELINE = { H: 0.86, I_hir: 0.84, R_hir: 0.82, F: 0.85, C: 0.86, Rn: 0.85 }; const OAM_BASELINE = { I_oam: 0.12, K: 0.22, R_oam: 0.18, D: 0.05, M: 0.20, N: 0.15, G_oam: 1.015, Ac: 0.88 }; const OAM_CURRENT = { I_oam: 0.70, K: 0.65, R_oam: 0.75, D: 0.72, M: 0.45, N: 0.60, G_oam: 1.09, Ac: 0.42 }; function ScoreBar({ value, max = 1, invert = false, compact = false }) { const pct = Math.min(100, (value / max) * 100); const isGood = invert ? value < 0.4 : value > 0.6; const isMid = invert ? (value >= 0.4 && value <= 0.6) : (value >= 0.4 && value <= 0.6); const color = isGood ? "#4ade80" : isMid ? "#fbbf24" : "#f87171"; return (
{value.toFixed(2)}
); } function RatingInput({ value, onChange, label }) { const levels = [ { v: 0.15, label: "CRITICAL" }, { v: 0.35, label: "LOW" }, { v: 0.55, label: "PARTIAL" }, { v: 0.75, label: "ADEQUATE" }, { v: 0.92, label: "HIGH" }, ]; return (
{levels.map(l => ( ))}
); } function ThreatPanel({ cat, scores, onScore }) { const [open, setOpen] = useState(false); const catScores = scores[cat.id] || {}; const hirValues = cat.hirChecks.map(c => catScores[c.key] ?? 0.55); const avgHir = hirValues.reduce((a, b) => a + b, 0) / hirValues.length; const oamMagnitude = cat.oamPressures.reduce((sum, p) => sum + OAM_CURRENT[p.key] / (OAM_CURRENT[p.key] + 0.01), 0) / cat.oamPressures.length; const integrityScore = Math.max(0, avgHir - (oamMagnitude - 0.5) * 0.3); const statusColor = integrityScore > 0.65 ? "#4ade80" : integrityScore > 0.45 ? "#fbbf24" : "#f87171"; const statusLabel = integrityScore > 0.65 ? "WITHIN BOUNDS" : integrityScore > 0.45 ? "FLAG FOR REVIEW" : "INTEGRITY BREACH"; return (
setOpen(!open)} style={{ display: "flex", alignItems: "center", padding: "10px 14px", cursor: "pointer", gap: 12, userSelect: "none" }} > {cat.code} {cat.label} {statusLabel} {open ? "▲" : "▼"}
{open && (

{cat.description}

{/* OAM Pressures */}
OAM DEGRADATION PRESSURES
{cat.oamPressures.map(p => (
{p.label} {p.key}: {typeof OAM_CURRENT[p.key] === 'number' && OAM_CURRENT[p.key] <= 1 ? OAM_CURRENT[p.key].toFixed(2) : OAM_CURRENT[p.key]}
{OAM_CURRENT[p.key] <= 1 && }
{p.desc}
))}
{/* HIR Integrity Checks */}
HIR INTEGRITY CHECKS
{cat.hirChecks.map(c => (
{c.label} ({c.key})
{c.question}
onScore(cat.id, c.key, v)} />
))}
COMPUTED INTEGRITY · {cat.code}
→ {statusLabel}
{integrityScore <= 0.45 && (
⚠ HUMAN REVIEW REQUIRED — NOT A LEGAL FINDING
This layer flags degradation conditions for human review only. It does not determine guilt, innocence, or legal outcome. A trained reviewer must assess whether documentary conditions warrant escalation. No automated adverse finding is generated.
)}
)}
); } export default function App() { const [scores, setScores] = useState({}); const [activeTab, setActiveTab] = useState("assess"); const handleScore = useCallback((catId, key, val) => { setScores(prev => ({ ...prev, [catId]: { ...(prev[catId] || {}), [key]: val } })); }, []); const computeOverall = () => { let total = 0, count = 0; THREAT_CATEGORIES.forEach(cat => { const catScores = scores[cat.id] || {}; const hirValues = cat.hirChecks.map(c => catScores[c.key] ?? 0.55); const avgHir = hirValues.reduce((a, b) => a + b, 0) / hirValues.length; const oamMag = cat.oamPressures.reduce((sum, p) => sum + OAM_CURRENT[p.key] / (OAM_CURRENT[p.key] + 0.01), 0) / cat.oamPressures.length; total += Math.max(0, avgHir - (oamMag - 0.5) * 0.3); count++; }); return total / count; }; const overallScore = computeOverall(); const breachCount = THREAT_CATEGORIES.filter(cat => { const catScores = scores[cat.id] || {}; const hirValues = cat.hirChecks.map(c => catScores[c.key] ?? 0.55); const avgHir = hirValues.reduce((a, b) => a + b, 0) / hirValues.length; const oamMag = cat.oamPressures.reduce((sum, p) => sum + OAM_CURRENT[p.key] / (OAM_CURRENT[p.key] + 0.01), 0) / cat.oamPressures.length; return Math.max(0, avgHir - (oamMag - 0.5) * 0.3) <= 0.45; }).length; const tabs = [ { id: "assess", label: "ASSESSMENT" }, { id: "map", label: "HIR × OAM MAP" }, { id: "guide", label: "FRAMEWORK" }, ]; return (
{/* Header */}
PRIMORDIAL CALCULUS · OSF CANONICAL PACKAGE v1.0 · COLLIN D. WEBER

PRE-CARCERAL DUE-PROCESS INTEGRITY LAYER

HIR × OAM APPLICATION · DOCUMENTARY RECORD INTEGRITY ASSESSMENT
{[ { label: "BOUNDED", desc: "5 threat domains only" }, { label: "NON-PUNITIVE", desc: "Flags only, no adverse findings" }, { label: "HUMAN-REVIEWED", desc: "No automated outcomes" }, { label: "NOT LEGAL ADVICE", desc: "Integrity assessment only" }, ].map(c => (
{c.label}
{c.desc}
))}
{/* Tabs */}
{tabs.map(t => ( ))}
{/* ── ASSESSMENT TAB ── */} {activeTab === "assess" && (
{/* Status bar */}
RECORD RESONANCE (Rn)
{overallScore > 0.65 ? "Record supports fair proceeding" : overallScore > 0.45 ? "Conditional — review required" : "Record integrity insufficient"}
INTEGRITY BREACHES
0 ? "#f87171" : "#4ade80", lineHeight: 1 }}> {breachCount}
of {THREAT_CATEGORIES.length} threat domains breached
ROUTING STATUS
{breachCount === 0 ? "STANDARD PROCEEDING" : breachCount <= 2 ? "HUMAN REVIEW QUEUE" : "INTEGRITY HOLD"}
{breachCount === 0 ? "No breaches flagged. Standard human review applies." : breachCount <= 2 ? "Flagged conditions require trained human reviewer before proceeding." : "Multiple breaches. Record should not advance without full integrity review."}
{THREAT_CATEGORIES.map(cat => ( ))}
)} {/* ── HIR × OAM MAP TAB ── */} {activeTab === "map" && (
ARCHITECTURAL MAPPING STATEMENT

OAM is the zero-tolerance hard-fault test built after HIR. In the pre-carceral context, OAM variables map the pressures that degrade documentary integrity. HIR variables — Honesty, Integrity, Respect, Fidelity, Cohesion, Resonance — provide the restorative baseline checks. This layer does not replace legal process; it identifies where OAM degradation has made fair process structurally difficult.

{/* The mapping table */}
{["THREAT", "DOMINANT OAM PRESSURES", "HIR RESTORATIVE CHECKS", "RESONANCE THRESHOLD"].map(h => ( ))} {THREAT_CATEGORIES.map((cat, i) => ( ))}
{h}
{cat.code}
{cat.label}
{cat.oamPressures.map(p => (
{p.key} · {p.label}
))}
{cat.hirChecks.map(c => (
{c.key} · {c.label}
))}
{cat.id === "criminalization" ? "Rn > 0.65 required" : "F, C > 0.60 required"}
Baseline: Rn ≈ 0.85 (pre-OAM)
{/* Equation block */}
CANONICAL EQUATIONS APPLIED · FROM OSF PACKAGE (Weber, 2026)
HIR CONSTRUCTIVE SEQUENCE
{[ "H + I → F (Fidelity)", "R + I → C (Cohesion)", "F + C → Rn (Resonance)", "Rn[t+1] = Rn[t] + α(F[t]·C[t]) − δ", "S_core = s(H, I, R, Rn, G)", ].map(eq => (
{eq}
))}
OAM DEGRADATION EQUATIONS
{[ "G_oam[t] = 1 + q·N[t]", "N[t+1] = N[t] + (b·R·K·P[t] + g·R·K·I)·G_oam + …", "D[t+1] = D[t] + a·R·K·I·P·N·E + …", "E[t+1] = E[t] + m_eco·R·K·P + n_eco·N + …", "PDIL integrity = f(HIR checks) − f(OAM pressures)", ].map(eq => (
{eq}
))}
)} {/* ── FRAMEWORK TAB ── */} {activeTab === "guide" && (
{[ { title: "WHAT THIS LAYER DOES", color: "#60a5fa", items: [ "Maps five documentary integrity threat domains to OAM degradation variables", "Applies HIR restorative checks (H, I, R, F, C, Rn) against each threat", "Computes a per-domain and overall resonance integrity score", "Routes low-resonance records to human review queues", "Provides structured language for reviewers — not legal conclusions", ] }, { title: "WHAT THIS LAYER DOES NOT DO", color: "#f87171", items: [ "Determine guilt or innocence — that is never its function", "Generate adverse legal findings against any party", "Replace or supersede legal counsel, courts, or official review", "Constitute legal advice of any kind", "Operate without human review — no automated outcome is valid", ] } ].map(block => (
{block.title}
{block.items.map((item, i) => (
{item}
))}
))}
{/* Variable reference */}
OAM VARIABLE REFERENCE · CURRENT SYSTEMIC ESTIMATES
{Object.entries(OAM_CURRENT).filter(([k]) => OAM_CURRENT[k] <= 1).map(([k, v]) => { const labels = { I_oam: "Institutional Penetration", K: "Compliance Rigidity", R_oam: "Ideological Saturation", D: "Accumulated Degradation", M: "Coercive Enforcement", N: "Agency Loss Index", Ac: "Alchemical Continuity" }; const isAc = k === "Ac"; const bad = isAc ? v < 0.5 : v > 0.5; return (
{k} {v.toFixed(2)}
{labels[k] || k}
Baseline: {OAM_BASELINE[k]?.toFixed(2)}
); })}
CANONICAL SOURCE

Framework derived exclusively from: Primordial Calculus OSF Canonical Package v1.0 + 018 (Weber, C.D., 2026). HIR as bedrock constructive triad (H + I → F; R + I → C; F + C → Rn). OAM as the zero-tolerance hard-fault test built after HIR. Baseline calibration from 003_HIR_OAM_Historical_Baseline_Calibration_v0_1.txt (HIR/Rn ≈ 0.85; D ≈ 0.05). This application is bounded to documentary integrity assessment and does not constitute externally validated science. It inherits the package's provisional status accordingly.

)}
); }