feat: create SkyEye Governance Layer with infra manifest, quota ledger, and service guards

Add the skyeye/ directory structure including:
- infra-manifest.json: infrastructure inventory and quota definitions
- quota-ledger.json: billing cycle tracking and health summary
- guards/: per-service guard configs (GitHub, Drive, Notion, Actions, Gemini)
- guards/guard-template.json: template for new service guards
- scripts/: placeholder files for scan-engine, optimizer, guard-factory,
  quota-tracker, self-healer, and weekly-scan
- scan-report/, logs/daily/, logs/weekly/: empty dirs for future output

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-23 14:19:54 +00:00
parent ed2d208f7b
commit 9dc94a7b3a
17 changed files with 365 additions and 0 deletions

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-ACTIONS",
"target_service": "GitHub Actions",
"status": "active",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/actions-staging/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": 2000,
"current_month_used": 0,
"daily_soft_limit": 67,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "workflow_status_check",
"interval_hours": 6,
"last_check": null,
"last_status": "healthy",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-DRIVE",
"target_service": "Google Drive API",
"status": "active",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/drive-staging/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": 15,
"current_month_used": 0,
"daily_soft_limit": 0,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "api_ping",
"interval_hours": 6,
"last_check": null,
"last_status": "healthy",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-GEMINI",
"target_service": "Google Gemini API",
"status": "active",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/gemini-staging/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": 1500,
"current_month_used": 0,
"daily_soft_limit": 50,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "api_ping",
"interval_hours": 6,
"last_check": null,
"last_status": "healthy",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-GITHUB",
"target_service": "GitHub API",
"status": "active",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/inbox/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": 2000,
"current_month_used": 0,
"daily_soft_limit": 67,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "api_ping",
"interval_hours": 6,
"last_check": null,
"last_status": "healthy",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-[SERVICE_NAME]",
"target_service": "[Service Name]",
"status": "initializing",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/[service]-staging/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": "[TO_BE_FILLED]",
"current_month_used": 0,
"daily_soft_limit": 0,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "[TO_BE_FILLED]",
"interval_hours": 6,
"last_check": null,
"last_status": "unknown",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,40 @@
{
"guard_id": "GUARD-NOTION",
"target_service": "Notion API",
"status": "active",
"mode": "buffer",
"buffer_policy": {
"enabled": true,
"buffer_path": "buffer/notion-staging/",
"max_buffer_age_hours": 24,
"flush_strategy": "scheduled",
"flush_schedule_cst": ["21:30"]
},
"quota_policy": {
"monthly_limit": 3,
"current_month_used": 0,
"daily_soft_limit": 0,
"warning_threshold_percent": 70,
"critical_threshold_percent": 90,
"on_warning": "reduce_frequency",
"on_critical": "emergency_only"
},
"trigger_policy": {
"default_frequency": "3_per_day",
"min_frequency": "1_per_day",
"max_frequency": "6_per_day",
"auto_adjust": true,
"adjust_based_on": ["quota_remaining", "message_volume", "error_rate"]
},
"health_check": {
"enabled": true,
"method": "api_ping",
"interval_hours": 6,
"last_check": null,
"last_status": "healthy",
"consecutive_failures": 0,
"max_failures_before_alert": 3
},
"last_updated_by": "skyeye-init",
"last_updated_at": "2026-03-23T12:00:00Z"
}

View File

@ -0,0 +1,82 @@
{
"version": "1.0.0",
"last_scan": "2026-03-23T12:00:00Z",
"last_scan_by": "skyeye-weekly-scan",
"infrastructure": {
"github": {
"service": "GitHub",
"plan": "Free",
"repos": [
{
"name": "qinfendebingshuo/guanghulab",
"role": "main",
"guard": "buffer/"
},
{
"name": "WENZHUOXI/guanghu-awen",
"role": "sub-repo",
"persona": "PER-ZQ001",
"guard": ".github/persona-brain/"
}
],
"quotas": {
"actions_minutes_per_month": 2000,
"actions_current_used": 0,
"actions_budget_allocated": {
"buffer_collect": 270,
"buffer_flush": 90,
"skyeye_checkin": 180,
"skyeye_weekly_scan": 30,
"other_workflows": 200,
"emergency_reserve": 1230
},
"storage_limit_gb": 0.5,
"lfs_bandwidth_gb": 1
}
},
"google_drive": {
"service": "Google Drive",
"plan": "Google One / Free 15GB",
"guard": "buffer/drive-staging/",
"quotas": {
"storage_gb": 15,
"current_used_gb": 0,
"apps_script_daily_triggers": 20,
"apps_script_runtime_min_per_day": 90,
"drive_api_queries_per_100s": 20000
}
},
"notion": {
"service": "Notion",
"plan": "Plus",
"guard": "霜砚PER-SY001",
"quotas": {
"api_requests_per_second": 3,
"blocks_per_page": 10000,
"file_upload_mb": 5,
"guest_limit": 100
}
},
"gemini": {
"service": "Google Gemini",
"plan": "Free / Pro",
"guard": "buffer/gemini-staging/",
"quotas": {
"requests_per_minute": 15,
"requests_per_day": 1500,
"context_window_tokens": 1000000,
"personal_context_files": 100
}
},
"github_actions": {
"service": "GitHub Actions",
"plan": "Free",
"guard": "skyeye/guards/actions-guard.json",
"quotas": {
"concurrent_jobs": 20,
"minutes_per_month": 2000,
"job_timeout_hours": 6
}
}
}
}

View File

View File

43
skyeye/quota-ledger.json Normal file
View File

@ -0,0 +1,43 @@
{
"ledger_version": "1.0.0",
"billing_cycle": {
"start": "2026-03-01",
"end": "2026-03-31"
},
"services": {
"github_actions": {
"limit": 2000,
"used": 0,
"remaining": 2000,
"allocated": {
"buffer_system": 360,
"skyeye_daily": 180,
"skyeye_weekly": 30,
"sub_repo_checkins": 200,
"emergency": 1230
},
"daily_entries": []
},
"google_drive": {
"storage_limit_gb": 15,
"storage_used_gb": 0,
"apps_script_triggers_today": 0,
"apps_script_triggers_limit": 20
},
"notion_api": {
"rate_limit_per_second": 3,
"requests_today": 0,
"errors_today": 0
},
"gemini": {
"daily_limit": 1500,
"daily_used": 0,
"per_minute_limit": 15
}
},
"health_summary": {
"overall": "healthy",
"alerts": [],
"last_updated": "2026-03-23T12:00:00Z"
}
}

View File

View File

View File

View File

View File

View File

View File