Skip to content

Commit 3963f6c

Browse files
simonovic86claude
andauthored
feat(agent): add deployer demo agent and update Phase 2 docs (#28)
Add deployer agent that pays a compute provider, deploys itself, and monitors deployment status with multi-step effect-safe crash recovery. Includes mock compute provider server and demo script. Update IMPLEMENTATION_STATUS.md with complete Phase 2 section, HOSTCALL_ABI.md with wallet_pay (x402) capability docs, SPEC_INDEX.md with EFFECT_LIFECYCLE.md entry, and ROADMAP.md to reflect Phase 2 completion status. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ced4234 commit 3963f6c

12 files changed

Lines changed: 1131 additions & 14 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ make agent-heartbeat # Build heartbeat WASM agent → agents/heartbeat/agent.
2020
make agent-pricewatcher # Build price watcher WASM agent → agents/pricewatcher/agent.wasm
2121
make agent-sentinel # Build treasury sentinel WASM agent → agents/sentinel/agent.wasm
2222
make agent-x402buyer # Build x402 buyer WASM agent → agents/x402buyer/agent.wasm
23+
make agent-deployer # Build deployer WASM agent → agents/deployer/agent.wasm
2324
make test # Run tests: go test -v ./...
2425
make lint # golangci-lint (5m timeout)
2526
make vet # go vet
@@ -31,6 +32,7 @@ make demo-portable # Build + run portable agent demo (run → stop → copy
3132
make demo-pricewatcher # Build + run price watcher demo (fetch prices → stop → resume → verify)
3233
make demo-sentinel # Build + run treasury sentinel demo (effect lifecycle → crash → reconcile)
3334
make demo-x402 # Build + run x402 payment demo (pay for premium data → crash → reconcile)
35+
make demo-deployer # Build + run deployer demo (pay → deploy → monitor → crash → reconcile)
3436
make clean # Remove bin/, checkpoints/, agent.wasm
3537
```
3638

@@ -89,6 +91,7 @@ Atomic writes via temp file → fsync → rename. Every checkpoint is also archi
8991
- `agents/pricewatcher/` — Demo agent: fetches BTC/ETH prices from CoinGecko, tracks high/low/latest across checkpoint/resume
9092
- `agents/sentinel/` — Treasury sentinel: monitors simulated treasury balance, triggers refills with effect-safe intent tracking, demonstrates crash recovery and reconciliation
9193
- `agents/x402buyer/` — x402 payment demo: encounters HTTP 402 paywall, pays from budget via wallet_pay hostcall, receives premium data, crash-safe payment reconciliation
94+
- `agents/deployer/` — Deployer demo: pays compute provider, deploys itself, monitors deployment status, multi-step effect-safe crash recovery
9295
- `agents/research/example/` — Original demo agent (Survivor) from research phases
9396
- `agents/research/reconciliation/` — Bridge reconciliation demo agent (research phase)
9497
- `scripts/demo-portable.sh` — End-to-end portable agent demo

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help bootstrap build build-lab clean test lint vet fmt fmt-check tidy agent agent-heartbeat agent-reconciliation agent-pricewatcher agent-sentinel agent-x402buyer run-agent demo demo-portable demo-pricewatcher demo-sentinel demo-x402 gh-check gh-metadata gh-release
1+
.PHONY: help bootstrap build build-lab clean test lint vet fmt fmt-check tidy agent agent-heartbeat agent-reconciliation agent-pricewatcher agent-sentinel agent-x402buyer agent-deployer run-agent demo demo-portable demo-pricewatcher demo-sentinel demo-x402 demo-deployer gh-check gh-metadata gh-release
22

33
.DEFAULT_GOAL := help
44

@@ -11,6 +11,7 @@ RECONCILIATION_AGENT_DIR := agents/research/reconciliation
1111
PRICEWATCHER_AGENT_DIR := agents/pricewatcher
1212
SENTINEL_AGENT_DIR := agents/sentinel
1313
X402BUYER_AGENT_DIR := agents/x402buyer
14+
DEPLOYER_AGENT_DIR := agents/deployer
1415

1516
# Go commands
1617
GOCMD := go
@@ -60,6 +61,7 @@ clean: ## Remove build artifacts
6061
rm -f agents/pricewatcher/agent.wasm
6162
rm -f agents/sentinel/agent.wasm
6263
rm -f agents/x402buyer/agent.wasm
64+
rm -f agents/deployer/agent.wasm
6365
@echo "Clean complete"
6466

6567
test: ## Run tests (with race detector)
@@ -145,6 +147,13 @@ agent-x402buyer: ## Build x402 buyer demo agent WASM
145147
cd $(X402BUYER_AGENT_DIR) && $(MAKE) build
146148
@echo "Agent built: $(X402BUYER_AGENT_DIR)/agent.wasm"
147149

150+
agent-deployer: ## Build deployer demo agent WASM
151+
@echo "Building deployer agent..."
152+
@which tinygo > /dev/null || \
153+
(echo "tinygo not found. See docs/governance/DEVELOPMENT.md for installation" && exit 1)
154+
cd $(DEPLOYER_AGENT_DIR) && $(MAKE) build
155+
@echo "Agent built: $(DEPLOYER_AGENT_DIR)/agent.wasm"
156+
148157
demo: build agent-reconciliation ## Build and run reconciliation demo
149158
@echo "Building demo runner..."
150159
@mkdir -p $(BINARY_DIR)
@@ -175,6 +184,14 @@ demo-x402: build agent-x402buyer ## Run the x402 payment demo (pay for premium d
175184
@chmod +x scripts/demo-x402.sh
176185
@./scripts/demo-x402.sh
177186

187+
demo-deployer: build agent-deployer ## Run the deployer demo (pay, deploy, monitor, crash recovery)
188+
@echo "Building mockcloud server..."
189+
@mkdir -p $(BINARY_DIR)
190+
$(GOBUILD) -o $(BINARY_DIR)/mockcloud ./cmd/mockcloud
191+
@echo "Running Deployer Demo..."
192+
@chmod +x scripts/demo-deployer.sh
193+
@./scripts/demo-deployer.sh
194+
178195
check: fmt-check vet lint test ## Run all checks (formatting, vet, lint, tests)
179196
@echo "All checks passed"
180197

agents/deployer/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: build clean
2+
3+
build:
4+
tinygo build -target=wasi -no-debug -o agent.wasm .
5+
6+
clean:
7+
rm -f agent.wasm
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"capabilities": {
3+
"clock": { "version": 1 },
4+
"rand": { "version": 1 },
5+
"log": { "version": 1 },
6+
"wallet": { "version": 1 },
7+
"http": {
8+
"version": 1,
9+
"options": {
10+
"allowed_hosts": ["localhost"],
11+
"timeout_ms": 5000,
12+
"max_response_bytes": 8192
13+
}
14+
},
15+
"x402": {
16+
"version": 1,
17+
"options": {
18+
"allowed_recipients": ["mockcloud-provider"],
19+
"max_payment_microcents": 5000000
20+
}
21+
}
22+
},
23+
"resource_limits": {
24+
"max_memory_bytes": 67108864
25+
}
26+
}

agents/deployer/go.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module github.com/simonovic86/igor/agents/deployer
2+
3+
go 1.24
4+
5+
require github.com/simonovic86/igor/sdk/igor v0.0.0
6+
7+
replace github.com/simonovic86/igor/sdk/igor => ../../sdk/igor

0 commit comments

Comments
 (0)