Skip to content

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 ​

DirectoryRoleNotes
server-rsRust engineAxum routes, AppState hubs, telemetry bridge, agent runtime, security, persistence.
srcReact dashboardPages, layouts, stores, services, visualizers, detached portal UI.
src-tauriDesktop wrapperTauri packaging for Windows (NSIS), Linux (AppImage/.deb), and macOS Universal (fat .dmg).
apps/mobile-androidAndroid companionNative Jetpack Compose oversight companion with hardware AndroidKeyStore RSA-2048 OAEP BiometricPrompt.CryptoObject Ed25519 signing.
wasm-codecShared codec moduleWASM-friendly serialization helpers used by the repo.
executionExecution toolsDeterministic Python scripts and modular parity/audit library (execution/lib).
scriptsBuild & deploy helpersdeploy-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_benchEvaluation rigScenario-driven blind-judge mission benchmarks (run.py, judge.py).

Key Entry Points ​

  • server-rs/src/main.rs boots the Rust engine.
  • server-rs/src/router.rs defines the HTTP and WebSocket surface, including /v1/* routes, /v1/engine/ws, and /v1/engine/live-voice.
  • server-rs/src/state/mod.rs is the current AppState module and global state root.
  • server-rs/src/agent/knowledge_store/mod.rs governs SQLite-backed IKS and OKF metadata storage.
  • server-rs/src/agent/context_manager.rs houses the $O(N)$ linear dialogue compactor.
  • server-rs/src/agent/runner/execution_metrics.rs computes 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.rs resolves shared policy metadata for runner and MCP boundaries.
  • server-rs/src/agent/runner/context/ separates resolution, ordered preparation, and memory augmentation behind context.rs.
  • server-rs/src/agent/runner/service_traits/mission_state/outcome.rs owns 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 behind ws.rs.
  • server-rs/src/db/contract_tests.rs implements behavioral contract tests for DashMap and SQLite state stores.
  • server-rs/src/telemetry/mod.rs owns 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.rs and server-rs/src/services/backup/ (crypto.rs, daemon.rs, snapshot.rs) implement admin-gated TADPOLE_SNAP_V2 encrypted backups, 48h pruning, and staged restart restores.
  • server-rs/src/routes/remote.rs and server-rs/src/security/remote_protocol.rs implement QR companion pairing and Ed25519 request/decision verification.
  • server-rs/src/routes/knowledge.rs handles 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.rs and server-rs/src/routes/cas.rs provide 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.rs builds 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 (including route-parity AST verification), path_utils.rs, visualizer.rs, query_manager.rs, and modular doc_guard/ (symbols.rs, autofix.rs, report.rs).
  • server-rs/src/agent/business/service.rs implements 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 behind customer_catalog.rs.
  • server-rs/src/agent/mcp/client/http/client/ separates client transport, requests, responses, and fallback handling behind client.rs.
  • server-rs/src/agent/runner/intelligence/ separates routing heuristics and telemetry aggregation behind intelligence.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/ houses clean_code_linter.py and complexity_analyzer.py enforcing code-health ratchets across the repository.
  • src/layouts/Dashboard_Layout.tsx wires the main application shell and lazily loaded side panels.
  • src/services/tadpoleos_service.ts is the frontend service facade for engine interactions.
  • src/services/mission_history_service.ts provides typed client access to the flight recorder endpoints.
  • src/services/provider_configuration.ts and src/services/model_commands.ts own validated configuration writes and selective recovery.
  • src/domain/agents/state_reducer.ts merges 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.tsx provides in-chat generative UI rendering for typed OpenUI DSL.
  • src/components/chat/Question_Choice_Pill.tsx interactive choice pills for structured user question prompts.
  • src/components/chat/Mission_Metrics_Badge.tsx HUD badge for real-time mission execution metrics.
  • src/components/ui/Portal_Window.tsx powers detached windows while preserving shared state.
  • src/components/intelligence/KnowledgeGraph.tsx renders 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 under data/.
  • macOS: src-tauri/src/data_dir.rs, called by resolve_data_dir() in the desktop entrypoint, prepares ~/Library/Application Support/com.tadpole.os/ for the database, neural token, logs and PID locks. An absolute TADPOLE_DATA_DIR overrides it; invalid or unavailable directories stop startup before sidecar launch.
  • Template installs currently stage agents under data/swarm_config/, workflows into directives/, and specialized skills/scripts into execution/.
  • 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-universal matrix entry on macos-14 in .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. See docs/BLUEPRINT-universal-macos-build.md for native verification status.

Sovereign Intelligence Architecture.