Attachments forums

Re: 🖥️ Creating your own HomeLAB for trading

xard777, Sun Jul 19, 2026 5:56 am

FACTORY-03 v4.0 — Knowledge-Split Restart Manifest
Executive Summary

v4.0 delivers the Factory's memory architecture — a three-tier knowledge plane that decouples governance from semantic search, with strict LLM-free zones and a sovereign inference substrate.
Core Doctrine

Inference thinks. Rust executes. Python governs. SQLite commits. Vectors rebuildable.

Tier Technology Role LLM Access
Cortex Architect + Overwatch Constitutional review, soak gates, Factory reports Deliberate only
Spinal Cord Python Supervisor Treasury, veto, INBOX routing, state machines Bounded/rare
Agent Harness Rust (Tokio) Tool I/O, workspace scan, pre-clipped JSON → INBOX Ornith only if task needs language
Inference Ornith (llama-server) Token generation — $0/token on-box Local tokens
Reflex Arc Rust execution_agent/ RiskCap SHM, reflex cmd, sub-µs safety None
Memory Cold SQLite WAL Commit point for truth N/A
Memory Warm Qdrant HNSW + TurboQuant 4-bit Meaning search at scale Embed only
Memory Hot turbovec/in-process memory Session/recent window Embed only
Architecture: Two Commit Planes
Governance Plane — consensus.db

Treasury ticks, RSIL findings, birth certs, archives

Supervisor audit, federation state, anomaly journals

No embedding columns, no vector blobs, no "search by meaning"

Write path stays constitutional and transactional

Knowledge Plane — factory_knowledge.db

Canonical knowledge rows + embed_outbox

content_hash UNIQUE — dedupe at the door

Soft delete (deleted=1) — never silent hard-delete

One writer: the single KnowledgeStore instance

Semantic Plane — Qdrant/turbovec/memory

Point ID == SQLite rowid (no mapping table)

Collection: factory_knowledge_{model_slug}_{dim}

Model pin: ollama/nomic-embed-text/dim 768

Embed input cap: 8 KB deterministic clip

Ghost-point law: backend points with no live SQLite row = invalid

LLM-Free Zones (Manifest Law — Expanded)

The following must NOT call an LLM on the hot path:

Reflex arc (execution_agent/, RiskCap, reflex command channel)

Novelty/TRIT-CLIP clip evaluation

Treasury state machine transitions

Archive revival/SpawnBundle seed apply

Pre-clipped JSON collection and INBOX admit path

KnowledgeStore put() commit path — SQLite only; embed is async worker

Soft-delete + reconcile bookkeeping

Parity checkpoints (parity())

Allowed LLM/embed use:

Embed: Knowledge outbox worker → Ollama nomic-embed-text (pinned)

Local chat: Bounded CodeSage/harness tool loop when language required → :8080

Cortex/Factory report: Deliberate Overwatch-style summary, Architect ratification — never on 5s tick critical path

Performance Doctrine — Three Orders of Magnitude
Metric Old (v3.8) v4.0 Improvement
Knowledge put() commit ~0.6 ms (empty) ~0.04 ms ~15×
Tick on 129 GB DB ~3–5 s Not worsened (split) Dual-plane
LLM calls per tick Ambient Zero By law

Burn-in baseline (2026-07-18):

put() latency: mean 0.15 ms · p95 0.14 ms · max 6.6 ms

Outbox depth: peak=1 (turnstile, not backlog)

Drain lag at stop: ~0.0001 s

Parity: 600/600 OK · failed embeds 0

Ship Day Gates — All Green ✅
Rung Focus Status
9.0 Knowledge plane live ✅
9.1 Feed/INBOX → put() ✅
9.2 Live embed path ✅
9.3 Qdrant warm promotion ✅
9.4 Semantic recall (read path) Pending
9.5 Factory report cortex path Pending
9.6 72h dual-DB soak Pending
9.7 Batch embed drain (v4.x) Pending
9.8 Governance DB archival Pending
9.9 Knowledge retention/archival Pending

Qdrant warm tier certification (2026-07-18):

