This repository was archived by the owner on Nov 15, 2026. It is now read-only.
Repository navigation
feat(desktop): the Server sheet, the ordered stop and lodge mode's notes - #61
Merged
Merged
Conversation
…stop server_save writes app.json, stops this computer's readd and waits for its lock, and writes local back when the lock stays held after 30 s (ADR-0008, steps 1 to 4). Saving local writes app.json, then starts readd through the new frostread --start. server_get gives the sheet its local facts: the mode and whether a local database exists.
…otes in lodge mode The sheet says what each change does from local facts only, in ADR-0008's words. A lost connection shows a banner that retries every 10 s instead of the error sheet, and never falls back to local data. In lodge mode Open in Notes opens lodge's note route in the browser.
make app-e2e-lodge starts lodge's development build with Read and Notes in the nsl machine and drives the built app through local, lodge, save as note, a stopped lodge, local again, a readd that does not stop, and the state a crash leaves just after app.json is renamed to lodge.
… show an idle drop, and end only the run's processes A save keeps every other member of app.json as raw JSON and refuses a file it cannot read. One mode gate orders saves, connects and server_get, so a connect never acts on a provisional mode. The desktop shows a closed connection in its banner and reloads its lists when the subscription returns. The Server sheet cannot close while a save runs. The e2e script ends only its own process group, and the harness ends the app before it reads the launcher's pid file. Each fix has its guard and a line in .memory/corrections.jsonl.
…e gate, save over a null app.json, retry every 10 s, and end the run's launchers The lodge connect under the mode gate has a 10 s bound, so a server that never finishes its handshake cannot hold a save for ever. The stop's deadline starts once the save holds the gate. A null app.json, which readd and the shell read as local mode, saves as an empty object. The desktop's watcher retries every 10 s, as the banner says; lodge's frame keeps its retry. The harness kills a child that ignores SIGTERM, and the stand-in launchers before it reads the readd pid file.
…cess group in the harness The change watcher is the desktop's only retry, 10 s after a drop or a failed subscribe, and a subscribe that takes after either reloads the window; an answer from before the latest drop counts for nothing. The harness starts WebKitWebDriver as a process group leader and ends that group, which holds the app, the stand-in launcher and its readd, so no process escapes for want of a record.
frostyard-machines
marked this pull request as ready for review
November 6, 2026 17:46
bketelsen
approved these changes
Nov 6, 2026
1 task done
3 tasks done
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Plan 0002, Phase 6, part 2 (plan, ADR-0008, spec). Part 1 (#54) connects the window to lodge. This PR lets a person choose the mode, and tests the whole path against lodge's development build.
web/src/components/ServerSheet.tsx). The sidebar'sConnect to lodge…(orLodge: HOST) opens it. It says what each change does in ADR-0008's words, from local facts only (the mode, and whether a local database exists), so it reads the same while lodge is unreachable.web/src-tauri/src/server.rs,server_save): it writesapp.json(temporary file, synced, renamed, directory synced), then callsdaemon.shutdownand waits for the data lock for up to 30 s. When the lock stays held, it writes local back and saysThis computer's reader did not stop. Frostread still uses it.The mode does not change half-way. Saving local writesapp.json, then starts readd through the launcher's newfrostread --start. One mode gate orders saves, connects andserver_get, so a connect never acts on a mode a save has not settled; the lodge connect under it has a 10 s bound. Other members ofapp.jsonare kept as raw JSON.statussays notes is ready, andOpen in Notesopens lodge's note route in the browser through the opener.web/e2e/lodge.e2e.ts,make app-e2e-lodge): in the nsl machine,scripts/app-e2e-lodge.shstartsmake dev-lodge's script and drives the built app through local, lodge (readd stops, the local database stays, the window shows lodge's data), save as note and Open in Notes, a stopped lodge and the sheet's texts, local again (the same 5 local sources), a readd that does not stop (SIGSTOP: the mode stays local, with the error), and the state a crash leaves just afterapp.jsonis renamed to lodge (the next start ends the local readd and then shows lodge). In a plainmake app-e2ethe suite skips.The lodge web frame is unchanged: the new UI shows only when the shell has a server control, which only the desktop entry gives.
Risk tier
Risk tier: 3 — the PR carries
risk:high. Matched paths, and why each change is safe:web/src-tauri/src/server.rs(new; added to the glob in this PR): writes the desktop's ownapp.jsonunder$XDG_CONFIG_HOME/frostread(0700 directory, 0600 file, atomic rename) and stops or starts this computer's readd. It checks lodge's address with part 1'sLodge::parse(https, or http on loopback only) before it writes anything; it never reads a token or a credential, and it runs no command butfrostread --start, a fixed name with no argument from the page.web/src-tauri/src/main.rs: registers the 2 commands; the navigation and opener rules are unchanged, and the capability test now lists the 5 permissions exactly.web/src-tauri/src/remote.rs: only makesmode_path_fromandreject_duplicate_namesvisible in the crate; no logic changes.web/src-tauri/src/bridge.rs: a connect now holds the mode gate for reading, and the lodge connect has a 10 s bound; the line moving and the origin rules are unchanged.web/src-tauri/capabilities/default.json: grantsallow-server-getandallow-server-saveto the main window; still nocore:default, dialog or opener permission. The page can choose only the mode, and lodge's address is checked in Rust.packaging/flatpak/frostread.sh: moves the local start into a function shared by a plain launch and the new--start, which never runs the app; lodge mode and--backgroundare unchanged.smoke-test.shchecks--startin both modes..github/risk-paths.json: addsserverto the shell's glob, so the new file is a risk path.Makefile: adds theapp-e2e-lodgetarget only; no gate changes.What must not break, and still holds: local mode (
make app-e2e,make flatpak-smoke), and theflatpak.ymljobs (green on this head).Docs housekeeping
Verification
At head 7d90ec7:
make checkgreen (host)make app-checkgreen (nsl): Biome, tsc, Vitest 21 files / 146 tests, the desktop build, cargo fmt, clippy and 66 testsmake app-buildgreen (nsl, through the e2e targets)make app-e2e-lodgegreen (nsl): 7 of 7make app-e2egreen (nsl): 9 passed, 7 skipped (the lodge suite), no process left. One earlier run at ff43089 hadlists.e2e.tsandread.e2e.tstime out onPOST /sessionafterhostile.e2e.ts; 3 later runs passed, and its cause is not known.make flatpak-smokegreen (host), with the 2 new--startchecksmake screenshotsrun and its 3 PNGs committed: the sidebar now showsConnect to lodge…store.ts,desktop/shell.tsandrpc/transport/tauri.tsback tomain: 4 Vitest tests fail on assertions (quiet disconnects, Open in Notes in lodge mode, CodeNotConnected on a refused connect, the banner's retry).server.rswithout the write-back of local:save_lodge_stop_failure_writes_local_exact_errorandreal_lock_stop_fails_and_save_backwrites_localfail.shared_mode_table_saves_keep_raw_unknown_members,malformed_mode_stays_unchanged,save_gate_blocks_connect_until_stop_fails,server_get_waits_for_save,lodge_connect_timeout_bounds_accepting_silent_server,save_deadline_starts_after_gate_wait,null_mode_loads_and_saves_as_empty_object, the sheet's close-during-save test, the idle-close banner test, the 10 s spacing test,end kills a child that ignores SIGTERMandendGroup ends a process that the group started and nobody recordedeach fail with their fix removed.server_savewrites no lodge, and case f when the stop failure is ignored..memory/corrections.jsonl(11 lines).Cross-review
Reviewer
openai/gpt-6.1-sol; codergithub-copilot/mai-code-2-flash, with small edits by an Anthropic Claude model. Base 3e99fe3. The initial review (2 batches, 31 files; the 3 generated screenshots left out) found 6 blocking points at 2387468; re-review 1 at 565f68e found 3 more and 2 partly fixed; re-review 2 at ff43089 left 2 partly fixed; re-review 3 at 7d90ec7: Ready, Blocking: none.