| index e892f4c..15b2b26 100644 | ||
| --- a/.gitignore | ||
| +++ b/.gitignore | ||
| @@ -1,7 +1,13 @@ | ||
| 1 | 1 | /plugin_hello |
| 2 | 2 | /plugin_hello.exe |
| 3 | +/plugin_hello.arm64 | |
| 4 | +/plugin_hello.musl | |
| 5 | +/plugin_hello.macos-arm64 | |
| 6 | +/plugin_hello.macos-x86_64 | |
| 3 | 7 | *.o |
| 4 | 8 | *.obj |
| 5 | 9 | bin/ |
| 6 | 10 | *.tmp |
| 7 | 11 | *.log |
| 12 | +__pycache__/ | |
| 13 | +*.pyc |
| index 1a12d90..e79a27b 100644 | ||
| --- a/Makefile | ||
| +++ b/Makefile | ||
| @@ -3,6 +3,7 @@ | ||
| 3 | 3 | # Targets: |
| 4 | 4 | # make native build -> ./plugin_hello |
| 5 | 5 | # make musl static musl x86_64 -> ./plugin_hello (fully static) |
| 6 | +# make arm64 static aarch64 -> ./plugin_hello.arm64 (Pi 5 / ARM64 servers) | |
| 6 | 7 | # make win64 MinGW-w64 static -> ./plugin_hello.exe |
| 7 | 8 | # make macos Apple clang -> ./plugin_hello (run on macOS) |
| 8 | 9 | # make test build + run tests/run.sh |
| @@ -12,13 +13,17 @@ CC ?= cc | ||
| 12 | 13 | CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings |
| 13 | 14 | MUSL_CC ?= musl-gcc |
| 14 | 15 | 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 | 20 | WIN_CC ?= x86_64-w64-mingw32-gcc |
| 16 | 21 | WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static |
| 17 | 22 | SRC := src/plugin_hello.c |
| 18 | 23 | BIN := plugin_hello |
| 19 | 24 | EXE := plugin_hello.exe |
| 20 | 25 | |
| 21 | -.PHONY: all native musl win64 macos test clean distclean help | |
| 26 | +.PHONY: all native musl arm64 win64 macos test clean distclean help | |
| 22 | 27 | |
| 23 | 28 | all: native |
| 24 | 29 | |
| @@ -33,6 +38,13 @@ musl: $(SRC) | ||
| 33 | 38 | @echo "==> static musl build ($(MUSL_CC))" |
| 34 | 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 | 48 | # Native Win64 static PE — runs on any Windows 10/11 x64 node |
| 37 | 49 | win64: $(SRC) |
| 38 | 50 | @echo "==> MinGW-w64 build ($(WIN_CC))" |
| @@ -47,10 +59,10 @@ test: native | ||
| 47 | 59 | @sh tests/run.sh |
| 48 | 60 | |
| 49 | 61 | 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 | |
| 51 | 63 | rm -rf bin |
| 52 | 64 | |
| 53 | 65 | distclean: clean |
| 54 | 66 | |
| 55 | 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" |
| index cee6ea5..567a5b7 100644 | ||
| --- a/README.md | ||
| +++ b/README.md | ||
| @@ -56,7 +56,7 @@ Content-Type: application/json; charset=utf-8 | ||
| 56 | 56 | Cache-Control: no-store |
| 57 | 57 | 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 | 60 | "node":{"hostname":"agentcore-latest","os":"linux","arch":"x86_64", |
| 61 | 61 | "libc":"glibc","pid":591,"utc":"2026-11-11T01:10:39Z"}, |
| 62 | 62 | "query_string":"action=info", |
| @@ -100,7 +100,8 @@ discovery endpoint, not a dispatch route. The page also forwards `node`, `id`, a | ||
| 100 | 100 | ```sh |
| 101 | 101 | make # native (cc / gcc / clang) -> ./plugin_hello |
| 102 | 102 | 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 | |
| 104 | 105 | make macos # Apple clang (run on macOS) -> ./plugin_hello |
| 105 | 106 | make test # build + full test suite |
| 106 | 107 | make clean |
| @@ -148,7 +149,7 @@ curl -s -H "X-Bot-Password: <pwd>" http://127.0.0.1:8150/plugins | grep hello | ||
| 148 | 149 | ## Pre-built binaries |
| 149 | 150 | |
| 150 | 151 | 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 | 154 | | Target | File | |
| 154 | 155 | |---|---| |
| 1 | 1 | new 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 | +} |
| index 9a805b0..8ee873d 100755 | ||
| --- a/release-dist.sh | ||
| +++ b/release-dist.sh | ||
| @@ -28,7 +28,7 @@ set -euo pipefail | ||
| 28 | 28 | |
| 29 | 29 | SLUG="hello" |
| 30 | 30 | ID="plugin_hello" |
| 31 | -VERSION="1.1.0" | |
| 31 | +VERSION="1.1.1" | |
| 32 | 32 | DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins" |
| 33 | 33 | |
| 34 | 34 | ROOT="$(cd "$(dirname "$0")" && pwd)" |
| @@ -37,12 +37,14 @@ cd "$ROOT" | ||
| 37 | 37 | DRY_RUN=0 |
| 38 | 38 | DO_MACOS=1 |
| 39 | 39 | DO_MIRROR=1 |
| 40 | +STANDALONE=0 | |
| 40 | 41 | for arg in "$@"; do |
| 41 | 42 | 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 ;; | |
| 46 | 48 | *) echo "unknown argument: $arg" >&2; exit 2 ;; |
| 47 | 49 | esac |
| 48 | 50 | done |
| @@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; } | ||
| 63 | 65 | # ---------------------------------------------------------------- 0. preflight |
| 64 | 66 | say "0/7 preflight" |
| 65 | 67 | |
| 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 | |
| 67 | 69 | say "using scorpiox-cli-botplugin publish" |
| 68 | - exec scorpiox-cli-botplugin publish "$ROOT" | |
| 70 | + exec scorpiox-cli-botplugin publish "$ROOT" --version "$VERSION" | |
| 69 | 71 | fi |
| 70 | -echo " scorpiox-cli-botplugin not installed — running standalone pipeline" | |
| 72 | +echo " running the standalone pipeline (dist + plugingit mirror)" | |
| 71 | 73 | |
| 72 | 74 | [ -n "$(git status --porcelain 2>/dev/null)" ] && \ |
| 73 | 75 | echo " note: working tree is dirty; source.tar.gz comes from the last commit" |
| @@ -138,6 +140,22 @@ else | ||
| 138 | 140 | echo " skip linux-x86_64-musl (no musl-gcc)" |
| 139 | 141 | 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 | 159 | # windows-x86_64 (static PE) |
| 142 | 160 | if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then |
| 143 | 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 | 246 | emit() { if [ -f "$2" ]; then [ $first -eq 1 ] || printf ',\n'; first=0; target_meta "$@"; fi; } |
| 229 | 247 | emit "linux-x86_64" "$STAGE/$ID" "elf-x86_64" "linux-x86_64/$ID" "$ID" |
| 230 | 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 | 250 | emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID" |
| 232 | 251 | emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID" |
| 233 | 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 | 262 | for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done |
| 244 | 263 | [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|" |
| 245 | 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 | 266 | [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|" |
| 247 | 267 | [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|" |
| 248 | 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 | 272 | # ---------------------------------------------------------------- 4. stage |
| 253 | 273 | say "4/7 stage tree" |
| 254 | 274 | 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" | |
| 257 | 277 | cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID" |
| 258 | 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 | 280 | [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID" |
| 260 | 281 | [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID" |
| 261 | 282 | [ -f "$STAGE/$ID.exe" ] && cp -f "$STAGE/$ID.exe" "$PKG/windows-x86_64/$ID.exe" |
| index e369a72..ad955ff 100644 | ||
| --- a/src/plugin_hello.c | ||
| +++ b/src/plugin_hello.c | ||
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | |
| 35 | 35 | #define PLUGIN_SLUG "hello" |
| 36 | 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 | 40 | /* Query string helpers */ |
| index 5214139..8039ffa 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -62,7 +62,7 @@ DESC=$("$BIN" --meta | sed 's/.*"desc":"\([^"]*\)".*/\1/') | ||
| 62 | 62 | [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})" |
| 63 | 63 | NAME=$("$BIN" --meta | sed 's/.*"name":"\([^"]*\)".*/\1/') |
| 64 | 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 | 67 | # ---------------------------------------------------------------- json mode |
| 68 | 68 | section "node auth" |
| @@ -93,7 +93,7 @@ BODY=$(printf '%s' "$INFO" | sed '1,/^\r$/d') | ||
| 93 | 93 | check "info ok:true" '"ok":true' "$BODY" |
| 94 | 94 | check "info plugin id" '"plugin":"plugin_hello"' "$BODY" |
| 95 | 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 | 97 | check "info hostname field" '"hostname"' "$BODY" |
| 98 | 98 | check "info os field" '"os"' "$BODY" |
| 99 | 99 | check "info arch field" '"arch"' "$BODY" |
| @@ -181,6 +181,47 @@ if command -v musl-gcc >/dev/null 2>&1; then | ||
| 181 | 181 | else |
| 182 | 182 | echo " skip: musl-gcc not installed" |
| 183 | 183 | 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 | 226 | if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then |
| 186 | 227 | if x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static \ |
| @@ -250,8 +291,12 @@ if [ -d .git ]; then | ||
| 250 | 291 | HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true) |
| 251 | 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,}' \ | |
| 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,}' \ | |
| 255 | 300 | | grep -v '[$][{(A-Za-z_]' \ |
| 256 | 301 | | sort -u | head -5 || true) |
| 257 | 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 | 343 | for f in README.md Makefile build.ps1 release-dist.sh tests/run.sh LICENSE .gitignore src/plugin_hello.c; do |
| 299 | 344 | [ -f "$f" ] && pass "file present: $f" || fail "file missing: $f" |
| 300 | 345 | 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 | 357 | [ -f README.md ] && grep -q 'plugingit.scorpiox.net' README.md && pass "README documents plugingit clone URL" || fail "README missing clone URL" |
| 302 | 358 | [ -f README.md ] && grep -qi 'mit' README.md && pass "README mentions MIT license" || true |
| 303 | 359 | |
| 304 | 360 |
| index e892f4c..15b2b26 100644 | index e892f4c..15b2b26 100644 | ||
| --- a/.gitignore | --- a/.gitignore | ||
| +++ b/.gitignore | +++ b/.gitignore | ||
| @@ -1,7 +1,13 @@ | @@ -1,7 +1,13 @@ | ||
| 1 | /plugin_hello | 1 | /plugin_hello |
| 2 | /plugin_hello.exe | 2 | /plugin_hello.exe |
| 3 | +/plugin_hello.arm64 | ||
| 4 | +/plugin_hello.musl | ||
| 5 | +/plugin_hello.macos-arm64 | ||
| 6 | +/plugin_hello.macos-x86_64 | ||
| 3 | *.o | 7 | *.o |
| 4 | *.obj | 8 | *.obj |
| 5 | bin/ | 9 | bin/ |
| 6 | *.tmp | 10 | *.tmp |
| 7 | *.log | 11 | *.log |
| 12 | +__pycache__/ | ||
| 13 | +*.pyc |
| index 1a12d90..e79a27b 100644 | index 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_hello | 4 | # 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.exe | 7 | # 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.sh | 9 | # 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-strings | 13 | CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings |
| 13 | MUSL_CC ?= musl-gcc | 14 | MUSL_CC ?= musl-gcc |
| 14 | MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static | 15 | 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-gcc | 20 | WIN_CC ?= x86_64-w64-mingw32-gcc |
| 16 | WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static | 21 | WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static |
| 17 | SRC := src/plugin_hello.c | 22 | SRC := src/plugin_hello.c |
| 18 | BIN := plugin_hello | 23 | BIN := plugin_hello |
| 19 | EXE := plugin_hello.exe | 24 | EXE := plugin_hello.exe |
| 20 | 25 | ||
| 21 | -.PHONY: all native musl win64 macos test clean distclean help | 26 | +.PHONY: all native musl arm64 win64 macos test clean distclean help |
| 22 | 27 | ||
| 23 | all: native | 28 | 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 node | 48 | # 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.sh | 59 | @sh tests/run.sh |
| 48 | 60 | ||
| 49 | clean: | 61 | 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 |
| 51 | rm -rf bin | 63 | rm -rf bin |
| 52 | 64 | ||
| 53 | distclean: clean | 65 | 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" |
| index cee6ea5..567a5b7 100644 | index 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-store | 56 | Cache-Control: no-store |
| 57 | X-Content-Type-Options: nosniff | 57 | 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 | ```sh | 100 | ```sh |
| 101 | make # native (cc / gcc / clang) -> ./plugin_hello | 101 | make # native (cc / gcc / clang) -> ./plugin_hello |
| 102 | make musl # static musl x86_64 (universal) -> ./plugin_hello | 102 | 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 | ||
| 104 | make macos # Apple clang (run on macOS) -> ./plugin_hello | 105 | make macos # Apple clang (run on macOS) -> ./plugin_hello |
| 105 | make test # build + full test suite | 106 | make test # build + full test suite |
| 106 | make clean | 107 | 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 binaries | 149 | ## Pre-built binaries |
| 149 | 150 | ||
| 150 | If you would rather not compile, every release is published with checksums at | 151 | 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 | |---|---| |
| 1 | new file mode 100644 | 1 | new file mode 100644 |
| index 0000000..b64bc2b | index 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 | +} |
| index 9a805b0..8ee873d 100755 | index 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=0 | 37 | DRY_RUN=0 |
| 38 | DO_MACOS=1 | 38 | DO_MACOS=1 |
| 39 | DO_MIRROR=1 | 39 | DO_MIRROR=1 |
| 40 | +STANDALONE=0 | ||
| 40 | for arg in "$@"; do | 41 | for arg in "$@"; do |
| 41 | case "$arg" in | 42 | 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 | esac | 49 | esac |
| 48 | done | 50 | 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. preflight | 65 | # ---------------------------------------------------------------- 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; then | 68 | +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 | fi | 71 | 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 | fi | 141 | 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; then | 160 | 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"; done | 262 | 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. stage | 272 | # ---------------------------------------------------------------- 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" |
| index e369a72..ad955ff 100644 | index 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 */ |
| index 5214139..8039ffa 100755 | index 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 mode | 67 | # ---------------------------------------------------------------- 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 | else | 181 | else |
| 182 | echo " skip: musl-gcc not installed" | 182 | echo " skip: musl-gcc not installed" |
| 183 | fi | 183 | 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; then | 226 | 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; do | 343 | 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 | done | 345 | 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" || true | 358 | [ -f README.md ] && grep -qi 'mit' README.md && pass "README mentions MIT license" || true |
| 303 | 359 | ||
| 304 | 360 |