TurboQuant bits4 ✅ verified

7200/7200 parity ✅

Outbox peak: 2 vs control 1 (no measurable overhead)

--interval 0.5 same pace as control

Attribution by subtraction: Δ ≈ 0

Standing Rules (Doctrine Locked)

SQLite is the only commit point for each plane it owns

One writer per knowledge plane — all writes through KnowledgeStore

Embedding model is pinned — bump = new collection + rebuild + alias flip

parity() must match at every soak checkpoint; drift halts investigation

Backend is rebuildable — worst case: drop collection, embedded=0, reconcile()

memory/turbovec first is legal — promote to Qdrant by evidence, not hype

LLM-free zones are law (§2) — cortex report is deliberate, not ambient

v3.8 immune law still binds — veto thresholds are calibrated

Reliability before speed — parity checkpoints beat throughput vanity

put() is the waited latency — never reintroduce embed/vector I/O onto commit path

Governance history is a separate problem — Rung 9.8 for 129 GB archive

Producer topology is law — out-of-process = INBOX only; no direct DB writes

Clean slate before every Qdrant soak — recreate collection, pin image, verify quant

Truncation is deterministic, never silent — full-content hash always; clipped=1 flag

Knowledge backup = SQLite file — vector snapshots optional; index is rebuildable

Qdrant binds loopback — wider bind requires API key in config

Architecture Wins — Cheaper Than Combined Parts
Cost What We Cut How v4.0 Does It
Money Cloud/chatty LLM API tokens Pre-clipped JSON, local Ornith only when language required, archive revival, report-tier LLM only
Latency Hot-path wall-clock Rust reflex + harness; no SQLite write stampede on meaning search
Attention Debug churn, SLOW_TICK storms Split governance DB vs knowledge DB; deterministic LLM-free zones
Sovereignty External runtime dependency Local Ornith, local Qdrant optional, dual-DB metabolism

Practical rule: Does this change remove an LLM call, a false state transition, a re-evolution tax, or a write-lock on the hot path? If not, justify it.
Path Forward

Semantic recall (Rung 9.4): Architect/report/L9 can search() without touching consensus.db write hot path

Batch embed drain (Rung 9.7): 32–64 items per /api/embed call → hundreds/s vs ~50/s

Governance archive (Rung 9.8): 129 GB class history → revival-class mechanics

Knowledge retention (Rung 9.9): Age-out policy for factory_knowledge.db → archive files, vectors deleted, parity baseline adjusted

Closing

v3.8 proved the Factory can survive and veto with a sovereign immune layer and a Rust reflex.
v4.0 makes the Factory remember by meaning without choking on a single SQLite, and speaks to LLMs only when the cortex decides.

Board: 9.0 ✅ 9.1 ✅ 9.2 ✅ dessert ✅ 9.3 ✅ — warm tier certified; default still memory.
Next: Rung 9.4 semantic recall.

FACTORY-03-v4.0-MANIFEST — 2026-07-18 · rev D + dessert + Rung 9.3 green · restart canon
Build Agent Checklist

KnowledgeStore module + offline soak green

Docker compose for Qdrant + requirements file

v4.0 manifest written; v3.8 marked superseded

Wire KnowledgeStore into supervisor lifecycle

Feed path: test_news_feed.py + news_rss.py → put()

Live Ollama embed soak ≥1h with parity (248/248, 24/24 checkpoints)

Burn-in dessert (5 min, memory+ollama) — metrics filed

Rev D landmine fix: §8.3 recreate + image pin + quant verify

Qdrant warm-tier soak ≥1h (7200/7200 · TurboQuant bits4 · peak outbox 2)

Semantic search() available to Architect report/L9

Factory report path documented: single deliberate LLM call site

72h dual-plane soak (Rung 9.6) with halt-on-parity-drift

Batch embed drain 32–64 (Rung 9.7) — when archive bulk-ingest needs it

Governance consensus.db archival plan (Rung 9.8) — 129 GB history

Knowledge retention job (Rung 9.9) per §3.7

Paying it forward. 🚀

— XARD777
All files in topic