Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 573ffea956 | |||
| 3e47e27d49 | |||
|
|
b0df17dddd | ||
|
|
e534ef4937 | ||
|
|
344de9f9a1 | ||
|
|
1d0ea0b112 | ||
|
|
2742b4ddcf | ||
|
|
139ca7397f | ||
|
|
b2014284d1 | ||
|
|
e27de13efd | ||
|
|
7b8b37a2fd | ||
|
|
e9580009ea | ||
|
|
bd69598503 | ||
|
|
45e2904943 | ||
|
|
cbea798a27 | ||
|
|
772b2d00d3 | ||
|
|
ffc723c49f | ||
|
|
96b64cba97 | ||
|
|
89ae74ae0f | ||
|
|
95b84a8102 | ||
|
|
f4f1fcdad7 | ||
|
|
f4f1f8592f | ||
|
|
8f59bddf47 | ||
|
|
ed02890c12 | ||
|
|
6a628ee551 | ||
|
|
3a12d14e2c | ||
|
|
d564543b70 | ||
|
|
70f838dfb9 | ||
|
|
e66c2565fb | ||
|
|
8d869ca8df | ||
|
|
83b3947a8f | ||
|
|
fe33ce7f10 | ||
|
|
c3520d10a1 | ||
|
|
b607592be2 | ||
|
|
88f9ed7ccd | ||
|
|
66e8642f59 | ||
|
|
36d6a79a2a | ||
|
|
4af6c8fac4 | ||
|
|
eb332b0d2e | ||
|
|
a189363c23 | ||
|
|
f2a5db9eec | ||
|
|
2c120c96d7 | ||
|
|
e70db69d76 | ||
|
|
f6fea00413 | ||
|
|
eccd6e0b27 | ||
|
|
b5976d063d | ||
|
|
731e0ed69e | ||
|
|
f2f6590660 | ||
|
|
e184f48adf | ||
|
|
6d98624792 | ||
|
|
254d63dd54 |
28 changed files with 9843 additions and 2777 deletions
38
Cargo.lock
generated
38
Cargo.lock
generated
|
|
@ -479,6 +479,19 @@ version = "2.8.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||
|
||||
[[package]]
|
||||
name = "muninn-contracts"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cultcache-rs",
|
||||
"cultmesh-rs",
|
||||
"cultnet-rs",
|
||||
"rmp-serde",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "muninn-daemon"
|
||||
version = "0.1.0"
|
||||
|
|
@ -488,6 +501,7 @@ dependencies = [
|
|||
"cultmesh-rs",
|
||||
"cultnet-rs",
|
||||
"libc",
|
||||
"muninn-contracts",
|
||||
"muninn-move-tracker",
|
||||
"muninn-psmoveapi-tracker",
|
||||
"odin-core",
|
||||
|
|
@ -791,6 +805,21 @@ version = "0.4.12"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||
|
||||
[[package]]
|
||||
name = "sleipnir-daemon"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cultcache-rs",
|
||||
"cultmesh-rs",
|
||||
"cultnet-rs",
|
||||
"muninn-contracts",
|
||||
"odin-core",
|
||||
"rmp-serde",
|
||||
"serde_json",
|
||||
"vigem-client",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.10"
|
||||
|
|
@ -878,6 +907,15 @@ version = "0.9.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "vigem-client"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b857e6f99efe1e1eb1e4dfb035de8ae7ec8ec56bd1928edcbd7c6e4427634d52"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.1+wasi-snapshot-preview1"
|
||||
|
|
|
|||
10
Cargo.toml
10
Cargo.toml
|
|
@ -1,8 +1,10 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"crates/muninn-contracts",
|
||||
"crates/muninn-daemon",
|
||||
"crates/muninn-move-tracker",
|
||||
"crates/muninn-psmoveapi-tracker",
|
||||
"crates/sleipnir-daemon",
|
||||
]
|
||||
resolver = "3"
|
||||
|
||||
|
|
@ -10,3 +12,11 @@ resolver = "3"
|
|||
edition = "2024"
|
||||
license = "MIT"
|
||||
publish = false
|
||||
|
||||
# One pin per shared upstream. Muninn and Sleipnir resolve the same CultLib and
|
||||
# odin-core by construction; a bump is one edit here.
|
||||
[workspace.dependencies]
|
||||
cultcache-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultcache-rs" }
|
||||
cultmesh-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultmesh-rs" }
|
||||
cultnet-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultnet-rs" }
|
||||
odin-core = { git = "https://github.com/GameCult/Odin.git", rev = "3e96c6c85ca8b89b1bc7b01c1b7744f43111be99" }
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -1,5 +1,14 @@
|
|||
# Muninn
|
||||
|
||||
> **Deprecation notice (Meta, 2026-11-06).** Muninn's *streaming* role (screen and audio
|
||||
> capture, the media sender, and the OBS media receiver at
|
||||
> [github.com/GameCult/Ratatoskr](https://github.com/GameCult/Ratatoskr), not the forge chat
|
||||
> client of the same name) is superseded in the streaming space. Do not build new work on it.
|
||||
> Nothing is deleted yet; what depends on it and what looks removable is in
|
||||
> [docs/streaming-deprecation.md](docs/streaming-deprecation.md). The non-streaming roles
|
||||
> (sensors, PS Move, input for Sleipnir) are not covered by this notice.
|
||||
|
||||
|
||||
**Local capture broker for the GameCult swarm.**
|
||||
|
||||
Muninn resolves what data streams a host can offer, advertises them, and serves
|
||||
|
|
@ -11,6 +20,11 @@ Muninn running does not mean Muninn is broadcasting. Each feed it can reach is
|
|||
for input. A stream asks for screen and audio. Muninn does not decide what any of
|
||||
them are for.
|
||||
|
||||
**Naming note.** Muninn's docs say "Ratatoskr" for the OBS media receiver, which lives at
|
||||
[github.com/GameCult/Ratatoskr](https://github.com/GameCult/Ratatoskr) (forge mirror:
|
||||
[GameCult/Ratatoskr-receiver](https://eureka.gamecult.org/forge/GameCult/Ratatoskr-receiver)).
|
||||
The forge repo `GameCult/Ratatoskr` is an unrelated project, Void's Cinny-based chat client.
|
||||
|
||||
Extracted from [Odin](https://github.com/GameCult/Odin) with its full history.
|
||||
Muninn had lived as three crates inside the repository of the service that
|
||||
discovers it, with its document schemas owned by `odin-core` — an inversion of
|
||||
|
|
|
|||
21
crates/muninn-contracts/Cargo.toml
Normal file
21
crates/muninn-contracts/Cargo.toml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[package]
|
||||
name = "muninn-contracts"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "muninn_contracts"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
cultcache-rs = { workspace = true }
|
||||
cultmesh-rs = { workspace = true }
|
||||
cultnet-rs = { workspace = true }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
rmp-serde = "1.3"
|
||||
526
crates/muninn-contracts/src/lib.rs
Normal file
526
crates/muninn-contracts/src/lib.rs
Normal file
|
|
@ -0,0 +1,526 @@
|
|||
//! Muninn's typed state records: the wire and store contract that `muninn` and
|
||||
//! `sleipnir` share. Library only: no sockets, threads, devices or Odin.
|
||||
|
||||
mod records;
|
||||
|
||||
pub use records::*;
|
||||
|
||||
cultmesh_rs::cultmesh_documents!(MuninnRecords {
|
||||
MuninnTelemetrySurfaceRecord => MUNINN_TELEMETRY_SURFACE_SCHEMA,
|
||||
MuninnCaptureStreamRecord => MUNINN_CAPTURE_STREAM_SCHEMA,
|
||||
MuninnCaptureStreamCommandRecord => MUNINN_CAPTURE_STREAM_COMMAND_SCHEMA,
|
||||
MuninnObsStreamCatalogRecord => MUNINN_OBS_STREAM_CATALOG_SCHEMA,
|
||||
MuninnMoveMarkerCandidateRecord => MUNINN_MOVE_MARKER_CANDIDATE_SCHEMA,
|
||||
MuninnMoveControllerStateRecord => MUNINN_MOVE_CONTROLLER_STATE_SCHEMA,
|
||||
MuninnHidControllerStateRecord => MUNINN_HID_CONTROLLER_STATE_SCHEMA,
|
||||
MuninnMoveIdentityRecord => MUNINN_MOVE_IDENTITY_SCHEMA,
|
||||
MuninnMoveLightCommandRecord => MUNINN_MOVE_LIGHT_COMMAND_SCHEMA,
|
||||
MuninnMoveHueProgramRecord => MUNINN_MOVE_HUE_PROGRAM_SCHEMA,
|
||||
MuninnMoveTrackerHealthRecord => MUNINN_MOVE_TRACKER_HEALTH_SCHEMA,
|
||||
MuninnMoveEvidenceTransportHealthRecord => MUNINN_MOVE_EVIDENCE_TRANSPORT_HEALTH_SCHEMA,
|
||||
MuninnQuestAccessRecord => MUNINN_QUEST_ACCESS_SCHEMA,
|
||||
MuninnCommandBoundaryCompatRecord => MUNINN_COMMAND_BOUNDARY_SCHEMA,
|
||||
MuninnTransportProfileCompatRecord => MUNINN_TRANSPORT_PROFILE_SCHEMA,
|
||||
});
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use cultcache_rs::{CultCache, DatabaseEntry};
|
||||
use cultmesh_rs::CultMeshDocumentSet;
|
||||
use cultnet_rs::CultNetDocumentRegistry;
|
||||
|
||||
/// Every Muninn record: its type name, its schema id, the schema constant
|
||||
/// the document set binds it under, and its Rust name.
|
||||
fn contract() -> Vec<(&'static str, &'static str, &'static str, &'static str)> {
|
||||
macro_rules! row {
|
||||
($record:ty, $constant:expr) => {
|
||||
(
|
||||
<$record as DatabaseEntry>::TYPE,
|
||||
<$record as DatabaseEntry>::SCHEMA_NAME,
|
||||
$constant,
|
||||
stringify!($record),
|
||||
)
|
||||
};
|
||||
}
|
||||
vec![
|
||||
row!(MuninnTelemetrySurfaceRecord, MUNINN_TELEMETRY_SURFACE_SCHEMA),
|
||||
row!(MuninnCaptureStreamRecord, MUNINN_CAPTURE_STREAM_SCHEMA),
|
||||
row!(MuninnCaptureStreamCommandRecord, MUNINN_CAPTURE_STREAM_COMMAND_SCHEMA),
|
||||
row!(MuninnObsStreamCatalogRecord, MUNINN_OBS_STREAM_CATALOG_SCHEMA),
|
||||
row!(MuninnMoveMarkerCandidateRecord, MUNINN_MOVE_MARKER_CANDIDATE_SCHEMA),
|
||||
row!(MuninnMoveControllerStateRecord, MUNINN_MOVE_CONTROLLER_STATE_SCHEMA),
|
||||
row!(MuninnHidControllerStateRecord, MUNINN_HID_CONTROLLER_STATE_SCHEMA),
|
||||
row!(MuninnMoveIdentityRecord, MUNINN_MOVE_IDENTITY_SCHEMA),
|
||||
row!(MuninnMoveLightCommandRecord, MUNINN_MOVE_LIGHT_COMMAND_SCHEMA),
|
||||
row!(MuninnMoveHueProgramRecord, MUNINN_MOVE_HUE_PROGRAM_SCHEMA),
|
||||
row!(MuninnMoveTrackerHealthRecord, MUNINN_MOVE_TRACKER_HEALTH_SCHEMA),
|
||||
row!(
|
||||
MuninnMoveEvidenceTransportHealthRecord,
|
||||
MUNINN_MOVE_EVIDENCE_TRANSPORT_HEALTH_SCHEMA
|
||||
),
|
||||
row!(MuninnQuestAccessRecord, MUNINN_QUEST_ACCESS_SCHEMA),
|
||||
row!(MuninnCommandBoundaryCompatRecord, MUNINN_COMMAND_BOUNDARY_SCHEMA),
|
||||
row!(MuninnTransportProfileCompatRecord, MUNINN_TRANSPORT_PROFILE_SCHEMA),
|
||||
]
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn record_names_are_the_published_schema_ids() {
|
||||
let expected = [
|
||||
("muninn.telemetry_surface", "muninn.telemetry_surface.v1"),
|
||||
("muninn.capture_stream", "muninn.capture_stream.v1"),
|
||||
("muninn.capture_stream_command", "muninn.capture_stream_command.v1"),
|
||||
("muninn.obs_stream_catalog", "muninn.obs_stream_catalog.v1"),
|
||||
("muninn.move_marker_candidate", "muninn.move_marker_candidate.v1"),
|
||||
("muninn.move_controller_state", "muninn.move_controller_state.v1"),
|
||||
("muninn.hid_controller_state", "muninn.hid_controller_state.v1"),
|
||||
("muninn.move_identity", "muninn.move_identity.v1"),
|
||||
("muninn.move_light_command", "muninn.move_light_command.v1"),
|
||||
("muninn.move_hue_program", "muninn.move_hue_program.v1"),
|
||||
("muninn.move_tracker_health", "muninn.move_tracker_health.v1"),
|
||||
(
|
||||
"muninn.move_evidence_transport_health",
|
||||
"muninn.move_evidence_transport_health.v1",
|
||||
),
|
||||
("muninn.quest_access", "muninn.quest_access.v1"),
|
||||
("muninn.command_boundary", "muninn.command_boundary.v1"),
|
||||
("muninn.transport_profile", "muninn.transport_profile.v1"),
|
||||
];
|
||||
let actual: Vec<_> = contract()
|
||||
.into_iter()
|
||||
.map(|(record_type, schema, constant, _)| {
|
||||
assert_eq!(schema, constant, "schema constant and derive disagree");
|
||||
(record_type, schema)
|
||||
})
|
||||
.collect();
|
||||
assert_eq!(actual, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn document_set_binds_every_record_under_its_schema() {
|
||||
let mut cache = CultCache::new();
|
||||
MuninnRecords.register_cache(&mut cache).unwrap();
|
||||
let mut registry = CultNetDocumentRegistry::new();
|
||||
MuninnRecords.register_documents(&mut registry).unwrap();
|
||||
|
||||
let rows = contract();
|
||||
let mut registered = cache.registered_entry_types();
|
||||
registered.sort();
|
||||
let mut expected: Vec<String> = rows.iter().map(|row| row.0.to_string()).collect();
|
||||
expected.sort();
|
||||
assert_eq!(registered, expected);
|
||||
for (record_type, schema, _, record) in rows {
|
||||
let binding = registry
|
||||
.binding_by_schema_id(schema)
|
||||
.unwrap_or_else(|| panic!("{record} is not bound under {schema}"));
|
||||
assert_eq!(binding.document_type, record_type, "{record}");
|
||||
}
|
||||
}
|
||||
|
||||
/// One wire pin per record. `bytes` is the record's positional MessagePack
|
||||
/// array, encoded from a sample whose every field holds a distinct,
|
||||
/// non-default value (Options: one `None`, one `Some`). `first_default` is
|
||||
/// the key of the first defaulted tail field; records without one carry
|
||||
/// `None`.
|
||||
struct Pin {
|
||||
record: &'static str,
|
||||
bytes: Vec<u8>,
|
||||
first_default: Option<usize>,
|
||||
golden: &'static str,
|
||||
/// Decode a payload as this record and encode it again.
|
||||
reencode: fn(&[u8]) -> Result<Vec<u8>, String>,
|
||||
}
|
||||
|
||||
fn pin<T>(
|
||||
record: &'static str,
|
||||
sample: T,
|
||||
first_default: Option<usize>,
|
||||
golden: &'static str,
|
||||
) -> Pin
|
||||
where
|
||||
T: serde::Serialize + serde::de::DeserializeOwned,
|
||||
{
|
||||
Pin {
|
||||
record,
|
||||
bytes: rmp_serde::to_vec(&sample).unwrap(),
|
||||
first_default,
|
||||
golden,
|
||||
reencode: |bytes| {
|
||||
let decoded: T = rmp_serde::from_slice(bytes).map_err(|error| error.to_string())?;
|
||||
rmp_serde::to_vec(&decoded).map_err(|error| error.to_string())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn text(value: &str) -> String {
|
||||
value.to_string()
|
||||
}
|
||||
|
||||
fn texts(values: &[&str]) -> Vec<String> {
|
||||
values.iter().map(|value| value.to_string()).collect()
|
||||
}
|
||||
|
||||
fn pins() -> Vec<Pin> {
|
||||
vec![
|
||||
pin(
|
||||
"MuninnTelemetrySurfaceRecord",
|
||||
MuninnTelemetrySurfaceRecord {
|
||||
surface_id: text("surface"),
|
||||
host_id: text("host"),
|
||||
state: text("live"),
|
||||
available_sources: texts(&["src"]),
|
||||
stream_affordances: texts(&["aff"]),
|
||||
active_streams: texts(&["act"]),
|
||||
activation_authority: text("auth"),
|
||||
detail: text("detail"),
|
||||
updated_at: text("t"),
|
||||
primary_stream_id: text("psid"),
|
||||
primary_stream_label: text("plabel"),
|
||||
command_rudp_target: text("cmd"),
|
||||
media_target_host: text("mth"),
|
||||
media_port: 4001,
|
||||
media_packet_bytes: 1200,
|
||||
rudp_video_bitrate_kbps: 8000,
|
||||
rudp_latency_budget_ms: 40,
|
||||
video_source_ids: texts(&["vid"]),
|
||||
video_source_labels: texts(&["vlab"]),
|
||||
audio_source_ids: texts(&["aid"]),
|
||||
audio_source_labels: texts(&["alab"]),
|
||||
},
|
||||
Some(9),
|
||||
"dc0015a773757266616365a4686f7374a46c69766591a373726391a361666691a3616374a461757468a664657461696ca174a470736964a6706c6162656ca3636d64a36d7468cd0fa1cd04b0cd1f402891a376696491a4766c616291a361696491a4616c6162",
|
||||
),
|
||||
pin(
|
||||
"MuninnCaptureStreamRecord",
|
||||
MuninnCaptureStreamRecord {
|
||||
stream_id: text("stream"),
|
||||
host_id: text("host"),
|
||||
state: text("live"),
|
||||
video_source: text("vsrc"),
|
||||
audio_source: text("asrc"),
|
||||
transport: text("rudp"),
|
||||
targets: texts(&["tgt"]),
|
||||
command_witness: text("wit"),
|
||||
supervisor_pid: None,
|
||||
mux_pid: Some(77),
|
||||
restart_count: 3,
|
||||
detail: text("detail"),
|
||||
updated_at: text("t"),
|
||||
},
|
||||
None,
|
||||
"9da673747265616da4686f7374a46c697665a476737263a461737263a47275647091a3746774a3776974c04d03a664657461696ca174",
|
||||
),
|
||||
pin(
|
||||
"MuninnCaptureStreamCommandRecord",
|
||||
MuninnCaptureStreamCommandRecord {
|
||||
command_id: text("cmd"),
|
||||
host_id: text("host"),
|
||||
stream_id: text("stream"),
|
||||
state: text("live"),
|
||||
action: text("start"),
|
||||
target_host: text("tgt"),
|
||||
port: 4001,
|
||||
obs_target_host: Some(text("obs")),
|
||||
obs_port: 4002,
|
||||
media_transport: text("rudp"),
|
||||
media_packet_bytes: 1200,
|
||||
requested_by: text("who"),
|
||||
detail: text("detail"),
|
||||
updated_at: text("t"),
|
||||
rudp_video_bitrate_kbps: 8000,
|
||||
rudp_latency_budget_ms: 40,
|
||||
video_source_id: text("vid"),
|
||||
audio_source_id: text("aid"),
|
||||
},
|
||||
Some(14),
|
||||
"dc0012a3636d64a4686f7374a673747265616da46c697665a57374617274a3746774cd0fa1a36f6273cd0fa2a472756470cd04b0a377686fa664657461696ca174cd1f4028a3766964a3616964",
|
||||
),
|
||||
pin(
|
||||
"MuninnObsStreamCatalogRecord",
|
||||
MuninnObsStreamCatalogRecord {
|
||||
catalog_id: text("catalog"),
|
||||
host_id: text("host"),
|
||||
stream_ids: texts(&["sid"]),
|
||||
labels: texts(&["lab"]),
|
||||
urls: texts(&["url"]),
|
||||
states: texts(&["st"]),
|
||||
updated_at: text("t"),
|
||||
command_rudp_target: text("cmd"),
|
||||
media_target_host: text("mth"),
|
||||
media_port: 4001,
|
||||
media_packet_bytes: 1200,
|
||||
rudp_video_bitrate_kbps: 8000,
|
||||
rudp_latency_budget_ms: 40,
|
||||
video_source_ids: texts(&["vid"]),
|
||||
video_source_labels: texts(&["vlab"]),
|
||||
audio_source_ids: texts(&["aid"]),
|
||||
audio_source_labels: texts(&["alab"]),
|
||||
},
|
||||
Some(7),
|
||||
"dc0011a7636174616c6f67a4686f737491a373696491a36c616291a375726c91a27374a174a3636d64a36d7468cd0fa1cd04b0cd1f402891a376696491a4766c616291a361696491a4616c6162",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveMarkerCandidateRecord",
|
||||
MuninnMoveMarkerCandidateRecord {
|
||||
stream_id: text("stream"),
|
||||
host_id: text("host"),
|
||||
camera_id: text("cam"),
|
||||
frame_sequence: 11,
|
||||
source_id_hash: 12,
|
||||
tile_x: 13,
|
||||
tile_y: 14,
|
||||
center_x_px: 1.5,
|
||||
center_y_px: 2.5,
|
||||
radius_px: 3.5,
|
||||
area_px: 15,
|
||||
mean_luma: 4.5,
|
||||
peak_luma: 16,
|
||||
score: 0.5,
|
||||
observed_at: text("t"),
|
||||
move_id: text("move"),
|
||||
},
|
||||
Some(15),
|
||||
"dc0010a673747265616da4686f7374a363616d0b0c0d0eca3fc00000ca40200000ca406000000fca4090000010ca3f000000a174a46d6f7665",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveControllerStateRecord",
|
||||
MuninnMoveControllerStateRecord {
|
||||
stream_id: text("stream"),
|
||||
host_id: text("host"),
|
||||
move_id: text("move"),
|
||||
sequence: 21,
|
||||
source_timestamp_ns: -22,
|
||||
accelerometer_xyz: vec![1.0, 2.0, 3.0],
|
||||
gyroscope_xyz: vec![4.0, 5.0, 6.0],
|
||||
magnetometer_xyz: vec![7.0, 8.0, 9.0],
|
||||
trigger_value: 0.25,
|
||||
buttons: texts(&["cross"]),
|
||||
battery01: 0.75,
|
||||
observed_at: text("t"),
|
||||
source_path: text("/dev/js0"),
|
||||
},
|
||||
Some(12),
|
||||
"9da673747265616da4686f7374a46d6f766515ea93ca3f800000ca40000000ca4040000093ca40800000ca40a00000ca40c0000093ca40e00000ca41000000ca41100000ca3e80000091a563726f7373ca3f400000a174a82f6465762f6a7330",
|
||||
),
|
||||
pin(
|
||||
"MuninnHidControllerStateRecord",
|
||||
MuninnHidControllerStateRecord {
|
||||
stream_id: text("muninn.raven.hid"),
|
||||
host_id: text("raven"),
|
||||
device_id: text("xbox-0"),
|
||||
device_kind: text("xinput"),
|
||||
sequence: 7,
|
||||
source_timestamp_ns: -3,
|
||||
axes: vec![0.5, -1.0],
|
||||
buttons: texts(&["a", "b"]),
|
||||
battery01: 1.0,
|
||||
observed_at: text("unix:100"),
|
||||
source_path: text("xinput://0"),
|
||||
},
|
||||
None,
|
||||
"9bb06d756e696e6e2e726176656e2e686964a5726176656ea678626f782d30a678696e70757407fd92ca3f000000cabf80000092a161a162ca3f800000a8756e69783a313030aa78696e7075743a2f2f30",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveIdentityRecord",
|
||||
MuninnMoveIdentityRecord {
|
||||
identity_id: text("identity"),
|
||||
host_id: text("host"),
|
||||
move_id: text("move"),
|
||||
source_path: text("path"),
|
||||
bluetooth_host_address: text("bt"),
|
||||
state: text("live"),
|
||||
detail: text("detail"),
|
||||
observed_at: text("t"),
|
||||
},
|
||||
None,
|
||||
"98a86964656e74697479a4686f7374a46d6f7665a470617468a26274a46c697665a664657461696ca174",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveLightCommandRecord",
|
||||
MuninnMoveLightCommandRecord {
|
||||
command_id: text("cmd"),
|
||||
host_id: text("host"),
|
||||
move_id: text("move"),
|
||||
hidraw_path: text("hidraw"),
|
||||
colors: texts(&["red"]),
|
||||
durations_ms: vec![100, 200],
|
||||
repeat_count: 5,
|
||||
authority: text("auth"),
|
||||
state: text("live"),
|
||||
detail: text("detail"),
|
||||
updated_at: text("t"),
|
||||
},
|
||||
None,
|
||||
"9ba3636d64a4686f7374a46d6f7665a668696472617791a37265649264ccc805a461757468a46c697665a664657461696ca174",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveHueProgramRecord",
|
||||
MuninnMoveHueProgramRecord {
|
||||
program_id: text("prog"),
|
||||
host_id: text("raven"),
|
||||
mode: text("cycle"),
|
||||
cycle_ms: 20,
|
||||
epoch_ns: -1,
|
||||
hold_at_ns: 0,
|
||||
requested_by: text("mimir"),
|
||||
updated_at: text("unix:1"),
|
||||
order_mode: text("ring"),
|
||||
transition_percent: 50,
|
||||
transition_percent_explicit: true,
|
||||
},
|
||||
Some(8),
|
||||
"9ba470726f67a5726176656ea56379636c6514ff00a56d696d6972a6756e69783a31a472696e6732c3",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveTrackerHealthRecord",
|
||||
MuninnMoveTrackerHealthRecord {
|
||||
health_id: text("health"),
|
||||
host_id: text("host"),
|
||||
camera_id: text("cam"),
|
||||
camera_index: -2,
|
||||
state: text("live"),
|
||||
camera_name: text("name"),
|
||||
camera_api: text("api"),
|
||||
width: 640,
|
||||
height: 480,
|
||||
exposure: 0.5,
|
||||
calibrated_controller_count: 2,
|
||||
update_count: 30,
|
||||
observation_count: 31,
|
||||
latest_observation_count: 32,
|
||||
last_observation_at: text("last"),
|
||||
detail: text("detail"),
|
||||
updated_at: text("t"),
|
||||
image_mean_rgb: vec![1, 2, 3],
|
||||
image_peak_rgb: vec![4, 5, 6],
|
||||
color_evidence_move_ids: texts(&["move"]),
|
||||
color_evidence_pixel_counts: vec![40],
|
||||
rejected_stale_count: 41,
|
||||
rejected_radius_count: 42,
|
||||
rejected_bounds_count: 43,
|
||||
rejected_continuity_count: 44,
|
||||
},
|
||||
Some(17),
|
||||
"dc0019a66865616c7468a4686f7374a363616dfea46c697665a46e616d65a3617069cd0280cd01e0ca3f000000021e1f20a46c617374a664657461696ca174930102039304050691a46d6f76659128292a2b2c",
|
||||
),
|
||||
pin(
|
||||
"MuninnMoveEvidenceTransportHealthRecord",
|
||||
MuninnMoveEvidenceTransportHealthRecord {
|
||||
health_id: text("health"),
|
||||
host_id: text("host"),
|
||||
stream_id: text("stream"),
|
||||
produced_frames: 50,
|
||||
local_ring_admissions: 51,
|
||||
remote_handoffs: 52,
|
||||
remote_sends: 53,
|
||||
updated_at: text("t"),
|
||||
},
|
||||
None,
|
||||
"98a66865616c7468a4686f7374a673747265616d32333435a174",
|
||||
),
|
||||
pin(
|
||||
"MuninnQuestAccessRecord",
|
||||
MuninnQuestAccessRecord {
|
||||
access_id: text("access"),
|
||||
host_id: text("host"),
|
||||
serial: text("serial"),
|
||||
connection_state: text("conn"),
|
||||
product: text("product"),
|
||||
model: text("model"),
|
||||
device: text("device"),
|
||||
transport_id: text("tid"),
|
||||
input_stream_id: text("input"),
|
||||
pose_stream_id: text("pose"),
|
||||
video_input_stream_id: text("video"),
|
||||
video_input_transport: text("vtransport"),
|
||||
state: text("live"),
|
||||
detail: text("detail"),
|
||||
observed_at: text("t"),
|
||||
},
|
||||
None,
|
||||
"9fa6616363657373a4686f7374a673657269616ca4636f6e6ea770726f64756374a56d6f64656ca6646576696365a3746964a5696e707574a4706f7365a5766964656faa767472616e73706f7274a46c697665a664657461696ca174",
|
||||
),
|
||||
pin(
|
||||
"MuninnCommandBoundaryCompatRecord",
|
||||
MuninnCommandBoundaryCompatRecord {
|
||||
value: serde_json::json!({ "daemon_id": "muninn" }),
|
||||
},
|
||||
None,
|
||||
"9181a96461656d6f6e5f6964a66d756e696e6e",
|
||||
),
|
||||
pin(
|
||||
"MuninnTransportProfileCompatRecord",
|
||||
MuninnTransportProfileCompatRecord {
|
||||
value: serde_json::json!({ "state": "live" }),
|
||||
},
|
||||
None,
|
||||
"9181a57374617465a46c697665",
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
/// Every record's bytes are exactly the pinned positional array: a swapped
|
||||
/// key, a changed type or a moved field changes them.
|
||||
#[test]
|
||||
fn every_record_encodes_to_its_pinned_positional_bytes() {
|
||||
let mut wrong = Vec::new();
|
||||
for pin in pins() {
|
||||
let actual = hex(&pin.bytes);
|
||||
if actual != pin.golden {
|
||||
wrong.push(format!("{}: {actual}", pin.record));
|
||||
}
|
||||
let reencoded = (pin.reencode)(&pin.bytes)
|
||||
.unwrap_or_else(|error| panic!("{} does not decode its own bytes: {error}", pin.record));
|
||||
assert_eq!(reencoded, pin.bytes, "{} round trip", pin.record);
|
||||
}
|
||||
assert!(
|
||||
wrong.is_empty(),
|
||||
"unpinned or moved wire layouts:\n{}",
|
||||
wrong.join("\n")
|
||||
);
|
||||
}
|
||||
|
||||
/// A payload written before a defaulted key existed still decodes, once
|
||||
/// per defaulted key, and every key from there on reads as its zero value.
|
||||
#[test]
|
||||
fn every_defaulted_tail_key_decodes_from_a_payload_that_ends_before_it() {
|
||||
use serde_json::Value;
|
||||
let is_zero = |value: &Value| match value {
|
||||
Value::Null => true,
|
||||
Value::Bool(flag) => !flag,
|
||||
Value::Number(number) => number.as_f64() == Some(0.0),
|
||||
Value::String(text) => text.is_empty(),
|
||||
Value::Array(items) => items.is_empty(),
|
||||
Value::Object(_) => false,
|
||||
};
|
||||
for pin in pins() {
|
||||
let Some(first_default) = pin.first_default else {
|
||||
continue;
|
||||
};
|
||||
let full: Vec<Value> = rmp_serde::from_slice(&pin.bytes).unwrap();
|
||||
for end in first_default..full.len() {
|
||||
let truncated = rmp_serde::to_vec(&full[..end]).unwrap();
|
||||
let decoded = (pin.reencode)(&truncated).unwrap_or_else(|error| {
|
||||
panic!(
|
||||
"{} does not decode a payload ending before key {end}: {error}",
|
||||
pin.record
|
||||
)
|
||||
});
|
||||
let decoded: Vec<Value> = rmp_serde::from_slice(&decoded).unwrap();
|
||||
assert_eq!(decoded.len(), full.len(), "{} ending before key {end}", pin.record);
|
||||
assert_eq!(&decoded[..end], &full[..end], "{} ending before key {end}", pin.record);
|
||||
assert!(
|
||||
decoded[end..].iter().all(is_zero),
|
||||
"{} ending before key {end} defaulted to {:?}",
|
||||
pin.record,
|
||||
&decoded[end..]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn hex(bytes: &[u8]) -> String {
|
||||
bytes.iter().map(|byte| format!("{byte:02x}")).collect()
|
||||
}
|
||||
}
|
||||
508
crates/muninn-contracts/src/records.rs
Normal file
508
crates/muninn-contracts/src/records.rs
Normal file
|
|
@ -0,0 +1,508 @@
|
|||
use cultcache_rs::DatabaseEntry;
|
||||
use serde_json::Value;
|
||||
|
||||
pub const MUNINN_TELEMETRY_SURFACE_SCHEMA: &str = "muninn.telemetry_surface.v1";
|
||||
pub const MUNINN_CAPTURE_STREAM_SCHEMA: &str = "muninn.capture_stream.v1";
|
||||
pub const MUNINN_CAPTURE_STREAM_COMMAND_SCHEMA: &str = "muninn.capture_stream_command.v1";
|
||||
pub const MUNINN_OBS_STREAM_CATALOG_SCHEMA: &str = "muninn.obs_stream_catalog.v1";
|
||||
pub const MUNINN_MOVE_MARKER_CANDIDATE_SCHEMA: &str = "muninn.move_marker_candidate.v1";
|
||||
pub const MUNINN_MOVE_CONTROLLER_STATE_SCHEMA: &str = "muninn.move_controller_state.v1";
|
||||
pub const MUNINN_HID_CONTROLLER_STATE_SCHEMA: &str = "muninn.hid_controller_state.v1";
|
||||
pub const MUNINN_MOVE_IDENTITY_SCHEMA: &str = "muninn.move_identity.v1";
|
||||
pub const MUNINN_MOVE_LIGHT_COMMAND_SCHEMA: &str = "muninn.move_light_command.v1";
|
||||
pub const MUNINN_MOVE_HUE_PROGRAM_SCHEMA: &str = "muninn.move_hue_program.v1";
|
||||
pub const MUNINN_MOVE_TRACKER_HEALTH_SCHEMA: &str = "muninn.move_tracker_health.v1";
|
||||
pub const MUNINN_MOVE_EVIDENCE_TRANSPORT_HEALTH_SCHEMA: &str =
|
||||
"muninn.move_evidence_transport_health.v1";
|
||||
pub const MUNINN_QUEST_ACCESS_SCHEMA: &str = "muninn.quest_access.v1";
|
||||
pub const MUNINN_COMMAND_BOUNDARY_SCHEMA: &str = "muninn.command_boundary.v1";
|
||||
pub const MUNINN_TRANSPORT_PROFILE_SCHEMA: &str = "muninn.transport_profile.v1";
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "muninn.capture_stream", schema = "muninn.capture_stream.v1")]
|
||||
pub struct MuninnCaptureStreamRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub video_source: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub audio_source: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub transport: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub targets: Vec<String>,
|
||||
#[cultcache(key = 7)]
|
||||
pub command_witness: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub supervisor_pid: Option<u32>,
|
||||
#[cultcache(key = 9)]
|
||||
pub mux_pid: Option<u32>,
|
||||
#[cultcache(key = 10)]
|
||||
pub restart_count: u32,
|
||||
#[cultcache(key = 11)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 12)]
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.capture_stream_command",
|
||||
schema = "muninn.capture_stream_command.v1"
|
||||
)]
|
||||
pub struct MuninnCaptureStreamCommandRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub command_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub action: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub target_host: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub port: u16,
|
||||
#[cultcache(key = 7)]
|
||||
pub obs_target_host: Option<String>,
|
||||
#[cultcache(key = 8)]
|
||||
pub obs_port: u16,
|
||||
#[cultcache(key = 9)]
|
||||
pub media_transport: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub media_packet_bytes: u32,
|
||||
#[cultcache(key = 11)]
|
||||
pub requested_by: String,
|
||||
#[cultcache(key = 12)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 13)]
|
||||
pub updated_at: String,
|
||||
#[cultcache(key = 14, default)]
|
||||
pub rudp_video_bitrate_kbps: u32,
|
||||
#[cultcache(key = 15, default)]
|
||||
pub rudp_latency_budget_ms: u32,
|
||||
#[cultcache(key = 16, default)]
|
||||
pub video_source_id: String,
|
||||
#[cultcache(key = 17, default)]
|
||||
pub audio_source_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.telemetry_surface",
|
||||
schema = "muninn.telemetry_surface.v1"
|
||||
)]
|
||||
pub struct MuninnTelemetrySurfaceRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub surface_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub available_sources: Vec<String>,
|
||||
#[cultcache(key = 4)]
|
||||
pub stream_affordances: Vec<String>,
|
||||
#[cultcache(key = 5)]
|
||||
pub active_streams: Vec<String>,
|
||||
#[cultcache(key = 6)]
|
||||
pub activation_authority: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub updated_at: String,
|
||||
#[cultcache(key = 9, default)]
|
||||
pub primary_stream_id: String,
|
||||
#[cultcache(key = 10, default)]
|
||||
pub primary_stream_label: String,
|
||||
#[cultcache(key = 11, default)]
|
||||
pub command_rudp_target: String,
|
||||
#[cultcache(key = 12, default)]
|
||||
pub media_target_host: String,
|
||||
#[cultcache(key = 13, default)]
|
||||
pub media_port: u16,
|
||||
#[cultcache(key = 14, default)]
|
||||
pub media_packet_bytes: u32,
|
||||
#[cultcache(key = 15, default)]
|
||||
pub rudp_video_bitrate_kbps: u32,
|
||||
#[cultcache(key = 16, default)]
|
||||
pub rudp_latency_budget_ms: u32,
|
||||
#[cultcache(key = 17, default)]
|
||||
pub video_source_ids: Vec<String>,
|
||||
#[cultcache(key = 18, default)]
|
||||
pub video_source_labels: Vec<String>,
|
||||
#[cultcache(key = 19, default)]
|
||||
pub audio_source_ids: Vec<String>,
|
||||
#[cultcache(key = 20, default)]
|
||||
pub audio_source_labels: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.obs_stream_catalog",
|
||||
schema = "muninn.obs_stream_catalog.v1"
|
||||
)]
|
||||
pub struct MuninnObsStreamCatalogRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub catalog_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub stream_ids: Vec<String>,
|
||||
#[cultcache(key = 3)]
|
||||
pub labels: Vec<String>,
|
||||
#[cultcache(key = 4)]
|
||||
pub urls: Vec<String>,
|
||||
#[cultcache(key = 5)]
|
||||
pub states: Vec<String>,
|
||||
#[cultcache(key = 6)]
|
||||
pub updated_at: String,
|
||||
#[cultcache(key = 7, default)]
|
||||
pub command_rudp_target: String,
|
||||
#[cultcache(key = 8, default)]
|
||||
pub media_target_host: String,
|
||||
#[cultcache(key = 9, default)]
|
||||
pub media_port: u16,
|
||||
#[cultcache(key = 10, default)]
|
||||
pub media_packet_bytes: u32,
|
||||
#[cultcache(key = 11, default)]
|
||||
pub rudp_video_bitrate_kbps: u32,
|
||||
#[cultcache(key = 12, default)]
|
||||
pub rudp_latency_budget_ms: u32,
|
||||
#[cultcache(key = 13, default)]
|
||||
pub video_source_ids: Vec<String>,
|
||||
#[cultcache(key = 14, default)]
|
||||
pub video_source_labels: Vec<String>,
|
||||
#[cultcache(key = 15, default)]
|
||||
pub audio_source_ids: Vec<String>,
|
||||
#[cultcache(key = 16, default)]
|
||||
pub audio_source_labels: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_marker_candidate",
|
||||
schema = "muninn.move_marker_candidate.v1"
|
||||
)]
|
||||
pub struct MuninnMoveMarkerCandidateRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub camera_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub frame_sequence: u64,
|
||||
#[cultcache(key = 4)]
|
||||
pub source_id_hash: u64,
|
||||
#[cultcache(key = 5)]
|
||||
pub tile_x: u32,
|
||||
#[cultcache(key = 6)]
|
||||
pub tile_y: u32,
|
||||
#[cultcache(key = 7)]
|
||||
pub center_x_px: f32,
|
||||
#[cultcache(key = 8)]
|
||||
pub center_y_px: f32,
|
||||
#[cultcache(key = 9)]
|
||||
pub radius_px: f32,
|
||||
#[cultcache(key = 10)]
|
||||
pub area_px: u32,
|
||||
#[cultcache(key = 11)]
|
||||
pub mean_luma: f32,
|
||||
#[cultcache(key = 12)]
|
||||
pub peak_luma: u32,
|
||||
#[cultcache(key = 13)]
|
||||
pub score: f32,
|
||||
#[cultcache(key = 14)]
|
||||
pub observed_at: String,
|
||||
#[cultcache(key = 15, default)]
|
||||
pub move_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_controller_state",
|
||||
schema = "muninn.move_controller_state.v1"
|
||||
)]
|
||||
pub struct MuninnMoveControllerStateRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub move_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub sequence: u64,
|
||||
#[cultcache(key = 4)]
|
||||
pub source_timestamp_ns: i64,
|
||||
#[cultcache(key = 5)]
|
||||
pub accelerometer_xyz: Vec<f32>,
|
||||
#[cultcache(key = 6)]
|
||||
pub gyroscope_xyz: Vec<f32>,
|
||||
#[cultcache(key = 7)]
|
||||
pub magnetometer_xyz: Vec<f32>,
|
||||
#[cultcache(key = 8)]
|
||||
pub trigger_value: f32,
|
||||
#[cultcache(key = 9)]
|
||||
pub buttons: Vec<String>,
|
||||
#[cultcache(key = 10)]
|
||||
pub battery01: f32,
|
||||
#[cultcache(key = 11)]
|
||||
pub observed_at: String,
|
||||
#[cultcache(key = 12, default)]
|
||||
pub source_path: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.hid_controller_state",
|
||||
schema = "muninn.hid_controller_state.v1"
|
||||
)]
|
||||
pub struct MuninnHidControllerStateRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub device_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub device_kind: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub sequence: u64,
|
||||
#[cultcache(key = 5)]
|
||||
pub source_timestamp_ns: i64,
|
||||
#[cultcache(key = 6)]
|
||||
pub axes: Vec<f32>,
|
||||
#[cultcache(key = 7)]
|
||||
pub buttons: Vec<String>,
|
||||
#[cultcache(key = 8)]
|
||||
pub battery01: f32,
|
||||
#[cultcache(key = 9)]
|
||||
pub observed_at: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub source_path: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "muninn.move_identity", schema = "muninn.move_identity.v1")]
|
||||
pub struct MuninnMoveIdentityRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub identity_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub move_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub source_path: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub bluetooth_host_address: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub observed_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_light_command",
|
||||
schema = "muninn.move_light_command.v1"
|
||||
)]
|
||||
pub struct MuninnMoveLightCommandRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub command_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub move_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub hidraw_path: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub colors: Vec<String>,
|
||||
#[cultcache(key = 5)]
|
||||
pub durations_ms: Vec<u32>,
|
||||
#[cultcache(key = 6)]
|
||||
pub repeat_count: u32,
|
||||
#[cultcache(key = 7)]
|
||||
pub authority: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 9)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_hue_program",
|
||||
schema = "muninn.move_hue_program.v1"
|
||||
)]
|
||||
pub struct MuninnMoveHueProgramRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub program_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub mode: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub cycle_ms: u64,
|
||||
#[cultcache(key = 4)]
|
||||
pub epoch_ns: i64,
|
||||
#[cultcache(key = 5)]
|
||||
pub hold_at_ns: i64,
|
||||
#[cultcache(key = 6)]
|
||||
pub requested_by: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub updated_at: String,
|
||||
#[cultcache(key = 8, default)]
|
||||
pub order_mode: String,
|
||||
#[cultcache(key = 9, default)]
|
||||
pub transition_percent: u8,
|
||||
#[cultcache(key = 10, default)]
|
||||
pub transition_percent_explicit: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_tracker_health",
|
||||
schema = "muninn.move_tracker_health.v1"
|
||||
)]
|
||||
pub struct MuninnMoveTrackerHealthRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub health_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub camera_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub camera_index: i32,
|
||||
#[cultcache(key = 4)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub camera_name: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub camera_api: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub width: u32,
|
||||
#[cultcache(key = 8)]
|
||||
pub height: u32,
|
||||
#[cultcache(key = 9)]
|
||||
pub exposure: f32,
|
||||
#[cultcache(key = 10)]
|
||||
pub calibrated_controller_count: u32,
|
||||
#[cultcache(key = 11)]
|
||||
pub update_count: u64,
|
||||
#[cultcache(key = 12)]
|
||||
pub observation_count: u64,
|
||||
#[cultcache(key = 13)]
|
||||
pub latest_observation_count: u32,
|
||||
#[cultcache(key = 14)]
|
||||
pub last_observation_at: String,
|
||||
#[cultcache(key = 15)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 16)]
|
||||
pub updated_at: String,
|
||||
#[cultcache(key = 17, default)]
|
||||
pub image_mean_rgb: Vec<u32>,
|
||||
#[cultcache(key = 18, default)]
|
||||
pub image_peak_rgb: Vec<u32>,
|
||||
#[cultcache(key = 19, default)]
|
||||
pub color_evidence_move_ids: Vec<String>,
|
||||
#[cultcache(key = 20, default)]
|
||||
pub color_evidence_pixel_counts: Vec<u32>,
|
||||
#[cultcache(key = 21, default)]
|
||||
pub rejected_stale_count: u64,
|
||||
#[cultcache(key = 22, default)]
|
||||
pub rejected_radius_count: u64,
|
||||
#[cultcache(key = 23, default)]
|
||||
pub rejected_bounds_count: u64,
|
||||
#[cultcache(key = 24, default)]
|
||||
pub rejected_continuity_count: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.move_evidence_transport_health",
|
||||
schema = "muninn.move_evidence_transport_health.v1"
|
||||
)]
|
||||
pub struct MuninnMoveEvidenceTransportHealthRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub health_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub stream_id: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub produced_frames: u64,
|
||||
#[cultcache(key = 4)]
|
||||
pub local_ring_admissions: u64,
|
||||
#[cultcache(key = 5)]
|
||||
pub remote_handoffs: u64,
|
||||
#[cultcache(key = 6)]
|
||||
pub remote_sends: u64,
|
||||
#[cultcache(key = 7)]
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "muninn.quest_access", schema = "muninn.quest_access.v1")]
|
||||
pub struct MuninnQuestAccessRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub access_id: String,
|
||||
#[cultcache(key = 1)]
|
||||
pub host_id: String,
|
||||
#[cultcache(key = 2)]
|
||||
pub serial: String,
|
||||
#[cultcache(key = 3)]
|
||||
pub connection_state: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub product: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub model: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub device: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub transport_id: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub input_stream_id: String,
|
||||
#[cultcache(key = 9)]
|
||||
pub pose_stream_id: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub video_input_stream_id: String,
|
||||
#[cultcache(key = 11)]
|
||||
pub video_input_transport: String,
|
||||
#[cultcache(key = 12)]
|
||||
pub state: String,
|
||||
#[cultcache(key = 13)]
|
||||
pub detail: String,
|
||||
#[cultcache(key = 14)]
|
||||
pub observed_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.command_boundary",
|
||||
schema = "muninn.command_boundary.v1"
|
||||
)]
|
||||
pub struct MuninnCommandBoundaryCompatRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub value: Value,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "muninn.transport_profile",
|
||||
schema = "muninn.transport_profile.v1"
|
||||
)]
|
||||
pub struct MuninnTransportProfileCompatRecord {
|
||||
#[cultcache(key = 0)]
|
||||
pub value: Value,
|
||||
}
|
||||
|
|
@ -15,13 +15,14 @@ path = "src/main.rs"
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
cultcache-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultcache-rs" }
|
||||
cultmesh-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultmesh-rs" }
|
||||
cultnet-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "c2a9a6e526390808ef195759056fda0b9a55d8a3", package = "cultnet-rs" }
|
||||
cultcache-rs = { workspace = true }
|
||||
cultmesh-rs = { workspace = true }
|
||||
cultnet-rs = { workspace = true }
|
||||
libc = "0.2"
|
||||
muninn-contracts = { path = "../muninn-contracts" }
|
||||
muninn-move-tracker = { path = "../muninn-move-tracker" }
|
||||
muninn-psmoveapi-tracker = { path = "../muninn-psmoveapi-tracker", optional = true }
|
||||
odin-core = { git = "https://github.com/GameCult/Odin.git", rev = "3e96c6c85ca8b89b1bc7b01c1b7744f43111be99" }
|
||||
odin-core = { workspace = true }
|
||||
rmp-serde = "1.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_bytes = "0.11"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
1085
crates/muninn-daemon/src/media_send.rs
Normal file
1085
crates/muninn-daemon/src/media_send.rs
Normal file
File diff suppressed because it is too large
Load diff
1523
crates/muninn-daemon/src/media_send/tests.rs
Normal file
1523
crates/muninn-daemon/src/media_send/tests.rs
Normal file
File diff suppressed because it is too large
Load diff
BIN
crates/muninn-daemon/testdata/clip.h264
vendored
Normal file
BIN
crates/muninn-daemon/testdata/clip.h264
vendored
Normal file
Binary file not shown.
7
crates/muninn-daemon/testdata/clip.h264.provenance.txt
vendored
Normal file
7
crates/muninn-daemon/testdata/clip.h264.provenance.txt
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
clip.h264: 15 frames of the ffmpeg testsrc2 pattern, 160x120 at 30 fps, H.264 Constrained
|
||||
Baseline in Annex B with access unit delimiters, one IDR every 8 frames, no B-frames.
|
||||
Generated once and committed so the media send harness needs no ffmpeg.
|
||||
|
||||
Command (ffmpeg 8.1.1 full build, libx264, 2026-09-29):
|
||||
|
||||
ffmpeg -f lavfi -i "testsrc2=size=160x120:rate=30:duration=0.5" -c:v libx264 -profile:v baseline -preset veryslow -crf 28 -bf 0 -g 8 -x264-params "threads=1:aud=1:repeat-headers=1:keyint=8:min-keyint=8:scenecut=0" -f h264 clip.h264
|
||||
23
crates/sleipnir-daemon/Cargo.toml
Normal file
23
crates/sleipnir-daemon/Cargo.toml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[package]
|
||||
name = "sleipnir-daemon"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "sleipnir"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
cultmesh-rs = { workspace = true }
|
||||
cultnet-rs = { workspace = true }
|
||||
cultcache-rs = { workspace = true }
|
||||
muninn-contracts = { path = "../muninn-contracts" }
|
||||
odin-core = { workspace = true }
|
||||
rmp-serde = "1.3"
|
||||
serde_json = "1"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
vigem-client = "0.1.4"
|
||||
3112
crates/sleipnir-daemon/src/main.rs
Normal file
3112
crates/sleipnir-daemon/src/main.rs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -237,9 +237,10 @@ a temporary PCM/AAC compatibility bridge.
|
|||
Recommended first LAN profile:
|
||||
|
||||
- Profile id: `muninn.rudp.low_latency_h264_lan.v1`.
|
||||
- Video: H.264 NVENC, `p1`, ultra-low-latency tune, CBR high enough that LAN
|
||||
- Video: H.264 NVENC, `p5` (`main.rs:9504`), ultra-low-latency tune, CBR high enough that LAN
|
||||
bandwidth is not the constraint, no B-frames, no lookahead, short GOP or
|
||||
intra-refresh, periodic IDR/keyframe on feedback pressure.
|
||||
intra-refresh, keyframe actuation on feedback pressure (not built: keyframe requests are only
|
||||
counted and logged today; Cut 6 builds it).
|
||||
- VBV: derive `bufsize` from roughly one frame of bitrate
|
||||
(`bitrate_kbps / framerate`) instead of a large fixed encoder reservoir.
|
||||
The point is bounded latency, not hoarding compressed video in a nicer hat.
|
||||
|
|
@ -247,7 +248,7 @@ Recommended first LAN profile:
|
|||
temporary PCM/AAC bridge with separate packet identity and clock.
|
||||
- Transport: payload elementary access units as typed media records, never a
|
||||
muxed container as the unit of truth.
|
||||
- Packet size: default typed media chunks are `480` bytes. That leaves headroom
|
||||
- Packet size: default typed media chunks are `848` bytes (`main.rs:81`). That leaves headroom
|
||||
for CultNet/MessagePack/RUDP headers inside a normal Ethernet MTU so the OBS
|
||||
bridge does not depend on IP fragmentation or private RUDP fragment
|
||||
reassembly. The sender also sets CultNet RUDP `max_fragment_bytes` to `1431`
|
||||
|
|
@ -255,8 +256,9 @@ Recommended first LAN profile:
|
|||
minus the five-byte `media` channel id), so oversized typed records fragment
|
||||
in CultNet deliberately instead of falling through to accidental IP
|
||||
fragmentation.
|
||||
- Resend cadence: sender RUDP media resends are scheduled every `5` ms while
|
||||
the packet is still inside the `75` ms reliable-expiry budget.
|
||||
- Resend cadence: sender RUDP media resends are scheduled every `30` ms (`main.rs:94`) while
|
||||
the packet is still inside its expiry, which is the request's latency budget (a request that names none gets `250` ms, `main.rs:98`, and the advertisement offers the same as `default_latency_budget_ms`).
|
||||
- Send queue: `media_send.rs` owns it. The unit is a group, one access unit with its parity or one audio packet, stamped `produced_at + latency budget` when the packetizer emits it. A request's latency budget is clamped to 1..=2000 ms. The send loop moves one payload per step and picks it afresh each time: audio, then repairs, then video, so audio never waits behind more than the payload in progress, full socket or not. The group deadline is checked before every payload; a group that outlives it mid-send is abandoned and counted `groups_cut_short`. Queues are capped per kind (audio 256, video 512 groups) and drop the oldest group, counted as `groups_dropped_audio` and `groups_dropped_video`. Every access unit the sender drops (queue cap, expiry, packetizer overflow) has already consumed its frame id, so the receiver sees a gap; an overflow also discards the dropped frame's remaining slices instead of emitting them as a frame. A repair keeps the deadline of the frame it repairs, goes only to the receiver that asked, and is not sent after that deadline.
|
||||
- Control: sender may adapt bitrate, keyframe cadence, chunk size, and playout
|
||||
budget from receiver feedback; the receiver must not silently stretch latency
|
||||
to preserve visual perfection.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ microphones, cameras, and future sensors.
|
|||
|
||||
```powershell
|
||||
cargo build -p muninn-daemon
|
||||
muninn serve --store C:\Meta\Odin\state\muninn.telemetry.cc --interval-seconds 15 --idunn-rudp-health $env:IDUNN_RUDP_HEALTH --idunn-daemon starfire-muninn --idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access
|
||||
muninn serve --store C:\Meta\Odin\state\muninn.telemetry.cc --interval-seconds 15
|
||||
muninn --health --store C:\Meta\Odin\state\muninn.telemetry.cc
|
||||
```
|
||||
|
||||
|
|
@ -97,10 +97,7 @@ E:\Projects\Odin\scripts\restart-starfire-muninn.cmd
|
|||
E:\Projects\Odin\scripts\health-starfire-muninn.cmd
|
||||
```
|
||||
|
||||
The restart script launches Muninn hidden with `--host starfire --quest-adb`,
|
||||
`--idunn-rudp-health` from explicit `-IdunnRudpHealth` or
|
||||
`IDUNN_RUDP_HEALTH`, `--idunn-daemon starfire-muninn`, and
|
||||
`--idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access`.
|
||||
The restart script launches Muninn hidden with `--host starfire --quest-adb`.
|
||||
If the CultCache store at `C:\Meta\Odin\state\starfire.muninn.telemetry.cc`
|
||||
fails MessagePack decode on boot, the restart path archives the corrupt file,
|
||||
clears the stale `.lock`, and relaunches the daemon instead of leaving the lane
|
||||
|
|
@ -192,11 +189,7 @@ muninn move-light-status \
|
|||
Idunn keeps the Muninn daemon alive. Idunn does not learn a Move-specific
|
||||
watcher, and Mimir does not write HID directly except through temporary smoke
|
||||
scripts used to prove hardware behavior before a Muninn daemon is available.
|
||||
When `serve` is launched with `--idunn-rudp-health`, `--idunn-daemon`, and
|
||||
`--idunn-health-contract`, the long-running Muninn body publishes
|
||||
`idunn.daemon_health` directly to Idunn over `cultnet.transport.rudp.v0` on its
|
||||
normal cadence. `--health` keeps the same publication path for manual proof and
|
||||
compatibility probes, but the live owner is the daemon's `serve` process.
|
||||
`--health` reads the telemetry store and reports; it publishes nothing.
|
||||
Quest ADB probing is a telemetry input, not daemon liveness. If `adb` is
|
||||
missing or the Quest is unavailable, Muninn publishes `muninn.quest_access` as
|
||||
`unavailable` and keeps serving the local telemetry surface.
|
||||
|
|
@ -235,10 +228,6 @@ actuators only, not lifecycle owners. The binary is installed at
|
|||
`/home/metacrat/.local/state/gamecult/muninn/muninn.telemetry.cc`, and the
|
||||
restart actuator launches `serve --host nightwing --interval-seconds 15` with
|
||||
`--move-state move-usb=/dev/input/by-id/usb-Sony_Computer_Entertainment_Motion_Controller-joystick`,
|
||||
`--idunn-rudp-health` supplied by explicit `-IdunnRudpHealth` or
|
||||
`IDUNN_RUDP_HEALTH`,
|
||||
`--idunn-daemon nightwing-muninn`,
|
||||
`--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-and-move-hid`,
|
||||
PID, and logs under
|
||||
`/home/metacrat/.local/state/gamecult/muninn`.
|
||||
With that Move state source attached, `serve` also publishes the
|
||||
|
|
@ -248,10 +237,12 @@ Nightwing source discovery must emit one Move source per controller id. The USB
|
|||
pairing collection and Bluetooth joystick can expose the same controller as
|
||||
separate `/dev/input/js*` paths; `nightwing-move-state-sources.sh` prefers the
|
||||
Bluetooth `HID_ID=0005:0000054C:000003D5` path so Idunn health does not demand
|
||||
fresh records from two faces of the same controller. The Nightwing health
|
||||
actuator requires the same configured Idunn RUDP endpoint, but that command is
|
||||
fallback proof only; the live keepalive contract is now published by the
|
||||
long-running Nightwing `serve` process.
|
||||
fresh records from two faces of the same controller.
|
||||
|
||||
Starfire and Nightwing binaries and their `scripts/*-muninn.ps1` actuators
|
||||
must be installed together: a binary that rejects the retired
|
||||
`--idunn-rudp-health`, `--idunn-daemon` and `--idunn-health-contract` flags
|
||||
fails to start under an old restart script, and a new script never passes them.
|
||||
|
||||
Each private PSMoveAPI Eye worker owns optical observation admission before the
|
||||
parent aggregates evidence. Positions older than 50 ms, blobs below 2 px,
|
||||
|
|
|
|||
2145
docs/realtime-robustness-cut.md
Normal file
2145
docs/realtime-robustness-cut.md
Normal file
File diff suppressed because it is too large
Load diff
37
docs/streaming-deprecation.md
Normal file
37
docs/streaming-deprecation.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Streaming deprecation (Meta, 2026-11-06)
|
||||
|
||||
Muninn's streaming role and the OBS media receiver are superseded in the streaming
|
||||
space. Scope: screen and loopback-audio capture, the media sender, and the receiver at
|
||||
github.com/GameCult/Ratatoskr (forge mirror `GameCult/Ratatoskr-receiver`; the forge repo
|
||||
`GameCult/Ratatoskr` is an unrelated chat client and is not covered). Nothing has been
|
||||
deleted. The lists below come from file names and docs, not from a consumer audit;
|
||||
confirm each consumer before cutting.
|
||||
|
||||
## What depends on the streaming role
|
||||
|
||||
- Nothing in StreamPixels on main. StreamPixels `tools/showcheck` (PR #2) read Muninn's
|
||||
activation log and the receiver's OBS log until it was rescoped on 2026-11-06 (a762f69)
|
||||
to server, overlay and OBS only; the Muninn and Ratatoskr hops are gone from it and
|
||||
survive only on its parked branch `kiko/showcheck-muninn-chain`.
|
||||
- Docs here that describe it: `docs/muninn-media-streaming.md`,
|
||||
`docs/realtime-robustness-cut.md`, and the receiver sections of `docs/teardown-map.md`.
|
||||
- Operations: `scripts/activate-muninn-raven-*`, `scripts/health-*`,
|
||||
`scripts/restart-*`, and `deployment/idunn` (the health and restart scripts also serve
|
||||
the non-streaming daemon, so they stay).
|
||||
- The receiver repo's README names Muninn in prose.
|
||||
|
||||
## Removal candidates (streaming only; verify consumers first)
|
||||
|
||||
- `crates/muninn-daemon/src/media_send.rs`, `media_send/tests.rs`,
|
||||
`media_packetizer.rs`, and the media wiring in `main.rs`.
|
||||
- Media-related records in `crates/muninn-contracts` (`records.rs`, `lib.rs`), if no
|
||||
non-streaming consumer reads them.
|
||||
- `scripts/activate-muninn-raven-av-srt.cmd`, `scripts/activate-muninn-raven-media.ps1`,
|
||||
`scripts/wasapi-loopback-capture.ps1`.
|
||||
- `docs/muninn-media-streaming.md` (move to history rather than delete if it is cited).
|
||||
|
||||
## Keep
|
||||
|
||||
Sensor serving, PS Move tracking (`muninn-move-tracker`, `muninn-psmoveapi-tracker`,
|
||||
`native/`), and `sleipnir-daemon` input are outside this notice. Do not remove them under
|
||||
it. `idunn_presence.rs` matched a media search term only; it is presence, not streaming.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Muninn Teardown Map (pre-rebuild)
|
||||
# Muninn Teardown Map (history of the extraction)
|
||||
|
||||
Date: 2026-09-09. Working map for extracting Muninn from Odin into a dedicated repo.
|
||||
Date: 2026-09-09. Working map for extracting Muninn from Odin into a dedicated repo. Muninn now lives in `GameCult/Muninn`; the body below was written at `Odin\crates\muninn-daemon` and is annotated in place where git has since contradicted it. Line counts at `e70db69`: `main.rs` 15,134 and `media_packetizer.rs` 2,633 under `crates/muninn-daemon/src/`.
|
||||
|
||||
## What Muninn is (operator, 2026-09-09)
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ Independently confirmed in gamecult-ops `scripts/idunn/idunn-deployment-targets.
|
|||
- `src/media_packetizer.rs` 4,244 lines
|
||||
Sibling crates: `muninn-move-tracker` (308), `muninn-psmoveapi-tracker` (359).
|
||||
|
||||
CultLib pin: `c13b6ba0` (2026-09-05), 3 commits behind CultLib HEAD `d1a9edad`.
|
||||
CultLib pin at the time of writing: `c13b6ba0` (2026-09-05), 3 commits behind CultLib HEAD `d1a9edad`. Live pin: `c2a9a6e` (`crates/muninn-daemon/Cargo.toml:18-20`).
|
||||
|
||||
## Authorities currently fused in main.rs
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ Adding a sensor touches one file and zero core code.
|
|||
|
||||
## Schema ownership (decided)
|
||||
|
||||
19 `muninn.*` schemas, 38 declarations, currently in `odin-core/src/documents.rs`.
|
||||
19 `muninn.*` schemas, 38 declarations, at the time of writing in `odin-core/src/documents.rs`. The four media schemas have since moved to CultLib as `gamecult.media_*`; the other `muninn.*` records are still imported from odin-core.
|
||||
Muninn's contracts owned by Odin = inversion. Move to CultLib, following
|
||||
`a539d4f` (Idunn/Odin authority contracts returned to CultLib) and
|
||||
`c13b6ba` (IdunnDaemonHealthTrustBindingRecord into cultnet-rs).
|
||||
|
|
@ -62,7 +62,7 @@ obs_stream_catalog, quest_access, telemetry_surface, transport_profile.
|
|||
|
||||
## Coupling
|
||||
|
||||
Muninn -> odin-core: ONE import block, 20 symbols (main.rs).
|
||||
Muninn -> odin-core: ONE import block, 20 symbols (main.rs) at the time of writing; 21 at `e70db69` (`main.rs:27-37`).
|
||||
odin-core / odin-daemon / sleipnir-daemon -> Muninn: NONE.
|
||||
Crate boundary cuts clean.
|
||||
|
||||
|
|
@ -436,7 +436,7 @@ exercising the path it claims to measure; `--metrics` stays in the script.
|
|||
|
||||
## Ratatoskr exists (2026-09-10)
|
||||
|
||||
https://github.com/GameCult/Ratatoskr — the receiving end, extracted from the
|
||||
https://github.com/GameCult/Ratatoskr (forge mirror `GameCult/Ratatoskr-receiver`; the forge `GameCult/Ratatoskr` is the unrelated chat client) — the receiving end, extracted from the
|
||||
6,515-line C++ plugin in `Mimir/native/obs_stem_source/`.
|
||||
|
||||
Holds one rule: **it implements no transport, it consumes CultNet.** The plugin
|
||||
|
|
@ -447,7 +447,7 @@ cultnet-rs and cultnet-ts but not the receiver.
|
|||
|
||||
Working: subscription over `cultnet-rs`, drained and handed across a C ABI.
|
||||
9 Rust tests, 14 C checks (the C side loads the cdylib dynamically and verifies
|
||||
the header's claims, rather than assuming them). Pinned to CultLib `d1a9eda`.
|
||||
the header's claims, rather than assuming them). Pinned to CultLib `d1a9eda` at the time of writing; now `c2a9a6e` (Ratatoskr `crates/ratatoskr-core/Cargo.toml:16-18`).
|
||||
|
||||
### The next blocking piece
|
||||
|
||||
|
|
@ -460,8 +460,9 @@ The receiver-side reassembly code that was kept in `media_packetizer.rs` as the
|
|||
seed for Ratatoskr moved there on 2026-09-10 (`Ratatoskr` 2618184,
|
||||
`crates/ratatoskr-core/src/video.rs`) and was cut here (705 lines: frame
|
||||
assembly, the assembly set, reassembly, expired-frame feedback, their tests).
|
||||
Muninn now holds only the producer half: packetize, XOR stripe parity, and the
|
||||
feedback *builder* its sender tests exercise. The contract's erasure code is
|
||||
Muninn holds the producer half (packetize, XOR stripe parity, the feedback
|
||||
*builder* its sender tests exercise) and still carries receiver residue: `AudioPacketBuffer`
|
||||
and the whole-stream Annex B helpers in `media_packetizer.rs`, which only tests call. The contract's erasure code is
|
||||
XOR stripes, one recovered chunk per stripe; the C++ receiver's GF(256) block
|
||||
solver reads fields the v2 record does not carry and stayed in Mimir.
|
||||
|
||||
|
|
@ -608,22 +609,24 @@ Three repos where there was one crate, and a contract neither of them owns.
|
|||
|
||||
| Repo | Role | State |
|
||||
|---|---|---|
|
||||
| CultLib `main` `05e0925` | the contract | media records, wire envelope, validation, channel delivery |
|
||||
| CultLib `main` `05e0925` at the time of writing (media contract unchanged since `c2a9a6e`) | the contract | media records, wire envelope, validation, channel delivery |
|
||||
| Muninn | producer | speaks the shared contract; blocked on one pin (below) |
|
||||
| Ratatoskr | consumer | decodes the envelope; builds clean, no conflicts |
|
||||
|
||||
### The one thing blocking a clean Muninn build
|
||||
### The one thing blocking a clean Muninn build (history; resolved)
|
||||
|
||||
Resolved 2026-09-11 (see the Raven section below): `Cargo.lock` is tracked (`70d267f`) and the pins are the build. The build resolves `odin-core` from Odin `3e96c6c`, which no Odin branch holds; only the tag `attic/claude-cultlib-pin-c2a9a6e` keeps it reachable. The text below is the state on 2026-09-10.
|
||||
|
||||
`odin-core` pins CultLib `c13b6ba`; Muninn needs `05e0925`. Cargo resolves two
|
||||
`cultcache-rs` copies and `DatabaseEntry` from one is not `DatabaseEntry` from
|
||||
the other.
|
||||
|
||||
Muninn cannot resolve this alone: it uses 23 odin-core symbols, and while 16 are
|
||||
Muninn cannot resolve this alone: it used 23 odin-core symbols (21 at `e70db69`), and while 16 are
|
||||
its own records that belong here (capture stream, command boundary, HID
|
||||
controller state, five Move records, OBS catalog, Quest access, telemetry
|
||||
surface, transport profile), 7 are genuinely Odin's — `discover_provider_endpoints`,
|
||||
surface, transport profile), 7 were genuinely Odin's — `discover_provider_endpoints`,
|
||||
`OdinDocuments`, `OdinEndpointQuery`, Eve advertisement and surface records,
|
||||
`IdunnDaemonHealthRecord`.
|
||||
`IdunnDaemonHealthRecord`. At `e70db69` four remain imported: `EveProviderAdvertisementRecord`, `EveSurfaceStateRecord`, `IdunnDaemonHealthRecord`, `OdinDocuments`.
|
||||
|
||||
Muninn's two bodies were collapsed 2026-09-10 (Odin d41c744 dropped its
|
||||
workspace copy of the three crates and the actuator scripts). The Idunn
|
||||
|
|
@ -653,10 +656,8 @@ one once the patch is gone.
|
|||
Muninn-specific `obs_stream_catalog` / `capture_stream_command` stay
|
||||
published beside them until nothing reads them. The old plugin's CLI
|
||||
shell-out and `.cc` snapshot are not ported. The connection direction was
|
||||
inverted the same day (section above). **Not yet exercised live:** Raven
|
||||
runs a pre-b679fc2 Muninn; the next Raven deploy ships this repository
|
||||
(gamecult-ops rebound the targets 2026-09-10) and needs
|
||||
`MUNINN_MEDIA_RUDP_ADVERTISE` set.
|
||||
inverted the same day (section above). First live frames on `58e8663` (2026-09-10); exercised through 2026-09-11 on `bc43e1b` and later
|
||||
(measurements below); the 2026-09-10 note that Raven ran a pre-b679fc2 Muninn is history.
|
||||
3. **Opus.** Unblocked and measured at 16.8x. `-f aac` in the receiver becomes
|
||||
codec-driven; framing follows the `aac-adts-padded-v1` precedent (2-byte
|
||||
big-endian length prefix).
|
||||
|
|
@ -664,8 +665,10 @@ one once the patch is gone.
|
|||
`feedback.rs`). The producer's repair cache and keyframe counter now have a
|
||||
live counterpart. `build_receiver_feedback` moved to CultLib (34c8ea7) and
|
||||
stopped implying a keyframe request from missing chunks (4160ab5): a repair
|
||||
request is the alternative to one, and the sender turns every new keyframe
|
||||
request into an IDR.
|
||||
request is the alternative to one. The sender counts keyframe requests and logs them;
|
||||
it does not force an IDR (`main.rs:3036-3048`). Recovery today is the fixed GOP:
|
||||
every GOP keyframe is an IDR, at a GOP of `framerate/4` frames (`-forced-idr 1`, `-g`,
|
||||
`-keyint_min`, `main.rs:10405-10410`); not every frame.
|
||||
|
||||
### Deliberate breaks, both recorded as passing tests
|
||||
|
||||
|
|
@ -698,8 +701,7 @@ by continuity in under 10 s. The catalog on Odin named the new endpoint the
|
|||
first time the restarted `serve` advertised.
|
||||
|
||||
Still Raven-specific and unmanaged: the two activation scripts and
|
||||
`health-muninn.ps1`, which still passes the retired `--idunn-rudp-health`
|
||||
flags. That flag family (`IdunnRudpHealthOptions`, `run_daemon_health_publisher`,
|
||||
`idunn.daemon_health` documents) has no consumer since the previous Idunn
|
||||
generation was retired and is the next cut; nightwing and starfire's restart
|
||||
scripts still require it, so it goes with them.
|
||||
`health-muninn.ps1`. The retired `--idunn-rudp-health` flag family
|
||||
(`IdunnRudpHealthOptions`, `run_daemon_health_publisher`, `idunn.daemon_health`
|
||||
documents) had no consumer since the previous Idunn generation was retired; it
|
||||
was deleted from `muninn`, its five host scripts and `muninn.md` in named cut 3.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
@echo off
|
||||
echo health-muninn.cmd archived: Raven Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-remote-telemetry-health. Use health-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
echo health-muninn.cmd archived: Raven Muninn has no daemon-published health. Run health-muninn.ps1 as an explicit witness inspection (scheduled-task actions, serve process, store freshness); it is not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ param(
|
|||
[string] $ActivateStorePath = "C:\Meta\Odin\state\muninn.activate.cc",
|
||||
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[int] $ConnectTimeoutSeconds = 10,
|
||||
[string] $SshUser = "madman's lullaby",
|
||||
[string] $IdentityFile = ""
|
||||
|
|
@ -13,10 +12,6 @@ param(
|
|||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Path,
|
||||
|
|
@ -177,10 +172,7 @@ if (`$null -eq `$process) {
|
|||
}
|
||||
foreach (`$pattern in @(
|
||||
"--host raven",
|
||||
"--activate-store $ActivateStorePath",
|
||||
"--idunn-rudp-health $IdunnRudpHealth",
|
||||
"--idunn-daemon muninn",
|
||||
"--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-health"
|
||||
"--activate-store $ActivateStorePath"
|
||||
)) {
|
||||
if (`$process.CommandLine -notlike "*`$pattern*") {
|
||||
throw "Muninn serve process is missing expected command-line segment `${pattern}: `$(`$process.CommandLine)"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
@echo off
|
||||
echo health-nightwing-muninn.cmd archived: Nightwing Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-remote-telemetry-and-move-hid. Use health-nightwing-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
echo health-nightwing-muninn.cmd archived: Nightwing Muninn has no daemon-published health. Run health-nightwing-muninn.ps1 as an explicit witness inspection (serve process, store freshness, PID file); it is not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ param(
|
|||
[string] $PidPath = "/home/metacrat/.local/state/gamecult/muninn/muninn.pid",
|
||||
[string[]] $MoveState = @(),
|
||||
[int] $IntervalSeconds = 15,
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH
|
||||
[int] $MaxStoreAgeSeconds = 180
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no WireGuard endpoint default is allowed."
|
||||
}
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Path,
|
||||
|
|
@ -76,16 +71,6 @@ if [ -z "`$process_line" ]; then
|
|||
echo 'Nightwing Muninn serve command line is unavailable' >&2
|
||||
exit 1
|
||||
fi
|
||||
for pattern in \
|
||||
'--idunn-rudp-health $IdunnRudpHealth' \
|
||||
'--idunn-daemon nightwing-muninn' \
|
||||
'--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-and-move-hid'
|
||||
do
|
||||
if ! printf '%s\n' "`$process_line" | grep -F -- "`$pattern" >/dev/null 2>&1; then
|
||||
echo "Nightwing Muninn serve command line is missing `$pattern" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
if [ ! -f '$StorePath' ]; then
|
||||
echo 'Muninn telemetry store is missing on Nightwing' >&2
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
@echo off
|
||||
echo health-starfire-muninn.cmd archived: Starfire Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-local-telemetry-and-quest-access. Use health-starfire-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
echo health-starfire-muninn.cmd archived: Starfire Muninn has no daemon-published health. Run health-starfire-muninn.ps1 as an explicit witness inspection (serve process, store freshness, PID file); it is not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -3,16 +3,11 @@ param(
|
|||
[string] $StorePath = "C:\Meta\Odin\state\starfire.muninn.telemetry.cc",
|
||||
[string] $LogRoot = "C:\Meta\Odin\logs\starfire-muninn",
|
||||
[string[]] $MoveState = @(),
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH
|
||||
[int] $MaxStoreAgeSeconds = 180
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $MuninnExe)) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
|
|
@ -28,15 +23,6 @@ $process = Get-CimInstance Win32_Process |
|
|||
if ($null -eq $process) {
|
||||
throw "Starfire Muninn serve process is not running with Quest access enabled"
|
||||
}
|
||||
foreach ($pattern in @(
|
||||
"--idunn-rudp-health $IdunnRudpHealth",
|
||||
"--idunn-daemon starfire-muninn",
|
||||
"--idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access"
|
||||
)) {
|
||||
if ($process.CommandLine -notlike "*$pattern*") {
|
||||
throw "Starfire Muninn serve process is missing expected command-line segment ${pattern}: $($process.CommandLine)"
|
||||
}
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $StorePath)) {
|
||||
throw "Starfire Muninn telemetry store is missing at $StorePath"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,10 @@ param(
|
|||
"nightwing-eye-1" = 100
|
||||
},
|
||||
[int] $IntervalSeconds = 15,
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[string] $IdunnDaemon = "nightwing-muninn",
|
||||
[string] $IdunnHealthContract = "muninn.cultnet-rudp-remote-telemetry-and-move-hid",
|
||||
[string] $OdinCultMeshUri = $(if ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
|
||||
[string] $OdinCultMeshRudpEndpoint = $(if ($env:CULTMESH_URI_ODIN_RUDP) { $env:CULTMESH_URI_ODIN_RUDP } else { "10.77.0.2:17871" }),
|
||||
[string] $HidControllerRudpBind = "0.0.0.0:17888",
|
||||
[string] $HidControllerRudpAdvertise = $(if ($env:MUNINN_HID_CONTROLLER_RUDP_ADVERTISE) { $env:MUNINN_HID_CONTROLLER_RUDP_ADVERTISE } else { "10.77.0.3:17888" }),
|
||||
[string] $CommandRudpBind = "0.0.0.0:17889",
|
||||
[string] $CommandRudpAdvertise = "10.77.0.3:17889"
|
||||
)
|
||||
|
||||
|
|
@ -34,12 +30,6 @@ if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daem
|
|||
throw "restart-nightwing-muninn.ps1 is an Idunn actuator body. Redeploy by poking Idunn; direct service restart is not an owned path."
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
if ($IdunnRudpHealth -match '^(127\.0\.0\.1|localhost):(\d+)$') {
|
||||
$IdunnRudpHealth = "10.77.0.2:$($Matches[2])"
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind) -and [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
throw "HID controller RUDP advertise endpoint must be supplied by -HidControllerRudpAdvertise or MUNINN_HID_CONTROLLER_RUDP_ADVERTISE when HID RUDP bind is enabled; no Nightwing LAN default is allowed."
|
||||
}
|
||||
|
|
@ -135,7 +125,7 @@ if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
|||
$hidControllerRudpSetLines += "set -- ""`$@"" --hid-controller-rudp-advertise $(Quote-ShSingle $HidControllerRudpAdvertise)"
|
||||
}
|
||||
$hidControllerRudpSetBlock = ($hidControllerRudpSetLines -join "`n")
|
||||
$commandRudpSetBlock = "set -- ""`$@"" --command-rudp-bind $(Quote-ShSingle $CommandRudpBind) --command-rudp-advertise $(Quote-ShSingle $CommandRudpAdvertise)"
|
||||
$commandRudpSetBlock = "set -- ""`$@"" --command-rudp-advertise $(Quote-ShSingle $CommandRudpAdvertise)"
|
||||
$remoteScript = @"
|
||||
set -eu
|
||||
mkdir -p '$LogRoot'
|
||||
|
|
@ -162,10 +152,7 @@ set -- serve \
|
|||
--host nightwing
|
||||
$moveRuntimeSetBlock
|
||||
set -- "`$@" \
|
||||
--interval-seconds '$IntervalSeconds' \
|
||||
--idunn-rudp-health '$IdunnRudpHealth' \
|
||||
--idunn-daemon '$IdunnDaemon' \
|
||||
--idunn-health-contract '$IdunnHealthContract'
|
||||
--interval-seconds '$IntervalSeconds'
|
||||
$odinCultMeshUriSetBlock
|
||||
$hidControllerRudpSetBlock
|
||||
$commandRudpSetBlock
|
||||
|
|
@ -179,10 +166,9 @@ muninn_pid="`$(cat '$LogRoot/muninn.pid')"
|
|||
kill -0 "`$muninn_pid" 2>/dev/null
|
||||
muninn_cmdline="`$(tr '\0' ' ' < "/proc/`$muninn_pid/cmdline")"
|
||||
if ! printf '%s\n' "`$muninn_cmdline" | grep -F -- '--host nightwing' >/dev/null 2>&1 ||
|
||||
! printf '%s\n' "`$muninn_cmdline" | grep -F -- '--idunn-rudp-health $IdunnRudpHealth' >/dev/null 2>&1 ||
|
||||
! printf '%s\n' "`$muninn_cmdline" | grep -F -- '--move-marker-camera nightwing-eye-0=/dev/video2' >/dev/null 2>&1 ||
|
||||
! printf '%s\n' "`$muninn_cmdline" | grep -F -- '--move-marker-camera nightwing-eye-1=/dev/video3' >/dev/null 2>&1; then
|
||||
echo 'Nightwing Muninn serve command line is missing Idunn health or dual-camera arguments' >&2
|
||||
echo 'Nightwing Muninn serve command line is missing dual-camera arguments' >&2
|
||||
exit 1
|
||||
fi
|
||||
"@
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@ param(
|
|||
[string] $MoveBluetoothHost = "",
|
||||
[string[]] $MoveState = @(),
|
||||
[switch] $EnableUsbMoveState,
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[string] $IdunnDaemon = "starfire-muninn",
|
||||
[string] $IdunnHealthContract = "muninn.cultnet-rudp-local-telemetry-and-quest-access",
|
||||
[string] $OdinCultMeshUri = $(if ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
|
||||
[string] $OdinCultMeshRudpEndpoint = $(if ($env:CULTMESH_URI_ODIN_RUDP) { $env:CULTMESH_URI_ODIN_RUDP } else { "127.0.0.1:17871" }),
|
||||
[string] $HidControllerRudpBind = "",
|
||||
|
|
@ -29,9 +26,6 @@ if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daem
|
|||
if (-not (Test-Path -LiteralPath $MuninnExe)) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind) -and [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
throw "HID controller RUDP advertise endpoint must be supplied by -HidControllerRudpAdvertise or MUNINN_HID_CONTROLLER_RUDP_ADVERTISE when HID RUDP bind is enabled; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
|
@ -63,10 +57,7 @@ $arguments = @(
|
|||
"--host", "starfire",
|
||||
"--interval-seconds", "15",
|
||||
"--quest-adb",
|
||||
"--quest-serial", $QuestSerial,
|
||||
"--idunn-rudp-health", $IdunnRudpHealth,
|
||||
"--idunn-daemon", $IdunnDaemon,
|
||||
"--idunn-health-contract", $IdunnHealthContract
|
||||
"--quest-serial", $QuestSerial
|
||||
)
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshUri)) {
|
||||
$arguments += @("--odin-cultmesh-uri", $OdinCultMeshUri)
|
||||
|
|
@ -160,15 +151,3 @@ if ($null -eq $processCheck) {
|
|||
if ($null -eq $processCheck) {
|
||||
throw "Starfire Muninn serve process is not running after restart"
|
||||
}
|
||||
foreach ($pattern in @(
|
||||
"--idunn-rudp-health",
|
||||
$IdunnRudpHealth,
|
||||
"--idunn-daemon",
|
||||
$IdunnDaemon,
|
||||
"--idunn-health-contract",
|
||||
$IdunnHealthContract
|
||||
)) {
|
||||
if ($processCheck.CommandLine -notlike "*$pattern*") {
|
||||
throw "Starfire Muninn serve command line is missing ${pattern}: $($processCheck.CommandLine)"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue