# Narrowboat AI — expanded waterways archive v2

29 October 2026. This is an evidence-led expansion of Alan’s SKIPPER starter and
Narrowboat AI’s first integration. “Ten times better” is treated as a request for
deeper engineering and checking, not a claim of ten times the coverage or accuracy.

## What was reviewed

The original handoff, README and importer; the previous integration; the current
live Site source; routing/GPS/facility modules; source licences; original Scottish
Canals downloads; retained OSM geometry; and additional publisher datasets. The
original ZIP was code, not a populated national database. Its national amenity
sweep, way-centre export, weak partial-response handling, missing export provenance
and missing country-completeness evidence were unsuitable for a verified boat map.
The repaired v1 importer remains separately preserved, with failure-preservation tests.

The live application is a Vinext/Cloudflare Worker Site with Leaflet, bundled OSM
route/facility data, existing D1/R2 bindings and device-local records/backups.
This work adds no subscription, API key, paid dataset or new hosted database.
The SQLite reference database is connected to the app through its matching generated
catalogue and content-addressed detail exports. Personal boat/account records are
not included in any reference archive. Existing viewer access remains unchanged.

## Actual additions

| Source | New source records | Scope and important qualification |
|---|---:|---|
| Scottish Canals | 971 | 160 lock gates, 754 towpath line features, 57 weirs. Gates are not extra chambers. |
| Retained OSM structure geometry | 1,081 | 322 waterway tunnels, 456 other covered sections, 273 aqueducts, 30 waterway bridges. Retained October snapshot, not a new national refresh. |
| Environment Agency | 227 | Fluvial navigation aids with a watercourse or navigation purpose; 934 coastal/tidal/out-of-scope records excluded. Not visitor moorings or locks. |
| BridgeWise / OSM | 102 | 24 marina records, 71 other waterfront places, 7 bridge positions on the Norfolk Broads. No headroom/pilot data copied. |
| Fresh small Rufford OSM pilot | 4 | Three mapped bridge lines intersecting a canal and one nearby toilet-area point. Nearby does not prove boat access. |
| **Total new** | **2,385** | Source records, not a count of unique facilities or independently verified sites. |

The total is **23,109**, including the 20,724 inherited archive records. Existing
9,750 journey-facility records and the routing network are not rewritten. Existing
Scottish lock/chamber records remain 91; the 160 new gates are separately typed.
The 16 previously excluded empty Scottish mooring geometries remain excluded.
344 canal vertices are retained as supporting evidence, not counted as facilities.
The empty publisher towpath-node ZIP supplies no records.

Full counts by source, category, collection area and geometry type are in
`data/run_report.json` in the downloadable package. Possible overlaps number
**315**. These are evidence for review, not proven duplicates; nothing is removed
solely because its coordinates resemble another provider’s record.

## Ten substantial improvements

| Area | Before | Expanded implementation |
|---|---|---|
| Source breadth | Starter OSM query; first app integration added Scottish points/lines | Additional official Scottish assets, EA inland assets, licensed Broads records and a bounded fresh pilot |
| Provenance | Inconsistent point-only export | Stable source IDs, per-source terms/URLs/hashes, retained/retrieved dates separated from source snapshot dates |
| Geometry | Starter way centroids | Original point/line/multipart geometry; derived area points explicitly flagged |
| Feature meaning | Gates and waterfront places could inflate apparent totals | Gates, chambers, assets, waterfront places, culverts, tunnels, aqueducts and hazards stay separate |
| Duplicate handling | Stable-ID replacement alone | Source identity checks plus conservative cross-provider candidates; no automatic proximity-only merging |
| Data delivery | Whole 18 MB file before searching | About 4.7 MB catalogue, lazy detail files with SHA-256 integrity checks, bounded concurrent downloads |
| Search and map | Text/category/source; first 100 only | Region, evidence and mapped-access filters, viewport scope, 30-record pagination, fit-to-results, direct planner shortcut |
| Journey proximity | Line vertices only | Exact segment-distance/intersection handling catches crossing lines whose vertices lie outside the corridor |
| Portable archive | Basic SQLite/point GeoJSON | Full geometry GeoJSON ZIP; indexed SQLite with FTS5 search, RTree bounds, quality flags, source registry and overlap table |
| Reuse and failure behaviour | Limited reproducibility/offline support | Pinned free build dependencies, raw licensed inputs, deterministic detail hashes, failed-fetch retries, saved on-device reference selections, bounded export and integrity tests |

The catalogue size is a measured reduction for that initial data file only.
Actual page traffic also includes the selected source-detail files and map tiles.
No “10× accuracy” or complete-coverage claim is made.

## What the app does

Journey Planning now has a direct **Search waterways archive** button. The archive
uses the existing colours, type sizes and Leaflet components. It supports names,
waterway/source references, category, source, collection area, evidence type,
mapped access, map bounds and selected-journey proximity. Full geometry and source
attributes can be viewed for each record. Raw dimensions remain unverified source
claims and are never used to certify a boat’s clearance or change a calculated route.

