{
    "generated_at": "2026-04-12T17:59:01-06:00",
    "agent": {
        "interval_seconds": 600,
        "state": {
            "version": 1,
            "interval_seconds": 600,
            "last_run_at": "2026-04-12T17:54:29-06:00",
            "last_source": "shutdown",
            "last_status": "ok",
            "last_duration_ms": 185,
            "last_changes": 0,
            "runs_total": 6700,
            "fixes_total": 4,
            "history": [
                {
                    "at": "2026-04-12T13:01:22-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 198,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T13:11:23-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 206,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T13:21:27-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 185,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T13:31:32-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 5585,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T13:41:38-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 177,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T13:51:45-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 6977,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:01:56-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 182,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:12:10-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 191,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:22:22-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 185,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:32:32-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 182,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:42:42-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 177,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T14:52:49-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 180,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:03:01-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 306,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:13:37-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 200,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:23:57-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 9595,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:34:03-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 6620,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:44:09-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 6286,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T15:54:20-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 9064,
                    "source": "shutdown",
                    "health_score": 75,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:04:21-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 223,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:14:21-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 187,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:24:28-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 176,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:34:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 172,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:44:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 183,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T16:54:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 218,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:04:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 239,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:14:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 170,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:24:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 181,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:34:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 184,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:44:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 203,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-04-12T17:54:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 185,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                }
            ],
            "last_health_score": 90,
            "last_health_grade": "A",
            "last_issue_count": 26
        },
        "latest_report": {
            "started_at": "2026-04-12T17:54:29-06:00",
            "finished_at": "2026-04-12T17:54:29-06:00",
            "source": "shutdown",
            "status": "ok",
            "duration_ms": 185,
            "changes": 0,
            "issues": [
                {
                    "id": "require_wa",
                    "label": "Variable require_wa no definida",
                    "severity": "low",
                    "count": 26,
                    "sample": "[2] en /home/redaction/public_html/inc_code_wa.php 2: Undefined variable $require_wa",
                    "recommendation": "Usar !empty($require_wa) en lugar de evaluación directa."
                }
            ],
            "actions": [
                {
                    "id": "cache_refresh_admin_cache_start",
                    "status": "skipped",
                    "changed": false,
                    "file": "admin/cache_start.php",
                    "detail": "Sin cambios requeridos."
                },
                {
                    "id": "cache_refresh_portal_cache_start",
                    "status": "skipped",
                    "changed": false,
                    "file": "portal/cache_start.php",
                    "detail": "Sin cambios requeridos."
                },
                {
                    "id": "publisher_news_edit_guard",
                    "status": "skipped",
                    "changed": false,
                    "file": "admin/publisher_news_edit.php",
                    "detail": "Sin cambios requeridos."
                },
                {
                    "id": "inc_news_lists_defaults",
                    "status": "skipped",
                    "changed": false,
                    "file": "admin/inc_news_lists.php",
                    "detail": "Sin cambios requeridos."
                },
                {
                    "id": "inc_code_wa_guard",
                    "status": "skipped",
                    "changed": false,
                    "file": "inc_code_wa.php",
                    "detail": "Sin cambios requeridos."
                }
            ],
            "health": {
                "generated_at": "2026-04-12T17:54:29-06:00",
                "checks": [
                    {
                        "name": "DB",
                        "status": "UNAVAILABLE",
                        "detail": "Conexión no inicializada."
                    },
                    {
                        "name": "Logs runtime",
                        "status": "UP",
                        "detail": "/home/redaction/public_html/errors/runtime"
                    },
                    {
                        "name": "Archivo index.php",
                        "status": "UP",
                        "detail": "ok (46 B)"
                    },
                    {
                        "name": "Archivo login.php",
                        "status": "UP",
                        "detail": "ok (174 B)"
                    },
                    {
                        "name": "Archivo register.php",
                        "status": "UP",
                        "detail": "ok (177 B)"
                    },
                    {
                        "name": "Archivo admin/home.php",
                        "status": "UP",
                        "detail": "ok (1.27 KB)"
                    },
                    {
                        "name": "Archivo portal/index.php",
                        "status": "UP",
                        "detail": "ok (6.49 KB)"
                    },
                    {
                        "name": "Archivo portal/news.php",
                        "status": "UP",
                        "detail": "ok (35.47 KB)"
                    },
                    {
                        "name": "Archivo portal/inc_head.php",
                        "status": "UP",
                        "detail": "ok (3.21 KB)"
                    },
                    {
                        "name": "Archivo portal/inc_top.php",
                        "status": "UP",
                        "detail": "ok (620 B)"
                    },
                    {
                        "name": "Archivo status.php",
                        "status": "UP",
                        "detail": "ok (20.00 KB)"
                    },
                    {
                        "name": "Archivo errors.php",
                        "status": "UP",
                        "detail": "ok (28.77 KB)"
                    },
                    {
                        "name": "Archivo agent.php",
                        "status": "UP",
                        "detail": "ok (21.51 KB)"
                    },
                    {
                        "name": "Cobertura /portal/* y /portales/*",
                        "status": "N/A",
                        "detail": "Analizados: 0 de 0 | UP: 0 | WARN: 0 | DOWN: 0"
                    }
                ],
                "portal_coverage": {
                    "checked_at": "2026-04-12T17:54:29-06:00",
                    "scope": "/portal/* + /portales/* + subdominios",
                    "status": "N/A",
                    "total": 0,
                    "total_available": 0,
                    "up": 0,
                    "warn": 0,
                    "down": 0,
                    "include_portales_route": true,
                    "items": [],
                    "detail": "No hay portales disponibles para analizar."
                }
            },
            "logs": {
                "files": {
                    "app": "/home/redaction/public_html/errors/runtime/app-2026-04-12.log",
                    "php": "/home/redaction/public_html/errors/runtime/php-errors.log",
                    "admin_legacy": "/home/redaction/public_html/admin/error_log.txt",
                    "portal_legacy": "/home/redaction/public_html/portal/error_log.txt"
                },
                "line_count": 600
            },
            "summary": {
                "score": 90,
                "grade": "A",
                "status": "UP",
                "checks": {
                    "up": 12,
                    "warn": 0,
                    "down": 0,
                    "other": 2
                },
                "issues_total": 26,
                "issue_severity": {
                    "high": 0,
                    "medium": 0,
                    "low": 26,
                    "info": 0
                },
                "portal": {
                    "total": 0,
                    "up": 0,
                    "warn": 0,
                    "down": 0
                }
            }
        },
        "run_result": null
    },
    "portal_coverage": {
        "checked_at": "2026-04-12T17:54:29-06:00",
        "scope": "/portal/* + /portales/* + subdominios",
        "status": "N/A",
        "total": 0,
        "total_available": 0,
        "up": 0,
        "warn": 0,
        "down": 0,
        "include_portales_route": true,
        "items": [],
        "detail": "No hay portales disponibles para analizar."
    },
    "portal_limit": 24,
    "portal_filter": "",
    "portal_scan_source": "report"
}