/ CLAUDE.md
CLAUDE.md
 1  # Bebop-V-FFI
 2  
 3  > FFI bindings between Bebop binary serialization and V language for IIoT edge computing
 4  
 5  ## Project Context
 6  
 7  This library bridges [Bebop](https://bebop.sh) (high-performance binary serialization) with [V](https://vlang.io) (systems programming language) for Industrial IoT applications. It's part of the [Kaldor IIoT](https://github.com/hyperpolymath/kaldor-iiot) ecosystem.
 8  
 9  ## Tech Stack
10  
11  - **V Language** - Primary implementation language
12  - **C** - FFI layer and Bebop runtime
13  - **Bebop** - Schema definition and wire format
14  - **Zig** - (Planned) Stable C ABI layer for next-gen version
15  
16  ## Key Commands
17  
18  ```bash
19  # Build
20  v build -prod src/
21  
22  # Test
23  v test tests/
24  
25  # Generate bindings from schema
26  bebop --generator v --input schemas/*.bop --output src/
27  
28  # Validate RSR compliance
29  just validate-rsr
30  ```
31  
32  ## Architecture
33  
34  ```
35  V Application → V Bindings → C FFI → Bebop Runtime → Wire Format
36  ```
37  
38  Future (v2.0):
39  ```
40  V Application → Zig FFI (C ABI) → Rust Core → Wire Format
41  ```
42  
43  ## Related Projects
44  
45  - [kaldor-iiot](https://github.com/hyperpolymath/kaldor-iiot) - Parent IIoT platform
46  - [bunsenite](https://github.com/hyperpolymath/bunsenite) - Similar FFI architecture (Nickel parser)
47  
48  ## Coding Standards
49  
50  - Use descriptive variable names
51  - All public functions must have doc comments
52  - Zero `unsafe` blocks in public API
53  - Bounds checking on all buffer operations
54  
55  ## File Annotations
56  
57  All source files must include:
58  ```
59  // SPDX-License-Identifier: AGPL-3.0-or-later
60  // SPDX-FileCopyrightText: 2025 Hyperpolymath Contributors
61  ```
62  
63  ## RSR Compliance
64  
65  - **Tier**: Bronze
66  - **Prohibited**: Python, TypeScript/JavaScript (use ReScript)
67  - **Required**: justfile, .well-known/, comprehensive docs