refactor!: remove the deprecated warden role #30

Merged
claudiomaradonna merged 3 commits from refactor/remove-warden into main 2026-10-08 10:51:28 +02:00
Collaborator

Why

warden is deprecated. castrum still shipped the role, plus three ai-stack settings that existed only for its escalation path. One of them, ai_stack_localrecall_port (default 8082), published LocalRecall, which put it on the LAN wherever a host kept the default, because Docker publishes past the castrum table. Design and plan: .plans/2026-10-08-warden-removal{-design,}.md (local).

What changed

  • BREAKING: the warden role is removed, along with its service_roles and MOLECULE_ROLES entries, its catalogue row and the docs that used it as an example. firewall-apply's scenarios keep their cases through swarm.
  • BREAKING: ai_stack_localrecall_port and ai_stack_network_subnet are removed, and so is ai-net's attachable. LocalRecall publishes no port; only localagi reaches it, on ai-net. The templates, README, molecule assertions and migration doc follow.
  • The ai-stack docs now name both GPU paths docker-engine's assert accepts.
  • No tenant enabled warden, so no host's configuration changes. The one ai_mainframes host already left LocalRecall unpublished. Its next live run should recreate ai-net once and restart the stack; the commit body of refactor(ai-stack)! has the check and the fallback.
  • The refactor(roles)! commit body lists the one-off cleanup for a host that ran warden.

Verification

  • make check passed after each commit, and every relative link resolves.
  • A local render of compose.yml.j2 with the role's defaults differs from main only in the header comment, attachable and LocalRecall's ports:. The new molecule assertions hold against that render.
  • change-reviewer and docs-auditor ran on the branch; the confirmed findings are fixed.
  • Not run: make test (no podman in the agent sandbox). It covers the ai-stack and firewall-apply default and peered scenarios.

Risks and follow-ups

  • Merge the castrum-fleet PR that drops the host's now-unused ai_stack_localrecall_port: "" only after this one. Merged first, the old default would publish LocalRecall on 8082 there.
  • After the live run, check docker network inspect ai-stack_ai-net --format '{{.Attachable}}'. If it still prints true, run docker compose down in ai_stack_root, then the play.
## Why warden is deprecated. castrum still shipped the role, plus three ai-stack settings that existed only for its escalation path. One of them, `ai_stack_localrecall_port` (default `8082`), published LocalRecall, which put it on the LAN wherever a host kept the default, because Docker publishes past the castrum table. Design and plan: `.plans/2026-10-08-warden-removal{-design,}.md` (local). ## What changed - **BREAKING:** the `warden` role is removed, along with its `service_roles` and `MOLECULE_ROLES` entries, its catalogue row and the docs that used it as an example. firewall-apply's scenarios keep their cases through swarm. - **BREAKING:** `ai_stack_localrecall_port` and `ai_stack_network_subnet` are removed, and so is ai-net's `attachable`. LocalRecall publishes no port; only localagi reaches it, on ai-net. The templates, README, molecule assertions and migration doc follow. - The ai-stack docs now name both GPU paths docker-engine's assert accepts. - No tenant enabled warden, so no host's configuration changes. The one ai_mainframes host already left LocalRecall unpublished. Its next live run should recreate ai-net once and restart the stack; the commit body of `refactor(ai-stack)!` has the check and the fallback. - The `refactor(roles)!` commit body lists the one-off cleanup for a host that ran warden. ## Verification - `make check` passed after each commit, and every relative link resolves. - A local render of `compose.yml.j2` with the role's defaults differs from main only in the header comment, `attachable` and LocalRecall's `ports:`. The new molecule assertions hold against that render. - `change-reviewer` and `docs-auditor` ran on the branch; the confirmed findings are fixed. - Not run: `make test` (no podman in the agent sandbox). It covers the ai-stack and firewall-apply `default` and `peered` scenarios. ## Risks and follow-ups - Merge the castrum-fleet PR that drops the host's now-unused `ai_stack_localrecall_port: ""` only after this one. Merged first, the old default would publish LocalRecall on 8082 there. - After the live run, check `docker network inspect ai-stack_ai-net --format '{{.Attachable}}'`. If it still prints `true`, run `docker compose down` in `ai_stack_root`, then the play.
warden is deprecated. No tenant enables it, so no host's configuration
changes; a host that still carries a warden chain loses it at its next
firewall-apply run.

The role goes, with its entry in service_roles and MOLECULE_ROLES, its
catalogue row and the docs that used it as an example (per-host flags
now cite zram, the --tags examples ai-stack). firewall-apply's default
scenario keeps its "switched on with no admitted source gets an empty
chain" case through swarm with no peers group and no sources; peered
keeps swarm and ai-stack as its restricted rules; the firewall_render
fixture drops it.

One-off cleanup, as root, on a host that ran warden:

  systemctl --user -M warden@ disable --now warden.service
  loginctl terminate-user warden
  while pgrep -u warden >/dev/null; do sleep 1; done
  loginctl disable-linger warden
  userdel -r warden
  grep '^warden:' /etc/subuid /etc/subgid   # remove any line left
  rm -rf /etc/warden /usr/local/bin/warden

and remove the LocalAGI agent's MCP entry that pointed at warden. The
wait matters: terminate-user returns while rootless containers are
still stopping, and userdel refuses a user with live processes.

BREAKING CHANGE: the warden role and every warden_* variable are gone.
ai_stack_localrecall_port published LocalRecall (default 8082) for
warden's jail sessions; ai_stack_network_subnet pinned ai-net so
warden's rule could admit it; attachable let warden's jails join ai-net.
With warden gone all three serve nothing, and the publish put
LocalRecall on the LAN wherever a host kept the default, because Docker
publishes past the castrum table.

LocalRecall now publishes no port, and ai-net is a plain bridge; only
localagi reaches LocalRecall, through LOCALAGI_LOCALRECALL_URL. The
published-service assert checks LocalAI and LocalAGI only. The compose
and env templates lose their escalation-path comments; the README,
defaults, port-file comment, ADVANCED_USAGE's ai_mainframes row and the
migration doc follow (step 1 records the old ports, step 6 probes them).
The molecule scenario asserts that localrecall has no ports and ai-net
no other key.

A local render with the role's defaults differs from main only in the
header comment, attachable and localrecall's ports. On the one
ai_mainframes host, which already set the port empty, ai-net loses
attachable. Compose recreates a network whose config-hash label
changed, restarting the stack once, but may reuse one an older Compose
created without that label. After the live run,

  docker network inspect ai-stack_ai-net --format '{{.Attachable}}'

prints false once ai-net was recreated. If it prints true, or compose
refuses, run `docker compose down` in ai_stack_root, then the play.

BREAKING CHANGE: ai_stack_localrecall_port and ai_stack_network_subnet
are removed; LocalRecall is no longer published and ai-net is no longer
attachable.
ai_stack_gpu_enabled's README bullet and defaults comment said
docker-engine's assert requires a registered nvidia runtime. The assert
accepts either that or an NVIDIA CDI spec, as docker-engine's README
says, so a DGX-style host with only a CDI spec read as unsupported.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
claudiomaradonna/castrum!30
No description provided.