AdPilot · Corpus
T-026 — Page connections + boosts (sandbox)
T-026 — Page connections + boosts (sandbox)
Frozen spec for the T-026 build: the connected-pages surface with token health and the promote-existing-post flow, sandbox-only end to end.
Decisions
- Scope (Q1): fully sandbox. Connections are seeded fixtures spanning
the health spectrum (healthy / expiring / disconnected); reconnect is a
local status flip with a fresh 60-day token window; boost execution flips
queued → executedwith a detail string and audit entries — no HTTP client exists in the boost path and the sandbox budget cap is $1,000. Schema carriespost_auth_id/advertiser_id(TikTok Spark Ads / whitelisting) so the real integration is schema-only later, and the connection scope sets document exactly what T-012's App Review must request. - Implementer — boosts vs campaigns: boosts list under their own
GET /v1/boostsand render in the connections page history; they do not masquerade as campaigns (deviation from the card's "appears in campaign list" criterion recorded — acampaign_idlinkage can be added when the campaigns surface wants inline boosts). - Implementer — guards: budget ≥ $1 and ≤ $1,000, duration 1–30 days, postId required; execution against a non-healthy connection fails closed (422); double-execution conflicts (409).
Surface-area deltas
services/api/internal/domain/connections.go— schemas, closed sets, scope sets, validation,Reconnect.services/api/internal/store/connections.go+services/api/internal/store/migrations/0010_connections.sql— CRUD and the two tables (incl. Spark-Ads fields).services/api/internal/api/handlers_connections.go— list + seed, reconnect, boost create/list/execute; 5 new routes inservices/api/internal/api/server.go.apps/web-next/app/connections/page.tsx— the connections page (status pills, scopes, reconnect, boost form, history with execute).apps/web-next/app/layout.tsx— nav link.apps/web-next/lib/api.ts— connections + boosts client methods.apps/web-next/lib/types.ts—Connection,BoostAudience,BoostRequesttypes.apps/web-next/lib/demo.ts— demo-engine parity.- Tests:
services/api/internal/api/connections_test.go— spectrum seed, reconnect, lifecycle + 409, guards, audit trail. - Bookkeeping: the card's git-mv sides
tasks/00-backlog/T-026-page-connections-boosts.md/tasks/10-in-progress/T-026-page-connections-boosts.mdand this specdocs/tech-spec/T-026.md.
Verification
Go gates: go test ./... (6/6 packages; 5 new test functions). Web gates:
npm run build (strict), jest, eslint. Sandbox proof: the executor path
contains no HTTP client and its detail string says so; the audit trail test
reads the log store directly.
Out of scope
Real Meta/TikTok/Google executors and OAuth (credentials-gated: T-001, T-002, T-012), campaign-list inline boosts, ad-account insights.