No description
  • C++ 92.8%
  • Python 3.6%
  • CMake 2.5%
  • Shell 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tim Janke e5948c2c06
Some checks failed
CI / style (clang-format + clang-tidy) (push) Failing after 11s
CI / build-test (Linux) (push) Failing after 11s
CI / asan (Linux) (push) Failing after 12s
✅ (test): Upload to the real backend, not only to the mock
Every suite here talked to tools/mock-server, and the backend's suite signed
chunks with its own code. Neither proved the pair, and that is exactly where the
last three bugs lived: the mock completing orders on the wrong event, the mock
dropping events that share a sequence number, and the plugin never emitting the
event the backend closes a flight on. All three were invisible because every
test ran against its own stand-in.

This records a flight through the real recorder and uploads it through the real
session to a real flyg-backend. The assertion is that the session completes,
which is stronger than it looks: completion requires the server to have acked
through the footer's last sequence, and it only acks a chunk whose signature it
recomputed and matched. Passing means the socket authenticated, the wire format
decoded, two independent implementations of SHA-256 and the key derivation
agreed, and every record was stored.

It skips itself unless FLYG_BACKEND_URL and FLYG_DEVICE_TOKEN are set, so it
never fails a build with no backend to talk to. tools/live-backend-test.sh seeds
a device and runs it. Pairing needs a browser and a passkey, so the device row
is the one thing the script fakes; the upload is real.

Run against a backend on this machine, a flight arrived COMPLETED and VERIFIED
with its forty samples, its events and its snapshot, route included.
2026-09-07 01:33:22 +01:00
.github/workflows 👷 (ci): Build on the runner this repository actually has 2026-09-07 01:25:18 +01:00
cmake ➕ (proto): Track the shared flyg proto repo as a submodule 2026-08-03 15:52:42 +02:00
core 🔒 (core/crypto): Derive the chunk signing key from the device token 2026-09-07 01:09:01 +01:00
docs 👷 (ci): Build on the runner this repository actually has 2026-09-07 01:25:18 +01:00
proto@10ff156171 ✨ (core/net): Send the record bytes a chunk's signature covers 2026-09-07 01:00:55 +01:00
src ♻️ (core/restore): Decide a journal's fate in core, not in the adapter 2026-09-07 00:56:07 +01:00
test ✅ (test): Upload to the real backend, not only to the mock 2026-09-07 01:33:22 +01:00
third_party ➕ (deps): Add IXWebSocket submodule 2026-07-23 10:43:00 +02:00
tools ✅ (test): Upload to the real backend, not only to the mock 2026-09-07 01:33:22 +01:00
.clang-format 🔧 (repo): Accept the clang-format config on LLVM 18 and 19 2026-09-05 21:24:17 +01:00
.clang-format-ignore 🎉 Start of the re-implementation of the X-Plane 12 plugin 2026-07-21 14:40:44 +02:00
.clang-tidy 🎉 Start of the re-implementation of the X-Plane 12 plugin 2026-07-21 14:40:44 +02:00
.editorconfig 🔧 (repo): Add repository scaffolding 2026-07-21 15:01:31 +02:00
.gitignore ✨ (mock-server): Add Python server with device-flow endpoints 2026-07-23 10:17:00 +02:00
.gitmodules ➕ (proto): Track the shared flyg proto repo as a submodule 2026-08-03 15:52:42 +02:00
CHANGELOG.md 📝 (docs): Document crash recovery 2026-09-06 22:06:48 +01:00
CLAUDE.md ➕ (proto): Track the shared flyg proto repo as a submodule 2026-08-03 15:52:42 +02:00
CMakeLists.txt ➕ (proto): Track the shared flyg proto repo as a submodule 2026-08-03 15:52:42 +02:00
CMakePresets.json 👷 (ci): Add CI workflow for build, test and style 2026-07-21 15:34:48 +02:00
README.md 👷 (ci): Build on the runner this repository actually has 2026-09-07 01:25:18 +01:00

flyg — X-Plane 12 plugin

flyg is the in-simulator client of the flyg platform (virtual aircraft rental/ownership, jobs, economy). It records verifiable flight tracks, streams them live with a crash-safe offline buffer, and applies platform actions (such as purchased fuel) inside X-Plane 12.

Status: pre-alpha. Requires X-Plane 12.1 or newer.

What it does

  • Records every flight to a crash-safe, append-only journal on disk — no flight is lost to a network drop, backend outage, or sim crash.
  • Streams live over a WebSocket with ack-based trimming, falling back to HTTPS and resuming cleanly after interruptions.
  • Derives flight intelligence — phases (taxi → takeoff → … → shutdown), touchdown rate, and anomaly flags (pause, time acceleration, teleport, fuel jumps, replay, clock drift) — so nothing about a flight is a surprise.
  • Applies platform fuel while parked (engines off, brake set), verifying the write and flagging aircraft that ignore it.
  • Survives a simulator crash — snapshots the aircraft's configuration as you fly, then puts it back and carries on recording the same flight, with the gap declared for the backend to judge.
  • Pairs to your account with a device-code flow, all from a minimal in-sim status window; everything else lives on the website.

Milestones

Milestone Scope Status
M0 Skeleton: build, schemas, CI, style gate, ImGui window ✅
M1 Recorder: sampler → crash-safe journal, trackdump ✅
M2 Auth: device-code flow + mock server ✅
M3 Live tracking: WS streaming + offline re-upload ✅
M4 Flight intelligence: phases, events, anomalies ✅
M5 Fuel + jobs: set_fuel, job display ✅
M6 Release readiness: update check, docs, packaging ✅
M7 Orders: rental checks, fuel/payload writes, auto-start ✅
M8 Integration: recording events close a flight, auto-stop ✅
M9 Crash recovery: aircraft snapshots, resume an interrupted flight ✅

Build

cmake --preset dev && cmake --build --preset dev   # -> build/dev/flyg/lin_x64/flyg.xpl
ctest --preset dev

See docs/INSTALL.md to install and pair, and to develop against the bundled mock backend.

Documentation

Contributing

First-party C++ follows docs/guides/cpp-style.md, enforced by ./tools/check-style.sh (clang-format is the hard gate). Commits use :gitmoji: (scope): Imperative subject with no trailers. Run the full green check — configure + build + ctest + check-style.sh — before every commit.