Repository navigation
Ship the browser UI in the pip wheel (CSP + wheel check) - #60
Merged
Merged
Conversation
…erved UI remedy serve on a pip install showed 'WebUI assets not bundled': the wheel only packed src/remedy, and remedy-runtime looks for desktop/dist or a webui folder next to its binary, neither of which a pip install has. - scripts/stage_wheel_webui.py builds desktop/ and stages dist (no source maps) into src/remedy/webui/dist (gitignored) with a hashed manifest. - remedy serve passes it as REMEDY_BUNDLED_WEBUI_DIR, the last place the runtime looks, so REMEDY_WEBUI_DIR and a live desktop/dist still win. - Served UI gets a CSP mirroring the desktop one (inline scripts by sha256 only, frame-ancestors none), nosniff, X-Frame-Options DENY and Referrer-Policy no-referrer so a one-time link never leaks via Referer. - scripts/check_wheel.py refuses a wheel without the UI (CI, every push) and, with --release, without runtime pins for its version. - Desktop Release gains a pypi-wheel job that builds the wheel from the tagged commit with the UI and the run's own runtime hashes.
Self-improve bot
This bot does not merge. Owner ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pip install remedy-aithenremedy serveshowed WebUI assets not bundled. The wheel packs onlysrc/remedy; remedy-runtime looks forREMEDY_WEBUI_DIR, adesktop/distnear cwd or its binary, or awebui/uifolder next to the binary. A pip install has none of these.Fix (bundle the static build; wheel 2.4 MB -> 5.1 MB)
scripts/stage_wheel_webui.py [--build]buildsdesktop/and stagesdist(no source maps) intosrc/remedy/webui/dist(gitignored, still packed by uv_build), with aremedy-webui.jsonmanifest (version + per-file sha256).remedy servepasses it to the runtime asREMEDY_BUNDLED_WEBUI_DIR. This is the lowest-priority candidate, soREMEDY_WEBUI_DIRand a livedesktop/diststill win.index.html, neverunsafe-inline. It also setsframe-ancestors 'none'andobject-src 'none'. Other headers:nosniff,X-Frame-Options: DENY, andReferrer-Policy: no-referrer, so a one-time?bootstrap=link can't leak via Referer.scripts/check_wheel.pyfails a wheel that lacks the UI, has a stale or tampered UI, includes source maps, or is over 12 MB. CI runs it on every push.--releasealso requires runtime pins for the wheel's version.pypi-wheeljob builds the frontend, stages it, pins from those sums, and in publish runs re-verifies the published assets (andcmps the pins). It then builds, runscheck_wheel --release, and uploadsremedy-pypi-dist.Tests
tests/test_wheel_webui.py: staging, the wheel check (missing/stale/tampered UI, release pins), and the serve handoff.Local check
Wheel installed in a clean venv,
remedy serverun from /tmp, headless Chrome. The full UI loads with no CSP violations or console errors and no Tauri globals. Chat round-trips through a mock OpenAI-compatible echo model.