← Research & specs
AdPilot · Corpus

T-023 — Automations engine v1: spend-cap rules, trigger/condition/action

T-023 — Automations engine v1: spend-cap rules, trigger/condition/action

Frozen spec for the T-023 build (base main → head of the build). The flagship automation the market expects: pause the ad when spend crosses the cap — implemented per docs/42-automation-architecture.md §2 (the pre-drawn research design), sandbox-only executors.

Decisions

Surface-area deltas

Verification

Go gates: go test ./... in services/api (6/6 packages; 13 new test functions). Web gate: npm run build in apps/web-next (strict tsc). Live E2E on :8090: rule created → simulate explains → the real 15s worker fired → campaign paused → run history "fired"; a shiftBudget rule with requiresApproval queued pending, budget untouched at 40, confirm applied 48, double-confirm 422.

Out of scope

Real ad-platform calls (sandbox rule; a real executor implements the same dispatch behind a credentials-gated card), the NL rule parser (T-028), the unified approvals table (T-028), outbound webhook delivery (T-027).