How dicklesworthstone/vibe_cockpit works
Purpose and entry points
Vibe Cockpit (vc) is a Rust fleet console for AI coding-agent telemetry across local and SSH-reachable machines. Its primary executable entry point is src/main.rs; command orchestration and machine-readable output live in crates/vc_cli/src/lib.rs and crates/vc_cli/src/robot.rs. Operators use CLI, daemon, TUI, web API, or MCP; all non-collection surfaces read persisted state.
Configuration and runtime boundary
vc_config defines the shared runtime configuration, including database location, enabled collectors, schedules, and machine definitions: crates/vc_config/src/lib.rs. Collection is explicitly the external-I/O boundary: it invokes installed tools, reads local files/databases, and opens SSH sessions. Cancellation-aware execution, remote access, and machine registration are separated in crates/vc_collect/src/executor.rs, crates/vc_collect/src/ssh.rs, and crates/vc_collect/src/machine.rs.
Collection pipeline
vc_collect runs a pluggable set of source adapters, normalizes their results, redacts sensitive values, and writes observations to storage. Collector implementations cover agent tools, GitHub, system probes, SQLite/JSONL sources, and HTTP benchmarking under crates/vc_collect/src/collectors/mod.rs, crates/vc_collect/src/collectors/github.rs, and crates/vc_collect/src/collectors/sysmoni.rs. Scheduling, adaptive polling, and per-collector execution are centered in crates/vc_collect/src/scheduler.rs, crates/vc_collect/src/probe.rs, and crates/vc_collect/src/redact.rs.
Durable data plane
vc_store is the system-of-record layer backed by DuckDB. It owns schema access and ordered migrations in crates/vc_store/src/lib.rs, crates/vc_store/src/schema.rs, and crates/vc_store/src/migrations/001_initial_schema.sql. Migrations establish tables for telemetry, machines, health, alerts, knowledge, experiments, commands, and retention. The documented DuckDB-to-FrankenSQLite export is one-way; DuckDB remains the read/write source for the application.
Analysis, scoring, and operational decisions
vc_query transforms stored telemetry into fleet views: health scores/factors, freshness, cost attribution, digests, guardrails, and natural-language query handling. Its architectural core is crates/vc_query/src/health.rs, crates/vc_query/src/nl.rs, and crates/vc_query/src/cost.rs. vc_alert evaluates and records alert rules/routes (crates/vc_alert/src/lib.rs, crates/vc_alert/src/routing.rs); threshold evaluation is the implemented alert condition. Higher-level automation and intelligence are isolated in crates/vc_guardian/src/autopilot.rs, crates/vc_knowledge/src/mining.rs, and crates/vc_oracle/src/evolution.rs.
Read and integration surfaces
The interactive terminal console is vc_tui, with store-backed data access and screen composition in crates/vc_tui/src/data.rs, crates/vc_tui/src/lib.rs, and crates/vc_tui/src/screens/overview.rs. The read-only HTTP/WebSocket and metrics-facing service is vc_web (crates/vc_web/src/lib.rs, crates/vc_web/src/auth.rs), with a separate Next.js frontend under web/src/app/page.tsx and web/src/lib/api.ts. Agent integration is provided by a stdio JSON-RPC MCP server in crates/vc_mcp/src/lib.rs; versioned robot envelopes and TOON output are handled by crates/vc_cli/src/robot.rs and crates/vc_cli/src/toon.rs.
Primary control flow
vc daemon repeatedly executes: load config → schedule local/remote collectors → normalize/redact → persist to DuckDB → derive health/freshness → evaluate threshold alerts. TUI, web, MCP, JSON CLI, and robot commands query the resulting store rather than querying external tools directly. JSON robot contracts are published in docs/schemas/robot-envelope.json, docs/schemas/robot-health.json, and docs/schemas/robot-triage.json.
Main entry points: src/lib.rs DuckDB system of record · src/lib.rs Shared configuration · src/lib.rs CLI orchestration · mod.rs Source adapters
Components 21
Operator Surfaces
- vc executable
src/main.rs - CLI orchestration · Commands and machine-readable output.
crates/vc_cli/src/lib.rs - Robot contracts · Versioned JSON envelopes and TOON output.
crates/vc_cli/src/robot.rs - Terminal console · Store-backed interactive fleet views.
crates/vc_tui/src/lib.rs - Read-only web service · Also exposes metrics-facing endpoints.
crates/vc_web/src/lib.rs - Next.js frontend
web/src/app/page.tsx - MCP server · Agent integration surface.
crates/vc_mcp/src/lib.rs
Collection Boundary
The only subsystem that performs external I/O.
- Collection scheduler · Schedules adaptive per-collector probes.
crates/vc_collect/src/scheduler.rs - Cancellation-aware executor · Runs local and remote collection work.
crates/vc_collect/src/executor.rs - Machine registry · Registers collection machines.
crates/vc_collect/src/machine.rs - SSH access
crates/vc_collect/src/ssh.rs - Source adapters · Agent tools, GitHub, system, SQLite/JSONL, and HTTP sources.
crates/vc_collect/src/collectors/mod.rs - Normalize and redact · Normalizes observations and removes sensitive values.
crates/vc_collect/src/redact.rs
Data and Decisions
- DuckDB system of record · Application read/write source for telemetry and operational records.
crates/vc_store/src/lib.rs - Schema and migrations · Ordered migrations define durable domain tables.
crates/vc_store/src/schema.rs - Fleet query layer · Builds health, freshness, cost, digests, guardrails, and NL queries.
crates/vc_query/src/health.rs - Threshold alerts · Evaluates and records alert rules and routes.
crates/vc_alert/src/lib.rs
Automation
- Guardian autopilot
crates/vc_guardian/src/autopilot.rs - Knowledge mining
crates/vc_knowledge/src/mining.rs - Oracle evolution
crates/vc_oracle/src/evolution.rs
Other components
- Shared configuration · Defines database, collectors, schedules, and machines.
crates/vc_config/src/lib.rs
Connections 23
- vc executable → CLI orchestration: starts commands
- CLI orchestration → Robot contracts: emits
- vc executable → Shared configuration: loads
- Shared configuration → Collection scheduler: collector schedules
- Shared configuration → Machine registry: machine definitions
- Collection scheduler → Cancellation-aware executor: dispatches probes
- Cancellation-aware executor → Source adapters: runs
- Machine registry → SSH access: remote sessions
- SSH access → Source adapters: remote collection
- Source adapters → Normalize and redact: observations
- Normalize and redact → DuckDB system of record: persist telemetry
- Schema and migrations → DuckDB system of record: defines tables
- DuckDB system of record → Fleet query layer: stored telemetry
- Fleet query layer → Threshold alerts: health and freshness
- DuckDB system of record → Threshold alerts: records alerts
- DuckDB system of record → Guardian autopilot: operational state
- DuckDB system of record → Knowledge mining: telemetry history
- DuckDB system of record → Oracle evolution: experiments and knowledge
- DuckDB system of record → CLI orchestration: query results
- DuckDB system of record → Terminal console: read state
- DuckDB system of record → Read-only web service: read state
- Read-only web service → Next.js frontend: API and WebSocket
- DuckDB system of record → MCP server: read state