Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
## Pike SQLite Follow-On

- After exporting an OpenInterstate release locally, also build Pike's SQLite pack from that exact release archive unless the user explicitly says not to.
- Use Pike's supported release-driven pipeline entrypoint from `/Users/tjohnell/projects/pike/server`: `./pike-pipeline.sh build --release-file /abs/path/openinterstate-release-<release-id>.tar.gz --reachability-snapshot /Volumes/goose-drive/pike-osrm/reachability/pike.osrm-reachability.snapshot.pgdump`.
- Use Pike's supported release-driven pipeline entrypoint from `/Users/tjohnell/projects/pike/server`: `./pike-pipeline.sh build --release-file /abs/path/openinterstate-release-<release-id>.tar.gz --reachability-snapshot <path-to-reachability-snapshot>`.
- Reachability snapshots are produced by the separate `tldev/openinterstate-reachability` repo.
- Let Pike keep its own default output locations unless the user asks otherwise. The current default host pack output is `/Users/tjohnell/projects/pike/server/.data/packs/pike.sqlite` and the staged build file is `/Users/tjohnell/projects/pike/server/.data/packs/pike.sqlite.new`.
- After the Pike build finishes, validate the pack with `sqlite3` by checking `PRAGMA integrity_check;` and confirming the `meta` table reports the matching `openinterstate_release_id`.

Expand Down
25 changes: 1 addition & 24 deletions bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -544,20 +544,6 @@ oi_container_path() {
printf '/data/%s\n' "$rel_path"
}

oi_guard_no_reachability_clears() {
local sql_file="$1"
local pattern

for pattern in \
'TRUNCATE[[:space:]]+[^;]*exit_poi_reachability' \
'DELETE[[:space:]]+FROM[[:space:]]+exit_poi_reachability' \
'DROP[[:space:]]+TABLE[[:space:]]+[^;]*exit_poi_reachability'
do
if rg -n -i -e "$pattern" "$sql_file" >/dev/null 2>&1; then
oi_die "guardrail violation in $(basename "$sql_file"): reachability clears are forbidden"
fi
done
}

oi_download_pbf() {
local source_url="$1"
Expand Down Expand Up @@ -1006,11 +992,9 @@ oi_extract_interstate_relation_cache() {
oi_apply_derive() {
local derive_file="$REPO_ROOT/schema/derive.sql"
local derive_state_file import_state_file import_signature derive_signature derive_sql_signature derive_code_signature
local reachability_signature relation_cache_file relation_cache_signature
local relation_cache_file relation_cache_signature
local -a derive_source_files=()

oi_guard_no_reachability_clears "$derive_file"

import_state_file="$(oi_state_file import "$OI_DATA_ROOT|$OI_DB_NAME")"
import_signature="$(oi_state_read "$import_state_file" signature 2>/dev/null || true)"
[[ -n "$import_signature" ]] || import_signature="no-import-state"
Expand All @@ -1032,19 +1016,12 @@ oi_apply_derive() {
relation_cache_file="$(oi_extract_interstate_relation_cache)"
[[ -f "$relation_cache_file" ]] || oi_die "missing Interstate relation cache: $relation_cache_file"
relation_cache_signature="$(oi_file_signature "$relation_cache_file")"
reachability_signature="$(
{
oi_db_query "SELECT COUNT(*), COALESCE(MAX(updated_at)::text, '') FROM exit_poi_reachability;" 2>/dev/null || true
oi_db_query "SELECT COUNT(*), COALESCE(MAX(updated_at)::text, '') FROM osrm_snap_hints;" 2>/dev/null || true
} | oi_hash_stdin
)"
derive_signature="$(
{
printf 'import=%s\n' "$import_signature"
printf 'derive_sql=%s\n' "$derive_sql_signature"
printf 'derive_code=%s\n' "$derive_code_signature"
printf 'relation_cache=%s\n' "$relation_cache_signature"
printf 'reachability=%s\n' "$reachability_signature"
} | oi_hash_stdin
)"

Expand Down
17 changes: 0 additions & 17 deletions docs/data_contract_draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,6 @@ Draft key fields:
- `distance_m`
- `rank`

### exit_place_scores

Represents reachability and ranking metadata for a link.

Draft key fields:

- `exit_id`
- `place_id`
- `route_distance_m`
- `route_duration_s`
- `reachable`
- `reachability_score`
- `reachability_confidence`
- `provider`
- `provider_dataset_version`
- `updated_at`

### reference_routes

Represents route artifacts used for exploration and QA.
Expand Down
5 changes: 0 additions & 5 deletions docs/naming_glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ A point or area of interest reachable from an exit.

A candidate or selected relationship between an exit and a place.

### Exit-Place Score

Reachability or ranking metadata attached to an exit-place link.

### Reference Route

A route artifact intended for exploration, QA, examples, and simulation.
Expand Down Expand Up @@ -68,6 +64,5 @@ Preferred replacement: `exit-place link` or `draft link`, depending on context.
- `canonical_exit_aliases` -> `exit_aliases`
- `pois` -> `places`
- `exit_poi_candidates` -> `exit_place_links`
- `exit_poi_reachability` -> `exit_place_scores`
- `reference_routes` is the preferred public term for route artifacts
- `reference_route_anchors` is the preferred public term for route anchor points
3 changes: 1 addition & 2 deletions docs/release_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ changed.
4. `csv/exit_aliases.csv`
5. `csv/places.csv`
6. `csv/exit_place_links.csv`
7. `csv/exit_place_scores.csv`
8. `csv/reference_routes.csv`
7. `csv/reference_routes.csv`
9. `gpx/reference_routes.gpx.zip`
10. `examples/sample_corridors.geojson`
11. `manifest.json`
Expand Down
1 change: 0 additions & 1 deletion docs/release_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ release-YYYY-MM-DD/
exit_aliases.csv
places.csv
exit_place_links.csv
exit_place_scores.csv
reference_routes.csv
gpx/
reference_routes.gpx.zip
Expand Down
16 changes: 0 additions & 16 deletions schema/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,3 @@ CREATE TABLE IF NOT EXISTS exit_poi_reachability (
CREATE INDEX IF NOT EXISTS exit_poi_reachability_exit_idx
ON exit_poi_reachability (exit_id);

CREATE TABLE IF NOT EXISTS osrm_snap_hints (
source_scope TEXT NOT NULL,
endpoint_kind TEXT NOT NULL,
endpoint_id TEXT NOT NULL,
dataset_key TEXT NOT NULL,
input_lon DOUBLE PRECISION NOT NULL,
input_lat DOUBLE PRECISION NOT NULL,
snapped_lon DOUBLE PRECISION NOT NULL,
snapped_lat DOUBLE PRECISION NOT NULL,
hint TEXT NOT NULL,
snapped_distance_m DOUBLE PRECISION,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (source_scope, endpoint_kind, endpoint_id, dataset_key)
);
CREATE INDEX IF NOT EXISTS osrm_snap_hints_lookup_idx
ON osrm_snap_hints (source_scope, endpoint_kind, dataset_key);
Loading
Loading