autonomous-agents
Autonomous Agents
CRITICAL ENV DEPENDENCY:
SHAI_OPS_GROUP_IDmust be set on the worker.envon RackNerd. Without it,apps/worker/src/utils/wa-notify.ts notifyOps()silently no-ops and every alert routed through it is dropped on the floor. Verified failure mode 2026-05-12: var was set on Vercel 12 days earlier but never propagated to worker; 47 unresolved findings had accumulated unread. Fail-loud hardening (throw if missing) is a TODO. Check propagation:ssh root@172.245.56.50 'grep SHAI_OPS_GROUP_ID /opt/superseller-worker/apps/worker/.env'.Read findings every session: any cleanup, audit, or "is the system healthy" question should START with
SELECT id, agent, severity, finding, AGE(NOW(), found_at) FROM agent_findings WHERE resolved=false ORDER BY severity, found_at DESC;on RackNerd Postgres, not with manual greps. The agents already audited what you're about to audit.
Architecture
5 files in apps/worker/src/services/agents/:
| File | Agent | Schedule | What It Prevents |
|---|---|---|---|
credential-sentinel.ts |
Credential Sentinel | Every 6h | Wrong/stale API keys, cross-file drift, unexpanded ${} vars |
session-watchdog.ts |
Session Watchdog | Every 4h | FB cookies expiring silently, PM2 crash loops, posting gaps |
doc-integrity-scanner.ts |
Doc Integrity Scanner | Daily | Wrong emails/phones/script names persisting in docs |
orchestrator.ts |
Orchestrator | Every 6h | Coordinates all agents, dedup findings, daily WhatsApp digest |
index.ts |
Barrel export | — | Re-exports all agents |