Skip to content

feat(lodge): serve the React app again - #293

Merged
bketelsen merged 1 commit into
mainfrom
feat/lodge-serves-react
Nov 26, 2026
Merged

bketelsen merged 1 commit into
mainfrom
feat/lodge-serves-react

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of plan 0011, "Lodge serves the React app" (ADR-0050, both in #292, which is not merged yet: the links to docs/adr/0050-frostnotes-has-no-desktop-window.md in this PR resolve once #292 lands, so merge #292 first).

  • One build path. make web-build builds the React app (app/, vite build --mode web, base /app/notes/) into build/web again, with icon.svg and revision.txt. make lodge-app depends on it and lays out build/lodge/apps/notes with app.json at the build's version. This is the pre-Run the shared NSGo editor in an authenticated Lodge session #267 shape. legacy-lodge-app is folded into web-build and removed. make deb, make lodge-package and stage.sh take build/web as before. release.yml runs make web-build. flatpak.yml's web job runs make lodge-app. All of them now hold the React app.
  • NSGo web build kept, not shipped. nsgo-lodge-app and nsgo-lodge-evidence are unchanged and still build into build/nsgo-lodge, but nothing shipped uses them. packaging/nsgo/build-rc.sh's Lodge archive now comes from make lodge-app. Phase 3 removes the NSGo build.
  • Checks of the shipped tree:
    • packaging/deb-check.py gets --forbid GLOB (fnmatch on each member's install path).
    • make deb-check now requires web/index.html, web/icon.svg and web/revision.txt, where it used to require web/nsgo.json. It forbids web/nsgo.json, *.wasm and */wasm_exec.*.
    • internal/packagecheck/debcheck_test.go mirrors those arguments. It adds 3 failing cases: nsgo.json, a .wasm module and Go's wasm_exec loader. A new test, TestMakeDebCheckPassesTheseArguments, fails when the Makefile's deb-check recipe stops passing any of them. I broke 1 argument by hand to see it fail.
  • Evidence. make m4-evidence and make porter-evidence run make lodge-app's tree in place of legacy-lodge-app's. With M4_NOTES_WEB=... they run the tree a .deb installs instead.
  • flatpak.yml's web job. It is renamed "Build the Lodge web app (make lodge-app)", which is not a required check. It drops setup-go from cmd/frostnotes-nsgo/go.mod and NSGO_VERSION. Its archive still carries notes/web/revision.txt, which the export job checks against GITHUB_SHA.
  • dev/nsl/provision.sh installs libgtk-3-0t64. Since the Tauri shell went (c1d950c), no package pulled in GTK 3. On a freshly provisioned machine Firefox ESR failed to start ("libgtk-3.so.0: cannot open shared object file"), and make m4-evidence failed with it.
  • Docs. docs/design/app.md (In a browser, the Lodge paragraph of the NSGo section, the live suite's web target), docs/development.md and the README now say that Lodge serves the React app. Plan 0011's status is not edited.

Contract check. Nothing in the API or Lodge contract changed after the React app last served Lodge on 2026-11-23:

  • schema/rpc, api/zz_generated.go, app/src/rpc/gen/api.ts, internal/lodgeapp, packaging/lodge and app/package.json have no commits after Run the shared NSGo editor in an authenticated Lodge session #267. The last schema change is 745a40b, 2026-11-16.
  • The React app still does lodge-client's handshake (connectLodge in app/src/lodge/main.tsx) and follows the shell's theme (Bridge.tsx). It uses rpc.hello's contentKey for content URLs.
  • It is still on lodge-client client/v0.3.2.
  • It needs no Wasm frame policy.

Risk tier

Risk tier: 3 — L1 and L2 paths, matched by script against .github/risk-paths.json (schema v2, braces and ** expanded):

Path Level (glob) Why the change is safe
packaging/deb-check.py L1 (packaging/{nfpm.yaml,deb-check.py}) Additive: a new --forbid option that can only add errors. Every existing rule is unchanged, and its unit tests pass, with 3 new failing cases.
.github/workflows/release.yml L1 ({release,flatpak}.yml), L2 (workflows/**) One line: make web-build loses the NSGO_VERSION= argument, which the React build does not read. No permission, trigger, action pin or attestation changes.
.github/workflows/flatpak.yml L1, L2 Only the web job changes: its name, a removed setup-go step and the NSGO_VERSION argument. It still builds make lodge-app into the same frostnotes-lodge.tar.gz, with notes/web/revision.txt checked by the export job. Permissions, the publish job and the pins are unchanged.
Makefile L2 web-build, lodge-app, deb-check, m4-evidence and porter-evidence change as described above. verify, check, ci, the race gate and bump are untouched.
dev/nsl/provision.sh L1 One Debian package (libgtk-3-0t64) added to the existing apt-get install from the distribution's archive. No new download, pin or checksum.

Default L3: README.md, docs/design/app.md, docs/development.md, internal/packagecheck/debcheck_test.go, packaging/nsgo/build-rc.sh.

Docs housekeeping

Verification

Run on ba57375's tree before committing; the commit holds the same files.

  • make check green on the host (exit 0; internal/packagecheck, repocheck and workflowcheck ok).
  • make ui-check green in nsl (exit 0; 96 files, 821 tests).
  • make lodge-app in nsl (exit 0). build/lodge/apps/notes/web holds index.html (with id="root"), assets/, icon.svg and revision.txt, and no nsgo.json or .wasm file.
  • make deb (exit 0). Its deb-check printed "is ok" for dist/frostyard-notesd_0.0.0-4b66bad-snapshot_amd64.deb. Extracted with dpkg-deb -x, the package has 0 files named *.wasm or nsgo*.
  • make m4-evidence M4_NOTES_WEB=build/deb-x/usr/share/lodge/apps/notes (exit 0), on the tree the .deb installs. It used lodge's development build at e76a17c and Firefox ESR 153.4.0esr through geckodriver 0.37.1 under Xvfb, in a newly provisioned frostnotes nsl machine. Results:
    • TestIWebAppInLodge/desktop: PASS, "notes' frame is 1232 wide", "the image went in by a drop".
    • TestIWebAppInLodge/phone: PASS, "notes' frame is 390 wide", "the image went in by a drop".
    • TestIRenderedNotesRunNoScript: PASS, "no script ran: live preview, reading view, the links, and evil.svg opened as a document".
    • TestIPorterThroughLodge/listener and /agent-socket: PASS.
  • Workflows changed: no action added, every action is still SHA-pinned with # vX.Y.Z, and checkout keeps persist-credentials: false. The web job has no permissions block of its own, as before; the top level is contents: read.
  • Not run: make nsgo-lodge-app itself (only make -n), CI's Flatpak jobs, and core's check-readme.mjs on the one-line README change (it needs node, which never runs on the host).

Plan 0011, Phase 1 (ADR-0050): make web-build builds the React app
(app/) for /app/notes/ again, and make lodge-app lays it out with its
manifest, so make deb, make lodge-package, the release and flatpak.yml's
Lodge archive all hold it. legacy-lodge-app is folded into web-build;
make m4-evidence and porter-evidence run lodge-app's tree, or with
M4_NOTES_WEB the tree a .deb installs.

The build still writes revision.txt, which flatpak.yml checks in its
Lodge archive. deb-check.py gains --forbid GLOB, and make deb-check
forbids the NSGo web build's nsgo.json, any .wasm module and Go's
wasm_exec loader; a test holds the Makefile to the arguments the tests
check. nsgo-lodge-app and the NSGo client still build, for a Lodge test
install only; packaging/nsgo/build-rc.sh's Lodge archive is lodge-app's.

dev/nsl/provision.sh installs libgtk-3-0t64: since the Tauri shell went
(c1d950c), no package brought in GTK 3, and on a freshly provisioned
machine Firefox ESR could not start, so make m4-evidence failed with
"libgtk-3.so.0: cannot open shared object file".
@github-actions github-actions Bot added level:L1 Read every line risk:high Touches a path in .github/risk-paths.json labels Nov 25, 2026
@bketelsen
bketelsen merged commit 07fbed3 into main Nov 26, 2026
23 of 24 checks passed
@bketelsen
bketelsen deleted the feat/lodge-serves-react branch November 26, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L1 Read every line risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants