-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
71 lines (57 loc) · 2.11 KB
/
Copy pathJustfile
File metadata and controls
71 lines (57 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
set shell := ["bash", "-uc"]
default:
just --list
test:
go test ./...
test-short:
go test -short ./...
test-ask:
go test ./cmd/agentroom -run 'TestAskReplyAcrossCLI|TestBeginAskRejectsConcurrentAsk|TestWaitForReplyTimeout|TestResolveLiveTargetRejectsMissingAndAmbiguous' -count=1
fix:
go fix ./...
fix-check:
go fix -diff ./...
build: fix-check
go build ./...
vet: fix-check
go vet ./cmd/agentroom ./agentroom
lint: fix-check
golangci-lint run ./...
analyze: vet lint
check: test build vet lint
git diff --check
cli:
go build -o cmd/agentroom/agentroom ./cmd/agentroom
help:
go run ./cmd/agentroom --help
go run ./cmd/agentroom ask --help
go run ./cmd/agentroom reply --help
# Requires a reachable Redis at REDIS_ADDR (default localhost:6379).
smoke-ask redis_addr="localhost:6379":
#!/usr/bin/env bash
set -euo pipefail
bin="${TMPDIR:-/tmp}/agentroom-smoke"
repo="agentroom-smoke-$$(date +%s)"
branch="test"
session="agentroom-smoke-session"
go build -o "$bin" ./cmd/agentroom
env CLAUDE_SESSION_ID="$session" "$bin" --addr "{{redis_addr}}" --repo "$repo" --branch "$branch" post AGENT_JOINED '{"role":"reviewer","working_on":"ask smoke"}' --agent reviewer-smoke
"$bin" --addr "{{redis_addr}}" --repo "$repo" --branch "$branch" who
env CLAUDE_SESSION_ID="$session" "$bin" --addr "{{redis_addr}}" --repo "$repo" --branch "$branch" ask "can you confirm the smoke?" --agent asker-smoke --to reviewer-smoke --timeout 1s &
ask_pid=$!
trap 'kill "$ask_pid" 2>/dev/null || true' EXIT
ask_id=""
for _ in {1..50}; do
ask_id="$("$bin" --addr "{{redis_addr}}" --repo "$repo" --branch "$branch" tail --count 5 | awk '$3 == "ASK" {print $1}' | tail -1)"
if [[ -n "$ask_id" ]]; then
break
fi
sleep 0.05
done
if [[ -z "$ask_id" ]]; then
echo "ASK event did not appear" >&2
exit 1
fi
env CLAUDE_SESSION_ID="$session" "$bin" --addr "{{redis_addr}}" --repo "$repo" --branch "$branch" reply "$ask_id" '{"status":"ok"}' --agent reviewer-smoke
wait "$ask_pid"
trap - EXIT