One mail app at a time: a second copy says tuimail is already open (FP-17) #60

Merged
merge-queue merged 1 commit from fp17-one-copy into main 2026-11-28 01:58:04 -08:00
Owner

Work package: https://openproject.home.romaine.life/wp/FP-17

Every interactive home app is one copy (FP-17). The at menu brings the mail window back; this makes a tuimail opened any other way (typed in a shell, a script, a Claude session) refuse to start.

Takes the lock: only the mail app's interactive run, plain tuimail with no arguments. It claims one-copy's tuimail lock in main::run right after the arguments are read and before anything else (config, settings, accounts, keychain, log, cache, password commands, the terminal), so a refused copy prints tuimail is already open, exits 1 and touches nothing. One-copy waits up to 5 s for a copy that is ending, which covers TESTING.md's respawn-pane -k update.

Doesn't take it: tuimail mcp (one per Claude session), tuimail session, --check, --demo, --help, --version.

Adds: the one-copy v0.1.0 dependency and the claim; docs: CLAUDE.md (Running), README (Get started, Development), TESTING.md (the update's restart), with ONE_COPY_SCOPE for a test run against a separate data folder.

Leaves alone: the agent listener's "another tuimail is answering agents" check (agent.rs). It stays as it was: the lock is taken before the listener starts, so the check now fires only when two apps share a data folder under different ONE_COPY_SCOPEs, and --demo keeps its own socket (demo-agent.sock).

Proof (debug build, lock held by a separate process, ONE_COPY_SCOPE=fp17test, scratch TM_DATA_DIR): the interactive run printed tuimail is already open and exited 1 after 5.09 s with the data folder still empty; --check, --version and mcp ran while it was held. With the holder gone, tuimail started on a throwaway tmux server (Add an account screen), and a second copy beside it was refused the same way.

Work package: https://openproject.home.romaine.life/wp/FP-17 Every interactive home app is one copy (FP-17). The at menu brings the `mail` window back; this makes a tuimail opened any other way (typed in a shell, a script, a Claude session) refuse to start. **Takes the lock:** only the mail app's interactive run, plain `tuimail` with no arguments. It claims one-copy's `tuimail` lock in `main::run` right after the arguments are read and before anything else (config, settings, accounts, keychain, log, cache, password commands, the terminal), so a refused copy prints `tuimail is already open`, exits 1 and touches nothing. One-copy waits up to 5 s for a copy that is ending, which covers TESTING.md's `respawn-pane -k` update. **Doesn't take it:** `tuimail mcp` (one per Claude session), `tuimail session`, `--check`, `--demo`, `--help`, `--version`. **Adds:** the `one-copy` v0.1.0 dependency and the claim; docs: CLAUDE.md (Running), README (Get started, Development), TESTING.md (the update's restart), with `ONE_COPY_SCOPE` for a test run against a separate data folder. **Leaves alone:** the agent listener's "another tuimail is answering agents" check (`agent.rs`). It stays as it was: the lock is taken before the listener starts, so the check now fires only when two apps share a data folder under different `ONE_COPY_SCOPE`s, and `--demo` keeps its own socket (`demo-agent.sock`). Proof (debug build, lock held by a separate process, `ONE_COPY_SCOPE=fp17test`, scratch `TM_DATA_DIR`): the interactive run printed `tuimail is already open` and exited 1 after 5.09 s with the data folder still empty; `--check`, `--version` and `mcp` ran while it was held. With the holder gone, tuimail started on a throwaway tmux server (Add an account screen), and a second copy beside it was refused the same way.
One mail app at a time: a second copy says tuimail is already open (FP-17)
All checks were successful
Suite release / home-sync (pull_request) Has been skipped
Suite release / build (rust, aarch64-unknown-linux-gnu) (, rust-aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu, false, ubuntu-latest, aarch64-unknown-linux-gnu, rust) (pull_request) Has been skipped
Suite release / build (rust, x86_64-unknown-linux-gnu) (, rust-x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu, false, ubuntu-latest, x86_64-unknown-linux-gnu, rust) (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / dispatch (pull_request) Has been skipped
Suite rust / check-test-linux (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 34s
Suite rust / check-machete (pull_request) Has been skipped
Suite release / build (rust, aarch64-pc-windows-msvc) (, rust-aarch64-pc-windows-msvc, aarch64-pc-windows-msvc, false, windows-latest, aarch64-pc-windows-msvc, rust) (pull_request) Has been skipped
Suite release / build (rust, x86_64-pc-windows-msvc) (, rust-x86_64-pc-windows-msvc, x86_64-pc-windows-msvc, false, windows-latest, x86_64-pc-windows-msvc, rust) (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite rust / check-format (pull_request) Successful in 34s
Suite default / check-fetches (pull_request) Successful in 30s
Suite rust / check-typos (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite cluster-service / reused-checks (pull_request) Successful in 33s
Suite default / reused-checks (pull_request) Successful in 27s
Suite rust / check-audit (pull_request) Successful in 32s
Suite release / check-build (rust, x86_64-pc-windows-msvc) (, rust-x86_64-pc-windows-msvc, x86_64-pc-windows-msvc, false, windows-latest, x86_64-pc-windows-msvc, rust) (pull_request) Successful in 9m14s
Suite rust / check-services (pull_request) Successful in 6m9s
Suite release / check-build (rust, aarch64-unknown-linux-gnu) (, rust-aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu, false, ubuntu-latest, aarch64-unknown-linux-gnu, rust) (pull_request) Successful in 6m48s
Suite rust / check-test-windows (pull_request) Successful in 5m43s
Suite release / check-build (rust, x86_64-unknown-linux-gnu) (, rust-x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu, false, ubuntu-latest, x86_64-unknown-linux-gnu, rust) (pull_request) Successful in 11m55s
Suite release / check-build (rust, aarch64-pc-windows-msvc) (, rust-aarch64-pc-windows-msvc, aarch64-pc-windows-msvc, false, windows-latest, aarch64-pc-windows-msvc, rust) (pull_request) Successful in 5m35s
Suite rust / reused-checks (pull_request) Successful in 34s
Suite release / check-package (pull_request) Successful in 29m22s
Suite release / reused-checks (pull_request) Successful in 41s
merge-queue landed on main
cbf9aa9f12
merge-queue deleted branch fp17-one-copy 2026-11-28 01:58:06 -08:00
Sign in to join this conversation.
No description provided.