How wataboocolosus/triadees works
Purpose and Entry Points
Tríade Ω is a governed local AI-agent prototype: it runs auditable cognitive cycles, retains scoped memory, performs gated learning, and can operate background workers and experimental federated nodes. Primary CLI and server entry point: triade_digimon.py. The API serves the official React SPA through apps/single_port_app.py; route composition is under apps/routes/. The browser client starts at frontend/src/main.tsx.
Core Cognitive Run
The orchestrated request path is implemented around the central runner and typed contracts: triade/core/runner.py, triade/core/contracts.py, and triade/core/central.py. A run moves from input and signals through memory/context, Crystal regulation, planning, safety, response, persisted artifacts, and verification. triade/core/expression_cortex.py is the presentation boundary: it converts governed internal results into human-facing output rather than exposing raw internal state.
Triadic State and Memory Boundary
Central cognition is modulated by the hypothalamus and Bodega memory/context layers: triade/core/hypothalamus.py, triade/core/bodega_global_context.py, and triade/core/crystal.py. SQLite is the operational persistence layer, with schema evolution in triade/memory/migrations/ and semantic retrieval/storage in triade/memory/semantic_store.py and triade/memory/semantic_search.py. Memory confidence, scope, provenance, identity continuity, and semantic-governance rules form a hard boundary: candidate/experimental content is not stable truth by default.
Governance, Safety, and Evidence
Actions and outputs pass policy, permission, coherence, safety, and verification controls: triade/core/safety.py, triade/core/permission_governor.py, and triade/core/verification.py. Runtime execution adds durable task status, leases, receipts, and recovery through triade/runtime/governed_task_executor.py, triade/runtime/task_leases.py, and triade/runtime/runtime_recovery.py. Sensitive operations are intended to be blocked, sandboxed, or human-approved rather than executed directly.
Learning and Neuron Lifecycle
Learning is a gated pipeline rather than direct memory mutation: candidate discovery/evidence progresses through validation and production injection in triade/learning/pipeline.py, triade/learning/evidence_bridge.py, and triade/learning/validation.py. Specialized “neurons” are designed, evaluated, trained, certified, and lifecycle-managed by triade/neuron_factory/lifecycle.py, triade/neuron_factory/evaluation.py, and triade/core/neuron_registry.py. Regression and rollback protection are separate release gates in triade/regression/gate.py and triade/regression/rollback.py.
Always-On Runtime and Model Layer
Background operation uses supervised workers, queues, scheduling, concurrency, and watchdogs: triade/workers/worker_loop.py, triade/workers/worker_supervisor.py, and triade/runtime/watchdog.py. Resource policies can degrade execution mode rather than stop safe observation; resource control resides in triade/core/resource_governor.py. Ollama is the recommended local inference and embedding service, routed by triade/models/model_router.py and accessed via triade/models/ollama_client.py; safe fallback exists but has reduced cognitive/learning claims.
External Surfaces and Deployment
The public/API boundary includes route modules such as apps/routes/api.py, apps/routes/knowledge.py, and apps/routes/health.py; dashboard endpoints are read-only by design. Federation is an authorization- and evidence-gated private-node subsystem, not established distributed production: triade/federation/dispatch.py, triade/federation/evidence_gate.py, and triade/federation/registry.py. An Android edge node can preprocess locally and relay work via android/triade-node/app/src/main/java/local/triade/node/TriadeNodeService.java and android/triade-node/app/src/main/java/local/triade/node/RelayClient.java. Deployment targets include Docker/Compose, systemd units, Caddy, and cloud manifests in compose.cloud.yml, deploy/systemd/, and render.yaml.
Components 21
Interfaces
- CLI & server entry
triade_digimon.py - SPA server & route composition
apps/single_port_app.py - Public API routes · Includes API, knowledge, health, and read-only dashboard surfaces.
- React SPA
frontend/src/main.tsx
Cognitive Core
- Governed cognitive runner
triade/core/runner.py - Typed run contracts
triade/core/contracts.py - Central cognition
triade/core/central.py - Triadic state & context · Hypothalamus, Crystal regulation, and Bodega context modulate each run.
triade/core/hypothalamus.py - Expression cortex · Converts governed results into human-facing output.
triade/core/expression_cortex.py
Memory & Evidence
- Scoped semantic memory · Applies confidence, scope, provenance, identity, and semantic-governance boundaries.
triade/memory/semantic_store.py - SQLite operational persistence · Schema evolution is maintained under migrations.
Governance & Runtime
- Policy, permission & safety · Sensitive operations are blocked, sandboxed, or human-approved.
triade/core/safety.py - Verification
triade/core/verification.py - Governed task execution · Tracks task status, leases, receipts, and recovery.
triade/runtime/governed_task_executor.py - Supervised workers · Runs queued and scheduled work under supervision and watchdogs.
triade/workers/worker_supervisor.py - Local model routing · Routes Ollama inference and embeddings; fallback has reduced claims.
triade/models/model_router.py
Learning & Neurons
- Gated learning pipeline · Candidate evidence is validated before production injection.
triade/learning/pipeline.py - Neuron lifecycle & registry · Designs, evaluates, trains, certifies, and manages specialized neurons.
triade/neuron_factory/lifecycle.py - Regression & rollback gates
triade/regression/gate.py
Federation & Edge
- Private federation · Authorization- and evidence-gated; not established distributed production.
triade/federation/dispatch.py - Android edge relay · Preprocesses locally and relays work.
android/triade-node/app/src/main/java/local/triade/node/TriadeNodeService.java
Connections 24
- CLI & server entry → SPA server & route composition: starts
- SPA server & route composition → Public API routes: mounts
- React SPA → Public API routes: calls
- Public API routes → Governed cognitive runner: submits requests
- Governed cognitive runner → Typed run contracts: uses
- Governed cognitive runner → Central cognition: orchestrates
- Central cognition → Triadic state & context: reads regulation/context
- Triadic state & context → Scoped semantic memory: retrieves scoped memory
- Scoped semantic memory → SQLite operational persistence: persists
- Central cognition → Local model routing: requests inference
- Central cognition → Policy, permission & safety: gates plans/actions
- Policy, permission & safety → Verification: requires evidence
- Verification → Expression cortex: approves result
- Expression cortex → Public API routes: returns governed output
- Policy, permission & safety → Governed task execution: authorizes execution
- Governed task execution → SQLite operational persistence: stores receipts/status
- Supervised workers → Governed task execution: runs durable work
- Gated learning pipeline → Scoped semantic memory: injects validated knowledge
- Gated learning pipeline → Neuron lifecycle & registry: produces specializations
- Neuron lifecycle & registry → Regression & rollback gates: requires release approval
- Regression & rollback gates → Scoped semantic memory: permits production changes
- Private federation → Verification: evidence-gated
- Private federation → Governed task execution: dispatches approved work
- Android edge relay → Private federation: relays work