Repository navigation
feat: support template quadlets and template units - #52
Conversation
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>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
There was a problem hiding this comment.
💡 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".
… 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>
There was a problem hiding this comment.
💡 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".
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>
There was a problem hiding this comment.
💡 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".
`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>
Summary
Archives two OpenSpec changes; releases as 3.1.0 (
minor).support-template-quadlets (minor)
@are templates. core-ops writes them and reloads systemd, but never starts, stops, queries or verifies the template unit..pod/.mount/.automountand.volume/.network/.podinstance files; validation rejects two files that compile to the same runtime unit.systemctl list-units, keeping only units systemd loaded from the template (FragmentPath) and never listing volume templates, and are shown under the template inplan.--restart-instances(plan/apply/agent, orCORE_OPS_RESTART_INSTANCESfor the agent) queues a restart with--no-block, so apply never waits on a oneshot build.core-ops skilldocument is copied out of frozenspecs/016-…toskill/core-ops-source-repo/SKILL.md(now the embedded, shipped copy) and documents the template rules; the frozen original stays unchanged.accepted-template-quadlet-lifecyclewith thetemplate-quadlet-historyfixture.fix-verify-guest-hangs (patch)
core-ops-verifynow 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 exceedsfs.pipe-user-pages-soft); this also broke thejournalctl -bdiagnostic collection.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/masterall pass.accepted-template-quadlet-lifecyclepassed on the blessed VM profile (26/26 steps, 23/23 assertions);apply --restart-instancesreturned in 701 ms against a 600 s oneshot instance. On that guest Zincati loggedauto-updates logic disabled by configurationand no update was staged.homelab-e2eapproval.Notes
socket-restart-sequencetouches the same planner code; whichever merges second rebases (design D11 of support-template-quadlets).🤖 Generated with Claude Code