Principle:23blocks OS Ai maestro Status Snapshot Persistence
| Knowledge Sources | |
|---|---|
| Domains | Status_Presence, Persistence |
| Last Updated | 2026-10-26 10:00 GMT |
Overview
A snapshot persistence pattern that receives agent status reports (model, context, cost, effort, mode) from hooks, validates fields, and serves them merged across local and remote hosts.
Description
The status snapshot service receives reports from agent hooks. `ingestStatusSnapshot` validates the fields (model, modelId, sessionId, effort), checks the agent exists, bounds the payload size, and keeps the report in memory. `getSnapshots` returns a map of agent name → snapshot by merging local snapshots with cached remote host snapshots.
Unknown fields are dropped; the report writes nothing to disk (in-memory only). The snapshot enriches the presence display with model context, cost, and effort information.
Usage
Use this principle when designing a status enrichment system where:
- Hooks post lightweight status reports (not full state)
- Reports must be validated (field types, size bounds, agent existence)
- Snapshots merge across local and remote hosts
Theoretical Basis
The snapshot is a validated in-memory report:
ingest(agentId, body):
validate: agentId is a string, body is an object, size < MAX
check: agent exists in registry
extract: model, modelId, sessionId, effort (unknown fields dropped)
store: in-memory map[agentName] = snapshot
getSnapshots():
merge: local snapshots + remote host snapshots (cached)
return: agent name → snapshot