Imprevista

Deploy Log

← Back to Deploy Log
|Marketing Bot|DEPLOYED

Add Drafts admin page + auto-merge approve/reject loop (#10)

The agent now logs every successful draft POST to learnings/drafts.jsonl, and the new /drafts.html page lists pending drafts with one-click Approve/Reject backed by GDA's existing /api/internal/drafts/<id>/{approve,reject}

The agent now logs every successful draft POST to learnings/drafts.jsonl, and the new /drafts.html page lists pending drafts with one-click Approve/Reject backed by GDA's existing /api/internal/drafts/<id>/{approve,reject} endpoints. End-to-end reject loop smoke-tested against GDA prod.

Also ran the agent once in --production mode against real GSC data, posting 4 real drafts (1 AI fanout, 3 page 2-3 keyword) which now populate the admin page. The fact_block_html is still placeholder text — honest banner at the top of /drafts.html warns about this.

What's new:

  • agents/gda/gsc-refresh/agent.js: appends successful POSTs to

learnings/drafts.jsonl with full opportunity + GSC metrics

  • api/admin/drafts.js: GET endpoint returning drafts + summary counts
  • api/admin/draft-action.js: POST endpoint that proxies approve/reject to

GDA and appends updated status to the ledger

  • drafts.html: list view with status pills, GSC metrics, preview iframe,

approve/reject buttons, summary counters, filter chips

  • learnings/drafts.jsonl: 5 ledger entries (4 posted + 1 reject)
  • Nav links on all 8 pages: Drafts between Experiments and Process

Smoke test confirmed: rejecting drf_tycx4ba3 via the new API hit GDA's /api/internal/drafts/<id>/reject, returned rejected_at, and the ledger flipped status accordingly.

What's NOT in this commit (next step):

  • LLM generation of real fact_block_html from GSC opportunity + GDA price

data (drafts still ship placeholder text — banner on /drafts.html warns about this)

  • Validator cron to auto-fire verdicts on 2026-06-02
  • Email/Slack notification on new draft posted

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files Changed

Commit:943ce0e