feat: activate and improve autonomous orchestrator, shield, health checker, and innovation modules#156
Merged
Merged
Conversation
- Create backend/modules/github-ops.js: GitHub pull/PR/merge/workflow-trigger/rollback ops - Create scripts/system-shield.js: real-time file-watch (chokidar) + PM2 process-monitor + deploy-lock + HTTP API - Enhance scripts/health-guardian.js: add external URL check (https://zeusai.pro) + orchestrator notifications - Enhance autonomous-orchestrator.js: integrate github-ops cycle (pull, CI-check, rollback) - Update ecosystem.config.js: add unicorn-system-shield PM2 process + external health URL env vars - Wire /api/github-ops/* routes into backend/index.js Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/d8f4af31-6da5-4108-8ec4-4b73cafe0e53 Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
- system-shield.js: use execFile instead of exec for pm2/git commands, add isSafeProcName() + isSafeFilePath() validators, log notification errors - github-ops.js: use separate console.log args to avoid tainted-format-string, fix spread whitespace - health-guardian.js: log orchestrator notification errors Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/d8f4af31-6da5-4108-8ec4-4b73cafe0e53 Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
…check, fix tainted-format-string in health-guardian log Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/d8f4af31-6da5-4108-8ec4-4b73cafe0e53 Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ruffy80
April 13, 2026 20:10
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four autonomous subsystems (orchestrator, shield, health checker, innovation agent) existed in partial/inactive states. This PR activates all of them, fills capability gaps, and wires everything into the PM2 ecosystem.
New:
backend/modules/github-ops.jsCentralized GitHub operations module used by the orchestrator:
pullLatest(branch)— authenticated git pullcreatePR / mergePR— GitHub API PR lifecycletriggerWorkflow(id, branch)— workflow dispatch (CI/deploy trigger)getWorkflowRuns— CI status pollingrollback(sha)— git revert + pushNew:
scripts/system-shield.js(PM2:unicorn-system-shield)Standalone shield daemon replacing the simpler quantum watchdog for file/process protection:
execFile('pm2', ['restart', ...])on failuregit checkout --usingexecFile/tmp/unicorn-deploy.lockwith 30-min auto-expireGET /status,POST /lock,POST /unlock,POST /healisSafeProcName()(regex) +isSafeFilePath()(path.relative-based) guards prevent injectionEnhanced:
scripts/health-guardian.jsHEALTH_GUARDIAN_EXTERNAL_URL, defaultPUBLIC_APP_URL/health) on a separate 2-min intervalPOST /api/orchestrator/checkon any failure (internal, shield, or external)log()now uses separateconsole.logargs (not template literals) to avoid tainted-format-stringEnhanced:
autonomous-orchestrator.jsAdds a 9th cycle (
runGithubCycle, default every 10 min):ecosystem.config.jsunicorn-system-shieldapp entryunicorn-health-guardianenv extended withHEALTH_GUARDIAN_EXTERNAL_URL,HEALTH_GUARDIAN_EXTERNAL_MS,HEALTH_GUARDIAN_ORCHESTRATOR_URLunicorn-orchestratorenv extended withGH_PULL_INTERVAL=600,GH_AUTO_ROLLBACK=falsebackend/index.jsgithub-opsrequired and startedGET /api/github-ops/status,GET /api/github-ops/workflow-runs,POST /api/github-ops/pull,POST /api/github-ops/trigger-workflow,POST /api/github-ops/rollback(all admin-gated except status)