IMPORTANT
AI Context & Knowledge Heritage
- Subsystem: Architecture & Documentation / Core Docs / CODEBASE_MAP
- Architecture:
@docs ARCHITECTURE:Documentation - Failure Path: Information drift, legacy terminology, or documentation mismatch.
- Observability: Traceability via
execution/parity_guard.py
🗺️ Codebase Map
Status: Stable
Version: 1.1.464
Last Updated: 2026-11-20 (Dual-token RBAC, Backup V2 210k PBKDF2, Android hardware biometric CryptoObject, Clippy & OpenAPI 3.1 hardening)
Classification: Sovereign
Overview
This map is the lightweight navigation layer for the current Tadpole OS repository. It points to the live code roots and the highest-signal entry points used by the engine, dashboard, and desktop shell.
Top-Level Map
| Directory | Role | Notes |
|---|---|---|
server-rs | Rust engine | Axum routes, AppState hubs, telemetry bridge, agent runtime, security, persistence. |
src | React dashboard | Pages, layouts, stores, services, visualizers, detached portal UI. |
src-tauri | Desktop wrapper | Tauri packaging for Windows (NSIS), Linux (AppImage/.deb), and macOS Universal (fat .dmg). |
apps/mobile-android | Android companion | Native Jetpack Compose oversight companion with hardware AndroidKeyStore RSA-2048 OAEP BiometricPrompt.CryptoObject Ed25519 signing. |
wasm-codec | Shared codec module | WASM-friendly serialization helpers used by the repo. |
execution | Execution tools | Deterministic Python scripts and modular parity/audit library (execution/lib). |
scripts | Build & deploy helpers | deploy-bunker-{1,2}.{ps1,sh}, build-linux-light.{ps1,mjs,sh}, build-macos-universal.sh, verify-macos-bundle.sh, deploy-linuxlite.ps1, publish-public.ps1. |
tests/mission_bench | Evaluation rig | Scenario-driven blind-judge mission benchmarks (run.py, judge.py). |
Key Entry Points
server-rs/src/main.rsboots the Rust engine.server-rs/src/router.rsdefines the HTTP and WebSocket surface, including/v1/*routes,/v1/engine/ws, and/v1/engine/live-voice.server-rs/src/state/mod.rsis the current AppState module and global state root.server-rs/src/agent/knowledge_store/mod.rsgoverns SQLite-backed IKS and OKF metadata storage.server-rs/src/agent/context_manager.rshouses the $O(N)$ linear dialogue compactor.server-rs/src/agent/runner/execution_metrics.rscomputes per-mission execution metrics and telemetry rollups.server-rs/src/agent/runner/tools/houses the Zero-Trust tool pipeline, CBS, and trait-based registry.server-rs/src/agent/runner/tools/resolved_policy.rsresolves shared policy metadata for runner and MCP boundaries.server-rs/src/agent/runner/context/separates resolution, ordered preparation, and memory augmentation behindcontext.rs.server-rs/src/agent/runner/service_traits/mission_state/outcome.rsowns durable completion and conflict recovery.server-rs/src/agent/script_skills/separates artifact codecs, sources, validation, and filesystem persistence.server-rs/src/security/permissions/separates decision types, policy evaluation, SQL lookup, and approval lifecycle.server-rs/src/routes/ws/separates telemetry, live voice, and shared admission helpers behindws.rs.server-rs/src/db/contract_tests.rsimplements behavioral contract tests for DashMap and SQLite state stores.server-rs/src/telemetry/mod.rsowns the tracing-to-frontend telemetry bridge.server-rs/src/routes/templates/handles starter-kit and template installation (mod.rs,catalog.rs,installed.rs,mcp_store.rs,validate.rs).server-rs/src/routes/backup.rsandserver-rs/src/services/backup/(crypto.rs,daemon.rs,snapshot.rs) implement admin-gatedTADPOLE_SNAP_V2encrypted backups, 48h pruning, and staged restart restores.server-rs/src/routes/remote.rsandserver-rs/src/security/remote_protocol.rsimplement QR companion pairing and Ed25519 request/decision verification.server-rs/src/routes/knowledge.rshandles the IKS and OKF metadata API endpoints.server-rs/src/routes/missions/houses the Mission Flight Recorder composite endpoints (/v1/missions,/v1/missions/{id}/dossier,/v1/missions/{id}/pin) with Merkle chain validation and CAS diffing.server-rs/src/services/cas.rsandserver-rs/src/routes/cas.rsprovide the Content-Addressable Store (CAS) revision history, restore, and pre-aligned side-by-side LCS diff engine (/v1/cas/diff).server-rs/src/intelligence/graph/synthesis.rsbuilds the codebase symbol graph and precomputes deterministic Label Propagation (community) modularity clusters.server-rs/src/bin/graph_query/is the modular intelligence CLI (ADG-05):main.rs(includingroute-parityAST verification),path_utils.rs,visualizer.rs,query_manager.rs, and modulardoc_guard/(symbols.rs,autofix.rs,report.rs).server-rs/src/agent/business/service.rsimplements the isolated SMB practice enquiry, approval, policy, and promotion lifecycle.server-rs/src/agent/outward/customer_catalog/separates catalog context, parsers (RFC 4180 CSV / QuickBooks), persistence, search indexing, and types behindcustomer_catalog.rs.server-rs/src/agent/mcp/client/http/client/separates client transport, requests, responses, and fallback handling behindclient.rs.server-rs/src/agent/runner/intelligence/separates routing heuristics and telemetry aggregation behindintelligence.rs.execution/lib/modular execution library:parity_router.py&parity_validators.py(Parity Guard),ai_context_parser.py&ai_context_resolver.py(AI Context contract verification)..agent/skills/clean-code/scripts/housesclean_code_linter.pyandcomplexity_analyzer.pyenforcing code-health ratchets across the repository.src/layouts/Dashboard_Layout.tsxwires the main application shell and lazily loaded side panels.src/services/tadpoleos_service.tsis the frontend service facade for engine interactions.src/services/mission_history_service.tsprovides typed client access to the flight recorder endpoints.src/services/provider_configuration.tsandsrc/services/model_commands.tsown validated configuration writes and selective recovery.src/domain/agents/state_reducer.tsmerges API snapshots and socket patches.src/domain/chat/owns transcript transitions;src/services/chat/owns decisions, replication, and diagnostic projection.src/components/missions/history/contains the Mission Flight Recorder & Run History master-detail dossier UI and audit viewers.src/components/chat/OpenUI_Renderer.tsxprovides in-chat generative UI rendering for typed OpenUI DSL.src/components/chat/Question_Choice_Pill.tsxinteractive choice pills for structured user question prompts.src/components/chat/Mission_Metrics_Badge.tsxHUD badge for real-time mission execution metrics.src/components/ui/Portal_Window.tsxpowers detached windows while preserving shared state.src/components/intelligence/KnowledgeGraph.tsxrenders the primary Neural Map visualization supporting Symbols and OKF force-graphs.starter_kits/contains the built-in SMB starter swarms shipped with the repo.execution/contains parity, audit, and operator verification tooling.tests/mission_bench/contains the scenario-driven blind-judge benchmarking harness (run.py,judge.py).
Notes For Operators
- Persistent runtime data is rooted from
AppState.base_dir, which defaults to the repo root and stores data underdata/. - macOS:
src-tauri/src/data_dir.rs, called byresolve_data_dir()in the desktop entrypoint, prepares~/Library/Application Support/com.tadpole.os/for the database, neural token, logs and PID locks. An absoluteTADPOLE_DATA_DIRoverrides it; invalid or unavailable directories stop startup before sidecar launch. - Template installs currently stage agents under
data/swarm_config/, workflows intodirectives/, and specialized skills/scripts intoexecution/. - The documentation parity checks rely on this file for path validation, so entries here should stay coarse, current, and rooted in paths that exist on disk.
- Universal macOS CI is configured as the
macos-universalmatrix entry onmacos-14in.github/workflows/build.yml. It uses the shared build helper, stages both target-specific sidecars plus the universal engine, and verifies bundle slices/signatures/artifacts. Seedocs/BLUEPRINT-universal-macos-build.mdfor native verification status.
