Commit Graph

107 Commits

Author SHA1 Message Date
Reese Norris
73487b7b67 fix: address review feedback for sweatbox e2e 2026-07-17 20:57:33 -04:00
Reese Norris
d60bda0257 server: e2e sweatbox visibility, FP, delete, kick/kill lifecycle 2026-07-17 20:57:33 -04:00
Reese Norris
331b711d8f server: service HTTP sweatbox API (gated)
Register /sweatbox/* on service HTTP only when SweatboxHost is allocated
(SWEATBOX_ENABLED). Same fsd_service JWT + Administrator middleware as
existing routes. 2 MiB body limit on airport/scenario/command payloads.
2026-07-17 20:57:31 -04:00
Reese Norris
2b4a0a9435 server: SweatboxHost registers synthetic pilots with Cancel-safe lifecycle
Wire the pure sweatbox engine to FSD sessions with dual bookkeeping:
claim before Register, post-Register commit check, abortFailedAdd vs
cleanupSyntheticSession, AfterFunc pointer-scoped only (stopAF before
Cancel on intentional Remove), engine.Delete only if owned.

Also: FPL encode goldens, PackPBH round-trip, kick/$!! Remove for
Synthetic, SWEATBOX_ENABLED default false (TestServer true), tick apply
with map + same-pointer Find, State merges session FlightPlan.
2026-07-17 20:57:30 -04:00
Reese Norris
3181f0c6de fix: address review feedback for sweatbox kinematics
- Taxi follows polyline until hold waypoint (no corner-cut to future holds)
- Align dep runway heading on CTO from hold-short / in-position (tick + command)
- Regression tests for Issues 1–2
2026-07-17 20:57:28 -04:00
Reese Norris
0bb2b836e0 sweatbox: kinematics tick for taxi and vectors
Implement pure motion.go and expand Engine.Tick(dt):
- paused / dt<=0: freeze motion and elapsed
- taxi along TaxiWaypoints at ground speed; stop at holds; honor hold/res/cross
- takeoff when ClearedTakeoff: accelerate, climb to initial climb, then Departing
- air vectors: turn (TurnDir), climb/descend, speed change; position integration
- TickResult returns value-copy snapshots only (no shared pointers)
2026-07-17 20:57:28 -04:00
Reese Norris
3647eb3d12 sweatbox: fh/cm/spd and fp/vp domain updates
Wire P0c air-vector and flight-plan instructor commands through Engine.Command.
Set DesiredHeading/Alt/Speed (and TurnDir/ImmediateHeading for fhn) plus plan
fields for PR4 Tick and host FPL encode; no kinematics or wire encoding.
2026-07-17 20:57:13 -04:00
Reese Norris
6ed5f7ae46 fix: address review feedback for sweatbox ground commands
Derive DepRunway from instructor taxi tokens (preserve RwyB ends); clear
DepRunway on non-runway re-taxi; add regressions and minor dispatch cleanups.
2026-07-17 20:56:59 -04:00
Reese Norris
f23a04c846 sweatbox: taxi/hold/cross/cto command dispatch
Wire P0b ground commands through Engine.Command using PlanTaxi for routes.
Set SimAircraft taxi path, hold-short, and takeoff-clearance state for PR4 Tick.
2026-07-17 20:56:59 -04:00
Reese Norris
a397d6ef6d fix: address review feedback for sweatbox engine skeleton
Reject NaN/Inf geometry on add; clear Ident on ss; combined runway
name defaults to RwyA; simplify rules switch; test SetMaxAircraft
below current count.
2026-07-17 20:56:58 -04:00
Reese Norris
400facfacb sweatbox: engine skeleton with add/del/pause/ops
Add pure Engine (mutex, pause/elapsed/ops, max 64 AC) with LoadAirport,
LoadScenario (auto-pause), Tick elapsed-only, Snapshot, and instructor
commands: add (approach/parking/bearing), del, p/un, ops/stats, pos,
sq/sqi/sn/ss, id. Callsigns from airline lists/registration; domain-only
DTOs for host integration later.
2026-07-17 20:56:58 -04:00
Reese Norris
7e1b314740 fix: address review feedback for sweatbox taxi planner 2026-07-17 20:56:56 -04:00
Reese Norris
4eb7cb3ca9 sweatbox: intersection graph and taxi planner 2026-07-17 20:56:56 -04:00
Reese Norris
e014579aee session: Synthetic flag; skip synthetic recipients on all fan-out
Add Session.Synthetic so in-process sweatbox participants can register
in the postoffice without receiving human fan-out traffic. All six
broadcast helpers skip synthetic recipients.
2026-07-17 20:56:54 -04:00
Reese Norris
4180e12c5c fix: address review feedback for sweatbox parsers 2026-07-17 20:56:53 -04:00
Reese Norris
cb8bd24d63 sweatbox: add .apt/.air parsers and KBTV fixtures
Introduce pure internal/sweatbox package with TWRTrainer-compatible
airport and scenario parsers, fixtures, unit tests, and import-graph
ownership rules. No server wiring.
2026-07-17 20:56:53 -04:00
Reese Norris
e0d7532423 feat: make openfsd SQLite-only with Postgres migration tool
Drop runtime PostgreSQL support (repos, dual migration trees, driver
selection). Reject non-sqlite DATABASE_DRIVER at startup with a pointer
to the cutover path. Add openfsd-migrate-to-sqlite (unit + embedded-
Postgres e2e), wiki docs for operators, and the sweatbox integrated
simulator design doc.
2026-07-17 16:09:55 -04:00
Reese Norris
7556e5491a docs: rewrite FSD protocol docs for openfsd and modern VATSIM
Align about, protocol, CAPS, auth token, enumerations, and VATSIM auth
pages with current wire behavior, openfsd notes, and clearer structure.
2026-07-17 14:11:28 -04:00
Reese Norris
08d4b13fa4 default DATABASE_AUTO_MIGRATE to true
Align config default with README so FSD applies migrations on startup without an env override.
2026-07-17 13:59:22 -04:00
Reese Norris
e8f7e4e8db ci: re-run after GHCR package Actions write access 2026-07-17 13:53:09 -04:00
Reese Norris
acee8e7066 ci: fix geo coverage floor and harden GHCR push job
Cover QuantizeDeg non-positive quantum path so internal/geo hits 100%
(floor was failing at 96.9%). Grant actions:write for GHA cache, allow
optional GHCR_TOKEN, and document package Actions access for write_package.
2026-07-17 13:50:39 -04:00
Reese Norris
9735fb6c6b docs: align agent rules and READMEs with settled layout
Drop phased PR0–PR17 planning and legacy dual-binary notes. Document
current package ownership, coverage floors, and single-binary ops.
Scrub stale script/lint comments; allow web→server DTO import edge.
2026-07-17 13:44:29 -04:00
Reese Norris
919311df85 ci: build single binary and publish GHCR image on main/dev
Test builds ./cmd/openfsd only. Docker job builds on PRs and pushes
:latest, :dev, and sha tags on push to main and dev.
2026-07-17 13:44:29 -04:00
Reese Norris
8ec753ddf9 chore: ship one Docker image for FSD and web
Replace Dockerfile_fsd/Dockerfile_web with a single Dockerfile that
builds /openfsd. Compose runs one service exposing 6809 and 8000.
2026-07-17 13:44:29 -04:00
Reese Norris
295b7887ee feat: unify FSD and web into a single openfsd binary
Run both services by default, or select with -fsd / -web. Shared DB
layer is unchanged; colocated web defaults FSD service HTTP to localhost.
Remove the separate cmd/openfsd-web entrypoint.
2026-07-17 13:44:25 -04:00
Reese Norris
0f86688790 fix: race-safe large-N postoffice tree and SendPosition cancel path
Gate Search on treeReady so rebuild cannot race with concurrent
Register; serialize tree mutations under treeLock. Check session
cancel in SendPosition so fan-out skips dead peers. Add concurrency
and UX contract tests plus overridable linear threshold for large-N
coverage.
2026-07-17 13:36:23 -04:00
Reese Norris
2e37ed08b8 perf: lock-free postoffice path and non-blocking position send
Speed up dense position fan-out with atomic live snapshots for N≤2048,
equirectangular DistanceSq filtering, and SendPosition latest-wins
drops so slow peers cannot stall broadcasters. Ignore SQLite WAL/SHM
sidecars so local operator DBs are not staged by accident.
2026-07-17 13:26:19 -04:00
Reese Norris
b08536543f feat: answer $CQ SERVER:CAPS for vatSys compatibility
Advertise only implemented server flags (no SECPOS), document the full
capability inventory from vatSys research, and cover the path with unit
and e2e tests.
2026-07-17 13:22:01 -04:00
Reese Norris
69a3a4aea1 fix: align Bearer middleware tests with dual-accept; restore PR17 stack tip 2026-07-16 12:39:46 -04:00
Reese Norris
a1ebb6f1a5 fix: address review feedback for stress and coverage
Add workflow_dispatch for stress; true handler-to-enqueue sampling;
strengthen weak asserts; broadcast bench; pure package floors; compose smoke note.
2026-07-16 12:37:55 -04:00
Reese Norris
a6c2167a93 test: stress baselines; coverage ≥80%; dead code cleanup
Record stress baselines without absolute CI latency fails; raise cover floor;
README layout; residual cleanup.
2026-07-16 12:37:55 -04:00
Reese Norris
e69b6214d5 fix: address review feedback for PE admin forms
Enforce updateUser API rating ceiling; form elevation tests; db.Config* keys.
2026-07-16 12:37:53 -04:00
Reese Norris
289aa09f08 web: no-JS user/config forms; dashboard summary; vanilla map
PE admin mutations with CSRF; server-rendered dashboard; map credentials same-origin.
2026-07-16 12:37:53 -04:00
Reese Norris
1970257d27 fix: address review feedback for PE baseline security
CSRF only skipped after successful Bearer auth; fsd-jwt verifies
password; reject suspended form login; document XFP/Secure; regression tests.
2026-07-16 12:37:51 -04:00
Reese Norris
ef1a883b48 web: PE baseline — form login, signed session, CSRF, gates, drop jQuery
Stateless session cookie; dual-accept API auth; no-JS login path.
2026-07-16 12:37:51 -04:00
Reese Norris
05dc2137a3 fix: address review feedback for web API tests
Verify password on /fsd-jwt; expand Bearer/config token coverage.
2026-07-16 12:37:49 -04:00
Reese Norris
06d2450541 test(web): API httptest; move FSD main to cmd/openfsd
Bearer API tests; Dockerfile_fsd builds cmd/openfsd as fsd.
2026-07-16 12:37:49 -04:00
Reese Norris
5ece0b184d fix: address review feedback for internal/web
Return fs.Sub errors from setupRoutes/Run; parse HTML templates once in NewServer without panic.
2026-07-16 12:37:47 -04:00
Reese Norris
65ec62a738 refactor: internal/web importable; cmd/openfsd-web; Docker embed-safe
Move web package; no init panic; Dockerfile_web builds cmd/openfsd-web as fsdweb.
2026-07-16 12:37:47 -04:00
Reese Norris
a2045c1c0d fix: testserver imports internal/db after package move 2026-07-16 12:37:45 -04:00
Reese Norris
0c59003da5 fix: address review feedback for internal/db
gofmt import order: internal/auth before internal/db.
2026-07-16 12:37:34 -04:00
Reese Norris
0db5a9d4c6 refactor: move db to internal/db
Preserve migrations embed; update all imports; no schema change.
2026-07-16 12:37:34 -04:00
Reese Norris
99edfba1f3 fix: address review feedback for e2e suite
M1 pre-bound HTTP listener + timed readiness client; M2 frequency
broadcast e2e; M3 predicate polls (no bare sleep asserts); L1 Listen
passthrough; L3 METAR path map; L4 join HTTP before DB close; L5 WaitGroup;
L2 multi-send absence window; L7 online_users lat/lon/alt asserts.
2026-07-16 12:37:33 -04:00
Reese Norris
ebf4759e3f test(e2e): real server + fsdclient scenarios
StartTestServer seeding; pilot/ATC login, range, text, FP, METAR mock, kill.
2026-07-16 12:37:33 -04:00
Reese Norris
eeaacaf283 fix: address review feedback for handler tests
Snapshot Search/All under lock; pointer exclude; kill no-op assert.
2026-07-16 12:37:31 -04:00
Reese Norris
8180994186 test: handler table tests + split handler_*.go
Split handlers by domain; fake Registry unit tests.
2026-07-16 12:37:31 -04:00
Reese Norris
2f2e96f90f fix: address review feedback for server DI
handleKickUser return; MetarQueue.Run; registry sentinel re-exports; compile-time store asserts.
2026-07-16 12:37:16 -04:00
Reese Norris
5c1008c342 refactor: server.Deps injection; cmd-friendly bootstrap; no panic main
Move FSD orchestration to internal/server with injectable Deps; main exits 1 on error.
2026-07-16 12:37:16 -04:00
Reese Norris
a733f584e1 fix: address review feedback for internal/metar
Default client Timeout+no-redirect; merge Run/session ctx for in-flight Do;
nil sender success guard; Request aligns with MetarQueue (3-arg).
2026-07-16 12:37:01 -04:00
Reese Norris
4b10a3135b refactor: internal/metar injectable HTTP
Worker pool with injectable HTTPDoer; context; slog; session.Sender delivery.
2026-07-16 12:37:01 -04:00