Description
src/agent/lifecycle.rs contains three TODO items for core agent lifecycle operations:
- heartbeat() (line ~134): Send heartbeat to broker/coordinator, receive lease offers
- pause() (line ~143): Checkpoint any active sandboxes, notify broker
- withdraw() (lines ~176-177): Checkpoint and terminate all active sandboxes, notify broker/coordinator of withdrawal
These are critical for Principle III (Donor Sovereignty) — donors must be able to pause and withdraw at any time with clean state transitions.
Requirements
- Heartbeat: periodic signal to broker with node state, resource availability, active leases
- Pause: checkpoint all running sandboxes (SIGSTOP + snapshot), transition to Paused state, stop accepting new leases
- Withdraw: checkpoint all sandboxes, terminate them, wipe scoped working directory, revoke keypair, notify broker, leave no host state
Success Criteria
Testing (Principle V)
- Run agent on real hardware, submit job, trigger pause, verify checkpoint saved
- Withdraw and verify zero host residue (scan for files, processes, network listeners)
- Test rapid pause/resume cycles under load
- Test withdraw during active job execution
Description
src/agent/lifecycle.rscontains three TODO items for core agent lifecycle operations:These are critical for Principle III (Donor Sovereignty) — donors must be able to pause and withdraw at any time with clean state transitions.
Requirements
Success Criteria
cargo testpasses with zero regressionsTesting (Principle V)