Skip to content

feat(install): report provider liveness in phase_health - #355

Merged
CameronBrooks11 merged 2 commits into
mainfrom
feat/install-provider-liveness
Oct 15, 2026
Merged

CameronBrooks11 merged 2 commits into
mainfrom
feat/install-provider-liveness

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

feat(install): report provider liveness in phase_health

phase_health confirmed that the runtime answers /v0/runtime/status and
that the run registry answers /v0/runs, and never looked at providers.
An install whose providers never came up reported healthy. The check
lives in install.sh so that every install path (local, remote, bundle
and CLI) runs it, and the workbench already shows install.sh's output.

Once the runtime responds, phase_health now reads
GET /v0/providers/health and polls until every provider is available
(lifecycle_state RUNNING or RECOVERING) or HEALTH_TIMEOUT elapses. It
then logs "health: providers: N of M running", and one warning per
provider that is not running, with its provider_id and
lifecycle_state. If the endpoint never answers, it warns that provider
liveness is unknown. A shortfall is a warning, like the run-registry
check, and does not set HEALTH_FAILED. It counts providers, not
devices: a device count would need provider-specific knowledge of
which devices to expect.

The response is parsed with grep, like the runtime version in the same
phase, so the target needs no JSON tool. The runtime serialises
objects with sorted keys, so each provider's lifecycle_state comes
right before its provider_id, and device entries carry neither key.
docs/deploy/install-sh.md describes the new check.

hardening_test.bats gains four cases that source install.sh and stub
curl by URL (and sleep): every provider running logs "2 of 2 running"
with no warning; a CIRCUIT_OPEN provider logs "1 of 2 running" and
names only that provider, with HEALTH_FAILED still 0; a provider that
comes up during the timeout is waited for; an endpoint that does not
answer gives the unknown warning. All four fail before the change and
pass after. bats tests/shell/: 181 of 181 pass, none skipped.
shellcheck tools/install.sh is clean.

Against the built runtime with one provider-sim v0.1.6 provider, the
check printed "providers: 1 of 1 running". After that provider process
was killed, it printed "providers: 0 of 1 running" and
"provider sim0: CIRCUIT_OPEN".

Closes #344

phase_health confirmed that the runtime answers /v0/runtime/status and
that the run registry answers /v0/runs, and never looked at providers.
An install whose providers never came up reported healthy. The check
lives in install.sh so that every install path (local, remote, bundle
and CLI) runs it, and the workbench already shows install.sh's output.

Once the runtime responds, phase_health now reads
GET /v0/providers/health and polls until every provider is available
(lifecycle_state RUNNING or RECOVERING) or HEALTH_TIMEOUT elapses. It
then logs "health: providers: N of M running", and one warning per
provider that is not running, with its provider_id and
lifecycle_state. If the endpoint never answers, it warns that provider
liveness is unknown. A shortfall is a warning, like the run-registry
check, and does not set HEALTH_FAILED. It counts providers, not
devices: a device count would need provider-specific knowledge of
which devices to expect.

The response is parsed with grep, like the runtime version in the same
phase, so the target needs no JSON tool. The runtime serialises
objects with sorted keys, so each provider's lifecycle_state comes
right before its provider_id, and device entries carry neither key.
docs/deploy/install-sh.md describes the new check.

hardening_test.bats gains four cases that source install.sh and stub
curl by URL (and sleep): every provider running logs "2 of 2 running"
with no warning; a CIRCUIT_OPEN provider logs "1 of 2 running" and
names only that provider, with HEALTH_FAILED still 0; a provider that
comes up during the timeout is waited for; an endpoint that does not
answer gives the unknown warning. All four fail before the change and
pass after. bats tests/shell/: 181 of 181 pass, none skipped.
shellcheck tools/install.sh is clean.

Against the built runtime with one provider-sim v0.1.6 provider, the
check printed "providers: 1 of 1 running". After that provider process
was killed, it printed "providers: 0 of 1 running" and
"provider sim0: CIRCUIT_OPEN".

Closes #344
@CameronBrooks11
CameronBrooks11 merged commit 519724d into main Oct 15, 2026
29 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/install-provider-liveness branch October 15, 2026 12:31
CameronBrooks11 added a commit that referenced this pull request Oct 16, 2026
Bumps `project(VERSION)` and `vcpkg.json` to 0.1.45 and rolls the
CHANGELOG. Ships, among others:
- `safety.on_startup`, default `safe_state`: the declared safe state
  runs once at every runtime start (#392, closes #362);
- Grafana and InfluxDB bound to loopback under `--with-observability`,
  with `--with-grafana-network` to open Grafana to the LAN (#359,
  closes #351);
- `install.sh` refuses a downgrade unless `--allow-downgrade` (#382,
  closes #366);
- the zero rung no longer sends a guessed boolean (#367), e-stop
  `safe_state_achieved` (#368), dispatchable coverage counts (#369),
  and startup warnings for fault-hook gaps (#370) and disarmed
  watchdogs (#371);
- `health.excluded_signals` (#377), signal unit and description in
  capabilities (#365);
- a half-open probe of an open provider circuit every 60 s, a restart
  that stops the old process first, and a restart clock that starts
  after it stops (#376, #391);
- automation status: `idle` outside AUTO, and `failed` cleared by a
  load or a new AUTO run (#373, #386);
- `install.sh`: provider liveness in the health phase (#355, #383),
  `manifest.json` restored on `--rollback` (#354), Grafana restarted
  on every observability run (#343), the datasource debug lines
  filtered from the journal (#360), and the uninstall prefix guard
  (#342);
- no ERROR lines for reads that fail during shutdown (#381).

The CHANGELOG opens 0.1.45 with upgrade notes: Grafana is on loopback
by default, `safety.on_startup` drives outputs at boot by default, and
downgrades need `--allow-downgrade`. The 0.1.44 note about restarting
grafana-server by hand is not repeated, since #343 restarts it on
every run.

The OpenAPI changes are additive: `SignalSpec.unit` and
`.description`, `EstopResponse.safe_state_achieved`,
`ParameterDefinition.source` and the runtime status
`startup_safe_state`. No provider-protocol change. anolis-workbench
vendors the OpenAPI file and needs a repin to this release.

Every commit in `git log v0.1.44..main` is in the CHANGELOG except
CI, test-only and docs-lint commits (#380, #384, #389).

After merge, tag `v0.1.45`.
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.

feat(install): report provider liveness in phase_health

1 participant