Commit Graph
170 Commits
Author SHA1 Message Date
Sameh Khamis b641ad2019 fix: integrate bounded trackpad pinch zoom 2026-09-20 19:49:07 -07:00
Sameh Khamis a948274326 Merge origin/main into fix/realtime-debug-log-hardening
# Conflicts:
#	CHANGELOG.md
#	src/tooling/localServices.test.mjs
2026-09-20 19:19:49 -07:00
Sameh Khamis 2608f187d3 fix: sanitize rejected Realtime token responses 2026-09-20 17:45:43 -07:00
Sameh Khamis a88904a02f Merge origin/main into fix/sanitize-openai-proxy-errors 2026-09-20 17:42:54 -07:00
Sameh Khamis 9ad64112dc fix: report OpenSky Basic and auto modes accurately 2026-09-20 16:43:16 -07:00
Sameh Khamis a716b059b8 Merge origin/main into fix/issue-362-opensky-doctor 2026-09-20 16:43:01 -07:00
Sameh Khamis 5d684c22b3 Merge origin/main into fix/ais-unavailable-sog-cog
# Conflicts:
#	CHANGELOG.md
#	docs/CURRENT-STATE.md
2026-09-20 16:33:53 -07:00
Sameh Khamis 6eeb2fce11 Merge origin/main into fix/ui-dark-select-palette
# Conflicts:
#	CHANGELOG.md
2026-09-20 16:21:29 -07:00
GGPOShadowsandClaude Opus 5 5e99adc978 fix(tomtom): size the daily tile budget to the real free allowance
TOMTOM_DAILY_TILE_BUDGET defaulted to 40,000 per day against a free
tier that is granted per MONTH, not per day. TomTom currently allows
200,000 Traffic Flow & Incidents tile requests per month
(https://docs.tomtom.com/pricing/), so the default exhausted a user's
entire monthly allowance in five days and left the traffic layer dead
for the rest of the billing period.

The docs contradicted themselves on this. traffic.js described the
free tier as "~50k/day", while .env.example cited the correct 200K
per month two lines below quoting the same 40,000 default. 50k/day
would be 1.5M/month, 7.5x the actual allowance.

Sets the default to 6,000/day. A 31-day month lands at 186,000,
inside the allowance with headroom. Corrects the stale figures in
traffic.js, .env.example and DATA_SOURCES.md.

This remains an application-side safety ceiling, not a billing cap,
and the surrounding text still says so. TomTom's free tier requires
no card, so overrunning it cuts the layer off rather than generating
a charge — but a layer that dies three weeks into every month is
still worth avoiding by default.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-19 22:44:19 -07:00
Uday S 59b2637fb7 fix: render native select option lists in the dark palette 2026-09-19 00:06:19 -04:00
Theerayut BoonkirdandClaude Opus 5 b0f5072347 docs: record the AIS unavailable-code handling
CONTRIBUTING asks for docs/CURRENT-STATE.md and CHANGELOG.md in the same PR
as a runtime behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-18 00:41:06 +01:00
Sameh Khamis a25ee64209 fix: distinguish partial vessel snapshots from stale data 2026-09-16 11:52:26 -07:00
manjunath22466 621d186de1 fix: scope Nepal media playback to explicit scene actions 2026-09-16 12:14:15 +05:30
manjunath22466 cf0b9927de Merge public main into Nepal media follow-up 2026-09-16 10:40:29 +05:30
Sameh Khamis 078fc290ec Add Director authoring, import previews and scene bundles 2026-09-15 20:15:32 -07:00
Sameh Khamis 80027756ef feat: add declarative Director feature actions 2026-09-15 19:16:49 -07:00
Sameh Khamis 92526e9a92 feat(director): add bounded scene data packs and placement 2026-09-15 17:59:53 -07:00
Sameh Khamis 13c0b8d1bc feat(director): add authored camera directions and anchors 2026-09-15 16:53:26 -07:00
Sameh Khamis 18300e7e00 feat(director): validate scene documents and preserve saved edits 2026-09-15 16:20:36 -07:00
Sameh Khamis 8a3c4868b0 refactor(director): separate timing clocks and scene pack presentation 2026-09-15 15:41:42 -07:00
Sameh Khamis e7970c50b7 fix(voice): discard continuations from closed conversations 2026-09-15 12:13:35 -07:00
Sameh Khamis aa6804802c Merge remote-tracking branch 'origin/main' into refactor/realtime-owners 2026-09-15 12:05:07 -07:00
Sameh Khamis cc9a080f2d refactor(voice): separate Realtime state and resource owners 2026-09-15 12:05:01 -07:00
Bilawal Sidhu 0bb61f53c6 fix(transit): keep the real silhouettes under sensor presets, make the selected trail visible, put Transit in Movement (#596)
## Changes

Follow-up to #587 after the owner's first look at the merged transit layer on Google 3D tiles.

- **Sensor presets keep the real silhouettes.** Under NVG, thermal (white-hot, black-hot, Ironbow) and noir, vehicles are the same silhouettes as in normal view, filled opaque white with a 2 px dark halo, at the CRT display sizes (26 px fleet, 39 px selected). The solid rounded "signature" bodies are gone.
- **The selected vehicle's trail is visible.** The retained history is now draped onto 3D tiles and terrain (`GroundPolylinePrimitive`, `ClassificationType.BOTH`, the way the traffic heat-lines are drawn), 3 px core over a 5 px dark backing, per-segment age colour, a short draped head clipped to the sprite. Two defects kept it off screen before: Cesium's per-instance attribute getters return copies, so the renderer's show/colour edits were discarded, and a marker did not recover after the camera jumped to it, which hid the trail with it. Trail geometry is now prepared on selection independent of floor resolution and marker visibility; sparse long intervals (rail) keep a bounded marker corridor instead of dropping the interval; classification survives map-source changes.
- **Transit sits in the Movement panel group** between Street Traffic and Bike Share (the panel orders by `PANEL_GROUPS`, not by catalog order; the catalog is moved too).

## How it was verified

- `npm run format:check` (854 files), `npm run check:boundaries`, `npm test` (4,062 passing), `npm run build` clean; tracking regression 109/109 in a real browser on Google 3D tiles.
- Browser harness (`scripts/qa-transit.mjs`), keyed on Google 3D tiles and keyless: keyed 194 pass, with the trail pixel check passing at 300, 600 and 900 m; the remaining keyed failures are the per-frame allocation gate already recorded as a follow-up from #587 (CPU and frame time within budget), four readability lines at threshold edges, and the card-anchor check now counting frames where the selected marker is legitimately off screen; keyless 193 pass with the remaining misses being threshold edges on the thin tram silhouette (centre 0.83–0.88 against 0.85) and one bus ring 0.28 against 0.25 on a pure-white roof.
- New harness checks: `Google 3D selected trail visible at 6 of 8 projected samples` (repeated off/on framebuffer captures at 300/600/900 m, samples outside the sprite footprint, a background-change negative control; fails on main, passes here), a camera-arrival check (select a moving vehicle, `setView` onto it, marker shown and trail body drawn within 2 s), `PANEL_ORDER` pinned, raster tests comparing every sensor raster's mask and aspect ratio to the normal silhouette.
- Direct look on a keyed build: a live CapMetro bus at 30 m/s selected through the layer API draws its draped trail along the highway lane (harness capture `keyed-600m-trail-visible.jpg`).
- Adversarial review by Codex Astra before the last two fix passes (stack-switch classification, marker corridor under the vertex cap, pixel-gate loophole), all three fixed with regressions.

Docs: `docs/CURRENT-STATE.md` and `CHANGELOG.md` updated in this PR. No data-source changes.
2026-09-15 13:26:41 -05:00
manjunath22466 94f83c59de fix: prevent Nepal media from opening external browsers in Pinokio 2026-09-15 23:54:07 +05:30
Sameh Khamis bfefa875e1 refactor: separate application shell state and lifecycle owners 2026-09-15 11:17:10 -07:00
Sameh Khamis 9f7adf71f6 refactor: extract reusable Director playback 2026-09-15 10:15:12 -07:00
Pedro Lobato 92350b8412 Merge remote-tracking branch 'origin/main' into fix/sanitize-openai-proxy-errors
# Conflicts:
#	CHANGELOG.md
2026-09-15 11:58:25 -05:00
Pedro Lobato 4fd168ff3c Merge remote-tracking branch 'origin/main' into fix/realtime-debug-log-hardening
# Conflicts:
#	CHANGELOG.md
2026-09-15 11:49:03 -05:00
Sameh Khamis fd6106ee01 Merge current main into map-feature refactoring 2026-09-15 08:41:34 -07:00
Sameh Khamis a9482f0a5b fix: cancel Nepal media preloads and respect drawing ownership
Retain active-flight preloading while canceling hidden frames and pending Facebook sessions on stop, disable, and replacement. Add lifecycle and pointer-ownership regression coverage. Apply the runtime formatting adopted on main and keep the existing source-shape check insensitive to that formatting.
2026-09-15 08:29:01 -07:00
Sameh Khamis 1a936ebac1 Merge current main into Nepal flood contribution 2026-09-15 08:24:37 -07:00
Sameh Khamis bf1d50f29b refactor: separate map feature queries and source records 2026-09-15 08:10:32 -07:00
Sameh Khamis 3155e4e0bf refactor: separate transit sources and request service 2026-09-15 07:41:56 -07:00
Sameh Khamis ae99843c14 build: discover owned runtime modules in the formatter gate 2026-09-15 07:26:32 -07:00
manjunath22466 60768ccc0b feat: add Nepal flood incident scene 2026-09-15 19:48:11 +05:30
Bilawal Sidhu 76c20be277 feat(transit): live public-transit vehicles from open GTFS-Realtime feeds (#587)
Supersedes #218 by @spcpza, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Contributor: @spcpza. His original commit is the base of this branch, and his own re-port onto main (2026-09-15, `5b69011`) was consulted while finishing the height work. That port reads every vehicle's surface from the app's shared ground-floor system (`cachedGroundFloor` / `warmGroundFloor` / `GROUND_FLOOR_LIFT_M`) rather than sampling the scene per layer, keeps a vehicle hidden until its cell answers, warms a bounded batch per poll on a timer instead of per frame, and renders at the ellipsoid above the altitude gate. That is the sounder primitive — one floor system for the app, with the rooftop-versus-street question already settled against a datum-correct DEM prior — and this branch's height work was rebuilt on it, replacing a bespoke cell cache, ground prior and rooftop rule written here. Credit for that direction is his.

Future work (not in this PR), both written up in docs/CURRENT-STATE.md:

- Readable route names. The realtime feeds carry only `route_id`; `route_short_name` / `route_long_name` live in each operator's static GTFS `routes.txt`, and headsigns in `trips.txt`. Doing it properly wants a server-side metadata loader beside the transit proxy with fixed registered static sources, bounded indexes built once and persisted, a slow conditional refresh, and a versioned route dictionary the browser caches. Shipped here: ids are never rewritten, and a cut one carries an ellipsis instead of reading as a typo.
- Below-ground rendering. Subway vehicles are drawn on the surface directly above themselves, because the feeds carry no depth and a train nobody can see is not worth drawing; the card says so plainly. Real treatment wants OSM tunnel geometry per city and a ghosted sprite tethered to the surface. The owner recorded it and left it.

Round four and after (2026-09-15). The owner tested round three under FLIR and NVG, and then asked for the design to be taken further: elegant in performance, beautiful on camera, trails with a cache for public transport, Cesium-native, and a core other moving layers can adopt. Codex Astra reviewed the plan (it confirmed the speed fault: a glide started from the drawn position at receipt time but spanned the gap between report times, so with MBTA reporting every ~10 s against a 15 s poll every second glide ran at 1.5x; it rejected a queued-segment patch), then wrote the design, then implemented it in commit-sized passes with adversarial review between them and real-browser harness runs by the integrator.

What this PR now contains beyond the contributor's original port:

- Delayed playback in a contact-agnostic core (`src/data/contactPlayback.js`): each vehicle keeps a typed, bounded fix history and a display clock that runs at one second per second through it, a feed-derived lag behind real time, holding at its newest fix rather than extrapolating and never sprinting to catch up. Marker, course, motion word, card and trail all read the same displayed sample. The clock has an explicit time-offset and seek API so a rewind is a later feature, not a rewrite; flights and vessels are untouched.
- A selected-vehicle trail (`src/data/contactTrailRenderer.js`, `src/layers/transit/trails.js`): the retained history drawn with batched Cesium primitives, clipped at display time so the head is exactly the sprite, faded by age, in the mode colour (white under sensor presets), on the same surface path as the marker.
- Bounded proxy-side history (`server/providers/transitHistory.js`): fifteen minutes and at most 128 fixes per vehicle with hard byte ceilings, MBTA only for now (opt-in per feed), served by a small endpoint that never fetches upstream, so a selected trail survives a browser reload while the server keeps running.
- Scene work bounded to what is visible and moving, an occluder, cached DETECT candidates, holds on the render loop only while something visible moves.
- Sensor presets: white-hot haloed sprites under NVG/FLIR/noir (black-hot inverts), saturated mode colours under CRT, per-mode bracket tiers in every theme, the selected card keeping its mode colour.
- A discriminating browser harness (`scripts/qa-transit.mjs`) that samples postRender frames, reads the real card anchor, and measures fleet budgets at 800 and 3,000 vehicles.

Not built, recorded as follow-ups: curated route display names (lowest priority per the owner), fleet-wide tails, route snapping, a rewind UI, adoption of the playback core by flights and vessels.

Verified at merge (2026-09-15 morning): unit suite 3,896 passing, build clean, format and boundary gates clean, tracking regression 109/109, browser harness keyless 200 pass / 0 fail (13 sensor checks unexercised because the live view offered fewer than six isolated sprites; every judged sprite passed), keyed on Google 3D tiles 198 pass with the per-frame allocation gate as the only failure. Follow-ups recorded: the keyed build's playback sampler still allocates per frame (CPU and frame time stay within budget; the 3,000-vehicle metro view sits at a 27.6 ms frame interval against a 25 ms budget), the shared detection overlay's per-paint allocation, friendlier route names, fleet-wide tails, a rewind UI, and adopting the playback core for vessels and flights.
Co-authored-by: spcpza <[email protected]>
2026-09-15 05:18:30 -05:00
Sameh Khamis a79208181f refactor: separate Nominatim transport from search composition 2026-09-14 22:14:51 -07:00
Sameh Khamis 66eb6d6a7c refactor: add configurable Nominatim adapter and portable source helpers 2026-09-14 22:08:16 -07:00
Sameh Khamis e46d50ce52 refactor: expose reference sources independently of standalone setup 2026-09-14 21:52:27 -07:00
Sameh Khamis cc960b0dbe refactor: enforce import directions and expose source factories 2026-09-14 21:12:01 -07:00
Sameh Khamis 4507f3a1d0 refactor: separate voice sessions from protocol adapters 2026-09-14 20:27:12 -07:00
Sameh Khamis 55b240e3ab refactor: separate voice action schemas from descriptions 2026-09-14 20:05:32 -07:00
Sameh Khamis ea6c8653b3 refactor: expose portable source record protocols 2026-09-14 19:36:32 -07:00
Bilawal SidhuandMatthew-Selvam 6fa25c349a fix(ui): name the missing provider key on a key-gated layer row (#575)
Supersedes #296 by @Matthew-Selvam, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Co-authored-by: Matthew-Selvam <[email protected]>
2026-09-14 21:26:09 -05:00
Pedro Lobato 44817e1286 fix(realtime): bound the debug-log sink and stop blocking on its writes
Ported onto the split provider layout: the route now lives in
server/providers/openai/debug-log.js and its state belongs to the handler
the factory returns rather than to module scope.

/api/realtime/debug-log is the one route in its family left unhardened.
Both siblings enforce a limiter through openai/rate-limit.js, and this was
the only handler still writing with fs.appendFileSync on the request path.

- Always-on per-IP limiter (120/min, 400 global). Deliberately not the
  opt-in openAiRateLimiter(): that one defaults to unlimited so throttling
  cannot silently change what a user spends, and this sink spends disk and
  event-loop time rather than provider quota.
- Serialized async appends with a 32 MB rotation ceiling and one retained
  generation. REALTIME_DEBUG_LOG_MAX_BYTES caps a single request body; it
  never bounded the file those bodies accumulate into, so any local page
  could grow .gev-logs/realtime-conversations.jsonl for as long as the dev
  server ran. Serializing also closes a read-then-write race on the size
  check, where concurrent callers all stat under the ceiling and none
  rotates.
- Generic 400/500 answers separating a malformed record or oversized body
  from a failed write, instead of echoing error.message — an errno and an
  absolute path for an fs failure.
- readRequestBody marks an oversized body with code 'BODY_TOO_LARGE', the
  marker its sibling readRequestBodyCapped already sets, so the two cases
  are distinguishable without matching on text.

Coverage extends src/tooling/localServices.test.mjs, which already drives
the real handler over a temporary sourceRoot. Both new tests fail on the
previous implementation and pass with this one.

Refs #23. Does not add authentication: these proxies have no auth
mechanism today, so introducing one is a maintainer design decision.
2026-09-14 21:24:12 -05:00
Pedro Lobato 9e71081a5a fix(server): stop relaying upstream and JS error text to the client
Ported onto the split provider layout: the routes now live in
server/providers/openai/{hud-summary,realtime}.js and the camera health
entry in server/providers/cctv.js.

The routes #263 names — celestrak, terrain, adsbdb — were sanitized by
#289. The same defect had moved:

- /api/openai/hud-summary relayed `data.error.message` verbatim on a
  non-ok upstream. That is OpenAI's own error text, carrying request ids,
  organization hints and quota wording. Its catch echoed the JS error too.
- /api/realtime/token echoed the JS error when minting failed, which for a
  network fault is a resolver message naming the upstream host.
- cctvProxy stored the raw error as a camera's health `message`. This is
  the least obvious of the three and the reason the PR is worth its size:
  GET /api/cctv/health serializes `message`, and src/layers/cctv/frames.js
  renders it as the camera's status label, so the detail reached the
  screen through a different door than the sanitized 502 beside it.

Logs name the failure and the upstream status without the text, matching
the Launch Library and terrain paths; these lines get pasted into issues.

Coverage extends the existing harnesses rather than adding files —
localServices.test.mjs drives both OpenAI routes over a mocked upstream,
mediaProviders.test.mjs drives a failing media fetch and then reads
/health. All three assertions fail on the previous implementation.

Refs #263. Does not touch /api/realtime/debug-log's identical echo; that
route is the subject of the #23 PR, so the two do not overlap a line.
2026-09-14 21:24:05 -05:00
Bilawal Sidhuandsendmebits 7fa0cfbb26 feat(search): Nominatim as the last-resort geocoder (#573)
Supersedes #350 by @sendmebits, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Co-authored-by: sendmebits <[email protected]>
2026-09-14 21:22:08 -05:00
Bilawal SidhuandKuraPiee cca6442997 feat(search): coordinates and bundled presets resolve keyless (#572)
Supersedes #388 by @KuraPiee, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Co-authored-by: KuraPiee <[email protected]>
2026-09-14 21:18:07 -05:00
Bilawal SidhuandYashveer Singh d9fac6d88e feat(ui): tilt and north-up compass controls (#571)
Supersedes #442 by @yashveeeeeeer, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Co-authored-by: Yashveer Singh <[email protected]>
2026-09-14 21:15:29 -05:00