-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
190 lines (161 loc) · 7 KB
/
Copy pathTaskfile.yml
File metadata and controls
190 lines (161 loc) · 7 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
version: "3"
tasks:
dev:
desc: Run Vite with HMR and launch attn against the dev server (honors ATTN_HOME env override for multi-instance dev; optional)
vars:
DEV_HOST_VALUE: '{{default "127.0.0.1" .DEV_HOST}}'
DEV_PORT_VALUE: '{{default "auto" .DEV_PORT}}'
ATTN_PATH_VALUE: '{{default "." .ATTN_PATH}}'
cmds:
- |
bash -lc '
set -euo pipefail
DEV_HOST="{{.DEV_HOST_VALUE}}"
DEV_PORT="{{.DEV_PORT_VALUE}}"
ATTN_PATH="{{.ATTN_PATH_VALUE}}"
: "${ATTN_RELAY_URL:=https://relay-staging.attn.sh}"
: "${ATTN_BROWSER_REVIEW_URL:=https://staging.attn.sh/review}"
choose_dev_port() {
local start_port=5173
local end_port=5273
local candidate
for candidate in $(seq "${start_port}" "${end_port}"); do
if ! lsof -nP -iTCP:"${candidate}" -sTCP:LISTEN >/dev/null 2>&1; then
echo "${candidate}"
return 0
fi
done
echo "Could not find a free development port in ${start_port}-${end_port}." >&2
return 1
}
if [ "${DEV_PORT}" = "auto" ]; then
DEV_PORT="$(choose_dev_port)"
fi
ATTN_DEV_SERVER_URL="http://${DEV_HOST}:${DEV_PORT}"
cleanup() {
if [ -n "${VITE_PID:-}" ] && kill -0 "${VITE_PID}" 2>/dev/null; then
kill -TERM "${VITE_PID}" 2>/dev/null || true
sleep 0.1
kill -KILL "${VITE_PID}" 2>/dev/null || true
wait "${VITE_PID}" 2>/dev/null || true
fi
}
trap cleanup EXIT INT TERM
# Install npm deps if missing
if [ ! -d "web/node_modules" ]; then
echo "==> Installing npm dependencies..."
(cd web && npm ci)
fi
echo "Starting Vite dev server on ${ATTN_DEV_SERVER_URL}"
(
cd web
exec ./node_modules/.bin/vite --host "${DEV_HOST}" --port "${DEV_PORT}" --strictPort
) &
VITE_PID=$!
# Give the spawned Vite process a moment to fail fast (for example, port in use).
sleep 0.2
if ! kill -0 "${VITE_PID}" 2>/dev/null; then
echo "Vite failed to start on ${ATTN_DEV_SERVER_URL} (process exited early)." >&2
echo "This usually means the port is already in use by another process." >&2
wait "${VITE_PID}" || true
exit 1
fi
echo "Waiting for Vite to be ready..."
until curl -fsS "${ATTN_DEV_SERVER_URL}" >/dev/null 2>&1; do
if ! kill -0 "${VITE_PID}" 2>/dev/null; then
echo "Vite failed to start on ${ATTN_DEV_SERVER_URL}. Try: task dev DEV_PORT=5174" >&2
wait "${VITE_PID}" || true
exit 1
fi
sleep 0.2
done
echo "Launching attn with HMR enabled (path: ${ATTN_PATH}, relay: ${ATTN_RELAY_URL}, reviews: ${ATTN_BROWSER_REVIEW_URL})"
ATTN_DEV_SERVER_URL="${ATTN_DEV_SERVER_URL}" ATTN_RELAY_URL="${ATTN_RELAY_URL}" ATTN_BROWSER_REVIEW_URL="${ATTN_BROWSER_REVIEW_URL}" cargo run --bin attn -- --no-fork "${ATTN_PATH}"
'
dev:site:
desc: Run the marketing site (site/) with Vite HMR — edit site/src files and the browser updates live
cmds:
- |
bash -lc '
set -euo pipefail
if [ ! -d "site/node_modules" ]; then
echo "==> Installing site dependencies..."
(cd site && npm ci)
fi
cd site && npm run dev
'
dev:app:
desc: Run the hosted browser app (web/ browser build) — the desk + /open import page; proxies to the staging relay
cmds:
- |
bash -lc '
set -euo pipefail
if [ ! -d "web/node_modules" ]; then
echo "==> Installing web dependencies..."
(cd web && npm ci)
fi
cd web && npm run dev:browser
'
dev:collab:
desc: One-command local collab harness — boots Miniflare relay + owner + reviewer attn daemons (attn-nnj.11.7). Ctrl+C cleans up.
cmds:
- scripts/dev-collab.sh
test:review:
desc: Run the review-surface E2E test suite (shape assertions; isolated ATTN_HOME)
cmds:
- scripts/test-review-e2e.sh
test:review-render:
desc: Inline-render regression guard — relay + owner, 3 comments must all render inline (no effect_update_depth loop)
cmds:
- scripts/test-review-render-e2e.sh
test:folder-share:
desc: Folder-share E2E — `attn review share <dir>` publishes a snapshot per .md + new files appear live
cmds:
- scripts/test-folder-share-e2e.sh
test:share-v3:
desc: "Durable share v3 lifecycle — real relay stack plus native owner, browser visitor, and conformance gates"
cmds:
- scripts/test-share-e2e.sh
test:apply:
desc: Run the apply E2E test suite — Rust cargo tests + optional daemon flow (attn-nnj.8.6)
cmds:
- scripts/test-apply-e2e.sh
test:dual:
desc: Smoke-test the dual-instance E2E harness (owner + reviewer via ATTN_HOME)
cmds:
- scripts/test-dual-instance-smoke.sh
test:gate:
desc: Permanent approval-gate E2E — local relay, dual instances, scoped mixed verdict wait, and canonical resulting hash
cmds:
- scripts/test-gate-e2e.sh
test:html-share:
desc: "Headless E2E for read-only HTML doc sharing (attn-qgd) — relay + owner shares .html + reviewer renders it read-only over the encrypted transport. Honors ATTN_SKIP_HTML_SHARE_E2E=1."
cmds:
- scripts/test-html-share-e2e.sh
test:html-annotation:
desc: "Headless E2E for HTML doc annotation — owner and reviewer both receive an annotatable HTML frame, while owner path mode retains local sub-resource resolution. Honors ATTN_SKIP_HTML_ANNOTATION_E2E=1."
cmds:
- scripts/test-html-annotation-e2e.sh
test:html-annotation:runtime:
desc: "Real-browser tests for the injected annotation runtime + shell bridge (attn-ges/attn-08r). Needs Chromium via `npx playwright install chromium`."
dir: web
cmds:
- npm run test:e2e:html-annotation
test:webrtc:
desc: "Run the WebRTC end-to-end test (Rust transport + bash daemon shape). Honors ATTN_SKIP_WEBRTC_E2E=1 on flaky CI."
cmds:
- cargo test --test webrtc_e2e -- --nocapture
- scripts/test-webrtc-e2e.sh
test:3party:
desc: "3-party live collab E2E — relay + owner + 2 reviewers through the UI: presence, co-typing (6 ways), remote carets, and comments alongside live editing. Honors ATTN_SKIP_3PARTY_E2E=1."
cmds:
- scripts/test-3party-e2e.sh
test:webrtc:live:
desc: "WebRTC live_direct orchestrator E2E — owner + 1 reviewer negotiate a real DataChannel over the relay's signaling channel; asserts the badge flips to live_direct. Honors ATTN_SKIP_WEBRTC_E2E=1."
cmds:
- scripts/test-webrtc-live-e2e.sh
check:size:
desc: Build release and verify the binary stays under the 25 MiB collab v2 budget (see planning/collab/amendments.md §Decision #1).
cmds:
- ATTN_DEFAULT_RELAY_URL="${ATTN_DEFAULT_RELAY_URL:-https://relay.attn.sh}" cargo build --release
- scripts/check-binary-size.sh