Skip to content

Commit cbea72c

Browse files
committed
chore: Implement Dual-Track differentiation (Class 1 Simplicity vs Class 2 Scale)
1 parent 807497d commit cbea72c

11 files changed

Lines changed: 2844 additions & 11 deletions

File tree

0-AI-MANIFEST.a2ml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ This is the AI manifest for **Bundle of Joy Server**. It declares:
99
- Critical invariants (rules that must NEVER be violated)
1010
- Repository structure and organization
1111

12+
## 🏰 DUAL-TRACK ARCHITECTURE (CLASS 1 vs CLASS 2)
13+
14+
This repository implements a Dual-Track design to balance simplicity and scale.
15+
16+
### **Class 1: Simple Track (Canonical)**
17+
- **Focus:** Zero-infrastructure simplicity.
18+
- **Workflow:** Repositories trigger builds via GitHub Actions (CLI/curl).
19+
- **Cartridge Pattern:** Each cartridge has its own self-contained V-lang adapters.
20+
- **Path:** Standard `cartridges/<name>/adapter/`.
21+
22+
### **Class 2: Orchestrator Track (Advanced)**
23+
- **Focus:** High-performance unified gateways.
24+
- **Workflow:** Secure Webhooks (HMAC-SHA256) and Real-time (MQTT/WS).
25+
- **Cartridge Pattern:** Uses core generic handlers to wrap cartridge FFI.
26+
- **Path:** `adapter/v/src/class_2_orchestrator/`.
27+
28+
**INVARIANT:** Class 2 features must NEVER damage or replace the Class 1 foundation.
29+
1230
## CANONICAL LOCATIONS (UNIVERSAL RULE)
1331

1432
### Machine-Readable Metadata: `.machine_readable/` ONLY
@@ -98,7 +116,8 @@ boj-server/
98116
│ └── src/loader.zig # Dynamic cartridge loader
99117
├── generated/abi/ # Auto-generated C headers from Idris2
100118
├── adapter/v/ # V-lang triple adapter (REST+gRPC+GraphQL)
101-
│ └── src/main.v # Unified console on port 9000
119+
│ ├── src/main.v # Unified console on port 9000
120+
│ └── src/class_2_orchestrator/ # Advanced gateway logic (WS/MQTT/Webhook)
102121
├── cartridges/ # One dir per matrix cell (Idris2+Zig+V)
103122
│ ├── database-mcp/ # MCP × Database cartridge
104123
│ ├── nesy-mcp/ # MCP × NeSy cartridge

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@ A genuine 'bundle of joy'.
1212
<img src="https://www.bestpractices.dev/projects/12164/badge" alt="OpenSSF Best Practices passing (115%)" />
1313
</a>
1414

15+
## 🏰 Dual-Track Architecture
16+
17+
BoJ Server provides two distinct ways to interact with cartridges, catering to different needs for simplicity and scale.
18+
19+
### **Class 1: Simple Track (Canonical)**
20+
- **Focus:** Simplicity, local-first, zero-infrastructure.
21+
- **Workflow:** Repositories use standard GitHub Actions (`curl` triggers) to talk to the server.
22+
- **Implementation:** Each cartridge is self-contained with its own adapters.
23+
- **Best for:** Most users, quick setups, and easy debugging.
24+
25+
### **Class 2: Orchestrator Track (Advanced)**
26+
- **Focus:** Unified transport, high-performance, massive scale.
27+
- **Workflow:** Uses secure Webhooks (HMAC-SHA256) and unified real-time gateways (MQTT/WebSockets).
28+
- **Implementation:** Core-level generic handlers located in `adapter/v/src/class_2_orchestrator/`.
29+
- **Best for:** Production environments, IoT integration, and multi-agent orchestration.
30+
31+
---
32+
1533
## Quick Start
1634

1735
**1. Clone and build**
@@ -97,13 +115,3 @@ See [docs/READINESS.md](docs/READINESS.md) for the full component-by-component a
97115
## Architecture (For Contributors)
98116

99117
BoJ uses Idris2 for interface proofs (zero `believe_me`), Zig for the C-compatible FFI layer, V-lang for the REST/gRPC/GraphQL adapter, and JavaScript for the MCP bridge. If that sounds like a lot of languages, it is -- each was chosen for a specific guarantee. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the rationale and contributor guide.
100-
101-
Cartridges are loaded as shared libraries (`.so` files) at runtime, verified by hash before mounting. Community-contributed cartridges go through the same verification pipeline.
102-
103-
## License
104-
105-
SPDX-License-Identifier: PMPL-1.0-or-later (Palimpsest License)
106-
107-
Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
108-
109-
See [LICENSE](LICENSE) for the full text.

adapter/v/src/webhook.v renamed to adapter/v/src/class_2_orchestrator/webhook.v

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)