Search results are paginated rather than silently dropping all results after 100.
Source geometry files are checked against the catalogue’s content hashes before
rendering. Failed downloads remain retryable, and stale asynchronous searches cannot
replace newer results. Empty states explicitly avoid claiming there are no facilities.

A filtered selection of up to 3,000 records / 20 MB can be saved in IndexedDB on the
current device, including full geometry and provenance. A successful transaction is
required before success is shown. Replacing a saved selection does not erase the
old one when validation/download fails. Reopening that selection while the app stays
open works without fetching the reference data again. This is **not a fully offline
PWA**: cold-starting the app, basemap tiles and live notices require internet. No map
tiles or GPS history are downloaded or saved by this feature.

Full SQLite and GeoJSON ZIPs are normal file links as a fallback to the filtered
browser download. A browser download request is not represented as a verified save.

## Source decisions

- **Scottish Canals:** publisher GIS portal expressly states OGL 3.0 for geographic
  downloads. Attribution retained. Original EPSG:27700 shapefiles retained and
  converted to WGS84. Source snapshot date is unknown where not supplied.
  https://www.scottishcanals.co.uk/scottish-canals-data-portal
- **OpenStreetMap:** ODbL. Original source geometry and tags retained. The national
  structure additions come from the retained 23 October snapshot, not a fresh survey.
  https://www.openstreetmap.org/copyright
- **Environment Agency:** the authoritative National Data Library record identifies
  Open Government Licence. The older CKAN mirror omitted its licence field, so that
  omission was not treated as the authority. Only the identified dataset and inland
  subset are imported. Source inventory dates do not imply a live operational feed.
  https://www.data.gov.uk/dataset/70817bda-9c68-4f27-8d7a-9b8458e30d67/aims-aids-to-navigation
- **BridgeWise:** provider explicitly offers the selected OSM-derived data under ODbL
  with commercial reuse, attribution/share-alike conditions. The separate private
  headroom, tidal-model and pilot dataset is not copied. The waterfront file also
  contains pubs/services; records without an explicit marina classification are
  “waterside place”, not automatically a permitted mooring.
  https://coryl.com/bridgewise-open-data
- **Waterways Ireland:** public facilities service was identified, but its item
  metadata returned a permission error. Reuse terms were not established, so no
  dataset was imported. Northern Ireland remains an explicit gap. A small NI
  Overpass pilot also timed out; no failed/empty result was published as successful.
- **CRT restricted bulk facilities:** not added. The existing commercial-permission
  request/register and separately reviewed OGL lock evidence remain intact.
- **OSM API policy:** one small map extract was used for regional validation. The
  editing API is not used as a recurring read-only/bulk importer; future national
  refreshes must use suitable Overpass/extract services. Failed public endpoints
  were not hammered or hidden behind a completeness claim.

The combined OSM-derived database is distributed with ODbL attribution and downloads;
per-source OGL/other provenance remains attached. Data licences do not assign a
new licence or ownership to Andy’s existing app code. No copyright maps were copied.

## Validation and current limits

Automated checks completed: **230 Node tests**, **4 Python importer/database tests**,
SQLite integrity, FTS query, RTree coverage, stable IDs, source counts, source/detail
checksums, categories, service filters, pagination, empty searches, full-geometry
exports, source quarantine, failure preservation and exact crossing-line proximity.
Original route/GPS/facility tests pass. The original route and reviewed facility data
files are unchanged. The full production build is required before publication.

Local preview reported running but the browser connection was refused even after
clearing the stopped preview’s stale generated dev lock. Browser interaction will
therefore be checked on the published trial update. Its final results, deployment
version and any repairs are recorded separately in the delivered release evidence.

No test here certifies complete UK coverage, visitor rights, available berths, current
services, stoppages, depth, physical clearance, navigable connectivity or GPS on an
actual travelling boat. iPad/Android layout has not been tested on those physical
devices. Approximate mapped positions and overlapping providers remain visible.

## Reproduce and inspect

The standalone package contains SQLite, full GeoJSON, counts, source/quality reports,
licensed source snapshots, the original handoff/starter, integration scripts, tests,
checksums and this report. Generated reference data contains no private boat profiles,
user accounts, backups, credentials or AI conversations.

Use Python 3.10+ with `integration/scripts/archive/requirements.txt`, then run
`python scripts/archive/expand_archive.py` from the included `integration` directory.
That rebuild does not require live data downloads or paid services. Original sources
can be refreshed only after rechecking terms and validating the corresponding input.
See `integration/scripts/archive/README.md` and `data/source-manifest.json`.

## Gates

- YES: expanded data export and SQLite generated and technically checked.
- YES: existing app integration, source detail controls and integrity checks implemented.
- YES: free resources; known source terms retained; original map/GPS data preserved.
- PENDING FINAL RELEASE CHECK: published browser interactions and saved-selection flow.
- UNKNOWN: physical-device layout, actual travelling GPS and browser download completion.
- NO: verified complete UK coverage or a new certified navigation graph.
