3.1 KiB
3.1 KiB
Verification summary – PR/generation flow
Quick checks run to verify the campaign, post, and content flow (strategy agent, live data, response framework, publish, analytics).
Backend (Python, with venv)
| Check | Result |
|---|---|
Strategy agent suggest_campaigns(months_ahead=2, start_from=date(2025,3,1)) |
OK – returns 2 campaigns with correct name, start_date, end_date, suggested_feature_ids |
Content templates build_context_for_feature, render_template_safe, list_templates |
OK – 4 templates; safe render returns (success, data, error); invalid template_id returns failure |
| AgentResult + product_context | OK – AgentResult.ok/AgentResult.fail and ErrorCodes; product context has features |
| Async enrich_context_live_data | OK – runs without error; today_kwh in context (empty when no DB data) |
Schedule expand expand_schedule(..., template_id) |
OK – returns list of slots with platform, scheduled_at |
| suggest_campaigns_endpoint (body: months_ahead=2) | OK – returns AgentResult with data.campaigns |
| preview_from_template (async, with DB session) | OK – returns AgentResult with data.text (e.g. product overview) |
Code fixes applied during verification
- strategy_agent.py: Removed unused
timedeltaimport.
Not run in this environment
- Full FastAPI app –
app.mainimportspr_authwhich requiresjwt; venv used for checks may not have it in path, or tests import main and fail on missing jwt. Requirements listpyjwt==2.10.1. - pytest – Tests that use DB or import
app.mainhitModuleNotFoundError: jwtor sandboxPermissionError(network/DB). No tests were added or changed for the new generate/strategy/live-data code. - PR frontend build –
npm run build/npx tscnot run (TypeScript not installed in environment). UI changes (Generate page checkbox, Campaigns suggest button) are consistent with the API (AgentResult, suggest-campaigns body, preview include_live_data).
Manual verification suggestions
-
Backend running (with DB and
jwtinstalled):POST /api/generate/suggest-campaignswith body{"months_ahead": 3}→success: true,data.campaignsarray.POST /api/generate/preview-from-templatewith body{"template_id": "product_overview_x", "include_live_data": false}→success: true,data.textset.- With
include_live_data: trueand DB having daily metrics for today, previewdata.context.today_kwhshould be set when data exists.
-
PR frontend (pr.degelas.be or local):
- Campaigns: “Suggest next 3 months” returns and displays suggested campaigns.
- Generate: “Include live data” checkbox sends
include_live_data: true; preview shows text (and today_kwh when backend returns it).
-
Publish job – When the scheduler runs,
run_scheduled_posts_jobreturns a list of{ post_id, status, posted_url? };mark_postedaccepts optionalposted_url. -
Analytics job –
run_post_insights_job()returns{ success, fetched, errors }; with no X/Instagram API,fetchedstays 0 and no rows are inserted.