mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 13:35:12 +09:00
The self-contained reports slice of the #33 agency-scale milestone, built without the high-blast-radius workspace_id/ACL/branding rework. - WpReportsService aggregates one calendar month per site: uptime % + a daily series + incidents (re-aggregated from #26 HealthCheck samples for the exact month), update runs (#29), DatabaseSnapshot backups, and current vulnerability posture (#28) + health/disk — each labelled persisted-history vs point-in-time. - Persisted (WordPressReport, Alembic 014 off 013_ai_assistant) + synchronous upsert per (site, YYYY-MM), so point-in-time sources (vulns, health) are captured as-of generation while true-historical sources are re-queried per month. Client grouping derives from the client-* tag (#20) — no workspace_id FK. Model lives in wordpress_site.py + lazy-imported in the service so the concurrent AI agent's models/__init__.py is untouched. - Routes GET /reports, POST /reports/generate (admin), DELETE /reports/<id>; client getReports/generateReport/deleteReport; a Reports tab with a recharts daily-uptime chart, summary cards, Print->Save-as-PDF (scoped @media print, no PDF dep) and JSON export. - 9 pytest tests; 3-lens adversarial review (4 of 5 findings fixed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>