Agent Operations

Production Operations Guide

Keep the Resonance agent healthy in production with daily checks, update runbooks, and incident response playbooks.

Daily Checks

  • Ensure /health responds 200 with current version and commit hash.
  • Review /metrics for recent R(t), entropy, latency, and tail distributions.
  • Confirm dashboard status strip reports uptime > 95% over the last 24 hours.

Updating the Agent

  1. Implement code changes in the resonance/agent workspace.
  2. Run npm run build:agent-binaries to produce cross-platform archives.
  3. Tag the release (git tag agent-vX.Y.Z && git push --tags) to trigger GitHub Actions.
  4. Render redeploys the backend and serves the new build artifacts.
  5. Agents poll RESONANCE_UPDATE_MANIFEST_URL and stage updates automatically.

Auto-update Flow

  • Polling cadence: RESONANCE_UPDATE_INTERVAL_MS (default 30 minutes).
  • New versions download to RESONANCE_UPDATE_STAGING_DIR.
  • Apply staged updates via resonance-agent --install-staged-update.

Scaling Intake

  • Run multiple agent instances behind a load balancer; stick sessions by API key.
  • Separate RESONANCE_INTAKE_API_KEY from dashboard key for least privilege.
  • Use the bench harness (--with-latency) to stress test throughput before go-live.

Incident Response

  • Confirm adaptive mode is enabled (policy defaults to adaptive).
  • Stream additional phase samples if coherence drops below 0.30.
  • Capture latency percentiles when Tail Health triggers warnings.
  • Investigate entropy spikes by verifying upstream clock sync and sampling intervals.

Security

  • API keys validated via constant-time comparison in security.ts.
  • Middleware enforces CSP, HSTS, and COOP/COEP headers.
  • Review docs/SECURITY_BASELINE.md for a full breakdown.

Useful Commands

# Validate health endpoint
curl https://syncscript-backend.onrender.com/health

# Feed synthetic phases
node resonance/bench/feed_phases.js --interval 1000 --count 600

# Tail latency smoke test
node resonance/bench/feed_phases.js --with-latency --interval 1000 --count 300