Repository navigation
Fix every launch failing at IAM setup on v0.129.0/v0.130.0 (#1069) - #1070
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
fix/1069-spored-policy-account
branch
from
October 17, 2026 01:54
1f783a1 to
7731f65
Compare
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 #1069
Every
spawn launchthat sets up the spored role failed on v0.129.0 and v0.130.0 (MalformedPolicyDocument: The policy failed legacy parsing), before any instance was created. #905 put${aws:PrincipalAccount}in the hybrid-registry grant'sResource. IAM'sPutRolePolicyrejects that, while Access Analyzer andsimulate-custom-policyboth accept it. Reproduced on a throwaway role; details are in the issue.Fix. The templates carry an explicit
SPAWN-ACCOUNT-IDplaceholder.bindPolicyAccountreplaces it with the caller's 12-digit account ID (the account the role is created in) at all four writers:SetupSporedIAMRole,ensureSporedBaselinePolicy,createIAMRoleandupdateInlinePolicy. It refuses a non-12-digit account, and any document still carrying${aws:PrincipalAccount}. The placeholder is deliberately neither 12 digits nor*: an unbound document is refused, not written with an account that matches nothing, or matches every account. The scope is unchanged: one table, in the role's own account.Gate (
TestEverySporedPolicyIsWrittenBoundToTheAccount). Runs every writer against Substrate (shared role,--iam-policycreate, baseline, and the update path) and reads back withGetRolePolicywhat actually reached IAM. Each binding site, reverted in a way that compiles, fails it and names the policy that reached IAM unbound, and so does the original bug (variable restored, binding removed).TestHybridRegistryGrantIsNarrowasserted the exact${aws:PrincipalAccount}string, i.e. it certified the bug; it now asserts the bound ARN.Limit of the gate: Substrate doesn't model IAM's grammar, so this proves no variable reaches IAM, not that IAM accepts the result. That the literal form is accepted was shown on real IAM (the throwaway-role probe in #1069). A real launch with this build is the next check.
Consumers: lagotto (v0.111.1), calque (v0.100.0) and spore-host-mcp (v0.126.1) all pin versions from before #905, so none is broken today. A Dependabot bump to v0.129.0 or v0.130.0 would break them, so this should ship as v0.130.1.
go vet, staticcheck (GOOS=linux), the hermetic suite, nested modules and semgrep all pass underGOTOOLCHAIN=go1.26.9.