Repository navigation
Verify spored by the instance's OS, not the workstation's (#882) - #886
Merged
Merged
Conversation
The launch gated spored verification on plat.OS, which is runtime.GOOS — the machine running spawn. From macOS, a Windows instance got the Linux check, SSM refused it (UnsupportedPlatformType), and the launch falsely reported that spored never came up; with --terminate-on-error that terminates a healthy instance. From a Windows workstation, a Linux instance got no check at all. sporedVerificationFor now decides from config.TargetOS only, and a Windows target is verified via AWS-RunPowerShellScript (is the spored service Running) instead of being skipped. An AST gate on the call site fails if anything of plat reaches the decision. Closes #882
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
Validated on a real Windows instance — from macOS, with
|
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.
Closes #882
The defect
Step 10b of
spawn launchgated spored verification on:platisplatform.Detect()andPlatform.OSisruntime.GOOS— the machine running spawn. So the instance's verification depended on the user's laptop:AWS-RunShellScript) sent to WindowsUnsupportedPlatformType; launch reports "spored never came up" about a healthy spore and exits 1 — observed oni-061da267b7a9442deduring #879's validation. With--terminate-on-error, it terminates a healthy instance.The fix
sporedVerificationFor(waitForSSH, targetOS)decides fromconfig.TargetOSonly. The workstation's OS is deliberately not a parameter, so it can't drift back in. The only otherplat.OSuse in the launch path — enabling ANSI colours in a Windows terminal — really is about the local machine and stays.A Windows target is verified, not skipped.
verifySporedReadyOnasks the Service Control Manager overAWS-RunPowerShellScriptwhether thesporedservice isRunning, with a 10-minute budget (first boot also installs the AWS CLI). It queries the service rather than runningspored.exebecause a verified-install refusal (#879) leaves no binary to run, and "no binary" has to read as not ready, not as an execution error. This matters now: #879 made the Windows install fail closed, so there's a real failure to report — and skipping would leave exactly the silent Windows case #878 described.verifySporedReadykeeps its signature and Linux behaviour for its other callers (plugin.go, the Substrate tests), which pass unchanged.Gates
TestLaunchDecidesSporedVerificationByTargetOSreads the call site's AST: it fails ifsporedVerificationForis passed anything ofplat, if it isn't passedconfig.TargetOS, or if the launch calls the Linux-onlyverifySporedReady. Structural on purpose — the defect was one wrong value in one condition, and a behavioural test of the decision function can't see what its caller passes. Matched as call expressions, so the comment that namesplat.OSto explain this can't trip it.Plus the decision table, the probe mapping (Windows → PowerShell document, Linux → shell), and a parse check of the Windows probe under PowerShell's parser.
plat.OS— the original bugverifySporedReadyThe last is the tempting non-fix: it also makes the false error disappear, while leaving Windows spores unverified.
make check,check-docs, semgrep, gitleaks (8.21.2) clean.Not yet: one real Windows launch
The PowerShell probe parses, and
RunPowerShellis proven against real Windows from #879's validation — but this exact probe string hasn't run against a real instance, and the end-to-end claim (a Windows launch from macOS now passes Step 10b) hasn't been observed. Same ~$0.04, ~15-minute launch as before, then terminate and leak-check. Waiting on an OK.🤖 Generated with Claude Code