How wdeldaybytebuster/bytebuster-neurosyncos works
1. Overall shape
NeuroSync Sovereign OS is a local, TypeScript-based control system with three main planes: a Hono server API, a React/Vite UI, and a set of core orchestration services under src/core. Runtime state is persisted in a local SQLite database in .data/, alongside a master key for crypto-backed storage.
2. Persistence and security boundary: BaseVault
src/core/basevault is the system’s storage foundation. It owns the SQLite schema, DB access, crypto, auth, and a write queue to serialize persistence operations. Other subsystems depend on this layer for durable state rather than talking to storage directly.
3. Execution boundary: CoreExec
src/core/coreexec is the task/DAG execution engine. It includes DAG validation, scheduler, worker pool, sandbox, dispatch, queueing, path validation, and memory sweep logic. This is the main “do work” subsystem and is clearly separated from routing/governance concerns.
4. Model governance and routing: RouteSwitch
src/core/routeswitch decides which model/provider should handle a request and how much autonomy is allowed. Its internal pieces include governor, council, triage, interceptor, router, discovery, and engine. Provider adapters target both OpenAI-compatible endpoints and llama.cpp, so model access is provider-agnostic.
5. Task intake and safety: ScopeLogic
src/core/scopelogic handles structured intake, validation, and risk handling for requests before they are executed. It contains interview, validator, schemas, and risk modules. Architecturally, this is the “policy gate” that constrains what gets promoted into execution or routing.
6. Background daemon and source sync: ScoutDaemon
src/core/scoutdaemon is the always-on background layer. It provides SSE streaming, idle detection, DB sync, parsing, and a GitNexus worker integration. This subsystem bridges filesystem/project activity into the rest of the OS and pushes live updates outward.
7. Analysis and adaptive routing: ScoutLogic
src/core/scoutlogic provides higher-level classification and benchmarking via classifier, dynamic router, and benchmarker modules. It appears to support system adaptation: determining how projects/tasks should be interpreted and which path they should follow through the OS.
8. Long-term memory: Cerebro
src/core/memory/cerebro is the memory subsystem, with vector retrieval, reflection, and habituation. It is the system’s persistence-backed learning/memory layer and likely feeds both decision-making and user-facing memory views.
9. API gateway
src/server/index.ts is the HTTP entrypoint, and src/server/routes exposes subsystem-facing endpoints such as cerebro, coreexec-router, llm, models, projects, scheduler-list, system, and todos. The server is the integration layer that turns internal services into consumable APIs for the UI and external callers.
10. UI as operational cockpit
src/ui is not a generic app shell; it is an operations dashboard for the OS. There are dedicated views for BaseVault, Cerebro, CoreExec, RouteSwitch, ScopeLogic, ScoutDaemon, and a UnifiedMasterDashboard. Components like approval queues, autonomy dials, routing dials, run history, and health widgets indicate the UI is meant for supervising and intervening in system behavior, not just displaying data.
11. Cross-cutting data flow
Typical flow is: intake in the UI or API → policy/risk gating in ScopeLogic → model routing in RouteSwitch or classification in ScoutLogic → execution in CoreExec → persistence through BaseVault → live status streamed via ScoutDaemon/SSE back to the UI. Memory updates in Cerebro can influence future routing and responses, while BaseVault provides the durable source of truth.
12. Tooling and governance layer
The docs/ tree is unusually important: it contains the architecture reference, operating rules, phase plans, schemas, and review templates. This documentation is treated as a living control plane for implementation decisions, while scripts/, tests, and the grammar files support validation of DAG behavior, crypto, and end-to-end flows.
Main entry points: routes Routes · engine.ts Engine · db.ts DB Access · router.ts Router
Components 31
Foundation
Persistence, crypto, and durable state boundary
- Schema · SQLite schema and data model for durable state
src/core/basevault/schema.ts - DB Access · Database access layer for local persistence
src/core/basevault/db.ts - Crypto · Crypto-backed storage and key handling
src/core/basevault/crypto.ts - Write Queue · Serializes write operations into storage
src/core/basevault/write-queue.ts
Execution
Task DAG execution and worker runtime
- Engine · Orchestrates execution of task graphs
src/core/coreexec/engine.ts - DAG Validation · Validates task graphs before execution
src/core/coreexec/validateDAG.ts - Scheduler · Plans and orders runnable work
src/core/coreexec/scheduler.ts - Worker Pool · Executes tasks in managed workers
src/core/coreexec/worker-pool.ts - Sandbox · Constrains task execution environment
src/core/coreexec/sandbox.ts
Governance
Policy, routing, and adaptive decision layers
- Governor · Controls allowed autonomy and request posture
src/core/routeswitch/governor.ts - Council · Aggregates routing and governance signals
src/core/routeswitch/council.ts - Router · Selects provider path for requests
src/core/routeswitch/router.ts - Adapters · Provider-specific integrations for model endpoints
src/core/routeswitch/adapters/openai-compatible.ts - Validator · Validates structured intake before execution
src/core/scopelogic/validator.ts - Interview · Collects and shapes user intent
src/core/scopelogic/interview.ts - Classifier · Classifies project/task intent and context
src/core/scoutlogic/classifier.ts - Dynamic Router · Adapts routing based on analysis signals
src/core/scoutlogic/dynamic-router.ts - Vector Memory · Vector-based retrieval and stored context
src/core/memory/cerebro/vector.ts - Reflection · Creates reflective memory and higher-level recall
src/core/memory/cerebro/reflection.ts
Ops
Background daemon and system telemetry
- SSE Stream · Streams daemon status and live events
src/core/scoutdaemon/sse.ts - DB Sync · Synchronizes daemon activity with durable state
src/core/scoutdaemon/db-sync.ts - GitNexus Worker · Integration worker for repository/project activity
src/core/scoutdaemon/gitnexus-worker.ts
API
HTTP entrypoints and subsystem routes
UI
Operational dashboard and control surfaces
- Master Dashboard · Unified operational cockpit for the OS
src/ui/views/UnifiedMasterDashboard.tsx - Control Panels · Autonomy, routing, approval, and status controls
src/ui/components/AutonomyDials.tsx - Subsystem Views · Dedicated dashboards for major core subsystems
src/ui/views/BaseVaultDashboard.tsx
Docs
Architecture, rules, and operating guidance
- Architecture Docs · Reference architecture and system boundaries
docs/docs/02-architecture/architecture-blueprint.md - Operating Rules · Rules, standards, and review guidance
docs/context/architecture.md
Tooling
Scripts, grammar, and validation utilities
- DAG Grammar · Grammar used to constrain DAG structure
docs/grammar/dag.gbnf - Validation Scripts · Crypto, DAG, and end-to-end verification scripts
scripts/dag-test.ts
Connections 30
- Schema → DB Access: defines · Schema is consumed by database access
- DB Access → Crypto: protects · Database layer relies on crypto for secure storage
- Write Queue → DB Access: serializes · Queued writes are flushed through DB access
- DAG Validation → Engine: gates · Validated DAGs enter the execution engine
- Scheduler → Worker Pool: dispatches · Scheduler hands runnable work to workers
- Engine → Scheduler: orchestrates · Engine coordinates scheduling and execution
- Engine → Sandbox: isolates · Task execution is constrained by sandboxing
- Governor → Council: sets policy · Governance posture informs decision making
- Council → Router: selects · Council decisions drive routing
- Router → Adapters: uses · Router invokes provider adapters
- Interview → Validator: feeds · Structured intake is validated before promotion
- Validator → Governor: constrains · Policy gate limits autonomy and execution scope
- Classifier → Dynamic Router: guides · Classification informs adaptive routing
- Dynamic Router → Router: influences · Adaptive analysis steers provider routing
- Reflection → Vector Memory: persists · Reflections are backed by vector retrieval memory
- Vector Memory → Council: informs · Memory can shape future decisions and responses
- GitNexus Worker → DB Sync: updates · Worker activity is synchronized to state
- DB Sync → DB Access: writes · Daemon sync persists into the durable store
- SSE Stream → Routes: streams to · Live events are exposed through the API layer
- Server → Routes: mounts · Server exposes subsystem routes
- Master Dashboard → Control Panels: contains · Dashboard surfaces operational controls
- Master Dashboard → Subsystem Views: navigates · Master dashboard links to subsystem views
- Subsystem Views → Routes: calls · UI views consume API endpoints
- Architecture Docs → Operating Rules: guides · Architecture docs are framed by operating rules
- DAG Grammar → DAG Validation: constrains · Grammar supports DAG validation
- Validation Scripts → Crypto: verifies · Scripts check crypto and persistence behavior
- Validation Scripts → Engine: exercises · Scripts cover execution flows
- Routes → Engine: exposes · API offers execution-facing endpoints
- Routes → Vector Memory: exposes · API serves memory-related endpoints
- Routes → Router: exposes · API serves routing and model endpoints