Repository navigation
feat(init): let a candy ship socket/target/timer/path/slice units to systemd - #419
Merged
Merged
Conversation
…systemd
B1's last item, and the half that had to wait for sdk#176.
systemd's candy_file: listed only *.service, and its assembly_template hardcoded
that same extension TWICE:
cp /systemd/*.service /usr/lib/systemd/user/ && \
for svc in /systemd/*.service; do systemctl --global enable ...; done
The pair agreed only because both were frozen. A candy could not ship a .socket,
.target or .slice at all - and widening either side alone would have been worse
than leaving it: widening candy_file: would stage units the copy never installs,
widening the copy would install units nothing collected.
Both move together now. candy_file: claims .service/.socket/.target/.timer/.path/
.slice, and the assembly copies EVERY staged unit, then enables only the types
systemd can enable.
.slice is claimed but deliberately NOT enabled: a slice is a resource container
referenced by other units' Slice=, and `systemctl enable` on one is an error, not
a no-op. That distinction is asserted, not just commented.
The enable loop carries an existence guard because an unmatched glob stays literal
in sh - without it, a candy shipping only services would fail the build on
`systemctl enable '/systemd/*.socket'`.
This is inert without sdk#176, which made candy_file: honoured at all (the scan is
init-agnostic, so the patterns are globbed at the point of use). The sdk pin moves
to v0.2026240.1542, which also carries #177's fix for the depends_candy
false positive that #176 introduced.
TestEmbeddedVocab_SystemdClaimsEveryUnitTypeItInstalls guards the pair that has to
stay consistent - what candy_file: claims versus what the assembly copies and
enables - so neither side can drift again. Verified to fail on the pre-change
vocabulary rather than assumed.
Assisted-by: Claude Code Anthropic Opus 5 (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq
Contributor
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (description accounts for all 4 files), no secrets/exfiltration, no weakened guardrails; the sdk pin bump ( Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch B1's last item, and the half that had to wait for
opencharly/sdk#176.systemd's
candy_file:listed only*.service, and itsassembly_templatehardcoded that sameextension twice:
The pair agreed only because both were frozen. A candy could not ship a
.socket,.targetor.sliceat all — and widening either side alone would have been worse than leaving it: wideningcandy_file:stages units the copy never installs; widening the copy installs units nothingcollected. So both move together here.
candy_file:now claims.service.socket.target.timer.path.slice, and the assemblycopies every staged unit, then enables only the types systemd can enable.
Two details that are asserted rather than merely commented:
.sliceis claimed but never enabled. A slice is a resource container referenced by otherunits'
Slice=;systemctl enableon one is an error, not a no-op.sh, so without[ -e "$unit" ] || continuea candy shipping only services would fail the build onsystemctl enable '/systemd/*.socket'.This is inert without
sdk#176, which madecandy_file:honoured at all (the candy scan isinit-agnostic, so the patterns are globbed at the point of use). The sdk pin moves to
v0.2026240.1542, which also carries#177's fix for thedepends_candyfalse positive#176introduced.
Why this matters beyond tidiness
cstream's session layer needs exactly the unit types that were unreachable — a
.socketfor thesocket-activated broker, a
.targetfor the session, and a.slicedrop-in. Before this, those hadto be hand-written with
write:+command: systemctl daemon-reload && enable, which is the R4violation batch B4 exists to remove.
How tested
Coverage that fails without the change
TestEmbeddedVocab_SystemdClaimsEveryUnitTypeItInstallsguards the pair that has to stayconsistent — what
candy_file:claims versus what the assembly copies and enables. Against thepre-change vocabulary:
Verified by reverting
charly.ymland re-running, not by inspection.Module gates
Fresh-rebuild R10 on a disposable bed, from the committed tree
The assembly template every systemd image renders through changed, and the sdk pin moved, so the bed
was re-run with the binary built from the final commit:
Rulebook compliance
/charly-image:layer(init polymorphism,service:/candy_file:) and/charly-check:checkloaded before editing.depends_candyfalse positive observed while testingthis change was root-caused and fixed in
sdk#177before this leg landed, not worked around here.were two hardcoded copies of
*.service.caveat; no sleeps, retries or environment-specific shims.
*.servicecopy is deleted, not left beside the new loop(
git grep 'cp /systemd/\*.service'returns nothing).git statuschecked; branch off freshmain; no force-push, no bypass.RUNline, asserted directly by the guard test.task build:binaryoutput.#Box.init's enum widening was the spec leg(
opencharly/spec#57, merged).Change classification
candy_file:+assembly_template) plusa pin bump.
analysed on a live system. The supervisord path ran a full green R10and the vocabulary/assembly consistency is asserted directly, but no bed deploys a systemd
image, so a candy actually shipping a
.socketis not proven installed end to end. Claimingfully tested and validatedwould paper over that; closing it is what the cstream VM bed is for.Not covered
sdk#175(render context +#Box.init),plugin-init#2(stdout mappers),charly#418(quoting + stdout),sdk#176(candy_file:),spec#57(enum), and this.init: systemdon a container also requires thepreserve_usercapability and a candy that triggers the init, so a box declaring it still resolves supervisord
today — correct behaviour (
ResolveInitSystemignores an untriggered explicit init), but it meansthe systemd
file_copypath has no live coverage anywhere in the corpus. That gap is the cstreamVM bed's job.
Assisted-by: Claude Code Anthropic Opus 5 (analysed on a live system)