- infrastructure/proxmox/: CT provisioning configs - infrastructure/fabric/gitops/: GitOps layer - fleet.yaml: GPU inventory (Dell GTX 1050 vfio-pci passthrough) - firmware/: ESP32 firmware tree (67 files, 6.9MB) - realms/savearth/: Savearth team realm with heteronyms - lab-gateway: ESP client + manager - CI: Forgejo + GitHub Actions workflows Co-authored-by: Álvaro de Campos <campos@portugalfuturista.org>
56 lines
1.7 KiB
Rust
56 lines
1.7 KiB
Rust
// Host test for the Rust telemetry library.
|
|
// Validates JSON wire format + consent filtering.
|
|
|
|
use aurelio_telemetry::*;
|
|
|
|
fn main() {
|
|
use std_impls::{HostPlatform, StdoutTransport};
|
|
|
|
let mut platform = HostPlatform::new();
|
|
let mut transport = StdoutTransport;
|
|
|
|
let mut tc = TelemetryClient::new("esp32-shower-001");
|
|
tc.consent.enable(Category::Environment);
|
|
tc.consent.enable(Category::SessionMeta);
|
|
tc.consent.enable(Category::ToolCalls);
|
|
tc.consent.enable(Category::AgentMetadata);
|
|
tc.consent.enable(Category::ErrorTraces);
|
|
|
|
tc.begin_session("test-session-001");
|
|
|
|
println!("\n── Environment ──");
|
|
assert!(tc.send_environment(&mut platform, &mut transport));
|
|
|
|
println!("\n── Session Meta ──");
|
|
assert!(tc.send_session_meta(&platform, &mut transport));
|
|
|
|
println!("\n── Tool Call ──");
|
|
assert!(tc.send_tool_call(
|
|
&platform,
|
|
&mut transport,
|
|
"read_sensor",
|
|
r#"{"sensor":"flow_rate","channel":0}"#,
|
|
r#"{"value":4.2,"unit":"L/min"}"#
|
|
));
|
|
|
|
println!("\n── Agent Metadata ──");
|
|
assert!(tc.send_agent_metadata(&platform, &mut transport, "edge-tflite", "device-agent"));
|
|
|
|
println!("\n── Error Trace ──");
|
|
assert!(tc.send_error_trace(
|
|
&platform,
|
|
&mut transport,
|
|
"Guru Meditation Error: Core 0 panic'ed (LoadProhibited)."
|
|
));
|
|
|
|
// Test consent filtering
|
|
tc.consent.disable(Category::ToolCalls);
|
|
let result = tc.send_tool_call(&platform, &mut transport, "blocked", "", "");
|
|
assert!(
|
|
!result,
|
|
"tool_calls should be blocked when consent disabled"
|
|
);
|
|
println!("\n── Consent filter: PASS (tool_calls blocked) ──");
|
|
|
|
println!("\nAll Rust tests passed.");
|
|
}
|