Skip to content

Commit c3fed3b

Browse files
Merge branch 'main' into claude/enhance-vibe-aaa-standard-ATSCg
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
2 parents 61f4ff7 + 2fd19cd commit c3fed3b

409 files changed

Lines changed: 20903 additions & 8492 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.machine_readable/6a2/STATE.a2ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ entries = [
124124
{ 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." },
125125
{ 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." },
126126
{ 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." },
127128
]
128129

129130
[launch-status]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Bustfile.a2ml — meta-repo bust contractile (breakage / rollback)
2+
// SPDX-License-Identifier: PMPL-1.0-or-later
3+
4+
Bust {
5+
name: "boj-server"
6+
version: "1.0.0"
7+
description: "Rollback procedures when something breaks in the meta-repo"
8+
9+
scenarios: {
10+
"bad-pointer-bump": "git revert <bump-commit> in meta-repo; child repo itself untouched"
11+
"submodule-pointer-points-at-missing-sha": "git submodule update --init --checkout <path> resets child to parent-recorded SHA; OR revert the stale bump commit"
12+
"submodule-orphan-after-local-only-commit": "roll back locally with git reset to before the stranded commit; fix remote situation before re-attempting"
13+
"accidental-private-repo-content-leaked-to-public-submodule": "hard-rotate the leaked secret immediately; git-filter-repo or BFG on the submodule's own history; public re-publication only after rotation complete"
14+
}
15+
16+
escalation-ladder: [
17+
"1. revert the meta-repo commit (reversible, low blast radius)",
18+
"2. reset the local submodule clone (affects only local workspace)",
19+
"3. force-push to main — PROHIBITED without explicit user confirmation (violates branch protection)",
20+
"4. registry-level (delete/archive the GitHub repo) — human-only action, never by AI"
21+
]
22+
23+
backup-points: [
24+
"GitHub serves as the durable backup for every submodule's own history",
25+
"Meta-repo history on origin/main is the durable backup for pointer state",
26+
"Local backup tags (backup/pre-<operation>-<date>) retained on risky rewrites"
27+
]
28+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Bust — error-handling / failure-recovery runner
3+
#
4+
# Pairs with: Bustfile.a2ml (same directory)
5+
# Verb: bust
6+
# Semantics: every declared failure mode must have a recovery path that has
7+
# been exercised. Runner injects failures (via declared probes)
8+
# and verifies the recovery path works. Hard gate on any
9+
# failure-mode with missing or broken recovery.
10+
# CLI: `contractile bust check` → list failure modes + recovery status
11+
# `contractile bust drill` → inject declared failures, verify recovery
12+
#
13+
# Anything else in this directory is human-only notes/archive; machines ignore.
14+
#
15+
# Base: ../_base.ncl provides pedigree_schema, run_defaults, probe_schema.
16+
# See: docs/CONTRACTILE-SPEC.adoc
17+
18+
let base = import "../_base.ncl" in
19+
20+
{
21+
pedigree = base.pedigree_schema & {
22+
contractile_verb = "bust",
23+
semantics = "error handling + failure recovery",
24+
security = {
25+
leash = 'Kennel,
26+
trust_level = "controlled failure injection; scoped to system-under-test",
27+
allow_network = false,
28+
allow_filesystem_write = true, # drills may write transient state (tmp dirs, test DBs)
29+
allow_subprocess = true,
30+
injection_scope = "system-under-test-only",
31+
},
32+
metadata = {
33+
name = "bust-runner",
34+
version = "1.0.0",
35+
description = "Exercises declared failure modes and verifies recovery paths. Hard-gates on any failure mode without working recovery.",
36+
paired_xfile = "Bustfile.a2ml",
37+
author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>",
38+
},
39+
},
40+
41+
schema = {
42+
failure_modes
43+
| Array {
44+
id | String,
45+
description | String,
46+
class | [| 'network, 'disk_full, 'oom, 'timeout, 'partial_write, 'panic, 'crash, 'rollback, 'concurrency |],
47+
# TODO: migrate to base.probe_schema (structured probe) when CLI supports it
48+
injection_probe | String, # command that deterministically causes this failure
49+
# TODO: migrate to base.probe_schema (structured probe) when CLI supports it
50+
recovery_probe | String, # command that verifies recovery (exit 0 = recovered)
51+
expected_recovery_time_seconds | Number | default = 30,
52+
# status_core values: 'declared, 'verified, 'failing; bust adds 'drilled
53+
status | [| 'declared, 'drilled, 'verified, 'failing |] | default = 'declared,
54+
notes | String | optional,
55+
},
56+
},
57+
58+
# Runner behaviour — inherits from base.run_defaults.
59+
# bust adds record_recovery_times for performance tier feeding.
60+
run = base.run_defaults & {
61+
on_any_fail = "exit-nonzero", # missing or broken recovery blocks merge
62+
report_format = "a2ml",
63+
emit_summary = true,
64+
record_recovery_times = true, # feeds the performance tier
65+
},
66+
}

BOJ_LOGIC.adoc

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Bundle of Joy (BoJ) Server: Logic and Architecture
2+
3+
## Overview
4+
5+
The Bundle of Joy (BoJ) server is a unified MCP (Model Context Protocol) server designed to provide a comprehensive suite of tools and capabilities for developers, researchers, and organizations. It is built on a modular architecture that emphasizes flexibility, scalability, and extensibility.
6+
7+
## Core Logic
8+
9+
### Modular Design
10+
11+
The BoJ server is structured around the concept of "cartridges," which are pluggable modules that provide specific functionalities. Each cartridge is isolated and can be loaded or unloaded dynamically without affecting the rest of the system. This design allows for:
12+
13+
- **Isolation**: Each cartridge operates independently, reducing the risk of conflicts or cascading failures.
14+
- **Extensibility**: New functionalities can be added by creating new cartridges without modifying the core system.
15+
- **Maintainability**: Cartridges can be updated or replaced individually, simplifying maintenance and upgrades.
16+
17+
### Three-Layer Architecture
18+
19+
The BoJ server employs a three-layer architecture to ensure robustness and flexibility:
20+
21+
1. **ABI Layer (Idris2)**: This layer defines the abstract interfaces and types used by the system. It ensures type safety and provides a clear contract for the rest of the system.
22+
2. **FFI Layer (Zig)**: This layer implements the foreign function interface, providing high-performance bindings between the ABI layer and the adapter layer.
23+
3. **Adapter Layer (Zig)**: This layer contains the actual implementations of the tools and functionalities provided by the cartridges.
24+
25+
### Federation and Communication
26+
27+
The BoJ server supports federation through the Umoja protocol, which enables multiple BoJ instances to communicate and collaborate. Key features of the federation include:
28+
29+
- **QUIC Transport**: Encrypted, low-latency communication between nodes.
30+
- **UDP Fallback**: Ensures compatibility with networks that do not support QUIC.
31+
- **Gossip Protocol**: Automatic peer discovery and network formation.
32+
- **Hash Attestation**: Cryptographic verification of nodes to ensure trust and security.
33+
34+
### Knowledge Graph
35+
36+
The BoJ server includes a knowledge graph that stores and manages contextual data about entities such as people, projects, organizations, and tools. The knowledge graph supports:
37+
38+
- **Entities**: Representations of real-world objects with attributes and metadata.
39+
- **Observations**: Factual statements about entities, with temporal validity and confidence scores.
40+
- **Relations**: Typed relationships between entities, with weights indicating the strength of the relationship.
41+
42+
### Session Management
43+
44+
The BoJ server provides robust session management capabilities, allowing users to:
45+
46+
- **Persistent Sessions**: Maintain session state across restarts.
47+
- **Context Loading**: Automatically load context from previous sessions.
48+
- **Multi-Project Isolation**: Isolate sessions by project to avoid conflicts and ensure data integrity.
49+
50+
### Decision Tracking
51+
52+
The BoJ server includes a structured decision tracking system that records:
53+
54+
- **Title**: A brief description of the decision.
55+
- **Decision**: The choice made.
56+
- **Reasoning**: The rationale behind the decision.
57+
- **Alternatives**: Other options that were considered.
58+
- **Confidence**: A score indicating the certainty of the decision.
59+
60+
### Learning System
61+
62+
The BoJ server features a learning system that captures and organizes knowledge and insights. Learnings are categorized into types such as:
63+
64+
- **Pattern**: Recurring successful approaches.
65+
- **Mistake**: Lessons learned from failures.
66+
- **Insight**: Strategic realizations.
67+
- **Research**: External knowledge and findings.
68+
- **Architecture**: System design decisions.
69+
70+
## Technical Implementation
71+
72+
### Language and Tools
73+
74+
The BoJ server is primarily implemented in Zig, with additional components in Idris2 for the ABI layer and TypeScript for the MCP bridge. Key tools and technologies include:
75+
76+
- **Zig**: Used for the FFI and adapter layers due to its performance, memory safety, and interoperability.
77+
- **Idris2**: Used for the ABI layer to ensure type safety and correctness.
78+
- **TypeScript**: Used for the MCP bridge to facilitate communication with MCP clients.
79+
- **SQLite**: Used for local storage of session data, learnings, decisions, and the knowledge graph.
80+
- **Neo4j**: Used for advanced graph queries and analysis in the knowledge graph.
81+
82+
### Build System
83+
84+
The BoJ server uses the Zig build system for compiling and linking the various components. The build system is configured to:
85+
86+
- Compile the Idris2 ABI layer.
87+
- Build the Zig FFI and adapter layers.
88+
- Link the components into a single executable.
89+
- Manage dependencies and external libraries.
90+
91+
### Testing
92+
93+
The BoJ server includes a comprehensive test suite that covers:
94+
95+
- Unit tests for individual components.
96+
- Integration tests for cartridge interactions.
97+
- End-to-end tests for the entire system.
98+
- Performance benchmarks to ensure scalability and efficiency.
99+
100+
### Documentation
101+
102+
The BoJ server is thoroughly documented, with:
103+
104+
- Asciidoc files for user and developer documentation.
105+
- JSON Schema definitions for cartridge metadata and tool interfaces.
106+
- API documentation for the REST, GraphQL, and gRPC endpoints.
107+
- Examples and tutorials for common use cases.
108+
109+
## Use Cases
110+
111+
### Software Development
112+
113+
The BoJ server can be used to:
114+
115+
- Manage software projects and repositories.
116+
- Automate build, test, and deployment processes.
117+
- Track issues, pull requests, and code reviews.
118+
- Analyze code quality and detect code smells.
119+
120+
### Research and Analysis
121+
122+
The BoJ server can be used to:
123+
124+
- Conduct academic and market research.
125+
- Analyze datasets and trends.
126+
- Store and retrieve research findings and insights.
127+
- Collaborate with other researchers and organizations.
128+
129+
### Communication and Notification
130+
131+
The BoJ server can be used to:
132+
133+
- Send notifications via email, SMS, Slack, Discord, and Telegram.
134+
- Broadcast messages to multiple channels.
135+
- Manage communication workflows and alerts.
136+
137+
### Cloud and Infrastructure Management
138+
139+
The BoJ server can be used to:
140+
141+
- Deploy and manage cloud resources on AWS, GCP, Azure, Cloudflare, and Vercel.
142+
- Monitor and observe infrastructure metrics and logs.
143+
- Automate infrastructure as code (IaC) processes.
144+
145+
## Future Directions
146+
147+
The BoJ server is continuously evolving, with planned enhancements including:
148+
149+
- **AI Agents**: Autonomous agent orchestration and management.
150+
- **Workflow Engine**: Visual workflow builder for complex processes.
151+
- **Marketplace**: Cartridge discovery and installation platform.
152+
- **Analytics**: Usage metrics and insights for performance optimization.
153+
- **WASM Cartridges**: WebAssembly-based cartridges for enhanced portability and security.
154+
- **Blockchain**: Smart contract integration for decentralized applications.
155+
- **Quantum**: Quantum computing interfaces for advanced research and analysis.
156+
157+
## Conclusion
158+
159+
The Bundle of Joy (BoJ) server is a powerful, modular, and extensible platform designed to meet the diverse needs of developers, researchers, and organizations. Its robust architecture, comprehensive feature set, and commitment to continuous improvement make it a valuable tool for a wide range of applications.

0 commit comments

Comments
 (0)