Wire Format
Wire Format Examples
Section titled “Wire Format Examples”Hexdump examples for common MFBP operations. All multi-byte values are little-endian.
Frame Structure
Section titled “Frame Structure”| Field | Size | Description |
|---|---|---|
| Length | 4 bytes | Total payload size (u32 LE) |
| OpCode | 1 byte | Command identifier |
| Payload | Variable | Command-specific data |
LINEAGE.CREATE
Section titled “LINEAGE.CREATE”Create lineage "fire" with energy 0.9:
Request:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 0B 00 00 00 | Length: 11 |
| 0x04 | 10 | OpCode: LINEAGE.CREATE |
| 0x05 | 04 00 | key_len: 4 |
| 0x07 | 66 69 72 65 | key: “fire” |
| 0x0B | 66 66 66 3F | energy: 0.9 (f32 LE) |
Response:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 01 00 00 00 | Length: 1 |
| 0x04 | F0 | OpCode: OK |
LINEAGE.STIMULATE
Section titled “LINEAGE.STIMULATE”Stimulate "fire" with delta 0.5:
Request:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 0B 00 00 00 | Length: 11 |
| 0x04 | 12 | OpCode: LINEAGE.STIMULATE |
| 0x05 | 04 00 | key_len: 4 |
| 0x07 | 66 69 72 65 | key: “fire” |
| 0x0B | 00 00 00 3F | delta: 0.5 (f32 LE) |
Response:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 01 00 00 00 | Length: 1 |
| 0x04 | F0 | OpCode: OK |
BOND.CONNECT
Section titled “BOND.CONNECT”Create synergy bond from "fire" → "heat" with strength 0.8:
Request:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 11 00 00 00 | Length: 17 |
| 0x04 | 20 | OpCode: BOND.CONNECT |
| 0x05 | 04 00 | src_len: 4 |
| 0x07 | 66 69 72 65 | src: “fire” |
| 0x0B | 04 00 | tgt_len: 4 |
| 0x0D | 68 65 61 74 | tgt: “heat” |
| 0x11 | CD CC 4C 3F | strength: 0.8 (f32 LE) |
| 0x15 | 01 | polarity: +1 (synergy) |
Response:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 01 00 00 00 | Length: 1 |
| 0x04 | F0 | OpCode: OK |
SYS.STATS
Section titled “SYS.STATS”Get database statistics:
Request:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 01 00 00 00 | Length: 1 |
| 0x04 | 41 | OpCode: SYS.STATS |
Response:
| Offset | Bytes | Description |
|---|---|---|
| 0x00 | 0D 00 00 00 | Length: 13 |
| 0x04 | F0 | OpCode: OK |
| 0x05 | 05 00 00 00 | lineage_count: 5 |
| 0x09 | 03 00 00 00 | bond_count: 3 |
| 0x0D | 66 66 66 3F | mood: 0.9 (f32 LE) |
Type Reference
Section titled “Type Reference”| Type | Size | Encoding |
|---|---|---|
| u16 | 2 bytes | LE |
| u32 | 4 bytes | LE |
| u64 | 8 bytes | LE |
| f32 | 4 bytes | IEEE 754 LE |
| i8 | 1 byte | Signed |