This repository has been archived on 2026-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
orchestrator/security-review/systemd/sea-haven-secrev.service
Adam Moussa dbe2f8c186 Raise nightly agentic budget $20 -> $120 for full per-night coverage
First-run data (2026-06-17) showed the $20 ceiling covered only the
canary + 5 of ~22 scannable repos before pausing the rotation, leaving
16 repos un-deep-scanned that night. Raise TOTAL_BUDGET_USD default to
$120 so every repo gets a deep agentic pass each night (~22 x ~$5 +
canary, with headroom). Spend draws on the Max subscription pool; the
per-target cap ($12) and round-robin rotation are unchanged, so this is
a ceiling raise, not a per-repo cost change. Updates README, DEPLOY, and
the systemd Environment example to match.
2026-06-17 13:18:46 -04:00

49 lines
2.3 KiB
Desktop File

# sea-haven-secrev.service — Path B nightly security sweep (sh-secrev VM, user adam).
#
# Install (on the VM, as root):
# sudo cp sea-haven-secrev.service /etc/systemd/system/
# sudo cp sea-haven-secrev.timer /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable --now sea-haven-secrev.timer # timer drives the run; do NOT enable the .service
# systemctl list-timers sea-haven-secrev.timer # confirm next run
# sudo systemctl start sea-haven-secrev.service # optional: run once now to smoke-test
# journalctl -u sea-haven-secrev.service -e # logs (also under ~/sweep-reports/<date>/)
#
# Secrets come from the EnvironmentFiles (the leading '-' = optional, no failure if absent):
# ~/secrev.env -> CLAUDE_CODE_OAUTH_TOKEN (required by run_headless.py),
# GH_TOKEN (read-only fine-grained PAT — REQUIRED for org auto-discovery),
# SLACK_WEBHOOK_URL
# ~/orchestrator/.env -> OPENAI_API_KEY etc. (only needed if ENABLE_XMODEL_HOOK=1)
#
# GH_TOKEN must be a fine-grained PAT scoped to the Sea-Haven-Industries org with READ-ONLY
# Contents (and Metadata) permission — nothing else. It enumerates repos and clones them into
# ~/repo-mirrors. Never give this unattended box a write-capable token.
[Unit]
Description=Sea Haven Path B nightly security sweep
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=adam
WorkingDirectory=/home/adam/orchestrator
EnvironmentFile=-/home/adam/secrev.env
EnvironmentFile=-/home/adam/orchestrator/.env
# Tune ceilings/targets here without editing the script (uncomment to override defaults):
# Environment=TOTAL_BUDGET_USD=120
# Environment=PER_TARGET_BUDGET_USD=12
# Environment=CANARY_FLOOR=10
# Environment=MAX_CYCLE_NIGHTS=4
# Environment=MAX_AGENTIC_PER_NIGHT=0
# Environment=GH_ORG=Sea-Haven-Industries
# Environment=MIRROR_DIR=/home/adam/repo-mirrors
# Environment=ENABLE_XMODEL_HOOK=0
ExecStart=/home/adam/orchestrator/security-review/nightly_sweep.sh
# Two-tier sweep (scanners over every repo + a budget-bounded agentic rotation) runs for hours;
# 6h ceiling bounds a hang without killing a healthy long night. Spend is capped by TOTAL_BUDGET_USD.
TimeoutStartSec=21600
Nice=10
[Install]
WantedBy=multi-user.target