# qbitOS ecosystem map → KBatch Shadow Live

How **DAC · GlueLam · Prefixes · stenoSTRIP · IronLine · preflight · bridge · engine · T5/T6 · ugrad** relate to this dictionary / Shadow Live surface.

**Where it lives (CF / GitHub / X):** → **[WHERE-IT-LIVES.md](./WHERE-IT-LIVES.md)**

Upstream sources:

- [quantum-gutter](https://mueee.qbitos.ai/quantum-gutter.html) · [kbatch](https://mueee.qbitos.ai/kbatch.html)
- [qbitOS](https://github.com/qbitOS/) · [uvspeed](https://github.com/qbitOS/uvspeed)
- [qbitos-gluelam](https://github.com/qbitOS/qbitos-gluelam) · [qbitos-iron-line](https://github.com/qbitOS/qbitos-iron-line) · [ugrad](https://github.com/qbitOS/ugrad)

---

## One-sentence stack

| Concept | One sentence |
|--------|----------------|
| **Prefixes** | 11 structural symbols (`{n,+1,-n,+0,0,-1,+n,+2,-0,+3,1}`) that classify every line of code (and, in kbatch, structural units of text) across 17–59 languages. |
| **GlueLam** | *Single source of truth* for those modules: load `quantum-prefixes.js` / DAC / steno / preflight **once**, never fork classifiers into each app. |
| **DAC** (`qbit-dac.js`) | Dimensional / track layer: stripes, complexity, unified **`.qbit` codec** — prefixes become durable codec tracks, not just gutter labels. |
| **stenoSTRIP** (`qbit-steno.js` / `js/steno-strip.js`) | Steganographic strip: 13 Unicode spaces, ~19 bits/line — invisible routing / weight / cortical history. **Write coins** = visible glyphs spent; **blank coins** = allotable steno bits for other use. Tool totals: ASCII / hex / binary / utf8. |
| **pcap/image bridge** (`js/pcap-image-bridge.js`) | GrokYtalkY-aligned path: blank payload → GYST-like packets · Cursor-Grok Forge watermark (`cgf:`) · hexlum 13² lattice stamp · IronLine/`gy-stream` broadcast for packet streams. |
| **Engine** | The actual classifier implementations: browser JS regex, **T5-native** Rust byte-dispatch, WASM, optional ML ONNX. |
| **T5 / T6** | **T5** = zero-alloc native speed path (`t5.rs`, ~3.2 ns/line). **T6** = next rung (planned / R-stair toward cortical / hardware-class throughput). |
| **IronLine** | **L0–L7** pipeline + `BroadcastChannel('iron-line')` bus + cortical loop budgets — *where* work runs and how apps talk. |
| **Cortical loop** (`js/cortical-loop.js`) | **3–5s budget** for spoken/uttered/thought-like path: L0–L3 fast (&lt;80ms) · L4–L7 idle (stack · crossref · persona · publish). Neuralink-*class latency goal*, not hardware claim. |
| **Tool stack** (`js/tool-stack.js`) | Every section stacks Prefixes · DAC · GlueLam · steno · IronLine · t5+/WASM · multi-runtime export (JSON/JAX/Python/C++26/Tokio/Tree-sitter/Walker/REPL/MCP). |
| **Persona / SpaceXAI** (`js/persona-suggest.js`) | Auto-suggest from register meta · speech packs · geometric shadows · host-injected SpaceXAI packs. |
| **Lazy loader** (`js/lazy-loader.js`) | Progressive letter shards · idle heavy work · no full 1.69M block on first paint. |
| **preflight** | Gate before expensive / external action (esp. IBM QPU): qubit budget, depth, measures → **GO / WARN / ABORT**. |
| **bridge** | Adapters that move payloads across worlds: typing→QASM, IronLine→composer, kbatch→search, QPU submit, Overview pipe. |
| **ugrad** (μgrad) | Host domain + R0–R6 staircase (micrograd → μcortical): training, arenas, gameHUB, compliance, deploy surface. |
| **Shadow Live (this repo)** | **Language geometry runtime**: type once → physical key path → 15-layout shadows + RSI/a11y — the *word* side of the same multi-lane OS. |
| **Bindings** (`bindings/`) | Host adapters for Python · C++26 · Tokio/Rust · WASM stub — bulk LLM/MCP/tensor cross-ref. |
| **Quantum gutter** (`js/quantum-gutter.js` + `vendor/gluelam/`) | 11-symbol prefix fold-through on code **and** speech rails — not only mueee editors. |
| **Mesh / NFC / terminal** (`js/mesh-bus.js` · `js/terminal-lane.js`) | Multi-device knowledge: freya · gy-stream · NFC invite · Freya-style REPL. No single device is the only gate. |
| **Cache / PWA** (`js/cache-bust.js` · `sw.js`) | Build-stamped assets · network-first shell · offline letter shards. |

See also: [MESH-ACCESS.md](./MESH-ACCESS.md).

---

## Mental model: two twin geometries

```
                    ┌─────────────────────────────────────┐
                    │           ugrad.ai host              │
                    │   compliance · deploy · R-staircase  │
                    └─────────────────┬───────────────────┘
                                      │
         ┌────────────────────────────┼────────────────────────────┐
         │                            │                            │
         ▼                            ▼                            ▼
   CODE GEOMETRY                LANGUAGE GEOMETRY              ACTION /
   (quantum gutter)             (kbatch / this dict)           HARDWARE
         │                            │                            │
   Prefixes 11-sym              Key path · 15 layouts         preflight
         │                            │                            │
   DAC tracks /.qbit            Shadow Live · RSI strip       QPU / DAW
         │                            │                            │
   stenoSTRIP embed             braille/Morse/NATO/DDR        IronLine L*
         │                            │                            │
   T5 engine classify           CapsuleAnalyzer · corpus      bridges
```

- **Code geometry** answers: *what kind of line is this structurally?*  
- **Language geometry** answers: *what physical keys / hands / scripts does this string occupy?*  
- **IronLine + bridges** answer: *who hears it, at what layer budget, and is it safe to fire?*

They are **not** competing features. GlueLam says they share modules; IronLine says they share a bus.

---

## Canonical data flow (Gluelam order)

Compliance / Iron Line contract:

```
raw text / code
    → Prefixes (classify)
    → DAC (tracks · stripes · .qbit codec)
    → stenoSTRIP (embed / carry side-channel)
    → IronLine bus (L0–L7 + BroadcastChannel)
    → bridges (QPU · DAW · Overview · search · spatial)
    → preflight (before paid / irreversible hardware)
    → engine backends (T5 native · WASM · JS fallback · IBM)
```

**Shadow Live inserts parallel to “classify” on the language rail:**

```
typed string
    → pathBase (QWERTY / active board)
    → 15-layout shadow ring
    → CapsuleAnalyzer metrics (RSI, home-row, travel)
    → a11y encodings
    → [optional] Prefixes if string is code
    → [optional] steno embed caption_out
    → IronLine publish (kbatch-training / quantum-loopback)
    → preflight if → QPU
```

---

## IronLine layers — where this repo sits

| Layer | Name | This project’s role |
|-------|------|---------------------|
| L0 | Super Speed Terminal | Optional steno-term consumer of dictionary API |
| L1 | Terminal + Search | Geometry-first **Shadow Search** (next product layer) |
| L2 | Commander | Agent: “rephrase for lower RSI” / layout switch |
| L3 | Quantum Terminal | Typing path / prefix dist → QASM (bridge to gutter) |
| **L4** | **Notepad / Everything** | **Home for kbatch + Shadow Live + dictionary** |
| L5 | RNDR + Data | Layout Lab heatmaps, spatial/gsplat glyph clouds |
| L6 | Research / Medical | Phonation · scholar · Freya units later |
| L7 | Security / Persona | Register spectrum, mother-tongue, compliance |

Shadow Live is correctly an **L4 surface** with L3 quantum and L1 search as next edges.

---

## Engines: T5 vs T6 vs browser

| Path | Speed class | Used for |
|------|-------------|----------|
| **pre-computed** | 0 ns at runtime | `data/analyzed/*` 234k shadow packs |
| **T5-native** (Rust) | ~3 ns/line | Prefix classify, CLI, Tauri sidecar |
| **server Rust** | ~90 ns/line | API batch |
| **WASM** | ~300 ns/line | Fast browser without install |
| **JS regex** | ~250 ns+/line | Everywhere fallback (gutter, PWAs) |
| **T6** | next rung | Cortical / multi-bus / hardware-class pipeline (do not invent a second T5 in this repo) |

**Dictionary rule:** keep geometric analysis in JS (CapsuleAnalyzer) for now; when prefixing *code* or *transcripts*, **call shared modules** — do not reimplement the 11 symbols here.

---

## Concept atoms (steno engine) ↔ language stepping

Quantum gutter’s **53 concept atoms / steno meaning table** and this app’s **language-stepping** (origins → mother tongue → slang) are the same idea at different scales:

| Steno / gutter | Shadow Live / dictionary |
|----------------|---------------------------|
| Concept atom | Lemma / token |
| Frequency / solfeggio | Rhythm BPM · DDR flow |
| Compression ratio | Shadow readability · clipping/shorthand register |
| Cross-language atom map | Mother-tongue chips + stepping paths |
| Capsule `words[]` | Corpus letter shards + analyzed packs |

**Do not merge UIs.** Share **export shapes** (`caption_out`, envelope JSON, BroadcastChannel payloads).

---

## Bus channels (what to publish from Shadow Live)

| Channel | Payload from this app |
|---------|------------------------|
| `kbatch-training` | RSI, efficiency, layout rank, shadow ring summary |
| `quantum-loopback` | Path → gate angles (when quantum bridge on) |
| `iron-line` | Layer telemetry: `{ layer: "L4", app: "kbatch-dict", event: "shadow-live" }` |
| `hexterm` | Keystroke / strip updates if terminal open |
| `quantum-prefixes` | Only when analyzing code cells, not plain prose |

---

## preflight — when it matters here

preflight is **not** for every keystroke. Use it when Shadow Live / Writer would:

1. Submit a circuit to IBM / paid backend  
2. Export a large job to IronLine `/v1/jobs`  
3. Push a spatial/DAW stream that costs GPU time  

GO / WARN / ABORT gates: qubit count, depth, measurements — already stubbed in mueee `qbit-preflight.js`.

---

## What not to stack next (ecosystem edition)

| Avoid | Why |
|-------|-----|
| Forking `quantum-prefixes` into this repo | Violates GlueLam |
| Building a second IronLine bus | Use `BroadcastChannel('iron-line')` |
| Full OED senses before bus publish | Geometry-first product still holds |
| “T6 engine” rewrite of CapsuleAnalyzer | Wrong layer; T5 owns code classify |
| Absorbing all of kbatch.html into the dictionary SPA | Keep L4 surfaces modular; bridge instead |

---

## Integration order 1–7 (status in this repo)

| # | Layer | Status | Module / surface |
|---|--------|--------|------------------|
| 1 | Shadow Live | **Shipped** | `js/shadow-live.js` · `#shadow-live` |
| 2 | GlueLam consumer | **Shipped** | `js/gluelam-consumer.js` (stubs + optional load) |
| 3 | IronLine publish | **Shipped** | `js/ironline-bus.js` |
| 4 | Quantum bridge + preflight | **Shipped** | `js/quantum-bridge.js` |
| 5 | Shadow Search | **Shipped** | `js/shadow-search.js` |
| 6 | ugrad host | **Docs + wrangler** | `docs/HOSTING.md` · `wrangler.toml` → deploy CF |
| 7 | Spatial / aito hooks | **Shipped** | `js/spatial-hooks.js` · bus payload |

**Design principle home:** `docs/WHERE-IT-LIVES.md` + envelope `designPrinciple` + `kbatchDict.corpus.livesAt()`.

---

## Ownership matrix

| Concern | Owner repo / module |
|---------|---------------------|
| Prefix symbols + languages | uvspeed `web/quantum-prefixes.js` + `crates/prefix-engine` / T5 |
| DAC / .qbit | uvspeed `web/qbit-dac.js` |
| stenoSTRIP | uvspeed `web/qbit-steno.js` |
| preflight | uvspeed / mueee `qbit-preflight.js` |
| IronLine L0–L7 + bus | qbitos-iron-line + uvspeed |
| GlueLam contract | qbitos-gluelam |
| ugrad host / R-stair | qbitOS/ugrad · ugrad-r0 |
| Multi-layout word geometry + 234k index | **this repo** (`layouts`, `capsule-analyzer`, `shadow-live`, `data/analyzed`) |
| Full kbatch PWA tabs | mueee `kbatch.html` / qbitos-kbatch |

---

## Design principle (glulam metaphor)

> Glued laminated timber is stronger because **aligned layers** share load.  
> Aligned **JS + Rust + PWAs** sharing one classifier beat forked copies that drift.  
> Shadow Live is one more lamina: **aligned language geometry**, not a parallel OS.

When in doubt: **consume upstream, publish on IronLine, preflight before hardware, ship daily type→path→shadows.**
