Skip to content

feat(infra): a second spend alert, its own budget, when the month's forecast passes $600 - #990

Merged
allisonmahmood merged 1 commit into
mainfrom
feat/spend-alert-600
Oct 29, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
feat/spend-alert-600

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changed

The production budget emails when the month's forecast passes $300. With full-vCPU hosts and company boxes (#984), idle infrastructure alone is about $180 a month, so that alert will fire on ordinary busy weeks. This keeps the $300 alert exactly as it is and adds a second one, a new budget that emails when the forecast passes $600.

Look at

  • Two budgets, not two notifications on one. CloudFormation replaces an AWS::Budgets::Budget to change its notifications, and the replacement would collide with the fixed patchy-monthly name and fail the base stack deploy (caught in review). The $600 alert is its own budget, patchy-monthly-600; apps/infra/src/BaseStack.ts builds both from one helper.

  • The $300 budget doesn't change at all. Synthesizing the production base stack on main and on this branch gives an identical Spend resource, so the deploy only creates SpendHigh:

    main ids: ['Spend']  branch ids: ['Spend', 'SpendHigh']
    Spend identical on branch: True
    
  • Email verification. AWS Budgets emails a newly added address only once it is verified in the account, and one verification covers every budget. Addresses already verified in the account are active at once, and recipients added before AWS introduced verification keep receiving alerts unchanged. So the alert addresses may get a verification email from an @aws.com sender when the new budget appears; open its link while signed in to the account. docs/OPERATIONS.md records both budgets, why each alert is its own budget, and the verification step.

How it was verified

  • vitest run src/stacks.test.ts in apps/infra: 7 passed. The new case pins exactly two budgets, each one's name, type, period, amount, its forecast-above-100% notification and its email subscriber.
  • The identical-Spend comparison above, from the synthesized templates.
  • Prettier, ESLint and tsc on the infra package.
  • Not checked: the deploy itself and the email; both happen on the next release.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

Infrastructure only: one new AWS budget in the production base stack. The existing budget is untouched.

  • What does a revert leave behind? Nothing: the base stack deletes patchy-monthly-600 on its next deploy, and patchy-monthly is unchanged either way.
  • Does the release before it still work with that? Yes. Releases don't read budgets.

Made by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area size:s Under 100 changed lines labels Oct 28, 2026
@allisonmahmood allisonmahmood changed the title feat(infra): a second spend alert when the month's forecast passes $600 feat(infra): a second spend alert, its own budget, when the month's forecast passes $600 Oct 28, 2026
@github-actions github-actions Bot added the area:docs Touches the docs area label Oct 28, 2026
…orecast passes $600

Rebased onto main after the TypeScript 7 stack (#985).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit ed80fc7 into main Oct 29, 2026
24 checks passed
@allisonmahmood
allisonmahmood deleted the feat/spend-alert-600 branch October 29, 2026 16:48
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
## What changed

This adds release 23's What's new entry, written from `ed80fc7`. It
covers everything merged since release 22's `through` (`a2d1331`), and
sets the `patchy` release to `0.23.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`. This is the speed and capacity release: patches
that run server code open faster, and the fleet has room for more
companies at once.

| Change | PRs |
| --- | --- |
| Improved: Patches with server code open faster. Landing on Home or All
patches readies the company's server and its three most-opened patches,
a patch stays ready for ten minutes after use instead of one, loading a
patch takes a third of the time, and each company server has twice the
CPU | #991, #992, #997, #999, #984 |
| Behind the scenes: Patchy can run patches for more companies at the
same time (24 company boxes instead of 15, and 64 companies per host
instead of 16) | #984, #993 |

Two merged PRs get no line, because nobody using Patchy would notice
them: #990 (a second AWS cost alert, at $600) is operations tooling, and
#1049 (a test fix for flake #1012) is test churn. #1046 is release 22's
own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- **Rollback safety, from the live commit `eb414ed` (release 22) to
`ed80fc7`:**
  - No PR in the range is labelled `one-way`, and none adds a migration.
- #984 and #990 change infrastructure. A rollback redeploys release 22's
stacks: 0.5 vCPU tasks, a fleet budget of 15 with two spares, and no
`patchy-monthly-600` budget (the base stack deletes it; `patchy-monthly`
is untouched). Exec task definitions are retained, so release 22's hosts
can still manage this release's boxes until promotion.
- #984's one rollback hazard: once this release holds 14 or more spare
boxes, release 22 can't fit its two spares inside its budget of 15, and
its promote step times out. The fix is the runbook in
`docs/OPERATIONS.md` › Freeing budget for a promotion.
- #999 leaves binding history rows with release cause `unused`, which
release 22 reads as text. #999's new `speculative` bind field is refused
by release 22's supervisors before they act, so prewarms on those boxes
are skipped during a rolling deploy.
- Neither `execution.process.load` (#992) nor `execution.prewarm.window`
(#999) is set in production's `PATCHY_LIMITS_JSON`, so release 22 loads
the configuration unchanged.

**Rollback line:** If this release misbehaves, roll back to `eb414ed`
(release 22). If that rollback's promote step times out short of two
spares, follow `docs/OPERATIONS.md` › Freeing budget for a promotion,
then re-run it.

## How it was verified

- **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and
`schemas.test.ts` pass (21 tests), and prettier passes on the changed
files.
- **The range.** Each PR was Sol-reviewed with every finding fixed.
After the TypeScript 7 stack (#985), all seven were rebuilt on one
integration branch, with each conflict and each TypeScript 7 fix kept in
the PR it belongs to. `pnpm check` passed there, apart from local-only
CLI and supervisor test failures caused by T3 probing this machine's
ports. Each PR then landed with all 12 required checks green on its
rebased head, and main's tree after #990 equals the integration tip.
Re-runs: `clerk-live` once on #984 (a sign-in handshake flake). On #992,
flake #1012 failed twice and was fixed by #1049 instead of re-running.
- **Deploy state.** The live commit, pinned from `/healthz/deep`, is
`eb414ed` (release 22). The Deploy run updated last succeeded, and none
is unfinished.
- **Quota.** #984 peaks at 29 vCPUs during a deploy (24 boxes, 4 rolling
hosts, the promote task), inside the account's current 30.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Text and version numbers only. The `0.23.0` bump tells CLIs and patch
repos installed before this deploy to upgrade, as every release does.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Made by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, running in
T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Touches the docs area area:server Touches the server area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant