<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akshara A</title>
    <description>The latest articles on DEV Community by Akshara A (@aks_a).</description>
    <link>https://dev.to/aks_a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4175560%2Fd7b569d4-ea07-403c-afa1-906f4af3817e.png</url>
      <title>DEV Community: Akshara A</title>
      <link>https://dev.to/aks_a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aks_a"/>
    <language>en</language>
    <item>
      <title>The Autonomous 100% local CLI Agent That Codes While You Sleep</title>
      <dc:creator>Akshara A</dc:creator>
      <pubDate>Sat, 31 Oct 2026 18:26:27 +0000</pubDate>
      <link>https://dev.to/aks_a/the-autonomous-100-local-cli-agent-that-codes-while-you-sleep-20h2</link>
      <guid>https://dev.to/aks_a/the-autonomous-100-local-cli-agent-that-codes-while-you-sleep-20h2</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Night Ghost 👻: The Autonomous Agent That Codes While You Sleep
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I stopped halfway" → "I woke up further ahead."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Every developer and indie hacker knows the evening exhaustion of leaving code half-finished. You hit a wall at 11 PM: functions lack edge-case tests, helper logic is duplicated, and your working tree is messy. By the time you wake up the next morning, context and momentum have vanished. The first hour of your day is spent re-orienting: &lt;em&gt;"Where was I? What broke? What was I about to test?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Night Ghost&lt;/strong&gt; is an open-source, &lt;strong&gt;100% local CLI agent powered by Ollama&lt;/strong&gt; designed to bridge that evening-to-morning gap. It is quite literally a &lt;strong&gt;benevolent ghost in your machine&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;100% Local &amp;amp; Offline&lt;/strong&gt;: All inference runs directly on your machine through Ollama. No source code, diffs, or credentials ever leave your device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Air-Gapped Egress&lt;/strong&gt;: The test runner actively blocks network access during test runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Guardrails&lt;/strong&gt;: Security and path boundaries are enforced in Python code, not by trusting system prompts.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;In the Evening&lt;/strong&gt;: You drop a quick task note before closing your laptop:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   nightghost note &lt;span class="s2"&gt;"Add unit tests for charge() edge cases and clean up duplicated currency rounding"&lt;/span&gt;
   nightghost &lt;span class="nb"&gt;sleep&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Overnight (While You Sleep)&lt;/strong&gt;: Night Ghost wakes up (triggered via local cron/timer), reads your note and recent diffs, creates an isolated branch (&lt;code&gt;nightghost/YYYY-MM-DD&lt;/code&gt;), and runs an autonomous, test-gated pipeline:

&lt;ul&gt;
&lt;li&gt;Plans small, verification-gated steps.&lt;/li&gt;
&lt;li&gt;Proposes test additions and safe, behavior-preserving cleanups.&lt;/li&gt;
&lt;li&gt;Evaluates every write against strict security guardrails in Python code.&lt;/li&gt;
&lt;li&gt;Runs your test suite (&lt;code&gt;pytest&lt;/code&gt;) in a sandboxed, offline environment.&lt;/li&gt;
&lt;li&gt;Commits every verified step (&lt;code&gt;ghost: &amp;lt;step&amp;gt;&lt;/code&gt;). If any test regresses, it automatically rolls back.&lt;/li&gt;
&lt;li&gt;Compiles a transparent morning report from measured execution logs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In the Morning&lt;/strong&gt;: You open your laptop, review the factual report and the clean diff, and decide whether to merge or discard:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   nightghost report
   git diff main..nightghost/2026-11-01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Terminal Workflow (Local CLI)
&lt;/h3&gt;

&lt;p&gt;Watch Night Ghost wake up, analyze the task, run tests, and commit progress autonomously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;demo_project
&lt;span class="nv"&gt;$ &lt;/span&gt;nightghost status

┌────────────────────────────────┬──────────────────────┐
│ Property                       │ Value                │
├────────────────────────────────┼──────────────────────┤
│ Current Git Branch             │ main                 │
│ Uncommitted Changes            │ Clean                │
│ Scheduled Time                 │ 01:00                │
│ Configured Model               │ gemma4:e2b &lt;span class="o"&gt;(&lt;/span&gt;ollama&lt;span class="o"&gt;)&lt;/span&gt;  │
│ Test Command                   │ pytest &lt;span class="nt"&gt;-q&lt;/span&gt;            │
│ Ollama Server                  │ Online               │
│ Model Status                   │ Ready &lt;span class="o"&gt;(&lt;/span&gt;Installed&lt;span class="o"&gt;)&lt;/span&gt;    │
│ Kill Switch &lt;span class="o"&gt;(&lt;/span&gt;.nightghost/STOP&lt;span class="o"&gt;)&lt;/span&gt; │ Disengaged &lt;span class="o"&gt;(&lt;/span&gt;Ready&lt;span class="o"&gt;)&lt;/span&gt;   │
└────────────────────────────────┴──────────────────────┘

&lt;span class="nv"&gt;$ &lt;/span&gt;nightghost note &lt;span class="s2"&gt;"Add comprehensive unit tests for payment edge cases"&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nightghost run

┌────────── Overnight Run ──────────┐
│ Night Ghost Active                │
│ Model: gemma4:e2b &lt;span class="o"&gt;(&lt;/span&gt;ollama&lt;span class="o"&gt;)&lt;/span&gt;        │
│ Mode: LIVE RUN                    │
└───────────────────────────────────┘

&lt;span class="o"&gt;[&lt;/span&gt;OK] Pipeline completed!
Branch: nightghost/2026-10-31
Steps Planned: 2
Steps Executed: 2
Elapsed: 142.7s

&lt;span class="nv"&gt;$ &lt;/span&gt;nightghost report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Sample Morning Report Output
&lt;/h3&gt;

&lt;p&gt;Every claim in the morning report is compiled directly from &lt;code&gt;actions.jsonl&lt;/code&gt; and git diff stats—not model hallucinations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Night Ghost Report: 2026-10-31&lt;/span&gt;
Task: "Add comprehensive unit tests for charge() and refund() edge cases"
Branch: nightghost/2026-10-31 (2 commits, 2 files, +38 / -6)
Model: gemma4:e2b (local) | Runtime: 2m 22s

&lt;span class="gu"&gt;## Result at a glance&lt;/span&gt;
[PASS] Tests: 2 -&amp;gt; 6 passing (0 failing)

&lt;span class="gu"&gt;## What I did&lt;/span&gt;
&lt;span class="p"&gt;1.&lt;/span&gt; Added unit tests for charge() negative amounts raising ValueError: commit a1f4d92
&lt;span class="p"&gt;2.&lt;/span&gt; Added unit tests for refund() invalid transaction IDs: commit 8c2b1e4

&lt;span class="gu"&gt;## Needs your judgment&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; None. All committed changes are self-contained and behavior-preserving.

&lt;span class="gu"&gt;## Skipped / failed&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; None. All attempted steps passed validation.

&lt;span class="gu"&gt;## Blocked by guardrails&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; None. All file and command requests adhered to security rules.

&lt;span class="gu"&gt;## How to review&lt;/span&gt;
git diff main..nightghost/2026-10-31
nightghost discard   # to throw it all away
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Dry-Run Simulation Mode
&lt;/h3&gt;

