The Logger package is the diagnostic backbone of the Vibe Project. It provides high-performance, context-aware structured logging used for system governance, metrics, and autonomous self-healing.
To ensure O(1) parsing and high diagnostic saliency, every log event MUST include a 4-character context identifier. This allow developers and agents to immediately filter for specific domains:
VBPR: Vibe Predictor (Inference).STOR: Store / Persistence.STEM: System Brainstem (Core Lifecycle).CERE: Cerebellum (Coordination).A2UI: Agentic UI transitions.
- Thread-Safety: The
LogGovernoris afinal actor, ensuring that logging never blocks the calling thread or contributes to data races. - OSLog Integration: Leverages the native Apple
os_logsystem for efficient kernel-level buffering and console integration. - Privacy Gating: Automatic redaction of potentially sensitive telemetry data in production builds.
Logger isn't just for text; it tracks system Vital Signs:
- Latency Snapshots: Tracking inference and sampling times.
- Throughput Metrics: Monitoring sensor update frequencies.
- Memory Pressure: Logging events that trigger elective neural pruning in the
Store.
Strictly use the SiliconRegistry.
let logger = try registry.resolve(LoggerProtocol.self)
logger.info("Initializing sensory array", context: "SENS")Every ?? or default case MUST log a warning.
let value = try? await store.read(key)
if value == nil {
logger.warn("Cache miss for critical key", context: "STOR")
}- [ ] Neural Log Prioritization: Using a small model to determine which logs are "High Entropy" and should be persisted vs discarded.
- [ ] JSON Structural Export: Automated generation of parseable diagnostic reports for CI/CD audit trails.
- [ ] Health-Triggered Verbosity: Dynamically increasing log level during detected system-instability (e.g., thermal throttling).
“To see the error is the first step towards rectifying the prediction.”