fix(builder): build the dev host where it's served, and repair the stale obc-pack paths - #990
Merged
Merged
Conversation
`builder/static/dist/` was a build artifact committed by accident in c070d62: vite's `dev` outDir is `../static/dist` relative to builder/app, which resolves to builder/static/dist — but server.py, tools/justfile, the README and .gitignore all name builder/server/static/dist. Only the ignore rule was expected to cover it, so the 640 KB bundle landed in the tree, and a6b0c35 then swept 36 more files of it into an unrelated chore commit. The mismatch also meant the FastAPI dev host served its "Frontend not built yet" page even right after `npm run build`, since the directory it mounts never existed. Point the outDir at builder/server/static/dist — one line, and the four references that already agreed keep agreeing — then untrack the misplaced copy. Verified: `npm run build` now writes builder/server/static/dist (the same asset hashes the committed bundle had), `python -m builder.server` serves the app at 200 with no console errors, `git status` stays clean after a build, and with the directory absent "/" still returns the 503 build-me page rather than a stack trace. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The three-hosts table still named `frontend/dist/<host>/`, the app directory's pre-refactor name. Vite writes `dist/web` and `dist/desktop` relative to builder/app, which is also what deploy-site.yml copies from and what .gitignore's `builder/app/dist/` covers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…he path `/api/schema` falls back to the checked-in config schema when the obc-pack binary isn't built, but SCHEMA_FILE still named `firmware/obc-pack/…` — a path that stopped existing when the crate moved to `host/`. The failure is silent by construction: the binary branch keeps working, `os.path.exists` just goes False, and the fallback never fires again. So an unbuilt packer took the 503 instead of degrading to a usable schema, and the editor lost the capability information it derives from that envelope. CI builds obc-pack before running builder/tests/, so the existing `/api/schema` test took the binary branch and could not have caught it. test_schema_source.py covers what was uncovered: the path resolves and holds a config schema, the fallback branch actually answers with no binary in sight, and both sources produce the same envelope shape (the frontend reads schema_version / format_version / source off either). All three fail against the pre-fix code. The 503's build hint said `in firmware/` too, as did the same hint in jobs.py — the workspace is rooted at the repo root, so both now say so. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both staleness tests tell you to regenerate with a redirect into `obc-pack/schema/…`, from before the crate moved under `host/`. Followed literally from the repo root — which is where you run cargo — that creates a stray top-level `obc-pack/` directory and leaves the test still failing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two independent path bugs in
builder/, found one after the other. Both are thesilent kind: nothing throws, so nothing noticed.
1. The dev host's bundle was tracked, and served from nowhere
builder/static/dist/was a Vite build artifact committed by accident inc070d62. Vite's
devoutDir was../static/distrelative tobuilder/app,resolving to
builder/static/dist— butserver.py,tools/justfile, theREADME and
.gitignoreall namebuilder/server/static/dist. Only the ignorerule was expected to cover it, so 640 KB of bundle landed in the tree, and
a6b0c35 later swept 36 more files of it into an unrelated chore commit.
The same mismatch meant the FastAPI dev host was broken: it mounts a
directory that never existed, so
python -m builder.serverserved its"Frontend not built yet" page even immediately after
npm run build.Fixed by pointing the outDir at the path the other four references already
agreed on, then untracking the misplaced copy. The
.gitignoreline wasalready correct and needed no change.
2.
/api/schema's fallback could never fireSCHEMA_FILEstill namedfirmware/obc-pack/…, a path that stopped existingwhen the crate moved to
host/. The binary branch kept working,os.path.existsquietly went False, and the repo-file fallback stopped firing — so an unbuilt
packer took the 503 instead of degrading to a usable schema, and the editor lost
the capability information it derives from that envelope.
ci.ymlbuilds obc-pack immediately before pytest, so the existing/api/schematest always took the binary branch and could not have caught this. The Rust side
pins the file's contents through
include_str!(a move there is a compileerror) and the frontend imports it by relative path — Python's string-joined path
was the only one that could rot in silence.
builder/tests/test_schema_source.pynow pins it, along with the fallback branch actually answering and both sources
producing the same envelope shape.
Also fixed: the build hints in
server.pyandjobs.pysaidin firmware/, andboth schema staleness tests told you to regenerate into
obc-pack/schema/…—followed from the repo root that creates a stray top-level
obc-pack/directoryand leaves the test still failing.
firmware/obc-packnow appears nowhere.Verification
npm run buildwritesbuilder/server/static/dist(same asset hashes thecommitted bundle had), the server serves it at 200 with no console errors, and
git statusstays clean after a build./still returns the existing 503 build-me pagerather than a stack trace.
builder/tests/: 10 passed with obc-pack built. The three new path tests werechecked against the pre-fix code and all three fail there.
cargo test -p obc-pack: 199 passed.cargo fmt --allclean.Docs
README.md's three-hosts table pointed atfrontend/dist/<host>/, the appdirectory's pre-refactor name — corrected to
builder/app/dist/in its owndocs:commit. Nothing indocs/content/describes these paths or the schemafallback, so the docs site needs no update.
🤖 Generated with Claude Code