← all documents · raw markdown · 13 KB

ORACLE-OS-GUEST-NODE-FEDERATION-GOAL.md

| | |
|---|---|
| Status | P0+P1 shipped (v9.10.267); P2+P3+P4 v0 shipped (v9.10.268). Not full internet-scale mesh. |
| Author | kai-engineer (owner vision, 2026-07-10) |
| Scope | Multi-tenant CLOUD Oracle-OS: a stripped "guest view", a KAI node federation so separate fleets share knowledge in real time, and rolling LoRA maintenance windows that fold new data into the existing model. |
| Relationship to existing tracks | Extends ORACLE-OS-ROLE-SEPARATION-GOAL.md (Track F), RELEASE-READINESS.md, KAI-MEMORY-SCALEOUT-GOAL.md, RSHL-LLM-TRAINING-READINESS.md (§6-7), and the training/cloud-bitnet/ finetuner. This is NOT a KAIVERSE task and touches none of the flight controls/pacer. |

---

The vision (as the owner described it)

Oracle-OS will eventually run in the cloud. Other people create an account and get a secondary "guest view" — a duplicate of the Oracle-OS dashboard with all admin secrets and server info stripped out. A guest only sees their own machine's data in the dashboard *when they are hosting a KAI node*.

A node = a KAI process that connects, from an external machine, into another person's Fleet Command Center (the host enables it). This lets KAI gain knowledge across areas/fleets in real time, so the AIs in the system get smarter from many sources. Users will *feel* the difference over time because the info is current and reinforced by many people's feedback loops on the same/related topics.

Model upkeep happens on weekly LoRA fine-tuning "maintenance windows", scheduled per the time zone the server runs in (like scheduled maintenance). This updates the current model(s) instead of retraining from scratch — the old version is carried forward into the new one via LoRA, not thrown away.

---

What already exists vs. what's greenfield (grounded in the repo)

Workstream A — Guest view / role separation · ~60% designed & partly coded

There is already a real owner/admin/member/viewer model, so the "guest view" is an *extension*, not a from-scratch build.

Workstream B — Nodes / federation · Greenfield (does not exist)

There is no peer-to-peer / node / cross-fleet networking today. Everything is local or an outbound client to a cloud LLM API.

Workstream C — Cross-node knowledge reinforcement · Single-node reinforcement exists; cross-node aggregation is new

The "reinforced by many people's feedback loops" mechanism partly exists — but only within one machine.

Workstream D — LoRA maintenance windows · Real machinery exists; scheduler + one correction needed

> ⚠️ Correction the owner should know: LoRA does NOT apply to the RSHL lattice. KAI's core RSHL lattice is genuinely non-transformer with zero neural weights (SparseVec::encode is a fixed hash — not differentiable, "you cannot backprop the lattice"). A LoRA can only apply to the BitNet/LLM "brain" module (src/cognition/bitnet_llama.rs, mounted when KAI_NATIVE_BRAIN=1) — the optional language model, not the memory substrate. So the plan is: the lattice keeps reinforcing itself (Workstream C, already real); its consolidated memory becomes the replay/training data for a weekly LoRA on the BitNet brain (Workstream D). Two different mechanisms, and that's the correct design per the readiness docs.

---

Security model (the part you get one chance to get right)

A cloud, multi-tenant, federated system inverts KAI's current trust assumptions (today it trusts its own box). Non-negotiables:

1. Server-side redaction, always. The guest view must be a *different server response*, not the same data hidden with CSS. Guests never receive admin tokens, .env-derived config, host telemetry, logs, transcripts of other tenants, or control endpoints. Enforce on every endpoint by role (close the /api/system-stats / /api/logs / /api/tests leaks first).

2. Tenant data isolation. "Their machine's data only" means every read is scoped to the caller's tenant/node ID at the query layer — not filtered client-side. A guest hosting a node sees *their* node's telemetry; never another tenant's.

3. Node authentication + authorization. A node joining someone's command center needs a mutual handshake (issued node credential, not a shared secret), an explicit host enable/allow step, capability scoping (what a node may read/share), rate limits, and instant revocation.

4. Federated-knowledge trust. Incoming knowledge from external nodes must be treated as untrusted: provenance-tagged, quarantined, consensus/again-seen-weighted before it can reinforce anything, and never able to overwrite owner-verified beliefs. Poisoning/spam defense is a first-class requirement, not an afterthought.

5. Secrets never leave the owner's machine. Per the existing hard rule — the guest/cloud path must be architected so tools/oracle-discord/.env values are never serializable into any tenant-facing response or node exchange.

---

Phased plan (each phase flag-gated, reversible, independently shippable)

P0 — Guest-view hardening (extends existing Track F; no federation needed; safe to start now).

Close the server-side read leaks: role-filter /api/system-stats, /api/logs, /api/tests; guarantee a guest response contains no host/admin fields. Add a "cloud guest" role tier below viewer. Deliverable: a guest can log in and see a sanitized dashboard with zero server/admin info. Verifiable by diffing owner vs. guest API responses.

P1 — Multi-tenant account + data scoping.

Real accounts (the registry already exists), tenant IDs, and query-layer scoping so a tenant only ever reads their own data. Still single-server; no nodes yet. This is the backbone the guest view needs to be true multi-tenant.

P2 — Node protocol v0 (the big one).

Design + build the node handshake and transport: a KAI process on machine B authenticates into machine A's command center (host must explicitly enable it), with credentialed auth, capability scoping, heartbeat, and revocation. Start read-only (a node can register + report *its own* telemetry to the host it joined) before any knowledge write. This is greenfield and the security-critical core — design doc + threat model before code.

P3 — Federated knowledge exchange.

On top of P2: nodes share *consolidated, provenance-tagged* knowledge. Incoming knowledge is quarantined and only reinforces via the existing cosine-gated / survival-count machinery once corroborated. Add feedback-loop weighting across nodes with poisoning defenses. This is where "users feel it get smarter over time" becomes real.

P4 — Weekly per-timezone LoRA maintenance windows.

Wire the auto_finetuner.py skeleton's TODOs (merge/requantize/hot-swap), add a scheduler keyed to the server's time zone with a weekly cadence, feeding lattice-consolidated replay data (Workstream C) into an eval-gated LoRA on the BitNet brain (Workstream D), with versioned rollback. Old model → new model via adapter, never a from-scratch retrain.

Suggested order: P0 → P1 → P2 → P3 → P4. P0/P1 are low-risk extensions of shipped code and deliver a usable sanitized guest view early. P2/P3 are the ambitious, security-heavy, multi-month greenfield. P4 can proceed in parallel with P1-P3 since its machinery is separate.

---

Honest feasibility

This is a major, multi-month architecture — realistically the biggest single initiative in the project — not a quick build. The good news: ~half of it has scaffolding already (roles, hashed tokens, per-user memory, error-weighted reinforcement, a real LoRA finetuner + continual-update skeleton, and a written plan for the nightly-window model). The genuinely hard, genuinely new parts are B (node federation) and its security/trust model — those are greenfield and must be designed carefully before any code, because a mistake there leaks one person's machine/secrets to another. Compute-wise the guest/cloud/dashboard side is light; the LoRA windows need a real GPU on the cloud host (the docs already assume cloud pretrain + home adapt).

Costs / dependencies to decide before building

Not done here (per convention)

Investigation + plan only. No shipped code edited, no restart, no version bump. Building starts with P0 (guest-view server-side redaction) once you confirm — it's the safe, high-value first slice and needs no federation.