Skip to content

remove: the spawn alerts path and the stranded self-hosted stack (#783) - #796

Merged
scttfrdmn merged 1 commit into
mainfrom
remove/783-alerting-and-stranded-stack
Oct 11, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
remove/783-alerting-and-stranded-stack

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #783
Closes #790

BREAKING: spawn alerts create|list|delete|history is gone. The next release
must bump MINOR.

#783 asked whether two artifacts were prior art or dead ends. The answer turned
out to be measurable rather than a matter of taste.

Why remove alert-handler rather than deploy it

fact evidence
Nothing emitted the event it handled the handler is handler(ctx, event SweepEvent); sweep-orchestrator's only lambda.Invoke is reinvokeSelf, using its own identically-named type to re-invoke itself
Zero users spawn-alerts: Count=0. Nobody has ever successfully created an alert
Never developed every commit since the initial one is mechanical — CVE bumps, a Go version bump, a test migration

So "deploy it" was never a deployment: you would also need an emission path in
sweep-orchestrator and a scheduler for the long_running and cost_threshold
triggers. That is a feature project, and the project already has a live,
differently-modelled alerting path — alert-evaluator, reading
spawn-alert-preferences, untouched here. It has had nothing to do since
2026-02-20 either, but that is a separate component and a separate decision
(#794).

Why delete self-hosted-stack.yaml

One commit — the initial one — never edited, never deployed in either account. It
declared 11 resources and no functions, so deploying it yields half a control
plane, and it named a log group for the function removed above. Its informational
value is superseded by docs/infra-account.md: 103 resources measured from the
live account, versus 11 imagined in February. #780 should start from the measured
document.

#790 is fully closed too

Its last item was "the CLI must not accept alerts it cannot deliver", which #793
fixed, and its framing was "closes once #783 is decided". Verified live after
this change:

$ spawn validate --infrastructure --region us-east-1
Lambda Functions:
  ✓ spawn-dashboard-api
  ✓ scheduler-handler
  ✓ spawn-sweep-orchestrator
  (3/3 accessible)
Status: ✓ All resources accessible      # exit 0

It began the day reporting two errors, one of them false, with remediation
pointing at a command that does not exist.

Deliberately NOT removed

Recording these so they do not read as oversights:

  • spawn-alerts / spawn-alert-history in AWS. Still deployed, still empty.
    Deleting live tables is control-plane reaping (Leave no trace: nothing reaps the control plane — the lambdas, their roles/rules/alarms, or the buckets spawn auto-creates #653), not something to fold
    into a code change.
  • deployment/cloudformation/alerts-tables.yaml. Two of its four tables —
    spawn-cost-history, spawn-alert-preferences — are read by live
    functions, so deleting it would strand deployed infrastructure.
  • pkg/aws.GenerateScopedDynamoDBPolicy's spawn-alerts ARNs. That
    generator has no production caller, only tests, so its grants are never
    created. Editing dead code is churn.

The gate's exception list is now empty

undeployedFunctions existed for exactly one entry. #783 resolved it by removal,
so every Lambda name in Go source is now one that a deploy mechanism in this repo
actually creates. Kept as an empty map with a note: an addition is a claim that
something is referenced while nothing deploys it — a state to fix, not record.

Stale-artifact gaps this surfaced

Verification

make check green across all 11 nested modules — discovery picked up the
drop from 12 without being told, which is the "discover, don't list" rule paying
for itself. check-docs, changelog and semgrep (0 findings) clean.

Tier 0 e2e re-run with -count=1 against a freshly built bin/spawn, not
the cached result: Go's test cache cannot see a binary read at runtime, so a
cached PASS here proves nothing. 65.9s, green.

Public API surface unchanged — neither pkg/alerts nor pkg/infrastructure is
imported by another repo, confirmed against api/public-surface.txt before
deleting anything.

~3,170 lines removed.

BREAKING: `spawn alerts create|list|delete|history` is gone. Next release
must bump MINOR.

#783 asked whether two artifacts were prior art or dead ends. The answer
turned out to be measurable rather than a matter of taste.

## Why remove alert-handler rather than deploy it

Three facts, each checked:

  1. Nothing emitted the event it handled. The handler is
     `handler(ctx, event SweepEvent)`, and sweep-orchestrator's only
     lambda.Invoke is reinvokeSelf — using its own identically-named type
     to re-invoke itself. So deploying the function would have changed
     nothing; you would also need an emission path and a scheduler for
     the long_running and cost_threshold triggers. "Deploy it" was a
     feature project, not a deployment.

  2. Zero users. spawn-alerts: Count=0. Nobody has ever successfully
     created an alert, so the removal takes nothing from anyone.

  3. Never developed. Every commit touching it since the initial one is
     mechanical — CVE bumps, a Go version bump, a test migration.

The project also already has a live, differently-modelled alerting path:
alert-evaluator reads spawn-alert-preferences and is untouched here. It
has had nothing to do since 2026-02-20 either (#794), but that is a
separate decision about a separate component.

## Why delete self-hosted-stack.yaml

One commit — the initial one — never edited, never deployed in either
account. 11 resources and NO functions, so deploying it produces half a
control plane, and it declared a log group for the function removed
above. Its informational value is superseded by docs/infra-account.md,
which maps 103 resources measured from the live account rather than 11
imagined in February. #780 should start there.

## What is deliberately NOT removed

  - spawn-alerts / spawn-alert-history in AWS. Still deployed, still
    empty. Deleting live tables is control-plane reaping (#653) and not
    something to fold into a code change.
  - deployment/cloudformation/alerts-tables.yaml. Two of its four tables
    (spawn-cost-history, spawn-alert-preferences) are read by LIVE
    functions, so deleting it would strand deployed infrastructure.
  - pkg/aws.GenerateScopedDynamoDBPolicy's spawn-alerts ARNs. That
    generator has no production caller — only tests — so its grants are
    never created. Editing dead code is churn; recording the decision so
    it does not read as an oversight.

## The gate's exception list is now empty

undeployedFunctions existed for exactly one entry, spawn-alert-handler.
#783 resolved it by removal, so every Lambda name in Go source is now one
that a deploy mechanism in this repo actually creates. Kept as an empty
map with a note: an addition is a claim that something is referenced
while nothing deploys it, which is a state to fix rather than record.

## Two stale-artifact gaps this surfaced

  - TestNoNewAWSSDKImportsInCmd failed with "allowlist references
    alerts.go, which no longer exists". The gate working as designed.

  - `make check-docs` PASSED while docs-gen/alerts.md survived for a
    deleted command: gen-docs writes but never prunes, so there was no
    diff to detect. Published reference docs would have kept describing a
    command that is gone. Fragment removed; filed #795 for the gate,
    which is one-way today (content matches) and needs to be two-way (the
    file set matches the command set).

  - #792 bit twice more. The Tier 0 coverage gate enumerated commands
    from a stale bin/spawn and demanded a decision for `alerts` after it
    was deleted — the inverse symptom of this morning's false PASS.

## Verification

make check (all 11 nested modules — discovery picked up the drop from 12
without being told), check-docs, changelog and semgrep (0 findings) clean.

Tier 0 e2e re-run with -count=1 against a freshly built bin/spawn, NOT
the cached result: Go's test cache cannot see a binary read at runtime, so
a cached PASS here proves nothing. 65.9s, green.

Public API surface unchanged: neither pkg/alerts nor pkg/infrastructure is
imported by another repo, confirmed against api/public-surface.txt before
deleting.
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 8e2eac7 into main Oct 11, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the remove/783-alerting-and-stranded-stack branch October 11, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant