Skip to content

feat: support template quadlets and template units - #52

Merged
outergod merged 9 commits into
masterfrom
support-template-quadlets
Nov 29, 2026
Merged

outergod merged 9 commits into
masterfrom
support-template-quadlets

Conversation

@outergod

@outergod outergod commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Archives two OpenSpec changes; releases as 3.1.0 (minor).

support-template-quadlets (minor)

  • Unit files whose stem ends in @ are templates. core-ops writes them and reloads systemd, but never starts, stops, queries or verifies the template unit.
  • Loader rejects template .pod/.mount/.automount and .volume/.network/.pod instance files; validation rejects two files that compile to the same runtime unit.
  • Running instances are discovered with systemctl list-units, keeping only units systemd loaded from the template (FragmentPath) and never listing volume templates, and are shown under the template in plan.
  • Removing a template stops its instances first. A template or referenced-config change keeps instances by default; --restart-instances (plan/apply/agent, or CORE_OPS_RESTART_INSTANCES for the agent) queues a restart with --no-block, so apply never waits on a oneshot build.
  • The bundled core-ops skill document is copied out of frozen specs/016-… to skill/core-ops-source-repo/SKILL.md (now the embedded, shipped copy) and documents the template rules; the frozen original stays unchanged.
  • New accepted VM scenario accepted-template-quadlet-lifecycle with the template-quadlet-history fixture.

fix-verify-guest-hangs (patch)

  • core-ops-verify now drains guest command stdout/stderr while waiting. Previously a step printing more than a pipe holds stalled until its timeout (8 KiB pipes once the user exceeds fs.pipe-user-pages-soft); this also broke the journalctl -b diagnostic collection.
  • The harness Ignition templates disable Zincati auto-updates, which were rebooting guests mid-scenario.

Verification

  • cargo build --locked, cargo test (64 lib + 550), cargo clippy --all-targets -- -D warnings, openspec validate --strict, core-ops-release validate --base-ref origin/master all pass.
  • accepted-template-quadlet-lifecycle passed on the blessed VM profile (26/26 steps, 23/23 assertions); apply --restart-instances returned in 701 ms against a 600 s oneshot instance. On that guest Zincati logged auto-updates logic disabled by configuration and no update was staged.
  • The E2E gate (full accepted corpus) still needs homelab-e2e approval.

Notes

  • socket-restart-sequence touches the same planner code; whichever merges second rebases (design D11 of support-template-quadlets).

🤖 Generated with Claude Code

outergod and others added 4 commits November 29, 2026 13:14
Plan, apply and agent stop breaking on systemd template units: templates are written but never started, queried, verified or recovered. Running instances are discovered and reported; --restart-instances (CORE_OPS_RESTART_INSTANCES for the agent) restarts them when the template or a config it uses changes, and removing a template stops them. Supports .container, .volume, .network and native template kinds with Podman's naming, rejects .pod/.mount/.automount templates and non-container instance files, and adds a runtime unit uniqueness check. New capability: unit-activation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a step timeout, the harness read the SSH client's stdout and stderr
only after it exited, so a step printing more than a pipe holds (8 KiB
once the user exceeds fs.pipe-user-pages-soft) stalled until its
timeout. Read both pipes on threads while waiting.

Verification guests booted an old base image and Zincati rebooted them
mid-scenario to apply an update. Disable Zincati auto-updates in the
harness Ignition templates.

OpenSpec change: fix-verify-guest-hangs (archived).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit file whose stem ends in `@` (`site-build@.container`,
`cache@.volume`, `lan@.network`, native `.socket`/`.timer`/`.path`/
`.target`) is a template. core-ops writes it and reloads systemd but
never starts, stops, queries or verifies the template unit.

- Loader rejects template `.pod`/`.mount`/`.automount` and `.volume`/
  `.network`/`.pod` instance files; validation rejects two files that
  compile to the same runtime unit.
- Observation lists a template's running instances with
  `systemctl list-units`, skipping volume templates and units that have
  their own unit file.
- `plan` shows each running instance under its template. Removing a
  template stops its instances first; a template or referenced config
  change keeps them by default and restarts them (queued, `--no-block`)
  with the new `--restart-instances` flag on plan/apply/agent or
  `CORE_OPS_RESTART_INSTANCES` for the agent.
- The bundled skill moves out of the frozen `specs/016-…` tree to
  `skill/core-ops-source-repo/SKILL.md` and documents template rules.
- Accepted VM scenario `accepted-template-quadlet-lifecycle` with the
  `template-quadlet-history` fixture.

OpenSpec change: support-template-quadlets (archived).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T16:15:49.087114Z 4aa0996 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ae11f6101

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skill/core-ops-source-repo/SKILL.md Resolved
Comment thread src/io/observed.rs Resolved
outergod and others added 2 commits November 29, 2026 16:39
… the template

Comparing listed units against the observed workload files missed unit
files core-ops does not observe, such as an independently installed
`backup@daily.timer` next to a managed `backup@.timer`; removing or
restarting the template would then have stopped or restarted it. Ask
systemd instead: keep only units whose FragmentPath is the template unit.

Addresses Codex review finding on #52.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`specs/` is frozen history, and feature 016's plan and tasks refer to
`specs/016-source-repository-layout/skill/SKILL.md`. Restore it
byte-for-byte; the shipped, embedded copy stays at
`skill/core-ops-source-repo/SKILL.md`.

Addresses Codex review finding on #52.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35421dc3dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/planner.rs Resolved
Removing a managed mount stops every desired container first, which
included templates and ran `systemctl stop site-build@.service`,
bypassing the planner's template guard and possibly failing the mount
removal. Skip template workloads there as well.

Addresses Codex review finding on #52.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e474b516b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/apply.rs Resolved
`apply --rollback-to … --rollback-plan-only` rendered its human and JSON
reports from the rollback plan without template instance dispositions,
so a rollback that changes or removes a template with running instances
looked the same with and without `--restart-instances`. Annotate the
preview plan with the dispositions for the rollback target, and compute
the plan-only executable plan once instead of twice.

Addresses Codex review finding on #52.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@outergod
outergod merged commit 8d99cc7 into master Nov 29, 2026
5 checks passed
@outergod
outergod deleted the support-template-quadlets branch November 29, 2026 17:05

This branch was previously deployed

1 inactive deployment
homelab-e2e — 4aa09966 Deployed Nov 29, 2026 by outergod via e2e-gate #118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant