Skip to content

Commit ebe545a

Browse files
hyperpolymathclaude
andcommitted
chore: Stapeln setup, TS→Zig test port, container + CI hardening
- Fix stapeln.toml: broken TOML entrypoint, Node.js references, wrong Containerfile path → now points to container/Containerfile and uses Zig layer definitions (ffi-build, adapter-build, runtime) - Fix container/Containerfile: resolve V-lang merge conflict header; clean SPDX header and correct Zig build comment throughout - Fix root Containerfile: replace node:22-slim with cgr.dev/chainguard/node:latest (Chainguard compliance); add WASM transition notice - Kill all 7 TypeScript test files (zero-tolerance policy): tests/{smoke,e2e_mcp,aspect_security,p2p_cartridge_properties,mcp_bench}.ts cartridges/local-coord-mcp/tests/e2e_coord.ts Replace with equivalent Zig tests; all pass under zig test. e2e_coord.zig skips gracefully when adapter binary not yet built. - Wire new Zig protocol tests into ffi/zig/build.zig under `protocol-tests` step; all included in `test` step. - Fix npm-bun-blocker.yml: was root-only; now recursively checks for package-lock.json, bun.lockb, node_modules/, .npmrc anywhere in tree. Correctly surfaces mcp-bridge/package-lock.json violation. - Fix ts-blocker.yml: was new-additions-only; now zero-tolerance for any existing .ts/.tsx files in the tree. - Drop deno.lock: no longer needed (TS files removed). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c5188a8 commit ebe545a

19 files changed

Lines changed: 1154 additions & 2211 deletions

.github/workflows/npm-bun-blocker.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,33 @@ jobs:
1212
contents: read
1313
steps:
1414
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15-
- name: Block npm/bun
15+
- name: Block npm/bun (recursive)
1616
run: |
17-
if [ -f "package-lock.json" ] || [ -f "bun.lockb" ] || [ -f ".npmrc" ]; then
18-
echo "❌ npm/bun artifacts detected. Use Deno instead."
19-
exit 1
17+
LOCKFILES=$(find . -name "package-lock.json" -not -path "./.git/*" -not -path "*/node_modules/*" 2>/dev/null || true)
18+
BUN_LOCK=$(find . -name "bun.lockb" -not -path "./.git/*" 2>/dev/null || true)
19+
NODE_MODS=$(find . -name "node_modules" -type d -not -path "./.git/*" 2>/dev/null || true)
20+
NPMRC=$(find . -name ".npmrc" -not -path "./.git/*" 2>/dev/null || true)
21+
22+
FAIL=0
23+
if [ -n "$LOCKFILES" ]; then
24+
echo "❌ package-lock.json detected (use Deno instead of npm):"
25+
printf '%s\n' "$LOCKFILES"
26+
FAIL=1
27+
fi
28+
if [ -n "$BUN_LOCK" ]; then
29+
echo "❌ bun.lockb detected (banned):"
30+
printf '%s\n' "$BUN_LOCK"
31+
FAIL=1
32+
fi
33+
if [ -n "$NODE_MODS" ]; then
34+
echo "❌ node_modules/ detected (no runtime npm install):"
35+
printf '%s\n' "$NODE_MODS"
36+
FAIL=1
37+
fi
38+
if [ -n "$NPMRC" ]; then
39+
echo "❌ .npmrc detected:"
40+
printf '%s\n' "$NPMRC"
41+
FAIL=1
2042
fi
43+
if [ "$FAIL" -eq 1 ]; then exit 1; fi
2144
echo "✅ No npm/bun violations"

.github/workflows/ts-blocker.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ jobs:
1212
contents: read
1313
steps:
1414
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15-
- name: Block new TypeScript/JavaScript
15+
- name: Block TypeScript (zero tolerance) and new JavaScript
1616
run: |
17-
NEW_TS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(ts|tsx)$' | grep -v '\.gen\.' || true)
18-
NEW_JS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(js|jsx)$' | grep -v '\.res\.js$' | grep -v '\.gen\.' | grep -v 'node_modules' || true)
17+
# Zero-tolerance: NO .ts files anywhere in the tree.
18+
EXISTING_TS=$(find . -name "*.ts" -o -name "*.tsx" | grep -v './.git/' | grep -v node_modules | grep -v '\.gen\.' || true)
19+
if [ -n "$EXISTING_TS" ]; then
20+
echo "❌ TypeScript files found (must be zero — port to Zig or ReScript):"
21+
printf '%s\n' "$EXISTING_TS"
22+
exit 1
23+
fi
1924
20-
if [ -n "$NEW_TS" ] || [ -n "$NEW_JS" ]; then
21-
echo "❌ New TS/JS files detected. Use ReScript instead."
22-
[ -n "$NEW_TS" ] && echo "$NEW_TS"
23-
[ -n "$NEW_JS" ] && echo "$NEW_JS"
25+
# JS: block new additions only (existing JS tracked for WASM migration).
26+
NEW_JS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(js|jsx)$' | grep -v '\.res\.js$' | grep -v '\.gen\.' | grep -v 'node_modules' || true)
27+
if [ -n "$NEW_JS" ]; then
28+
echo "❌ New .js files detected. Target language is Zig→WASM; use Zig or ReScript instead."
29+
printf '%s\n' "$NEW_JS"
2430
exit 1
2531
fi
26-
echo "✅ ReScript policy enforced"
32+
33+
echo "✅ No TS/new-JS violations"

Containerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
# Lightweight MCP stdio bridge for inspection and deployment.
3-
# Runs only the Node.js MCP bridge (zero dependencies).
2+
# Lightweight MCP stdio bridge for inspection and local development.
3+
# Runs only the Node.js MCP bridge (zero npm dependencies).
44
# The bridge responds to MCP initialize + tools/list with the full
55
# cartridge tool manifest.
66
#
7-
# For the full production image with Zig FFI + V adapter, use:
7+
# TRANSITIONAL: this image will be replaced by a Zig→WASM bridge once
8+
# typed-wasm-mcp lands. See docs/architecture/TYPED-WASM-MCP-BRIDGE.md.
9+
#
10+
# For the full production image (Zig FFI + adapter), use:
811
# podman build -f container/Containerfile .
912
#
1013
# Usage:
1114
# podman build -t boj-server:latest .
1215
# echo '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | podman run -i boj-server
1316

14-
FROM node:22-slim
17+
FROM cgr.dev/chainguard/node:latest
1518

1619
LABEL org.opencontainers.image.title="Bundle of Joy Server (MCP Bridge)" \
1720
org.opencontainers.image.description="MCP stdio transport for BoJ cartridge toolkit" \

0 commit comments

Comments
 (0)