Repository navigation
Description
PushClient has three implementations. Only the in-memory buffer is ever
instantiated, so pushed plugin data never reaches an instance.
Evidence
$ grep -rn 'func New.*PushClient' --include='*.go' pkg/plugin/ | grep -v _test
pkg/plugin/push_ssh.go:28:func NewSSHTunnelPushClient(host, keyPath string) *SSHTunnelPushClient {
pkg/plugin/push_ssm.go:27:func NewSSMPushClient(ctx context.Context, instanceID, region string) (*SSMPushClient, error) {
pkg/plugin/local_executor.go:35:func NewBufferingPushClient() *BufferingPushClient {
$ grep -rn 'NewBufferingPushClient|NewSSMPushClient|NewSSHTunnelPushClient' \
--include='*.go' . | grep -v '_test|func New'
cmd/plugin.go:212: pushBuf := plugin.NewBufferingPushClient()
One construction site in the entire repo, and it is the buffer.
Both real transports are fully implemented and entirely unreachable — 7
functions across the two files, confirmed dead by whole-program reachability
intersected across all three GOOS targets:
push_ssm.go— SSM Parameter Store delivery, 2/2 functions deadpush_ssh.go— SSH tunnel to spored's push API, 5/5 functions dead
Why this looks like a gap rather than cleanup
spored runs a push API on loopback (pkg/pluginruntime/pushapi.go) with a
per-start 32-byte token, constant-time comparison, and delivery intended over an
SSH port-forward. The security review assessed that server as correctly
built — auth middleware wrapping the whole mux, loopback-only bind, 0600 token
file.
So there is a well-made receiver, a well-made SSH transport to reach it, and
nothing that connects the two. BufferingPushClient accumulates in memory in
the CLI process and exits with it.
That is the shape of a feature whose last wire was never attached, not of
deliberately dead code — which is why I am filing it as a defect rather than
folding it into the dead-code inventory.
What needs deciding
- Is
plugin pushmeant to work? If yes,cmd/plugin.go:212should select
a transport — SSH tunnel when a key is available, SSM otherwise — rather than
always buffering. The constructors already take exactly the arguments the
command has to hand (host/keyPath, orinstanceID/region). - If not, say so: remove the two transports, and make the buffering client's
behaviour explicit in the command's help so nobody believes data was
delivered.
Either way the current state is the worst of the three: a command that appears to
push, succeeds, and delivers nothing.
Worth checking against the plugin-push work in spore-plugins#26 before choosing —
this may be a known-unfinished edge rather than a regression.
Activity
scttfrdmn commentedon Oct 11, 2026
The premise is wrong: pushed plugin data does reach the instance. Correcting before the
PR, because the issue's framing — "a command that appears to push, succeeds, and delivers
nothing" — would lead someone to wire up a transport that is not needed.
There is no
spawn plugin pushcommandBuffering IS the delivery mechanism
cmd/plugin.gosays so where it constructs the client:And it does exactly that, at line 254:
remotePluginInstallthen reaches the live receiver:So the chain is complete and live: local push steps →
BufferingPushClient→pushBuf.Values()→ install request → SSH tunnel → spored's push API. Delivering valuesone at a time, as the dead transports would, could not give the ordering guarantee the
install request does.
What actually was dead
pkg/plugin/push_ssh.go(127 lines) andpush_ssm.go(52) — two alternativePushClientimplementations that nothing constructed. The SSH one duplicates the tunneland token helpers
cmd/plugin.goalready has and uses. Genuinely dead, genuinelysuperseded, and removed in the PR.
So this is a dead-code removal, not a broken feature. The receiver was never clientless.
Why the misreading was reasonable
The doc comment on
BufferingPushClientread: "records pushes in memory instead ofdelivering them to a remote runtime". That is a fair description of the type and a
misleading description of the system, and it is what three independent reads keyed on. The
PR rewrites it to state that buffering is how delivery works, and why — the same move as
#809, where a Go-only reading of a shell-delivered cert produced the opposite error.
One real thing this surfaced: #855
plugin installneeds SSH unconditionally, so it cannot work on a keyless SSM-onlyinstance — which spawn deliberately supports (Windows SSM-first, keyless connect,
Provision's "keyless: SSM-only, like the Lambda" path that lagotto uses). The deletedpush_ssm.gowas a sketch of exactly that missing capability, so I filed #855 rather thanlet the gap disappear with the code.
Remove two never-constructed PushClient transports