Files
Heimdall/skills/agent-startup-composition/SKILL.md
T
arnaud.dartois 060239d10e
Heimdall Gitea / Detect CI scope (push) Successful in 6s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 2s
test(agent): validate startup dependency composition (#343)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-12 16:24:08 +01:00

1.9 KiB

name, description
name description
agent-startup-composition Validate Heimdall Agent dependency-injection composition by starting its source-built container without a Central dependency.

Agent startup composition

src/Heimdall.Agent/Program.cs constructs SnapshotPipelineServiceOptions in the service-registration factory before registering the hosted service. Do not register SnapshotPipelineService with the generic AddHostedService<T>() unless every constructor dependency, including that options record, is registered in DI. A missing dependency can prevent Host.StartAsync and leave the Agent container unable to start.

Acceptance

Run bash skills/agent-startup-composition/acceptance.sh from the repository root. The recipe builds only the CPU Agent image from the current checkout with a unique local tag and starts it in a disposable Compose project with generated site-token data and an internal-only network. Its Central URL points to the Agent container's own unused loopback port; it cannot reach a deployment.

The recipe proves that:

  1. The Agent host starts and remains running with its production service registrations, including SnapshotPipelineService.
  2. /health/live responds successfully before registration with Central; the readiness endpoint /healthz is intentionally not used because it reports Unhealthy until Central registration succeeds.
  3. Startup logs do not contain the missing SnapshotPipelineServiceOptions dependency or a host-start failure.
  4. Cleanup removes the exact Compose project, generated state volume/network, and this recipe's one exact Agent image tag, then verifies their absence.

This checks DI and host startup only. It does not validate Central registration, camera discovery, model inference, a published Agent, or a deployed installation. The EXIT trap preserves the test result, attempts each cleanup independently, and reports cleanup failures. The Dockerfile's shared .NET base images remain.