Skip to content

Commit ff9562b

Browse files
hyperpolymathclaude
andcommitted
feat: 18 cartridges with real invoke handlers, feedback-o-tron (18th)
- Register all 18 cartridges in V adapter catalogue (was 4 stubs) - Add real invoke handlers for all 18 — no more state-machine-only stubs - Add feedback-mcp as 18th cartridge: full ABI (Idris2 state machine), FFI (Zig with 5 tests), adapter (V), and shared lib (.so) - Add Feedback domain (=14) across all 3 layers (Idris2, Zig, V) - Update Containerfile, Justfile, and contractiles for 18 cartridges - Zola SSG builds tested end-to-end through ssg-mcp invoke Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7eb44e1 commit ff9562b

17 files changed

Lines changed: 1990 additions & 150 deletions

File tree

.machine_readable/contractiles/dust/Dustfile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@ recovery:
1919
- name: cartridge-abi-rollback
2020
path: "cartridges/*/abi/**/*.idr"
2121
rollback: "git checkout HEAD~1 -- cartridges/"
22-
notes: "Rollback all cartridge ABIs. Requires re-typecheck."
22+
notes: "Rollback all 18 cartridge ABIs. Requires re-typecheck."
23+
24+
- name: cartridge-ffi-rollback
25+
path: "cartridges/*/ffi/**/*.zig"
26+
rollback: "git checkout HEAD~1 -- cartridges/"
27+
notes: "Rollback all 18 cartridge FFI layers. Requires zig build test."
28+
29+
- name: single-cartridge-rollback
30+
event: "cartridge.{name}.failure"
31+
undo: "git checkout HEAD~1 -- cartridges/{name}-mcp/ && cd cartridges/{name}-mcp/ffi && zig build"
32+
notes: "Rollback a single cartridge (ABI+FFI) and rebuild its .so."
33+
34+
adapter:
35+
- name: v-adapter-rollback
36+
path: "adapter/v/src/main.v"
37+
rollback: "git checkout HEAD~1 -- adapter/v/src/main.v"
38+
notes: "Rollback V-lang adapter. Rebuild with just build-adapter."
2339

2440
federation:
2541
- name: node-deregister
@@ -32,6 +48,11 @@ recovery:
3248
undo: "Reset gossip state to last known-good snapshot."
3349
notes: "If gossip data is corrupted, fall back to seed node registry."
3450

51+
- name: federation-transport-fallback
52+
event: "umoja.quic.failure"
53+
undo: "Fall back to UDP transport for gossip."
54+
notes: "QUIC transport failure triggers automatic UDP fallback."
55+
3556
menu:
3657
- name: menu-regenerate
3758
path: .machine_readable/servers/menu.a2ml
@@ -43,3 +64,8 @@ recovery:
4364
source: ffi/zig/
4465
transform: "just clean && just build && just test"
4566
notes: "Full FFI rebuild and test cycle after any Zig source change."
67+
68+
- name: shared-libs-rebuild
69+
event: "cartridge.so.missing"
70+
transform: "for c in cartridges/*/ffi; do (cd $c && zig build); done"
71+
notes: "Rebuild all 18 cartridge .so files."

.machine_readable/contractiles/lust/Intentfile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,47 @@
44
version: 1
55

66
future:
7-
matrix-fill:
8-
- "Fill remaining MCP column: Cloud, Container, K8s, Git, Secrets, Queues, IaC, Observe, SSG, Proof."
9-
- "Begin LSP column for key capability domains."
10-
- "Evaluate DAP column where debugging adapters make sense."
7+
grade-progression:
8+
- "Grade D→C: Dogfood all 18 cartridges from PanLL + local workflows."
9+
- "Grade C→B: External user testing, documentation, stable API contract."
10+
- "Grade B→A: Production hardening, SLA, monitoring, community cartridge submissions."
1111

1212
umoja-federation:
13-
- "Implement gossip protocol for community node discovery (IPv6-only)."
14-
- "Hash attestation for binary verification of community-hosted nodes."
13+
- "QUIC-first transport: replace cleartext UDP with QUIC, UDP as fallback only."
1514
- "Deploy 4 family seed nodes across 4 continents (UK, Central Europe, Australia, Americas)."
1615
- "Load-aware routing: route orders to healthiest available node."
16+
- "Multi-node federation testing on Verpex VPS."
1717

18-
v-lang-adapter:
19-
- "Triple API adapter: REST (9000) + gRPC (9001) + GraphQL (9002)."
20-
- "Read order-ticket.scm, mount selected cartridges, return endpoints."
21-
- "Status endpoint returns live matrix state."
18+
cartridge-dogfooding:
19+
- "database-mcp: VeriSimDB queries from PanLL and local workflows."
20+
- "ssg-mcp: Zola/ddraig builds through cartridge mount."
21+
- "container-mcp: Stapeln integration for container lifecycle."
22+
- "observe-mcp: feedback-o-tron integration for observability and feedback."
23+
- "secrets-mcp: Credential management for community nodes."
24+
- "proof-mcp: proven-server VAE and proof verification."
25+
- "git-mcp: gitbot-fleet operations through cartridge dispatch."
26+
27+
coprocessor-support:
28+
- "Axiom.jl-style coprocessor dispatch: GPU (CUDA/ROCm), TPU, FPGA offload."
29+
- "Cartridge-level coprocessor declaration in ABI (which accelerators a cartridge can use)."
30+
- "Resource-aware scheduling via Guardian module."
2231

2332
security:
2433
- "Auto-SDP (Software Defined Perimeter) for community nodes."
2534
- "DoQ/DoH for encrypted DNS resolution on Umoja network."
2635
- "oDNS research: distributed Oblivious DNS as a network service."
2736
- "Container hash state monitoring via vordr integration."
37+
- "Podman removable+secure instance for community node operators."
2838

2939
panll-integration:
3040
- "BoJ panel in PanLL showing live capability matrix."
3141
- "Menu browser and order placement from PanLL."
3242
- "A2ML integration: PanLL reads BoJ menu.a2ml for capability discovery."
43+
- "Route LSP/DAP/BSP/database/agent panels through bojRouting toggle."
3344

3445
community:
3546
- "Community cartridge submission process (Ayo menu tier)."
3647
- "Hosting documentation for community node operators."
3748
- "IndieWeb integration: Webmention, self-hosted node discovery."
3849
- "PMPL license as network license for provenance chain verification."
50+
- "feedback-o-tron cartridge (18th) — DONE: full ABI+FFI+Adapter+.so, sentiment tracking."

.machine_readable/contractiles/must/Mustfile

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
description: "Invariant checks for BoJ capability catalogue, cartridges, and formal proofs."
1111

1212
parameters:
13-
gateway_port: "9000"
13+
gateway_port: "7700"
1414
abi_dir: "src/abi"
1515
ffi_dir: "ffi/zig"
1616

@@ -31,29 +31,42 @@ checks:
3131
description: "Core FFI tests must pass."
3232
run: "cd ffi/zig && zig build test"
3333

34-
- name: cartridge-fleet-abi
35-
description: "Fleet-MCP ABI must type-check."
36-
run: "cd cartridges/fleet-mcp/abi && idris2 --check fleet-mcp.ipkg"
37-
38-
- name: cartridge-nesy-abi
39-
description: "NeSy-MCP ABI must type-check."
40-
run: "cd cartridges/nesy-mcp/abi && idris2 --check nesy-mcp.ipkg"
41-
42-
- name: cartridge-database-abi
43-
description: "Database-MCP ABI must type-check."
44-
run: "cd cartridges/database-mcp/abi && idris2 --check database-mcp.ipkg"
45-
46-
- name: cartridge-agent-abi
47-
description: "Agent-MCP ABI must type-check."
48-
run: "cd cartridges/agent-mcp/abi && idris2 --check agent-mcp.ipkg"
34+
- name: cartridge-abi-all
35+
description: "All 18 cartridge ABIs must type-check."
36+
run: |
37+
for cart in database fleet nesy agent cloud container k8s git secrets queues iac observe ssg proof lsp dap bsp feedback; do
38+
dir="cartridges/${cart}-mcp/abi"
39+
if [ -d "$dir" ]; then
40+
echo "Checking ${cart}-mcp ABI..."
41+
(cd "$dir" && idris2 --check ${cart}-mcp.ipkg) || exit 1
42+
fi
43+
done
4944

5045
- name: cartridge-ffi-tests
51-
description: "All cartridge FFI tests must pass."
46+
description: "All 18 cartridge FFI tests must pass."
5247
run: |
53-
cd cartridges/fleet-mcp/ffi && zig build test &&
54-
cd ../../nesy-mcp/ffi && zig build test &&
55-
cd ../../database-mcp/ffi && zig build test &&
56-
cd ../../agent-mcp/ffi && zig build test
48+
for cart in database fleet nesy agent cloud container k8s git secrets queues iac observe ssg proof lsp dap bsp feedback; do
49+
dir="cartridges/${cart}-mcp/ffi"
50+
if [ -d "$dir" ] && [ -f "$dir/build.zig" ]; then
51+
echo "Testing ${cart}-mcp FFI..."
52+
(cd "$dir" && zig build test) || exit 1
53+
fi
54+
done
55+
56+
- name: cartridge-shared-libs
57+
description: "All 18 cartridge .so files must exist."
58+
run: |
59+
for cart in database fleet nesy agent cloud container k8s git secrets queues iac observe ssg proof lsp dap bsp feedback; do
60+
so="cartridges/${cart}-mcp/ffi/zig-out/lib/lib${cart}_mcp.so"
61+
if [ ! -f "$so" ]; then
62+
echo "Missing: $so"
63+
exit 1
64+
fi
65+
done
66+
67+
- name: adapter-builds
68+
description: "V-lang triple adapter must compile."
69+
run: "v -check adapter/v/src/main.v"
5770

5871
- name: spdx-headers
5972
description: "All source files must have PMPL-1.0-or-later SPDX headers."

Justfile

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ build *args:
267267
cd cartridges/nesy-mcp/ffi && zig build {{args}}
268268
cd cartridges/database-mcp/ffi && zig build {{args}}
269269
cd cartridges/agent-mcp/ffi && zig build {{args}}
270+
cd cartridges/feedback-mcp/ffi && zig build {{args}}
270271
@echo "Build complete"
271272

272273
# Build in release mode with optimizations
@@ -305,6 +306,8 @@ test *args:
305306
cd cartridges/database-mcp/ffi && zig build test
306307
@echo "Running agent-mcp FFI tests..."
307308
cd cartridges/agent-mcp/ffi && zig build test
309+
@echo "Running feedback-mcp FFI tests..."
310+
cd cartridges/feedback-mcp/ffi && zig build test
308311
@echo "All tests passed!"
309312

310313
# Run tests with verbose output
@@ -314,6 +317,7 @@ test-verbose:
314317
cd cartridges/nesy-mcp/ffi && zig build test -- --verbose
315318
cd cartridges/database-mcp/ffi && zig build test -- --verbose
316319
cd cartridges/agent-mcp/ffi && zig build test -- --verbose
320+
cd cartridges/feedback-mcp/ffi && zig build test -- --verbose
317321

318322
# Smoke test — type-check core ABI + run one FFI test
319323
test-smoke:
@@ -377,6 +381,7 @@ typecheck:
377381
cd cartridges/nesy-mcp/abi && idris2 --check nesy-mcp.ipkg
378382
cd cartridges/database-mcp/abi && idris2 --check database-mcp.ipkg
379383
cd cartridges/agent-mcp/abi && idris2 --check agent-mcp.ipkg
384+
cd cartridges/feedback-mcp/abi && idris2 --check feedback-mcp.ipkg
380385
@echo "All ABI files type-check!"
381386

382387
# Verify zero believe_me in all Idris2 sources
@@ -423,20 +428,65 @@ matrix:
423428
# RUN & EXECUTE
424429
# ═══════════════════════════════════════════════════════════════════════════════
425430

426-
# Run the BoJ server (Phase 3 — V-lang adapter required)
431+
# Run the BoJ server (V-lang triple adapter: REST 7700, gRPC 7701, GraphQL 7702)
427432
run *args: build
428-
@echo "BoJ server requires V-lang adapter (Phase 3)"
429-
@echo "Current status: ABI + FFI layers complete"
430-
@echo "Run 'just matrix' to see cartridge status"
433+
#!/usr/bin/env bash
434+
set -euo pipefail
435+
ADAPTER="adapter/v/boj-server"
436+
if [ ! -f "$ADAPTER" ]; then
437+
echo "Building V-lang adapter..."
438+
v -cc gcc -cflags "-L$(pwd)/ffi/zig/zig-out/lib -Wl,--allow-multiple-definition" \
439+
-o "$ADAPTER" adapter/v/src/main.v
440+
fi
441+
echo "Starting BoJ Server..."
442+
exec "$ADAPTER" {{args}}
431443
432444
# Run with verbose output
433445
run-verbose *args: build
434-
just run {{args}}
446+
BOJ_VERBOSE=1 just run {{args}}
447+
448+
# Build V-lang adapter binary
449+
build-adapter: build
450+
#!/usr/bin/env bash
451+
set -euo pipefail
452+
echo "Building V-lang adapter..."
453+
v -cc gcc -cflags "-L$(pwd)/ffi/zig/zig-out/lib -Wl,--allow-multiple-definition" \
454+
-o adapter/v/boj-server adapter/v/src/main.v
455+
echo "Built: adapter/v/boj-server ($(du -h adapter/v/boj-server | cut -f1))"
435456
436457
# Install to user path
437-
install: build-release
458+
install: build-adapter
438459
@echo "Installing boj-server..."
439-
@echo "Phase 3 required for installable binary"
460+
cp adapter/v/boj-server ~/.local/bin/boj-server
461+
@echo "Installed to ~/.local/bin/boj-server"
462+
463+
# Start Cloudflare quick tunnel (exposes BoJ at *.trycloudflare.com)
464+
tunnel:
465+
@echo "Starting Cloudflare Quick Tunnel → *.trycloudflare.com"
466+
@echo "Watch output for the assigned URL."
467+
cloudflared tunnel --no-autoupdate --no-tls-verify --url http://localhost:7700
468+
469+
# Run BoJ server + Cloudflare Tunnel together
470+
serve: build
471+
#!/usr/bin/env bash
472+
set -euo pipefail
473+
ADAPTER="adapter/v/boj-server"
474+
if [ ! -f "$ADAPTER" ]; then
475+
echo "Building V-lang adapter..."
476+
v -cc gcc -cflags "-L$(pwd)/ffi/zig/zig-out/lib -Wl,--allow-multiple-definition" \
477+
-o "$ADAPTER" adapter/v/src/main.v
478+
fi
479+
echo "Starting BoJ Server..."
480+
echo " Local: http://localhost:7700/status"
481+
LD_LIBRARY_PATH="$(pwd)/ffi/zig/zig-out/lib" "$ADAPTER" &
482+
BOJ_PID=$!
483+
trap "kill $BOJ_PID 2>/dev/null; kill $TUNNEL_PID 2>/dev/null; exit" INT TERM
484+
sleep 2
485+
echo ""
486+
echo "Starting Cloudflare Tunnel (watch for public URL)..."
487+
cloudflared tunnel --no-autoupdate --no-tls-verify --url http://localhost:7700 &
488+
TUNNEL_PID=$!
489+
wait $BOJ_PID $TUNNEL_PID
440490
441491
# ═══════════════════════════════════════════════════════════════════════════════
442492
# DEPENDENCIES

0 commit comments

Comments
 (0)