Repository navigation
Description
Found while gathering evidence for #783. spawn validate --infrastructure is the
command whose whole job is to tell you whether the shared infrastructure is
healthy. Run against the live infra account (966362334030) today:
$ AWS_PROFILE=spore-host-infra spawn validate --infrastructure --region us-east-1
Lambda Functions:
✗ …:function:spawn-alert-handler: ResourceNotFoundException: Function not found
✓ spawn-dashboard-api
✗ …:function:spawn-scheduler-handler: ResourceNotFoundException: Function not found
✓ spawn-sweep-orchestrator
(2/4 accessible)
Status: ✗ 2 errors found
Recommendations:
1. Deploy Lambda functions using CloudFormation: spawn config deploy-infrastructure
Three separate defects, in increasing order of how much they matter.
1. spawn-scheduler-handler is a FALSE error
The function is deployed. It is called scheduler-handler, with no spawn-
prefix, because scripts/deploy-scheduler-handler.sh defaults to
SPAWN_LAMBDA_NAME:-scheduler-handler.
pkg/infrastructure/resolver.go:88 hardcodes the prefixed name:
return fmt.Sprintf("arn:aws:lambda:%s:966362334030:function:spawn-scheduler-handler", r.region)This is the same trap already recorded in docs/infra-account.md and
scripts/lambda-deploy-census.sh — a filter built from the naming convention
cannot find the one function that does not follow it. Here it does not merely
miss the function, it actively reports it as missing.
A health check that cries wolf is worse than no health check: the next person to
run this has to re-derive which of the two errors is real.
2. spawn-alert-handler is a TRUE error — and it means spawn alerts never fires
This is #783's stranded lambda/alert-handler/, but the consequence is larger
than "unused code". Tracing the path:
spawn alerts create <sweep-id>exists and validates five trigger types
(complete,failure,cost_threshold,long_running,instance_failed—
pkg/alerts/alerts.go:27-31), then writes tospawn-alerts.spawn alerts history <alert-id>readsspawn-alert-history.- The only consumer of
spawn-alertsand the only writer of
spawn-alert-historyislambda/alert-handler/main.go. - That function is deployed nowhere, under any name, in either account.
- The live
spawn-alert-evaluatoris not a substitute: it reads
spawn-alert-preferences+spawn-cost-historyand publishes to
COST_ALERTS_TOPIC_ARN. It never readsspawn-alerts, and it covers cost
alerts only — not the sweep triggers the CLI accepts.
So spawn alerts create succeeds and no alert can ever fire, and
spawn alerts history is permanently empty. Nothing in the CLI says so. This
is the same shape as #774's advertised-and-ignored --region.
Checked rather than assumed: sweep-orchestrator's only lambda.Invoke is
reinvokeSelf (main.go:833), not alert delivery. Nothing in the repo invokes
the alert handler.
3. The remediation names a command that does not exist
pkg/infrastructure/validator.go:255 and :279 both recommend:
Deploy Lambda functions using CloudFormation:
spawn config deploy-infrastructure
There is no such command. spawn config takes two arguments (get/set), and
deploy-infrastructure appears nowhere in the tree except those two strings. So
the one actionable line in a failing report sends you to a dead end.
Suggested
- Resolve the scheduler-handler name from the same place the deploy script does,
rather than reconstructing it. A gate that the validator's expected names match
the names the deploy scripts/templates actually create would prevent the class
— this is the "discover, don't list" rule in CLAUDE.md. - Decide
alert-handler(this is Two stranded artifacts: self-hosted-stack.yaml (354 lines, deployed nowhere) and lambda/alert-handler (builds in CI, runs nowhere) #783's decision): deploy it, or remove the
spawn alertsCLI surface. Whichever is chosen, the CLI must not keep
accepting alerts it cannot deliver — that half is a bug independent of the
product call. - Point the recommendation at a real command, or drop it.
Each of the three is independently verifiable by running the command above.
Activity
fix(validate): stop reporting a deployed Lambda as missing, and point…
scttfrdmn commentedon Oct 10, 2026
Defects 1 and 3 are fixed and merged in #791 (
b5f90d5). Leaving thisopen for defect 2's remaining half.
Fixed
1. The false
spawn-scheduler-handlererror. The resolver now resolves thedeployed name (
scheduler-handler) from a constant, and three places thatagreed with the bug were corrected: the resolver, its unit test, and the
Substrate fixture. Verified live, read-only — 1 error instead of 2, 3/4
accessible instead of 2/4,
✓ scheduler-handler.3. The dead-end remediation.
spawn config deploy-infrastructureandspawn config init --self-hostedare gone. Recommendations name the actualscript or template per resource, and where nothing in the repo deploys a
function they say so rather than inventing a command.
Two gates landed with it:
TestEveryHardcodedLambdaNameIsCreatedByADeployMechanism— reads functionnames out of every deploy script and template and fails when Go source
hardcodes one none of them create. Discovered, not listed. Found ten created
names, two of which nobody had enumerated by hand.
TestValidateRecommendationsNameOnlyRealCommandsAndPaths— resolves everycommand a recommendation mentions against the real cobra tree, and checks
every path exists. Checking the first word would not have caught this:
configis a real command; the defect was the subcommand.Worth recording because it nearly shipped as a no-op: the second gate missed
two of the three defects on its first run. The Lambda branch names mechanisms
per function when it has resource detail and falls back to one generic line when
it does not, and the fixture populated
Resources— so the fallback string wasunreachable, and restoring the original text there passed. Same shape as #787.
The fixture now drives both shapes and asserts the fallback is non-empty.
Still open — defect 2's second half
The missing
spawn-alert-handleris now reported honestly, but the CLI half isuntouched:
spawn alerts createstill accepts alerts that nothing candeliver, and
spawn alerts historyis still permanently empty. Reporting it ina health check is not the same as refusing to accept it at the point of use.
That half does not depend on #783: whether the answer there is "deploy the
handler" or "remove the feature", the CLI should not silently accept an alert it
cannot deliver in the meantime.
fix(alerts): refuse an alert that cannot be delivered (#790) (#793)
scttfrdmn commentedon Oct 11, 2026
Defect 2's remaining half is fixed and merged in #793 (
82d286d). All threecode items in this issue are now done; what is left is not code.
spawn alerts createrefuses when the consumer is absent — verified live againstthe shared account: exit 1, and an independent DynamoDB scan of
spawn-alertsfor the probe sweep ID returns
Count=0, so nothing is written.The refusal is conditional on knowing, not on guessing:
AccessDenied/ no networkRefusing on an undetermined result would break working installs to protect them
from a defect they may not have. A self-hosted install pointing
SPAWN_LAMBDA_ALERT_HANDLER_ARNat its own deployed function is unaffected, andthere is a test for that so "refuse when the shared function is missing" cannot
quietly become "always refuse".
What remains, and where it belongs
This issue can close once #783 is decided. The reporting is now honest in all
three places it was not — the health check, the remediation, and the point of
use — but the underlying feature is still inert in the shared account. That is
#783's call: deploy
alert-handler, or withdrawspawn alerts.Worth noting for whoever picks that up: with this change, "withdraw the command"
is now a smaller step than it was. The command already refuses in every
shared-mode install, so removing it would not take away working behaviour from
anyone.
One thing this surfaced
#792 — Tier 0 e2e uses an existing
bin/spawnunconditionally rather thanbuilding. It gave me a passing
TestTier0_AlertsRoundTripfrom a nine-hour-oldbinary containing none of this change. The failing new test is what sent me
looking; the passing one would not have.
remove: alert-evaluator and the dashboard's alert-preferences endpoin…
fix(deploy): discover deploy scripts instead of listing them, and fix…
fix(reaper): make the max-age ceiling apply inside a live deadline, a…
fix(schedule): invoke a sweep orchestrator that exists, in a region i…
Gate every printed command and path, and fix the ten that were wrong (#…
Delete the superseded DCV cert installer, and gate the paths (#852)