recon/lib
malice d56b1d5f92
cleanup: remove /api/contacts + /api/address_book handlers + pull entire /nav-i/* subtree (extraction #3 shadow) (#12)
* cleanup: remove /api/address_book handlers (extraction #3 shadow)

Removes address_book_bp (lib/address_book_api.py: /api/address_book/lookup +
/api/address_book/list) + its registration in lib/api.py. Edge-shadowed since
extraction #3 — navi-contacts (:8423) serves /api/address_book/* on
navi.echo6.co; no recon-side consumer (no template/JS reference).

lib/address_book.py is KEPT — geocode.py (nickname short-circuit + annotation)
and netsyms_api.py import it.

NOT removed this PR: contacts_bp. The recon dashboard at /deleted-contacts
(recon-product, stays) calls /api/contacts/<id>/{restore,restore-as,purge} via
XHR, and recon.echo6.co proxies straight to recon:8420 (verified the Caddy
block — no navi-contacts routing there). Removing contacts_bp would break those
dashboard actions. Flagged for a decision; lib/contacts.py also stays (dashboard
ContactsDB reads). See PR body.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cleanup: deprecate /nav-i + /deleted-contacts; remove contacts_bp + lib/contacts.py

Probe found recon's /deleted-contacts dashboard reads /opt/recon/data/contacts.db
— frozen since extraction #3 moved write ownership to navi-contacts
(/var/lib/navi-backend/contacts.db). The page has been silently rendering ~25-day
stale data, and its restore/restore-as/purge XHRs hit recon's contacts_bp (the
recon.echo6.co Caddy block proxies straight to recon:8420 — no navi-contacts
routing there). Per Matt's decision, deprecate the pages entirely; they'll be
re-surfaced later as a proper admin page consuming navi-contacts via API.

Removed:
- contacts_bp (lib/contacts_api.py, all 10 /api/contacts* routes) + its
  registration in lib/api.py — edge-shadowed by navi-contacts :8423 since #3,
  and now free of recon-product consumers once the dashboard goes.
- /nav-i (navi_landing_page) + /deleted-contacts (deleted_contacts_page) route
  handlers; templates/navi/landing.html + templates/navi/deleted_contacts.html.
- lib/contacts.py (ContactsDB) — the dashboard was its only non-contacts_bp
  consumer; both gone.
- The two dead NAVI_SUBNAV entries (Overview→/nav-i, Deleted Contacts→
  /deleted-contacts).

Kept / adapted:
- /nav-i/api-keys page (recon-product key management) stays. NAVI_SUBNAV reduced
  to just its API Keys entry; the base.html top-nav "Nav-I" link repointed
  /nav-i -> /nav-i/api-keys so the surviving section page stays reachable
  (minimal href change, not a nav restructure — flagged in PR).
- lib/address_book.py — geocode.py + netsyms_api.py still consume it (untouched).

Out-of-band follow-up after merge: delete the stale /opt/recon/data/contacts.db
(frozen 2026-04-28; data, not code).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cleanup: pull the entire /nav-i/* subtree (api-keys page is a weaker dup of /settings/keys)

Completes the contacts cleanup by removing the rest of /nav-i/. The
/nav-i/api-keys page was (a) a weaker duplicate of /settings/keys for Gemini
(it lacked remove + reload-from-.env), and (b) a write-only-to-dead-files
surface for TomTom + Google Places: it wrote /opt/recon/.env, but the live
navi-traffic (:8421) and navi-places (:8425) services read their own
/etc/navi-backend/<svc>.env and have ignored recon's copy since extractions
#1 + #5. End state: no /nav-i/* URLs in recon.

Removed:
- /nav-i/api-keys route + template (templates/navi/api_keys.html)
- all /api/nav-i/api-keys/* endpoints (list/update/test/restart-recon)
- lib/api_keys_admin.py (its only importers were those 4 endpoints; _KEY_DEFS/
  _read_env/_write_env were private to it)
- the now-orphaned NAVI_SUBNAV
- the "Nav-I" top-nav entry in base.html (reverses the /nav-i->/nav-i/api-keys
  repoint from the previous commit, now that the page itself is gone)

Kept (Gemini's real home, recon-product):
- /settings/keys + /api/keys/* + lib/key_manager.py (KeyManager) — they import
  key_manager directly, never api_keys_admin, so untouched.

Note: TOMTOM_API_KEY now has zero recon .py references. GOOGLE_PLACES_API_KEY
still has one (lib/google_places.py), kept in the prior /api/place cleanup as
place_detail's dep; its only caller (_enrich_with_google) is unreachable since
the /api/place handlers were removed — left in place pending /api/wiki-enrich
retirement (out of scope here).

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>
2026-05-23 03:34:22 -06:00
..
acquisition Phase 6d: PeerTube acquisition module + service thread 2026-04-15 03:08:51 +00:00
offroute Switch /api/reverse/<lat>/<lon> elevation source from Valhalla to planet-DEM 2026-05-20 15:20:35 +00:00
processors fix: ZIM table extraction — pipe-delimited cells instead of concatenation 2026-05-07 01:32:25 +00:00
__init__.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
address_book.py fix(navi): address book prefix+boundary match for longer queries 2026-04-20 07:54:32 +00:00
address_book_test.py fix(navi): address book prefix+boundary match for longer queries 2026-04-20 07:54:32 +00:00
api.py cleanup: remove /api/contacts + /api/address_book handlers + pull entire /nav-i/* subtree (extraction #3 shadow) (#12) 2026-05-23 03:34:22 -06:00
aurora_nav_tool.py fix(navi): format tool output as human-readable directions 2026-04-19 22:42:17 +00:00
auth.py Add contacts/phone book system with per-user scoping 2026-04-22 05:29:54 +00:00
deployment_config.py cleanup: remove /api/config handler (extraction #2 shadow) (#10) 2026-05-23 00:08:48 -06:00
dispatcher.py Phase 6f-2: format normalizer in dispatcher 2026-04-15 23:08:19 +00:00
embedder.py Fix Kiwix download URL generation in embedder 2026-04-18 00:06:52 +00:00
enricher.py Add langdetect language filter to enricher + purge non-English ZIM articles 2026-04-17 14:37:13 +00:00
extractor.py fix: PDF extraction quality — word-boundary checks and layout mode 2026-05-07 01:36:23 +00:00
filing.py Phase 5c-1: dispatcher loop, filing worker loop, service rewire 2026-04-14 18:30:58 +00:00
geocode.py fix(geocode): apply viewport bias to Netsyms address results 2026-04-26 20:59:17 +00:00
geocode_test.py feat(navi): structured geocode with usaddress parsing and reranker 2026-04-20 16:29:47 +00:00
google_places.py Add Google Places (New) tertiary enrichment for business POIs 2026-04-22 04:08:12 +00:00
ingester.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
key_manager.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
landclass.py landclass: filter antimeridian-wrapping PAD-US records 2026-05-20 16:34:14 +00:00
landclass_test.py landclass: filter antimeridian-wrapping PAD-US records 2026-05-20 16:34:14 +00:00
nav_tools.py feat(geocode): add viewport bias for location-aware search 2026-04-26 04:03:44 +00:00
nav_tools_test.py feat(navi): add nav_tools with route() and reverse_geocode() - Phase H2 2026-04-19 22:14:26 +00:00
netsyms.py feat(navi): add netsyms tier-2 geocoding + geocode API 2026-04-20 07:24:09 +00:00
netsyms_api.py Switch /api/reverse/<lat>/<lon> elevation source from Valhalla to planet-DEM 2026-05-20 15:20:35 +00:00
netsyms_test.py feat(navi): add netsyms tier-2 geocoding + geocode API 2026-04-20 07:24:09 +00:00
new_pipeline.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
organizer.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
osm_categories.py Add place detail proxy with Nominatim-first routing and Overpass fallback 2026-04-21 03:06:51 +00:00
overture.py Add Overture Maps POI enrichment layer for place details 2026-04-21 16:51:25 +00:00
peertube_collector.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
peertube_scraper.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
place_detail.py recon: add /api/wiki-enrich endpoint (extraction #5 prep, additive) (#8) 2026-05-22 13:23:08 -06:00
query_router.py feat(navi): semantic query router for intelligent tool selection - Phase H2b 2026-04-19 23:50:35 +00:00
query_router_test.py feat(navi): semantic query router for intelligent tool selection - Phase H2b 2026-04-19 23:50:35 +00:00
reverse_bundle_test.py Switch /api/reverse/<lat>/<lon> elevation source from Valhalla to planet-DEM 2026-05-20 15:20:35 +00:00
scraper_runner.py Fix progress regex and SIGHUP/scan_zims race condition 2026-04-19 19:35:42 +00:00
status.py Add scraper Phase 2: smart crawl mode detection + browser fallback 2026-04-18 18:26:43 +00:00
utils.py Phase 3: dispatcher, transcript processor, text_dir resolution 2026-04-14 15:39:42 +00:00
web_scraper.py Initial commit: RECON codebase baseline 2026-04-14 14:57:23 +00:00
wiki_enrich_api.py recon: add /api/wiki-enrich endpoint (extraction #5 prep, additive) (#8) 2026-05-22 13:23:08 -06:00
wiki_enrich_api_test.py recon: add /api/wiki-enrich endpoint (extraction #5 prep, additive) (#8) 2026-05-22 13:23:08 -06:00
wiki_rewrite.py Add wiki link rewriting to local Kiwix 2026-04-23 06:34:22 +00:00
wiki_rewrite_api.py recon: add /api/wiki-rewrite endpoint (extraction #5 prep, additive) (#9) 2026-05-22 14:08:18 -06:00
wiki_rewrite_api_test.py recon: add /api/wiki-rewrite endpoint (extraction #5 prep, additive) (#9) 2026-05-22 14:08:18 -06:00
zim_monitor.py Phase 1: Kiwix foundation — ZIM monitor and kiwix-serve setup 2026-04-16 23:39:34 +00:00