interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / collab / tests / compose.sh

242 lines · 19418 bytes Raw Blame History
1#!/bin/bash
2# collab/tests/compose.sh: end-to-end HOST test of Phase A (docs/collab-write.md): the web composes and
3# checks and says publishing is closed (no command shown); the author runs commands this test writes,
4# and the result shows on the forge. Everything is private
5# to a temp dir: a throwaway Radicle profile (RAD_HOME) with a private repo, a test forged on PORT
6# (default 18493) whose store and allow-list point at that profile, throwaway ssh keys for sign-in.
7# Nothing touches ~/.radicle, the live forged or the network. Every gate has a negative control.
8# Usage: collab/tests/compose.sh (from anywhere; CORES default 14; KEEP=1 keeps the temp dir)
9# untr FILE: forged adds translation hints while it sends an HTML page (server/tr.om); the checks here
10# read pages without them (server/tests/translate.sh gates the hints). Other bodies are left as sent.
11untr() { case "$(head -c 15 "$1" 2>/dev/null)" in '<!doctype html'*) sed -i 's/<span translate="no">\([^<]*\)<\/span>/\1/g; s/ translate="no"//g' "$1" ;; esac; }
12set -u
13H=$(cd "$(dirname "$0")" && pwd)
14export PORT=${COMPOSE_PORT:-18493} CORES=${CORES:-14}
15T=$(mktemp -d /tmp/cpcompose.XXXXXX)
16W=$T/w
17PASS=0; FAIL=0
18ok() { PASS=$((PASS+1)); echo "PASS $*"; }
19bad() { FAIL=$((FAIL+1)); echo "FAIL $*"; }
20check() { if [ "$1" = "$2" ]; then ok "$3 ($1)"; else bad "$3: want $2, got $1"; fi; }
21has() { grep -qF -- "$1" "$T/body"; }
22
23# ---- throwaway Radicle profile and private repo (the "author's clone")
24export RAD_HOME=$T/rad RAD_PASSPHRASE=
25rad auth --alias cptest < /dev/null > /dev/null 2>&1 || { echo "rad auth failed"; exit 1; }
26git init -q -b main "$W" && cd "$W" && echo hello > a.txt && git add a.txt \
27 && git -c user.name=t -c user.email=t@t.invalid commit -qm init \
28 && rad init --private --name cpscratch --description "compose test" --default-branch main --no-confirm --no-seed > /dev/null 2>&1 \
29 || { echo "rad init failed"; exit 1; }
30git config user.name t; git config user.email t@t.invalid
31RID=$(rad . | sed 's/^rad://')
32echo "scratch repo rad:$RID in $RAD_HOME"
33printf '# test allow-list\n\n| repo | RID | default branch |\n|---|---|---|\n| cpscratch | rad:%s | main |\n' "$RID" > "$T/rids.md"
34
35# ---- test forged
36mkdir -p "$T/data" "$T/social"
37DATA=$T/data/ STORE=$RAD_HOME/storage/ RIDS=$T/rids.md "$H/tbuild.sh" "$T/forged" || exit 1
38FORGE_SOCIAL_DIR=$T/social/ taskset -c "$CORES" nice -n 10 "$T/forged" 2>> "$T/forged.err" &
39PID=$!
40trap 'kill $PID 2>/dev/null; wait $PID 2>/dev/null; [ -n "${KEEP:-}" ] || rm -rf "$T"' EXIT
41U="http://127.0.0.1:$PORT"
42for i in $(seq 50); do curl -s -o /dev/null "$U/" && break; sleep 0.1; done
43kill -0 $PID 2> /dev/null || { echo "test forged did not start: $(cat "$T/forged.err")"; exit 1; }
44R=/drakestapleton/cpscratch
45BASE=/
46IP=10.9.0.1
47
48# code METHOD PATH [curl args] -> status; body in $T/body, headers in $T/hdr
49code() { m=$1; p=$2; shift 2; c=$(curl -s -o "$T/body" -D "$T/hdr" -X "$m" -H "X-Forge-Base: $BASE" -H "X-Real-IP: $IP" "$@" "$U$p" -w '%{http_code}'); untr "$T/body"; printf %s "$c"; }
50hdr() { grep -i "^$1:" "$T/hdr" | head -1 | cut -d' ' -f2- | tr -d '\r'; }
51field() { grep -o "name=\"$1\" value=\"[^\"]*\"" "$T/body" | head -1 | sed 's/.*value="//; s/"$//'; }
52cmds() { python3 - "$T/body" <<'EOF'
53import sys, re, html
54for m in re.findall(r'<pre class="so-cmd">(.*?)</pre>', open(sys.argv[1]).read(), re.S):
55 print(html.unescape(m))
56EOF
57}
58run_() { [ -n "$1" ] && (cd "$W" && sh -c "$1"); }
59# The compose page shows no command: publishing is closed for now. The author's own commands below
60# are written by this test (not read from the page) so the fixture repo still gets its COBs.
61closed() { has 'Publishing it is closed for now: Interplane does not accept comments, reviews, issues or patches yet.' && [ -z "$(cmds)" ] && ok "$1: publishing closed, no command shown" || bad "$1: closed note missing or a command shown"; }
62dl() { curl -s -o "$2" -D "$T/hdr" -H "X-Forge-Base: $BASE" -H "$CK" "$U$1" -w '%{http_code}'; }
63cidof() { hdr location | sed -n 's|.*/compose/\([0-9a-f]\{32\}\)$|\1|p'; }
64
65# ---- sign-in with throwaway ssh keys (the forge accepts any did:key it can verify)
66ssh-keygen -q -t ed25519 -N '' -C t1 -f "$T/k1"; ssh-keygen -q -t ed25519 -N '' -C t2 -f "$T/k2"
67did() { python3 - "$1" <<'EOF'
68import sys, base64
69raw = b'\xed\x01' + base64.b64decode(open(sys.argv[1]).read().split()[1])[-32:]
70A = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
71n = int.from_bytes(raw, 'big'); s = ''
72while n: n, r = divmod(n, 58); s = A[r] + s
73print('did:key:z' + s)
74EOF
75}
76login() { # key -> SES, TOK
77 code GET /login > /dev/null
78 local pn=$(hdr set-cookie | sed -n 's/^\([A-Za-z_-]*forge_pre\)=.*/\1/p')
79 local pre=$(hdr set-cookie | sed -n 's/^[A-Za-z_-]*forge_pre=\([0-9a-f]*\);.*/\1/p')
80 local cs=$(field csrf) no=$(field nonce) ts=$(field ts)
81 printf '%s' "interplane-forge-login:$no:$ts" | ssh-keygen -Y sign -f "$1" -n interplane-forge > "$T/sig" 2> /dev/null
82 code POST /login -H "Cookie: $pn=$pre" --data-urlencode "csrf=$cs" --data-urlencode "nonce=$no" \
83 --data-urlencode "ts=$ts" --data-urlencode "did=$(did "$1.pub")" --data-urlencode "sig@$T/sig" > /dev/null
84 SES=$(grep -i "^set-cookie:" "$T/hdr" | cut -d" " -f2- | tr -d "\r" | sed -n 's/^\([A-Za-z_-]*forge_session=[0-9a-f]*\);.*/\1/p')
85 code GET /settings -H "Cookie: $SES" > /dev/null
86 TOK=$(field csrf)
87}
88login "$T/k2"; SES2=$SES; TOK2=$TOK
89login "$T/k1"
90[ ${#TOK} = 32 ] && [ ${#TOK2} = 32 ] && [ "$TOK" != "$TOK2" ] && ok "two sessions signed in" || { bad "sign-in failed ($SES / $TOK)"; exit 1; }
91CK="Cookie: $SES"
92
93# ---- forms
94c=$(code GET "$R/issues/new"); check "$c" 200 "GET issues/new signed out"
95has 'Sign in with your key' && ! has 'name="title"' && ok "NEG signed out: sign-in link, no form" || bad "signed-out new-issue page"
96c=$(code GET "$R/issues/new" -H "$CK"); check "$c" 200 "GET issues/new signed in"
97has "action=\"$R/issues/new\"" && has 'name="title"' && has "value=\"$TOK\"" && ok "new-issue form with this session's CSRF token" || bad "new-issue form"
98c=$(code GET "$R/patches/new" -H "$CK"); has 'name="draft"' && ok "new-patch form has the draft box" || bad "new-patch form ($c)"
99c=$(code GET "$R/issues" -H "$CK"); has "href=\"$R/issues/new\"" && ok "issue list links the new-issue form" || bad "issue list link"
100
101# ---- write gate (contract section 5): signed out, CSRF, then the checks
102printf 'Title one\n' > "$T/t"
103c=$(code POST "$R/issues/new" --data-urlencode "csrf=$TOK" --data-urlencode "title=x" --data-urlencode "body=y")
104check "$c" 303 "NEG signed-out POST redirects"; check "$(hdr location)" "/login" "NEG signed-out POST goes to login"
105c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK2" --data-urlencode "title=x"); check "$c" 403 "NEG other session's CSRF token"
106c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "title=x"); check "$c" 403 "NEG missing CSRF token"
107c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title="); check "$c" 400 "NEG empty title"
108has 'The title must be one line' && ok "empty title message" || bad "empty title message"
109c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=a
110b"); check "$c" 400 "NEG two-line title"
111c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=$(printf 'x%.0s' $(seq 257))"); check "$c" 400 "NEG 257-byte title"
112c=$(code POST "$R/issues/new" -H "$CK" --data "csrf=$TOK&title=ok&body=%FF%FE"); check "$c" 400 "NEG invalid UTF-8 body"
113has 'must be UTF-8' && ok "UTF-8 message" || bad "UTF-8 message"
114c=$(code POST "$R/issues/new" -H "$CK" --data "csrf=$TOK&title=ok&body=a%01b"); check "$c" 400 "NEG control byte in body"
115c=$(code POST "$R/issues/new" -H "$CK" --data "csrf=$TOK&title=ok&body=%ED%A0%80"); check "$c" 400 "NEG UTF-16 surrogate in body"
116head -c 60001 /dev/zero | tr '\0' a > "$T/big"
117c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=ok" --data-urlencode "body@$T/big"); check "$c" 400 "NEG 60001-byte body"
118has 'longer than 60000' && ok "length message" || bad "length message"
119head -c 60000 /dev/zero | tr '\0' a > "$T/big"
120c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=ok" --data-urlencode "body@$T/big"); check "$c" 303 "60000-byte body accepted"
121c=$(code POST "$R/issues/0000000000000000000000000000000000000000/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body=hi"); check "$c" 404 "NEG comment on an unknown issue"
122c=$(code POST "$R/issues/new/x" -H "$CK" --data-urlencode "csrf=$TOK"); check "$c" 405 "NEG POST on an unknown route"
123
124# ---- new issue, with an XSS body; the published issue must render it inert
125IP=10.9.0.2
126printf 'Hello <b>there</b>\r\n\r\n<script>alert(1)</script>\n[x](javascript:alert(1)) <img src=x onerror=alert(1)>\n\n**bold** text\n\n\n' > "$T/ib"
127TITLE='-Crash on "quotes" & $(id) `uname`'
128c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=$TITLE" --data-urlencode "body@$T/ib")
129check "$c" 303 "POST issues/new"
130CID=$(cidof); [ ${#CID} = 32 ] && ok "redirect to compose/<128-bit id>" || bad "location $(hdr location)"
131c=$(code GET "$R/compose/$CID" -H "$CK"); check "$c" 200 "compose page"
132has '<strong>bold</strong>' && ok "preview renders Markdown" || bad "preview markdown"
133! has '<script>alert' && ! has 'href="javascript:' && ! has '<img src=x' && ok "NEG preview renders the XSS inert" || bad "preview XSS"
134has 'Crash on &quot;quotes&quot; &amp; $(id)' && ok "title escaped in preview" || bad "title escape"
135closed "new issue"; CMD="rad issue open --repo rad:$RID --title=\"\$(head -n 1 issue.md)\" --description=\"\$(tail -n +3 issue.md)\""
136c=$(dl "$R/compose/$CID/issue.md" "$W/issue.md"); check "$c" 200 "download issue.md"
137check "$(hdr content-type)" "text/markdown; charset=utf-8" "issue.md content type"
138check "$(hdr content-disposition)" 'attachment; filename="issue.md"' "issue.md is an attachment"
139printf '%s\n\nHello <b>there</b>\n\n<script>alert(1)</script>\n[x](javascript:alert(1)) <img src=x onerror=alert(1)>\n\n**bold** text\n' "$TITLE" > "$T/want"
140cmp -s "$W/issue.md" "$T/want" && ok "issue.md = title, blank line, body (CRLF folded, trailing blank lines trimmed)" || bad "issue.md content: $(od -c "$W/issue.md" | head -5)"
141# NEGATIVE: the compose belongs to this session, this repo, this id
142c=$(code GET "$R/compose/$CID"); check "$c" 404 "NEG signed-out compose page"
143c=$(code GET "$R/compose/$CID" -H "Cookie: $SES2"); check "$c" 404 "NEG other session's compose page"
144c=$(code GET "$R/compose/$CID/issue.md" -H "Cookie: $SES2"); check "$c" 404 "NEG other session's download"
145c=$(code GET "$R/compose/${CID%?}0" -H "$CK"); [ "${CID: -1}" = 0 ] && c=404; check "$c" 404 "NEG altered compose id"
146c=$(code GET "$R/compose/$CID/patch.md" -H "$CK"); check "$c" 404 "NEG wrong file name"
147# run it as the author
148run_ "$CMD" > "$T/out" 2>&1 && ok "author ran: rad issue open" || bad "rad issue open: $(cat "$T/out")"
149c=$(code GET "$R/issues"); has 'Crash on &quot;quotes&quot;' && ok "new issue listed on the forge" || bad "issue not listed ($c)"
150ISS=$(grep -o "$R/issues/[0-9a-f]\{7,40\}" "$T/body" | head -1 | sed 's|.*/||')
151ET=$(printf '%s' "$TITLE" | sed 's/&/\&amp;/g; s/"/\&quot;/g')
152has "$ET" && ok "title reached rad unchanged (leading -, quotes, \$(...), backticks)" || bad "title changed: $(grep -o '[^>]*Crash[^<]*' "$T/body" | head -1)"
153c=$(code GET "$R/issues/$ISS"); check "$c" 200 "issue page"
154has '<strong>bold</strong>' && ok "issue body rendered as Markdown" || bad "issue body markdown"
155! has '<script>alert' && ! has 'href="javascript:' && ! has '<img src=x' && ok "NEG published issue renders the XSS inert" || bad "published issue XSS"
156has 'id="compose"' && has 'Sign in with your key' && ok "issue page: sign-in prompt when signed out" || bad "issue page prompt"
157
158# ---- comment on the issue
159c=$(code GET "$R/issues/$ISS" -H "$CK"); ISSF=$(grep -o "issues/[0-9a-f]\{40\}/compose" "$T/body" | head -1 | cut -d/ -f2)
160[ ${#ISSF} = 40 ] && has "value=\"$TOK\"" && ok "issue page has the comment form" || bad "issue comment form"
161c=$(code POST "$R/issues/$ISSF/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body= "); check "$c" 400 "NEG blank comment"
162c=$(code POST "$R/issues/${ISSF:0:8}/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body=First *comment* from the forge"); check "$c" 303 "POST issue comment (short id)"
163CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null; closed "issue comment"
164CMD="rad issue comment $ISSF --repo rad:$RID --message=\"\$(cat comment.md)\""
165dl "$R/compose/$CID/comment.md" "$W/comment.md" > /dev/null
166check "$(cat "$W/comment.md")" "First *comment* from the forge" "comment.md content"
167run_ "$CMD" > "$T/out" 2>&1 && ok "author ran: rad issue comment" || bad "rad issue comment: $(cat "$T/out")"
168c=$(code GET "$R/issues/$ISS"); has 'First <em>comment</em> from the forge' && ok "comment shows on the forge" || bad "comment missing"
169
170# ---- new patch: git push, then rad patch edit for the multi-line description
171IP=10.9.0.3
172git -C "$W" checkout -qb feat && echo more > "$W/b.txt" && git -C "$W" add b.txt && git -C "$W" commit -qm "add b"
173printf 'Line one of the description.\n\nLine three, `code`.\n' > "$T/pb"
174c=$(code POST "$R/patches/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=Add b.txt" --data-urlencode "body@$T/pb"); check "$c" 303 "POST patches/new"
175CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null; closed "new patch"
176printf '%s\n' 'git push -o patch.message="$(head -n 1 patch.md)" rad HEAD:refs/patches' "rad patch edit PATCH_ID --repo rad:$RID --message=\"\$(head -n 1 patch.md)\" --message=\"\$(tail -n +3 patch.md)\"" > "$T/cmds"
177dl "$R/compose/$CID/patch.md" "$W/patch.md" > /dev/null
178run_ "$(sed -n 1p "$T/cmds")" > "$T/out" 2>&1 && ok "author ran: git push" || bad "git push: $(cat "$T/out")"
179PAT=$(grep -o '[0-9a-f]\{40\}' "$T/out" | head -1)
180E=$(sed -n 2p "$T/cmds"); E=${E/PATCH_ID/$PAT}
181run_ "$E" > "$T/out" 2>&1 && ok "author ran: rad patch edit" || bad "rad patch edit: $(cat "$T/out")"
182c=$(code GET "$R/patches/$PAT"); check "$c" 200 "patch page"
183has 'Add b.txt' && has 'Line three, <code>code</code>.' && ok "patch title and Markdown description on the forge" || bad "patch description"
184# single-line description and draft go into the push options
185c=$(code POST "$R/patches/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=T2" --data-urlencode "body=one line" --data-urlencode "draft=1")
186CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null
187closed "draft patch"
188has 'New patch (draft)' && ok "draft named on the compose page" || bad "draft heading"
189
190# ---- patch comment and reviews
191c=$(code GET "$R/patches/$PAT" -H "$CK"); REV=$(field rev)
192[ ${#REV} = 40 ] && has 'name="verdict" value="accept"' && ok "patch page has the review form (revision $REV)" || bad "patch form"
193c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body=Looks *fine*"); check "$c" 303 "POST patch comment"
194CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null; closed "patch comment"
195CMD="rad patch comment $REV --repo rad:$RID --message=\"\$(cat comment.md)\""
196dl "$R/compose/$CID/comment.md" "$W/comment.md" > /dev/null
197run_ "$CMD" > "$T/out" 2>&1 && ok "author ran: rad patch comment" || bad "rad patch comment: $(cat "$T/out")"
198c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "rev=$REV" --data-urlencode "verdict=accept" --data-urlencode "body=Ship **it**")
199check "$c" 303 "POST review accept"
200CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null; closed "review accept"
201CMD="rad patch review $PAT --repo rad:$RID --revision $REV --accept --message=\"\$(cat review.md)\""
202dl "$R/compose/$CID/review.md" "$W/review.md" > /dev/null
203run_ "$CMD" > "$T/out" 2>&1 && ok "author ran: rad patch review --accept" || bad "rad patch review: $(cat "$T/out")"
204c=$(code GET "$R/patches/$PAT"); has 'Looks <em>fine</em>' && ok "patch comment shows on the forge" || bad "patch comment missing"
205has 'Ship <strong>it</strong>' && ok "review body shows on the forge" || bad "review body missing"
206c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "verdict=reject")
207check "$c" 303 "POST review reject without text"
208CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null
209closed "review reject without text"
210! has 'download>' && ok "no download step without text" || bad "download step shown"
211c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "verdict=review" --data-urlencode "body=Needs a test")
212CID=$(cidof); code GET "$R/compose/$CID" -H "$CK" > /dev/null; closed "review without verdict"
213CMD="rad patch review $PAT --repo rad:$RID --revision $REV --message=\"\$(cat review.md)\""
214dl "$R/compose/$CID/review.md" "$W/review.md" > /dev/null
215run_ "$CMD" > "$T/out" 2>&1 && ok "author ran: rad patch review (no verdict)" || bad "rad patch review (no verdict): $(cat "$T/out")"
216c=$(code GET "$R/patches/$PAT"); has 'Needs a test' && ok "review without verdict shown on the forge" || bad "no-verdict review missing ($c)"
217c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "verdict=merge" --data-urlencode "body=x"); check "$c" 400 "NEG unknown verdict"
218c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "rev=deadbeef" --data-urlencode "body=x"); check "$c" 400 "NEG revision not of this patch"
219c=$(code POST "$R/patches/$PAT/compose" -H "$CK" --data-urlencode "csrf=$TOK"); check "$c" 400 "NEG comment without text"
220c=$(code POST "$R/patches/$ISSF/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body=x"); check "$c" 404 "NEG issue id used as a patch"
221
222# ---- base path: /forge/ links and redirects
223BASE=/forge/
224c=$(code POST "$R/issues/$ISSF/compose" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "body=via aienos"); check "$c" 303 "POST under /forge/"
225case "$(hdr location)" in "/forge$R/compose/"*) ok "redirect keeps /forge/";; *) bad "location $(hdr location)";; esac
226c=$(code GET "$R/compose/$(cidof)" -H "$CK"); has "href=\"/forge$R/compose/" && has "href=\"/forge$R/issues/$ISSF\"" && ok "compose page links under /forge/" || bad "/forge/ links"
227BASE=/
228
229# ---- per-IP write limit (30 writes a minute), checked before the text
230IP=10.9.0.4; n=0
231for i in $(seq 30); do c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title="); [ "$c" = 400 ] && n=$((n+1)); done
232check "$n" 30 "30 writes from one address pass the limit"
233c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title="); check "$c" 429 "NEG 31st write in a minute"
234IP=10.9.0.5
235c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title="); check "$c" 400 "another address is not limited"
236
237# ---- the forge wrote nothing itself: every COB above came from the author's commands
238c=$(code POST "$R/issues/new" -H "$CK" --data-urlencode "csrf=$TOK" --data-urlencode "title=never published")
239code GET "$R/issues" > /dev/null; ! has 'never published' && ok "NEG composed but not run: not on the forge" || bad "forge published by itself"
240
241echo "collab compose: $PASS passed, $FAIL failed"
242[ "$FAIL" = 0 ]