Repository navigation
fix: resolve the deferred {{.Home}} token on machine venues - #188
Merged
Merged
Conversation
A home-relative `copy: to: ${HOME}/...` is TOKENIZED at compile into
"{{.Home}}/..." so each emit target resolves it against the DESTINATION home. The
OCI target does that (OCITarget.emitPlan -> spec.ResolveHome). The machine-venue
walk had no equivalent, so the literal token reached PutFile and the file landed in
a directory named "{{.Home}}" inside the venue home - silently, with no error, while
the sibling mkdir/write/command verbs in the same candy applied normally.
Measured on a live Arch guest: /home/arch/{{.Home}}/copyprobe/copied.txt.
WalkPlans now resolves the token across the same field set spec.ResolveHome covers,
before any step runs, so the machine venue and the OCI target resolve the same
places. The venue home is probed LAZILY - only a plan that actually carries the
token pays the extra RunCapture - and that probe is now one helper shared with the
env.d managed-block finalizer, which carried its own inline copy.
An unresolvable home is a no-op rather than substituting empty, so a failed probe
cannot silently rewrite ${HOME}/x into /x.
Closes opencharly/charly#460.
Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (diff matches the described fix exactly), no secrets/exfiltration, no network calls, no weakened guardrails, no supply-chain changes, no embedded directives. Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
github-actions Bot
pushed a commit
to opencharly/plugin-deploy-vm
that referenced
this pull request
Aug 29, 2026
…#3) This plugin walks deploy plans via kit.WalkPlans, which until sdk v0.2026241.2117 never resolved the deferred {{.Home}} token on a machine venue. A candy's home-relative `copy: to: ${HOME}/...` therefore reached PutFile carrying the literal token and landed in a directory named "{{.Home}}" inside the guest home - silently, while the sibling mkdir/write/command verbs applied normally. The fix is in the sdk (opencharly/sdk#188); this repin is what delivers it to target: vm deploys. Verified end to end on a disposable Arch cloud-image VM bed: the reproducer's copy assertion fails on the old pin and passes on this one. Refs opencharly/charly#460. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
This was referenced Aug 29, 2026
fix: bump sdk to v0.2026241.2117 for the machine-venue home-token fix
opencharly/plugin-deploy-pod#5
Merged
github-actions Bot
pushed a commit
to opencharly/plugin-installstep
that referenced
this pull request
Aug 29, 2026
…#2) This plugin walks deploy plans through kit.WalkPlans, which until sdk v0.2026241.2117 never resolved the deferred {{.Home}} token on a machine venue. A candy's home-relative copy: to: ${HOME}/... therefore reached PutFile carrying the literal token and landed in a directory named "{{.Home}}" in the venue home - silently, while the sibling mkdir/write/command verbs applied normally. The fix is in the sdk (opencharly/sdk#188); this repin delivers it to install-step execution on machine venues. Refs opencharly/charly#460. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
github-actions Bot
pushed a commit
to opencharly/plugin-deploy-local
that referenced
this pull request
Aug 29, 2026
…#3) This plugin walks deploy plans through kit.WalkPlans, which until sdk v0.2026241.2117 never resolved the deferred {{.Home}} token on a machine venue. A candy's home-relative copy: to: ${HOME}/... therefore reached PutFile carrying the literal token and landed in a directory named "{{.Home}}" in the venue home - silently, while the sibling mkdir/write/command verbs applied normally. The fix is in the sdk (opencharly/sdk#188); this repin delivers it to target: local host deploys. Refs opencharly/charly#460. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
github-actions Bot
pushed a commit
to opencharly/plugin-deploy-pod
that referenced
this pull request
Aug 29, 2026
…#5) This plugin walks deploy plans through kit.WalkPlans, which until sdk v0.2026241.2117 never resolved the deferred {{.Home}} token on a machine venue. A candy's home-relative copy: to: ${HOME}/... therefore reached PutFile carrying the literal token and landed in a directory named "{{.Home}}" in the venue home - silently, while the sibling mkdir/write/command verbs applied normally. The fix is in the sdk (opencharly/sdk#188); this repin delivers it to pod deploys (overlay candies applied onto a running pod). Refs opencharly/charly#460. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
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
Fixes opencharly/charly#460: a candy's
copy:step silently fails to deliver on atarget: vm/target: localdeploy.Root cause. A home-relative
copy: to: ${HOME}/...is tokenized at compile into{{.Home}}/...so each emit target resolves it against the destination home — thedeliberate design recorded in
install_build.go("Tokenize a home-relativeto:so eachEmitTarget resolves it against the real destination home at emit"). The OCI target does
that, in
OCITarget.emitPlan:The machine-venue walk had no equivalent.
walkOppassedstep.Tostraight toPutFile, so the literal token reached the venue.Observed on a live Arch guest — the file is delivered, just to a directory literally
named
{{.Home}}:No error is raised, which is why it went unnoticed:
mkdir:,write:andcommand:fromthe same candy in the same deploy all apply normally, because those legs render shell that
expands
$HOMEat runtime. Only thePutFile-staged verbs are affected.Why it matters beyond one candy:
pod-swaydelivers both itssway-wrapperand itsconfigviacopy:, so atarget: vmdeploy of the sway stack lands a compositor whoselauncher is in a junk directory.
The fix
WalkPlansresolves the token before any step runs, across the same field setspec.ResolveHomecovers, so the machine venue and the OCI target resolve the same placesrather than drifting (R3). Three details worth reviewing:
RunCapture,so the common case costs nothing.
ensureVenueManagedBlockcarried its own inlineprintf %s "$HOME"; both now callprobeVenueHome.rewrite
${HOME}/xinto/x.The field list lives in one function (
homeBearingFields) that both the predicate and theresolver read, so a future view field cannot be added to one and forgotten in the other.
How tested
The regression test fails without the fix. Neutralising only the resolution call, with
the helpers left in place, reproduces the live symptom exactly:
With the fix restored:
TestStepCarriesHomeTokenwalks every field family (To,Dest,ExtractDest,UnitPath,UnitText,Snippet,Destination,EnvVars,PathAdd,PathAppend),asserting each is both detected and resolved, and that a token-free step does not
trigger a probe.
Full module, no regressions:
gofmt -l kit/also reportskit/install_ledger_test.go; that is pre-existing —verified identical on pristine
HEADbefore this branch — and untouched here.Live acceptance is not in this PR, and why
The end-to-end proof needs
plugin-deploy-vmrebuilt against this sdk, which means thistag first, then that plugin's pin. The minimal reproducer is committed in the issue and
reproduces in ~2 minutes on a disposable Arch cloud-image VM bed:
Before: only
written.txtin~/copyprobe,copied.txtunder~/{{.Home}}/. The unittest above encodes exactly that assertion at the seam where the defect lives, which is why
it fails without the change.
Rulebook compliance
ResolveHomeand confirming the token on a live guest; the fix addresses the cause, notthe symptom.
spec.HomeTokenand mirrorsspec.ResolveHome's field set instead ofinventing a second notion of "home-bearing"; the duplicated inline
$HOMEprobe iscollapsed into one helper.
|| true, no path-guessing fallback: an unresolvable home is anexplicit no-op.
that carry no token.
Change classification
sdk/kit), plus a regression test.go test ./...on the module,go vet,gofmt, and a negativecontrol proving the test fails without the fix.
analysed on a live system— the defect was measured on a liveguest and the fix is unit-proven at the seam, but the end-to-end rerun needs the
downstream repin described above, so the stronger tier would overstate it.
Assisted-by: Claude Code claude-opus-5[1m] (analysed on a live system)