Skip to content

Commit 1d61435

Browse files
authored
Merge pull request #109 from AdaWorldAPI/claude/cognitive-layer-stack-77KUH
Add binary wire protocol (CogPacket) for inter-runtime communication
2 parents 9476783 + 559ff27 commit 1d61435

5 files changed

Lines changed: 1071 additions & 3 deletions

File tree

crates/ladybug-contract/src/legacy.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ mod tests {
446446
confidence: 1.0,
447447
epoch: 12345,
448448
version: None,
449+
dominant_layer: None,
450+
layer_activations: None,
451+
nars_frequency: None,
452+
calibration_error: None,
449453
},
450454
};
451455
let json = serde_json::to_string(&env).unwrap();
@@ -475,6 +479,10 @@ mod tests {
475479
confidence: 1.0,
476480
epoch: 0,
477481
version: None,
482+
dominant_layer: None,
483+
layer_activations: None,
484+
nars_frequency: None,
485+
calibration_error: None,
478486
},
479487
};
480488
let req = V1StepDelegationRequest { step, input };

crates/ladybug-contract/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
//! | [`layers`] | 7-layer consciousness marker constants |
2828
//! | [`temporal`] | `Version`, `VersionDiff`, temporal error types |
2929
//! | [`delegation`] | `DelegationRequest` / `DelegationResponse` |
30-
//! | [`legacy`] | V1 JSON backward compatibility (existing wire format) |
30+
//! | [`wire`] | Binary wire protocol: `CogPacket` (8+8/4096 command packets, no JSON) |
31+
//! | [`legacy`] | V1 JSON backward compatibility (external wire format only) |
3132
3233
pub mod container;
3334
pub mod geometry;
@@ -45,6 +46,7 @@ pub mod temporal;
4546

4647
pub mod delegation;
4748
pub mod legacy;
49+
pub mod wire;
4850

4951
// === Convenience re-exports ===
5052
pub use container::{Container, CONTAINER_BITS, CONTAINER_BYTES, CONTAINER_WORDS};
@@ -58,3 +60,4 @@ pub use legacy::{
5860
V1DataEnvelope, V1EnvelopeMetadata, V1LadybugEnvelope, V1LadybugMetadata,
5961
V1StepDelegationRequest, V1StepDelegationResponse, V1StepStatus, V1UnifiedStep,
6062
};
63+
pub use wire::{CogPacket, WireError, COG_MAGIC, WIRE_VERSION};

crates/ladybug-contract/src/nars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::fmt;
99
///
1010
/// - **frequency** (f): Proportion of positive evidence (0.0 - 1.0)
1111
/// - **confidence** (c): Reliability of the frequency (0.0 - 1.0)
12-
#[derive(Clone, Copy, PartialEq)]
12+
#[derive(Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
1313
pub struct TruthValue {
1414
pub frequency: f32,
1515
pub confidence: f32,

0 commit comments

Comments
 (0)