Repository navigation
test(status): prove -o json keeps stdout parseable, via an emitStatus seam - #694
Merged
Merged
Conversation
… seam The substance of #540 was already fixed and is verified live: exit=0, 868 bytes of valid JSON on stdout, the agent log lines on stderr, and every field the report asked for present under ttl/on_complete/cost. What was missing was the guard the report asked for. spored's renderer has TestRenderStatusJSON_StdoutIsPureJSON; spawn's relay had none, and it adds six human annotations that each break json.Unmarshal if misrouted. emitStatus takes the annotations as a parameter rather than computing them from the *InstanceInfo. That is load-bearing: the first version computed them internally and PASSED with the routing bug deliberately reintroduced, because every notice helper returns "" for any instance a test can build without AWS. A test whose inputs are inert cannot fail. Fixes #540
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Nov 12, 2026
New roles get the spore-host/spawn-instance-boundary at CreateRole; existing roles get it via PutRolePermissionsBoundary before any policy write. The boundary allows a broad data-plane ceiling and denies IAM administration, organizations/account actions and cross-account AssumeRole, so a role cannot be used to escalate IAM however its policies are written. Provisioned by 'spawn setup-account' (admin) or the first admin-run launch; the documented user baseline cannot create it, and a non-admin is told the command. 'spawn cleanup --instance-roles' deletes it once no role uses it. Align spawn onboard's portal policy with the live role and the BYOA template (#694): drop Stop/Start/Terminate, deny ownership-tag writes. Stacks on #1606.
scttfrdmn
added a commit
that referenced
this pull request
Nov 12, 2026
New roles get the spore-host/spawn-instance-boundary at CreateRole; existing roles get it via PutRolePermissionsBoundary before any policy write. The boundary allows a broad data-plane ceiling and denies IAM administration, organizations/account actions and cross-account AssumeRole, so a role cannot be used to escalate IAM however its policies are written. Provisioned by 'spawn setup-account' (admin) or the first admin-run launch; the documented user baseline cannot create it, and a non-admin is told the command. 'spawn cleanup --instance-roles' deletes it once no role uses it. Align spawn onboard's portal policy with the live role and the BYOA template (#694): drop Stop/Start/Terminate, deny ownership-tag writes. Stacks on #1606.
scttfrdmn
added a commit
that referenced
this pull request
Nov 12, 2026
…1609) * Cap every spawn-created IAM role with a permissions boundary New roles get the spore-host/spawn-instance-boundary at CreateRole; existing roles get it via PutRolePermissionsBoundary before any policy write. The boundary allows a broad data-plane ceiling and denies IAM administration, organizations/account actions and cross-account AssumeRole, so a role cannot be used to escalate IAM however its policies are written. Provisioned by 'spawn setup-account' (admin) or the first admin-run launch; the documented user baseline cannot create it, and a non-admin is told the command. 'spawn cleanup --instance-roles' deletes it once no role uses it. Align spawn onboard's portal policy with the live role and the BYOA template (#694): drop Stop/Start/Terminate, deny ownership-tag writes. Stacks on #1606. * e2e: record Tier 0 coverage decision for spawn setup-account
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.
Fixes #540 — but not in the way the title suggests, so here is exactly what I found.
The substance was already fixed; I verified it live
I launched a
t4g.smalland ran the reporter's failing command against it:stdout is a clean JSON document. The four agent log lines that broke the original
json.loadsare on stderr, where they belong:And every field the report asked for is present. I initially thought they were missing, because I probed flat key names — they are nested:
So "sentinel present, TTL deadline, cost-limit consumed, effective rate" — all four — are there.
runStatusOverSSMalready passed--output jsonthrough to spored and already keptres.Stderroff stdout, with a comment citing #540.What was actually missing
The third item in your suggested fix:
spored's renderer has
TestRenderStatusJSON_StdoutIsPureJSON. spawn's relay had no test at all — and spawn's relay is the riskier half, because it adds six annotations of its own (TTL reconciliation, lifecycle protection, billable resources, DNS, FSx, spored upgrade hint). Each is prose, and any one of them on stdout breaks the document. Nothing stopped that.emitStatusmakes the stream rule a single assertable thing: in--output json, stdout carries spored's document and nothing else.Why the annotations are a parameter
This is the part worth reading, because I got it wrong first.
My initial
emitStatustook the*InstanceInfoand called the six notice helpers itself. The test passed. Then I reintroduced the routing bug on purpose —dest := stdoutunconditionally — and the test still passed.Every notice helper returns
""for any instance a test can construct without AWS. I probed four fixture shapes (bare, DNS tags, TTL tags, stopped) and got zero-length output from all six helpers in every case. So the test was routing nothing, and asserting that nothing arrived in the right place.Passing the annotations in fixes it: the test supplies non-empty strings, and now the reintroduced bug fails loudly with
invalid character '⚠' after top-level value— the real #540 symptom. The test also asserts its own fixture is non-empty, so it cannot quietly go inert again.That is the third vacuous test I have written today, and all three had the same shape: the fixture couldn't produce the condition under test. The other two were #684's region-substitution test (which set the field no caller set) and a
Contains(usage, "or")check that matched the "or" inside "spore".Gates
gofmt -lempty,go vet ./...,go test -short ./...,make check-docs, changelog gate,semgrep→ 0 findings. Regression confirmed caught. Live-verified on a real instance, which was then terminated and leak-checked (0 instances).Also ran
make changelog-fix— merging #690 and #692 left two### Fixedheadings in[Unreleased], the mechanical conflict that fixer exists for.