docs: prepare English public documentation and preserve license scope

This commit is contained in:
Darío Sevilla committed 2026-10-12 05:06:35 +00:00
1 parent 008e4e3d80
commit f727149369
10 files changed
+192 -180

No files matched your search

+36 -37
View File
@@ -1,70 +1,69 @@
# Routing and guidance (English summary)
# Routing and guidance
Route calculation uses a configurable HTTPS Valhalla-compatible service. The default FOSSGIS endpoint is a public demo with fair-use/rate limits, not a production SLA. Valhalla asks applications published to end users to notify the project and include an identifying `X-Client-Id`; see the [official Valhalla documentation](https://valhalla.github.io/valhalla/). A route request sends the selected origin and destination to the configured service. Do not submit sensitive coordinates to a public endpoint.
NavFrame does not contain an offline routing graph. It can follow previously calculated route geometry with GPS, but calculating or recalculating a route requires network access. The `motorcycle` profile does not certify legal access, surface quality, or motorcycle suitability. ETA and GPS-based turn progression are estimates and require physical validation. Detailed implementation and historical test notes follow in Spanish.
NavFrame does not contain an offline routing graph. It can follow previously calculated route geometry with GPS, but calculating or recalculating a route requires network access. The `motorcycle` profile does not certify legal access, surface quality, or motorcycle suitability. ETA and GPS-based turn progression are estimates and require physical validation.
# Detailed routing notes (Spanish)
## Implementation contract
Investigación y contrato del 2026-09-29. NavFrame solicita una ruta al seleccionar un destino explícito o pulsar calcular, con origen DEMO/GPS utilizable. La vista previa precede al inicio del guiado; estas acciones no sustituyen automáticamente una ruta activa. El guiado GPS puede solicitar un recálculo tras desvío sostenido o una acción manual. El servicio y UI Android poseen la solicitud, cancelación y vista previa. La fase 5 incorporó vista previa; la fase 6 añade guiado básico puro, simulación sobre la ruta y política conservadora de desvío/recálculo. No incorpora búsqueda de direcciones, voz ni map matching vial avanzado.
Research and contract dated 2026-09-29. NavFrame requests a route after explicit destination selection or Calculate, using a usable DEMO/GPS origin. Preview precedes guidance; these actions do not automatically replace an active route. GPS guidance may request recalculation after sustained deviation or a manual action. The Android service and UI own requests, cancellation, and preview. Phase 5 introduced preview; phase 6 adds basic pure guidance, route simulation, and a conservative deviation/recalculation policy. That phase does not include address search, voice, or advanced road map matching.
## Servicio inicial y privacidad
## Initial service and privacy
Endpoint configurable inicial: `https://valhalla1.openstreetmap.de/route`, demo pública de FOSSGIS; `valhalla.openstreetmap.de` es el frontend, no el endpoint API elegido. El [README oficial Valhalla](https://github.com/valhalla/valhalla) documenta el servicio y exige uso razonable; pide identificar aplicaciones que se publiquen a usuarios mediante `X-Client-Id` y avisar en sus Discussions. No se ha contactado a terceros ni se publica esta app como servicio para usuarios externos. Antes de distribución pública, resolver ese requisito o usar un servidor propio.
Initial configurable endpoint: `https://valhalla1.openstreetmap.de/route`, the FOSSGIS public demo; `valhalla.openstreetmap.de` is the frontend rather than the chosen API endpoint. The [official Valhalla README](https://github.com/valhalla/valhalla) documents the service and requires reasonable use; it asks applications published to users to identify themselves with `X-Client-Id` and notify its Discussions. No third parties have been contacted, and the app has not been published as a service for external users. Resolve that requirement or use a self-hosted server before public distribution.
El [OpenAPI oficial](https://github.com/valhalla/valhalla/blob/master/docs/docs/api/openapi.yaml) documenta HTTP429 y límite por usuario de **una petición por segundo**. El adapter debe serializar solicitudes, esperar al menos ese intervalo, enviar User-Agent identificativo y `X-Client-Id`, y mostrar errores. El recálculo de fase 6 añade cooldown mínimo de 30 segundos, una sola solicitud en vuelo y pausa ante HTTP429; no crea un bucle continuo de reintentos. La demo no ofrece disponibilidad garantizada; el endpoint propio debe poder sustituirse sin cambiar renderer/transporte.
The [official OpenAPI](https://github.com/valhalla/valhalla/blob/master/docs/docs/api/openapi.yaml) documents HTTP429 and a per-user limit of **one request per second**. The adapter must serialize requests, wait at least that interval, send an identifying User-Agent and `X-Client-Id`, and show errors. Phase 6 recalculation adds a minimum 30-second cooldown, one request in flight, and a pause after HTTP429; it does not create a continuous retry loop. The demo offers no availability guarantee; replacing it with a custom endpoint must not require changing rendering/transport.
Calcular envía al servidor origen/destino y opciones, además de IP e identificador de cliente. No registrar JSON ni coordenadas en logs. La [política FOSSGIS de routing](https://routing.openstreetmap.de/about.html) describe registros y crédito OSM para su servicio OSRM; Valhalla remite a ese criterio de fair use, pero no se afirma que ambas implementaciones tengan idéntica retención. La página alemana completa de condiciones respondió protección Anubis durante investigación; no se eludió.
Calculation sends origin/destination and options to the server, alongside IP and client identifier. Do not log JSON or coordinates. The [FOSSGIS routing policy](https://routing.openstreetmap.de/about.html) describes logging and OSM attribution for its OSRM service; Valhalla refers to that fair-use criterion, but identical retention across both implementations is not asserted. The full German terms page returned Anubis protection during research; it was not bypassed.
## Petición y perfiles
## Requests and profiles
`buildValhallaRequest(origin, destination, options)` genera POST JSON con dos locations `type=break`, `costing=motorcycle`, `shape_format=polyline6`, `units=kilometers`, `language=es-ES` y `directions_type=instructions`. `motorcycle` está marcado beta por Valhalla. FASTEST significa una ruta basada en tiempo y costes del modelo; no certifica el mínimo matemático, legalidad vial ni idoneidad de cada tramo para la MT-07.
`buildValhallaRequest(origin, destination, options)` generates POST JSON with two locations using `type=break`, `costing=motorcycle`, `shape_format=polyline6`, `units=kilometers`, language from the selected route language (`es-ES` by default), and `directions_type=instructions`. Valhalla marks `motorcycle` as beta. FASTEST means routing based on the model's time and costs; it does not certify a mathematical minimum, legal road access, or each segment's suitability for the MT-07.
Fase0.8 añade preferencias combinables en `RouteOptions(profile, avoidMotorways, avoidUnpaved, avoidTolls)`. Los presets se combinan con los flags explícitos; cambiar una preferencia no modifica el costing a auto:
Phase 0.8 adds combinable preferences in `RouteOptions(profile, avoidMotorways, avoidUnpaved, avoidTolls)`. Presets combine with explicit flags; changing a preference does not switch costing to auto:
| Perfil/opción | Petición motorcycle | Semántica |
| Profile/option | Motorcycle request | Meaning |
|---|---|---|
| FASTEST / Moto rápido | use_highways=0.5, use_tolls=0.5, use_trails=0.5 | Preferencia neutral; autopistas y peajes permitidos |
| AVOID_MOTORWAYS / Evitar autopistas | use_highways=0 | Penaliza autopistas; no prohibición absoluta |
| AVOID_UNPAVED / Preferir asfalto | use_trails=0 | Penaliza superficies deficientes y caminos; no certificación de asfalto |
| TOURING | use_highways=0.2, use_tolls=0 | Reduce autopistas y peajes; no garantiza ruta panorámica |
| avoidTolls | use_tolls=0 | Preferencia por evitar peajes, combinable con las anteriores |
| FASTEST / Fast motorcycle | use_highways=0.5, use_tolls=0.5, use_trails=0.5 | Neutral preference; motorways and tolls allowed |
| AVOID_MOTORWAYS / Avoid motorways | use_highways=0 | Penalizes motorways; not an absolute prohibition |
| AVOID_UNPAVED / Prefer paved roads | use_trails=0 | Penalizes poor surfaces and trails; no pavement certification |
| TOURING | use_highways=0.2, use_tolls=0 | Reduces motorways and tolls; no scenic-route guarantee |
| avoidTolls | use_tolls=0 | Toll-avoidance preference, combinable with the above |
`use_tracks=0` conserva una penalización de pistas en todos los perfiles. La preferencia de asfalto tiene efecto: reduce `use_trails` de0.5 neutral a0.0; en fases previas era0.0 fijo. Ninguna selección habilita ignorar restricciones, acceso o sentidos únicos.
`use_tracks=0` retains a track penalty in all profiles. The paved-road preference has an effect: it reduces `use_trails` from the neutral 0.5 to 0.0; earlier phases fixed it at 0.0. No selection permits ignoring restrictions, access, or one-way roads.
La [documentación oficial motorcycle y exclusiones](https://valhalla.github.io/valhalla/api/route/api-reference/#motorcycle-costing-options-beta) describe costes blandos y exclusiones experimentales. Se comprobó también [MotorcycleCost](https://github.com/valhalla/valhalla/blob/master/src/sif/motorcyclecost.cc), [DynamicCost](https://github.com/valhalla/valhalla/blob/master/valhalla/sif/dynamiccost.h) y [AutoCost](https://github.com/valhalla/valhalla/blob/master/src/sif/autocost.cc) el2026-09-29: motorcycle lee opciones base, pero Allowed/AllowedReverse no aplican `exclude_unpaved`; AutoCost sí lo aplica. Por eso no enviamos esa bandera como una garantía de moto. `exclude_highways`/`exclude_tolls` dependen de `service_limits.allow_hard_exclusions`; el servidor puede ignorarlas con un warning. Se retiró `exclude_highways=true` del antiguo preset para evitar esa falsa expectativa. No hay fallback silencioso a auto ni a otro perfil.
The [official motorcycle/exclusion documentation](https://valhalla.github.io/valhalla/api/route/api-reference/#motorcycle-costing-options-beta) describes soft costs and experimental exclusions. [MotorcycleCost](https://github.com/valhalla/valhalla/blob/master/src/sif/motorcyclecost.cc), [DynamicCost](https://github.com/valhalla/valhalla/blob/master/valhalla/sif/dynamiccost.h), and [AutoCost](https://github.com/valhalla/valhalla/blob/master/src/sif/autocost.cc) were also checked on 2026-09-29: motorcycle reads base options, but Allowed/AllowedReverse do not apply `exclude_unpaved`; AutoCost does. Therefore that flag is not sent as a motorcycle guarantee. `exclude_highways`/`exclude_tolls` depend on `service_limits.allow_hard_exclusions`; the server may ignore them with a warning. `exclude_highways=true` was removed from the old preset to avoid that false expectation. There is no silent fallback to auto or another profile.
`RouteResult.hasUnpaved` es evidencia opcional, no una validación independiente: se deriva del campo booleano `maneuver.rough`, emitido por el [serializador oficial](https://github.com/valhalla/valhalla/blob/master/src/tyr/route_serializer_valhalla.cc) cuando `portions_unpaved` es verdadero. `true` permite avisar que el resultado incluye tierra pese a la preferencia. Si faltan campos, es `null`, nunca «asfalto verificado» por ausencia. Solo una respuesta con información explícita completa y todos false produce false; el backend habitual omite rough=false. No se inventa un campo summary.has_unpaved.
`RouteResult.hasUnpaved` is optional evidence, not independent validation: it derives from the boolean `maneuver.rough` emitted by the [official serializer](https://github.com/valhalla/valhalla/blob/master/src/tyr/route_serializer_valhalla.cc) when `portions_unpaved` is true. `true` permits a warning that the result includes unpaved sections despite the preference. Missing fields mean `null`, never “verified paved” through absence. Only a response with complete explicit information and all values false produces false; the usual backend omits rough=false. No summary.has_unpaved field is invented.
Android conserva las opciones usadas junto a la ruta para que los recálculos mantengan el perfil. Cambiar los controles prepara solicitudes futuras y no transforma retroactivamente una ruta activa. Las pruebas de serialización cubren independencia/combinación de preferencias, costing motorcycle y ausencia de exclusiones no verificadas; las pruebas de metadatos distinguen ausencia, evidencia positiva y booleanos inválidos. No se ha realizado un smoke HTTP para cada combinación nueva ni una prueba física de las preferencias.
Android retains the options used with the route so recalculations preserve the profile. Changing controls prepares future requests and does not retroactively transform an active route. Serialization tests cover independent/combined preferences, motorcycle costing, and absence of unverified exclusions; metadata tests distinguish absence, positive evidence, and invalid booleans. No HTTP smoke test for every new combination or physical preference test has been performed.
## Resultado puro JVM
## Pure JVM result
`parseValhallaRoute(json, destination=null)` devuelve `RouteResult`. Preserva el destino solicitado separado del extremo ajustado a carretera, geometría, longitud total y duración. `Maneuver` conserva instruction, type, begin/endShapeIndex, duración, nombres de vía y longitud **de su segmento**. Esta longitud no es la distancia actual del motorista hasta el próximo giro.
`parseValhallaRoute(json, destination=null)` returns `RouteResult`. It preserves the requested destination separately from the road-snapped endpoint, geometry, total length, and duration. `Maneuver` preserves instruction, type, begin/endShapeIndex, duration, road names, and **its segment's length**. That length is not the rider's current distance to the next turn.
El parser acepta JSON estricto, status exitoso y unidades explícitas kilómetros/millas; convierte a metros y segundos enteros redondeados. Decodifica polyline6, valida rangos geográficos, mediciones finitas/no negativas y límites de índices. Une legs por su punto común y rebasa índices sobre la geometría final. Rechaza legs desconectadas, respuestas de más de 2Mi caracteres, geometrías de más de 100.000 puntos o más de 128 legs. El HTTP adapter debe limitar también los bytes recibidos antes de construir el String. Mensajes de error propios no incluyen cuerpo remoto ni coordenadas.
The parser accepts strict JSON, successful status, and explicit kilometre/mile units; it converts to metres and rounded integer seconds. It decodes polyline6, validates geographic ranges, finite/nonnegative measurements, and index bounds. It joins legs at their shared point and rebases indices onto the final geometry. It rejects disconnected legs, responses over 2 Mi characters, geometries over 100,000 points, or more than 128 legs. The HTTP adapter must also limit received bytes before constructing the String. Local error messages include neither remote bodies nor coordinates.
JSON utiliza Gson 2.11.0 con `Strictness.STRICT`, API documentada en su [release oficial](https://github.com/google/gson/releases/tag/gson-parent-2.11.0). Adapter y decoder son código original del proyecto; no se incorpora código del motor Valhalla. Gson usa [Apache 2.0](https://github.com/google/gson/blob/gson-parent-2.11.0/LICENSE); Valhalla es [MIT](https://github.com/valhalla/valhalla/blob/master/COPYING). El mapa/ruta debe conservar crédito [© OpenStreetMap contributors](https://www.openstreetmap.org/copyright).
JSON uses Gson 2.11.0 with `Strictness.STRICT`, documented in its [official release](https://github.com/google/gson/releases/tag/gson-parent-2.11.0). The adapter and decoder are original project code; no Valhalla engine code is embedded. Gson uses [Apache 2.0](https://github.com/google/gson/blob/gson-parent-2.11.0/LICENSE); Valhalla uses [MIT](https://github.com/valhalla/valhalla/blob/master/COPYING). Maps/routes must retain [© OpenStreetMap contributors](https://www.openstreetmap.org/copyright).
## Verificación
## Verification
`ValhallaRouteTest` usa fixture original de estructura realista, no captura de GPS del usuario ni respuesta inventada presentada como ruta real. Cubre vector polyline6 independiente, kilómetros/millas, maniobras de llegada de longitud cero, unión de legs e índices, JSON no estricto, errores backend, overflow, coordenadas fuera de rango, formas truncadas y opciones de petición. Las pruebas no certifican disponibilidad pública, idoneidad de restricciones de moto, geocoder ni guía de giros.
`ValhallaRouteTest` uses an original realistically structured fixture, not user GPS recordings or an invented response presented as a real route. It covers an independent polyline6 vector, kilometres/miles, zero-length arrival maneuvers, leg joining/indices, non-strict JSON, backend errors, overflow, out-of-range coordinates, truncated shapes, and request options. Tests do not certify public availability, motorcycle restrictions, geocoding, or turn guidance.
Smoke HTTP autorizado: una única petición POST de demostración en Asturias (43.36,-5.85 → 43.365,-5.845), sin coordenadas del usuario, con User-Agent identificativo y X-Client-Id, devolvió HTTP200/status0 el 2026-09-29. Se aceptó motorcycle, units kilometers y language es-ES; la respuesta contenía un leg y diez maniobras en español, incluida llegada de longitud cero. Esto verifica el contrato de esta consulta, no disponibilidad continua ni restricciones de carretera. La comprobación HTTP y el render nativo Android deben reportarse por separado del parser JVM. La vista previa de fase 5 y el guiado básico de fase 6 se verifican por separado; sus umbrales no están calibrados con una prueba física de carretera. La prueba física TFT se realizará cuando el usuario esté disponible.
Authorized HTTP smoke test: one synthetic demonstration POST in Asturias (43.36,-5.85 → 43.365,-5.845), without user coordinates, with an identifying User-Agent and X-Client-Id, returned HTTP200/status0 on 2026-09-29. Motorcycle, units kilometers, and language es-ES were accepted; the response contained one leg and ten Spanish maneuvers, including a zero-length arrival. This validates that query's contract, not continuous availability or road restrictions. HTTP checks and native Android rendering must be reported separately from the JVM parser. Phase 5 preview and phase 6 basic guidance are verified separately; thresholds are not calibrated through a physical road test. Physical TFT testing depends on the user's availability.
## Basic guidance and limits — phase 6
## Guiado básico y límites — fase 6
`RouteGuidanceTracker(route).update(fix, nowMs, epochMs, fixAgeMs)` separates monotonic time, wall-clock time for ETA, and actual fix age. The caller must pass age from the provider and never assume a new tick means a new fix. Age up to 15 seconds and finite horizontal accuracy from 0 to 25 m are accepted. An unusable fix produces GPS_LOST without turn/countdown/ETA and breaks deviation/arrival evidence. The fix timestamp identifies distinct observations; repeated ticks do not advance state or confirm thresholds. An observation gap over 15 seconds also breaks evidence. Recovery after GPS_LOST or that gap requires two new fixes: the first establishes a baseline without progress, and the second stable fix allows reacquisition; absence does not enlarge the movement window.
`RouteGuidanceTracker(route).update(fix, nowMs, epochMs, fixAgeMs)` separa reloj monotónico, hora civil para ETA y edad real del fix. El caller debe pasar la edad desde el proveedor, nunca asumir que un tick nuevo implica un fix nuevo. Se acepta edad hasta 15s y precisión horizontal finita entre 0 y 25m. Un fix no utilizable produce GPS_LOST sin giro/countdown/ETA y rompe evidencia de desvío/llegada. El timestamp del fix identifica observaciones distintas; ticks repetidos no avanzan estado ni confirman umbrales. Un intervalo entre observaciones de más de 15s también rompe evidencia. Recuperar tras GPS_LOST o ese intervalo requiere dos fixes nuevos: el primero establece baseline sin avanzar y el segundo estable permite adquirir de nuevo; la ausencia no amplía la ventana de movimiento.
First acquisition uses the nearest valid projection over the entire route. Subsequent candidates are restricted to a local speed/time-dependent window, with 20 m backward tolerance and accumulated progress that does not retreat due to jitter. Distance to that candidate is checked before advancing. Position jumps incompatible with observed movement temporarily produce GPS_LOST; a later stable fix restores evaluation. These filters do not replace map matching: crossings, parallel branches, bridges, wrong-way travel, and prolonged GPS loss remain ambiguous. An isolated jump still temporarily produces GPS_LOST. If later fixes are stable but outside the reachable section, progress freezes and sustained evidence confirms OFF_ROUTE, allowing automatic recalculation; that deviation is not presented as GPS loss. Candidates are clipped to local-window endpoints to avoid artificial gaps near its boundaries. Do not infer a different road merely because other geometry is nearby.
La primera adquisición usa la proyección más cercana válida sobre toda la ruta. Después se limita el candidato a una ventana local dependiente de velocidad/tiempo, con tolerancia hacia atrás de 20m y progreso acumulado que no retrocede por jitter. Se verifica distancia a ese candidato antes de avanzar. Saltos de posición incompatibles con movimiento observado producen temporalmente GPS_LOST; un fix posterior estable recupera evaluación. Estos filtros no sustituyen map matching: cruces, ramales paralelos, puentes, conducción en sentido contrario y pérdidas prolongadas de GPS siguen siendo ambiguos. Un salto aislado sigue produciendo GPS_LOST temporalmente. Si los fixes posteriores son estables pero quedan fuera de la sección alcanzable, se congela el progreso y se confirma OFF_ROUTE tras evidencia sostenida, permitiendo el recálculo automático; no se presenta esa desviación como pérdida de GPS. Los candidatos se recortan a los extremos de la ventana local para evitar huecos artificiales cerca de sus límites. No inferir una carretera distinta solo porque otra geometría está cerca.
The next turn uses geometric distance to `beginShapeIndex` and advances after passing it by more than 5 m. Official types 1/2/3 are Start/StartRight/StartLeft, departure instructions omitted from the next turn; regular Right/Left turns are 10/15. `maneuverDirection(type)` selects an icon without parsing translations. Arrival requires a road-snapped endpoint within 25 m, geometric remaining distance within 30 m, three distinct fixes, and at least two seconds; it then remains confirmed until the tracker is replaced. The [official maneuver types](https://valhalla.github.io/valhalla/api/route/api-reference/#trip-legs-and-maneuvers) support these IDs.
El próximo giro usa la distancia geométrica al `beginShapeIndex` y avanza después de pasarlo por más de 5m. Los tipos oficiales 1/2/3 son Start/StartRight/StartLeft, instrucciones de salida, y se omiten del próximo giro; los giros normales Right/Left son 10/15. `maneuverDirection(type)` elige icono sin analizar traducciones. Llegada exige extremo ajustado a carretera a ≤25m, restante geométrico ≤30m, tres fixes distintos y ≥2s; luego permanece confirmada hasta sustituir el tracker. Los [tipos oficiales de maniobra](https://valhalla.github.io/valhalla/api/route/api-reference/#trip-legs-and-maneuvers) sustentan esos IDs.
Deviation means distance from the geometrically reachable section based on previous progress greater than `max(40m, 2 × accuracy)` for at least five seconds and three distinct fixes. This includes reversing along the same road or reaching a distant later section even when near another part of the route. Recovery breaks the sequence. Turn estimates are hidden while position exceeds the threshold; OFF_ROUTE confirms the state after that evidence. OFF_ROUTE retains the route for the map but shows neither countdown nor ETA calculated as though still following it. All thresholds are configurable and await real-world calibration.
Desvío: separación de la sección geométrica alcanzable desde el progreso previo mayor que `max(40m, 2 × accuracy)` durante ≥5s y ≥3 fixes distintos. Esto incluye volver hacia atrás por la misma carretera o alcanzar una sección posterior distante aunque la posición esté cerca de otra parte de la ruta. Una recuperación rompe la secuencia. Mientras la posición excede el umbral se ocultan estimaciones de giro; OFF_ROUTE confirma el estado después de esa evidencia. OFF_ROUTE conserva la ruta para el mapa, pero no muestra countdown ni ETA calculados como si se siguiera sobre ella. Todos esos umbrales son configurables y están pendientes de calibración real.
Remaining distance is pending geometric length. Real ETA is **approximate**: initial Valhalla duration multiplied by the remaining geometric fraction; it does not account for traffic, stops, or future speed. `RouteDemo(route).stateAt(elapsedMs, epochMs)` interpolates positions at 12 m/s and produces complete deterministic guidance up to ARRIVED; its ETA uses that speed. Android must continuously display DEMO and never use it to trigger HTTP recalculation.
El restante es longitud geométrica pendiente. ETA real es **aproximada**: duración inicial Valhalla multiplicada por fracción geométrica pendiente; no contempla tráfico, paradas ni velocidad futura. `RouteDemo(route).stateAt(elapsedMs, epochMs)` interpola posiciones a 12m/s y produce guiado completo determinista hasta ARRIVED; su ETA usa esa velocidad. Android debe mostrar DEMO continuamente y jamás utilizarlo para lanzar recálculo HTTP.
`ReroutePolicy` separates decision from IO: `shouldRequest`, `markRequested` before launching, and `markFinished` in finally, including errors/cancellation. An active request blocks another; cooldown after completion is at least 30 seconds and may extend with Retry-After. `reset` is only for a new session/manual action. Android additionally applies failure limits and HTTP429 blocking; route replacement must be atomic and retain the previous route on failure.
`ReroutePolicy` separa decisión de IO: `shouldRequest`, `markRequested` antes de lanzar y `markFinished` en finally, incluidos errores/cancelación. Un request activo bloquea otro; el cooldown tras finalización es al menos 30s, ampliable con Retry-After. `reset` solo para nueva sesión/acción manual. Android aplica además el límite de fallos y bloqueo HTTP429; una sustitución de ruta debe ser atómica y conservar la ruta anterior si falla.
`RouteGuidanceTest` cubre proyección/countdown/ETA, jitter y giro pasado, adquisición intermedia, ticks duplicados y separación temporal, tres observaciones de desvío/llegada, margen de precisión, fixes inválidos/stale, saltos y retorno, cruce de geometría, antimeridiano, single-flight/cooldown/Retry-After e interpolación demo. `TftServiceRerouteTest` simula GPS Android al retroceder sobre la carretera anterior y verifica una solicitud desde la posición actual con el mismo perfil, una sola solicitud en vuelo y recuperación del guiado con la ruta recibida. Estas pruebas no certifican guiado físico ni calidad de datos OSM.
`RouteGuidanceTest` covers projection/countdown/ETA, jitter/passed turns, intermediate acquisition, duplicate ticks/time gaps, three deviation/arrival observations, accuracy margins, invalid/stale fixes, jumps/return, geometry crossings, the antimeridian, single-flight/cooldown/Retry-After, and demo interpolation. `TftServiceRerouteTest` simulates Android GPS while reversing along the previous road and verifies one request from the current position with the same profile, one request in flight, and guidance recovery with the received route. These tests do not certify physical guidance or OSM data quality.