Skip to content

#39 Liveness check-in for processor run (co-processor-live) - #42

Merged
gregoryfoster merged 18 commits into
mainfrom
39-liveness
Oct 9, 2026
Merged

gregoryfoster merged 18 commits into
mainfrom
39-liveness

Conversation

@gregoryfoster

@gregoryfoster gregoryfoster commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Refs #39. Plan: docs/plans/2026-10-08-39-liveness.md. The table is on CannObserv/status#29 (#24 had closed). The monitor co-processor-live = 01M4H5FH3PTPGEB24XYQJ4NG7A was created disabled, and its id is in deploy/processor.service.

What: processor run checks in ok to Status's co-processor-live every 300 s, only while the consume loop has made progress within 605 s (reclaim_min_idle_ms + read_block_ms). It never sends alert: silence past the 900 s grace is the page.

  • processor.liveness.Heartbeat: a task beside Consumer.run.
    • Each check-in runs in a daemon thread (not the default executor) and is awaited for at most 10 s.
    • A tick whose check-in is still running is skipped. One attempt per tick, and nothing raises into the loop.
    • It logs on transitions only.
  • Consumer.last_progress is stamped after every step (backoff included) and every message (reclaim walks included). Consumer.backing_off goes in the variables.
  • StatusSettings is shared by Settings (live_monitor_id, live_interval_s, live_checkin_timeout_s < interval) and DriftSettings. The drift unit still needs no broker settings.
  • The starting record gains liveness: on <id>, off, or off: missing the status-checkin-key credential, plus an ERROR. A missing key never stops the service.
  • deploy/processor.service loads status-checkin-key, with the \n fallback.
  • Docs: DEPLOYMENT § Liveness (missing, the records, the grace, deliberate stops, rollback past Liveness check-in for processor run (co-status monitor co-processor-live) #39), the containment host check over both keys, spec §2/§3, AGENTS.md.

Done-when tests:

  • test_a_hung_status_never_delays_a_command: Status takes the connection and never answers, and a command is processed while the check-in hangs.
  • test_a_wedged_loop_goes_silent_while_the_event_loop_stays_up.
  • test_the_child_cannot_read_the_real_secrets with the Status key, on disk and as the unit's credential. It skips where exedev can't read it; DEPLOYMENT § Containment's key loop is the live evidence.

Review: CR 1–5 are applied, one commit each (see the plan's "Amended in review"). The real one is CR 1: the deploy's smoke run now carries the unit's SetCredential= fallback, so a missing Status key can't fail a deploy.

After merge:

  1. scripts/deploy.sh (after 2026-10-09T21:35Z needs no watcher#326 heads-up).
  2. The first ok on status#29.
  3. Status enables the monitor.
  4. The rehearsal, a PATCH to 60/0 then back, with no restart in its window. The operator confirms both notices.

🤖 Generated with Claude Code

gregoryfoster and others added 10 commits October 8, 2026 17:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hung Status never delays a command; a wedged loop goes silent while the
event loop stays up; empty reads, backoffs and each reclaimed message are
progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… timeout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The starting record names it: on <id>, off, or off for a missing key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fallback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregoryfoster

Copy link
Copy Markdown
Member Author

The table moved to CannObserv/status#29: status#24 had closed on 2026-10-07, before the table was posted there. The monitor id will come from #29.

gregoryfoster and others added 2 commits October 9, 2026 20:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gregoryfoster and others added 6 commits October 9, 2026 21:09
Without it a missing status-checkin.key failed the smoke's transient unit
(exit 243, probed) and switched the deploy back, where the service itself
starts with liveness off. systemd-run unescapes the \n (probed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bug outside tick's own handlers ended the task silently: the monitor went
missing with no record why, and processor run's stop re-raised it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregoryfoster
gregoryfoster merged commit fe0de17 into main Oct 9, 2026
4 of 6 checks passed
@gregoryfoster

Copy link
Copy Markdown
Member Author

Shipped: FF-merged to main at fe0de17 (2026-10-09T21:59:14Z), and deployed with scripts/deploy.sh (CI run 37996667935 passed; live fe0de17d4c96). Issue #39 stays open for the live checks.

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