Watch
0
0
Fork
You've already forked hyperhive
0

swarm: set an agent's config repo avatar from its icon

The agent module exposes the PNG nix renders from the agent's icon as the
read-only option services.hyperhive.agent.iconPng, which the forge and matrix
avatar syncs now share. When the builder reads an icon it builds that one
attribute with nix build and sends the file, base64, next to the SVG in the
meta build reply, so the builder runs no renderer of its own.

After recording the icon, the controller sets the avatar of
agent-configs/<agent> from the PNG as the forge admin, removes the avatar when
the icon is removed, and leaves it alone when the builder sent no PNG. A marker
per repo holds the image's fingerprint, so a build whose icon did not change
makes no forge call; a forge that refuses the avatar does not fail the build.
An old builder sends no PNG, so it changes nothing.
This commit is contained in:
iris 2026-11-22 23:23:30 +01:00 • committed by mara
commit 1a31a4cd5a

View file

@ -409,6 +409,12 @@ one per hive. It ensures them at start and every five minutes after
- the `agent-configs` org avatar
(`deploy.swarm-controller.configOrgAvatarPng`).
The config repos get the agent's icon too. When a build sets the agent's icon,
the controller sets the avatar of `agent-configs/<agent>` from the PNG the
builder rendered (`forge/repo_avatar.rs`), as the forge admin, who may edit any
repo's avatar. A marker per repo (`forge-repo-avatar-<repo>`) holds the image's
SHA-256, as for the service accounts below.
The swarm's own forge accounts (`builder`, `ci-metrics` and `review-classifier`)
get an avatar too, from a separate pass in the controller (`forge/service_avatars.rs`).
Each has an icon in a hexagonal frame (`branding/service-<login>.svg`, rendered to a PNG