Skip to content

Commit 3232c55

Browse files
committed
docs: add droplet testing guide to AGENTS.md
Practical instructions for using bin/ci/droplet.sh to spin up ephemeral DO droplets for manual or scripted testing. Covers create, SSH, upload, run, and cleanup.
1 parent b63038c commit 3232c55

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,38 @@ Add new test files to `bin/test.sh` — don't scatter test invocations across CI
119119
- **When changing behavior, update all docs.** Check and update: `README.md`, `CONFIGURATION.md`, skill files (`pi/skills/*/SKILL.md`), and `AGENTS.md`. Inline code examples in docs must match the actual implementation.
120120
- **No distro-specific commands.** Scripts must work on both Arch and Ubuntu (and any standard Linux). Use `grep -E` (not `grep -P`), POSIX-compatible tools, and avoid package manager calls (`pacman`, `apt`, etc.). If a package is needed, document it as a prerequisite rather than auto-installing it.
121121

122+
## Testing on Droplets
123+
124+
Use `bin/ci/droplet.sh` to spin up ephemeral DigitalOcean droplets for testing setup, install, or shell changes on real Linux. Requires `DO_API_TOKEN` env var.
125+
126+
```bash
127+
# Generate a throwaway SSH key
128+
ssh-keygen -t ed25519 -f /tmp/ci_key -N "" -q
129+
130+
# Create a droplet (Ubuntu or Arch)
131+
eval "$(bin/ci/droplet.sh create my-test ubuntu-24-04-x64 /tmp/ci_key.pub)"
132+
# → sets DROPLET_ID, DROPLET_IP, SSH_KEY_ID
133+
134+
# Or Arch (custom image):
135+
eval "$(bin/ci/droplet.sh create my-test 217410218 /tmp/ci_key.pub)"
136+
137+
# Wait for SSH, upload source, run a CI script
138+
bin/ci/droplet.sh wait-ssh "$DROPLET_IP" /tmp/ci_key
139+
tar czf /tmp/hornet-src.tar.gz --exclude=node_modules --exclude=.git .
140+
scp -i /tmp/ci_key /tmp/hornet-src.tar.gz "root@$DROPLET_IP:/tmp/"
141+
bin/ci/droplet.sh run "$DROPLET_IP" /tmp/ci_key bin/ci/setup-ubuntu.sh
142+
143+
# Or SSH in for manual poking
144+
ssh -i /tmp/ci_key "root@$DROPLET_IP"
145+
146+
# Clean up when done (~$0.003/run)
147+
bin/ci/droplet.sh destroy "$DROPLET_ID" "$SSH_KEY_ID"
148+
```
149+
150+
Droplets take ~15s to create, ~10s for SSH, ~90s for full setup+tests. Always destroy after — they cost ~$0.003 per run but add up if forgotten.
151+
152+
The CI scripts (`bin/ci/setup-ubuntu.sh`, `bin/ci/setup-arch.sh`) run `install.sh` with simulated input, verify the result, then run the full test suite. Use them as-is or SSH in and test manually.
153+
122154
## Security Notes
123155

124156
- `tool-guard.ts` blocks: writes outside `/home/hornet_agent/`, writes to source repo, writes to protected runtime files, dangerous bash patterns (reverse shells, fork bombs, rm -rf /, etc.), credential exfiltration.

0 commit comments

Comments
 (0)