Operations & Diagnostics
TheOperationsSection serves as the primary observability hub for the daemon’s internal health and the palyrad self-healing subsystem. It surfaces diagnostic snapshots, audit events, and recovery job statuses.
Implementation & Data Flow
The section consumes adiagnosticsSnapshot provided by useConsoleAppState apps/web/src/console/useConsoleAppState.tsx#30. This snapshot is populated via the ConsoleApiClient calling the GET /console/v1/diagnostics endpoint.
Key components of the Operations view include:
- Self-Healing & Doctor Recovery: Displays the status of the
doctor_recoveryandself_healingloops apps/web/src/console/sections/OperationsSection.tsx#64-67. It tracks active incidents, remediation attempts, and heartbeats. - Audit Log: Renders a searchable table of
auditEventsapps/web/src/console/sections/OperationsSection.tsx#36. These events represent the tamper-evident journal of all sensitive operations performed by the daemon. - Provider Status: Real-time connectivity state for the configured model provider (e.g., OpenAI, Anthropic) apps/web/src/console/sections/OperationsSection.tsx#84-88.
Diagnostics Architecture
The following diagram illustrates how the Web Console retrieves and displays operational health from the daemon’s internal services. Operational Health Data Flow Sources: apps/web/src/console/sections/OperationsSection.tsx#49-122, apps/web/src/console/useConsoleAppState.tsx#164-211Usage & Governance
TheUsageSection implements the UI for Palyra’s “Smart Routing” and token governance system. It allows operators to monitor model mix, estimated costs, and budget enforcement.
Key Logic & Metrics
- Token Aggregates: Displays total prompt and completion tokens across a selectable time window (24h, 7d, 30d, 90d) apps/web/src/console/sections/UsageSection.tsx#170-178.
- Model Mix & Cost Estimation: Uses
UsageModelMixRecordcrates/palyra-daemon/src/usage_governance.rs#169-177 to show distribution across providers. Costs are calculated usingestimate_cost_for_modelcrates/palyra-daemon/src/transport/http/handlers/console/usage.rs#13-18. - Smart Routing: Displays recent routing decisions, including the
complexity_scoreandexplanationfor why a specific model was chosen over the default crates/palyra-daemon/src/usage_governance.rs#112-130.
Budget Enforcement
The daemon evaluatesUsageBudgetPolicyRecord crates/palyra-daemon/src/usage_governance.rs#11-13 to determine if a run should be blocked or if an approval is required. The console surfaces these as “Usage Alerts” apps/web/src/console/sections/UsageSection.tsx#70-80.
Usage Governance System
Sources: crates/palyra-daemon/src/usage_governance.rs#28-51, crates/palyra-daemon/src/transport/http/handlers/console/usage.rs#162-188, apps/web/src/console/sections/UsageSection.tsx#95-143
Memory & Learning
TheMemorySection provides a management interface for the daemon’s long-term knowledge base, including the Workspace (curated documents) and the Learning Queue (automated fact extraction).
Workspace Documents
The Workspace represents “Tier-1” memory. The console allows for:- CRUD Operations: Creating, moving, and deleting documents via
saveWorkspaceDocumentandmoveWorkspaceDocumentapps/web/src/console/sections/MemorySection.tsx#83-86. - Search & Recall: Previewing how the orchestrator will recall documents using
previewMemoryRecallapps/web/src/console/sections/MemorySection.tsx#89. - Promotion: Promoting ephemeral session hits into permanent workspace drafts apps/web/src/console/sections/MemorySection.tsx#91.
Learning Review Queue
The Learning system automatically identifies potential facts or procedures from chat sessions. These are held in aqueued state until an operator reviews them.
- Candidate Review: Operators can approve, reject, or edit
learningCandidatesapps/web/src/console/sections/MemorySection.tsx#155. - Confidence Thresholds: The UI surfaces
durable_factandprocedurethresholds used by the daemon to flag candidates for auto-application apps/web/src/console/sections/MemorySection.tsx#176-179.
Memory Implementation Details
| Entity | Code Reference | Description |
|---|---|---|
| MemoryStatus | memoryStatus apps/web/src/console/sections/MemorySection.tsx#43 | Summary of usage, retention, and maintenance tasks. |
| Learning Candidate | MemoryLearningCandidate apps/web/src/console/sections/MemorySection.tsx#59 | A fact or skill proposed by the reflection loop. |
| Recall Preview | memoryRecallPreview apps/web/src/console/sections/MemorySection.tsx#77 | Simulated vector search results for a given query. |
| Workspace Hit | memoryWorkspaceHits apps/web/src/console/sections/MemorySection.tsx#56 | Documents returned from lexical search in the workspace. |
Section Refresh Lifecycle
To maintain data freshness without overwhelming the daemon, the console implements a TTL-based auto-refresh strategy defined inAUTO_REFRESH_SECTION_TTL_MS apps/web/src/console/useConsoleAppState.tsx#42-54:
- Memory: 10,000ms
- Operations: 10,000ms
- Usage: No auto-refresh (typically manual or on-mount) to prevent heavy aggregate recalculations.