Commit Graph

92 Commits

Author SHA1 Message Date
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
Reese Norris
3648f1b5cf fix: address review feedback for internal/postoffice
Strengthen TestImportGraph with go list -deps closure checks; fail hard if source packages fail to load.
2026-07-16 12:36:37 -04:00
Reese Norris
2cb4036adf refactor: internal/postoffice Registry DI; import-graph test
Move registry out of fsd; lock-order docs; Snapshot for HTTP; import-graph checks.
2026-07-16 12:36:37 -04:00
Reese Norris
f26d3d36a4 fix: address review feedback for internal/session
Soften FacilityType ownership docs; store ATC frequency; session unit tests; Conn write discipline docs.
2026-07-16 12:36:00 -04:00
Reese Norris
4949789ae7 refactor: internal/session; unify sendError; slog; field ownership docs
Single Client→Session rename wave. Session owns send channel; no postoffice import.
2026-07-16 12:36:00 -04:00
Reese Norris
f74067b6cd fix: address review feedback for pkg/fsdclient
M1 Next ReadTimeout min with ctx; M2 login writeMu/CAS; IsATC;
Raw copies; full KnownAuthKeys; IsSendFast; ManualClock mutex;
simplify $DI; flake-free line collector tests.
2026-07-16 12:35:40 -04:00
Reese Norris
0518ad6099 feat(pkg/fsdclient): protocol-faithful FSD client
Dial, login (password/JWT), positions, recorder/WaitFor; imports protocol only.
2026-07-16 12:35:40 -04:00
Reese Norris
d42d472484 fix: address review feedback for internal/auth
Add odd-client/%3 branch VATSIM goldens; MakeJwtToken returns *JwtToken.
2026-07-16 12:35:39 -04:00
Reese Norris
0da82ca395 refactor: extract internal/auth (JWT + VATSIM)
Move JWT and VATSIM auth out of fsd; web imports auth+protocol.
2026-07-16 12:35:39 -04:00
Reese Norris
81e1936e21 fix: address review feedback for internal/geo 2026-07-16 12:35:38 -04:00
Reese Norris
a49eeeb95e refactor: extract internal/geo; postoffice unit/bench
Pure haversine and bounding-box helpers; fsd postoffice uses geo package.
2026-07-16 12:35:38 -04:00
Reese Norris
6715b33601 fix: address review feedback for pkg/protocol
Document Field negative-index contract, drop unreachable prefix
checks (100% coverage), remove duplicated fsd rebaseToNextField.
2026-07-16 12:35:37 -04:00
Reese Norris
b899f56871 refactor: extract pkg/protocol with golden vectors
Pure wire-format package with goldens from docs/protocol.md and
differential adapters in fsd. Coverage floor for protocol package.
2026-07-16 12:35:37 -04:00
Reese Norris
5379dc7c7c fix: address remaining AGENTS.md nits 2026-07-16 12:35:36 -04:00
Reese Norris
2ea1fd587c fix: address review feedback for AGENTS.md and tooling
Avoid double race suite, stdlib-only import checks, recursive package
scan, cmd/ coverage filter, hygiene log.Print, design path, gofmt CI.
2026-07-16 12:35:36 -04:00
Reese Norris
514562055a chore: AGENTS.md acceptance criteria, golangci-lint, coverage report
Operational agent criteria, lint config, soft coverage report, and CI hygiene hooks.
2026-07-16 12:35:36 -04:00