solar/docs/VERIFICATION_SUMMARY.md

3.1 KiB
Raw Permalink Blame History

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 timedelta import.

Not run in this environment

  • Full FastAPI app app.main imports pr_auth which requires jwt; venv used for checks may not have it in path, or tests import main and fail on missing jwt. Requirements list pyjwt==2.10.1.
  • pytest Tests that use DB or import app.main hit ModuleNotFoundError: jwt or sandbox PermissionError (network/DB). No tests were added or changed for the new generate/strategy/live-data code.
  • PR frontend build npm run build / npx tsc not 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

  1. Backend running (with DB and jwt installed):

    • POST /api/generate/suggest-campaigns with body {"months_ahead": 3}success: true, data.campaigns array.
    • POST /api/generate/preview-from-template with body {"template_id": "product_overview_x", "include_live_data": false}success: true, data.text set.
    • With include_live_data: true and DB having daily metrics for today, preview data.context.today_kwh should be set when data exists.
  2. 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).
  3. Publish job When the scheduler runs, run_scheduled_posts_job returns a list of { post_id, status, posted_url? }; mark_posted accepts optional posted_url.

  4. Analytics job run_post_insights_job() returns { success, fetched, errors }; with no X/Instagram API, fetched stays 0 and no rows are inserted.