Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
573ffea956 Deprecation notice: streaming role superseded (no deletions) (#2) 2026-11-13 03:25:05 +00:00
3e47e27d49 Docs: which Ratatoskr the docs mean (#1) 2026-11-13 03:24:48 +00:00
Meta Vens
b0df17dddd Name the lowercase parked tag in the removed-flag message
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 21:19:43 +02:00
Meta Vens
e534ef4937 Drop orphaned Sleipnir binding_summary and Muninn imports left by the Eve surface removal
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 20:42:24 +02:00
Meta Vens
344de9f9a1 Quarantine Muninn's Eve operator surfaces: move-hue and input-mirror dashboards, Eve command ingress
Parked at tag parked/Muninn-eve-surface per thing2:ruling:eve-dashboards-quarantined. Provider advertisements and the Odin provider lease stay; their surfaces entries go. --command-rudp-bind is rejected as removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 20:17:52 +02:00
Meta Vens
1d0ea0b112 Merge named Cut 3 and H0: retire --idunn-rudp-health, muninn-contracts
Soul found no blocker; its findings (wire pins for all 15 records,
stale health text, unpinned boundary fields, inert-registration
comment) are fixed at 2742b4d. Deploy note: starfire and nightwing
need the binary and scripts installed together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 00:23:58 +02:00
Meta Vens
2742b4ddcf Correct stale health text, pin per-host boundary identity, note deploy order
The MuninnRecords comment claimed muninn-contracts decides every muninn.*
binding; today odin-core registers identical strings first and the
registration is inert until Odin deletes its copies. The help text no
longer describes the retired --idunn flags, the health-*.cmd stubs no
longer claim daemon-published health, and docs/muninn.md says to install
the binary and the scripts together. A test now pins daemon_id, state and
current_transport for raven, starfire and nightwing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:17:51 +02:00
Meta Vens
139ca7397f muninn-contracts: pin every record's wire bytes and every defaulted key
One table, 15 records: each encodes to its pinned positional MessagePack
array (dropped, swapped, retyped keys change the bytes), and every record
with a defaulted tail decodes from a payload that ends before each
defaulted key, one truncation per key, reading the rest as zero values.
Replaces the two hand-written hid and hue tests and the single hue
truncation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:17:50 +02:00
Meta Vens
b2014284d1 muninn-contracts: pin that a defaulted tail decodes from an older payload
The wire-layout goldens set every field, so dropping `default` from a
record's tail survived them. Adds a test that decodes an eight-element
hue program payload and expects the defaulted tail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:34:35 +02:00
Meta Vens
e27de13efd muninn-contracts: Muninn's 15 state records leave odin-core
New library crate crates/muninn-contracts holds the records Muninn owns
(telemetry surface, capture stream and command, OBS catalog, Move marker
candidate, controller state, identity, light command, hue program,
tracker health and evidence transport health, HID controller state,
Quest access, command boundary, transport profile), their schema
constants, and the MuninnRecords document set. The definitions are the
odin-core ones moved verbatim; the wire is unchanged.

muninn and sleipnir import the records from here, so both link one
definition. muninn registers MuninnRecords after OdinDocuments, which
stays because it still carries Odin's own records and stale copies of
the same schema ids. Muninn's odin-core imports are now
EveProviderAdvertisementRecord, EveSurfaceStateRecord and OdinDocuments.

Tests pin every type name and schema id, the document-set bindings, and
the positional wire layout of two records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:31:46 +02:00
Meta Vens
7b8b37a2fd health_check no longer reads a timestamp it does not publish
The previous commit left health_check computing an observed_at and a
state/detail pair whose only consumer was the deleted publisher; the
timestamp helper itself was deleted, so the workspace did not build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:18:57 +02:00
Meta Vens
e9580009ea Retire --idunn-rudp-health and the daemon-health publisher
The flag family (--idunn-rudp-health, --idunn-daemon,
--idunn-health-contract), IdunnRudpHealthOptions, the health worker
thread, idunn_health_payload, the RUDP health connection and the
idunn.daemon_health document had no consumer since the previous Idunn
generation. The raven-muninn recipe never passed them; liveness is the
runtime-presence publisher. Removes the IdunnDaemonHealthRecord odin-core
symbol (three remain).

The daemon id is now derived from the host alone. The transport profile
and command-boundary records no longer carry health_publication, and
health_contract is null. The starfire, nightwing and raven health and
restart scripts stop passing and checking the flags; muninn.md follows.

Tests: the retired flags are unknown arguments; the boundary record
carries the host-derived daemon id and no health_publication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:17:13 +02:00
Meta Vens
bd69598503 Merge Cut 2: bounded sender, one deadline owner, a drivable seam
Audio priority per payload, deadlines per payload, every sender-side drop
consumes a frame_id, the latency budget clamped to 2000 ms, a departed
receiver drops out without stopping the others. Soul pass 3: merge with
follow-ups (mid-group leaver order unpinned; per-receiver I/O errors still
stop the loop; raw budget persists in the command record).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:31:34 +02:00
Meta Vens
45e2904943 Clamp the command's budget where the command is read, not where the request is copied
A request naming no budget stores 0 and means the 250 ms default; clamping at
the copy turned 0 into 1 ms. The command accessor already owns 0-means-default,
so it owns the clamp too: compare, spawn arguments and logs read through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:18:29 +02:00
Meta Vens
cbea798a27 Drop a departed receiver from the send loop, pin the untested rules, clamp the budget once
A receiver that timed out or disconnected between payloads left a stale
session in the in-flight group snapshot and in queued repairs; the next
hub.send returned "Unknown RUDP server peer" and the mux restarted for every
receiver. try_send now says whether the session still exists (address and
generation) and reports ReceiverGone; the group drops that receiver, the repair
queue drops that receiver's repairs, and every other hub error still
propagates.

Tests that fail under their mutation: the three departure shapes, audio
expiry, a repair kept on a full socket, resends polled on a full socket, the
loss-to-repair-budget wiring, and a leftover spanning two pushes.

The latency budget is clamped by one function where a request or a command line
is read, so the advertisement, telemetry and stream-equivalence check all see
the clamped value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:17:25 +02:00
Meta Vens
772b2d00d3 Pin that the send loop is not finished while a frame or repair is in flight
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:50:10 +02:00
Meta Vens
ffc723c49f Leave the repair queue bounded by the repair budget alone
The extra room cap on queued repairs had no test and no owner beyond the
budget and the frame deadline, which already bound the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:39:01 +02:00
Meta Vens
96b64cba97 Send media one payload per step: audio first, per-payload deadlines, clamped budget
The send loop now moves one payload per step and chooses it afresh: audio,
then repairs, then video. A video group in progress or a full socket no
longer holds audio back for more than the payload in progress; a full
socket hands control back instead of spinning to the group deadline.
Repairs are queued by feedback intake and sent by the same step, each
checked against its own frame's deadline at send time and only to the
receiver that asked. The group deadline is checked before every payload; a
group that outlives it mid-send is abandoned and counted groups_cut_short.
A request's latency budget is clamped to 1..=2000 ms.

Tests pin the cap values, the clamp, per-payload audio priority (mid-frame,
full socket, between repairs), the send-time deadline for groups and
repairs, repairs going only to the asker, and the frame-id gap left by a
queue-cap, expiry or overflow drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:37:31 +02:00
Meta Vens
89ae74ae0f Make a packetizer overflow drop consume its frame id and its leftover slices
An access unit dropped for outgrowing max_pending_bytes consumed no frame
id, so a receiver could not see the gap, and the slices that followed it
were emitted as a complete access unit of their own. The drop now spends
the frame id (and its pts step) and the state discards the leftover slices
up to the next access-unit boundary, waiting for the boundary when the
leftover is not yet complete. A stream that resumes on a boundary loses
nothing more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:37:30 +02:00
Meta Vens
95b84a8102 Record the Cut 2 Soul pass and the loss-signalling owner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:24:31 +02:00
Meta Vens
f4f1fcdad7 Merge origin/main into hands/muninn-cut2
Bring H3, the Sleipnir import and the recipe merge into the Cut 2 branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:24:29 +02:00
Meta Vens
f4f1f8592f Merge H3: Sleipnir joins the Muninn workspace with its history
Soul: merge with follow-ups. The CultLib c2a9a6e pin stops acking
unreliable frames, so Sleipnir's 1 s subscribe alone refreshes Muninn's 2 s
HID timeout; H2/H4 replace that path. odin-core 3e96c6c lives only under an
attic tag; repin once the bump reaches Odin main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:22:24 +02:00
Meta Vens
8f59bddf47 Merge route/b3-declare: raven-muninn declares its Odin dependency
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:17:09 +02:00
Meta Vens
ed02890c12 Give Sleipnir the media_delivery field CultLib c2a9a6e requires
Odin main's Sleipnir was written against CultLib a8aedda, and its two
CultNetRudpSocketTransportOptions initialisers do not compile at
Muninn's c2a9a6e pin. media_delivery: None is the field's default, so
behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:16:07 +02:00
Meta Vens
6a628ee551 Hoist the CultLib and odin-core pins into one workspace table
Sleipnir joins the workspace at Muninn's pins (CultLib c2a9a6e, odin-core
Odin 3e96c6c) instead of Odin main's a8aedda and a path dependency.
Muninn and Sleipnir now move together by construction. Manifests and
lock only; no source change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:11:40 +02:00
Meta Vens
3a12d14e2c Import Sleipnir from Odin 379b826 with history
Merges crates/sleipnir-daemon/{Cargo.toml,src/main.rs} filtered from Odin
main 379b826 (git filter-repo --path, unrelated history). Source is
unchanged; the manifest still carries Odin's pins and is repointed in the
next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:10:42 +02:00
Meta Vens
d564543b70 State the stream rule once: consumers dial the producing Muninn
The input firewall rule is what any producing Muninn needs, not an input
exception or an accepted cost of Q10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:05:34 +02:00
Meta Vens
70f838dfb9 Describe the group send queue and the 250 ms default in the media doc
The streaming doc still said a request naming no latency budget got 2,000 ms
and did not mention that the sender queue is bounded, per-group, and owns the
deadline that repairs inherit. Re-anchor the two main.rs references it moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:04:39 +02:00
Meta Vens
e66c2565fb Bound the media sender: one deadline owner, whole-group drops, a drivable seam
The sender's queues were unbounded (mpsc::channel plus two VecDeques), expired
payloads one at a time so half a frame could leave after the other half died,
gave repairs a fresh deadline from the clock, spun on a 1 ms sleep, and could
not be driven without PowerShell, ffmpeg and WASAPI. The latency budget also had
two owners: a 2 s producer default that the receiver's 250 ms age never matched.

MediaSendCore (new media_send.rs) owns the queues, hub, feedback intake, repair
cache and budget, and progress counters. run_rudp_mux_once now spawns encoders,
feeds readers into the core and publishes; it decides no deadline.

- The unit is a group: one access unit with its parity, or one audio packet,
  stamped produced_at + the request's latency budget when it leaves the
  packetizer. Expiry is per group; a group is sent whole or not at all.
- Queues are capped per kind (audio 256, video 512 groups), drop the oldest
  group and count it (groups_dropped_audio, groups_dropped_video). The reader
  channel is a bounded sync_channel.
- The Annex B packetizer returns one group per access unit and no longer errors
  on pending overflow: an unfinished access unit larger than the ceiling is
  dropped and counted.
- Repairs inherit the deadline of their frame and are not sent after it. A
  blocked send polls resends and stops at the group deadline; the sleep is gone.
- MUNINN_RUDP_MEDIA_RECEIVER_ASSEMBLY_DEADLINE_MS is deleted. The default budget
  is 250 ms (Q7), used only when a request names none and offered as the
  advertisement's default_latency_budget_ms. The profile loses its three copies
  of the budget; the telemetry JSON carries one latency_budget_ms.
- A test harness drives the real readers and core over loopback through a
  seeded drop relay to a CultNet RUDP client, from a committed H.264 clip
  (testdata/clip.h264, ffmpeg command recorded beside it) and a PCM ramp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:04:17 +02:00
Meta Vens
8d869ca8df Record Q13: no live Sleipnir on Raven, H2 and H4 merge independently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:01:33 +02:00
Meta Vens
83b3947a8f Record Q11 (muninn-contracts) and Q12 (fold Move evidence in)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:58:10 +02:00
Meta Vens
fe33ce7f10 Re-map the HID cuts H0-H5 to Q9 and Q10 (Imagination pass 3)
Sleipnir moves into the Muninn workspace with its history. Input mirrors
the media request path: Muninn advertises an input stream on CultMesh, the
consumer requests it and dials. Opens Q11-Q13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:55:22 +02:00
Meta Vens
c3520d10a1 Merge realtime robustness Cuts 0-1: maps corrected, receiver residue deleted
Soul: merge after doc fixes (done in b607592). -565 lines from the producer;
no consumer of the deleted symbols in Muninn, Ratatoskr, Odin, Mimir or
StreamPixels; the bluetoothctl-dependent test now runs through a seam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:09:40 +02:00
Meta Vens
b607592be2 Correct keyframe, GOP, and provenance claims in the media docs
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 16:02:33 +02:00
Meta Vens
88f9ed7ccd Collapse the video parity wire builder to one frame; test stale-identity pruning without bluetoothctl
video_wire_records_with_parity keeps only its single-frame caller. The stale
move-identity prune is split out of reconcile_move_identity_records so its
test no longer shells out to the host Bluetooth binary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 16:02:33 +02:00
Meta Vens
66e8642f59 Record HID rulings Q9 (Sleipnir in Muninn's workspace) and Q10 (Muninn advertises input streams)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:02:10 +02:00
Meta Vens
36d6a79a2a Map Cut 6 (native encoder) and the remote-play HID cuts H0-H5
Cut 6: the donor encoder behind a C ABI in an off-default package, typed
encoder-command records on stdin, built and accepted on Raven by Idunn. HID:
muninn-contracts crate, edges carried on the latest channel with the state, no
Odin main change. Q9 (Sleipnir's home) and Q10 (who dials) open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 14:11:04 +02:00
Meta Vens
4af6c8fac4 Move test-only cultnet imports into the tests module
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:59:53 +02:00
Meta Vens
eb332b0d2e Record realtime robustness rulings Q1-Q8 (2026-09-30)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 13:55:27 +02:00
Meta Vens
a189363c23 Drop imports the receiver residue left unused
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:51:01 +02:00
Meta Vens
f2a5db9eec Subtract receiver residue from the producer (RR Cut 1)
Delete AudioPacketBuffer (receiver jitter buffer), the whole-stream Annex B
helpers (packetize_video_annex_b_stream, its options structs and wire
wrappers) and encode/decode_record_payload; only tests called them. Re-home
the packetizer-behaviour tests onto VideoAnnexBStreamSendState. Drop the five
audio_packet_buffer tests and the legacy-feedback decode test (CultLib pins
key 10 default in receiver_feedback_decodes_records_written_before_its_last_field).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:50:38 +02:00
Meta Vens
2c120c96d7 Correct the Muninn maps against git (RR Cut 0)
teardown-map.md: mark the extraction-era claims as history in place (pin,
symbol counts, diamond, live-exercise note) and correct the false claim that
the sender turns keyframe requests into an IDR. muninn-media-streaming.md:
preset p5, 848-byte chunks, 30 ms resend inside the latency-budget expiry.
Docs only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:47:40 +02:00
Meta Vens
e70db69d76 Map the realtime robustness campaign (Imagination, 2026-09-30)
Operator made the Odin muninn-bounded-realtime-send donor a campaign. FEC moves
to a CultLib cultnet-rs media_fec codec (reed-solomon-erasure) used by both
Muninn and Ratatoskr; bounded whole-frame sender; one latency owner. Q1-Q8 open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 13:46:42 +02:00
Meta Vens
f6fea00413 Bump CultLib to a8aedda for bounded fragment reassembly
cultnet-rs removed a fragment buffer only on successful reassembly and
refused new fragmented payloads once 64 sets were stranded, so any
sustained loss on a fragmenting channel ended with the receiver returning
"RUDP pending fragment-set limit reached" for every subsequent fragmented
payload. Odin is the rendezvous every other target is observed through;
a receiver that stops accepting fragmented traffic after a bounded number
of losses is the wrong failure mode for that role.

Measured on Raven at 3% loss, 12 Mbps: the old receiver dies at 3 and 6
fragments per payload, the new one delivers 91.0% and 82.7%, and the
loss amplification matches 1-(1-p)^n exactly.

The pin also carries the media stream contracts and the media delivery
option, neither of which Odin uses, and the TypeScript and Python halves
of the same eviction fix.

All 11 CultLib revs across odin-core, odin-daemon, muninn-daemon and
sleipnir-daemon move together; leaving any behind gives two cultcache-rs
copies and a DatabaseEntry that is not DatabaseEntry.

  cargo test -p odin-core -p odin-daemon -> 22 passed, 10 passed, 4 passed,
  0 failed

muninn-psmoveapi-tracker still fails to link in the build image for want
of libpsmoveapi. It declares no CultLib dependency, so the pin cannot
reach it; that is a missing native library on the builder.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 12:04:12 +02:00
Meta Vens
eccd6e0b27 Cut idunn-daemon and the vendored cultmesh fork out of Odin
Idunn now lives at https://github.com/GameCult/Idunn with its full 136-commit
history. Odin no longer contains the deployment authority that manages it.

Also removes vendor/cultmesh-rs, the private fork that had diverged from
CultLib in both directions. Its unique capability -- the RUDP document server
and the message_id correlation rework -- was reconciled into CultLib first, so
this deletes a duplicate rather than a capability. The four crates that
consumed it by path (muninn-daemon, odin-core, odin-daemon, sleipnir-daemon)
now consume CultLib at c13b6ba like everything else.

What deliberately stays in Odin: crates/odin-core/src/idunn.rs, which is Odin's
own projection of Idunn state for aggregation and is Odin's to own;
src/odin/idunn-rudp.cjs, its client for talking to Idunn; and
deployment/idunn/recipe.toml, which despite the path is Odin's own deployment
recipe expressed in Idunn's format -- it builds odin-daemon.

odin-core: 22 passed, 0 failed, unchanged across the cut. odin-daemon still
fails to compile on Windows for the pre-existing Unix-only std::os::fd reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 18:09:11 +02:00
Meta Vens
b5976d063d Sever idunn-daemon's last import from odin-core
IdunnDaemonHealthTrustBindingRecord and its schema constant moved to
cultnet-rs (GameCult/CultLib@c13b6ba). odin-core now imports them from
cultnet_rs instead of defining them, and idunn-daemon/provisioning.rs
pulls all six provider-health symbols from cultnet_rs directly, merged
into its existing cultnet_rs use block. Dropped the odin-core path
dependency from idunn-daemon/Cargo.toml — nothing in the crate reaches
odin_core:: anymore. Bumped the CultLib git rev across all six
consuming manifests to the new commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 17:43:24 +02:00
Meta Vens
731e0ed69e Bump CultLib to ae0ac0d and give odin-core its missing rmp-serde dev-dep
Moves all six CultLib pins from cbde940 to ae0ac0d, which carries the
reconciled cultmesh-rs. The delta is three commits and near-nothing in the
packages Odin consumes: a license line, two lines in cultnet-rs replication,
and one additive pub fn.

The dev-dependency is a real pre-existing defect, not fallout from the bump.
odin-core's tests use rmp_serde in crates/odin-core/src/idunn.rs but never
declared it, so the lib-test target has never compiled. Verified pre-existing:
9 errors at the old pin, 8 at the new. With the dep declared, odin-core tests
compile and 22 pass -- including idunn_records_round_trip_through_cultmesh,
which matters for the extraction this branch is preparing.

Note for anyone checking this on Windows: odin-daemon does not build here and
that is expected, not a regression. It imports std::os::fd and from_raw_fd,
which are Unix-only. Identical failure at both pins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 17:35:54 +02:00
Meta Vens
f2f6590660 Apply rustfmt
The drift was 94 hunks across 4 files, not 94 files as I described it earlier.
muninn-daemon carries almost all of it; sleipnir-daemon needed four lines.

Checked rather than assumed. Ignoring whitespace, the only remaining deltas are
trailing commas rustfmt adds when it wraps an argument list, and braces removed
from single-expression closure bodies. Both are semantics-preserving.
sleipnir-daemon's change is whitespace and nothing else.

Everything except the Unix-only odin-daemon builds; muninn and sleipnir pass 162
tests, with the same pre-existing media-channel failure.

vendor/cultmesh-rs is its own workspace so `cargo fmt` does not reach it, but it
reports no drift of its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 15:28:32 +02:00
Meta Vens
e184f48adf Consume CultCache and CultNet from CultLib instead of forking them
The CultNet submodule and the in-tree CultCache copy are gone. Both now come
from CultLib, and vendor/cultmesh-rs is the only fork left -- it too consumes
CultLib, so exactly one version of each crate spans the graph. That mattered:
mixing sources would have put two cultnet-rs crates in one build, and the types
would not have unified.

The in-flight CultMesh RUDP document server comes with it because it is a
prerequisite, not a coincidence. The previously committed CultMesh calls
assume_connected(), a CultNet method Odin's fork carried and CultLib does not,
so the old code cannot build against CultLib at all. The newer code no longer
calls it. Verified by reverting the file and watching it fail.

Three API differences needed adapting: CultLib's transport options carry a
reconnect_policy the fork lacked (7 sites), its create_ack builds the packet
straight from ack state and so cannot fail, and its transport profile owns each
channel's reliable expiry.

Everything but odin-daemon builds; odin-daemon is Unix-only and does not compile
on this machine either way. muninn and sleipnir pass 162 tests. The one failure,
rudp_media_transport_options_follow_low_latency_profile, expects an Unreliable
media channel while every CultNet lineage including both revisions Odin had
pinned declares it Reliable, so it failed before this change too.

The in-flight idunn-daemon work is deliberately left uncommitted; the committed
tree was verified to build without it. Also left alone: the untracked
odin-daemon crate and deployment recipe, and the root manifest, whose now-dead
vendor excludes are inert. That recipe still requires the vendor/cultnet-rs
gitlink and will refuse admission until that line is dropped -- the fix is in
the working tree, waiting on that directory being tracked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 14:54:58 +02:00
Meta Vens
6d98624792 Expose Sleipnir input mirror latency 2026-07-06 22:11:14 +01:00
Meta Vens
254d63dd54 Rework Odin transport ownership and service names 2026-07-04 22:38:43 +01:00
28 changed files with 9843 additions and 2777 deletions

38
Cargo.lock generated
View file

@ -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"

View file

@ -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" }

View file

@ -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

View 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"

View 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()
}
}

View 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,
}

View file

@ -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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

BIN
crates/muninn-daemon/testdata/clip.h264 vendored Normal file

Binary file not shown.

View 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

View 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"

File diff suppressed because it is too large Load diff

View file

@ -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.

View file

@ -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,

File diff suppressed because it is too large Load diff

View 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.

View file

@ -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.

View file

@ -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

View file

@ -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)"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"
}

View file

@ -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
"@

View file

@ -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)"
}
}