From b558841397250ce4b1956a85b3bd267c82d4c628 Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Fri, 13 Nov 2026 12:38:09 +0100 Subject: [PATCH 1/2] docs: clarify health check contracts in spec (#407) --- docs/specs.md | 2 +- skills/server-healthchecks/SKILL.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/specs.md b/docs/specs.md index 335e326..5197d85 100644 --- a/docs/specs.md +++ b/docs/specs.md @@ -238,7 +238,7 @@ restent à mesurer; aucune capacité chiffrée n'est annoncée ici. - Serilog (structure logging) - OpenTelemetry ready - Sentry SDK compatible GlitchTip -- Healthchecks (API, Agent, DB, RustFS, Broker IA, Ollama) +- Health checks Central : `/healthz` est la liveness du processus, `/readyz` vérifie PostgreSQL et le stockage actif, et `/health/live` vérifie PostgreSQL plus le backend IA configuré (CodeProject.AI ou Ollama; l'absence de backend IA est valide). Côté Agent, `/healthz` agrège `agent_health` et `live`, tandis que `/health/live` expose la dégradation du pipeline IA. Aucun health check Central distinct du broker distant n'est enregistré; voir [`HealthController`](../src/Heimdall.Web/Controllers/HealthController.cs), [`AiHealthCheck`](../src/Heimdall.Infrastructure/HealthChecks/AiHealthCheck.cs) et [`Agent Program`](../src/Heimdall.Agent/Program.cs). - Tests : xUnit + Shouldly + NSubstitute + bUnit + Testcontainers --- diff --git a/skills/server-healthchecks/SKILL.md b/skills/server-healthchecks/SKILL.md index 4bb0053..79fe7ef 100644 --- a/skills/server-healthchecks/SKILL.md +++ b/skills/server-healthchecks/SKILL.md @@ -8,6 +8,7 @@ description: Keep Heimdall container health probes aligned with the HTTP methods Use this workflow when changing `Dockerfile` health checks, Central Compose health checks, or Web health endpoint routing. - Central and Agent containers probe `/healthz` on port 8080 (the development Agent may bind its host-mapped port). ASP.NET maps this route for `GET`; a `HEAD` request returns 405 and marks a live server unhealthy. +- When documenting health status, compare each summary with the registered check names/tags and endpoint filters in Web and Agent. Web `/healthz` is liveness, `/readyz` checks the `ready` PostgreSQL and selected-storage dependencies, and `/health/live` selects the `live` PostgreSQL and optional configured AI backend check. Agent `/healthz` runs its registered health checks; `/health/live` selects only the Agent pipeline-degradation check. Do not claim a Central broker health check unless one is registered. - In the Alpine image, use BusyBox `wget` with `-O /dev/null` to issue a GET and discard the body. Do not use `--spider`, because BusyBox implements it as HEAD. - Apply this to both `docker/Dockerfile`/Central Compose and `docker/Dockerfile.agent`/Agent development Compose. Keep the image and Compose probes consistent, with bounded timeout/retries and no published health endpoint required. - For acceptance, build the changed Central or Agent image from source under a project-unique tag in a unique Compose project with a generated `.env`, synthetic credentials, a loopback-only unused port, and project-scoped volumes/network. Install an EXIT cleanup trap before build/start. Verify a GET health probe succeeds and an equivalent HEAD receives the endpoint's 405; then confirm the changed service reports healthy. In cleanup remove only that project with `down --volumes --remove-orphans`, verify no labeled containers/volumes/networks remain, remove and inspect each exact local image tag even on failure, and retain shared base images. Preserve the test exit status and report cleanup failures. -- 2.54.1 From 6ccf74313b0174be28972a0d994a83e94aca75f9 Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Fri, 13 Nov 2026 12:41:11 +0100 Subject: [PATCH 2/2] docs: record health probe status codes (#407) --- docs/specs.md | 2 +- skills/server-healthchecks/SKILL.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/specs.md b/docs/specs.md index 5197d85..540cd49 100644 --- a/docs/specs.md +++ b/docs/specs.md @@ -238,7 +238,7 @@ restent à mesurer; aucune capacité chiffrée n'est annoncée ici. - Serilog (structure logging) - OpenTelemetry ready - Sentry SDK compatible GlitchTip -- Health checks Central : `/healthz` est la liveness du processus, `/readyz` vérifie PostgreSQL et le stockage actif, et `/health/live` vérifie PostgreSQL plus le backend IA configuré (CodeProject.AI ou Ollama; l'absence de backend IA est valide). Côté Agent, `/healthz` agrège `agent_health` et `live`, tandis que `/health/live` expose la dégradation du pipeline IA. Aucun health check Central distinct du broker distant n'est enregistré; voir [`HealthController`](../src/Heimdall.Web/Controllers/HealthController.cs), [`AiHealthCheck`](../src/Heimdall.Infrastructure/HealthChecks/AiHealthCheck.cs) et [`Agent Program`](../src/Heimdall.Agent/Program.cs). +- Health checks Central : `/healthz` est une liveness toujours `200`; `/readyz` vérifie PostgreSQL et le stockage actif (`200` si healthy, sinon `503`); `/health/live` vérifie PostgreSQL plus le backend IA configuré (CodeProject.AI ou Ollama; l'absence de backend IA est valide) et renvoie `503` si un check n'est pas healthy. Côté Agent, `/healthz` agrège `agent_health` et `live` (`Degraded` → `200`, `Unhealthy` → `503`); `/health/live` expose la dégradation du pipeline IA (`200` healthy, sinon `503`). Aucun health check Central distinct du broker distant n'est enregistré; voir [`HealthController`](../src/Heimdall.Web/Controllers/HealthController.cs), [`AiHealthCheck`](../src/Heimdall.Infrastructure/HealthChecks/AiHealthCheck.cs) et [`Agent Program`](../src/Heimdall.Agent/Program.cs). - Tests : xUnit + Shouldly + NSubstitute + bUnit + Testcontainers --- diff --git a/skills/server-healthchecks/SKILL.md b/skills/server-healthchecks/SKILL.md index 79fe7ef..f532858 100644 --- a/skills/server-healthchecks/SKILL.md +++ b/skills/server-healthchecks/SKILL.md @@ -8,7 +8,7 @@ description: Keep Heimdall container health probes aligned with the HTTP methods Use this workflow when changing `Dockerfile` health checks, Central Compose health checks, or Web health endpoint routing. - Central and Agent containers probe `/healthz` on port 8080 (the development Agent may bind its host-mapped port). ASP.NET maps this route for `GET`; a `HEAD` request returns 405 and marks a live server unhealthy. -- When documenting health status, compare each summary with the registered check names/tags and endpoint filters in Web and Agent. Web `/healthz` is liveness, `/readyz` checks the `ready` PostgreSQL and selected-storage dependencies, and `/health/live` selects the `live` PostgreSQL and optional configured AI backend check. Agent `/healthz` runs its registered health checks; `/health/live` selects only the Agent pipeline-degradation check. Do not claim a Central broker health check unless one is registered. +- When documenting health status, compare each summary with the registered check names/tags, endpoint filters, and HTTP status mapping in Web and Agent. Web `/healthz` is liveness (`200`), `/readyz` checks the `ready` PostgreSQL and selected-storage dependencies (`200` only when healthy, otherwise `503`), and `/health/live` selects the `live` PostgreSQL and optional configured AI backend check (`503` when degraded). Agent `/healthz` runs its registered checks (`Degraded` maps to `200`, `Unhealthy` to `503`); `/health/live` selects only the Agent pipeline-degradation check (`503` when degraded). Do not claim a Central broker health check unless one is registered. - In the Alpine image, use BusyBox `wget` with `-O /dev/null` to issue a GET and discard the body. Do not use `--spider`, because BusyBox implements it as HEAD. - Apply this to both `docker/Dockerfile`/Central Compose and `docker/Dockerfile.agent`/Agent development Compose. Keep the image and Compose probes consistent, with bounded timeout/retries and no published health endpoint required. - For acceptance, build the changed Central or Agent image from source under a project-unique tag in a unique Compose project with a generated `.env`, synthetic credentials, a loopback-only unused port, and project-scoped volumes/network. Install an EXIT cleanup trap before build/start. Verify a GET health probe succeeds and an equivalent HEAD receives the endpoint's 405; then confirm the changed service reports healthy. In cleanup remove only that project with `down --volumes --remove-orphans`, verify no labeled containers/volumes/networks remain, remove and inspect each exact local image tag even on failure, and retain shared base images. Preserve the test exit status and report cleanup failures. -- 2.54.1