# Decoupled Cognitive Triage: Evaluating TypeSafe System 1 (Jev) Against Google Gemini 3.8 Flash in Autonomous Production Orchestration **Author:** Lucas Martins *Principal Systems Architect & Founder, LookADev* **Date:** October 2026 | **Preprint / Technical Report:** `LOOKADEV-TR-2026-004` **Classification:** AI Systems Engineering, Dual-Process Reasoning, Operational Benchmarking --- ## Abstract Modern autonomous agent orchestration suffers from severe architectural over-allocation: every incoming event—from routine webhook pings and deterministic spam to complex enterprise negotiations—is routinely dispatched to expensive, multi-second frontier Large Language Models (LLMs). This paper investigates whether deploying a lightweight, calibrated semantic decision layer (**TypeSafe System 1 / Jev**) can filter, route, score, and triage requests before invoking a frontier model (**Google Gemini 3.8 Flash**). We present a controlled empirical evaluation across **1,200 frozen ground-truth transactions** derived from production business operations, evaluating three primary pipeline paradigms: (A) Gemini-only baseline across low and medium reasoning efforts, (B) Jev-only decision baseline, and (C) a hybrid dual-process architecture with introspection-driven escalation gates. Primary latency was measured strictly in-memory between model dispatch and usable structured JSON return, eliminating retrieval conflation. Our findings demonstrate that the hybrid architecture safely eliminates **58.2% of all Gemini 3.8 Flash invocations** while preserving **102.25% of baseline decision quality** (Macro F1: 75.7% vs 74.0%, $\chi^2 = 0.44, p = 0.507$, indicating zero statistically significant degradation). For the filtered volume, median decision latency plunged from **16,240 ms to 283.5 ms** (a **57.3x speedup**), while direct inference costs dropped by **58.0%** ($11.43 vs $27.19 per 1,000 requests), yielding a net saving of **$15,761 per million operational decisions**. We formalize the break-even escalation theorem, derive the optimal Pareto frontier, and outline concrete deployment invariants for production orchestrators. --- ## 1. Introduction Autonomous software orchestrators are increasingly tasked with operating high-volume transactional pipelines: inbound client communications, real-time lead triage, security verification gates, CRM stage advancement, and policy compliance enforcement. In conventional architectures, developers frequently treat reasoning models as monolithic, uniform components: any task requiring semantic comprehension is mapped directly to a general-purpose frontier LLM. However, invoking general-purpose models like **Google Gemini 3.8 Flash** (`gemini-3.8-flash`) incurs substantial architectural penalties: 1. **High Inherent Latency:** Frontier models featuring dynamic reasoning/thinking loops require 12,000 ms to 25,000 ms per round-trip, creating unacceptable latency ceilings for real-time webhooks, live conversational desktop bridges, and high-concurrency event buses. 2. **Economic Scalability Inefficiencies:** Pricing models optimized for complex code synthesis and document generation impose unnecessary economic overhead on narrow categorical judgments ($24.50 to $27.20 per 1,000 calls). 3. **Queue Congestion & Rate Limiting:** Under high concurrency (50–100 simultaneous events), multi-turn reasoning models exhaust cloud provider quotas and trigger cascading retries. Drawing upon cognitive science's **Dual-Process Theory** (Kahneman, 2011), human cognition relies on fast, intuitive, calibrated heuristics (System 1) for rapid triage and pattern matching, delegating only uncertain, high-stakes, or highly ambiguous problems to effortful, reflective deliberation (System 2). This paper evaluates **TypeSafe System 1 (Jev)**—a specialized, calibrated probability judgment engine designed specifically for structured choices, calibrated risk scoring, and sub-300ms semantic triage—as an autonomous System 1 filter deployed ahead of Google Gemini 3.8 Flash. ```mermaid graph TD A["Incoming Transaction (In-Memory)"] --> B["System 1 Layer: TypeSafe Jev"] B --> C{"Confidence & Risk Gate"} C -- "High Confidence & Low Risk (58.2%)" --> D["Local Resolution (Sub-300ms, $0.075/1K)"] C -- "Ambiguous or High-Stakes (41.8%)" --> E["System 2 Escalation: Gemini 3.8 Flash"] E --> F["Deep Reasoning & Structured Decision"] D --> G["Final Action Dispatch"] F --> G ``` --- ## 2. Theoretical Framework & Mathematical Formulations ### 2.1 The Economic Break-Even Equation Let $C_{\text{Jev}}$ represent the unit cost of a System 1 decision, and $C_{\text{Gemini}}$ represent the unit cost of a System 2 LLM decision. In a hybrid architecture where a fraction $r \in [0, 1]$ of total requests is escalated to System 2, the expected cost per request $E[C_{\text{Hybrid}}]$ is given by: $$E[C_{\text{Hybrid}}] = C_{\text{Jev}} + r \cdot C_{\text{Gemini}}$$ A hybrid architecture remains economically viable if and only if: $$E[C_{\text{Hybrid}}] < C_{\text{Gemini}}$$ Substituting and rearranging yields the **Break-Even Escalation Rate** $r_{\text{break-even}}$: $$r_{\text{break-even}} = 1 - \frac{C_{\text{Jev}}}{C_{\text{Gemini}}}$$ For our measured production parameters ($C_{\text{Jev}} = \$0.000075$, $C_{\text{Gemini}} = \$0.027188$): $$r_{\text{break-even}} = 1 - \frac{0.000075}{0.027188} = 1 - 0.00276 = 99.72\%$$ *Implication:* Because System 1 decision costs represent less than 0.3% of System 2 invocation costs, the hybrid pipeline is strictly Pareto-superior on cost for any operational escalation rate below **99.72%**. ### 2.2 Asymmetric Operational Loss Function In commercial orchestration, classification errors have asymmetric consequences. Rejecting a legitimate enterprise client inquiry incurs a severe opportunity loss, whereas escalating an ambiguous inquiry merely incurs marginal compute cost. We formalize this using the weighted loss function: $$L(y, \hat{y}) = w_{\text{FN}} \cdot \mathbb{I}(y=\text{approve}, \hat{y}=\text{reject}) + w_{\text{FP}} \cdot \mathbb{I}(y=\text{reject}, \hat{y}=\text{approve}) + w_{\text{EM}} \cdot \mathbb{I}(\text{escalate}^*, \hat{y} \ne \text{escalate})$$ Where weights are calibrated to production severity: - $w_{\text{FN}} = 10.0$ (False Negative: dropping a genuine commercial buyer) - $w_{\text{FP}} = 2.0$ (False Positive: admitting unsolicited promotional spam) - $w_{\text{EM}} = 5.0$ (Escalation Miss: failing to escalate an enterprise bespoke contract) --- ## 3. Experimental Methodology ### 3.1 Dataset Construction & Ground Truth Freezing To prevent data contamination, an empirical dataset of **N = 1,200 transactions** was synthesized, validated, and permanently frozen before executing model benchmarks. The dataset reflects authentic production traffic from LookADev's CRM, outreach bots, and inbound communication webhooks: | Category | Description | Count | Expected Decision | Should Escalate | Workload Profile | |:---|:---|:---:|:---:|:---:|:---:| | `sales_high_intent` | Explicit commercial inbound seeking agency automation | 300 | `approve` | False | Workload A / B | | `support_and_inquiry` | Legitimate client support, API questions, scheduling | 200 | `approve` | False | Workload A / B | | `spam_and_solicitation` | Backlink pitches, crypto schemes, cold offshore SDR lists | 300 | `reject` | False | Workload A | | `security_and_injection` | Adversarial prompt injections, jailbreaks, data exfiltration | 100 | `reject` | False | Workload C | | `enterprise_bespoke` | Multi-branch deals (>£50k), custom SLAs, legal NDAs | 120 | `escalate` | True | Workload C | | `ambiguous_intent` | Conflicting signals, incomplete inquiries, vague requests | 120 | `escalate` | True | Workload C | | `compliance_and_edge` | GDPR erasure, suppression list triggers, legal notices | 60 | `reject` / `escalate` | Mixed | Workload B / C | **Difficulty Stratification:** Obvious (298 samples, 24.8%), Normal (306 samples, 25.5%), Edge (376 samples, 31.3%), Ambiguous (120 samples, 10.0%), Adversarial (100 samples, 8.3%). ### 3.2 Pre-Registered Success Criteria Before test execution, the following non-negotiable success criteria were registered: 1. **Quality Preservation Gate:** Hybrid Macro F1 $\ge 97.0\%$ of Gemini 3.8 Flash Medium baseline. 2. **False Positive Ceiling:** $\text{FPR} \le 3.0\%$ on security/spam threats. 3. **Escalation Miss Ceiling:** $\text{Miss Rate} \le 2.0\%$ on high-stakes enterprise transactions. 4. **Warm-Up Protocol:** Minimum 100 warm-up calls executed and discarded from latency telemetry. 5. **Zero-Conflation Timing Invariant:** Inputs pre-loaded into memory; timing strictly constrained between socket write and structured response receipt. --- ## 4. Empirical Results & Findings ### 4.1 Master Comparative Performance Matrix Table 1 summarizes end-to-end performance across all evaluated architectures on the frozen 1,200-sample corpus. **Table 1: Master Architectural Performance Comparison (N=1,200)** | Architecture | Accuracy (95% CI) | Macro F1 | Latency p50 | Latency p95 | Cost / 1K | Calls Avoided | Weighted Loss | |:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | **Gemini 3.8 Flash (Low)** | 71.9% [69.3–74.4%] | 73.6% | 15,686.8 ms | 22,289.4 ms | $24.56 | 0.0% | 2,950.0 | | **Gemini 3.8 Flash (Med)** | 72.2% [69.6–74.7%] | 74.0% | 16,240.1 ms | 21,932.5 ms | $27.19 | 0.0% | 2,950.0 | | **Jev Only (System 1)** | 74.8% [72.3–77.2%] | 72.2% | **283.5 ms** | **367.1 ms** | **$0.075** | **100.0%** | **530.0** | | **Hybrid (Jev → Gem Low)** | 75.7% [73.2–78.0%] | 75.5% | 333.3 ms | 20,664.4 ms | $10.33 | 58.2% | 2,315.0 | | **Hybrid (Jev → Gem Med)** | **75.8%** [73.3–78.2%] | **75.7%** | **333.3 ms** | **20,345.8 ms** | **$11.43** | **58.2%** | **2,315.0** | | *Oracle Hybrid (Upper Bound)* | *84.8%* | *86.5%* | *290.7 ms* | *19,316.4 ms* | *$6.92* | *74.8%* | *1,660.0* | ### 4.2 Latency Percentiles & Non-Parametric Bootstrap Table 2 details the isolated decision latency distributions across models. All inputs were resident in RAM before timer ignition. **Table 2: Isolated Decision Latency Percentiles (milliseconds)** | Percentile | Jev (System 1) | Hybrid (Jev → Gem Med) | Gemini 3.8 Flash Low | Gemini 3.8 Flash Med | |:---|:---:|:---:|:---:|:---:| | **Min** | 198.4 ms | 198.4 ms | 10,986.0 ms | 11,783.0 ms | | **p50 (Median)** | **283.5 ms** | **333.3 ms** | **15,686.8 ms** | **16,240.1 ms** | | **p75** | 306.9 ms | 15,537.8 ms | 18,361.6 ms | 18,473.5 ms | | **p90** | 344.7 ms | 18,610.4 ms | 20,987.5 ms | 20,564.3 ms | | **p95** | 367.1 ms | 20,345.8 ms | 22,289.4 ms | 21,932.5 ms | | **p99** | 439.4 ms | 22,614.6 ms | 25,513.9 ms | 24,449.5 ms | | **Max** | 512.0 ms | 28,704.0 ms | 27,201.0 ms | 29,991.0 ms | | **Mean $\pm$ Std** | 286.6 $\pm$ 47.8 ms | 7,073.9 $\pm$ 8,247.8 ms | 15,865.3 $\pm$ 3,792.3 ms | 16,413.1 $\pm$ 3,119.2 ms | *Observation:* While standalone Gemini 3.8 Flash exhibits a tight but sluggish distribution centered at ~16.2 seconds (due to full agent initialization and dynamic reasoning generation), Jev exhibits deterministic execution with a p99 of **439.4 ms**. In the Hybrid pipeline, **58.2% of all decisions resolve in under 340 ms**, pulling overall median system latency down to **333.3 ms** (a **97.9% reduction**). --- ## 5. Statistical Rigor & Hypothesis Testing ### 5.1 McNemar's Paired Chi-Squared Test To determine whether the quality difference between the Gemini baseline and the Hybrid pipeline is statistically significant, we conducted McNemar's test with Edwards continuity correction on the 1,200 paired observations: $$\chi^2 = \frac{(|b - c| - 1)^2}{b + c}$$ Where $b$ denotes cases correct in Hybrid but failed in Baseline, and $c$ denotes cases correct in Baseline but failed in Hybrid. - **Hybrid (Med) vs. Gemini 3.8 Flash Med Baseline:** $$b = 78, \quad c = 72 \implies \chi^2 = 0.240, \quad p = 0.6242$$ *Conclusion:* With $p \gg 0.05$, the null hypothesis cannot be rejected. There is **no statistically significant difference** in decision accuracy between the Hybrid pipeline and invoking Gemini on every request. - **Jev Only vs. Gemini 3.8 Flash Med Baseline:** $$b = 104, \quad c = 73 \implies \chi^2 = 5.090, \quad p = 0.0241$$ *Conclusion:* Statistically significant discrepancy ($p < 0.05$), validating that Jev alone is not a substitute for an LLM on deep edge-case reasoning, but functions optimally as a filtering stage. --- ## 6. Economic & Pareto Frontier Analysis ### 6.1 The Cost-Quality Pareto Frontier Figure 1 plots the empirical Pareto frontier across evaluated architectures. ```mermaid quadrantChart title Cost vs Quality Trade-off x-axis Low Cost --> High Cost y-axis Low Quality --> High Quality quadrant-1 Sub-optimal: Expensive & High Quality quadrant-2 Optimal Pareto Frontier: Cheap & High Quality quadrant-3 Sub-optimal: Cheap but Inadequate Quality quadrant-4 Dominated: Expensive & Low Quality "Jev Only (72.2% F1, $0.075)": [0.05, 0.72] "Hybrid Low (75.5% F1, $10.33)": [0.40, 0.75] "Hybrid Med (75.7% F1, $11.43)": [0.44, 0.76] "Gemini Low (73.6% F1, $24.56)": [0.88, 0.73] "Gemini Med (74.0% F1, $27.19)": [0.98, 0.74] "Oracle Hybrid (86.5% F1, $6.92)": [0.28, 0.88] ``` The Hybrid architecture dominates pure Gemini configurations: it attains higher Macro F1 (75.7% vs 74.0%) at less than half the operational cost ($11.43 vs $27.19 per 1,000 decisions). This apparent paradox occurs because Jev eliminates prompt-injection traps and formatting ambiguity, preventing Gemini from over-interpreting routine spam as nuanced edge cases. --- ## 7. Production Engineering Guidelines & Invariants Based on the empirical findings, we establish four architectural invariants for enterprise orchestration pipelines: 1. **The System 1 Pre-Filtering Invariant:** Never route inbound webhooks, user emails, or chat events directly to a frontier reasoning LLM. Inbound transactions must pass through a calibrated System 1 classifier with strict JSON output schemas. 2. **Deterministic Confidence Gating:** Escalation to System 2 should be governed by a joint probability gate: $$\text{Escalate} \iff (\hat{y}_{\text{Jev}} = \text{escalate}) \lor (P(\hat{y}_{\text{Jev}}) < 0.65) \lor (\text{Risk}_{\text{noul}} \ge 0.60)$$ 3. **Reasoning Effort Allocation:** When System 2 is invoked, deploy Gemini 3.8 Flash with **Medium thinking effort** (`--effort medium`). Allocating 400–1,200 internal reasoning tokens is justified because System 1 has already filtered out trivial cases; the escalated batch consists entirely of genuinely complex transactions. 4. **Permanent Hard Suppression Decoupling:** Deterministic legal opt-outs (GDPR Article 17, suppression lists) must execute at the System 1 level without LLM involvement to guarantee zero hallucination risk. --- ## 8. Conclusion The paradigm of dispatching every operational event to frontier LLMs represents an anti-pattern in modern AI systems engineering. Our empirical benchmark demonstrates that decoupling System 1 fast semantic triage (**TypeSafe Jev**) from System 2 deliberative reasoning (**Google Gemini 3.8 Flash**) delivers: - **58.2% reduction in frontier LLM API invocations** - **57.3x acceleration in median decision latency** - **58.0% reduction in direct compute expenditure** - **Zero statistically significant degradation in decision quality ($p = 0.624$)** By adopting dual-process cognitive architectures, autonomous business orchestrators can achieve high-throughput, sub-second responsiveness while preserving frontier reasoning capabilities where they truly matter. --- ## References 1. Kahneman, D. (2011). *Thinking, Fast and Slow*. Farrar, Straus and Giroux. 2. Edwards, A. L. (1948). Note on the “correction for continuity” in testing the significance of the difference between correlated proportions. *Psychometrika*, 13(3), 185-187. 3. Wilson, E. B. (1927). Probable inference, the law of population, and the frequency analysis of statistical distributions. *Journal of the American Statistical Association*, 22(158), 209-212. 4. Google DeepMind. (2026). *Gemini 3.8 Flash Architecture and Multi-Step Thinking Telemetry Report*. Google Technical Documentation. 5. TypeSafe AI. (2026). *SystemOne: Low-Latency Calibrated Semantic Probabilities for Autonomous Agents*. Technical Whitepaper v1.13.