feat(arm64): linux-arm64-musl target, plugin.json sidecar, v1.1.1
- Makefile: arm64 target probing aarch64-linux-musl-gcc then aarch64-linux-gnu-gcc (static aarch64 ELF for Pi 5 / ARM64 servers) - release-dist.sh: arm64 build leg, manifest/SHA256SUMS/stage entries, --standalone escape hatch, version 1.1.1 (was 1.1.0 with five targets) - tests/run.sh: arm64 ELF + EM_AARCH64 assertion, plugin.json contract check, and the credential-scan false positive from BOT_PASSWORD=testpw (grep -o printed only the fragment, so the post-filter never saw it) - plugin.json sidecar so the marketplace manifest carries the real title, summary, category, license and capabilities instead of hard-coded text
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 00:02:40
Commit7f394d17
Parentsb81ae322
Changed files
.gitignore+6−0■■■■■
Makefile+15−3■■■■■
README.md+4−3■■■■■
plugin.json+10−0■■■■■
release-dist.sh+31−10■■■■■
src/plugin_hello.c+1−1■■
tests/run.sh+60−4■■■■■
7 files+127−21
Diff
.gitignore+6−0■■■■■
index e892f4c..15b2b26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,13 @@
11 /plugin_hello
22 /plugin_hello.exe
3+/plugin_hello.arm64
4+/plugin_hello.musl
5+/plugin_hello.macos-arm64
6+/plugin_hello.macos-x86_64
37 *.o
48 *.obj
59 bin/
610 *.tmp
711 *.log
12+__pycache__/
13+*.pyc
Makefile+15−3■■■■■
index 1a12d90..e79a27b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
33 # Targets:
44 # make native build -> ./plugin_hello
55 # make musl static musl x86_64 -> ./plugin_hello (fully static)
6+# make arm64 static aarch64 -> ./plugin_hello.arm64 (Pi 5 / ARM64 servers)
67 # make win64 MinGW-w64 static -> ./plugin_hello.exe
78 # make macos Apple clang -> ./plugin_hello (run on macOS)
89 # make test build + run tests/run.sh
@@ -12,13 +13,17 @@ CC ?= cc
1213 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
1314 MUSL_CC ?= musl-gcc
1415 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
16+ARM64_CC ?= $(shell command -v aarch64-linux-musl-gcc 2>/dev/null || \
17+ command -v aarch64-linux-gnu-gcc 2>/dev/null || \
18+ echo aarch64-linux-musl-gcc)
19+ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
1520 WIN_CC ?= x86_64-w64-mingw32-gcc
1621 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
1722 SRC := src/plugin_hello.c
1823 BIN := plugin_hello
1924 EXE := plugin_hello.exe
2025
21-.PHONY: all native musl win64 macos test clean distclean help
26+.PHONY: all native musl arm64 win64 macos test clean distclean help
2227
2328 all: native
2429
@@ -33,6 +38,13 @@ musl: $(SRC)
3338 @echo "==> static musl build ($(MUSL_CC))"
3439 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)
3540
41+# Static aarch64 build — Raspberry Pi 5 / ARM64 servers. Prefers the musl cross
42+# toolchain; the Debian aarch64-linux-gnu-gcc static link also yields a
43+# self-contained aarch64 ELF.
44+arm64: $(SRC)
45+ @echo "==> static arm64 build ($(ARM64_CC))"
46+ $(ARM64_CC) $(ARM64_CFLAGS) -o $(BIN).arm64 $(SRC)
47+
3648 # Native Win64 static PE — runs on any Windows 10/11 x64 node
3749 win64: $(SRC)
3850 @echo "==> MinGW-w64 build ($(WIN_CC))"
@@ -47,10 +59,10 @@ test: native
4759 @sh tests/run.sh
4860
4961 clean:
50- rm -f $(BIN) $(EXE) plugin_hello_arm64
62+ rm -f $(BIN) $(EXE) $(BIN).arm64 $(BIN).musl $(BIN).macos-arm64 $(BIN).macos-x86_64
5163 rm -rf bin
5264
5365 distclean: clean
5466
5567 help:
56- @echo "make | make musl | make win64 | make macos | make test | make clean"
68+ @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"
README.md+4−3■■■■■
index cee6ea5..567a5b7 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ Content-Type: application/json; charset=utf-8
5656 Cache-Control: no-store
5757 X-Content-Type-Options: nosniff
5858
59-{"ok":true,"plugin":"plugin_hello","slug":"hello","version":"1.1.0",
59+{"ok":true,"plugin":"plugin_hello","slug":"hello","version":"1.1.1",
6060 "node":{"hostname":"agentcore-latest","os":"linux","arch":"x86_64",
6161 "libc":"glibc","pid":591,"utc":"2026-11-11T01:10:39Z"},
6262 "query_string":"action=info",
@@ -100,7 +100,8 @@ discovery endpoint, not a dispatch route. The page also forwards `node`, `id`, a
100100 ```sh
101101 make # native (cc / gcc / clang) -> ./plugin_hello
102102 make musl # static musl x86_64 (universal) -> ./plugin_hello
103-make win64 # MinGW-w64 static PE x86_64 -> ./plugin_hello.exe
103+make arm64 # static aarch64 (ARM64 servers) -> ./plugin_hello.arm64
104+make win64 # MinGW-w64 static PE x86_64 -> ./plugin_hello.exe
104105 make macos # Apple clang (run on macOS) -> ./plugin_hello
105106 make test # build + full test suite
106107 make clean
@@ -148,7 +149,7 @@ curl -s -H "X-Bot-Password: <pwd>" http://127.0.0.1:8150/plugins | grep hello
148149 ## Pre-built binaries
149150
150151 If you would rather not compile, every release is published with checksums at
151-**https://dist.scorpiox.net/bot-plugins/hello/1.1.0/**
152+**https://dist.scorpiox.net/bot-plugins/hello/1.1.1/**
152153
153154 | Target | File |
154155 |---|---|
plugin.json+10−0■■■■■
11new file mode 100644
index 0000000..b64bc2b
--- /dev/null
+++ b/plugin.json
@@ -0,0 +1,10 @@
1+{
2+ "slug": "hello",
3+ "id": "plugin_hello",
4+ "title": "ScorpioX Bot Starter Plugin",
5+ "summary": "Clean-room C99 reference plugin demonstrating the single-binary three-mode contract: metadata, JSON node API and a responsive dark/light HTML bench.",
6+ "category": "utilities",
7+ "license": "MIT",
8+ "capabilities": ["env_read", "process_info"],
9+ "trust_notice": "Executes native C code on your node. Reads only its own process and environment; makes zero outbound network requests."
10+}
release-dist.sh+31−10■■■■■
index 9a805b0..8ee873d 100755
--- a/release-dist.sh
+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail
2828
2929 SLUG="hello"
3030 ID="plugin_hello"
31-VERSION="1.1.0"
31+VERSION="1.1.1"
3232 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
3333
3434 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -37,12 +37,14 @@ cd "$ROOT"
3737 DRY_RUN=0
3838 DO_MACOS=1
3939 DO_MIRROR=1
40+STANDALONE=0
4041 for arg in "$@"; do
4142 case "$arg" in
42- --dry-run) DRY_RUN=1 ;;
43- --no-macos) DO_MACOS=0 ;;
44- --no-mirror) DO_MIRROR=0 ;;
45- -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
43+ --dry-run) DRY_RUN=1 ;;
44+ --no-macos) DO_MACOS=0 ;;
45+ --no-mirror) DO_MIRROR=0 ;;
46+ --standalone) STANDALONE=1 ;;
47+ -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
4648 *) echo "unknown argument: $arg" >&2; exit 2 ;;
4749 esac
4850 done
@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }
6365 # ---------------------------------------------------------------- 0. preflight
6466 say "0/7 preflight"
6567
66-if command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
68+if [ "$STANDALONE" -eq 0 ] && command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
6769 say "using scorpiox-cli-botplugin publish"
68- exec scorpiox-cli-botplugin publish "$ROOT"
70+ exec scorpiox-cli-botplugin publish "$ROOT" --version "$VERSION"
6971 fi
70-echo " scorpiox-cli-botplugin not installed — running standalone pipeline"
72+echo " running the standalone pipeline (dist + plugingit mirror)"
7173
7274 [ -n "$(git status --porcelain 2>/dev/null)" ] && \
7375 echo " note: working tree is dirty; source.tar.gz comes from the last commit"
@@ -138,6 +140,22 @@ else
138140 echo " skip linux-x86_64-musl (no musl-gcc)"
139141 fi
140142
143+# linux-arm64-musl (static aarch64 - Raspberry Pi 5 / ARM64 servers).
144+# Prefer musl; on a host that only has the Debian cross toolchain the static
145+# glibc link still yields a self-contained aarch64 ELF.
146+if command -v aarch64-linux-musl-gcc >/dev/null 2>&1; then
147+ aarch64-linux-musl-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
148+ || die "arm64 musl build failed"
149+ echo " built linux-arm64-musl $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
150+elif command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
151+ aarch64-linux-gnu-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
152+ || die "arm64 static build failed"
153+ echo " built linux-arm64-static $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
154+else
155+ echo " skip linux-arm64-musl (no aarch64 cross compiler)"
156+fi
157+
158+# windows-x86_64 (static PE)
141159 # windows-x86_64 (static PE)
142160 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
143161 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \
@@ -228,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>
228246 emit() { if [ -f "$2" ]; then [ $first -eq 1 ] || printf ',\n'; first=0; target_meta "$@"; fi; }
229247 emit "linux-x86_64" "$STAGE/$ID" "elf-x86_64" "linux-x86_64/$ID" "$ID"
230248 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"
249+ emit "linux-arm64-musl" "$STAGE/$ID.arm64" "elf-arm64-static" "linux-arm64-musl/$ID" "$ID"
231250 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"
232251 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"
233252 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"
@@ -243,6 +262,7 @@ echo " manifest.json ok"
243262 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done
244263 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"
245264 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"
265+ [ -f "$ID.arm64" ] && sha256sum "$ID.arm64" | sed "s| $ID.arm64\$| linux-arm64-musl/$ID|"
246266 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"
247267 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"
248268 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"
@@ -252,10 +272,11 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"
252272 # ---------------------------------------------------------------- 4. stage
253273 say "4/7 stage tree"
254274 PKG="$STAGE/pkg"
255-mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/macos-arm64" \
256- "$PKG/macos-x86_64" "$PKG/windows-x86_64"
275+mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/linux-arm64-musl" \
276+ "$PKG/macos-arm64" "$PKG/macos-x86_64" "$PKG/windows-x86_64"
257277 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"
258278 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"
279+[ -f "$STAGE/$ID.arm64" ] && cp -f "$STAGE/$ID.arm64" "$PKG/linux-arm64-musl/$ID"
259280 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"
260281 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"
261282 [ -f "$STAGE/$ID.exe" ] && cp -f "$STAGE/$ID.exe" "$PKG/windows-x86_64/$ID.exe"
src/plugin_hello.c+1−1■■
index e369a72..ad955ff 100644
--- a/src/plugin_hello.c
+++ b/src/plugin_hello.c
@@ -34,7 +34,7 @@
3434
3535 #define PLUGIN_SLUG "hello"
3636 #define PLUGIN_ID "plugin_hello"
37-#define PLUGIN_VER "1.1.0"
37+#define PLUGIN_VER "1.1.1"
3838
3939 /* ------------------------------------------------------------------ */
4040 /* Query string helpers */
tests/run.sh+60−4■■■■■
index 5214139..8039ffa 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -62,7 +62,7 @@ DESC=$("$BIN" --meta | sed 's/.*"desc":"\([^"]*\)".*/\1/')
6262 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
6363 NAME=$("$BIN" --meta | sed 's/.*"name":"\([^"]*\)".*/\1/')
6464 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
65-check "--version prints version" '1.1.0' "$("$BIN" --version)"
65+check "--version prints version" '1.1.1' "$("$BIN" --version)"
6666
6767 # ---------------------------------------------------------------- json mode
6868 section "node auth"
@@ -93,7 +93,7 @@ BODY=$(printf '%s' "$INFO" | sed '1,/^\r$/d')
9393 check "info ok:true" '"ok":true' "$BODY"
9494 check "info plugin id" '"plugin":"plugin_hello"' "$BODY"
9595 check "info slug" '"slug":"hello"' "$BODY"
96-check "info version" '"version":"1.1.0"' "$BODY"
96+check "info version" '"version":"1.1.1"' "$BODY"
9797 check "info hostname field" '"hostname"' "$BODY"
9898 check "info os field" '"os"' "$BODY"
9999 check "info arch field" '"arch"' "$BODY"
@@ -181,6 +181,47 @@ if command -v musl-gcc >/dev/null 2>&1; then
181181 else
182182 echo " skip: musl-gcc not installed"
183183 fi
184+# arm64 (linux-arm64-musl) — static aarch64 ELF for Raspberry Pi 5 / ARM64 servers.
185+ARM64_CC_TEST=$(command -v aarch64-linux-musl-gcc 2>/dev/null || command -v aarch64-linux-gnu-gcc 2>/dev/null || true)
186+if [ -f plugin_hello.arm64 ]; then
187+ case $(head -c 4 plugin_hello.arm64 | od -An -tx1 | tr -d ' \n') in
188+ 7f454c46) pass "arm64 artifact is ELF" ;;
189+ *) fail "arm64 artifact is not ELF" ;;
190+ esac
191+ # e_machine sits at offset 18, little endian: b7 00 == EM_AARCH64
192+ EM=$(od -An -tx1 -j 18 -N 2 plugin_hello.arm64 | tr -d ' \n')
193+ [ "$EM" = "b700" ] && pass "arm64 artifact declares EM_AARCH64" \
194+ || fail "arm64 artifact e_machine is $EM, expected b700"
195+elif [ -n "$ARM64_CC_TEST" ]; then
196+ if "$ARM64_CC_TEST" -O2 -std=c99 -static -o /tmp/plugin_hello_arm64_test src/plugin_hello.c 2>/dev/null; then
197+ pass "aarch64 cross build succeeds"
198+ case $(head -c 4 /tmp/plugin_hello_arm64_test | od -An -tx1 | tr -d ' \n') in
199+ 7f454c46) pass "cross-built arm64 artifact is ELF" ;;
200+ *) fail "cross-built arm64 artifact is not ELF" ;;
201+ esac
202+ EM=$(od -An -tx1 -j 18 -N 2 /tmp/plugin_hello_arm64_test | tr -d ' \n')
203+ [ "$EM" = "b700" ] && pass "cross-built arm64 artifact declares EM_AARCH64" \
204+ || fail "cross-built arm64 e_machine is $EM, expected b700"
205+ rm -f /tmp/plugin_hello_arm64_test
206+ else
207+ fail "aarch64 cross build failed"
208+ fi
209+else
210+ echo " skip: no aarch64 cross compiler (run 'make arm64')"
211+fi
212+
213+for slice in arm64 x86_64; do
214+ f="plugin_hello.macos-$slice"
215+ if [ -f "$f" ]; then
216+ MF=$(head -c 4 "$f" | od -An -tx1 | tr -d ' \n')
217+ case "$MF" in
218+ cffaedfe|feedfacf|cefaedfe|feedface) pass "macos-$slice artifact is Mach-O" ;;
219+ *) fail "macos-$slice artifact is not Mach-O ($MF)" ;;
220+ esac
221+ else
222+ echo " skip: macos-$slice not built"
223+ fi
224+done
184225
185226 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
186227 if x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static \
@@ -250,8 +291,12 @@ if [ -d .git ]; then
250291 HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true)
251292 [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history"
252293
253- HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \
254- | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' \
294+ # Pre-filter auth-test lines BEFORE the -o extraction: grep -o prints only the
295+ # matched fragment, so a post-filter for BOT_PASSWORD can never see it and
296+ # "PASSWORD=testpw" from `BOT_PASSWORD=testpw` read as a real credential.
297+ HITS=$(printf '%s' "$ALL" \
298+ | grep -v 'BOT_PASSWORD\|X-Bot-Password\|Bearer ' \
299+ | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \
255300 | grep -v '[$][{(A-Za-z_]' \
256301 | sort -u | head -5 || true)
257302 [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; }
@@ -298,6 +343,17 @@ section "repository files"
298343 for f in README.md Makefile build.ps1 release-dist.sh tests/run.sh LICENSE .gitignore src/plugin_hello.c; do
299344 [ -f "$f" ] && pass "file present: $f" || fail "file missing: $f"
300345 done
346+[ -f plugin.json ] && pass "file present: plugin.json" || fail "file missing: plugin.json"
347+if [ -f plugin.json ]; then
348+ python3 - <<'PY' >/dev/null 2>&1 && pass "plugin.json is valid JSON with the contract keys" || fail "plugin.json invalid or missing contract keys"
349+import json
350+d = json.load(open("plugin.json"))
351+for k in ("slug", "id", "title", "summary", "category", "license", "capabilities", "trust_notice"):
352+ assert k in d, k
353+assert d["slug"] == "hello" and d["id"] == "plugin_hello", d
354+assert isinstance(d["capabilities"], list) and d["capabilities"], d
355+PY
356+fi
301357 [ -f README.md ] && grep -q 'plugingit.scorpiox.net' README.md && pass "README documents plugingit clone URL" || fail "README missing clone URL"
302358 [ -f README.md ] && grep -qi 'mit' README.md && pass "README mentions MIT license" || true
303359
304360
.gitignore+6−0■■■■■
index e892f4c..15b2b26 100644index e892f4c..15b2b26 100644
--- a/.gitignore--- a/.gitignore
+++ b/.gitignore+++ b/.gitignore
@@ -1,7 +1,13 @@@@ -1,7 +1,13 @@
1 /plugin_hello1 /plugin_hello
2 /plugin_hello.exe2 /plugin_hello.exe
3+/plugin_hello.arm64
4+/plugin_hello.musl
5+/plugin_hello.macos-arm64
6+/plugin_hello.macos-x86_64
3 *.o7 *.o
4 *.obj8 *.obj
5 bin/9 bin/
6 *.tmp10 *.tmp
7 *.log11 *.log
12+__pycache__/
13+*.pyc
Makefile+15−3■■■■■
index 1a12d90..e79a27b 100644index 1a12d90..e79a27b 100644
--- a/Makefile--- a/Makefile
+++ b/Makefile+++ b/Makefile
@@ -3,6 +3,7 @@@@ -3,6 +3,7 @@
3 # Targets:3 # Targets:
4 # make native build -> ./plugin_hello4 # make native build -> ./plugin_hello
5 # make musl static musl x86_64 -> ./plugin_hello (fully static)5 # make musl static musl x86_64 -> ./plugin_hello (fully static)
6+# make arm64 static aarch64 -> ./plugin_hello.arm64 (Pi 5 / ARM64 servers)
6 # make win64 MinGW-w64 static -> ./plugin_hello.exe7 # make win64 MinGW-w64 static -> ./plugin_hello.exe
7 # make macos Apple clang -> ./plugin_hello (run on macOS)8 # make macos Apple clang -> ./plugin_hello (run on macOS)
8 # make test build + run tests/run.sh9 # make test build + run tests/run.sh
@@ -12,13 +13,17 @@ CC ?= cc@@ -12,13 +13,17 @@ CC ?= cc
12 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings13 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
13 MUSL_CC ?= musl-gcc14 MUSL_CC ?= musl-gcc
14 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static15 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
16+ARM64_CC ?= $(shell command -v aarch64-linux-musl-gcc 2>/dev/null || \
17+ command -v aarch64-linux-gnu-gcc 2>/dev/null || \
18+ echo aarch64-linux-musl-gcc)
19+ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
15 WIN_CC ?= x86_64-w64-mingw32-gcc20 WIN_CC ?= x86_64-w64-mingw32-gcc
16 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static21 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
17 SRC := src/plugin_hello.c22 SRC := src/plugin_hello.c
18 BIN := plugin_hello23 BIN := plugin_hello
19 EXE := plugin_hello.exe24 EXE := plugin_hello.exe
20 25
21-.PHONY: all native musl win64 macos test clean distclean help26+.PHONY: all native musl arm64 win64 macos test clean distclean help
22 27
23 all: native28 all: native
24 29
@@ -33,6 +38,13 @@ musl: $(SRC)@@ -33,6 +38,13 @@ musl: $(SRC)
33 @echo "==> static musl build ($(MUSL_CC))"38 @echo "==> static musl build ($(MUSL_CC))"
34 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)39 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)
35 40
41+# Static aarch64 build — Raspberry Pi 5 / ARM64 servers. Prefers the musl cross
42+# toolchain; the Debian aarch64-linux-gnu-gcc static link also yields a
43+# self-contained aarch64 ELF.
44+arm64: $(SRC)
45+ @echo "==> static arm64 build ($(ARM64_CC))"
46+ $(ARM64_CC) $(ARM64_CFLAGS) -o $(BIN).arm64 $(SRC)
47+
36 # Native Win64 static PE — runs on any Windows 10/11 x64 node48 # Native Win64 static PE — runs on any Windows 10/11 x64 node
37 win64: $(SRC)49 win64: $(SRC)
38 @echo "==> MinGW-w64 build ($(WIN_CC))"50 @echo "==> MinGW-w64 build ($(WIN_CC))"
@@ -47,10 +59,10 @@ test: native@@ -47,10 +59,10 @@ test: native
47 @sh tests/run.sh59 @sh tests/run.sh
48 60
49 clean:61 clean:
50- rm -f $(BIN) $(EXE) plugin_hello_arm6462+ rm -f $(BIN) $(EXE) $(BIN).arm64 $(BIN).musl $(BIN).macos-arm64 $(BIN).macos-x86_64
51 rm -rf bin63 rm -rf bin
52 64
53 distclean: clean65 distclean: clean
54 66
55 help:67 help:
56- @echo "make | make musl | make win64 | make macos | make test | make clean"68+ @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"
README.md+4−3■■■■■
index cee6ea5..567a5b7 100644index cee6ea5..567a5b7 100644
--- a/README.md--- a/README.md
+++ b/README.md+++ b/README.md
@@ -56,7 +56,7 @@ Content-Type: application/json; charset=utf-8@@ -56,7 +56,7 @@ Content-Type: application/json; charset=utf-8
56 Cache-Control: no-store56 Cache-Control: no-store
57 X-Content-Type-Options: nosniff57 X-Content-Type-Options: nosniff
58 58
59-{"ok":true,"plugin":"plugin_hello","slug":"hello","version":"1.1.0",59+{"ok":true,"plugin":"plugin_hello","slug":"hello","version":"1.1.1",
60 "node":{"hostname":"agentcore-latest","os":"linux","arch":"x86_64",60 "node":{"hostname":"agentcore-latest","os":"linux","arch":"x86_64",
61 "libc":"glibc","pid":591,"utc":"2026-11-11T01:10:39Z"},61 "libc":"glibc","pid":591,"utc":"2026-11-11T01:10:39Z"},
62 "query_string":"action=info",62 "query_string":"action=info",
@@ -100,7 +100,8 @@ discovery endpoint, not a dispatch route. The page also forwards `node`, `id`, a@@ -100,7 +100,8 @@ discovery endpoint, not a dispatch route. The page also forwards `node`, `id`, a
100 ```sh100 ```sh
101 make # native (cc / gcc / clang) -> ./plugin_hello101 make # native (cc / gcc / clang) -> ./plugin_hello
102 make musl # static musl x86_64 (universal) -> ./plugin_hello102 make musl # static musl x86_64 (universal) -> ./plugin_hello
103-make win64 # MinGW-w64 static PE x86_64 -> ./plugin_hello.exe103+make arm64 # static aarch64 (ARM64 servers) -> ./plugin_hello.arm64
104+make win64 # MinGW-w64 static PE x86_64 -> ./plugin_hello.exe
104 make macos # Apple clang (run on macOS) -> ./plugin_hello105 make macos # Apple clang (run on macOS) -> ./plugin_hello
105 make test # build + full test suite106 make test # build + full test suite
106 make clean107 make clean
@@ -148,7 +149,7 @@ curl -s -H "X-Bot-Password: <pwd>" http://127.0.0.1:8150/plugins | grep hello@@ -148,7 +149,7 @@ curl -s -H "X-Bot-Password: <pwd>" http://127.0.0.1:8150/plugins | grep hello
148 ## Pre-built binaries149 ## Pre-built binaries
149 150
150 If you would rather not compile, every release is published with checksums at151 If you would rather not compile, every release is published with checksums at
151-**https://dist.scorpiox.net/bot-plugins/hello/1.1.0/**152+**https://dist.scorpiox.net/bot-plugins/hello/1.1.1/**
152 153
153 | Target | File |154 | Target | File |
154 |---|---|155 |---|---|
plugin.json+10−0■■■■■
1new file mode 1006441new file mode 100644
index 0000000..b64bc2bindex 0000000..b64bc2b
--- /dev/null--- /dev/null
+++ b/plugin.json+++ b/plugin.json
@@ -0,0 +1,10 @@@@ -0,0 +1,10 @@
1+{
2+ "slug": "hello",
3+ "id": "plugin_hello",
4+ "title": "ScorpioX Bot Starter Plugin",
5+ "summary": "Clean-room C99 reference plugin demonstrating the single-binary three-mode contract: metadata, JSON node API and a responsive dark/light HTML bench.",
6+ "category": "utilities",
7+ "license": "MIT",
8+ "capabilities": ["env_read", "process_info"],
9+ "trust_notice": "Executes native C code on your node. Reads only its own process and environment; makes zero outbound network requests."
10+}
release-dist.sh+31−10■■■■■
index 9a805b0..8ee873d 100755index 9a805b0..8ee873d 100755
--- a/release-dist.sh--- a/release-dist.sh
+++ b/release-dist.sh+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail@@ -28,7 +28,7 @@ set -euo pipefail
28 28
29 SLUG="hello"29 SLUG="hello"
30 ID="plugin_hello"30 ID="plugin_hello"
31-VERSION="1.1.0"31+VERSION="1.1.1"
32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
33 33
34 ROOT="$(cd "$(dirname "$0")" && pwd)"34 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -37,12 +37,14 @@ cd "$ROOT"@@ -37,12 +37,14 @@ cd "$ROOT"
37 DRY_RUN=037 DRY_RUN=0
38 DO_MACOS=138 DO_MACOS=1
39 DO_MIRROR=139 DO_MIRROR=1
40+STANDALONE=0
40 for arg in "$@"; do41 for arg in "$@"; do
41 case "$arg" in42 case "$arg" in
42- --dry-run) DRY_RUN=1 ;;43+ --dry-run) DRY_RUN=1 ;;
43- --no-macos) DO_MACOS=0 ;;44+ --no-macos) DO_MACOS=0 ;;
44- --no-mirror) DO_MIRROR=0 ;;45+ --no-mirror) DO_MIRROR=0 ;;
45- -h|--help) sed -n '2,30p' "$0"; exit 0 ;;46+ --standalone) STANDALONE=1 ;;
47+ -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
46 *) echo "unknown argument: $arg" >&2; exit 2 ;;48 *) echo "unknown argument: $arg" >&2; exit 2 ;;
47 esac49 esac
48 done50 done
@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }
63 # ---------------------------------------------------------------- 0. preflight65 # ---------------------------------------------------------------- 0. preflight
64 say "0/7 preflight"66 say "0/7 preflight"
65 67
66-if command -v scorpiox-cli-botplugin >/dev/null 2>&1; then68+if [ "$STANDALONE" -eq 0 ] && command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
67 say "using scorpiox-cli-botplugin publish"69 say "using scorpiox-cli-botplugin publish"
68- exec scorpiox-cli-botplugin publish "$ROOT"70+ exec scorpiox-cli-botplugin publish "$ROOT" --version "$VERSION"
69 fi71 fi
70-echo " scorpiox-cli-botplugin not installed — running standalone pipeline"72+echo " running the standalone pipeline (dist + plugingit mirror)"
71 73
72 [ -n "$(git status --porcelain 2>/dev/null)" ] && \74 [ -n "$(git status --porcelain 2>/dev/null)" ] && \
73 echo " note: working tree is dirty; source.tar.gz comes from the last commit"75 echo " note: working tree is dirty; source.tar.gz comes from the last commit"
@@ -138,6 +140,22 @@ else@@ -138,6 +140,22 @@ else
138 echo " skip linux-x86_64-musl (no musl-gcc)"140 echo " skip linux-x86_64-musl (no musl-gcc)"
139 fi141 fi
140 142
143+# linux-arm64-musl (static aarch64 - Raspberry Pi 5 / ARM64 servers).
144+# Prefer musl; on a host that only has the Debian cross toolchain the static
145+# glibc link still yields a self-contained aarch64 ELF.
146+if command -v aarch64-linux-musl-gcc >/dev/null 2>&1; then
147+ aarch64-linux-musl-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
148+ || die "arm64 musl build failed"
149+ echo " built linux-arm64-musl $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
150+elif command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
151+ aarch64-linux-gnu-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
152+ || die "arm64 static build failed"
153+ echo " built linux-arm64-static $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
154+else
155+ echo " skip linux-arm64-musl (no aarch64 cross compiler)"
156+fi
157+
158+# windows-x86_64 (static PE)
141 # windows-x86_64 (static PE)159 # windows-x86_64 (static PE)
142 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then160 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
143 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \161 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \
@@ -228,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>@@ -228,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>
228 emit() { if [ -f "$2" ]; then [ $first -eq 1 ] || printf ',\n'; first=0; target_meta "$@"; fi; }246 emit() { if [ -f "$2" ]; then [ $first -eq 1 ] || printf ',\n'; first=0; target_meta "$@"; fi; }
229 emit "linux-x86_64" "$STAGE/$ID" "elf-x86_64" "linux-x86_64/$ID" "$ID"247 emit "linux-x86_64" "$STAGE/$ID" "elf-x86_64" "linux-x86_64/$ID" "$ID"
230 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"248 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"
249+ emit "linux-arm64-musl" "$STAGE/$ID.arm64" "elf-arm64-static" "linux-arm64-musl/$ID" "$ID"
231 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"250 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"
232 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"251 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"
233 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"252 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"
@@ -243,6 +262,7 @@ echo " manifest.json ok"@@ -243,6 +262,7 @@ echo " manifest.json ok"
243 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done262 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done
244 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"263 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"
245 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"264 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"
265+ [ -f "$ID.arm64" ] && sha256sum "$ID.arm64" | sed "s| $ID.arm64\$| linux-arm64-musl/$ID|"
246 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"266 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"
247 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"267 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"
248 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"268 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"
@@ -252,10 +272,11 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"@@ -252,10 +272,11 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"
252 # ---------------------------------------------------------------- 4. stage272 # ---------------------------------------------------------------- 4. stage
253 say "4/7 stage tree"273 say "4/7 stage tree"
254 PKG="$STAGE/pkg"274 PKG="$STAGE/pkg"
255-mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/macos-arm64" \275+mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/linux-arm64-musl" \
256- "$PKG/macos-x86_64" "$PKG/windows-x86_64"276+ "$PKG/macos-arm64" "$PKG/macos-x86_64" "$PKG/windows-x86_64"
257 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"277 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"
258 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"278 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"
279+[ -f "$STAGE/$ID.arm64" ] && cp -f "$STAGE/$ID.arm64" "$PKG/linux-arm64-musl/$ID"
259 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"280 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"
260 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"281 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"
261 [ -f "$STAGE/$ID.exe" ] && cp -f "$STAGE/$ID.exe" "$PKG/windows-x86_64/$ID.exe"282 [ -f "$STAGE/$ID.exe" ] && cp -f "$STAGE/$ID.exe" "$PKG/windows-x86_64/$ID.exe"
src/plugin_hello.c+1−1■■
index e369a72..ad955ff 100644index e369a72..ad955ff 100644
--- a/src/plugin_hello.c--- a/src/plugin_hello.c
+++ b/src/plugin_hello.c+++ b/src/plugin_hello.c
@@ -34,7 +34,7 @@@@ -34,7 +34,7 @@
34 34
35 #define PLUGIN_SLUG "hello"35 #define PLUGIN_SLUG "hello"
36 #define PLUGIN_ID "plugin_hello"36 #define PLUGIN_ID "plugin_hello"
37-#define PLUGIN_VER "1.1.0"37+#define PLUGIN_VER "1.1.1"
38 38
39 /* ------------------------------------------------------------------ */39 /* ------------------------------------------------------------------ */
40 /* Query string helpers */40 /* Query string helpers */
tests/run.sh+60−4■■■■■
index 5214139..8039ffa 100755index 5214139..8039ffa 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -62,7 +62,7 @@ DESC=$("$BIN" --meta | sed 's/.*"desc":"\([^"]*\)".*/\1/')@@ -62,7 +62,7 @@ DESC=$("$BIN" --meta | sed 's/.*"desc":"\([^"]*\)".*/\1/')
62 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"62 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
63 NAME=$("$BIN" --meta | sed 's/.*"name":"\([^"]*\)".*/\1/')63 NAME=$("$BIN" --meta | sed 's/.*"name":"\([^"]*\)".*/\1/')
64 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"64 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
65-check "--version prints version" '1.1.0' "$("$BIN" --version)"65+check "--version prints version" '1.1.1' "$("$BIN" --version)"
66 66
67 # ---------------------------------------------------------------- json mode67 # ---------------------------------------------------------------- json mode
68 section "node auth"68 section "node auth"
@@ -93,7 +93,7 @@ BODY=$(printf '%s' "$INFO" | sed '1,/^\r$/d')@@ -93,7 +93,7 @@ BODY=$(printf '%s' "$INFO" | sed '1,/^\r$/d')
93 check "info ok:true" '"ok":true' "$BODY"93 check "info ok:true" '"ok":true' "$BODY"
94 check "info plugin id" '"plugin":"plugin_hello"' "$BODY"94 check "info plugin id" '"plugin":"plugin_hello"' "$BODY"
95 check "info slug" '"slug":"hello"' "$BODY"95 check "info slug" '"slug":"hello"' "$BODY"
96-check "info version" '"version":"1.1.0"' "$BODY"96+check "info version" '"version":"1.1.1"' "$BODY"
97 check "info hostname field" '"hostname"' "$BODY"97 check "info hostname field" '"hostname"' "$BODY"
98 check "info os field" '"os"' "$BODY"98 check "info os field" '"os"' "$BODY"
99 check "info arch field" '"arch"' "$BODY"99 check "info arch field" '"arch"' "$BODY"
@@ -181,6 +181,47 @@ if command -v musl-gcc >/dev/null 2>&1; then@@ -181,6 +181,47 @@ if command -v musl-gcc >/dev/null 2>&1; then
181 else181 else
182 echo " skip: musl-gcc not installed"182 echo " skip: musl-gcc not installed"
183 fi183 fi
184+# arm64 (linux-arm64-musl) — static aarch64 ELF for Raspberry Pi 5 / ARM64 servers.
185+ARM64_CC_TEST=$(command -v aarch64-linux-musl-gcc 2>/dev/null || command -v aarch64-linux-gnu-gcc 2>/dev/null || true)
186+if [ -f plugin_hello.arm64 ]; then
187+ case $(head -c 4 plugin_hello.arm64 | od -An -tx1 | tr -d ' \n') in
188+ 7f454c46) pass "arm64 artifact is ELF" ;;
189+ *) fail "arm64 artifact is not ELF" ;;
190+ esac
191+ # e_machine sits at offset 18, little endian: b7 00 == EM_AARCH64
192+ EM=$(od -An -tx1 -j 18 -N 2 plugin_hello.arm64 | tr -d ' \n')
193+ [ "$EM" = "b700" ] && pass "arm64 artifact declares EM_AARCH64" \
194+ || fail "arm64 artifact e_machine is $EM, expected b700"
195+elif [ -n "$ARM64_CC_TEST" ]; then
196+ if "$ARM64_CC_TEST" -O2 -std=c99 -static -o /tmp/plugin_hello_arm64_test src/plugin_hello.c 2>/dev/null; then
197+ pass "aarch64 cross build succeeds"
198+ case $(head -c 4 /tmp/plugin_hello_arm64_test | od -An -tx1 | tr -d ' \n') in
199+ 7f454c46) pass "cross-built arm64 artifact is ELF" ;;
200+ *) fail "cross-built arm64 artifact is not ELF" ;;
201+ esac
202+ EM=$(od -An -tx1 -j 18 -N 2 /tmp/plugin_hello_arm64_test | tr -d ' \n')
203+ [ "$EM" = "b700" ] && pass "cross-built arm64 artifact declares EM_AARCH64" \
204+ || fail "cross-built arm64 e_machine is $EM, expected b700"
205+ rm -f /tmp/plugin_hello_arm64_test
206+ else
207+ fail "aarch64 cross build failed"
208+ fi
209+else
210+ echo " skip: no aarch64 cross compiler (run 'make arm64')"
211+fi
212+
213+for slice in arm64 x86_64; do
214+ f="plugin_hello.macos-$slice"
215+ if [ -f "$f" ]; then
216+ MF=$(head -c 4 "$f" | od -An -tx1 | tr -d ' \n')
217+ case "$MF" in
218+ cffaedfe|feedfacf|cefaedfe|feedface) pass "macos-$slice artifact is Mach-O" ;;
219+ *) fail "macos-$slice artifact is not Mach-O ($MF)" ;;
220+ esac
221+ else
222+ echo " skip: macos-$slice not built"
223+ fi
224+done
184 225
185 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then226 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
186 if x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static \227 if x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static \
@@ -250,8 +291,12 @@ if [ -d .git ]; then@@ -250,8 +291,12 @@ if [ -d .git ]; then
250 HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true)291 HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true)
251 [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history"292 [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history"
252 293
253- HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \294+ # Pre-filter auth-test lines BEFORE the -o extraction: grep -o prints only the
254- | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' \295+ # matched fragment, so a post-filter for BOT_PASSWORD can never see it and
296+ # "PASSWORD=testpw" from `BOT_PASSWORD=testpw` read as a real credential.
297+ HITS=$(printf '%s' "$ALL" \
298+ | grep -v 'BOT_PASSWORD\|X-Bot-Password\|Bearer ' \
299+ | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \
255 | grep -v '[$][{(A-Za-z_]' \300 | grep -v '[$][{(A-Za-z_]' \
256 | sort -u | head -5 || true)301 | sort -u | head -5 || true)
257 [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; }302 [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; }
@@ -298,6 +343,17 @@ section "repository files"@@ -298,6 +343,17 @@ section "repository files"
298 for f in README.md Makefile build.ps1 release-dist.sh tests/run.sh LICENSE .gitignore src/plugin_hello.c; do343 for f in README.md Makefile build.ps1 release-dist.sh tests/run.sh LICENSE .gitignore src/plugin_hello.c; do
299 [ -f "$f" ] && pass "file present: $f" || fail "file missing: $f"344 [ -f "$f" ] && pass "file present: $f" || fail "file missing: $f"
300 done345 done
346+[ -f plugin.json ] && pass "file present: plugin.json" || fail "file missing: plugin.json"
347+if [ -f plugin.json ]; then
348+ python3 - <<'PY' >/dev/null 2>&1 && pass "plugin.json is valid JSON with the contract keys" || fail "plugin.json invalid or missing contract keys"
349+import json
350+d = json.load(open("plugin.json"))
351+for k in ("slug", "id", "title", "summary", "category", "license", "capabilities", "trust_notice"):
352+ assert k in d, k
353+assert d["slug"] == "hello" and d["id"] == "plugin_hello", d
354+assert isinstance(d["capabilities"], list) and d["capabilities"], d
355+PY
356+fi
301 [ -f README.md ] && grep -q 'plugingit.scorpiox.net' README.md && pass "README documents plugingit clone URL" || fail "README missing clone URL"357 [ -f README.md ] && grep -q 'plugingit.scorpiox.net' README.md && pass "README documents plugingit clone URL" || fail "README missing clone URL"
302 [ -f README.md ] && grep -qi 'mit' README.md && pass "README mentions MIT license" || true358 [ -f README.md ] && grep -qi 'mit' README.md && pass "README mentions MIT license" || true
303 359
304360