Fix design-vs-implementation gaps found in verification

Critical fixes:
- Wire monitor subsystem to agent startup (was dead code)
- Implement NodeStatus RPC (disk, memory, CPU, runtime version, uptime)
- Deploy respects active=false (sets desired_state=stopped, not always running)

Medium fixes:
- Add Started field to runtime.ContainerInfo, populate from podman inspect
- Populate ComponentInfo.started in status handlers for uptime display
- Add Monitor field to Agent struct for graceful shutdown

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 12:29:04 -07:00
parent 8f913ddf9b
commit 941dd7003a
7 changed files with 99 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"os/exec"
"strings"
"time"
)
// Podman implements the Runtime interface using the podman CLI.
@@ -98,7 +99,8 @@ type podmanInspectResult struct {
User string `json:"User"`
} `json:"Config"`
State struct {
Status string `json:"Status"`
Status string `json:"Status"`
StartedAt string `json:"StartedAt"`
} `json:"State"`
HostConfig struct {
RestartPolicy struct {
@@ -142,6 +144,9 @@ func (p *Podman) Inspect(ctx context.Context, name string) (ContainerInfo, error
Cmd: r.Config.Cmd,
Version: ExtractVersion(r.Config.Image),
}
if t, err := time.Parse(time.RFC3339Nano, r.State.StartedAt); err == nil {
info.Started = t
}
info.Network = r.HostConfig.NetworkMode
if len(r.NetworkSettings.Networks) > 0 {