twin-playback

Record and replay digital-twin tag streams deterministically through the Godot viewer's DataBus.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/arthur0n/xenodot-twin --skill twin-playback-arthur0n
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: twin-playback
Source: https://github.com/arthur0n/xenodot-twin/tree/main/plugin/skills/twin-playback
Command: npx skills add https://github.com/arthur0n/xenodot-twin --skill twin-playback-arthur0n

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Live telemetry sessions in a Godot digital-twin viewer are ephemeral and hard to reproduce, making it impossible to scrub history, demo recorded data, or verify that playback behaves identically across runs. ## Core Features & Use Cases - NDJSON recording contract: A pinned twin-recording format (header with version, hz, seed, and tag table, then timestamped frames) shared by the Node.js recorder and the Godot parser so the two sides cannot drift. - Two recorder modes: Synthesize byte-reproducible fixtures from a seed with node tools/sim/record.js, or capture a live WebSocket stream stamped with seed:-1. - Deterministic playback player: core/playback.gd replays recordings through the same DataBus.inject_frame seam live data uses, with load/seek/play/pause/speed controls and an amber PLAYBACK honesty indicator. - Determinism gate: tools/check_playback.gd runs the shipped runtime twice and asserts identical PLAYBACK-HASH values, catching player bugs and input divergence. - Use Case: Record a 30-second plant telemetry fixture, scrub it in the viewer timeline, then run the two-leg determinism check to prove a playback change did not alter emitted state. ## Quick Start Record a synthesized fixture with node tools/sim/record.js --out fixture.ndjson --seconds 30 --seed 42, then replay it in the viewer and verify determinism via tools/verify_twin.sh.

Frequently Asked Questions about twin-playback

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I record a digital-twin telemetry session for replay?

Run node tools/sim/record.js with --out and either a seed for a synthesized fixture or --url ws://host:port for a live capture. Fixture mode is byte-reproducible per arguments and prints a sha256; live mode stamps seed:-1 and derives hz from observed cadence.

How do I replay a recording in the Godot twin viewer?

Pass --recording=<path> as a user argument or set recording= under [twin] in viewer.cfg. The player loads the NDJSON file, switches DataBus to MODE_PLAYBACK, and replays frames through the same inject_frame seam live data uses.

What is the twin-recording NDJSON format?

Line one is a header with version, kind, hz, seed, and a tag table with min/max ranges; every following line is a frame with t_ms, tag, value, and seq. Validation is strict: a bad header, non-monotonic t_ms, or unknown tag fails the whole load without crashing the viewer.

Can I use a live capture for the playback determinism gate?

No. The determinism gate only accepts synthesized fixtures with seed >= 0, because byte-reproducibility is the foundation of the check. Live captures have seed:-1 and non-zero-based seq values, so they are observation only and never reproducible anchors.

Why does playback seek emit one snapshot frame per tag?

Seek clamps to the recording duration and emits the last frame at or before the target time for each tag, in fixed header-tag order. This pinned ordering keeps runs deterministic, and tags with no frame yet emit nothing.

What speed range does the playback player support?

Speed is clamped between 0.25x and 8.0x via SPEED_MIN and SPEED_MAX, matching the timeline bar's SPEED_STEPS. Zero or negative values are excluded because the ascending-t_ms format cannot express a stalled or reversed clock.