Repository navigation
feat(service): carry the portable lifecycle fields into the render context - #59
Merged
Merged
Conversation
…ntext
The consumer half of spec#58. Those fields were authorable on a #CandyService but
BuildServiceRenderContext - the pure entry -> context projection every init
template renders against - dropped them, so nothing could reach a template. The
schema said yes and the renderer never saw it.
Carried verbatim, like the start hooks and for the same reason: each is an
init-level directive value, not a path to expand or an ordering list to merge.
Two tests, both revert-controlled:
- the fields survive the projection, including unit_options' LIST form, which
systemd needs for repeatable directives like RuntimeDirectory= - collapsing it
to a scalar would emit one unusable value instead of two lines.
- an entry setting NONE of them leaves the context's fields zero, so an existing
candy renders byte-identically. That is the assertion that makes "purely
additive" checkable rather than asserted.
Assisted-by: Claude Code Anthropic Opus 5 (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (carries exactly the five fields claimed), no secrets/network/egress, no weakened guardrails, no new deps, no embedded directives. 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
The consumer half of #58, and the second leg of batch B2.
#58 made
type,requires,restart_sec,watchdog_secandunit_optionsauthorable on a#CandyService. ButBuildServiceRenderContext— the pureServiceEntry→ render-contextprojection every init template renders against — dropped them, so nothing could reach a template.
The schema said yes and the renderer never saw it.
They are now carried verbatim, like the start hooks and for the same reason: each is an init-level
directive value, not a path to expand or an ordering list to merge.
How tested
Coverage that fails without the change
Two tests, and the second is the one that makes "purely additive" checkable rather than merely
claimed:
unit_options' list form. systemd needs thatfor repeatable directives such as
RuntimeDirectory=; collapsing it to a scalar would emit oneunusable value instead of two lines, so the element type is asserted, not just the key.
byte-identically. Without this, "additive" would rest on inspection.
Gates
Rulebook compliance
/charly-image:layer(theservice:schema and init polymorphism) loaded before editing.$TMPDIRtests that fail from a/tmpcheckout were diagnosed in fix(box): make openrc selectable via #Box.init #57;this suite is run from outside
/tmp.duplicate that used to exist in
deploykitwas removed insdk#175).git statuschecked; branch off freshmain; no force-push, no bypass.until the template legs land, which is why the tier is capped.
Change classification
analysed on a live system— the projection is exercised directly, but notemplate reads the fields yet, so there is no rendered output to prove.
Not covered — what still makes these fields inert
plugin-init+charly: the templates. systemd needsType=,Requires=,RestartSec=,WatchdogSec=and a range overunit_options.systemd; OpenRC needsneedin itsdepend()block,--respawn-delayand--healthcheck-timer. Until that lands, these fields are authorable, carried,and rendered nowhere — which is exactly why this PR claims nothing about emitted units.
B2's third item,
wait_for:, remains its own unit, as set out in #58: nine hand-rolledwhile [ ! -e "$SOCKET" ]loops exist today, and the honest gate for replacing them is deleting thatduplication with the affected beds staying green.
Assisted-by: Claude Code Anthropic Opus 5 (analysed on a live system)