feat(runtime): preserve structured Play v2 diagnostics
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good

Confirm loaded PBX identity, emit bounded fault envelopes and retain the primary crash report through teardown. Start background IO before audio initialization and update native protocol and process fixtures.
This commit is contained in:
2026-11-26 08:55:32 +00:00
parent f480b755ed
commit 7fd6fef1c8
19 changed files with 431 additions and 39 deletions
@@ -22,17 +22,35 @@ fn rgba_fixture_pins_channel_order_and_metadata() {
#[test]
fn bootstrap_rejects_wrong_roles_lengths_and_ports() {
let mut p = vec![0; 53];
let mut p = vec![0; 85];
p[48..50].copy_from_slice(&1234u16.to_le_bytes());
p[50..52].copy_from_slice(&1235u16.to_le_bytes());
p[52] = 1;
p[53..85].fill(0xab);
let mut bytes = Vec::new();
Writer::new(&mut bytes).send(BOOTSTRAP, 0, &p).unwrap();
let boot = Bootstrap::read(bytes.as_slice()).unwrap();
assert!(boot.disposable);
assert_eq!(boot.program_sha256, [0xab; 32]);
assert_eq!(boot.hello(1).len(), 49);
p[50..52].copy_from_slice(&1234u16.to_le_bytes());
bytes.clear();
Writer::new(&mut bytes).send(BOOTSTRAP, 0, &p).unwrap();
assert!(Bootstrap::read(bytes.as_slice()).is_err());
}
#[test]
fn v2_fault_fixture_preserves_unsigned_pc_span_and_unicode() {
let hex = include_str!("../../../../devtools/studio-protocol/fixtures/fault.hex");
let bytes: Vec<_> =
hex.split_whitespace().map(|s| u8::from_str_radix(s, 16).unwrap()).collect();
let m = Reader::new(bytes.as_slice()).receive_control().unwrap();
assert_eq!(m.header.kind, FAULT);
let value: serde_json::Value = serde_json::from_slice(&m.payload).unwrap();
assert_eq!(value["fault"]["pc"], u32::MAX);
assert_eq!(value["fault"]["trap"]["span"]["file_id"], 7);
assert!(value["fault"]["summary"].as_str().unwrap().contains("ação"));
let mut old: [u8; 32] = bytes[..32].try_into().unwrap();
old[4] = 1;
assert!(Header::decode(&old).unwrap_err().to_string().contains("required 2.0"));
}