From 5af416d710611dfc20362dfb8aca262f682dd78f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:31:15 +0000 Subject: [PATCH] [skyeye-governance] Create SkyEye Governance Layer with full infrastructure, guards, scripts, workflow, and test run Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/33ac7cc1-616d-426c-9b8f-6ad1a72df739 --- .github/workflows/skyeye-weekly-scan.yml | 42 ++++++++++++ skyeye/infra-manifest.json | 2 +- skyeye/logs/weekly/optimize-20260323.json | 12 ++++ skyeye/logs/weekly/quota-audit-20260323.json | 42 ++++++++++++ skyeye/logs/weekly/scan-20260323.json | 7 +- skyeye/logs/weekly/self-heal-20260323.json | 32 +++++++++ skyeye/quota-ledger.json | 2 +- skyeye/scan-report/20260323-weekly-scan.json | 68 ++++++++++++++++++++ 8 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/skyeye-weekly-scan.yml create mode 100644 skyeye/logs/weekly/optimize-20260323.json create mode 100644 skyeye/logs/weekly/quota-audit-20260323.json create mode 100644 skyeye/logs/weekly/self-heal-20260323.json create mode 100644 skyeye/scan-report/20260323-weekly-scan.json diff --git a/.github/workflows/skyeye-weekly-scan.yml b/.github/workflows/skyeye-weekly-scan.yml new file mode 100644 index 00000000..b1226dcb --- /dev/null +++ b/.github/workflows/skyeye-weekly-scan.yml @@ -0,0 +1,42 @@ +name: "SkyEye Weekly Full Scan" + +on: + schedule: + - cron: '0 12 * * 6' # 20:00 CST (UTC+8) every Saturday + repository_dispatch: + types: [skyeye-full-scan] # 手动触发 + +permissions: + contents: write + +jobs: + weekly-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: "🧐 Wake up SkyEye Core Brain" + run: echo "[SkyEye] Core brain awakened for weekly full scan at $(date -u '+%Y-%m-%dT%H:%M:%SZ')" + + - name: "🔍 Phase 1 - Infrastructure Scan" + run: node skyeye/scripts/scan-engine.js --mode=full + + - name: "💰 Phase 2 - Quota Audit" + run: node skyeye/scripts/quota-tracker.js --audit + + - name: "⚙️ Phase 3 - Optimize Guards" + run: node skyeye/scripts/optimizer.js --apply + + - name: "🩹 Phase 4 - Self-Heal" + run: node skyeye/scripts/self-healer.js + + - name: "📝 Phase 5 - Generate Report" + run: node skyeye/scripts/weekly-scan.js --report + + - name: "Commit scan results" + run: | + git config user.name "天眼 · SkyEye Core" + git config user.email "skyeye@guanghu.system" + git add skyeye/ buffer/config/ + git diff --cached --quiet || git commit -m "[skyeye-weekly] $(date -u +%Y%m%d) full scan complete [skip ci]" + git push diff --git a/skyeye/infra-manifest.json b/skyeye/infra-manifest.json index 77b5edae..4e0a571b 100644 --- a/skyeye/infra-manifest.json +++ b/skyeye/infra-manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "last_scan": "2026-03-23T14:27:06.305Z", + "last_scan": "2026-03-23T14:30:07.186Z", "last_scan_by": "skyeye-scan-engine", "infrastructure": { "github": { diff --git a/skyeye/logs/weekly/optimize-20260323.json b/skyeye/logs/weekly/optimize-20260323.json new file mode 100644 index 00000000..d8952e2c --- /dev/null +++ b/skyeye/logs/weekly/optimize-20260323.json @@ -0,0 +1,12 @@ +{ + "optimize_id": "OPT-20260323", + "timestamp": "2026-03-23T14:30:16.154Z", + "mode": "apply", + "guards_checked": 5, + "adjustments": [], + "summary": { + "guards_checked": 5, + "total_adjustments": 0, + "applied": true + } +} diff --git a/skyeye/logs/weekly/quota-audit-20260323.json b/skyeye/logs/weekly/quota-audit-20260323.json new file mode 100644 index 00000000..975af2be --- /dev/null +++ b/skyeye/logs/weekly/quota-audit-20260323.json @@ -0,0 +1,42 @@ +{ + "audit_id": "AUDIT-20260323", + "timestamp": "2026-03-23T14:30:11.691Z", + "mode": "full", + "services": { + "github_actions": { + "service": "github_actions", + "status": "healthy", + "usage_percent": 0, + "alerts": [], + "recommendations": [ + "日均可用预算: 250 分钟 (剩余 8 天)" + ] + }, + "google_drive": { + "service": "google_drive", + "status": "healthy", + "usage_percent": 0, + "alerts": [], + "recommendations": [] + }, + "notion_api": { + "service": "notion_api", + "status": "healthy", + "usage_percent": 0, + "alerts": [], + "recommendations": [] + }, + "gemini": { + "service": "gemini", + "status": "healthy", + "usage_percent": 0, + "alerts": [], + "recommendations": [] + } + }, + "overall_status": "healthy", + "total_alerts": 0, + "recommendations": [ + "日均可用预算: 250 分钟 (剩余 8 天)" + ] +} diff --git a/skyeye/logs/weekly/scan-20260323.json b/skyeye/logs/weekly/scan-20260323.json index 4b80d055..1132f64e 100644 --- a/skyeye/logs/weekly/scan-20260323.json +++ b/skyeye/logs/weekly/scan-20260323.json @@ -1,7 +1,7 @@ { "scan_id": "SCAN-20260323", "mode": "full", - "timestamp": "2026-03-23T14:27:06.304Z", + "timestamp": "2026-03-23T14:30:07.185Z", "guard_scan": { "total": 5, "valid": 5, @@ -9,7 +9,7 @@ "missing_fields": [] }, "workflow_scan": { - "total": 78, + "total": 79, "files": [ "agent-checkin.yml", "auto-deploy-drive-bridge.yml", @@ -65,6 +65,7 @@ "server-patrol.yml", "skyeye-checkin-audit.yml", "skyeye-checkin-receiver.yml", + "skyeye-weekly-scan.yml", "staging-preview.yml", "sync-deploy-to-notion.yml", "sync-dev-status.yml", @@ -118,7 +119,7 @@ "errors": 0, "warnings": 0, "guards_healthy": "5/5", - "workflows_found": 78, + "workflows_found": 79, "directories_ok": "14/14" } } diff --git a/skyeye/logs/weekly/self-heal-20260323.json b/skyeye/logs/weekly/self-heal-20260323.json new file mode 100644 index 00000000..38f752c5 --- /dev/null +++ b/skyeye/logs/weekly/self-heal-20260323.json @@ -0,0 +1,32 @@ +{ + "heal_id": "HEAL-20260323", + "timestamp": "2026-03-23T14:30:20.461Z", + "guard_repairs": { + "repaired": [], + "failed": [] + }, + "buffer_cleanup": { + "files_cleaned": 0, + "directories": [ + { + "path": "buffer/processed", + "cleaned": 0 + } + ] + }, + "log_cleanup": { + "files_cleaned": 0 + }, + "guard_restarts": { + "restarted": [] + }, + "directory_fixes": { + "created": [] + }, + "summary": { + "configs_repaired": 0, + "files_cleaned": 0, + "guards_restarted": 0, + "directories_created": 0 + } +} diff --git a/skyeye/quota-ledger.json b/skyeye/quota-ledger.json index e780d1df..55fb88e9 100644 --- a/skyeye/quota-ledger.json +++ b/skyeye/quota-ledger.json @@ -38,6 +38,6 @@ "health_summary": { "overall": "healthy", "alerts": [], - "last_updated": "2026-03-23T12:00:00Z" + "last_updated": "2026-03-23T14:30:11.691Z" } } diff --git a/skyeye/scan-report/20260323-weekly-scan.json b/skyeye/scan-report/20260323-weekly-scan.json new file mode 100644 index 00000000..0c1af001 --- /dev/null +++ b/skyeye/scan-report/20260323-weekly-scan.json @@ -0,0 +1,68 @@ +{ + "report_id": "SKYEYE-SCAN-20260323", + "scan_time": "2026-03-23T14:30:25.666Z", + "scan_time_beijing": "2026/3/23 22:30:25", + "scan_duration_seconds": 0, + "infrastructure_status": { + "total_services": 5, + "healthy": 5, + "degraded": 0, + "down": 0 + }, + "quota_status": { + "github_actions": { + "used_percent": 0, + "remaining_minutes": 2000, + "trend": "stable", + "recommendation": "maintain_current_frequency" + }, + "google_drive": { + "used_percent": 0, + "recommendation": "no_action_needed" + }, + "notion_api": { + "status": "healthy", + "recommendation": "no_action_needed" + }, + "gemini": { + "used_percent": 0, + "recommendation": "no_action_needed" + } + }, + "guard_status": { + "total_guards": 5, + "active": 5, + "suspended": 0, + "adjustments_made": [] + }, + "self_heal_actions": { + "files_cleaned": 0, + "configs_repaired": 0, + "guards_restarted": 0 + }, + "phase_details": { + "phase1_scan": { + "total_issues": 0, + "errors": 0, + "warnings": 0, + "guards_healthy": "5/5", + "workflows_found": 79, + "directories_ok": "14/14" + }, + "phase2_audit": "healthy", + "phase3_optimize": { + "guards_checked": 5, + "total_adjustments": 0, + "applied": true + }, + "phase4_heal": { + "configs_repaired": 0, + "files_cleaned": 0, + "guards_restarted": 0, + "directories_created": 0 + } + }, + "alerts": [], + "human_action_required": [], + "next_scan": "2026-03-28T12:00:00.000Z" +}