Skip to content

fix: the event stream carries the stale flag like list and inspect - #244

Merged
CMGS merged 2 commits into
masterfrom
fix/event-json-stale
Sep 14, 2026
Merged

CMGS merged 2 commits into
masterfrom
fix/event-json-stale

Conversation

@CMGS

@CMGS CMGS commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Why

#238 gave vm list -o json and vm inspect a stale flag for a record that still reads running while its VMM is gone. vm status --event --format json reconciles the same way (a dead VMM shows as stopped) but its envelope still carried the bare record, so the one JSON path that watches for changes could not tell a crash-reconciled stop from a clean one; the table view of the same command shows (stale). No consumer reads the flag today (vk-cocoon's watcher keys on state and pid), so this is about the three JSON renderers sharing one shape rather than documenting an exception.

What

The event envelope's vm field is the same vmOutput wrapper list and inspect use: identical record fields plus "stale": true when the reconcile fired, no key otherwise. One line in the states table names the third command.

Evidence

  • GOWORK=off go build ./... on darwin and linux, go test ./cmd/vm/ ok, make lint 0 issues on both platforms, asl clean; no comment added.
  • Unit test pins the envelope: {"event":"MODIFIED","vm":{"id":"v1",...,"state":"stopped","stale":true}} and no stale key on a live record.

vm status --event -o json reconciles a dead VMM to stopped exactly as list and inspect do, but its envelope still carried the bare record, so the one JSON path that watches for changes could not tell a crash-reconciled stop from a clean one. The envelope now wraps the same vmOutput, so all three JSON renderers share one shape.
@CMGS
CMGS merged commit c2c4cd1 into master Sep 14, 2026
4 checks passed
@CMGS
CMGS deleted the fix/event-json-stale branch September 14, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant