Skip to content

Commit 3cac5f3

Browse files
hyperpolymathclaude
andcommitted
fix(router): remove stale skeleton/placeholder language; document auth gap
Router @moduledoc: describes actual dispatch logic and links to docs/AUTH-DESIGN.adoc for the HTTP-layer auth gap. Removes "placeholder" and "invocation-not-yet-wired" language that was accurate before JS dispatch was wired. /health: drops stale mode:"skeleton" and note fields — cartridges_loaded is the useful signal. STATE.a2ml: full rewrite reflecting current reality (2026-04-25): - stack updated to Idris2→Zig FFI + Elixir REST + Deno JS dispatch - 106 cartridges (was "18/99" stale count from V-lang era) - open gaps enumerated (auth, credential forwarding, gateway catalog mode) - session history accurate docs/AUTH-DESIGN.adoc: bot+human-readable record of the auth topology, the credential-forwarding problem, Options A/B/C, and explicit instructions to AI agents not to add inline auth without a design decision. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b87db27 commit 3cac5f3

3 files changed

Lines changed: 230 additions & 187 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 65 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -5,204 +5,95 @@
55

66
[metadata]
77
project = "boj-server"
8-
version = "0.4.0"
9-
last-updated = "2026-04-18"
8+
version = "1.0.1-wip"
9+
last-updated = "2026-04-25"
1010
status = "active"
1111
grade = "D-alpha"
1212

1313
[project-context]
1414
name = "Bundle of Joy Server"
15-
purpose = "Unified server capability catalogue solving the combinatoric explosion of developer server protocols. Provides a 2D matrix of formally verified cartridges (protocol types x capability domains), distributed via community-hosted nodes with hash attestation and gossip protocol."
16-
completion-percentage = 57
17-
18-
[position]
19-
phase = "alpha"
20-
maturity = "alpha"
15+
purpose = "Unified server capability catalogue. AI goes to ONE place instead of hunting across dozens of MCP servers. Distributed via community-hosted Umoja nodes with gossip protocol and hash attestation. 106 cartridges covering the full developer-tool matrix."
16+
completion-percentage = 65
17+
18+
[stack]
19+
# Current authoritative stack — V-lang adapter layer is GONE (banned 2026-04-10, removed 2026-04-12)
20+
abi-layer = "Idris2 — formal interface definitions with dependent-type proofs"
21+
ffi-layer = "Zig — C-ABI .so shared libraries (boj-invoke CLI for dlopen dispatch)"
22+
rest-server = "Elixir (Plug/Cowboy) — HTTP surface on port 7700, 5 routes"
23+
js-dispatch = "Deno — mod.js cartridges invoked via priv/js_runner.js per-call fork"
24+
container = "Chainguard wolfi-base (Containerfile, 3-stage Zig+Elixir build)"
25+
federation = "Zig QUIC gossip (X25519 + ChaCha20-Poly1305, UDP 9999)"
2126

2227
[route-to-mvp]
2328
milestones = [
2429
{ name = "Phase 0: Fresh repo from rsr-template-repo", completion = 100 },
2530
{ name = "Phase 1: Core catalogue & menu system (Idris2 ABI)", completion = 100 },
2631
{ name = "Phase 2: Core Zig FFI layer (catalogue + loader)", completion = 100 },
27-
{ name = "Phase 3: V-lang quad adapter (REST+gRPC+GraphQL+SSE)", completion = 100 },
28-
{ name = "Phase 4: First cartridges — ABI+FFI+Adapter (database, fleet, nesy, agent)", completion = 100 },
32+
{ name = "Phase 3: V-lang adapter layer", completion = 100, note = "RETIRED — V-lang banned 2026-04-10, all .v files removed 2026-04-12" },
33+
{ name = "Phase 4: First cartridges — boj-health Zig FFI reference impl", completion = 100 },
2934
{ name = "Phase 5: Umoja federation & PanLL panel", completion = 100 },
30-
{ name = "Phase 6: Remaining cartridges (fill the matrix)", completion = 100 },
31-
{ name = "Phase 7: Polystack deprecation (endgame)", completion = 100 },
32-
{ name = "Phase 8: Grade D→C (QUIC, multi-node, coprocessor, docs)", completion = 40 },
33-
{ name = "Phase 9: Grade C→B (SLA, community, SDP, seed nodes)", completion = 20 },
35+
{ name = "Phase 6: 106-cartridge matrix (all have cartridge.json + mod.js)", completion = 100 },
36+
{ name = "Phase 7: Elixir REST server wired to Zig FFI + JS Deno dispatch", completion = 100 },
37+
{ name = "Phase 8: Gateway sidecar (http-capability-gateway policy + catalog integration)", completion = 15 },
38+
{ name = "Phase 9: Auth layer (HTTP invoke caller auth, trust-level forwarding, credential proxy)", completion = 0 },
39+
{ name = "Phase 10: Grade D→C (QUIC multi-node, SLA, seed nodes, external validation)", completion = 30 },
3440
]
3541

36-
# Honest assessment notes:
37-
# - Phase 8 partial: QUIC transport, multi-node testing, coprocessor dispatch code exists
38-
# but lacks external validation, release workflow is stub, placeholders remain
39-
# - Grade D (Alpha): 18 cartridges built as state machines, tests passing internally
40-
# - Federation tests: 40 (was 30, +10 QUIC tests)
41-
# - Coprocessor tests: 14, SLA tests: 11, Community tests: 11, SDP tests: 10
42-
# - Multi-node tests: 11 (shell tests)
43-
4442
[quality]
45-
# Added 2026-04-04: Comprehensive MCP test suite (Deno)
46-
total-tests = 365 # 307 existing + 58 new MCP tests
47-
core-ffi-tests = 178
48-
cartridge-ffi-tests = 113
49-
federation-tests = 40
50-
coprocessor-tests = 14
51-
sla-tests = 11
52-
community-tests = 11
53-
sdp-tests = 10
54-
e2e-tests = 13 # 3 existing + 10 new MCP E2E
55-
readiness-tests = 28
56-
guardian-tests = 12
57-
verisimdb-tests = 7
58-
multinode-tests = 11
59-
# NEW: MCP Bridge Tests (Deno)
60-
mcp-smoke-tests = 8 # CLI, schema validation, health, cartridge listing
61-
mcp-e2e-tests = 10 # Lifecycle, tool invocation, error handling, sandboxing
62-
mcp-p2p-tests = 14 # Property-based: uniqueness, vocabulary, matrix completeness
63-
mcp-aspect-tests = 17 # Security: injection, sandboxing, credential handling, SSRF
64-
mcp-benchmark-tests = 10 # Performance baselines: serialization, latency, throughput
65-
cartridges-total = 99 # standard cartridges with cartridge.json; corrected 2026-04-18 (was stale at 92)
66-
cartridges-non-standard = 1 # model-router-mcp — tool list inline in src/router.js, no cartridge.json
67-
cartridges-with-readme = 100 # README.adoc coverage complete 2026-04-18 (46 generated this session)
68-
cartridge-shared-libs-build-target = 99 # shared libs produced by Containerfile at runtime; not checked into the tree
69-
cartridge-shared-libs-on-disk = 0 # nothing pre-built is committed — the Containerfile is authoritative
70-
safety-modules = 7 # Safety, Guardian, SafeHTTP, SafePromptInjection, SafeCORS, SafeAPIKey, SafeWebSocket
71-
sse-transport = true # Port 7703 — fixed 2026-03-29
72-
glama-grade = "AAA" # Security A, License A, Quality A
73-
dependabot-alerts = 0 # 3 low-sev alerts (rustls-webpki x2, rand) resolved 2026-04-18 via tray/Cargo.lock patch bumps; cargo check clean
74-
benchmark = true # 63 V-lang ecosystem benchmarks + 10 MCP baselines
75-
ci-pipeline = "zig-test.yml"
76-
topology = true
77-
believe-me-count = 4 # 3 axiomatic primitives (charEqSound, charEqSym, unpackLength) + 1 logSafeBounded — reduced from 31 on 2026-04-12
78-
fake-fuzz-placeholder = false # tests/fuzz/placeholder.txt removed 2026-04-04
79-
80-
[maintenance]
81-
must = [
82-
"Order-ticket end-to-end flow test (done)",
83-
"Cartridge .so/.dylib shared library builds (99/99 done — counter corrected 2026-04-18; prior '18/18' was stale from early cohort)",
84-
"CI/CD pipeline (zig-test.yml — done)",
85-
"Hash verification wired to mount (done)",
86-
"Distinct error codes for all failure modes (done)",
87-
]
88-
should = [
89-
"gRPC-compat adapter (done — JSON-over-HTTP with service/method paths)",
90-
"GraphQL subscriptions for mount/unmount events (done — polling)",
91-
"Readiness Grade D (Alpha) tests (done — 7 production tests)",
92-
"PanLL module mapping (DONE — 887-line view, 5 tabs, clade definition)",
93-
"Cartridge hot-reload (done — unmount/verify/remount)",
94-
"QUIC-first transport (DONE — X25519+ChaCha20-Poly1305, 10 QUIC tests)",
95-
"Multi-node federation testing (DONE — 11 tests, REST API peering)",
96-
"Coprocessor dispatch (DONE — Axiom.jl-style, 14 tests)",
97-
"Podman secure instance (configured-not-deployed — quadlet, seccomp, read-only rootfs defined, image not published)",
98-
"Stable API contract (DONE — docs/API-CONTRACT.md)",
99-
]
100-
could = [
101-
"WASM cartridge support",
102-
"Teranga menu runtime generation",
103-
"Register domain for named Cloudflare tunnel",
104-
]
105-
106-
[blockers-and-issues]
107-
# No critical blockers. Grade D (Alpha) — 18 cartridges built, tests passing.
108-
# Remaining: external validation, release workflow, deploy seed nodes, register domain.
43+
cartridges-total = 106 # all 106 have cartridge.json + mod.js as of 2026-04-25
44+
cartridges-with-zig-ffi = 1 # boj-health only — the Zig .so reference implementation
45+
cartridges-with-js-mod = 105 # mod.js dispatch via Deno (includes model-router-mcp pure-local)
46+
cartridges-with-both = 0 # no cartridge uses both paths
47+
zig-ffi-chain-verified = true # boj-invoke → dlopen → libboj_health.so end-to-end tested 2026-04-25
48+
js-dispatch-chain-verified = true # deno run js_runner.js → mod.js handleTool — tested 2026-04-25
49+
believe-me-count = 4 # 3 axiomatic primitives + 1 logSafeBounded — reduced from 31 on 2026-04-12
50+
v-lang-files = 0 # all .v files removed 2026-04-12
51+
52+
[open-gaps]
53+
# Ordered by impact on users hitting POST /cartridge/:name/invoke
54+
gap-1 = "No HTTP-layer auth on invoke endpoint — any caller can hit any cartridge (see docs/AUTH-DESIGN.adoc)"
55+
gap-2 = "Credential forwarding in federation — user API keys live on their node, not on volunteer nodes"
56+
gap-3 = "Deno fork-per-call overhead ~200ms cold start — worker pool is Phase 2"
57+
gap-4 = "Gateway catalog-mode (PolicyLoader.load_from_boj_catalog) not yet implemented in http-capability-gateway"
58+
gap-5 = "Load-aware inter-node routing not wired — invocations are local only"
59+
gap-6 = "TEST-NEEDS.md references V-lang era tests — needs rewrite against Elixir/Deno stack"
60+
gap-7 = "STATE.a2ml was massively stale until 2026-04-25 — all session-history entries before this date describe the old V-lang stack"
10961

11062
[critical-next-actions]
11163
actions = [
112-
"Register domain (hiddenhashtag.dev or alternative) for named tunnel",
64+
"Decide and implement HTTP invoke auth (see docs/AUTH-DESIGN.adoc — options: bearer token, mTLS header, or node-identity header)",
65+
"Implement credential-forwarding design for federation (user keys travel with the request encrypted, vs node-level key config)",
66+
"Implement PolicyLoader.load_from_boj_catalog in http-capability-gateway (see docs/gateway-catalog-integration.adoc)",
67+
"Rewrite TEST-NEEDS.md against Elixir/Deno stack",
68+
"Deploy gateway sidecar in compose.dev.yaml once catalog mode is ready",
11369
"Deploy 4 seed nodes to actual infrastructure",
114-
"Enable DoQ/DoH on seed nodes (runtime config)",
115-
"Post Show HN + blog post (drafts ready in docs/outreach/)",
116-
"Submit arXiv paper (draft ready in docs/papers/)",
117-
"Gather external validation from real users",
11870
]
11971

72+
[blockers-and-issues]
73+
invoke-auth = "OPEN — HTTP invoke endpoint has no caller auth (see docs/AUTH-DESIGN.adoc)"
74+
credential-forwarding = "OPEN — design not yet decided; critical for federation use case"
75+
gateway-catalog-mode = "OPEN — PolicyLoader.load_from_boj_catalog not yet implemented"
76+
test-needs-stale = "OPEN — TEST-NEEDS.md references V-lang era, needs rewrite"
77+
12078
[session-history]
12179
entries = [
122-
{ date = "2026-03-16", description = "npm scripts verified and validated for Glama MCP directory submission compatibility." },
123-
{ date = "2026-04-03", description = "URL encoding fix: replace→replaceAll in npm-registry-mcp to handle all encoded characters. Code scanning alert resolved." },
124-
{ date = "2026-04-04", description = "Containerfile updated: all 96 cartridge FFI builds (was 18). Dynamic discovery loop replaces hardcoded list. entrypoint.sh builds LD_LIBRARY_PATH dynamically at startup. 96/96 cartridges now loadable in container." },
125-
{ date = "2026-04-12", description = "V-lang sweep complete (commits c4674f8/cb00882/325b42e/9186016): 0 .v adapter files remain, all 90 cartridges have cartridge.json + mod.js + Zig three-protocol adapter. CI fixes: lcb-website (SHA updates, RSR path migration 6scm→6a2, peter-evans→gh workflow run) + nafa-app (Deno SHA pin, TS exclusion for Deno test files). believe_me sweep: 31→4 across 6 ABI safety modules (commit d262256) — added fromLteTrue (constructive), charEqSound/unpackLength (axiomatic primitives), eliminated all Safety/SafeWebSocket/SafePromptInjection/SafeCORS/SafeAPIKey non-axiomatic instances." },
126-
{ date = "2026-04-17", description = "Spec bump v0.4.0: V-lang ban documented in all spec docs. Cartridge manifest format confirmed as Nickel (closed DD), JSON→Nickel migration tracked as future work. BoJ-only MCP rule added to FEDERATION.md. Unified-zig-api stack alignment documented in ARCHITECTURE.md and ABI-FFI-README.md as planned future work (BoJ does not yet consume libzig_api). ADR-0002 created. EXPLAINME.adoc manifest.json→cartridge.json corrected. META.a2ml languages updated (v removed, zig-adapter noted)." },
127-
{ date = "2026-04-20", description = "Fix disconnected state: (1) Updated .gemini/settings.json to use 'deno run -A' for MCP bridge (prevents interactive permission prompts). (2) Started Elixir REST backend on port 7700 as Class 3 Multiplier replacement for banned V-lang adapter. (3) Fixed 'just doctor' in Justfile to handle 'zig version' syntax and robust tool detection." },
128-
]
129-
130-
[launch-status]
131-
awesome-list-prs = [
132-
"punkpeye/awesome-mcp-servers #2999",
133-
"modelcontextprotocol/servers #3506",
134-
"C-BJ/awesome-zig #87",
135-
"vlang/awesome-v #265",
136-
"joaomilho/awesome-idris #14",
80+
{ date = "2026-04-25", description = "Major session: (1) Fixed Zig ElfDynLib bug — boj-invoke now targets x86_64-linux-gnu, forcing DlDynLib/real dlopen. (2) boj-health Zig FFI cartridge fully implemented and tested. (3) Elixir REST server wired: Containerfile rewritten (3-stage Zig+Elixir build), compose.dev.yaml created. (4) All 106 cartridges now have mod.js (7 were missing). (5) model-router-mcp gets cartridge.json. (6) JS dispatch path implemented: BojRest.JsInvoker + priv/js_runner.js + Router dispatch branch. (7) cartridge_so_path/1 fixed to read ffi.so_path from manifest. (8) Gateway policy + catalog-integration design doc added. (9) ROADMAP v1.1.0 milestone added. (10) STATE.a2ml rewritten to reflect current reality." },
81+
{ date = "2026-04-20", description = "Started Elixir REST backend on port 7700 as V-lang adapter replacement. Fixed just doctor in Justfile." },
82+
{ date = "2026-04-17", description = "Spec bump v0.4.0: V-lang ban documented. ADR-0002 created. EXPLAINME.adoc corrections." },
83+
{ date = "2026-04-12", description = "V-lang sweep complete: 0 .v files remain. believe_me sweep: 31→4. CI fixes." },
84+
{ date = "2026-04-04", description = "MCP test suite added (Deno). Containerfile updated for 96-cartridge matrix." },
85+
{ date = "2026-03-16", description = "Repository created from rsr-template-repo. Initial Idris2 ABI + Zig FFI foundation." },
13786
]
138-
wiki = "docs/wiki/ (5 pages: Home, User-Guide, Operator-Guide, Developer-Guide, FAQ)"
139-
container-bootstrap = "entrypoint.sh auto-seeds federation via BOJ_SEED_NODES env"
140-
papers = "arXiv draft + IETF Internet-Draft in docs/papers/"
141-
outreach = "Show HN + blog post drafts in docs/outreach/"
142-
143-
[dogfooding-status]
144-
verisimdb = "done — database-mcp e2e on port 8180 (octad CRUD, VQL, drift)"
145-
ssg = "done — ssg-mcp builds Zola sites end-to-end"
146-
container = "done — container-mcp with FFI state machine + Stapeln API proxy"
147-
feedback = "done — feedback-mcp (18th cartridge), full ABI+FFI+Adapter+.so"
148-
panll-panel = "done — Boj.res panel, 5 tabs, cartridge matrix"
149-
panll-routing = "done — bojRouting toggle on 10 panels (VeriSimDB, Editor Bridge, Build Dashboard, VM Inspector, Echidna, Aerie, Coprocessors, Automation Router, MyLang, TypeLL)"
150-
151-
[grade-b-status]
152-
quic-transport = "done — X25519 ECDH + ChaCha20-Poly1305 AEAD, backward compatible"
153-
multinode-testing = "done — 2-node federation test script, REST API peering, 11 tests"
154-
coprocessor-dispatch = "done — detect→select→dispatch→fallback, env-driven, 14 tests"
155-
podman-secure = "configured-not-deployed — quadlet + seccomp profile + read-only rootfs defined, container image not published, untested in production"
156-
api-contract = "done — docs/API-CONTRACT.md, all endpoints documented"
157-
configurable-ports = "done — BOJ_REST_PORT, BOJ_GRPC_PORT, BOJ_GRAPHQL_PORT env vars"
158-
159-
[seam-checks]
160-
module = "ffi/zig/src/seams.zig"
161-
tests = 15
162-
pattern = "panic-attack diagnostics (integration contract validation)"
163-
categories = "enum-encoding, mount-safety, hash-attestation, backend-axis, lifecycle, json-contract, protocol-range, order-validation, thread-safety"
164-
result = "silent signature (all pass)"
165-
166-
[thread-safety]
167-
pattern = "std.Thread.Mutex per FFI module, lock at C-ABI export boundary"
168-
modules-hardened = 9
169-
exports-protected = 120
170-
global-vars-guarded = 55
171-
deadlock-prevention = "internal _impl functions for re-entrant call paths"
172-
panic-attack-result = "1 weak point (QUIC crypto, expected), 0 critical vulns in Zig FFI"
173-
174-
[mcp-bridge]
175-
mode = "--mcp flag on boj-server binary"
176-
protocol = "JSON-RPC 2.0 over stdin/stdout (MCP 2024-11-05)"
177-
tools = 18
178-
usage = "boj-server --mcp (add to claude_desktop_config.json)"
179-
180-
[extensibility]
181-
backend-axis = "stubbed — third dimension (domain x protocol x backend) for community extensions"
182-
extension-descriptor = "docs/examples/extension.a2ml"
183-
documentation = "docs/EXTENSIBILITY.md"
184-
185-
[grade-a-aspirations]
186-
# These are NOT Grade A — they are initial implementations needing external validation
187-
sla-monitoring = "initial — 3-tier (community/standard/premium), percentile tracking, 11 tests, no real-world usage"
188-
community-submissions = "initial — Ayo tier, review state machine, hash validation, 11 tests, no external submitters"
189-
auto-sdp = "initial — zero-trust perimeter, allow-list, auto-ban, open mode for bootstrapping, 10 tests, untested in production"
190-
seed-nodes = "config only — 4-continent config (EU-West, EU-Central, US-East, AP-South), not deployed"
191-
192-
[maintenance-status]
193-
last-run-utc = "2026-03-09"
194-
last-report = "reports/maintenance/latest.json"
195-
last-result = "pass"
196-
open-warnings = 0
197-
open-failures = 0
198-
199-
[ecosystem]
200-
part-of = ["hyperpolymath infrastructure", "PanLL", "stapeln ecosystem"]
201-
depends-on = ["proven-servers", "stapeln", "selur-compose", "vordr", "svalinn"]
202-
replaces = ["polystack"]
20387

20488
[architecture]
205-
stack = "Idris2 (ABI) -> Zig (FFI) -> Zig (Adapter, formerly V-lang — banned 2026-04-10)"
206-
model = "2D matrix: protocol types (columns) x capability domains (rows)"
207-
distribution = "Community-hosted nodes with QUIC gossip protocol and hash attestation"
89+
stack-summary = "Idris2 ABI → Zig FFI (.so) → Elixir REST (HTTP/7700) → Deno JS (mod.js per-call)"
90+
dispatch-rule = "cartridge.json with 'ffi' key → boj-invoke CLI; without 'ffi' key → deno js_runner.js"
91+
federation = "Zig QUIC gossip: X25519 handshake + ChaCha20-Poly1305, SDP allow-list, hash attestation"
92+
auth-gap = "Federation trust is gossip-layer only; HTTP invoke has no caller auth — see docs/AUTH-DESIGN.adoc"
93+
gateway = "http-capability-gateway planned as sidecar (port 7800 → boj-rest:7700); static policy in container/gateway-policy.yaml; catalog-mode design in docs/gateway-catalog-integration.adoc"
20894
cultural-pillars = ["Teranga (hospitality)", "Umoja (unity)", "Ayo (joy)"]
95+
96+
[ecosystem]
97+
part-of = ["hyperpolymath infrastructure", "PanLL", "stapeln ecosystem"]
98+
depends-on = ["proven-servers", "stapeln", "selur-compose", "vordr", "svalinn", "http-capability-gateway"]
99+
replaces = ["polystack"]

0 commit comments

Comments
 (0)