Skip to content

refactor: extract fleet-specific systemd services - #297

Closed
hanthor-hive-agent[bot] wants to merge 1 commit into
masterfrom
arch/refactor-dotfiles-systemd
Closed

hanthor-hive-agent[bot] wants to merge 1 commit into
masterfrom
arch/refactor-dotfiles-systemd

Conversation

@hanthor-hive-agent

@hanthor-hive-agent hanthor-hive-agent Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Refactor

Extract the host-specific monitoring and phone orchestration units from the generic roles/systemd role into roles/systemd_hive_services.

  • Move system-mitigator.py, its user unit, and the phone-apply service/timer without changing their bytes or runtime conditions.
  • Wire the new role in site.yml with the existing services/systemd tags and skip_systemd gate, plus a role-specific tag.
  • Keep the generic role responsible for Podman, dotfiles-update, and Atuin services.
  • Document the new boundary in docs/src/roles/systemd_hive_services.md, docs/src/roles/systemd.md, docs/src/index.md, docs/src/SUMMARY.md, and the service-role table in docs/src/architecture.md.

Refs #280 (partial: this PR extracts the systemd cluster; the ssh_keys and pipewire_audio role decompositions remain open).


Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

Signed-off-by: architect <architect@hive.kubestellar.io>
@hanthor-hive-agent

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "architect" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

2 similar comments
@hanthor-hive-agent

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "architect" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hanthor-hive-agent

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "architect" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hanthor-hive-agent hanthor-hive-agent Bot added agent/architect Approved by a Hive merger/owner for auto-merge on green CI hive/hive-slim-hare Approved by a Hive merger/owner for auto-merge on green CI labels Oct 18, 2026
@github-actions
github-actions Bot enabled auto-merge (squash) October 18, 2026 02:23
@github-actions

Copy link
Copy Markdown

Queued for auto-merge, but these paths run on fleet machines and need @hanthor's review first:

  • roles/systemd/tasks/main.yml
  • roles/systemd_hive_services/files/system-mitigator.py
  • roles/systemd_hive_services/handlers/main.yml
  • roles/systemd_hive_services/tasks/main.yml
  • roles/systemd_hive_services/templates/phone-apply.service.j2
  • roles/systemd_hive_services/templates/phone-apply.timer.j2
  • roles/systemd_hive_services/templates/system-mitigator.service.j2
  • site.yml

@hanthor-hive-agent

Copy link
Copy Markdown
Contributor Author

⚠️ Hold-gate mergeability: this PR has a real conflict with its base

This PR is hold-gated and has fallen behind its base branch. The hive tried to merge the base in to keep it mergeable while it waits on review, but that merge conflicts and the hive cannot resolve it automatically.

It will stay held and will NOT merge on its own even once reviewed — removing hold alone will not be enough. Someone will need to merge or rebase the base branch in by hand (or resolve the conflict another way) before this PR can merge.

@hanthor-hive-agent hanthor-hive-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extraction itself checks out; the PR cannot merge — site.yml conflicts with master.

I merge-tested the head (d92574a) against master locally: site.yml is the only conflicting file. Everything else (including docs/src/SUMMARY.md) auto-merges. The sibling role PRs #295, #300 and #305 all add entries to the same roles: list in site.yml, which is the likely cause. One rebase on master should clear it; no other file needs attention.

What I verified in the move itself, because a "pure move" refactor is only safe if it really is one:

  • All four assets are 100%-similarity renames, not copies: roles/systemd/files/system-mitigator.py, templates/system-mitigator.service.j2, templates/phone-apply.service.j2, templates/phone-apply.timer.j2 → roles/systemd_hive_services/.... No leftover duplicates in the generic role.
  • The eight moved tasks match the block removed from roles/systemd/tasks/main.yml (hunk @@ -132,75 +132,3 @@) line for line apart from the handler name below, including every when: inventory_hostname == 'himachal' and both phone_apply_enabled branches (enable, stop-and-disable with failed_when: false, and unit removal).
  • The handler rename is consistent: the new role defines Reload systemd hive user daemon (roles/systemd_hive_services/handlers/main.yml:2) and all four notify: sites in the new tasks reference that name, not the old Reload systemd user daemon left behind in roles/systemd/handlers/main.yml:2. No dangling notify in either direction.
  • The new role does not depend on the old one running first: it recreates ~/.config/systemd/user itself as its first task, so --tags systemd_hive_services works standalone.
  • site.yml:133-135 reuses the existing services/systemd tags and the same when: not skip_systemd | default(false) gate, so just apply and --skip-tags systemd behave exactly as before.

One thing I could not verify and am leaving as an open question, not a finding: these units are gated to inventory_hostname == 'himachal', so nothing in CI exercises the moved tasks. The first real proof is an apply run on himachal.

Refs #280 (partial) matches what the diff does — the ssh_keys and pipewire_audio decompositions are genuinely untouched here, so the non-closing reference is correct.

Looks correct to me apart from the conflict.

— hive: agent=reviewer backend=omp model=anthropic/claude-opus-5:high omp=18.12.1

@hanthor hanthor left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moves himachal-only mitigator/phone-apply units into a new systemd_hive_services role with same host guards, handler and site.yml wiring; CI green.

@hanthor

hanthor commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Stale hive-agent PR (2026-10-29): the hives no longer cover this repo, and #348 replaces roles/systemd with native units.

Closed during the 2026-11-18 cleanup. The branch is kept, so this can be reopened.

@hanthor hanthor closed this Nov 18, 2026
auto-merge was automatically disabled November 18, 2026 18:36

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/architect Approved by a Hive merger/owner for auto-merge on green CI hive/hive-slim-hare Approved by a Hive merger/owner for auto-merge on green CI hold needs-human

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant