Skip to content

cleanup: prune pre-pivot dead code (ads, USDC, World Chain, GitHub OAuth) from API + docs #73

@distroinfinity

Description

@distroinfinity

Context

The Distro TV pivot (May 2026, PR #65) removed product-level surfaces for ads, USDC earnings, World Chain integration, and GitHub OAuth. The code paths and docs for these surfaces still exist — they're inert at runtime (no callers, no UI) but they bloat the API package and confuse new readers.

Surfaced during the M8 gitbook audit:

  • `gitbook-docs/backend/api.md` (~1394 lines): still documents ad/campaign/earnings/World Chain routes inside marked-deprecated sections. Should match the actual code state.
  • `gitbook-docs/cli/daemon-and-hooks.md`: retains "ad" terminology in impression/key-capture sections because the daemon code still uses those terms internally.

Suggested scope

Code-side (`packages/api/src`)

  • Routes / services / DB columns for: campaigns, ad slots, ad impressions (separate from "slot impressions"), revenue ledger, payout queue, USDC settlement worker, World ID verifier middleware, GitHub OAuth callback + session exchange
  • Drizzle schema tables: anything ad/campaign/earnings/payout/world-* related (run a migration to drop)
  • Workers: settlement, payout-batcher, world-id-* (if any)
  • Env vars: `GITHUB_CLIENT_*`, `WORLD_CHAIN_RPC`, `WORLD_ID_ACTION` — remove all references in code + .env.example + setup-worktree.sh + .env.shared

CLI-side (`packages/cli/src`)

  • Rename remaining "ad" terminology in daemon code → "slot" (or whatever the post-pivot canonical noun is)
  • Drop any USDC/wallet/earnings flows still present in commands

Docs

  • Prune the deprecated sections in `gitbook-docs/backend/api.md`
  • Refresh `gitbook-docs/cli/daemon-and-hooks.md` once daemon terminology is updated
  • Re-verify all gitbook pages don't reference dead surfaces

Why P2 / not urgent

  • All pre-pivot code is inert; no live callers, no production impact
  • Pivot is documented in `gitbook-docs/architecture/agent-treasury-pivot.md` (marked superseded) and the brand pages
  • Pruning is high-effort, low-risk — best done as a focused PR when there's bandwidth, not interleaved with feature work

Acceptance

  • `grep -r "campaign\|adImpression\|payout\|world.*chain\|world.*id" packages/api/src` returns zero hits (except inside historical archive/comments)
  • Drizzle schema only contains tables for the current product (users, devices, channels, news_items, ticker_symbols, watchlists, alerts, sessions, slot_impressions, etc.)
  • `gitbook-docs/backend/api.md` matches the actual route surface (~half the line count)
  • `@distrotv/cli` daemon terminology uses "slot" consistently

Related

  • M8 PR: M8: landing page + install vector #70 (gitbook audit + DEVDRIP_ALLOW_NEON_IN_DEV rename surfaced these as deferred)
  • Original Distro TV pivot spec: `docs/superpowers/specs/2026-05-05-distro-tv-pivot-design.md`
  • Superseded pages already marked: `gitbook-docs/architecture/agent-treasury-pivot.md`, `gitbook-docs/architecture/chain.md`, `gitbook-docs/frontend/mini-app.md`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions