Skip to content

spawn-cost-history-collector is live and hourly, and nothing in the repo can deploy it #848

Closed

Description

@scttfrdmn

Found in Phase 6 of the audit, while checking docs/infra-account.md's claim that there is
no "code with no deployment". That claim is true; this is the inverse, which the page
did not ask about and which is the worse state of the two — nothing about it looks wrong
from either side.

Measured

$ aws lambda get-function-configuration --function-name spawn-cost-history-collector
  LastModified: 2026-02-20T01:47:39Z
  Runtime:      provided.al2023

$ aws events describe-rule --name spawn-cost-history-collector-hourly
  Schedule: rate(1 hour)
  State:    ENABLED

It is live and invoked every hour, and was last modified 2026-02-20 — close to
eight months ago.

Every reference to it in this repository:

$ grep -rl cost-history-collector . | grep -v '^./.git'
CHANGELOG.md
.gitignore
docs/infra-account.md
.github/dependabot.yml
lambda/cost-history-collector/go.mod

So: no deploy script, no Makefile target, no CloudFormation or SAM template. The code
in lambda/cost-history-collector/ cannot be built and shipped to the function that is
running. The running bytes are whatever was uploaded by hand in February, and the source
has been drifting from them ever since — Dependabot has been bumping dependencies in a
module that cannot reach production.

Why the existing gate does not catch it

TestEveryHardcodedLambdaNameIsCreatedByADeployMechanism reasons outward from hardcoded
Lambda names in Go source to a deploy mechanism. Nothing in Go source names this function,
so it is invisible to that direction of the check — and it is the only Lambda in that state.

What it is

The general hazard already recorded under "leave no trace" made concrete: spored has no
autonomous self-upgrade and lambdas never upgrade with the CLI, so version skew is the
normal state and nothing warns.
The reaper stack sitting untouched from 2026-07-31 to
2026-10-04 while the CLI went v0.9x → v0.116.0 was the same shape. This one is worse
because there is no mechanism at all, not merely an un-run one.

Suggested fix

  1. A deploy path — the smallest thing that works is a scripts/deploy-cost-history-collector.sh
    in the shape of scripts/deploy-scheduler-handler.sh, so the existing deploy-script gates
    (TestDeployScriptsAssertTheAccount, the log-retention and version-stamp census) apply
    to it automatically.
  2. A gate for the inverse direction: every live Lambda in the account should have a deploy
    mechanism in the repo, discovered from spawn footprint or make lambda-versions-deployed
    rather than from Go source. That is the check that would have found this, and it would
    also catch the next one.
  3. Decide whether the function is still wanted before building either. It has been running
    hourly for eight months against code nobody can update; if the data it collects is unused
    the honest answer may be removal, which is the Two stranded artifacts: self-hosted-stack.yaml (354 lines, deployed nowhere) and lambda/alert-handler (builds in CI, runs nowhere) #783 question again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions