{
    "generated_at": "2026-05-05T11:35:03-06:00",
    "agent": {
        "interval_seconds": 600,
        "state": {
            "version": 1,
            "interval_seconds": 600,
            "last_run_at": "2026-05-05T10:13:08-06:00",
            "last_source": "shutdown",
            "last_status": "ok",
            "last_duration_ms": 31198,
            "last_changes": 0,
            "runs_total": 9834,
            "fixes_total": 4,
            "history": [
                {
                    "at": "2026-05-04T12:58:42-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 68334,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T13:09:09-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 27831,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T13:21:48-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 25232,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T13:36:09-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 130355,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T13:46:38-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 28499,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:01:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 140613,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:13:29-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 120832,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:24:54-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 85385,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:35:25-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 31525,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:46:54-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 26186,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T14:57:25-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 31518,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T15:11:21-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 25094,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T15:24:11-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 99480,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T15:36:10-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 35532,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T15:47:55-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 40749,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T16:00:50-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 60270,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T16:13:15-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 87746,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T16:26:25-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 52753,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T16:37:42-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 39336,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T16:48:48-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 26304,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T17:01:55-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 81415,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T17:13:22-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 36094,
                    "source": "shutdown",
                    "health_score": 78,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T17:26:27-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 135021,
                    "source": "shutdown",
                    "health_score": 77,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T18:51:34-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 23861,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T19:22:25-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 29693,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T19:52:21-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 36037,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T22:54:26-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 21698,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-04T23:05:11-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 44981,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-05T00:54:57-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 27363,
                    "source": "shutdown",
                    "health_score": 90,
                    "issues_total": 26
                },
                {
                    "at": "2026-05-05T10:13:08-06:00",
                    "status": "ok",
                    "changes": 0,
                    "duration_ms": 31198,
                    "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-05-05T10:12:37-06:00",
            "finished_at": "2026-05-05T10:13:08-06:00",
            "source": "shutdown",
            "status": "ok",
            "duration_ms": 31198,
            "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-05-05T10:12:37-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.75 KB)"
                    },
                    {
                        "name": "Archivo portal/news.php",
                        "status": "UP",
                        "detail": "ok (82.30 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 (24.21 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-05-05T10:12:37-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."
                }
            },
            "credential_scan": {
                "count": 0,
                "sample": []
            },
            "logs": {
                "files": {
                    "app": "/home/redaction/public_html/errors/runtime/app-2026-05-05.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": {
            "ok": true,
            "ran": false,
            "reason": "locked",
            "state": {
                "version": 1,
                "interval_seconds": 600,
                "last_run_at": "2026-05-05T10:13:08-06:00",
                "last_source": "shutdown",
                "last_status": "ok",
                "last_duration_ms": 31198,
                "last_changes": 0,
                "runs_total": 9834,
                "fixes_total": 4,
                "history": [
                    {
                        "at": "2026-05-04T12:58:42-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 68334,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T13:09:09-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 27831,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T13:21:48-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 25232,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T13:36:09-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 130355,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T13:46:38-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 28499,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:01:29-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 140613,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:13:29-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 120832,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:24:54-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 85385,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:35:25-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 31525,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:46:54-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 26186,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T14:57:25-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 31518,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T15:11:21-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 25094,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T15:24:11-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 99480,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T15:36:10-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 35532,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T15:47:55-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 40749,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T16:00:50-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 60270,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T16:13:15-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 87746,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T16:26:25-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 52753,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T16:37:42-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 39336,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T16:48:48-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 26304,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T17:01:55-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 81415,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T17:13:22-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 36094,
                        "source": "shutdown",
                        "health_score": 78,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T17:26:27-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 135021,
                        "source": "shutdown",
                        "health_score": 77,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T18:51:34-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 23861,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T19:22:25-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 29693,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T19:52:21-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 36037,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T22:54:26-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 21698,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-04T23:05:11-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 44981,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-05T00:54:57-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 27363,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    },
                    {
                        "at": "2026-05-05T10:13:08-06:00",
                        "status": "ok",
                        "changes": 0,
                        "duration_ms": 31198,
                        "source": "shutdown",
                        "health_score": 90,
                        "issues_total": 26
                    }
                ],
                "last_health_score": 90,
                "last_health_grade": "A",
                "last_issue_count": 26
            }
        }
    },
    "portal_coverage": {
        "checked_at": "2026-05-05T10:12:37-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"
}