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: 0 additions & 3 deletions .cairn/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@
"cycle device-link -> card-storage",
"cycle device-link -> device-map-builder",
"cycle device-link -> firmware-update",
"cycle device-link -> map-assembly",
"cycle device-map-baking -> content",
"cycle device-map-baking -> map-reading",
"cycle device-map-baking -> source-preparation",
"cycle device-map-builder -> device-link",
"cycle device-map-builder -> firmware-update",
"cycle device-map-builder -> map-assembly",
"cycle device-map-builder -> map-style",
"cycle device-map-builder -> route-planning",
"cycle device-map-builder -> trailview",
"cycle firmware-update -> device-link",
Expand Down
13 changes: 0 additions & 13 deletions .claude/launch.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "web-builder",
"runtimeExecutable": ".venv/bin/python",
"runtimeArgs": ["-m", "builder.server", "--no-browser", "--port", "8000"],
"port": 8000
},
{
"name": "web-builder-frontend",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev", "--", "--port", "5173"],
"cwd": "builder/web",
"port": 5173
},
{
"name": "web-builder-static",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev", "--", "--mode", "web", "--port", "5173"],
"cwd": "builder/web",
"port": 5173
},
{
"name": "data-page",
"runtimeExecutable": "tools/obc",
Expand Down
68 changes: 28 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,13 @@ jobs:
path: ${{ runner.temp }}/ui-snapshots/*.png
if-no-files-found: ignore

# Routing-profile round-trips through the builder's pack path. These shell out to the real
# obc-pack binary over the tiny corpus and byte-compare the §8.6 profile table against
# independently quantized expectations — so they pin the packer's writer against the spec
# rather than against itself — plus the pure /api/schema and /api/presets endpoints via
# FastAPI's TestClient. The preflight is what stops a missing binary or corpus from turning
# the packer half of the suite into a silent skip.
builder-python:
# Routing-profile round-trips through the obc-pack binary. These pack the tiny corpus with custom
# profiles and byte-compare the §8.6 profile table against independently quantized expectations,
# so they pin the packer's writer against the spec rather than against itself. The preflight is
# what stops a missing binary or corpus from turning the suite into a silent skip.
packer-python:
needs: selection
if: contains(fromJSON(needs.selection.outputs.jobs), 'builder-python')
if: contains(fromJSON(needs.selection.outputs.jobs), 'packer-python')
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand All @@ -445,26 +443,26 @@ jobs:
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: *python-uv-version
- name: Prepare web-builder packer tests
- name: Prepare the packer profile tests
run: |
uv sync --locked --group builder-test
uv sync --locked --group packer-test
cargo build -p obc-bake --bin obc-pack --release --locked
- name: Packer binary and corpus are present
run: |
test -x target/release/obc-pack
test -f builder/tests/corpus/data/tiny.osm.pbf
- name: web-builder packer tests (pytest)
id: python-builder
- name: Packer profile tests (pytest)
id: python-packer
run: |
mkdir -p .artifacts/python
rm -f .artifacts/python/builder.xml
PYTHONPATH=. uv run --locked --group builder-test python -m pytest builder/tests/ -v --junitxml=.artifacts/python/builder.xml
- name: Upload builder Python test results
if: ${{ !cancelled() && (steps.python-builder.outcome == 'success' || steps.python-builder.outcome == 'failure') }}
rm -f .artifacts/python/packer.xml
uv run --locked --group packer-test python -m pytest host/obc-bake/tests/test_routing_profiles.py -v --junitxml=.artifacts/python/packer.xml
- name: Upload packer Python test results
if: ${{ !cancelled() && (steps.python-packer.outcome == 'success' || steps.python-packer.outcome == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: python-builder-${{ github.run_attempt }}
path: .artifacts/python/builder.xml
name: python-packer-${{ github.run_attempt }}
path: .artifacts/python/packer.xml
if-no-files-found: error

embedded:
Expand Down Expand Up @@ -1016,18 +1014,14 @@ jobs:
exit 1
fi

# The web builder's Svelte frontend: type-check, unit tests, production builds.
#
# One source tree, two hosts: `npm run build` is the local FastAPI one and
# `build:web` the static hosted site. Both are built here — a host that stops compiling is otherwise invisible until someone
# tries to ship it. The *contents* of the web bundle (no job polling, no style
# editor) are asserted by vitest, which builds and inspects the emitted chunks.
# The web app's Svelte frontend: type-check and unit tests. The production build of the app is
# in vitest too: `bundle.test.ts` builds it and inspects the emitted chunks.
#
# The three wasm bridges come from `wasm-bridges` rather than being rebuilt here, so the
# module the byte-identity tests run against is literally the one the size budget passed. It is
# a hard dependency, not an optimisation, and it is why the downloads land before `npm ci`:
# every step below needs them — the TS wrappers import the generated bindings, so `npm run check`
# type-checks against them, and the vitest suites and `build:all` fail without the artifacts.
# type-checks against them, and the vitest suites fail without the artifacts.
# The assembly bridge's suite is also the *headless smoke* for #1034: it assembles the checked-in
# cell fixture in Node and compares the result to the bytes the native CLI wrote.
web:
Expand Down Expand Up @@ -1068,8 +1062,6 @@ jobs:
run: |
rm -f "$RUNNER_TEMP/web-builder-junit.xml"
npm run test:components -- --reporter=default --reporter=junit --outputFile="$RUNNER_TEMP/web-builder-junit.xml"
- name: production builds (dev + web hosts)
run: npm run build:all
# naga is the WGSL front end of Firefox; Chrome's Tint compiles the same files in the TrailView smoke.
- name: Cache the WGSL validator
id: naga
Expand All @@ -1093,17 +1085,15 @@ jobs:
path: ${{ runner.temp }}/web-builder-junit.xml
if-no-files-found: error

# The builder's download journey in a real browser: the shipped `dist/web` build, the real
# assembly worker, real OPFS, and the checked-in bridge fixture served as a loopback catalog.
# The web app in a real browser: the planner build with the pretend device, the real assembly
# worker, real OPFS, and the checked-in bridge fixture served as a loopback catalog.
#
# Its own job rather than a step on `web`, because the registry routes a suite to the job whose
# step executes it: sharing `web` would make the component tier and this end-to-end journey one
# route, and neither could be selected without the other. It needs the production core and
# deliberately not the flat test device — the shipped build must not contain it, and
# `bundle.test.ts` is what says so.
# step executes it: sharing `web` would make the component tier and these end-to-end journeys one
# route, and neither could be selected without the other.
#
# `npm test` builds `dist/web` itself (the package's `pretest`), so the bundle under test can
# never be stale or built against a different catalog URL.
# Each `npm run test:*` builds its page itself (the package's `pretest:*`), so the bundle under
# test can never be stale.
web-browser:
needs: [selection, wasm-bridges]
if: contains(fromJSON(needs.selection.outputs.jobs), 'web-browser')
Expand Down Expand Up @@ -1139,16 +1129,14 @@ jobs:
run: |
npm ci
npx playwright install --with-deps chromium --only-shell
- name: Builder assemble and download journey
- name: Web app journeys and the planner request budget
id: browser-journey
run: npm test --prefix builder/web/tests/browser
run: npm run test:planner --prefix builder/web/tests/browser
- name: Require browser journey execution
if: ${{ !cancelled() }}
env:
JOURNEY_OUTCOME: ${{ steps.browser-journey.outcome }}
run: test "$JOURNEY_OUTCOME" = success
- name: Planner request budget
run: npm run test:planner --prefix builder/web/tests/browser
- name: Operator page at phone width
run: npm run test:data --prefix builder/web/tests/browser
- name: TrailView smoke on SwiftShader
Expand Down Expand Up @@ -1223,7 +1211,7 @@ jobs:
# publishes no plan, which fails this gate rather than silently passing.
ci:
if: always()
needs: [selection, guards, cairn, fmt, clippy, test, ui-snapshots, builder-python, embedded, boot, device, deny, wasm, wasm-bridges, docs, ios-unit, ios-app, ios-release, web, web-browser, verification, planner-search]
needs: [selection, guards, cairn, fmt, clippy, test, ui-snapshots, packer-python, embedded, boot, device, deny, wasm, wasm-bridges, docs, ios-unit, ios-app, ios-release, web, web-browser, verification, planner-search]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ name: Deploy site
#
# / landing page + the live device demo trunk (obc-web-demo → wasm)
# /docs/ /blog/ docs site + expedition log build_docs.py (trunk pre_build hook)
# /builder/ the static map builder vite --mode web
# /plan/ the regional route planner vite --mode planner
# /plan/ the web app vite --mode planner
#
# Because the demo is the firmware's own render path compiled to wasm, every push
# rebuilds it — the site can never show a stale screenshot. And everything here is
# static files: there is no backend on this tier. Route conversion runs as wasm
# in the tab. Routing and search use the VPS. The tile Worker serves map tiles.
#
# The site carries code only. The planner and the map builder read the active release from
# The site carries code only. The web app reads the active release from
# `planner/catalog.json` at page load, so a data release never runs this workflow.
#
# ── What GitHub Pages can and cannot do (C6 #905; measured 2026-07-26) ──────────────
Expand Down Expand Up @@ -140,7 +139,7 @@ jobs:
OBC_BUILD_HARDWARE: "1"
run: trunk build --release --config docs/Trunk.toml --public-url "./"

# The builder imports the shared obc-route GPX↔OBCR path (#896), the cell
# The web app imports the shared obc-route GPX↔OBCR path (#896), the cell
# assembler (#1034), and the production-rendered skin preview (#1045). The shared
# script is also used by CI so the lists cannot drift.
# None is optional: the frontend imports the generated bindings, so a missing
Expand All @@ -154,28 +153,20 @@ jobs:
cache: npm
cache-dependency-path: builder/web/package-lock.json

# VITE_SITE_BASE makes the builder's links to the docs and the landing relative:
# VITE_SITE_BASE makes the web app's links to the docs and the landing relative:
# they are siblings inside this artifact, so naming them by absolute URL would be
# the one place a domain move still bit us. Left unset everywhere else (the dev
# server), where the site genuinely is somewhere else.
- name: Build the static map builder
- name: Build the web app
working-directory: builder/web
env:
VITE_SITE_BASE: "../"
run: |
npm ci
npm run build:web

- name: Build the public route planner
working-directory: builder/web
env:
VITE_SITE_BASE: "../"
run: npm run build:planner
npm run build

- name: Assemble the site
run: |
mkdir -p docs/dist/builder
cp -R builder/web/dist/web/. docs/dist/builder/
mkdir -p docs/dist/plan
cp -R builder/web/dist/planner/. docs/dist/plan/
mv docs/dist/plan/planner.html docs/dist/plan/index.html
Expand All @@ -193,7 +184,7 @@ jobs:
# in, and they are the one thing to hand-edit on the day the domain changes.
- name: No baked-in site path
run: |
if grep -rIlE "[\"'(=]/OpenBikeComputer/" docs/dist/builder docs/dist/index.html; then
if grep -rIlE "[\"'(=]/OpenBikeComputer/" docs/dist/plan docs/dist/index.html; then
echo "::error::the bundle hard-codes the project-Pages sub-path — it would 404 on a custom domain"
exit 1
fi
Expand Down Expand Up @@ -235,7 +226,6 @@ jobs:
[ "$n" -gt 0 ] || { echo " x no local assets referenced — check is vacuous"; fail=1; }
}
check "$base/"
check "$base/builder/"
check "$base/docs/"
check "$base/docs/hardware/bom/"
for file in purchasing.csv OBC_PCB.csv USB_Baseboard.csv OBC_PCB.pdf USB_Baseboard.pdf; do
Expand Down
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,11 @@ tools/obc.local
builder/web/.env.local
.venv/
/maps/
# Web builder frontend: dependencies + the Vite build output (CI builds it).
# The dev host builds into builder/server/static/dist/ (what the FastAPI server
# mounts); the static-web host into builder/web/dist/web/. Both entries must keep matching vite.config.ts's outDirs: when they
# drifted apart, `npm run build` wrote to an unignored path and 640 KB of bundle
# got committed by accident (and the server mounted nothing).
# Web app frontend: dependencies + the Vite build output, which goes to builder/web/dist/MODE/.
node_modules/
builder/web/dist/
planner/tiles/dist/
planner/tiles/.wrangler/
builder/server/static/dist/
# The static tier's data files (#900): the Geofabrik index is ~1.7 MB of
# generated JSON that goes stale weekly, and the catalog manifest belongs to the
# bakery — both are produced at deploy time, never committed.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ over BLE and USB. The custom PCB and enclosure are still under development. KiCa
| `host/` | Host tools, map bakers, fixtures, and test support |
| `planner/` | Router, build tools, service, search, and tile worker |
| `sim/` | Desktop, web and phone simulators, host core, replay, feeder and benchmarks |
| `builder/` | Web builder, Rust/WASM core, USB transport, presets, and server |
| `builder/` | Web app, Rust/WASM core, USB transport, and presets |
| `companion-ios/` | SwiftUI companion app and shared iOS package |
| `specs/` | Normative binary, wire, and vector contracts |
| `fixtures/` | Scenario registry, source provenance, and fixture builders |
Expand Down
11 changes: 0 additions & 11 deletions builder/__init__.py

This file was deleted.

70 changes: 0 additions & 70 deletions builder/palette.json

This file was deleted.

1 change: 0 additions & 1 deletion builder/server/__init__.py

This file was deleted.

25 changes: 0 additions & 25 deletions builder/server/__main__.py

This file was deleted.

Loading
Loading