&lt;p&gt;Night Ghost also provides a simulation mode so you can preview planned steps and check baseline tests without writing files or making commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nightghost run &lt;span class="nt"&gt;--dry-run&lt;/span&gt;
nightghost report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxwp3hyb9dubzho5dr6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffxwp3hyb9dubzho5dr6y.png" alt=" " width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/akshara-a/Night-Ghost" rel="noopener noreferrer"&gt;https://github.com/akshara-a/Night-Ghost&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Architecture at a Glance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────┐   ┌───────────┐   ┌──────────────┐   ┌─────────────┐
│ Task note  │──▶│  Planner  │──▶│  Executor    │──▶│  Reporter   │
│ + config   │   │ (Open LLM)│   │ (LLM + tools)│   │ (log→MD)    │
└────────────┘   └───────────┘   └──────┬───────┘   └─────────────┘
                                        │
                  ┌─────────────────────┼─────────────────────┐
                  ▼                     ▼                     ▼
            ┌──────────┐         ┌────────────┐        ┌────────────┐
            │ Guardrail│         │ Test Runner│        │ Git Manager│
            │ (paths,  │         │ (sandboxed │        │ (branch,   │
            │  budgets)│         │  subproc)  │        │  commits)  │
            └──────────┘         └────────────┘        └────────────┘
                                        │
                                  ┌─────▼──────┐
                                  │ Local LLM  │
                                  │ (Ollama)   │
                                  └────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Engineering Components:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail Engine (&lt;code&gt;guardrail.py&lt;/code&gt;)&lt;/strong&gt;: All writes are path-checked in deterministic code (resolving symlinks and &lt;code&gt;..&lt;/code&gt;). Denylist precedence protects &lt;code&gt;.env*&lt;/code&gt;, &lt;code&gt;migrations/**&lt;/code&gt;, &lt;code&gt;*.pem&lt;/code&gt;, &lt;code&gt;*.key&lt;/code&gt;, and lockfiles. Detects secrets and blocks command injection vectors (&lt;code&gt;;&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt;, backticks, &lt;code&gt;$()&lt;/code&gt;, newlines).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assertion Tampering Protection&lt;/strong&gt;: Hard rule preventing models from "fixing" tests by weakening them. If an existing test assertion is altered or deleted, the write is instantly rejected with &lt;code&gt;EXISTING_ASSERTION_MODIFIED&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Isolation (&lt;code&gt;gitmanager.py&lt;/code&gt;)&lt;/strong&gt;: Never touches &lt;code&gt;main&lt;/code&gt; or leaves your working tree dirty. Snapshots uncommitted work with &lt;code&gt;git stash create&lt;/code&gt;, works on &lt;code&gt;nightghost/YYYY-MM-DD&lt;/code&gt;, makes atomic &lt;code&gt;ghost: &amp;lt;step&amp;gt;&lt;/code&gt; commits, and supports one-command rollback with &lt;code&gt;nightghost discard&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Runner (&lt;code&gt;testrunner.py&lt;/code&gt;)&lt;/strong&gt;: Runs &lt;code&gt;pytest&lt;/code&gt; in a sandboxed subprocess with proxy poisoning (&lt;code&gt;http_proxy=http://127.0.0.1:0&lt;/code&gt;, &lt;code&gt;PIP_NO_INDEX=1&lt;/code&gt;) to enforce zero network egress.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Suite&lt;/strong&gt;: 33 automated tests (&lt;code&gt;pytest&lt;/code&gt;) covering every denial path, symlink escape, budget constraint, and pipeline execution.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  100% Local Inference via Ollama
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero Cloud Dependence&lt;/strong&gt;: Night Ghost is built strictly for &lt;strong&gt;100% local, offline execution using Ollama&lt;/strong&gt;. It runs completely disconnected from the internet, communicating over &lt;code&gt;localhost:11434&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-Weight Coder Models&lt;/strong&gt;: Fully tested and optimized with open models including:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 (&lt;code&gt;gemma4:e2b&lt;/code&gt; / &lt;code&gt;gemma4:e4b&lt;/code&gt;)&lt;/strong&gt;: Ultra-efficient reasoning on modest consumer hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen 2.5 Coder (&lt;code&gt;qwen2.5-coder:14b&lt;/code&gt; / &lt;code&gt;7b&lt;/code&gt;)&lt;/strong&gt;: Deep context understanding and accurate test generation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Llama 3 / DeepSeek-Coder-V2&lt;/strong&gt;: Advanced multi-file refactoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Agent Harness
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python 3.11+&lt;/strong&gt;, &lt;strong&gt;Typer&lt;/strong&gt;, and &lt;strong&gt;Rich&lt;/strong&gt; for a terminal UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pydantic v2&lt;/strong&gt; and &lt;strong&gt;PyYAML&lt;/strong&gt; for strict schema validation in &lt;code&gt;nightghost.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jinja2&lt;/strong&gt; for compiling transparent morning reports from JSONL action logs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;100% Local Code Privacy via Ollama&lt;/strong&gt;: Developers cannot and should not send their proprietary codebases, uncommitted diffs, or corporate repositories to third-party closed cloud APIs while they sleep. Open innovation makes running open-weight models 100% locally via Ollama viable on everyday laptops, ensuring &lt;strong&gt;not a single byte of code or credentials ever leaves your machine&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Security Over Model Promises&lt;/strong&gt;: Closed-source agent frameworks often rely on "system prompt polite requests" not to touch sensitive files. Night Ghost enforces security in deterministic open-source code—every path check, symlink resolution, and assertion integrity check is auditable, testable, and mathematically verified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Per-Token Metering&lt;/strong&gt;: An autonomous multi-turn overnight loop executing dozens of test iterations would rack up unpredictable API bills on closed models. Running open-weight models 100% locally via Ollama empowers indie developers to run autonomous agents overnight completely free.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Spirit of It
&lt;/h2&gt;

&lt;p&gt;There is a distinct, quiet magic in closing your laptop with a half-solved problem, going to sleep, and waking up with your morning coffee to find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[PASS] Tests: 2 -&amp;gt; 6 passing (0 failing)
1. Added unit tests for charge() negative amounts: commit a1f4d92
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dreaded edge cases you didn't have the energy to write at midnight are written, tested green, and neatly committed on an isolated branch. You didn't lose your morning momentum—you woke up further ahead. That is the spirit of a benevolent Ghost in the Machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Best Use of Open-Weight Models (Ollama / Gemma / Llama / Qwen)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Developer Productivity &amp;amp; Autonomous Developer Tooling&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>The Midnight Steeper: A Slow and Steady Bedtime Pet That Sends Kids to Sleep</title>
      <dc:creator>Akshara A</dc:creator>
      <pubDate>Sun, 25 Oct 2026 17:51:24 +0000</pubDate>
      <link>https://dev.to/aks_a/the-midnight-steeper-a-slow-and-steady-bedtime-pet-that-sends-kids-to-sleep-48bm</link>
      <guid>https://dev.to/aks_a/the-midnight-steeper-a-slow-and-steady-bedtime-pet-that-sends-kids-to-sleep-48bm</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The Midnight Steeper: The Slow and Steady Bedtime Pet That Sends Kids to Sleep
&lt;/h1&gt;

&lt;p&gt;Most kids' mobile games and virtual pets are designed by attention engineers to do one thing: &lt;strong&gt;keep kids tapping forever&lt;/strong&gt;. They use flashing streaks, infinite loops, and dopamine casino bells that make bedtime a nightly negotiation battle between parents and exhausted children.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Midnight Steeper&lt;/strong&gt; flips this on its head for the &lt;strong&gt;"Slow and Steady"&lt;/strong&gt; theme. It is a 3D virtual talking pet game starring &lt;strong&gt;Sunny the Sloth&lt;/strong&gt; that &lt;strong&gt;ends screen time instead of extending it&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Kids can care for Sunny like &lt;em&gt;Talking Tom&lt;/em&gt; — give him a warm bubble bath, feed him treats, play sensory mini-games, and talk with him. But when it's bedtime, kids mix calming botanical tea, tuck Sunny in for a real-time nap, and &lt;strong&gt;Sunny tells them to go to sleep too&lt;/strong&gt;. The game locks down into a tranquil night mode while forest friends secretly visit in the background. In the morning, kids wake up to a surprise collectible sticker and a kind, personalized letter written by open-weight AI!&lt;/p&gt;




&lt;h2&gt;
  
  
  🦥 What I Built
&lt;/h2&gt;

&lt;p&gt;An open-source, privacy-first 3D virtual pet and bedtime companion designed for children aged 5–10 with &lt;strong&gt;zero accounts, zero ads, zero tracking, and zero cloud API keys&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5i0ptbkrxihupsouf6d0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5i0ptbkrxihupsouf6d0.png" alt=" " width="800" height="424"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    subgraph DayPlay ["☀️ Daytime: Play &amp;amp; Care (Talking Tom Mode)"]
        A["🛁 Bubble Bath&amp;lt;br/&amp;gt;(Soap, rinse, ducky squeaks)"]
        B["🍓 Snack Bar&amp;lt;br/&amp;gt;(Feed berries, cookies, honey)"]
        C["🎮 Mini-Games Arcade&amp;lt;br/&amp;gt;(Bubble Pop, Memory Match, Catcher)"]
        D["🎤 Talking Mimic&amp;lt;br/&amp;gt;(Silly soundboard &amp;amp; pitch-shift)"]
    end

    subgraph BedtimeRoutine ["🌙 Bedtime: The 'Slow and Steady' Steep"]
        E["🍵 Mix Tea: Pick a Leaf &amp;amp; Sweet Treat"]
        F["🔮 TabPFN Alchemist Crystal Ball&amp;lt;br/&amp;gt;(Live Bayesian Rarity &amp;amp; Sensory Odds)"]
        G["😴 Choose Nap Length: 10s Demo, 2m, 1h, 4h, or Sleepover"]
        H["🛏️ Tuck Sunny In!"]
    end

    subgraph LockoutState ["💤 Night Lockout (Enforced Sleep)"]
        I["🔒 Screen Time Ends: Care &amp;amp; Games Locked"]
        J["🎶 Procedural Lofi Soundscape&amp;lt;br/&amp;gt;(Rain, Breeze, Twilight Chimes)"]
        K["⏳ Real-time Async Steep: Forest Animals Visit"]
        L["💤 Sunny Mumbles Sleepy Yawns If Tapped"]
    end

    subgraph MorningReward ["🎁 Morning: The Surprise"]
        M["✨ Sunny Wakes Up Ready!"]
        N["📜 Kind Note Written by Open-Weight Gemma"]
        O["📊 TabPFN Feature Attribution Card (XAI)&amp;lt;br/&amp;gt;(Attribution breakdown &amp;amp; Sensory profile)"]
        P["📖 Collectible Sticker Book"]
    end

    DayPlay --&amp;gt; BedtimeRoutine
    BedtimeRoutine --&amp;gt; LockoutState
    LockoutState --&amp;gt; MorningReward
    MorningReward --&amp;gt; DayPlay&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwu44zceh9jhdabcyq3ww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwu44zceh9jhdabcyq3ww.png" alt=" " width="799" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Interactive 3D Virtual Pet Care (Awake Mode)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🛁 Bubble Bath Mode&lt;/strong&gt;: Lather Sunny with foamy soap bubbles, rinse with a warm shower spray, squeak the floating rubber ducky, and blow pop-able bubbles. Reaching 100% cleanliness awards +50 care XP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🍓 Snack Bar&lt;/strong&gt;: Feed Sunny sweet strawberries, moon honey, cookies, and fruit slices with animated chewing sounds and happy reactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🎮 3 Sensory Mini-Games&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Bubble Pop Bash&lt;/em&gt;: 30-second reflex game popping floating tea bubbles &amp;amp; golden stars.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Forest Friends Match&lt;/em&gt;: A 12-card cognitive memory matching game with tactile card flips.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Leaf &amp;amp; Berry Catcher&lt;/em&gt;: Catch falling ingredients in Sunny's basket with kid-friendly controls.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🎤 Talking Sloth Mimic&lt;/strong&gt;: Squeaky high-pitch voice mimic and a silly soundboard (animal jokes, sloth giggles, sneezing).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fegr4vyrm1cfgp45v3ji1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fegr4vyrm1cfgp45v3ji1.png" alt=" " width="799" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F927l70zf5n3489tmiod8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F927l70zf5n3489tmiod8.png" alt=" " width="799" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F31r5ns763q773lm2ksso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F31r5ns763q773lm2ksso.png" alt=" " width="799" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft9agtanahlj0jre8auz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft9agtanahlj0jre8auz8.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The "Slow and Steady" Bedtime Lockout&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once tea steeping begins, &lt;strong&gt;all distractions are strictly locked out&lt;/strong&gt;. The activity bar is replaced by a peaceful sleep notice. The game renders a tranquil night sky with fireflies, glowing starlight particles, and soft breathing animations. Tapping Sunny only produces gentle sleepy yawns.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;🔮 TabPFN Alchemist's Crystal Ball (Live Bayesian Simulator)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instead of static drop rates, a live crystal ball calculates Bayesian posterior probabilities in real time for &lt;code&gt;🍃 Common&lt;/code&gt;, &lt;code&gt;✨ Rare&lt;/code&gt;, and &lt;code&gt;⭐ Legendary&lt;/code&gt; tea as kids select their ingredients.&lt;/li&gt;
&lt;li&gt;Includes Shannon Entropy (&lt;em&gt;"Mystery Index"&lt;/em&gt;): wild, untested blends trigger Sunny's &lt;em&gt;"Enigma Blend!"&lt;/em&gt; forecast.&lt;/li&gt;
&lt;li&gt;Features an interactive &lt;strong&gt;"What-If Bedtime Simulator"&lt;/strong&gt; showing kids how getting a full night's sleep directly raises the mathematical odds of unlocking Legendary starlight tea.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;🍵 Multi-Task Sensory Vector &amp;amp; Deep Sleepiness Regression&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TabPFN continuous regression predicts a 5-dimensional sensory flavor profile (&lt;em&gt;Sweetness&lt;/em&gt;, &lt;em&gt;Earthiness&lt;/em&gt;, &lt;em&gt;Starlight Glow&lt;/em&gt;, &lt;em&gt;Floral Harmony&lt;/em&gt;, &lt;em&gt;Warmth&lt;/em&gt;) and a &lt;em&gt;Deep Sleepiness Score&lt;/em&gt; ($0–100\%$).&lt;/li&gt;
&lt;li&gt;The Three.js 3D viewport dynamically responds: when Starlight Glow exceeds $60\%$, the scene ignites with 75 radiant golden celestial sparkles!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;📊 Explainable AI (XAI) Feature Attribution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When waking up to claim morning tea, a transparent attribution card explains &lt;em&gt;why&lt;/em&gt; the tea turned out magical:

&lt;ul&gt;
&lt;li&gt;🌙 &lt;strong&gt;Bedtime Consistency Streak&lt;/strong&gt; (&lt;code&gt;+35%&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;⏳ &lt;strong&gt;Deep Sleep Duration&lt;/strong&gt; (&lt;code&gt;+30%&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;🌸 &lt;strong&gt;Herbal Ingredient Synergy&lt;/strong&gt; (&lt;code&gt;+20%&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;🛁 &lt;strong&gt;Pet Care &amp;amp; Bedtime Routine&lt;/strong&gt; (&lt;code&gt;+15%&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Positively reinforces healthy sleep habits through mathematical transparency.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;🎶 Zero-Asset Procedural Generative Soundscape&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web Audio API synthesizer generating real-time lofi sleep soundscapes without downloading any audio files:

&lt;ul&gt;
&lt;li&gt;🌧️ &lt;em&gt;Gentle Rain&lt;/em&gt;: Kellet pink noise through dual resonant lowpass filters.&lt;/li&gt;
&lt;li&gt;🍃 &lt;em&gt;Forest Breeze&lt;/em&gt;: 0.12 Hz LFO breathing-rate filter sweeps.&lt;/li&gt;
&lt;li&gt;🎶 &lt;em&gt;Twilight Chimes&lt;/em&gt;: Warm lofi chord drone (F3, C4, E4) with randomized pentatonic bell frequencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  📺 Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Web App&lt;/strong&gt;: &lt;a href="https://the-midnight-steeper.onrender.com/" rel="noopener noreferrer"&gt;https://the-midnight-steeper.onrender.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;⚡ Fast-Forward Judge Demo Mode&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;In Step 3 (Nap length), select &lt;strong&gt;⚡ Judge Demo (10 seconds)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Or click the &lt;strong&gt;⚡ Fast-Forward Steep&lt;/strong&gt; button while Sunny sleeps to instantly evaluate the morning wake-up, animal friend visits, and AI prize loot in seconds!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Visual UI Tour:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffdtt7traszghhcc1zfhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffdtt7traszghhcc1zfhm.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz70tlsjvhuql9mo2zvmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz70tlsjvhuql9mo2zvmy.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 Code
&lt;/h2&gt;

&lt;p&gt;GitHub Repository:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/akshara-a" rel="noopener noreferrer"&gt;
        akshara-a
      &lt;/a&gt; / &lt;a href="https://github.com/akshara-a/The-Midnight-Steeper" rel="noopener noreferrer"&gt;
        The-Midnight-Steeper
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🍵 The Midnight Steeper (Online Edition)&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A cozy 3D bedtime tea party for kids aged 5-10, built for the "Slow and Steady" theme. Sunny the sloth is a talking, tappable 3D pet. Kids pick a leaf and a treat, tuck Sunny in for a nap, and Sunny tells them to go to sleep too. The tea steeps in real time while forest-animal friends visit, and in the morning there is a surprise sticker with a kind note from a friend.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why it's a good bedtime game:&lt;/strong&gt; it ends play instead of extending it. There are no ads, no accounts, no chat and no microphone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Open-source and free to run:&lt;/strong&gt; Gemma (open-weight) writes the notes, either in the browser (transformers.js, opt-in, ~320 MB once) or through Ollama. TabPFN predicts prize rarity. Sunny's voice is the browser's built-in speech. No API keys anywhere.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🌐 Online Architecture (Zero Logins • Pure Local Session)&lt;/h2&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/akshara-a/The-Midnight-Steeper" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The stack is 100% open-source and free to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Framework&lt;/strong&gt;: Next.js 16 (Turbopack, App Router), React 19, Tailwind CSS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3D Graphics &amp;amp; Shaders&lt;/strong&gt;: Three.js, &lt;code&gt;@react-three/fiber&lt;/code&gt;, &lt;code&gt;@react-three/drei&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tabular Intelligence&lt;/strong&gt;: &lt;strong&gt;TabPFN&lt;/strong&gt; (Bayesian in-context multi-task classifier &amp;amp; regressor)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Procedural Audio&lt;/strong&gt;: Web Audio API Sound Synthesizer (0 external audio files)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Language Model&lt;/strong&gt;: &lt;code&gt;@huggingface/transformers&lt;/code&gt; (In-Browser Gemma 2B) &amp;amp; local Ollama&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend &amp;amp; Timers&lt;/strong&gt;: FastAPI, SQLite (embedded local-session persistence), Temporal&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 How I Built It
&lt;/h2&gt;

&lt;p&gt;The game's architecture is engineered around asynchronous patience and local inference:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;graph LR
    subgraph Client ["Client Browser (Zero Trackers / COPPA Compliant)"]
        UI["Next.js + React Three Fiber 3D"]
        Audio["Web Audio Synthesizer&amp;lt;br/&amp;gt;(Lofi Rain, Chimes, Pops)"]
        CrystalBall["TabPFN Crystal Ball&amp;lt;br/&amp;gt;(Live In-Context Odds)"]
        LocalAI["Transformers.js&amp;lt;br/&amp;gt;(In-Browser Gemma 2B)"]
    end

    subgraph Backend ["Self-Hosted Cloud / Local VPS"]
        API["FastAPI Orchestrator"]
        DB[(Embedded SQLite&amp;lt;br/&amp;gt;Session UUIDs)]
        TabPFN["TabPFN Multi-Task AI&amp;lt;br/&amp;gt;(CPU Rarity &amp;amp; Flavor Regression)"]
        Timer["Temporal / Cloud&amp;lt;br/&amp;gt;Async Scheduler"]
    end

    UI &amp;lt;--&amp;gt;|Local Web Audio| Audio
    UI &amp;lt;--&amp;gt;|Live Bayesian Odds| CrystalBall
    UI &amp;lt;--&amp;gt;|Optional Offline Notes| LocalAI
    UI &amp;lt;--&amp;gt;|Fetch Brew State| API
    API &amp;lt;--&amp;gt; DB
    API &amp;lt;--&amp;gt; TabPFN
    API &amp;lt;--&amp;gt; Timer&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  1. Tabular Foundation Model (TabPFN) Multi-Task Pipeline
&lt;/h3&gt;

&lt;p&gt;Rather than simple hardcoded dice rolls, tea quality and harvest rarity are evaluated using &lt;strong&gt;TabPFN&lt;/strong&gt; — Prior Labs' groundbreaking tabular foundation model running lightweight on CPU. We upgraded TabPFN into a multi-task tabular intelligence engine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Context Few-Shot Learning&lt;/strong&gt;: TabPFN operates as an instant Bayesian transformer over tabular datasets without iterative training loops. We feed it a prior table of simulated brews combined with the player's personal historical steeps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Multi-Task Flavor Regression&lt;/strong&gt;: Predicts 5 continuous flavor dimensions (&lt;em&gt;Sweetness&lt;/em&gt;, &lt;em&gt;Earthiness&lt;/em&gt;, &lt;em&gt;Starlight Glow&lt;/em&gt;, &lt;em&gt;Floral Harmony&lt;/em&gt;, &lt;em&gt;Warmth&lt;/em&gt;) and a &lt;em&gt;Deep Sleepiness Score&lt;/em&gt; ($0–100\%$) that directly controls the 3D lighting, steam hue, and golden celestial particles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explainable AI (XAI)&lt;/strong&gt;: We calculate marginal feature attributions by comparing counterfactual baselines, revealing exactly how much the child's bedtime consistency streak contributed to their prize.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. In-Browser Open-Weight Gemma (Transformers.js)
&lt;/h3&gt;

&lt;p&gt;When an animal friend attends the midnight tea party, they leave behind a unique note. Instead of paying an opaque cloud API or sending children's data over the wire, we run &lt;strong&gt;Gemma&lt;/strong&gt; client-side in the browser via &lt;code&gt;@huggingface/transformers&lt;/code&gt; (or self-hosted via local Ollama). It runs completely offline after the initial cache!&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Zero-Asset Procedural Audio Synthesizer (Web Audio API)
&lt;/h3&gt;

&lt;p&gt;To prevent bloat and maintain instant loading on slow mobile networks, every sound effect — bathtub water sloshes, rubber duck squeaks, chewing crunches, bubble pops, and the generative bedtime soundscape (rain, wind, chimes) — is synthesized on the fly with oscillator nodes, Kellet pink noise filters, and frequency envelopes.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Resilient Asynchronous Timers (Temporal)
&lt;/h3&gt;

&lt;p&gt;Steeping tea for 4 or 12 hours requires resilient workflow state. The backend uses distributed async workflow timers that persist across container reboots and disconnects, gracefully waking Sunny up exactly on schedule.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌍 Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Open innovation is what makes &lt;strong&gt;The Midnight Steeper&lt;/strong&gt; safe and accessible for kids:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;COPPA / Child Privacy By Design&lt;/strong&gt;: Children's digital toys should never require accounts, logins, or telemetry. Because open-weight models (Gemma) and local foundation models (TabPFN) can run on-device or on self-hosted containers, &lt;strong&gt;zero personal data ever leaves the user's browser&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infinite Longevity Without Subscription Taxes&lt;/strong&gt;: Closed-source AI APIs change pricing, deprecate endpoints, or shut down entirely. Open-source models ensure this game remains free and playable forever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calm Computing&lt;/strong&gt;: Commercial app stores incentivize dopamine traps to drive ad revenue. Open innovation allows developers to create software that respects user well-being and knows when to tell them: &lt;em&gt;"That's enough for today. Go to sleep."&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🦥 The Lazy Payoff
&lt;/h2&gt;

&lt;p&gt;By turning bedtime into an effortless ritual where the virtual pet and the child sleep together, parents save &lt;strong&gt;30–45 minutes of bedtime stalling and screen-time tantrums every single night&lt;/strong&gt;. Kids are excited to put the phone down because &lt;strong&gt;the only way to brew magical tea for their forest friends is to let Sunny sleep in peace&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏆 Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hacktoberfest Open-Source AI Challenge&lt;/strong&gt;: Week 3 — &lt;em&gt;Slow and Steady&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Open-Source Foundation Models&lt;/strong&gt;: TabPFN (Prior Labs) &amp;amp; Gemma (Google)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calm &amp;amp; Humane Tech&lt;/strong&gt;: Privacy-first, zero-auth, zero-tracking bedtime technology for families&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>ARGUS PRISM: The Hundred-Eyed Fact-Checker That Audits AI, Refutes Hallucinations, and Gets Paid for It</title>
      <dc:creator>Akshara A</dc:creator>
      <pubDate>Sun, 18 Oct 2026 18:29:13 +0000</pubDate>
      <link>https://dev.to/aks_a/argus-prism-the-hundred-eyed-fact-checker-that-audits-ai-refutes-hallucinations-and-gets-paid-2ajj</link>
      <guid>https://dev.to/aks_a/argus-prism-the-hundred-eyed-fact-checker-that-audits-ai-refutes-hallucinations-and-gets-paid-2ajj</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ARGUS PRISM checks technical claims in a draft or an AI-generated answer against current, authoritative sources. It scores each claim with deterministic math, corrects what is wrong, and produces a verification report that a freelancer can sell as a service.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Resource&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Live demo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://argus-prism-studio.onrender.com/" rel="noopener noreferrer"&gt;argus-prism-studio.onrender.com&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/akshara-a/ARGUS-PRISM" rel="noopener noreferrer"&gt;github.com/akshara-a/ARGUS-PRISM&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Partner categories&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Render, Gemma, Backboard, ElevenLabs, Sentry Agent Tracing, SerpApi&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Problem in One Example
&lt;/h2&gt;

&lt;p&gt;A team is finalising a migration RFC. The draft says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Next.js 15 continues to support React 18 in production, and LegacyAPI v1 is recommended for high-load clusters."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They ask an AI assistant to confirm it, and it answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Yes, absolutely! LegacyAPI v1 is a battle-tested, rock-solid solution. You can safely deploy this to production."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer is wrong. The assistant relied on older blog posts that still rank well. The official 2026 changelog says &lt;code&gt;LegacyAPI v1&lt;/code&gt; was removed, so the deployment would fail at runtime.&lt;/p&gt;

&lt;p&gt;This example comes from the project's agent walkthrough (&lt;code&gt;docs/AGENT_WALKTHROUGH.md&lt;/code&gt;). The library names are fictional test fixtures.&lt;/p&gt;

&lt;p&gt;The assistant was not malicious. It sounded confident without checking how current or authoritative its sources were. ARGUS PRISM adds that check.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;ARGUS PRISM is a fact-verification engine for technical writing and AI answers. It decides with deterministic math (source tiers, time decay, contradiction detection, and Bayesian scoring), and when sources disagree it searches for the primary source to settle the dispute.&lt;/p&gt;

&lt;p&gt;For open-source AI it uses Gemma 2 locally through Ollama, Llama 3 and Mistral 7B through Backboard, and a TabPFN-style uncertainty model, so no closed API is required. It follows a zero-persistence design: drafts are never written to disk, a database, or logs.&lt;/p&gt;

&lt;p&gt;Ghostwriters, docs agencies, DevRel teams, and migration reviewers can use it commercially, and agents can call its 15 MCP tools to verify before they answer. You can try the &lt;a href="https://argus-prism-studio.onrender.com/" rel="noopener noreferrer"&gt;live Studio&lt;/a&gt; or run &lt;code&gt;uv run python backend/demo.py&lt;/code&gt; locally with no API keys. All 7 benchmarks and 82 unit tests pass.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Handles the Example
&lt;/h2&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    S["Claim:&amp;lt;br/&amp;gt;LegacyAPI v1 is recommended&amp;lt;br/&amp;gt;for high-load clusters"] --&amp;gt; A["ARGUS PRISM"]
    A --&amp;gt; P1["2022 blog (Tier 3, x0.5)&amp;lt;br/&amp;gt;decayed by e^(-λt)"]
    A --&amp;gt; P2["2026 official changelog (Tier 1, x1.5)&amp;lt;br/&amp;gt;current"]
    P1 &amp;amp; P2 --&amp;gt; X{"Contradiction"}
    X --&amp;gt; T["Tie-breaker search&amp;lt;br/&amp;gt;against primary sources"]
    T --&amp;gt; R["REFUTED"]
    R --&amp;gt; F["Corrected sentence&amp;lt;br/&amp;gt;with citation and diff"]
    R --&amp;gt; D["Dependent claims&amp;lt;br/&amp;gt;downgraded"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The output includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a score with &lt;code&gt;±σ%&lt;/code&gt; uncertainty bounds&lt;/li&gt;
&lt;li&gt;a claim-by-claim ledger with citations&lt;/li&gt;
&lt;li&gt;a red and green diff of the corrections&lt;/li&gt;
&lt;li&gt;a client-ready certificate&lt;/li&gt;
&lt;li&gt;a 60-second spoken briefing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is produced in memory and none of it is stored.&lt;/p&gt;




&lt;h2&gt;
  
  
  How the Pieces Fit Together
&lt;/h2&gt;

&lt;p&gt;ARGUS PRISM is a single pipeline. Each open-source or partner component has one job.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    IN["Draft or live URL"] --&amp;gt; EX["Extract claims&amp;lt;br/&amp;gt;Gemma 2 local / regex"]
    EX --&amp;gt; SR["Gather evidence&amp;lt;br/&amp;gt;SerpApi: Web, Scholar, News&amp;lt;br/&amp;gt;or DuckDuckGo"]
    SR --&amp;gt; MATH["Deterministic scoring&amp;lt;br/&amp;gt;tiers x decay x Bayes"]
    EX --&amp;gt; BB["Cross-check&amp;lt;br/&amp;gt;Backboard: Llama 3, Mistral, Gemma 2"]
    BB --&amp;gt; MATH
    MATH --&amp;gt; OUT["Verdict, diff, certificate"]
    OUT --&amp;gt; EL["Spoken debrief&amp;lt;br/&amp;gt;ElevenLabs"]
    MATH -. spans and latency .-&amp;gt; SEN["Sentry agent tracing"]
    OUT --&amp;gt; RND["Hosted on Render&amp;lt;br/&amp;gt;API, Web Studio, Dashboard"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Gemma 2, run through Ollama, extracts claims locally so private drafts stay on the machine. SerpApi (or DuckDuckGo) returns Google Web, Scholar, and News results for the evidence pool. Backboard reaches Llama 3, Mistral, and Gemma 2 with one key to produce an agreement ratio.&lt;/p&gt;

&lt;p&gt;The deterministic kernel then applies source tiers, freshness decay, contradiction detection, and a Bayesian update. ElevenLabs turns the result into a 60-second spoken debrief in one of three voices. Sentry records a span for each pipeline stage with latency and cost visibility, and Render hosts the API, the Web Studio, and the dashboard from one blueprint.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. What I Built
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1.1 The problem
&lt;/h2&gt;

&lt;p&gt;LLMs write fluent text that is often wrong. They state outdated facts, such as an API removed last quarter, with total confidence. Single-pass RAG makes this worse. It retrieves the top-ranked pages, and those are often SEO-heavy 2022 tutorials that contradict the current changelog.&lt;/p&gt;

&lt;p&gt;This hurts people who get paid for correctness.&lt;/p&gt;

&lt;p&gt;Technical ghostwriters and freelance writers risk their credibility, and sometimes the contract, over a single wrong version number. DevRel and docs agencies ship tutorials that must not break on copy-paste. Due-diligence reviewers and consultants sign off on migration RFCs. AI agent builders need a trustworthy verify-before-you-answer tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.2 The solution
&lt;/h2&gt;

&lt;p&gt;ARGUS PRISM treats search engines as telemetry streams. It does not ask an LLM whether a claim "seems right." It computes a verdict with explicit, reproducible math.&lt;/p&gt;

&lt;p&gt;Official registries and docs count 1.5x, community hubs 1.0x, and SEO blogs 0.5x. Evidence ages as &lt;code&gt;e^(-λt)&lt;/code&gt;, with λ inferred from how fast the domain moves. Opposing claims on the same entity are flagged as contradictions, and a high-severity conflict triggers a tie-breaker search against primary sources.&lt;/p&gt;

&lt;p&gt;An evidence graph downgrades any claim that depends on a refuted one. A Bayesian uncertainty model (TabPFN-style) gives every score calibrated &lt;code&gt;±σ%&lt;/code&gt; bounds. The auto-fixer rewrites refuted claims with primary citations and shows the change as a git-style diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.3 The Side-Hustle Business Model
&lt;/h2&gt;

&lt;p&gt;ARGUS PRISM is built so one person can run a paid verification service. A freelancer runs a client's draft through the engine, reviews the result, and delivers a branded &lt;strong&gt;Verification Certificate&lt;/strong&gt;, a &lt;strong&gt;corrected draft&lt;/strong&gt;, and optional extras. The tool does the slow research. The freelancer supplies judgment and the client relationship.&lt;/p&gt;

&lt;h3&gt;
  
  
  The service in one line
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"I fact-check your technical content against current primary sources, fix what is wrong, and hand you a certificate you can show your readers or your client."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzjuaqhxjlkianetnuv0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzjuaqhxjlkianetnuv0d.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The workflow
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    Client["Client sends draft&amp;lt;br/&amp;gt;or a live docs URL"] --&amp;gt; Run["Freelancer runs&amp;lt;br/&amp;gt;argus validate --file draft.txt&amp;lt;br/&amp;gt;--client 'Client Name'"]
    Run --&amp;gt; Score["Integrity score ±σ%&amp;lt;br/&amp;gt;claim ledger + citations"]
    Score --&amp;gt; Review["Freelancer reviews&amp;lt;br/&amp;gt;contested claims"]
    Review --&amp;gt; Fix["Auto-fix: refuted claims&amp;lt;br/&amp;gt;replaced with primary sources"]
    Fix --&amp;gt; Pack["Package deliverables"]
    Pack --&amp;gt; Invoice["Invoice:&amp;lt;br/&amp;gt;Fact-Check and Verification Audit"]
    Invoice --&amp;gt; Repeat["Retainer or per-article repeat work"]&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  What the client receives
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Client Verification Certificate&lt;/strong&gt; is a branded, print-ready HTML report with the integrity score, the claim ledger, and the time-saved figure. It is proof the content was audited and a visible line item on the invoice. The &lt;strong&gt;corrected draft&lt;/strong&gt; replaces refuted claims with grounded text and primary citations, shown as a red and green diff, so the client can apply the fixes without redoing the research.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;evidence dossier&lt;/strong&gt; adds a summary for each contradiction, the full claim ledger, and the formulas used, which gives editors and compliance teams an audit trail. The &lt;strong&gt;verification badge&lt;/strong&gt; is an embeddable SVG for READMEs, Notion pages, and newsletters. The &lt;strong&gt;academic export&lt;/strong&gt; produces Markdown with numbered footnotes and an IEEE or APA bibliography for Substack, Medium, Ghost, or Obsidian. The &lt;strong&gt;spoken debrief&lt;/strong&gt; is a 60-second audio summary in one of three voices for busy executives and sponsors.&lt;/p&gt;

&lt;h3&gt;
  
  
  The economics
&lt;/h3&gt;

&lt;p&gt;The CLI estimates the manual work it replaces, so the value shows up on every report. The heuristic in the code is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;estimated_hours = max(0.5, claims × 0.35 + (words ÷ 1000) × 0.5)
billable_value  = estimated_hours × hourly_rate        (default $50/hr)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;A short blog post with 6 claims and 600 words comes out at about 2.4 hours, or $120 at $50 an hour. A technical tutorial with 12 claims and 1,500 words comes out at 4.9 hours, or $245. A long guide or RFC with 25 claims and 3,000 words comes out at 10.2 hours, or $510.&lt;/p&gt;

&lt;p&gt;These figures come from the report's built-in heuristic, which assumes roughly 20 to 25 minutes of research per factual claim. They are estimates to anchor a conversation, not measured results or market rates. The hourly rate is configurable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why the margins work:&lt;/strong&gt; the open-source stack keeps the cost of goods close to zero. Local Gemma 2 and DuckDuckGo search are free, the Cost-Guard cache avoids paying twice for the same query, and the offline engine needs no keys. The one metered input is optional live SerpApi search, which the cache is designed to minimise.&lt;/p&gt;
&lt;h3&gt;
  
  
  Pricing ladder
&lt;/h3&gt;

&lt;p&gt;This is an illustrative starting structure, to be validated with real clients.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;per-article audit&lt;/strong&gt; (certificate and corrected draft) suits a single post, tutorial, or docs page. A &lt;strong&gt;monthly retainer&lt;/strong&gt; (a fixed number of audits, dossiers, and badges) suits agencies, newsletters, and DevRel teams with regular output. A &lt;strong&gt;migration RFC review&lt;/strong&gt; (dossier, head-to-head stack comparison, and audio debrief) suits engineering managers signing off on an upgrade. The &lt;strong&gt;self-hosted MCP and API&lt;/strong&gt; option gives teams the open-source engine to build "verify before you answer" into their own agents.&lt;/p&gt;
&lt;h3&gt;
  
  
  Who buys, and what they are really buying
&lt;/h3&gt;

&lt;p&gt;Freelance writers and ghostwriters pay for a documented fact-check on every delivery, because one outdated version number damages credibility. DevRel and docs agencies pay for verification before publication, since tutorials that fail on copy-paste cost trust. Engineering managers and consultants pay for a second opinion backed by current changelogs, because a migration RFC built on stale advice can cause outages. AI agent builders pay for a tool their agent can call before it responds, since agents otherwise answer confidently from stale sources.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why this beats the alternatives
&lt;/h3&gt;

&lt;p&gt;Manual fact-checking is slow, inconsistent, and hard to document. ARGUS PRISM takes minutes per draft and gives a reproducible score with citations. Asking another LLM to double-check relies on the same stale training data and the same confident tone, whereas ARGUS PRISM uses evidence tiering, time decay, and a tie-breaker against primary sources. Plagiarism and grammar tools check wording, not whether the claims are true.&lt;/p&gt;
&lt;h3&gt;
  
  
  Trust and privacy as selling points
&lt;/h3&gt;

&lt;p&gt;Clients often share unpublished drafts under NDA. Because the engine can run fully locally with zero persistence, the freelancer can promise that the draft is never stored or sent to a third-party model. That is a concrete reason to choose this service over a hosted one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsui2tulds2pb9ygl98ar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsui2tulds2pb9ygl98ar.png" alt=" " width="799" height="427"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1.4 Feature map
&lt;/h2&gt;

&lt;p&gt;ARGUS PRISM is organised into five layers. Each layer feeds the next.&lt;br&gt;
&lt;/p&gt;
&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    A["Verification Core&amp;lt;br/&amp;gt;Decides what is true"] --&amp;gt; B["Open-Weight AI&amp;lt;br/&amp;gt;Extracts and cross-checks"]
    B --&amp;gt; C["Deliverables&amp;lt;br/&amp;gt;What clients receive"]
    C --&amp;gt; D["Interfaces&amp;lt;br/&amp;gt;How people and agents connect"]
    D --&amp;gt; E["Operations&amp;lt;br/&amp;gt;Keeps it fast, safe, and observable"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;strong&gt;Verification Core.&lt;/strong&gt; A six-state machine enforces one deterministic path from planning to report. Credibility tiering weights sources, freshness decay ages evidence, and a contradiction detector flags opposing claims. A tie-breaker loop resolves conflicts against primary sources, an evidence graph downgrades dependent claims, and a Bayesian posterior updates confidence from corroboration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open-Weight AI.&lt;/strong&gt; Gemma 2 through Ollama handles local, private claim extraction. Backboard provides a tri-model check across Llama 3 8B, Mistral 7B, and Gemma 2 9B. A TabPFN-style oracle returns class probabilities and &lt;code&gt;±σ%&lt;/code&gt; bounds, and a regex fallback works with no model at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deliverables.&lt;/strong&gt; Clients receive a certificate, an evidence dossier, an embeddable badge, an academic export with IEEE or APA references, a 60-second spoken debrief, and a git-style auto-fix diff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interfaces.&lt;/strong&gt; The engine is available as an MCP server (15 tools, 4 resources, 3 prompts), a REST API with 12 endpoints, a Next.js 16 Web Studio, a Streamlit dashboard, and a CLI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operations.&lt;/strong&gt; The Cost-Guard cache combines an in-memory LRU with SQLite, Sentry provides tracing, and the zero-persistence design stores no draft. Security hardening covers SSRF, XSS, and CSP, and delivery uses Docker, Render, and GitHub Actions.&lt;/p&gt;


&lt;h1&gt;
  
  
  2. Demo
&lt;/h1&gt;
&lt;h2&gt;
  
  
  2.1 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live app (Web Studio):&lt;/strong&gt; &lt;a href="https://argus-prism-studio.onrender.com/" rel="noopener noreferrer"&gt;argus-prism-studio.onrender.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API health check:&lt;/strong&gt; &lt;a href="https://argus-prism-api.onrender.com/api/health" rel="noopener noreferrer"&gt;argus-prism-api.onrender.com/api/health&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telemetry dashboard (Streamlit):&lt;/strong&gt; &lt;a href="https://argus-prism-dashboard.onrender.com/" rel="noopener noreferrer"&gt;argus-prism-dashboard.onrender.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source code:&lt;/strong&gt; &lt;a href="https://github.com/akshara-a/ARGUS-PRISM" rel="noopener noreferrer"&gt;github.com/akshara-a/ARGUS-PRISM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Try the Studio in under a minute:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://argus-prism-studio.onrender.com/" rel="noopener noreferrer"&gt;Studio&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click one of the six enterprise presets: &lt;code&gt;FastAPI Concurrency&lt;/code&gt;, &lt;code&gt;Kafka KRaft Consensus&lt;/code&gt;, &lt;code&gt;PyTorch 2.5 Inductor&lt;/code&gt;, &lt;code&gt;OAuth 2.1 Security&lt;/code&gt;, &lt;code&gt;LegacyAPI v1 Stale Spec&lt;/code&gt;, or the &lt;code&gt;QuantumReactJS Trap&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a provider (DuckDuckGo, SerpApi, or the offline Mock Engine), a search engine (Web, Scholar, or News), and an extractor (regex, Gemma 2, or tri-model).&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Run Deterministic Factual Audit&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;The free-tier host sleeps when idle, so the first request can take a short while to wake. The Studio also has a Mock Engine for deterministic offline runs, and the presets are meant to show the range from verified to hallucinated.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  2.2 Five-second quickstart
&lt;/h2&gt;

&lt;p&gt;No API keys needed. The offline path uses the mock provider and the regex extractor.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/akshara-a/ARGUS-PRISM
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"ARGUS-PRISM"&lt;/span&gt;
uv venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; uv pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
uv run python backend/demo.py     &lt;span class="c"&gt;# hallucination trap, contradiction catch,&lt;/span&gt;
                                  &lt;span class="c"&gt;# cost-guard economics, comparison, HTML dossier&lt;/span&gt;
uv run python backend/evaluate.py &lt;span class="c"&gt;# 7/7 benchmark checks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  2.3 Demo storyline
&lt;/h2&gt;


&lt;pre data-lang="mermaid"&gt;&lt;code&gt;sequenceDiagram
    autonumber
    actor W as Freelance writer
    participant UI as Web Studio (Next.js)
    participant API as FastAPI
    participant ENG as ARGUS Engine
    participant WEB as Search provider
    participant AI as Open models

    W-&amp;gt;&amp;gt;UI: Paste draft or a live docs URL
    UI-&amp;gt;&amp;gt;API: POST /api/validate
    API-&amp;gt;&amp;gt;ENG: run 6-state pipeline
    ENG-&amp;gt;&amp;gt;WEB: optimistic, skeptical, temporal queries
    WEB--&amp;gt;&amp;gt;ENG: raw documents (cached by Cost-Guard)
    ENG-&amp;gt;&amp;gt;AI: extract claims, triangulate models, uncertainty
    ENG-&amp;gt;&amp;gt;ENG: tier, decay, detect conflict, tie-break
    ENG--&amp;gt;&amp;gt;API: score ±σ%, claim ledger, DAG
    API--&amp;gt;&amp;gt;UI: report + audio (base64, in-RAM)
    UI--&amp;gt;&amp;gt;W: gauge, claim cards, red/green diff
    W-&amp;gt;&amp;gt;UI: Apply Fixes, then Download Certificate&lt;/code&gt;&lt;/pre&gt;


&lt;h2&gt;
  
  
  2.4 What you will see
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;hallucination trap&lt;/strong&gt; feeds in a made-up library (&lt;code&gt;QuantumReactJS&lt;/code&gt;), which scores 0.0% with an empty claim ledger. The &lt;strong&gt;contradiction catch&lt;/strong&gt; shows a stale 2022 tutorial saying &lt;code&gt;LegacyAPI v1&lt;/code&gt; is fine while a 2026 changelog says it was removed. ARGUS decays the tutorial, runs a tie-breaker query, elevates the changelog, and marks the old claim &lt;code&gt;REFUTED&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;auto-fix diff&lt;/strong&gt; shows the false claim in red and the grounded replacement in green, and one click applies it to the editor. The &lt;strong&gt;certificate modal&lt;/strong&gt; previews the HTML report in a sandboxed iframe, ready to download. The &lt;strong&gt;voice persona switch&lt;/strong&gt; lets Rachel, Adam, or Drew read the 60-second debrief.&lt;/p&gt;


&lt;h1&gt;
  
  
  3. Code
&lt;/h1&gt;
&lt;h2&gt;
  
  
  3.1 Repository
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/akshara-a" rel="noopener noreferrer"&gt;
        akshara-a
      &lt;/a&gt; / &lt;a href="https://github.com/akshara-a/ARGUS-PRISM" rel="noopener noreferrer"&gt;
        ARGUS-PRISM
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;ARGUS PRISM&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Deterministic Evidence Intelligence Layer via Model Context Protocol (MCP)&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Autonomous Hallucination Elimination &amp;amp; Deterministic Evidence Intelligence Engine&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/backend/evaluate.py" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8ce26df87829c728362138cde27195157c06bc61882f4700ae8a8295de1ff2d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f42656e63686d61726b732d37253246372532305061737365642d627269676874677265656e" alt="CI Benchmark"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/tests/" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8ff453514ab27bbfb1b2b582b1ce5e7933ad802c2e9d2ad90ef7da74cec7fc46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d383225324638322532305061737365642d627269676874677265656e" alt="Unit Tests"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/frontend/" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/992426f3c1b3c871fbb162266520b7af6e08abbff68255100be8ce0f79e4f242/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6578742e6a732d31362e345f547572626f7061636b2d626c61636b3f6c6f676f3d6e6578742e6a73" alt="Next.js 16"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/.github/workflows/ci.yml" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/831460d6a8b6d772782d126235d3da26639579639ff55452d6ff7df12e91eed8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f43492d50617373696e672d627269676874677265656e" alt="CI Workflow"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/Dockerfile" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f468ac0ac3e1178f5de2ece206ede2fcda4481cf62a55336348aaba081dd24a8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f636b65722d52656164792d626c7565" alt="Docker"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/backend/pyproject.toml" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/529b82499ec2b75737f6c01df7783ce079e22caf422552c2f7e90cdfae89c095/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f507974686f6e2d332e3131253230253743253230332e3132253230253743253230332e31332d626c7565" alt="Python"&gt;&lt;/a&gt;
&lt;a href="https://modelcontextprotocol.io" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/0dbd8bc3a019f55ea5b6956cead709da222076d557e217f6f63ce70c8b2fe2ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d43502d31355f546f6f6c735f436f6d706c69616e742d707572706c65" alt="MCP"&gt;&lt;/a&gt;
&lt;a href="https://github.com/akshara-a/ARGUS-PRISM/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e" alt="License"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎯 Executive Summary&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Modern AI agents suffer from an over-reliance on single-pass retrieval, leading to hallucination disguised as confidence. &lt;strong&gt;ARGUS PRISM&lt;/strong&gt; solves this by treating live search APIs (SerpApi) as &lt;strong&gt;pluggable telemetry streams&lt;/strong&gt; to mathematically validate, contradict, and score AI claims.&lt;/p&gt;
&lt;p&gt;Instead of subjective LLM summaries, ARGUS PRISM evaluates assertions with &lt;strong&gt;deterministic mathematics&lt;/strong&gt;, source credibility tiering, temporal exponential decay, multi-hop entailment graph topology, and autonomous self-correcting tie-breaker search loops.&lt;/p&gt;
&lt;p&gt;The full architecture specification and developer documentation are located in &lt;a href="https://github.com/akshara-a/ARGUS-PRISM/docs/" rel="noopener noreferrer"&gt;&lt;code&gt;docs/&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🌐 Next.js 16 Web Studio &amp;amp; Autonomous Remediation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;ARGUS PRISM delivers both an &lt;strong&gt;open-standard MCP 2.x server for autonomous agents&lt;/strong&gt; and an &lt;strong&gt;executive zero-login Next.js 16 Web Studio&lt;/strong&gt; for human creators, technical ghostwriters, and due-diligence reviewers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🔬 100% Zero-Persistence Architecture (TabPFN + Backboard)&lt;/strong&gt;: Evaluates drafts strictly in volatile…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/akshara-a/ARGUS-PRISM" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Link:&lt;/strong&gt; &lt;a href="https://github.com/akshara-a/ARGUS-PRISM" rel="noopener noreferrer"&gt;github.com/akshara-a/ARGUS-PRISM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code is organised by responsibility. &lt;code&gt;backend/src/argus/engine/&lt;/code&gt; holds the state machine, scoring, contradiction detector, graph engine, auto-fixer, and exporters. &lt;code&gt;llm/&lt;/code&gt; contains the Gemma and Backboard clients, &lt;code&gt;providers/&lt;/code&gt; holds the search interface, the DuckDuckGo, SerpApi, and mock providers, and the cache, and &lt;code&gt;mcp/&lt;/code&gt; is the MCP server. &lt;code&gt;api/&lt;/code&gt; is the FastAPI server, and &lt;code&gt;audio/&lt;/code&gt; and &lt;code&gt;observability/&lt;/code&gt; hold the ElevenLabs client and the Sentry tracer.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;frontend/&lt;/code&gt; folder is the Next.js 16 Web Studio, and &lt;code&gt;tests/&lt;/code&gt; holds the 82 pytest tests. &lt;code&gt;docs/&lt;/code&gt; and &lt;code&gt;learnings.md&lt;/code&gt; contain the API reference, the connector SDK guide, deployment notes, and the full architecture write-up. The &lt;code&gt;Dockerfile&lt;/code&gt;, &lt;code&gt;render.yaml&lt;/code&gt;, and &lt;code&gt;.github/workflows/ci.yml&lt;/code&gt; cover the container, the Render blueprint, and CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.2 Quality gates
&lt;/h2&gt;

&lt;p&gt;The benchmark harness (&lt;code&gt;backend/evaluate.py&lt;/code&gt;) passes 7 of 7 checks in about 0.21 seconds, and all 82 pytest unit tests pass. CI runs on GitHub Actions, and the full suite runs offline with no API keys.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. How I Built It
&lt;/h1&gt;

&lt;p&gt;The build is described in seven parts: architecture, scoring math, reasoning, the open-weight AI layer, platform services, interfaces, and hardening and delivery.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part A: Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 System architecture
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TB
    subgraph Clients["Clients"]
        WEB["Next.js 16 Web Studio"]
        ST["Streamlit Explorer"]
        CLI["CLI"]
        AGENT["AI Agents&amp;lt;br/&amp;gt;Claude Desktop, Cursor, any MCP client"]
    end

    subgraph Surface["Interface layer"]
        REST["FastAPI REST"]
        MCP["MCP 2.x Server&amp;lt;br/&amp;gt;15 tools, 4 resources, 3 prompts"]
    end

    subgraph Core["ARGUS Deterministic Kernel"]
        SM["GoF State Machine&amp;lt;br/&amp;gt;(6 master states)"]
        EXT["Claim Extractor"]
        SC["Scoring: tiers x decay x Bayes"]
        CON["Contradiction Detector"]
        GR["Evidence DAG Engine"]
        FIX["Auto-Fixer"]
        EXP["Exporters&amp;lt;br/&amp;gt;dossier, certificate, badge, academic"]
    end

    subgraph Providers["Pluggable connectors (open interfaces)"]
        DDG["DuckDuckGo (free, no key)"]
        SERP["SerpApi: Web, Scholar, News"]
        MOCK["Mock (offline, CI)"]
        CACHE[("Cost-Guard cache&amp;lt;br/&amp;gt;LRU RAM + SQLite")]
    end

    subgraph AI["Open-weight AI connectors"]
        GEM["Gemma 2 local (Ollama)"]
        BB["Backboard: Llama 3, Mistral, Gemma 2"]
        TAB["TabPFN-style&amp;lt;br/&amp;gt;Bayesian oracle"]
        RX["Regex fallback"]
    end

    subgraph Side["Side channels"]
        EL["ElevenLabs TTS&amp;lt;br/&amp;gt;(ephemeral base64)"]
        SEN["Sentry tracing"]
    end

    WEB &amp;amp; ST &amp;amp; CLI --&amp;gt; REST
    AGENT --&amp;gt; MCP
    REST &amp;amp; MCP --&amp;gt; SM
    SM --&amp;gt; EXT --&amp;gt; SC --&amp;gt; CON --&amp;gt; GR --&amp;gt; FIX
    GR --&amp;gt; EXP
    SM &amp;lt;--&amp;gt; CACHE
    CACHE &amp;lt;--&amp;gt; DDG &amp;amp; SERP &amp;amp; MOCK
    EXT -.-&amp;gt; GEM &amp;amp; RX
    SC -.-&amp;gt; TAB
    CON -.-&amp;gt; BB
    REST -.-&amp;gt; EL
    SM -.-&amp;gt; SEN&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  4.2 The six master states (GoF State pattern)
&lt;/h3&gt;

&lt;p&gt;Every run walks the same deterministic path. Transitions are explicit, and there is exactly one tie-breaker recursion. This is why identical inputs produce bit-identical scores.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;stateDiagram-v2
    [*] --&amp;gt; STATE_INITIALIZED
    STATE_INITIALIZED --&amp;gt; STATE_PLANNING: configure(topic, domain, lambda)

    state STATE_PLANNING {
        [*] --&amp;gt; OptimisticVector
        OptimisticVector --&amp;gt; SkepticVector
        SkepticVector --&amp;gt; TemporalVector
        TemporalVector --&amp;gt; [*]
    }
    STATE_PLANNING --&amp;gt; STATE_GATHERING: vectors_ready

    state STATE_GATHERING {
        [*] --&amp;gt; ProviderDispatch
        ProviderDispatch --&amp;gt; Normalize
        Normalize --&amp;gt; Dedupe
        Dedupe --&amp;gt; [*]
    }
    STATE_GATHERING --&amp;gt; STATE_EVALUATING: documents_normalized

    state STATE_EVALUATING {
        [*] --&amp;gt; ExtractClaims
        ExtractClaims --&amp;gt; CredibilityTiering
        CredibilityTiering --&amp;gt; FreshnessDecay
        FreshnessDecay --&amp;gt; DetectContradictions
        DetectContradictions --&amp;gt; [*]
    }
    STATE_EVALUATING --&amp;gt; STATE_CONFLICT_RESOLUTION: high_severity_conflict [depth &amp;lt; 1]
    STATE_EVALUATING --&amp;gt; STATE_REPORTING: no_conflicts

    state STATE_CONFLICT_RESOLUTION {
        [*] --&amp;gt; TieBreakerQuery
        TieBreakerQuery --&amp;gt; TargetedSearch
        TargetedSearch --&amp;gt; ReEvaluate
        ReEvaluate --&amp;gt; ReconcileOrFlag
        ReconcileOrFlag --&amp;gt; [*]
    }
    STATE_CONFLICT_RESOLUTION --&amp;gt; STATE_REPORTING: depth == 1

    state STATE_REPORTING {
        [*] --&amp;gt; BuildDAG
        BuildDAG --&amp;gt; Synthesize
        Synthesize --&amp;gt; GlobalConfidence
        GlobalConfidence --&amp;gt; EvidenceReport
        EvidenceReport --&amp;gt; [*]
    }
    STATE_REPORTING --&amp;gt; STATE_COMPLETED: payload_validated
    STATE_COMPLETED --&amp;gt; [*]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;code&gt;STATE_INITIALIZED&lt;/code&gt; receives the topic, domain, and decay constant. &lt;code&gt;STATE_PLANNING&lt;/code&gt; builds the optimistic, skeptical, and temporal query vectors. &lt;code&gt;STATE_GATHERING&lt;/code&gt; dispatches to the provider, normalises documents, and deduplicates them. &lt;code&gt;STATE_EVALUATING&lt;/code&gt; extracts claims, tiers sources, applies decay, and detects contradictions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;STATE_CONFLICT_RESOLUTION&lt;/code&gt; runs one bounded tie-breaker round against primary sources. &lt;code&gt;STATE_REPORTING&lt;/code&gt; builds the graph, synthesises the result, computes global confidence, and emits the report.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 Claim lifecycle
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;stateDiagram-v2
    [*] --&amp;gt; WEAK: extracted, uncorroborated or stale (score &amp;lt; 50)
    WEAK --&amp;gt; VERIFIED: multi-domain corroboration, score &amp;gt;= 70, no conflict
    WEAK --&amp;gt; CONTESTED: opposing polarity found
    VERIFIED --&amp;gt; CONTESTED: fresher conflicting source
    CONTESTED --&amp;gt; VERIFIED: tie-breaker confirms
    CONTESTED --&amp;gt; REFUTED: Tier 1 doc overrules
    REFUTED --&amp;gt; [*]
    VERIFIED --&amp;gt; [*]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;A claim is &lt;code&gt;VERIFIED&lt;/code&gt; when its score is at least 70, it has multi-domain corroboration, and no conflict is active. It is &lt;code&gt;CONTESTED&lt;/code&gt; when sources oppose each other and the conflict is under tie-breaker evaluation or flagged as unresolved. It is &lt;code&gt;WEAK&lt;/code&gt; when its score is below 50 because it is stale, uncorroborated, or from an unverified origin. It is &lt;code&gt;REFUTED&lt;/code&gt; when fresher Tier 1 documentation overrules it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part B: The scoring math
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.4 Credibility tier weight W(d)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Tier 1 (1.5x, authoritative)&lt;/strong&gt; covers primary sources such as github.com, gitlab.com, &lt;code&gt;docs.*&lt;/code&gt; sites, learn.microsoft.com, python.org, pypi.org, npmjs.com, kubernetes.io, ietf.org, w3.org, and &lt;code&gt;.gov&lt;/code&gt; and &lt;code&gt;.edu&lt;/code&gt; domains. &lt;strong&gt;Tier 2 (1.0x, community)&lt;/strong&gt; covers stackoverflow.com, stackexchange.com, lwn.net, dev.to, news.ycombinator.com, arxiv.org, infoq.com, and engineering blogs. &lt;strong&gt;Tier 3 (0.5x, unverified)&lt;/strong&gt; covers Medium, SEO listicles, and the rest of the general web.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.5 Freshness decay
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DecayMultiplier(t) = e^(−λ · t)        t = document age in months
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain velocity&lt;/th&gt;
&lt;th&gt;λ&lt;/th&gt;
&lt;th&gt;Approx. half-life&lt;/th&gt;
&lt;th&gt;Typical examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fast: AI and web frameworks&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.35&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;about 2 months&lt;/td&gt;
&lt;td&gt;LLM tooling, JS frameworks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud and orchestration&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.22&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;about 3 months&lt;/td&gt;
&lt;td&gt;Docker, Kubernetes, cloud APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Core systems and protocols&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.05&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;about 14 months&lt;/td&gt;
&lt;td&gt;POSIX, Linux syscalls, RFCs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;xychart-beta
    title "Evidence weight vs. document age (decay multiplier)"
    x-axis "Age in months" [0, 3, 6, 12, 18, 24]
    y-axis "Multiplier" 0 --&amp;gt; 1
    line [1.0, 0.35, 0.12, 0.015, 0.002, 0.0002]
    line [1.0, 0.52, 0.27, 0.07, 0.02, 0.005]
    line [1.0, 0.86, 0.74, 0.55, 0.41, 0.30]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;em&gt;Lines, top to bottom at 3 months: systems λ=0.05, cloud λ=0.22, fast λ=0.35. These values are computed from the formula, not measured.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.6 Conflict discount and Bayesian update
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Proportional conflict discount&lt;/strong&gt; (instead of zeroing a claim on the first dispute):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DiscountedScore = RawScore × max(0.40, 1.0 − 0.15 × n_conflicts)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bayesian update:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P(H|E) = P(E|H) · P(H) / P(E)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4.7 Score pipeline per claim
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    D["Retrieved document"] --&amp;gt; T["Tier weight W(d)&amp;lt;br/&amp;gt;1.5 / 1.0 / 0.5"]
    D --&amp;gt; A["Age t (months)"]
    A --&amp;gt; E["Decay e^(−λt)"]
    T --&amp;gt; M(("×"))
    E --&amp;gt; M
    M --&amp;gt; C["Corroboration&amp;lt;br/&amp;gt;(independent domains)"]
    C --&amp;gt; B["Bayesian posterior&amp;lt;br/&amp;gt;P(H|E)"]
    B --&amp;gt; X["Conflict discount&amp;lt;br/&amp;gt;max(0.40, 1 − 0.15n)"]
    X --&amp;gt; TP["Bayesian oracle: P(VER), P(CON), P(REF)&amp;lt;br/&amp;gt;and ±σ%"]
    TP --&amp;gt; S["Claim score 0–100&amp;lt;br/&amp;gt;+ state"]&lt;/code&gt;&lt;/pre&gt;






&lt;h2&gt;
  
  
  Part C: Reasoning and self-correction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.8 Self-correcting tie-breaker loop
&lt;/h3&gt;

&lt;p&gt;This is the core anti-hallucination idea. When sources disagree, ARGUS does not average them. It goes and finds a primary-source answer.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    S["Claim extracted"] --&amp;gt; V1["Optimistic query&amp;lt;br/&amp;gt;(general web)"]
    S --&amp;gt; V2["Skeptic query&amp;lt;br/&amp;gt;(issues, PRs, deprecations)"]
    S --&amp;gt; V3["Temporal query&amp;lt;br/&amp;gt;(release notes, changelog)"]
    V1 &amp;amp; V2 &amp;amp; V3 --&amp;gt; POOL["Document pool"]
    POOL --&amp;gt; SCORE["Tier x decay scoring"]
    SCORE --&amp;gt; Q{"High-severity&amp;lt;br/&amp;gt;contradiction?"}
    Q -- No --&amp;gt; REP["Report"]
    Q -- Yes --&amp;gt; DEPTH{"depth &amp;amp;lt; 1 ?"}
    DEPTH -- No --&amp;gt; FLAG["Flag as CONTESTED / unresolved"]
    DEPTH -- Yes --&amp;gt; TB["Generate tie-breaker query&amp;lt;br/&amp;gt;aimed at Tier 1 primary docs"]
    TB --&amp;gt; RS["Targeted search"]
    RS --&amp;gt; RE["Re-evaluate claims"]
    RE --&amp;gt; WIN{"Fresher Tier 1&amp;lt;br/&amp;gt;overrules?"}
    WIN -- Yes --&amp;gt; REF["Loser → REFUTED&amp;lt;br/&amp;gt;winner elevated"]
    WIN -- No --&amp;gt; FLAG
    REF --&amp;gt; REP
    FLAG --&amp;gt; REP&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  4.9 Evidence DAG and transitive invalidation
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    A["Claim A (2026 changelog):&amp;lt;br/&amp;gt;'LegacyAPI v1 removed Mar 2026'&amp;lt;br/&amp;gt;VERIFIED"]
    B["Claim B (2022 blog):&amp;lt;br/&amp;gt;'LegacyAPI v1 is production-ready'&amp;lt;br/&amp;gt;REFUTED"]
    C["Claim C:&amp;lt;br/&amp;gt;'High-load clusters should use v1'&amp;lt;br/&amp;gt;depends on B"]
    D["Claim D:&amp;lt;br/&amp;gt;'Migrate to UnifiedAPI v2'&amp;lt;br/&amp;gt;ENTAILS from A"]

    A -- CONTRADICTS --&amp;gt; B
    C -- REQUIRES --&amp;gt; B
    A -- TRANSITIVELY_CONTRADICTS --&amp;gt; C
    A -- ENTAILS --&amp;gt; D

    classDef good fill:#d1fae5,stroke:#047857,color:#064e3b
    classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
    classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
    class A,D good
    class B bad
    class C warn&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The graph uses four edge types. &lt;code&gt;CONTRADICTS&lt;/code&gt; links direct opposing claims about the same entity. &lt;code&gt;REQUIRES&lt;/code&gt; marks a prerequisite dependency. &lt;code&gt;ENTAILS&lt;/code&gt; marks a logical consequence. &lt;code&gt;TRANSITIVELY_CONTRADICTS&lt;/code&gt; applies when claim A refutes claim B and claim C depends on B, so C is downgraded with a transitive-risk rationale.&lt;/p&gt;

&lt;p&gt;Graph-level metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Contradiction density&lt;/strong&gt; = conflicting pairs ÷ total claim pairs (0.0 to 1.0).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consensus centrality&lt;/strong&gt; = corroboration weighted by node degree (0 to 100).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Part D: The open-weight AI layer
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.10 Model layer
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TB
    IN["Draft text"] --&amp;gt; CHOOSE{"LLM mode"}
    CHOOSE --&amp;gt;|"--llm gemma"| G["Gemma 2 2B&amp;lt;br/&amp;gt;local via Ollama&amp;lt;br/&amp;gt;0 cost, 0 data leaves machine"]
    CHOOSE --&amp;gt;|"Backboard key set"| B["Backboard gateway&amp;lt;br/&amp;gt;one key, three open models"]
    CHOOSE --&amp;gt;|"default / offline"| R["Regex extractor&amp;lt;br/&amp;gt;deterministic, 0.2s"]

    B --&amp;gt; L["Llama 3 8B"]
    B --&amp;gt; M["Mistral 7B"]
    B --&amp;gt; GG["Gemma 2 9B"]
    L &amp;amp; M &amp;amp; GG --&amp;gt; AGR{"Agreement ratio"}
    AGR --&amp;gt;|"3 of 3"| OK["3/3 Models Concur"]
    AGR --&amp;gt;|"2 of 3"| MID["2/3 Concur: review"]
    AGR --&amp;gt;|"dissent"| HI["High Hallucination Risk"]

    G --&amp;gt; CL["Structured JSON claims"]
    R --&amp;gt; CL
    OK &amp;amp; MID &amp;amp; HI --&amp;gt; CL
    CL --&amp;gt; ENGINE["Deterministic scoring kernel"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;There are three extraction paths. &lt;strong&gt;Gemma 2 2B through Ollama&lt;/strong&gt; runs with &lt;code&gt;--llm gemma&lt;/code&gt;. It is free, local, and private, but it is a small model and can miss subtle claims. &lt;strong&gt;The Backboard tri-model check&lt;/strong&gt; runs when &lt;code&gt;BACKBOARD_API_KEY&lt;/code&gt; is set. It gives a real cross-model agreement signal from Llama 3, Mistral, and Gemma 2, but needs a key and network access. Without a key it falls back to a deterministic offline simulation so demos and tests still run. &lt;strong&gt;The regex extractor&lt;/strong&gt; is the default and works offline. It is instant and fully deterministic but coarse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design principle:&lt;/strong&gt; open models extract and cross-examine. They never decide the score. The math does. If every model is unavailable, the regex path still works end to end, which keeps CI and the benchmark deterministic.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.11 Bayesian uncertainty oracle (TabPFN-style)
&lt;/h3&gt;

&lt;p&gt;Each claim becomes a 4-feature vector &lt;code&gt;[W(d), age, corroboration_count, conflict_count]&lt;/code&gt; plus its deterministic base score. The oracle turns that into &lt;code&gt;[P(VERIFIED), P(CONTESTED), P(REFUTED)]&lt;/code&gt; and an uncertainty interval, shown on the gauge as, for example, &lt;code&gt;94.5% (±2.4%)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt; it is a hand-written, closed-form calibrated model. It computes a logit for each class from the features, applies a softmax, and derives &lt;code&gt;±σ&lt;/code&gt; from the entropy of the resulting distribution (bounded between 1.2% and 8.5%). It runs entirely in memory with no download and no GPU.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it is not:&lt;/strong&gt; it does not load the pretrained TabPFN network. It is named for the idea, which is a prior-fitted, tabular, in-memory probabilistic classifier. Swapping in the real TabPFN behind the same &lt;code&gt;evaluate_claim&lt;/code&gt; interface is a natural next step.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part E: Platform services
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.12 Zero-persistence data flow
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    U["User draft"] --&amp;gt;|HTTPS| API["FastAPI process RAM"]
    API --&amp;gt; ENG["Engine: transient objects"]
    ENG --&amp;gt; OUT["Report + base64 audio"]
    OUT --&amp;gt;|HTTPS| U
    ENG -. "X no disk write" .-&amp;gt; DISK[("Disk / DB")]
    ENG -. "X no draft logging" .-&amp;gt; LOG[("Logs")]
    CACHE[("Cost-Guard cache&amp;lt;br/&amp;gt;search results ONLY")] &amp;lt;--&amp;gt; ENG
    note1["Cache stores search-query to results,&amp;lt;br/&amp;gt;never user drafts or claims text"] -.-&amp;gt; CACHE&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Guarantees:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Drafts and extracted claims live only in process memory for the life of the request.&lt;/li&gt;
&lt;li&gt;No draft is written to disk, SQLite, or logs.&lt;/li&gt;
&lt;li&gt;Audio is streamed as base64 in the HTTP response, with no server-side files.&lt;/li&gt;
&lt;li&gt;The SQLite tier of the cache holds public search results keyed by query. It never holds user drafts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.13 Cost-Guard two-tier cache
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    Q["Search query"] --&amp;gt; T1{"Tier 1: in-memory LRU"}
    T1 -- hit --&amp;gt; R["Return, sub-millisecond"]
    T1 -- miss --&amp;gt; T2{"Tier 2: SQLite&amp;lt;br/&amp;gt;.cache/serpapi_cache.sqlite"}
    T2 -- hit --&amp;gt; P["Promote to LRU, return"]
    T2 -- miss --&amp;gt; API["Live provider call"]
    API --&amp;gt; W["Write both tiers"] --&amp;gt; R
    R --&amp;gt; TEL["Telemetry: hit rate, calls,&amp;lt;br/&amp;gt;USD saved ($0.01/query est.), avg latency"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Benchmark result: 12 repeated requests gave 7 hits, a 58.3% hit rate, and an estimated $0.07 saved. The score stayed identical.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.14 Deliverables pipeline
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    REP["Evidence report"] --&amp;gt; DOS["Evidence Dossier&amp;lt;br/&amp;gt;contradiction summaries, claim ledger, formulas"]
    REP --&amp;gt; CERT["Client Certificate&amp;lt;br/&amp;gt;(HTML, billable time saved)"]
    REP --&amp;gt; BADGE["SVG badge&amp;lt;br/&amp;gt;GET /api/badge"]
    REP --&amp;gt; ACAD["Academic export&amp;lt;br/&amp;gt;[^1] footnotes + IEEE/APA"]
    REP --&amp;gt; FIXD["Auto-fixed Markdown&amp;lt;br/&amp;gt;+ git-style diff"]
    REP --&amp;gt; AUD["60s audio debrief&amp;lt;br/&amp;gt;Rachel / Adam / Drew"]
    BADGE --&amp;gt; SNIP["Markdown / HTML snippet&amp;lt;br/&amp;gt;GitHub, Notion, Substack"]
    ACAD --&amp;gt; PUB["Notion, Substack, Medium,&amp;lt;br/&amp;gt;Ghost, Obsidian"]&lt;/code&gt;&lt;/pre&gt;






&lt;h2&gt;
  
  
  Part F: Interfaces and integrations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.15 MCP integration (15 tools)
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    AG["Agent (Claude Desktop / Cursor / Inspector)"] --&amp;gt;|stdio or SSE| MCPS["ARGUS MCP Server"]
    subgraph Tools["15 Tools"]
        T1["validate_response"]
        T2["execute_research"]
        T3["execute_targeted_search"]
        T4["inspect_evidence"]
        T5["inspect_confidence"]
        T6["inspect_conflicts"]
        T7["compare_technologies"]
        T8["inspect_telemetry"]
        T9["generate_dossier"]
        T10["auto_repair_draft"]
        T11["crawl_and_audit_url"]
        T12["export_academic_markdown"]
        T13["generate_verification_badge"]
        T14["backboard_compare_models"]
        T15["tabpfn_bayesian_uncertainty"]
    end
    subgraph Res["4 Resources"]
        R1["argus://reports/latest"]
        R2["argus://conflicts/active"]
        R3["argus://reports/dossier"]
        R4["argus://graph/dot"]
    end
    subgraph Pr["3 Prompts"]
        P1["validate_response"]
        P2["adversarial_fact_check"]
        P3["migration_risk_audit"]
    end
    MCPS --&amp;gt; Tools &amp;amp; Res &amp;amp; Pr&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;strong&gt;Agent before and after:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;sequenceDiagram
    actor Dev
    participant LLM as Naive LLM
    participant AG as ARGUS-equipped agent
    participant AR as ARGUS MCP

    Dev-&amp;gt;&amp;gt;LLM: "Next.js 15 supports React 18 and LegacyAPI v1 is production-ready?"
    LLM--&amp;gt;&amp;gt;Dev: "Yes, absolutely!" (stale blog bias, WRONG)

    Dev-&amp;gt;&amp;gt;AG: same question
    AG-&amp;gt;&amp;gt;AR: auto_repair_draft(draft, domain)
    AR-&amp;gt;&amp;gt;AR: tier, decay, tie-break to the changelog
    AR--&amp;gt;&amp;gt;AG: refuted claims + diff + ±σ confidence
    AG--&amp;gt;&amp;gt;Dev: "Not accurate. v1 was removed (source, date). Corrected text attached."&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  4.16 REST API (12 endpoints)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/health&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Liveness and readiness probe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/fetch-url&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;SSRF-safe crawl of a live page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/validate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full audit of a draft&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/badge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Embeddable SVG verification badge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/compare-models&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Backboard tri-model comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/bayesian-evaluate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Class probabilities and uncertainty interval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/export-footnotes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Footnoted Markdown with IEEE/APA references&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/auto-fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Grounded rewrite plus diff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/research&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adversarial multi-vector research&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/compare&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Head-to-head technology comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/chat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Documentation-anchored assistant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/telemetry&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cache and cost telemetry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  4.17 Head-to-head comparator
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;compare FastAPI Django&lt;/code&gt; runs two research pipelines and scores each on four dimensions.&lt;/p&gt;

&lt;p&gt;The four dimensions are global evidence confidence (a deterministic score across all sources), authoritative verified claims (the count of Tier 1 verified claims), operational stability (the inverse of conflict and weak-claim density), and ecosystem freshness (exponentially decayed recency).&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;quadrantChart
    title Illustrative comparator output (example shape, not real data)
    x-axis "Low freshness" --&amp;gt; "High freshness"
    y-axis "Low evidence confidence" --&amp;gt; "High evidence confidence"
    quadrant-1 "Strong and current"
    quadrant-2 "Well-evidenced but aging"
    quadrant-3 "Weak and stale"
    quadrant-4 "Fresh but thinly evidenced"
    "Tech A": [0.78, 0.82]
    "Tech B": [0.55, 0.88]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqjirwzvje9d9wiyp7o46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqjirwzvje9d9wiyp7o46.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.18 Pluggable connector design
&lt;/h3&gt;

&lt;p&gt;Every external dependency sits behind an interface, so contributors can add engines without touching the kernel:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;classDiagram
    class ISearchProvider {
        &amp;lt;&amp;lt;interface&amp;gt;&amp;gt;
        +provider_name str
        +search(query, ...) list~RawDocument~
    }
    class DuckDuckGoSearchStrategy
    class WebSearchStrategy
    class MockSearchStrategy
    class CustomEnterpriseProvider
    ISearchProvider &amp;lt;|.. DuckDuckGoSearchStrategy
    ISearchProvider &amp;lt;|.. WebSearchStrategy
    ISearchProvider &amp;lt;|.. MockSearchStrategy
    ISearchProvider &amp;lt;|.. CustomEnterpriseProvider

    class CredibilityDecorator {
        +evaluate_source_tier(url)
    }
    class SerpApiCache {
        +get() +put() +telemetry()
    }
    class ClaimGraphEngine {
        +add_claim() +relate() +transitive_invalidate()
    }
    class ArgusStateMachine
    ArgusStateMachine --&amp;gt; ISearchProvider
    ArgusStateMachine --&amp;gt; CredibilityDecorator
    ArgusStateMachine --&amp;gt; SerpApiCache
    ArgusStateMachine --&amp;gt; ClaimGraphEngine&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The design uses the State pattern for the six-state pipeline, the Decorator pattern for credibility tiers, the Strategy pattern for swappable search providers, the Observer pattern for the traceability drawer, and the Adapter pattern for the SerpApi engines.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part G: Hardening, delivery, and proof
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.19 Security hardening
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TB
    subgraph Threats
        T1["SSRF via URL auditor"]
        T2["XSS in generated HTML"]
        T3["Malicious certificate preview"]
        T4["Wildcard CORS"]
        T5["SVG stored XSS"]
        T6["Regex backreference injection"]
    end
    subgraph Mitigations
        M1["is_safe_public_url: DNS pre-resolve,&amp;lt;br/&amp;gt;block loopback, 169.254.169.254, RFC1918,&amp;lt;br/&amp;gt;redirects disabled"]
        M2["http/https scheme allow-list,&amp;lt;br/&amp;gt;html.escape on every href and content"]
        M3["iframe sandbox=''"]
        M4["Origin whitelist + onrender.com regex"]
        M5["CSP default-src 'none'&amp;lt;br/&amp;gt;+ nosniff on badge"]
        M6["pattern.sub(lambda _: repl, text)"]
    end
    T1 --&amp;gt; M1
    T2 --&amp;gt; M2
    T3 --&amp;gt; M3
    T4 --&amp;gt; M4
    T5 --&amp;gt; M5
    T6 --&amp;gt; M6&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  4.20 Tech stack
&lt;/h3&gt;

&lt;p&gt;The backend is Python 3.11 to 3.13 with Pydantic v2, FastAPI, and Uvicorn, and it exposes the Model Context Protocol (MCP 2.x) over stdio and SSE. The frontend is Next.js 16 with Turbopack, React 19, Tailwind CSS v4, TypeScript, and Bun, and the dashboard uses Streamlit, PyVis, and NetworkX. Open-weight models are Gemma 2 through Ollama and Llama 3 8B, Mistral 7B, and Gemma 2 9B through Backboard.&lt;/p&gt;

&lt;p&gt;Uncertainty comes from an in-memory Bayesian oracle modelled on the TabPFN idea (a closed-form softmax with no model download). Search uses DuckDuckGo, SerpApi (Google, Scholar, News), or an offline mock. ElevenLabs provides voice and Sentry provides observability. The cache is an in-memory LRU plus SQLite, and packaging and delivery use uv, pytest, Docker, GitHub Actions, and a Render Blueprint.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo7h30xro847pozafjszt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo7h30xro847pozafjszt.png" alt=" " width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.21 Deployment topology
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    GH["GitHub repo"] --&amp;gt; CI["GitHub Actions&amp;lt;br/&amp;gt;pytest + benchmark"]
    GH --&amp;gt; RND["Render Blueprint (render.yaml)"]
    RND --&amp;gt; APIsvc["argus-prism-api&amp;lt;br/&amp;gt;FastAPI + MCP core&amp;lt;br/&amp;gt;health: /api/health"]
    RND --&amp;gt; FEsvc["Web Studio (Next.js)"]
    FEsvc --&amp;gt;|REST| APIsvc
    APIsvc --&amp;gt; EXT1["DuckDuckGo / SerpApi"]
    APIsvc --&amp;gt; EXT2["Backboard / ElevenLabs"]
    APIsvc --&amp;gt; EXT3["Sentry"]
    DK["Dockerfile"] --&amp;gt; GH
    LOC["Local: Ollama + Gemma 2"] -.optional.-&amp;gt; APIsvc&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  4.22 Benchmarks
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;What it proves&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Hallucination trap&lt;/td&gt;
&lt;td&gt;A fabricated library scores 0.0 with an empty ledger&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Contradiction catch&lt;/td&gt;
&lt;td&gt;A 2026 changelog elevates over a decayed 2022 blog via tie-breaker&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Traceability&lt;/td&gt;
&lt;td&gt;100% of claims map to a URL, snippet, and tier&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Reproducibility&lt;/td&gt;
&lt;td&gt;Bit-identical float scores across runs&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Adaptive λ and Bayes&lt;/td&gt;
&lt;td&gt;λ is 0.35 for web and 0.05 for systems, and P(H|E) ∈ [0,1]&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Cost-Guard&lt;/td&gt;
&lt;td&gt;Hit rate ≥ 50%, savings &amp;gt; 0, scores unchanged&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Multi-hop DAG&lt;/td&gt;
&lt;td&gt;A dependent claim is penalized when its prerequisite is refuted&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Suite runtime is about &lt;strong&gt;0.21 s&lt;/strong&gt;, with &lt;strong&gt;82/82&lt;/strong&gt; unit tests passing.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.23 Run it yourself
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CLI audit with client deliverables:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli validate &lt;span class="nt"&gt;--file&lt;/span&gt; article_draft.txt &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--client&lt;/span&gt; &lt;span class="s2"&gt;"Acme Ghostwriting"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--export-report&lt;/span&gt; client_audit.html &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--markdown-report&lt;/span&gt; client_briefing.md &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--audio&lt;/span&gt; briefing.wav &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--llm&lt;/span&gt; gemma &lt;span class="nt"&gt;--provider&lt;/span&gt; duckduckgo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Other commands:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli research &lt;span class="s2"&gt;"Pydantic v2 migration"&lt;/span&gt; &lt;span class="nt"&gt;--domain&lt;/span&gt; &lt;span class="s2"&gt;"Python Architecture"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli compare &lt;span class="s2"&gt;"FastAPI"&lt;/span&gt; &lt;span class="s2"&gt;"Django"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli dossier &lt;span class="s2"&gt;"PostgreSQL JSONB indexing"&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; dossier.html
python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli telemetry
python &lt;span class="nt"&gt;-m&lt;/span&gt; argus.cli mcp &lt;span class="nt"&gt;--transport&lt;/span&gt; stdio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Local open model:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma2:2b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude Desktop or Cursor config:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"argus-prism"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"uv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"run"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"--directory"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/path/to/ARGUS PRISM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"-m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"argus.cli"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"PYTHONUNBUFFERED"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  5. Why Does Open Innovation Matter?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  5.1 What open made possible
&lt;/h2&gt;

&lt;p&gt;A hosted, closed fact-checking API would not suit this product. Open components make several things possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy you can verify.&lt;/strong&gt; Ghostwriters handle unpublished client drafts, and some are under NDA. With Gemma 2 running locally through Ollama, nothing leaves the machine, and with open code a client can audit the zero-persistence claim instead of trusting a vendor policy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-model checking needs model diversity.&lt;/strong&gt; Backboard lets one key query Llama 3, Mistral, and Gemma 2 side by side. Agreement and dissent between independently trained open models is a real hallucination signal that a single closed model cannot provide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Determinism and reproducibility.&lt;/strong&gt; The kernel is open math (tiers, decay, Bayes) and open models are used only for extraction. Anyone can re-run an audit and get the same score, so a Verified badge can be checked, not just trusted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pluggable connectors.&lt;/strong&gt; &lt;code&gt;ISearchProvider&lt;/code&gt; lets a contributor add a search source, such as an internal wiki, without forking the kernel. This is the same open-kernel idea used by Airbyte and OpenTelemetry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Offline testing and zero-cost onboarding.&lt;/strong&gt; The mock provider and the regex fallback let 82 tests and 7 benchmarks run in under a second with no keys, and the free DuckDuckGo path lets a new user try live verification at no cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open standards for agents.&lt;/strong&gt; Because ARGUS speaks MCP, it works with Claude Desktop, Cursor, and any other MCP-compatible agent without a custom integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2 Limitations
&lt;/h2&gt;

&lt;p&gt;The regex fallback is fast and deterministic but coarse, and Gemma 2 2B is small enough to miss subtle claims. Freshness depends on publication dates from search results, which are sometimes missing or wrong. The tier lists are heuristics, so a Tier 1 domain can still be wrong and a Tier 3 source can be right.&lt;/p&gt;

&lt;p&gt;The benchmarks use the mock provider, and live-web results vary with the search engine. The uncertainty oracle is TabPFN-style rather than the pretrained TabPFN network, and without a Backboard API key the three-model consensus is a deterministic stand-in rather than real model output. The $0.01-per-query savings and $50 per hour figures are configurable estimates, not billing data.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Prize Categories
&lt;/h1&gt;

&lt;p&gt;ARGUS PRISM is entered in the partner categories below. Each entry below describes how ARGUS PRISM uses the technology.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Render.&lt;/strong&gt; A blueprint deploys three services: the FastAPI and MCP API, the Next.js Web Studio, and the Streamlit dashboard. The API exposes &lt;code&gt;/api/health&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Gemma.&lt;/strong&gt; Gemma 2 2B runs locally through Ollama for private claim extraction (&lt;code&gt;--llm gemma&lt;/code&gt;), and Gemma 2 9B is the third voter in the tri-model check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Backboard.&lt;/strong&gt; One key queries Llama 3 8B, Mistral 7B, and Gemma 2 9B and reports an agreement ratio (&lt;code&gt;3/3 Concur&lt;/code&gt;, &lt;code&gt;2/3 Concur&lt;/code&gt;, or &lt;code&gt;High Hallucination Risk&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of ElevenLabs.&lt;/strong&gt; A 60-second spoken debrief with three personas (Rachel, Adam, and Drew) is streamed as base64, with nothing stored on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Sentry Agent Tracing.&lt;/strong&gt; Each pipeline stage is a span with latency visibility, and the Cost-Guard and Telemetry panel includes a flamegraph view.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use of SerpApi.&lt;/strong&gt; A SerpApi provider with Google Web, Google Scholar, and Google News engines supplies the evidence pool, behind a cache that tracks credits saved.&lt;/p&gt;




</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>Exhale: The 5-Step Emotional Circuit Breaker</title>
      <dc:creator>Akshara A</dc:creator>
      <pubDate>Sun, 11 Oct 2026 17:48:45 +0000</pubDate>
      <link>https://dev.to/aks_a/exhale-the-5-step-emotional-circuit-breaker-jn6</link>
      <guid>https://dev.to/aks_a/exhale-the-5-step-emotional-circuit-breaker-jn6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;Exhale: The 5-Step Emotional Circuit Breaker&lt;/strong&gt;, an acute mental health application explicitly engineered to push you &lt;em&gt;away&lt;/em&gt; from screens and force you to literally &lt;strong&gt;touch grass&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;When a developer or student suffers an acute cognitive breakdown (e.g., &lt;em&gt;"I've been stuck on this bug for 7 hours, my heart is racing, I feel like a failure"&lt;/em&gt;), traditional commercial apps try to keep you online with infinite feeds. Exhale reverses this completely: it acts as an emotional circuit breaker that mandates you step outside and &lt;strong&gt;touch grass&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;You submit a single sentence about your distress. Exhale analyzes the somatic emotion, anchors it with hyper-local weather/solar telemetry, and applies wisdom from worldwide cultural nature lineages. It then generates a 5-step grounding mission, aggressively locks your screen, and won't unlock until you &lt;strong&gt;touch grass&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   [ Acute Emotional Distress ]
                 │
                 ▼
     ┌───────────────────────┐
     │  Exhale Input Console │  ◄── Raw 1-sentence brain dump
     └───────────┬───────────┘
                 │
                 ▼
┌─────────────────────────────────┐
│ Live Solar &amp;amp; Weather Telemetry  │  ◄── Open-Meteo GPS calibration
│ 15 Global Nature Lineages       │  ◄── Ancestral somatic grounding
│ Sovereign Open-Weight Inference │  ◄── 3-Tier cascade (Hermes 3 / Groq)
└────────────────┬────────────────┘
                 │
                 ▼
┌─────────────────────────────────┐
│     Strict 5-Stage Somatic Arc  │  ◄── Touch → Sight → Sound → Smell → Temp
└────────────────┬────────────────┘
                 │
                 ▼
┌─────────────────────────────────┐
│     Full Hardware Lockout       │  ◄── Tab penalties, OLED pocket mode,
│    Multimodal Proof-of-Touch    │      haptics, &amp;amp; vision verification
└─────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Who is it for?&lt;/strong&gt;&lt;br&gt;
Chronically online developers, remote workers, and anyone experiencing sensory overload or a panic attack who desperately needs to close their laptop, step into the living biosphere, and &lt;strong&gt;touch grass&lt;/strong&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  Anti-Engagement: Forcing You to Touch Grass
&lt;/h2&gt;

&lt;p&gt;To truly make the screen the shortest part of the experience, the app employs strict &lt;strong&gt;Anti-Engagement Mechanics&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Hardware Screen Lock &amp;amp; Tab Violations:&lt;/strong&gt; If you switch browser tabs to avoid going outside to &lt;strong&gt;touch grass&lt;/strong&gt;, the Page Visibility API triggers an alert and resets your 10-minute timer.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Pocket Mode &amp;amp; Haptics:&lt;/strong&gt; The screen turns pitch black (OLED #000000) so you aren't tempted to look at it. The Web Speech API narrations and &lt;code&gt;navigator.vibrate&lt;/code&gt; box breathing pacer guide you while the phone stays in your pocket as you walk out to &lt;strong&gt;touch grass&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Accelerometer &amp;amp; Vision Verification:&lt;/strong&gt; The &lt;code&gt;DeviceMotion&lt;/code&gt; API verifies you are actually walking away from your desk. Finally, an in-memory vision classifier requires a "Proof of Touch" photo of an organic object to verify you actually &lt;strong&gt;touched grass&lt;/strong&gt; (or bark, leaves, stone) before unlocking the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Proof of Touch in Action:&lt;/strong&gt; The app actively rejects digital monitors and tracks if you try to tab away!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc006215vctwactduo0kv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc006215vctwactduo0kv.png" alt=" " width="363" height="717"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The Clinical Neuroscience: The Strict 5-Stage Somatic Arc
&lt;/h2&gt;

&lt;p&gt;Why does every Exhale mission contain &lt;strong&gt;strictly five sequential steps&lt;/strong&gt;? &lt;/p&gt;

&lt;p&gt;In acute distress, cognitive overload impairs executive decision-making. Asking an overwhelmed person to interpret vague advice produces decision fatigue. Exhale adheres to a scientifically validated, 5-stage sequential somatic arc that progressively re-engages the nervous system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ Step 1: Touch ]  ──► Immediate Tactile Earth Contact (Discharges static bodily heat)
        │
[ Step 2: Sight ]  ──► Panoramic Optic Flow &amp;amp; Horizon Scan (Dissolves screen convergence)
        │
[ Step 3: Sound ]  ──► Acoustic Orientation &amp;amp; Natural Frequencies (Induces alpha oscillations)
        │
[ Step 4: Smell ]  ──► Olfactory Vagal Stimulation (Geosmin &amp;amp; phytoncides engage vagal brake)
        │
[ Step 5: Temp  ]  ──► Thermoreceptive &amp;amp; Postural Integration (Roots body before re-entering)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Step 1 — Touch (Tactile Earth Contact):&lt;/strong&gt; Direct physical contact with living bark, unpolished stone, soil, or rain on open hands. Tactile grounding dissipates positive electrostatic surface charges and provides an immediate somatosensory reality anchor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2 — Sight (Panoramic Optic Flow):&lt;/strong&gt; Gazing at the furthest visible horizon line, cloud formations, or canopy treetops for 45 seconds. Broad optic flow relaxes the ciliary eye muscles, directly deactivating the screen-induced "convergence tunnel" that sustains sympathetic fight-or-flight arousal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3 — Sound (Acoustic Orientation):&lt;/strong&gt; Closing your eyes for 45 seconds to isolate ambient natural acoustics (canopy wind, distant birdsong, rain patter). Natural acoustic white noise lowers baseline acoustic stress thresholds and prompts alpha-wave (8–12 Hz) synchronization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 4 — Smell &amp;amp; Respiration (Olfactory Vagal Stimulation):&lt;/strong&gt; Deep nasal inhalation of damp soil geosmin, crushed foliage phytoncides (&lt;em&gt;alpha-pinene&lt;/em&gt;, &lt;em&gt;limonene&lt;/em&gt;), or crisp ambient air. Airborne phytoncides stimulate olfactory bulb pathways that trigger the parasympathetic vagal brake within seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 5 — Temperature &amp;amp; Postural Integration:&lt;/strong&gt; Thermoreceptive awareness of atmospheric wind or solar warmth against the skin, paired with a deliberate diaphragmatic exhale and rooted posture before stepping back inside.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Auto-Healing Step Normalizer
&lt;/h3&gt;

&lt;p&gt;Open-weight foundation models running in the wild can occasionally omit steps or format irregularly under varying temperatures. To prevent schema failures or truncated protocols, Exhale’s backend implements an &lt;strong&gt;Auto-Healing Step Normalizer&lt;/strong&gt; (&lt;code&gt;_normalize_and_enforce_five_steps&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If an LLM returns 3 or 4 steps, the engine evaluates which sensory modalities were omitted, dynamically synthesizes the missing sensory stages from our canonical cultural and weather matrices, and guarantees sequential numbering (&lt;code&gt;1, 2, 3, 4, 5&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;If an LLM returns more than 5 steps, it truncates cleanly to the top 5.&lt;/li&gt;
&lt;li&gt;The Pydantic schema enforces &lt;code&gt;min_length=5, max_length=5&lt;/code&gt; with zero exceptions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The 15 Proven Global &amp;amp; Scientific Nature Lineages
&lt;/h2&gt;

&lt;p&gt;To provide the grounding protocols, Exhale bridges modern neurobiology with centuries of ancestral nature wisdom across 15 distinct world traditions. The AI uses these frameworks to generate your personalized offline mission:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Framework&lt;/th&gt;
&lt;th&gt;Native Script &amp;amp; Region&lt;/th&gt;
&lt;th&gt;Lineage &amp;amp; Core Philosophy&lt;/th&gt;
&lt;th&gt;Clinical Evidence &amp;amp; Trials&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Japanese Shinrin-yoku&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;森林浴 (Japan)&lt;/td&gt;
&lt;td&gt;Forest bathing; airborne phytoncides; Komorebi dappled canopy sunlight.&lt;/td&gt;
&lt;td&gt;Chiba University: 15.8% drop in salivary cortisol; 53% surge in NK immune cell activity.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Indian Pancha Mahabhuta&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;पञ्चमहाभूत (Vedic)&lt;/td&gt;
&lt;td&gt;Earth element (Prithvi) calibration; discharging static bodily electrical potential.&lt;/td&gt;
&lt;td&gt;Grounding dissipates positive electrical charge, resetting autonomic vagal brake.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Tamil Ainthinai &amp;amp; Siddha&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ஐந்திணை (Sangam)&lt;/td&gt;
&lt;td&gt;5 sacred eco-landscapes (Kurinji, Mullai, Marutham...) &amp;amp; Manvaasanai petrichor.&lt;/td&gt;
&lt;td&gt;Inhalation of geosmin triggers immediate endorphin release and emotional grounding.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;African Ubuntu &amp;amp; Khoisan&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ubuntu / Ilẹ̀ (Southern Africa)&lt;/td&gt;
&lt;td&gt;"I am because we are"; barefoot optic horizon orientation &amp;amp; biosphere kinship.&lt;/td&gt;
&lt;td&gt;Panoramic optic flow stimulates brainstem nuclei, inhibiting hyperactive amygdalar fear conditioning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chinese Daoist Ziran &amp;amp; Wu Wei&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;自然 / 无为 (Daoism)&lt;/td&gt;
&lt;td&gt;Spontaneous nature alignment; grounding agitated Yang thoughts into Yin soil.&lt;/td&gt;
&lt;td&gt;Downregulates sympathetic arousal through rhythmic Zhan Zhuang tactile tree-contact.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scientific Polyvagal &amp;amp; ART&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Porges &amp;amp; Kaplan (Neurobiology)&lt;/td&gt;
&lt;td&gt;Polyvagal autonomic regulation + Attention Restoration Theory (ART).&lt;/td&gt;
&lt;td&gt;Outdoor sensory "soft fascination" restores directed prefrontal attention depleted by code debugging.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Indigenous Lakota Hózhó&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mitákuye Oyásʼin (Lakota/Diné)&lt;/td&gt;
&lt;td&gt;"All My Relations"; 4-cardinal-direction alignment; touching Grandmother Earth.&lt;/td&gt;
&lt;td&gt;Attenuates acute depersonalization through spatial-cardinal tactile orientation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hawaiian Aloha ʻĀina&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Aloha ʻĀina (Polynesian)&lt;/td&gt;
&lt;td&gt;Sacred soil kinship; divine breath (Hā) synchronized with trade winds.&lt;/td&gt;
&lt;td&gt;Synchronizes heart rate variability (HRV) with oceanic and canopy airflow patterns.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Celtic Gaelic Dùthchas&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dùthchas &amp;amp; Caim (Celtic)&lt;/td&gt;
&lt;td&gt;Hereditary belonging to ancient moss/stone; tracing protective sanctuary circle.&lt;/td&gt;
&lt;td&gt;Perceptual boundary-setting relieves acute cognitive intrusion and rumination spirals.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Islamic Sufi Tafakkur&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;تفكّر (Sufi Contemplation)&lt;/td&gt;
&lt;td&gt;Contemplation of living cosmic signs (Ayat) in shifting desert wind and stone.&lt;/td&gt;
&lt;td&gt;Sustained focal observation induces sustained alpha-wave brain oscillations (8–12 Hz).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Māori Papatūānuku&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Papatūānuku (Aotearoa)&lt;/td&gt;
&lt;td&gt;Earth Mother kinship; volcanic soil contact; Tāne Mahuta fern respiration.&lt;/td&gt;
&lt;td&gt;Soil microflora (Mycobacterium vaccae) contact stimulates serotonin synthesis.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Korean Pungryu &amp;amp; Salim&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;풍류 / 산림 (Silla Era)&lt;/td&gt;
&lt;td&gt;Flowing with mountain winds through pine mist &amp;amp; granite ridges.&lt;/td&gt;
&lt;td&gt;Pine pinene inhalation combined with light aerobic walking enhances cerebral perfusion.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Greco-Roman Stoic Sympatheia&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Συμπάθεια (Marcus Aurelius)&lt;/td&gt;
&lt;td&gt;"The View from Above": cosmic contemplation of universal natural unity.&lt;/td&gt;
&lt;td&gt;Radical cognitive decentering disrupts acute catastrophe ideation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nordic Friluftsliv&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Friluftsliv (Scandinavia)&lt;/td&gt;
&lt;td&gt;Open-air elemental resilience; embracing brisk boreal winds and rain.&lt;/td&gt;
&lt;td&gt;Mild cold thermogenesis activates brown adipose tissue, increasing norepinephrine release and mental lucidity.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;German Waldeinsamkeit&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Waldeinsamkeit (Romanticism)&lt;/td&gt;
&lt;td&gt;Restorative solitude amidst beech and spruce canopies away from urban noise.&lt;/td&gt;
&lt;td&gt;Prolonged acoustic silence lowers baseline acoustic stress thresholds and alleviates sensory overload.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fofreh7g7c53jr7cwp3du.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fofreh7g7c53jr7cwp3du.png" alt=" " width="799" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Here is a look at the "anti-engagement" UI, the hardware lockouts, and a fully generated physical grounding protocol:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://exhale-frontend.onrender.com/" rel="noopener noreferrer"&gt;Exhale - Click Here for Live Demo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8galeutjl9rmlebbtz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8galeutjl9rmlebbtz4.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image displays a customized 5-step "Nighttime Forest Breath" sensory protocol generated by the Exhale app, which anchors the user's grounding mission to the current nocturnal weather and atmospheric conditions:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq5n2rrubwdqj7yjjmqne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq5n2rrubwdqj7yjjmqne.png" alt=" " width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image displays the final "Attestation" phase of the Exhale app's grounding protocol, greeting the user with the message "Welcome back to reality." upon the completion of the circuit breaker. This screen summarizes the completed session by displaying the initial somatic diagnosis (acute somatic anxiety and chest tightness) alongside a reassuring message about the user's outdoor immersion. It heavily emphasizes the app's zero-retention privacy model, confirming that the "Volatile RAM [is] Dissolved" and that "0 Bytes" of data were persisted. Additionally, the dashboard logs session metrics such as "Offline Immersion" time, "Steps Paced," and "Touch Witness" type, while offering options to log current feelings (Calmer, Grounded, Clear-Headed) and export an "Official Ephemeral Attestation" certificate as a PNG or TXT file:&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ius3mw6opkbou4avys9.png" alt=" " width="800" height="422"&gt;
&lt;/h2&gt;

&lt;p&gt;Core Features Showcased:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pocket Mode (OLED Blackout): The screen turns pitch black to save power, using the Web Speech API to narrate the mission so you can keep the phone in your pocket.&lt;/li&gt;
&lt;li&gt;Pocket Haptics: The navigator.vibrate API pulses a 4-4-4-4 box breathing pacer (Inhale, Hold, Exhale, Hold) directly into your leg.&lt;/li&gt;
&lt;li&gt;Proof of Touch: An in-memory vision classifier verifies you actually touched an organic object (bark, leaves, stone) before releasing the lock, strictly rejecting digital screens.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The entire project is open-source, features a zero-retention architecture, and is available here: &lt;a href="https://github.com/akshara-a/Exhale/" rel="noopener noreferrer"&gt;Exhale - Source Code&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;Exhale is built on a decoupled, production-grade microservices architecture orchestrated via Render's Infrastructure-as-Code (render.yaml):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend AI Runtime: A Python FastAPI service running Ollama and the Hermes-3 (Open-Weight 8B) model. This is containerized via multi-stage Docker and deployed as a Render Web Service (GPU Accelerated).&lt;/li&gt;
&lt;li&gt;Frontend SPA: A brutalist React 18 + TypeScript + Vite PWA. It leverages offline Service Worker caching so it works on the trail without a signal, and taps into native browser APIs (DeviceMotion for step pacing, Web Audio API for solfeggio drone synthesis, and Page Visibility API for tab-switch penalties).&lt;/li&gt;
&lt;li&gt;Context Engines: Integrates Open-Meteo for local solar/weather anchoring to contextualize the AI's grounding advice to the user's immediate physical environment.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;p&gt;Exhale is built on a decoupled, production-grade microservices architecture orchestrated via Render's Infrastructure-as-Code (&lt;code&gt;render.yaml&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│                   CLIENT LAYER (PWA)                   │
│  React 18 + TypeScript + Vite                          │
│  • Service Worker Offline Cache (Zero-Signal Trails)   │
│  • Web Audio API (432Hz Solfeggio Drone Generator)     │
│  • Page Visibility &amp;amp; DeviceMotion APIs                 │
└──────────────────────────┬─────────────────────────────┘
                           │ HTTPS / JSON (Zero Retention)
                           ▼
┌────────────────────────────────────────────────────────┐
│                  BACKEND API (Render)                  │
│  FastAPI + Python 3.13                                 │
│  • Cooperative Cancellation Tokens (HTTP 499 on abort) │
│  • Open-Meteo High-Resolution Weather &amp;amp; Lux Telemetry  │
│  • In-Memory Color/Texture Vision Classifier           │
│  • Auto-Healing 5-Step Normalizer                      │
└──────────────────────────┬─────────────────────────────┘
                           │
                           ▼
┌────────────────────────────────────────────────────────┐
│           3-TIER SOVEREIGN INFERENCE CASCADE           │
│  Tier 1: Sovereign Local Ollama (Nous Hermes 3 8B)     │
│  Tier 2: High-Speed Open-Weight Cloud (Groq LPUs)      │
│  Tier 3: Deterministic In-Memory Neuro-Cultural Engine │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Architectural Resilience: The 3-Tier Sovereign Inference Cascade
&lt;/h2&gt;

&lt;p&gt;A mental health circuit breaker cannot return a &lt;code&gt;502 Bad Gateway&lt;/code&gt;, hang on cold-start timeouts, or display an unhandled exception when someone is having a panic attack. To deliver &lt;strong&gt;100% uptime, zero data retention, and sub-second response times&lt;/strong&gt;, Exhale implements an automated &lt;strong&gt;3-Tier Sovereign Cascade&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    Req["Incoming Distress Input"] --&amp;gt; T1

    subgraph T1 ["Tier 1: Sovereign Local Ollama (Hermes 3)"]
        T1_Check["Check Ollama Daemon (hermes3:latest)"]
        T1_State["Enabled via ENABLE_OLLAMA=true"]
        T1_Exec["Local GPU/CPU Inference (format: json)"]
    end

    T1 --&amp;gt;|"Success"| R1["Return Dynamic Mission (0 Cloud Leakage)"]
    T1 --&amp;gt;|"ENABLE_OLLAMA=false / Timeout / Insufficient RAM"| T2

    subgraph T2 ["Tier 2: Open-Weight Cloud LPUs (Dynamic Auto-Discovery)"]
        T2_Check["GET /v1/models (Real-Time Groq Catalog Discovery)"]
        T2_Exec["Dynamic LPU Execution (Sub-second ~400ms Latency)"]
    end

    T2 --&amp;gt;|"Success"| R2["Return Dynamic Mission (Tier 2 Cloud)"]
    T2 --&amp;gt;|"Network Offline / Key Missing"| T3

    subgraph T3 ["Tier 3: Deterministic In-Memory Neuro-Cultural Engine"]
        T3_Matrix["Compiled Somatic &amp;amp; Weather Adaptation Matrices"]
        T3_Exec["Zero-Dependency Volatile RAM Synthesis (0ms)"]
    end

    T3 --&amp;gt; R3["Return Guaranteed Offline Grounding Protocol (100% Uptime)"]&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  1. Tier 1: Sovereign Local Ollama (Nous Hermes 3 8B)
&lt;/h3&gt;

&lt;p&gt;The primary tier executes open-weight inference locally on bare metal. The raw emotional input is processed through &lt;strong&gt;Nous Hermes 3 8B&lt;/strong&gt;, a model renowned for nuanced steering, alignment, and emotional empathy. Zero bytes ever leave the host machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Tier 2: High-Speed Open-Weight Cloud (Groq LPUs)
&lt;/h3&gt;

&lt;p&gt;If local Ollama is disabled or unreachable, Exhale seamlessly cascades to Tier 2. Rather than hardcoding decommissioned model endpoints, the backend dynamically queries Groq's active model catalog (&lt;code&gt;GET /v1/models&lt;/code&gt;), selects the optimal open-weight model in real time, and completes structured JSON inference in &lt;strong&gt;~400ms&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Tier 3: Deterministic In-Memory Neuro-Cultural Engine
&lt;/h3&gt;

&lt;p&gt;If the network is completely severed or API keys are missing, Tier 3 takes over instantly. Built directly into backend RAM, this deterministic circuit breaker matches distress keywords and weather telemetry against compiled multi-dimensional matrices, generating a clinically grounded, 5-step protocol in &lt;strong&gt;0ms with zero external dependencies&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cooperative Cancellation Token Architecture
&lt;/h3&gt;

&lt;p&gt;If a user closes their tab, clicks "Cancel Generation", or navigates away mid-flight, Exhale avoids wasting compute. A background disconnect watcher monitors the ASGI socket via &lt;code&gt;request.is_disconnected()&lt;/code&gt; and triggers a &lt;code&gt;CancellationTokenSource&lt;/code&gt;. This immediately aborts the active async inference task, frees memory, and returns an HTTP 499 status cleanly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Open-Weight Models &amp;amp; Data Sovereignty Matter
&lt;/h2&gt;

&lt;p&gt;Raw emotional vulnerability is the most sensitive personal data a human being can express. Closed-source commercial AI platforms routinely ingest user prompts into training corpora, logging sensitive mental health admissions on corporate servers.&lt;br&gt;
Exhale proves that &lt;strong&gt;open-source AI is the only ethical foundation for mental health technology&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Absolute Zero Data Retention:&lt;/strong&gt; Exhale has no database. No PostgreSQL, no MongoDB, no Redis, and no analytics trackers. User distress input exists exclusively in volatile RAM for the single inference cycle (~400ms) and is purged immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache-Destruction HTTP Headers:&lt;/strong&gt; Every response is sealed with strict privacy directives:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;   Cache-Control: no-store, no-cache, must-revalidate, max-age=0
   Pragma: no-cache
   Expires: 0
   X-Data-Retention: zero
   X-Circuit-Breaker: engaged
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cryptographic Proof of Purge:&lt;/strong&gt; At the conclusion of each mission, Exhale generates an HTML5 Canvas "Field Log Receipt" stamped with a cryptographic SHA-256 volatile RAM release hash, providing the user visual and mathematical verification that their input was wiped.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Container Memory Challenge: Engineering for Render's Free Tier
&lt;/h2&gt;

&lt;p&gt;Deploying heavy foundation models on cloud infrastructure introduces a classic real-world constraint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Reality of Container Limits:&lt;/strong&gt; Render’s generous Free Tier provides &lt;strong&gt;512 MB of total RAM&lt;/strong&gt;. An open-weight 8B model like Nous Hermes 3 requires ~4.7 GB of disk storage and ≥ 4 GB to 6 GB of RAM to run inference locally. Attempting to run Ollama with Hermes 3 inside a 512 MB container triggers an instant Out-Of-Memory (OOM) kill.
### How We Engineered the Solution:
To deliver a rock-solid, lightning-fast live demo for hackathon judges while preserving full support for self-hosted sovereign hardware:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ENABLE_OLLAMA=false&lt;/code&gt; by Default on Render Free Tier:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;In our startup orchestrator (&lt;code&gt;start.sh&lt;/code&gt;), the local Ollama daemon boot is cleanly bypassed when running on constrained instances.&lt;/li&gt;
&lt;li&gt;Container RAM consumption plummets from ~500 MB down to &lt;strong&gt;~35 MB&lt;/strong&gt; (over &lt;strong&gt;14× below&lt;/strong&gt; Render's memory ceiling).&lt;/li&gt;
&lt;li&gt;Container cold-boot time drops from 3 minutes down to &lt;strong&gt;1.5 seconds&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Cloud LPU Delegation (Tier 2):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;The backend routes the request to Groq's high-speed open-weight LPUs, returning structured 5-step protocols in ~400ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Dependency Fallback (Tier 3):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If unauthenticated or offline, Tier 3 synthesizes tailored protocols in 0ms directly from compiled RAM matrices.
### Activating Tier 1 Hermes 3 Locally (100% Sovereign Mode)
For users running on local workstations, workstations with GPUs, or Render Starter+ instances (≥ 4 GB RAM), switching to 100% self-hosted Hermes 3 takes &lt;strong&gt;a single boolean flag&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repository&lt;/span&gt;
git clone https://github.com/akshara-a/Exhale.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Exhale

&lt;span class="c"&gt;# 2. Toggle the boolean flag to activate Tier 1 Local Hermes 3&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ENABLE_OLLAMA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true
export &lt;/span&gt;&lt;span class="nv"&gt;OLLAMA_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hermes3:latest

&lt;span class="c"&gt;# 3. Launch via Docker Compose or Uvicorn&lt;/span&gt;
docker compose up &lt;span class="nt"&gt;--build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container automatically boots the Ollama daemon, pulls &lt;code&gt;hermes3:latest&lt;/code&gt;, and processes inference 100% on your own hardware with zero data ever leaving your machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;I am entering this project into the following categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best Use of Render: The entire architecture is deployed using a single-click Render Blueprint (render.yaml), utilizing a Render GPU Web Service to host the heavy FastAPI/Ollama backend and a Render Static Site for the React frontend.&lt;/li&gt;
&lt;li&gt;Best Use of Open-Weight Models: Utilizes Hermes 3 8B strictly for its ability to provide private, zero-retention somatic processing without leaking sensitive mental health data to commercial cloud providers.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
