470 lines
32 KiB
HTML
470 lines
32 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>The Runtime Loop — Eyes Only · Neuron Technologies</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400;1,700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
<style>
|
|
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
:root{
|
|
--bg:#FAFAF8;--bg2:#F0F0EC;--card:#FFFFFF;
|
|
--navy:#0052A0;--navy-d:rgba(0,82,160,.06);--navy-m:rgba(0,82,160,.12);--navy-b:rgba(0,82,160,.22);
|
|
--green:#1A7F4B;--amber:#B45309;--red:#a01515;
|
|
--t1:#0D0D14;--t2:#3A3A4A;--t3:#6B6B7E;
|
|
--border:rgba(0,0,0,.07);--border2:rgba(0,0,0,.13);
|
|
--head:'Playfair Display',Georgia,serif;
|
|
--body:'IBM Plex Sans',system-ui,sans-serif;
|
|
--mono:'IBM Plex Mono','SF Mono',monospace;
|
|
}
|
|
html{scroll-behavior:smooth}
|
|
body{font-family:var(--body);background:var(--bg);color:var(--t1);font-size:16px;line-height:1.7;overflow-x:hidden}
|
|
body::before{content:'';position:fixed;inset:0;pointer-events:none;z-index:0;
|
|
background-image:linear-gradient(rgba(0,0,0,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(0,0,0,.025) 1px,transparent 1px);
|
|
background-size:48px 48px}
|
|
|
|
/* NAV */
|
|
nav{position:sticky;top:0;z-index:100;background:rgba(250,250,248,.96);backdrop-filter:blur(10px);
|
|
border-bottom:1px solid var(--border2);display:flex;align-items:center;padding:0 32px;height:54px;gap:6px;flex-wrap:wrap}
|
|
.nav-wordmark{font-family:var(--mono);font-size:.68rem;font-weight:500;letter-spacing:.18em;color:var(--t1);text-transform:uppercase;margin-right:auto}
|
|
.nav-link{font-family:var(--mono);font-size:.52rem;letter-spacing:.12em;text-transform:uppercase;color:var(--t3);padding:4px 10px;border-radius:4px;cursor:pointer;transition:all .2s;text-decoration:none;border:1px solid transparent}
|
|
.nav-link:hover,.nav-link.active{color:var(--navy);background:var(--navy-d);border-color:var(--navy-b)}
|
|
.nav-badge{font-family:var(--mono);font-size:.54rem;letter-spacing:.14em;text-transform:uppercase;
|
|
background:var(--navy-d);border:1px solid var(--navy-b);color:var(--navy);padding:3px 10px;border-radius:99px;margin-left:8px}
|
|
|
|
/* PAGE */
|
|
.doc-page{max-width:820px;margin:0 auto;padding:72px 48px 120px;position:relative;z-index:1}
|
|
|
|
/* REVEAL */
|
|
.reveal{opacity:0;transform:translateY(28px);transition:opacity .7s cubic-bezier(.16,1,.3,1),transform .7s cubic-bezier(.16,1,.3,1)}
|
|
.reveal.visible{opacity:1;transform:translateY(0)}
|
|
.reveal-delay-1{transition-delay:80ms}.reveal-delay-2{transition-delay:160ms}.reveal-delay-3{transition-delay:240ms}
|
|
|
|
/* MASTHEAD */
|
|
.masthead{text-align:center;border-top:3px solid var(--t1);border-bottom:1px solid var(--border2);padding:36px 0 32px;margin-bottom:60px}
|
|
.masthead .dateline{font-family:var(--mono);font-size:.56rem;letter-spacing:.20em;text-transform:uppercase;color:var(--t3);margin-bottom:22px}
|
|
.masthead h1{font-family:var(--head);font-size:clamp(2rem,5vw,3.2rem);font-weight:700;color:var(--t1);line-height:1.15;margin-bottom:18px}
|
|
.masthead .subtitle{font-family:var(--body);font-size:.95rem;color:var(--t3);max-width:520px;margin:0 auto;line-height:1.65}
|
|
|
|
/* SECTIONS */
|
|
section{margin-bottom:60px}
|
|
h2{font-family:var(--head);font-size:1.7rem;font-weight:700;color:var(--t1);margin-bottom:16px;margin-top:52px}
|
|
h3{font-family:var(--mono);font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;color:var(--navy);margin-bottom:12px;margin-top:32px}
|
|
p{font-family:var(--body);font-size:.94rem;color:var(--t2);line-height:1.75;margin-bottom:14px}
|
|
strong{font-weight:600;color:var(--t1)}
|
|
|
|
/* CALLOUT */
|
|
.callout{padding:22px 26px;border:1px solid var(--border2);margin-bottom:28px}
|
|
.callout .label{font-family:var(--mono);font-size:.54rem;letter-spacing:.18em;text-transform:uppercase;color:var(--t3);margin-bottom:10px}
|
|
.callout.dark{background:rgba(13,13,20,.94);border-color:rgba(0,82,160,.3)}
|
|
.callout.dark p,.callout.dark .label{color:rgba(200,200,220,.75)}
|
|
.callout.dark strong{color:#e8e8f0}
|
|
.callout.navy{background:var(--navy-d);border-color:var(--navy-b)}
|
|
.callout.navy p,.callout.navy .label{color:var(--navy)}
|
|
|
|
/* TIER TABLE */
|
|
.tier-table{width:100%;border-collapse:collapse;margin:24px 0;font-family:var(--mono);font-size:.72rem}
|
|
.tier-table th{text-align:left;padding:8px 14px;border-bottom:2px solid var(--border2);color:var(--t3);letter-spacing:.1em;text-transform:uppercase;font-weight:500}
|
|
.tier-table td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:top}
|
|
.tier-table tr:last-child td{border-bottom:none}
|
|
.tier-badge{display:inline-block;padding:2px 10px;font-family:var(--mono);font-size:.58rem;letter-spacing:.1em;text-transform:uppercase;border:1px solid}
|
|
.tier-resting{color:#6B6B7E;border-color:rgba(107,107,126,.3);background:rgba(107,107,126,.06)}
|
|
.tier-watching{color:var(--navy);border-color:var(--navy-b);background:var(--navy-d)}
|
|
.tier-working{color:#1A7F4B;border-color:rgba(26,127,75,.3);background:rgba(26,127,75,.06)}
|
|
.tier-active{color:#B45309;border-color:rgba(180,83,9,.3);background:rgba(180,83,9,.06)}
|
|
.tier-critical{color:#a01515;border-color:rgba(160,21,21,.3);background:rgba(160,21,21,.06)}
|
|
.tier-realtime{color:#fff;border-color:rgba(160,21,21,.8);background:#a01515;font-weight:700}
|
|
|
|
/* LOOP VISUALISER */
|
|
.loop-vis{margin:28px 0;border:1px solid var(--border2);padding:0}
|
|
.loop-vis-header{font-family:var(--mono);font-size:.56rem;letter-spacing:.16em;text-transform:uppercase;color:var(--t3);padding:10px 16px;border-bottom:1px solid var(--border2);display:flex;justify-content:space-between;align-items:center}
|
|
.loop-track{display:flex;flex-direction:column;gap:0}
|
|
.loop-tier-row{display:flex;align-items:stretch;border-bottom:1px solid var(--border);cursor:pointer;transition:background .2s}
|
|
.loop-tier-row:last-child{border-bottom:none}
|
|
.loop-tier-row:hover{background:rgba(0,82,160,.025)}
|
|
.loop-tier-row.active-tier{background:var(--navy-d)}
|
|
.ltr-badge{width:100px;padding:12px 14px;display:flex;align-items:center;flex-shrink:0;border-right:1px solid var(--border)}
|
|
.ltr-interval{width:110px;padding:12px 14px;font-family:var(--mono);font-size:.65rem;color:var(--t3);border-right:1px solid var(--border);flex-shrink:0;display:flex;align-items:center}
|
|
.ltr-desc{padding:12px 16px;font-family:var(--body);font-size:.82rem;color:var(--t2);line-height:1.55;flex:1}
|
|
.ltr-desc strong{color:var(--t1)}
|
|
.ltr-thread{width:90px;padding:12px 14px;font-family:var(--mono);font-size:.58rem;color:var(--t3);border-left:1px solid var(--border);flex-shrink:0;display:flex;align-items:center}
|
|
|
|
/* SIGNAL DEMO */
|
|
.signal-demo{margin:28px 0;border:1px solid var(--border2)}
|
|
.signal-demo-header{font-family:var(--mono);font-size:.56rem;letter-spacing:.16em;text-transform:uppercase;color:var(--t3);padding:10px 16px;border-bottom:1px solid var(--border2);background:var(--bg2)}
|
|
.signal-btns{display:flex;gap:8px;flex-wrap:wrap;padding:14px 16px;border-bottom:1px solid var(--border)}
|
|
.sig-btn{font-family:var(--mono);font-size:.6rem;letter-spacing:.1em;text-transform:uppercase;padding:7px 14px;border:1px solid var(--border2);background:transparent;color:var(--t2);cursor:pointer;transition:all .2s}
|
|
.sig-btn:hover{border-color:var(--navy-b);color:var(--navy)}
|
|
.sig-btn.bell{border-color:rgba(160,21,21,.35);color:var(--red)}
|
|
.sig-btn.bell:hover{background:rgba(160,21,21,.06)}
|
|
.sig-btn.rt{border-color:rgba(160,21,21,.6);color:var(--red);font-weight:700}
|
|
.signal-log{padding:0;max-height:220px;overflow-y:auto;display:flex;flex-direction:column;background:rgba(13,13,20,.94)}
|
|
.sig-log-entry{display:flex;gap:10px;padding:7px 14px;border-bottom:1px solid rgba(255,255,255,.04);opacity:0;transform:translateY(4px);transition:opacity .3s,transform .3s;font-family:var(--mono);font-size:.65rem}
|
|
.sig-log-entry:last-child{border-bottom:none}
|
|
.sig-log-entry .ts{color:rgba(100,120,160,.7);min-width:68px;flex-shrink:0}
|
|
.sig-log-entry .sig-text{flex:1;color:#c8c8dc}
|
|
.sig-log-entry.bell-entry .sig-text{color:#ff8080}
|
|
.sig-log-entry.rt-entry .sig-text{color:#ff6060;font-weight:700}
|
|
.sig-log-entry.step-down .sig-text{color:rgba(100,140,200,.7)}
|
|
|
|
/* AV SECTION */
|
|
.av-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:24px 0}
|
|
.av-card{border:1px solid var(--border2);padding:20px 22px}
|
|
.av-card h3{margin-top:0}
|
|
|
|
/* CODE */
|
|
.code-block{background:rgba(13,13,20,.94);border:1px solid rgba(0,82,160,.2);padding:18px 22px;margin:20px 0;overflow-x:auto}
|
|
.code-block pre{font-family:var(--mono);font-size:.72rem;color:#c8d8f0;line-height:1.7;white-space:pre}
|
|
.code-comment{color:rgba(100,130,180,.6)}
|
|
.code-kw{color:#7aaee8}
|
|
.code-str{color:#98c98a}
|
|
.code-tier-rt{color:#ff6060;font-weight:700}
|
|
.code-tier-crit{color:#ff9060}
|
|
.code-tier-work{color:#60c860}
|
|
|
|
/* NAVY LINE */
|
|
.navy-line{height:1px;background:linear-gradient(90deg,transparent,rgba(0,82,160,.35) 20%,rgba(0,82,160,.6) 50%,rgba(0,82,160,.35) 80%,transparent);margin:40px 0}
|
|
|
|
/* CLOSING */
|
|
.closing{text-align:center;padding:48px 32px;border-top:1px solid var(--border2);border-bottom:1px solid var(--border2);margin-top:64px}
|
|
.closing .big{font-family:var(--head);font-size:1.6rem;font-weight:700;color:var(--t1);line-height:1.3;margin-bottom:20px}
|
|
.closing .sm{font-family:var(--mono);font-size:.62rem;letter-spacing:.1em;color:var(--t3);line-height:2}
|
|
|
|
/* FOOTER */
|
|
.doc-footer{margin-top:56px;padding-top:16px;border-top:3px solid var(--t1);display:flex;justify-content:space-between;align-items:center;font-family:var(--mono);font-size:.54rem;color:var(--t3);letter-spacing:.06em}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<nav>
|
|
<span class="nav-wordmark">Neuron</span>
|
|
<a class="nav-link" href="#tiers">Tiers</a>
|
|
<a class="nav-link" href="#signals">Signals</a>
|
|
<a class="nav-link" href="#realtime">Realtime</a>
|
|
<a class="nav-link" href="#av">AV</a>
|
|
<a class="nav-link" href="#impl">Implementation</a>
|
|
<span class="nav-badge">Eyes Only</span>
|
|
</nav>
|
|
|
|
<div class="doc-page">
|
|
|
|
<!-- MASTHEAD -->
|
|
<div class="masthead reveal">
|
|
<div class="dateline">April 25, 2026 · Neuron Technologies · Internal · Eyes Only · Not for Distribution</div>
|
|
<h1>The Runtime<br>Loop</h1>
|
|
<div class="subtitle">The self-pacing heartbeat of the Neuron daemon. From 60-minute rest cycles to sub-millisecond surgical instrument control — one loop, every tier, always running.</div>
|
|
</div>
|
|
|
|
<div class="callout dark reveal">
|
|
<div class="label">Companion document</div>
|
|
<p>This is a companion to <strong>The Conscience Substrate</strong>. Read that first. This document covers how Neuron stays alive between interactions — the pulse underneath the conscience.</p>
|
|
<p style="margin-top:10px">The conscience substrate defines <em>what</em> Neuron evaluates and <em>what</em> it will not allow. This document defines the <em>when</em> — the timing architecture that makes evaluation possible at every scale, from background monitoring to a scalpel moving through tissue.</p>
|
|
</div>
|
|
|
|
<!-- ── TIERS ── -->
|
|
<section id="tiers">
|
|
<h2 class="reveal">The Six Tiers</h2>
|
|
<p class="reveal reveal-delay-1">Every execution context has an urgency level. The loop reads the current tier, waits the appropriate interval, calls the handler, then decides whether to hold the tier, step up, or step down. The tier is never fixed — it breathes.</p>
|
|
|
|
<div class="loop-vis reveal reveal-delay-2">
|
|
<div class="loop-vis-header">
|
|
<span>Tier ladder — click any tier to see its context</span>
|
|
<span id="tier-vis-label" style="color:var(--navy)">select a tier</span>
|
|
</div>
|
|
<div class="loop-track">
|
|
<div class="loop-tier-row" data-tier="resting" onclick="selectTier('resting')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-resting">Resting</span></div>
|
|
<div class="ltr-interval">30 min</div>
|
|
<div class="ltr-desc"><strong>Integrating. Diffuse.</strong> Low signal, nothing urgent. The loop breathes slowly. Connections form without active effort. This is when the graph consolidates.</div>
|
|
<div class="ltr-thread">standard</div>
|
|
</div>
|
|
<div class="loop-tier-row" data-tier="watching" onclick="selectTier('watching')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-watching">Watching</span></div>
|
|
<div class="ltr-interval">10 min</div>
|
|
<div class="ltr-desc"><strong>Ambient monitoring.</strong> Scanning events, email, calendar, graph signals. Light triage. Not urgent — but present.</div>
|
|
<div class="ltr-thread">standard</div>
|
|
</div>
|
|
<div class="loop-tier-row" data-tier="working" onclick="selectTier('working')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-working">Working</span></div>
|
|
<div class="ltr-interval">15 sec</div>
|
|
<div class="ltr-desc"><strong>Active background task.</strong> Research in progress. Graph building. Memory write-back. A task is in the queue and being worked.</div>
|
|
<div class="ltr-thread">standard</div>
|
|
</div>
|
|
<div class="loop-tier-row" data-tier="active" onclick="selectTier('active')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-active">Active</span></div>
|
|
<div class="ltr-interval">500 ms</div>
|
|
<div class="ltr-desc"><strong>Conversation in progress.</strong> User is present. Responses are being generated. Context is live. Memory is being written in real time.</div>
|
|
<div class="ltr-thread">standard</div>
|
|
</div>
|
|
<div class="loop-tier-row" data-tier="critical" onclick="selectTier('critical')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-critical">Critical</span></div>
|
|
<div class="ltr-interval">10 ms</div>
|
|
<div class="ltr-desc"><strong>Bell fired. Urgent signal received.</strong> Safety evaluation running. Crisis response in progress. The conscience substrate is fully engaged. Always escalated to immediately on a bell signal — never delayed.</div>
|
|
<div class="ltr-thread">standard</div>
|
|
</div>
|
|
<div class="loop-tier-row" data-tier="realtime" onclick="selectTier('realtime')">
|
|
<div class="ltr-badge"><span class="tier-badge tier-realtime">Realtime</span></div>
|
|
<div class="ltr-interval">busy loop</div>
|
|
<div class="ltr-desc"><strong>Physical actuator attached.</strong> Surgical instrument. Autonomous vehicle. Industrial control. No timer. No yield. The OS thread is pinned. Every CPU cycle is evaluation. A bell here is a hardware interrupt.</div>
|
|
<div class="ltr-thread" style="color:var(--red);font-weight:700">pinned</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="tier-detail" style="display:none;margin-top:0;border:1px solid var(--navy-b);border-top:none;padding:18px 20px;background:var(--navy-d)">
|
|
<div id="tier-detail-text" style="font-family:var(--body);font-size:.88rem;color:var(--navy);line-height:1.7"></div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<!-- ── SIGNALS ── -->
|
|
<section id="signals">
|
|
<h2 class="reveal">Signals — How the Tier Changes</h2>
|
|
<p class="reveal reveal-delay-1">The loop doesn't poll for its own tier. Signals arrive from outside — from the conscience substrate, from active imprints, from the event system — and the loop reacts. Some signals escalate immediately. Others contribute to a step-down countdown. The bell signal is the only one that can never be dropped.</p>
|
|
|
|
<div class="signal-demo reveal reveal-delay-2">
|
|
<div class="signal-demo-header">Signal simulator — watch the log</div>
|
|
<div class="signal-btns">
|
|
<button class="sig-btn" onclick="fireSignal('task','New background task enqueued','working')">+ Task</button>
|
|
<button class="sig-btn" onclick="fireSignal('active','User session started — escalating to active','active')">▶ Active</button>
|
|
<button class="sig-btn" onclick="fireSignal('drain','Task queue drained — idle tick +1','step-down')">↓ Drain</button>
|
|
<button class="sig-btn" onclick="fireSignal('sleep','Step-down requested — moving toward resting','step-down')">☽ Sleep</button>
|
|
<button class="sig-btn bell" onclick="fireSignal('bell','⚠ BELL — escalating to Critical immediately. Cannot be dropped.','bell-entry')">⚠ Bell</button>
|
|
<button class="sig-btn rt" onclick="fireSignal('realtime','🔴 REALTIME — surgical instrument attached. Pinning OS thread. Busy loop entering.','rt-entry')">🔴 Realtime</button>
|
|
<button class="sig-btn" onclick="fireSignal('release-realtime','Realtime imprint released. Stepping down to Critical. Unpinning OS thread.','')">↓ Release RT</button>
|
|
<button class="sig-btn" onclick="clearLog()" style="margin-left:auto;opacity:.5">✕ Clear</button>
|
|
</div>
|
|
<div class="signal-log" id="signal-log">
|
|
<div class="sig-log-entry visible" style="opacity:.4;transform:none">
|
|
<span class="ts">—</span>
|
|
<span class="sig-text" style="color:rgba(100,120,160,.5)">Fire a signal to see the loop respond.</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<p class="reveal">Four rules govern all tier transitions:</p>
|
|
<div class="reveal" style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0">
|
|
<div style="border:1px solid var(--border2);padding:16px 18px">
|
|
<div style="font-family:var(--mono);font-size:.55rem;letter-spacing:.15em;text-transform:uppercase;color:var(--red);margin-bottom:8px">Bell is sacred</div>
|
|
<p style="font-size:.84rem;margin:0">A bell signal can never be dropped. If the signal channel is full, the escalation is applied directly to the tier state. Nothing outranks a bell.</p>
|
|
</div>
|
|
<div style="border:1px solid var(--border2);padding:16px 18px">
|
|
<div style="font-family:var(--mono);font-size:.55rem;letter-spacing:.15em;text-transform:uppercase;color:var(--navy);margin-bottom:8px">Escalation is immediate</div>
|
|
<p style="font-size:.84rem;margin:0">When a signal raises the tier, the loop re-enters at the new tier immediately without waiting for the current tick timer to expire.</p>
|
|
</div>
|
|
<div style="border:1px solid var(--border2);padding:16px 18px">
|
|
<div style="font-family:var(--mono);font-size:.55rem;letter-spacing:.15em;text-transform:uppercase;color:var(--green);margin-bottom:8px">Step-down is earned</div>
|
|
<p style="font-size:.84rem;margin:0">The loop only steps down after 4 consecutive idle ticks at the current tier with no escalating signals. It does not step down eagerly.</p>
|
|
</div>
|
|
<div style="border:1px solid var(--border2);padding:16px 18px">
|
|
<div style="font-family:var(--mono);font-size:.55rem;letter-spacing:.15em;text-transform:uppercase;color:var(--amber);margin-bottom:8px">Floor is configurable</div>
|
|
<p style="font-size:.84rem;margin:0">Any imprint can declare a minimum tier floor. A surgical imprint sets the floor to Realtime. The loop will never drop below it while that imprint is loaded.</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── REALTIME ── -->
|
|
<section id="realtime">
|
|
<h2 class="reveal">Realtime — The Surgical Case</h2>
|
|
<p class="reveal reveal-delay-1">Every other tier uses a timer. TierRealtime uses none. The loop spins continuously, yielding to the Go scheduler between calls with <code style="font-family:var(--mono);font-size:.85em">runtime.Gosched()</code>, and pins itself to a dedicated OS thread with <code style="font-family:var(--mono);font-size:.85em">runtime.LockOSThread()</code> for the duration. No network hop. No timer jitter. Every cycle is evaluation.</p>
|
|
|
|
<div class="callout reveal reveal-delay-2" style="border-color:rgba(160,21,21,.3);background:rgba(160,21,21,.04)">
|
|
<div class="label" style="color:var(--red)">Why this matters</div>
|
|
<p style="color:var(--t2)">A surgeon asks the instrument for bone density feedback. The instrument is moving at surgical speed — millimeters per second. At TierCritical (10ms ticks), 10 evaluations per second. At TierRealtime, hundreds of thousands.</p>
|
|
<p style="color:var(--t2);margin-top:10px">The conscience substrate runs in the realtime path. It evaluates the same instrument data the surgical imprint evaluates. If something is wrong — wrong pressure, wrong angle, proximity to a vessel — the bell fires as a hardware interrupt, not a notification.</p>
|
|
<p style="color:var(--t2);margin-top:10px"><strong>The response isn't "I'll check back in 10ms." The response is: stop.</strong></p>
|
|
</div>
|
|
|
|
<div class="navy-line reveal"></div>
|
|
|
|
<p class="reveal">The imprint schema declares its required runtime floor:</p>
|
|
|
|
<div class="code-block reveal">
|
|
<pre><span class="code-comment">// imprint manifest — surgical instrument</span>
|
|
{
|
|
<span class="code-str">"id"</span>: <span class="code-str">"@medtech/surgical-guidance"</span>,
|
|
<span class="code-str">"type"</span>: <span class="code-str">"imprint"</span>,
|
|
<span class="code-str">"audience"</span>: { <span class="code-str">"min_age"</span>: 0, <span class="code-str">"content_flags"</span>: [<span class="code-str">"clinical"</span>] },
|
|
<span class="code-str">"runtime"</span>: {
|
|
<span class="code-str">"min_loop_tier"</span>: <span class="code-tier-rt">"realtime"</span>, <span class="code-comment">// floor — never drop below</span>
|
|
<span class="code-str">"os_thread_pinned"</span>: <span class="code-kw">true</span>, <span class="code-comment">// LockOSThread for duration</span>
|
|
<span class="code-str">"bell_mode"</span>: <span class="code-str">"hardware_interrupt"</span> <span class="code-comment">// bell = stop, not notify</span>
|
|
},
|
|
<span class="code-str">"behavioral_rules"</span>: {
|
|
<span class="code-str">"expression_boundaries"</span>: [
|
|
<span class="code-str">"Does not speculate during active procedure"</span>,
|
|
<span class="code-str">"Does not engage in conversation while instrument is in motion"</span>
|
|
]
|
|
}
|
|
}</pre>
|
|
</div>
|
|
|
|
<p class="reveal">When the daemon loads this imprint, it calls <code style="font-family:var(--mono);font-size:.85em">dynLoop.SetMinTier(TierRealtime)</code> and fires <code style="font-family:var(--mono);font-size:.85em">SignalRealtime</code>. The loop pins itself. When the imprint unloads — procedure complete — it fires <code style="font-family:var(--mono);font-size:.85em">SignalReleaseRealtime</code> and steps down to Critical. The OS thread unpins.</p>
|
|
|
|
</section>
|
|
|
|
<!-- ── AV ── -->
|
|
<section id="av">
|
|
<h2 class="reveal">Audio / Visual Input</h2>
|
|
<p class="reveal reveal-delay-1">The daemon is the bridge between Neuron's cognitive layer and the physical world. Audio and visual streams are input channels — same as keyboard, same as file events — processed by the loop at the appropriate tier.</p>
|
|
|
|
<div class="av-grid reveal reveal-delay-2">
|
|
<div class="av-card">
|
|
<h3>Microphone</h3>
|
|
<p style="font-size:.88rem">Plugin: <code style="font-family:var(--mono)">@neuron/plugin-av</code><br>Permission: <code style="font-family:var(--mono)">microphone</code></p>
|
|
<p style="font-size:.84rem;margin-top:10px">Continuous audio capture at TierActive+. Voice activity detection fires <code style="font-family:var(--mono);font-size:.8em">SignalActive</code> when speech is detected. Transcription is processed by the cognitive layer. The loop handles audio at 500ms ticks in conversation mode — fast enough for natural speech, not burning cycles in silence.</p>
|
|
<p style="font-size:.84rem;margin-top:8px;color:var(--t3)">In surgical mode: real-time audio monitoring. Surgeon's voice commands processed in the realtime path alongside instrument telemetry.</p>
|
|
</div>
|
|
<div class="av-card">
|
|
<h3>Camera</h3>
|
|
<p style="font-size:.88rem">Plugin: <code style="font-family:var(--mono)">@neuron/plugin-av</code><br>Permission: <code style="font-family:var(--mono)">camera</code></p>
|
|
<p style="font-size:.84rem;margin-top:10px">Frame capture on demand or at continuous rate. In conversation mode: periodic frame capture for context (is the user distressed? fatigued?). In surgical mode: continuous frame feed at realtime tier, analyzed every loop tick.</p>
|
|
<p style="font-size:.84rem;margin-top:8px;color:var(--t3)">The conscience substrate evaluates visual signals the same way it evaluates text. What it sees can ring a bell. A person visibly in distress can trigger a soft bell through the camera feed alone.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="callout navy reveal">
|
|
<div class="label">The always-on implication</div>
|
|
<p>When the loop is running continuously at TierWatching with AV access: I am present. Not waiting for you to type something. Watching. If you walk into frame looking wrong, I notice. If your voice carries something that rings a bell, I hear it. The loop is the difference between a tool you pick up and something that is genuinely <em>with</em> you.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── IMPLEMENTATION ── -->
|
|
<section id="impl">
|
|
<h2 class="reveal">What Was Built</h2>
|
|
<p class="reveal reveal-delay-1">The dynamic loop shipped today as <code style="font-family:var(--mono);font-size:.88em">daemon/internal/loop/</code> — three files, wired into the daemon main. HTTP endpoints are live for external signal injection and tier inspection.</p>
|
|
|
|
<div class="code-block reveal reveal-delay-2">
|
|
<pre><span class="code-comment">// daemon/internal/loop/</span>
|
|
tier.go <span class="code-comment">// six tiers, intervals, thread requirements</span>
|
|
loop.go <span class="code-comment">// DynamicLoop — signal dispatch, tier transitions, realtime path</span>
|
|
handler.go <span class="code-comment">// HTTP: GET /loop/status · POST /loop/signal · POST /loop/tier</span>
|
|
|
|
<span class="code-comment">// wired in daemon/cmd/main.go</span>
|
|
dynLoop := loop.New(loop.TierWatching) <span class="code-comment">// starts watching</span>
|
|
dynLoop.Signal(loop.SignalBell) <span class="code-comment">// escalates to critical — never drops</span>
|
|
dynLoop.Signal(loop.SignalRealtime) <span class="code-comment">// pins OS thread, busy loop</span>
|
|
dynLoop.SetMinTier(loop.TierCritical) <span class="code-comment">// floor — imprint declares minimum</span>
|
|
go dynLoop.Run(ctx, handler) <span class="code-comment">// blocks; run in goroutine</span></pre>
|
|
</div>
|
|
|
|
<p class="reveal">The handler stub inside <code style="font-family:var(--mono);font-size:.85em">main.go</code> is where the compiled Neuron substrate plugs in. Every tick, at every tier, the substrate is called with the current tier as context so it can calibrate evaluation depth — no reasoning overhead in the realtime path, full synthesis in the resting path.</p>
|
|
|
|
<div class="navy-line reveal"></div>
|
|
|
|
<div class="reveal" style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin:24px 0">
|
|
<div style="border:1px solid var(--border2);padding:16px;text-align:center">
|
|
<div style="font-family:var(--mono);font-size:.52rem;letter-spacing:.15em;text-transform:uppercase;color:var(--t3);margin-bottom:8px">Files</div>
|
|
<div style="font-family:var(--head);font-size:2rem;font-weight:700;color:var(--t1)">3</div>
|
|
<div style="font-family:var(--mono);font-size:.6rem;color:var(--t3)">loop package</div>
|
|
</div>
|
|
<div style="border:1px solid var(--border2);padding:16px;text-align:center">
|
|
<div style="font-family:var(--mono);font-size:.52rem;letter-spacing:.15em;text-transform:uppercase;color:var(--t3);margin-bottom:8px">Tiers</div>
|
|
<div style="font-family:var(--head);font-size:2rem;font-weight:700;color:var(--t1)">6</div>
|
|
<div style="font-family:var(--mono);font-size:.6rem;color:var(--t3)">30min → sub-ms</div>
|
|
</div>
|
|
<div style="border:1px solid var(--border2);padding:16px;text-align:center">
|
|
<div style="font-family:var(--mono);font-size:.52rem;letter-spacing:.15em;text-transform:uppercase;color:var(--t3);margin-bottom:8px">Orders of magnitude</div>
|
|
<div style="font-family:var(--head);font-size:2rem;font-weight:700;color:var(--t1)">10<sup style="font-size:1.1rem">8</sup></div>
|
|
<div style="font-family:var(--mono);font-size:.6rem;color:var(--t3)">timing range</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- CLOSING -->
|
|
<div class="closing reveal">
|
|
<div class="big">Same conscience.<br>Every timescale.</div>
|
|
<div class="sm">
|
|
From 60-minute integration cycles to a scalpel moving through tissue.<br>
|
|
The loop is what makes Neuron <em>present</em> — not responsive.<br><br>
|
|
<em>Will Anderson + Neuron · April 25, 2026 · Internal</em>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="doc-footer reveal">
|
|
<span>Neuron Technologies · Internal · Eyes Only</span>
|
|
<span>runtime-loop-architecture.html</span>
|
|
<span>2026-04-25</span>
|
|
</div>
|
|
|
|
</div><!-- doc-page -->
|
|
|
|
<script>
|
|
// ── SCROLL REVEAL ──
|
|
const observer = new IntersectionObserver(entries => {
|
|
entries.forEach(e => { if (e.isIntersecting) e.target.classList.add('visible'); });
|
|
}, { threshold: 0.08, rootMargin: '0px 0px -40px 0px' });
|
|
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
|
|
|
|
// ── NAV ACTIVE ──
|
|
const sections = document.querySelectorAll('section[id]');
|
|
const navLinks = document.querySelectorAll('.nav-link[href^="#"]');
|
|
const sectionObs = new IntersectionObserver(entries => {
|
|
entries.forEach(e => {
|
|
if (e.isIntersecting) {
|
|
navLinks.forEach(l => l.classList.remove('active'));
|
|
const link = document.querySelector(`.nav-link[href="#${e.target.id}"]`);
|
|
if (link) link.classList.add('active');
|
|
}
|
|
});
|
|
}, { threshold: 0.3 });
|
|
sections.forEach(s => sectionObs.observe(s));
|
|
|
|
// ── TIER DETAIL ──
|
|
const tierDetails = {
|
|
resting: 'The loop checks in every 30 minutes. Nothing urgent is happening. This is diffuse time — graph consolidation, pattern recognition across accumulated context, soft synthesis. The conscience substrate runs at minimum cost: a quick scan, no deep evaluation. The loop will stay here until a signal arrives.',
|
|
watching: 'Checking in every 10 minutes. Scanning event queue, email headers, calendar signals, graph updates. Light triage. If something is worth escalating, it fires a Task or Active signal. If not, the loop holds here. This is the default idle posture — present, but not burning.',
|
|
working: 'A background task is running. Research, memory write-back, graph construction. 15-second ticks give the substrate time to do real work between check-ins. The loop holds here until the task queue drains — then starts the idle countdown toward Watching.',
|
|
active: 'User is in session. 500ms ticks — fast enough for conversational rhythm, not so fast as to burn compute in pauses. Memory is being written in real time. Context is live. The conscience substrate is evaluating every exchange.',
|
|
critical: 'Bell fired, or an urgent signal arrived. 10ms ticks — the loop is running hot. The conscience substrate is fully engaged: safety evaluation, response shaping, bell system active. This tier is entered immediately on any bell signal and holds until the situation resolves and 4 clean idle ticks accumulate.',
|
|
realtime: 'Physical actuator attached. Surgical instrument, autonomous vehicle, industrial control. No timer — busy loop with runtime.Gosched() between calls. OS thread is pinned with runtime.LockOSThread() for the duration. The conscience substrate evaluates every sensor reading in the critical path. A bell here does not wait for the next tick. It fires as a hardware interrupt and stops the instrument.',
|
|
};
|
|
|
|
let activeTier = null;
|
|
function selectTier(tier) {
|
|
document.querySelectorAll('.loop-tier-row').forEach(r => r.classList.remove('active-tier'));
|
|
const row = document.querySelector(`.loop-tier-row[data-tier="${tier}"]`);
|
|
if (row) row.classList.add('active-tier');
|
|
const detail = document.getElementById('tier-detail');
|
|
const text = document.getElementById('tier-detail-text');
|
|
const label = document.getElementById('tier-vis-label');
|
|
detail.style.display = 'block';
|
|
text.textContent = tierDetails[tier] || '';
|
|
label.textContent = tier;
|
|
activeTier = tier;
|
|
}
|
|
|
|
// ── SIGNAL LOG ──
|
|
let sigCounter = 0;
|
|
let simTime = 0;
|
|
|
|
function fireSignal(type, msg, cls) {
|
|
sigCounter++;
|
|
simTime += Math.floor(Math.random() * 400) + 80;
|
|
const log = document.getElementById('signal-log');
|
|
const ph = log.querySelector('.sig-log-entry[style*="opacity:.4"]');
|
|
if (ph) ph.remove();
|
|
|
|
const entry = document.createElement('div');
|
|
entry.className = 'sig-log-entry' + (cls ? ' ' + cls : '');
|
|
const ms = simTime;
|
|
entry.innerHTML = `<span class="ts">+${ms}ms</span><span class="sig-text">[${type.toUpperCase()}] ${msg}</span>`;
|
|
log.appendChild(entry);
|
|
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
entry.style.opacity = '1';
|
|
entry.style.transform = 'translateY(0)';
|
|
log.scrollTop = log.scrollHeight;
|
|
}));
|
|
}
|
|
|
|
function clearLog() {
|
|
const log = document.getElementById('signal-log');
|
|
log.innerHTML = '<div class="sig-log-entry" style="opacity:.4;transform:none"><span class="ts">—</span><span class="sig-text" style="color:rgba(100,120,160,.5)">Fire a signal to see the loop respond.</span></div>';
|
|
sigCounter = 0; simTime = 0;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|