mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-08-26 17:31:37 +00:00
* Add navi-offroute service (extraction #8 — the last one) Faithful port of recon's /api/offroute (POST) + /api/mvum (GET) and the runtime offroute modules into a new :8428 service. Closes the loop: after this, navi-frontend talks only to navi-backend. Ported: router.py (OffrouteRouter, EntryPointIndex, 4 route strategies, in-Python MCP_Geometric least-cost path, Valhalla integration, per-request osmium extract), mvum.py (MVUMReader over navi.db), cost.py, friction.py, trails.py, and barriers.py (runtime BarrierReader/WildernessReader only). NOT ported (per Phase A §3/§15): prototype.py (dead at runtime), barriers.py build_*_raster (offline GDB→raster prep). DEM imported from shared/dem.py (PR #9), not duplicated. Behaviour-faithful changes: hardcoded paths/URLs → env vars; the profile.offroute.* config (osm_pbf_path/postgis_dsn/densify_interval_m) → dedicated env vars (router drops deployment_config). Both routes public (no auth, matching recon). PADUS via libpq peer-auth DSN (dbname=padus) — NO secret. Owns no DB. 15 hermetic tests (offroute validation + mocked-router shape + close-always; fixture-SQLite MVUM roads/trails/fallback/null; admin auth + no-secrets + probe shape). Full suite 119 passed / 1 skipped. Adds scikit-image + rasterio. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * navi-offroute: PR #10 review cleanups (4 faithful-port deviations) 1. trails.py — drop recon-era "Run the Phase B rasterization script" reference from the not-found error (confusing in navi-offroute context). 2. friction.py — add FileNotFoundError-before-rasterio-open check to match barriers/trails consistency. 3. mvum.py — remove dead try/except shapely import + warnings.warn at 2 sites (shapely is a hard pyproject dep; the fallback was unreachable). 4. router.py — declare psutil in pyproject, drop the silent fallback; the MEMORY_LIMIT_GB safety check was silently disabled in prod. Adds test_friction_reader_raises_file_not_found_when_missing (16 navi-offroute tests; full suite 120 passed / 1 skipped). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: zvx-echo6 <mj@k7zvx.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.4 KiB
TOML
39 lines
1.4 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "navi-backend"
|
|
version = "0.1.0"
|
|
description = "Echo6 navi-backend monorepo — Navi API services extracted from recon (decoupling project)."
|
|
requires-python = ">=3.10"
|
|
# Single workspace, single .venv. pytest is included so `pip install -e .` is the
|
|
# only setup step needed before running the test suite.
|
|
dependencies = [
|
|
"Flask>=3.0",
|
|
"gunicorn>=21",
|
|
"requests>=2.31",
|
|
"PyYAML>=6",
|
|
"psycopg2-binary>=2.9",
|
|
"pytest>=8",
|
|
# navi-geo (extraction #6): geocode engine + reverse bundle.
|
|
"usaddress>=0.5", # address parsing / intent classification
|
|
"rapidfuzz>=3", # reranker fuzzy string scoring
|
|
"cachetools>=5", # reverse-bundle TTLCache
|
|
"shapely>=2", # timezone point-in-polygon
|
|
"numpy>=1.24", # planet-DEM tile decode
|
|
"Pillow>=10", # planet-DEM Terrarium WebP decode
|
|
"pmtiles>=3", # planet-DEM PMTiles reader
|
|
# navi-offroute (extraction #8): off-network router + readers.
|
|
"scikit-image>=0.22", # MCP_Geometric least-cost pathfinding (router.py)
|
|
"rasterio>=1.3", # barriers/wilderness/trails/friction raster readers
|
|
"psutil>=5.9", # MEMORY_LIMIT_GB enforcement in router.py
|
|
]
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["shared*", "services*"]
|
|
namespaces = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["services", "shared"]
|