Plan P15 unit A5. Nothing but `wanderbooks serve` starts a host, so the tests
that had a bridge or a command start one now have `serve` hold the books (a
`serve` the harness keeps: Home::keep_host), or run a server of their own
(the commands), or are retired. Every test of the three files plan section 6
names, and what became of it:
open_while_held.rs (44 tests)
KEPT, still true for serve (28): closing_the_books_ends_every_lease_and_the_bridge_stays_closed,
closing_during_a_burst_of_posts_through_the_bridge_loses_nothing,
a_killed_host_is_replaced_by_its_holders,
holders_back_off_and_give_up_on_a_host_that_keeps_failing,
the_lease_socket_takes_only_the_owners_intents, a_restart_is_not_a_close,
another_apps_appimage_is_never_run_as_the_host,
the_host_outlives_the_app_scope_that_started_it,
the_bridge_serves_a_client_without_initialize,
the_bridge_recovers_when_the_server_dies_under_it,
a_message_too_large_is_refused_and_the_session_goes_on,
malformed_and_boundary_input_never_ends_the_session,
the_host_starts_without_a_scope_when_systemd_run_fails,
a_scrubbed_app_scope_doesnt_take_the_host_with_it,
doctor_doesnt_hang_on_a_frozen_host, doctor_doesnt_hang_on_a_frozen_server,
serve_hears_ctrl_c_while_it_waits_to_try_again,
every_malformed_message_is_answered, books_that_didnt_open_refuse_plainly,
close_and_list_dont_hang_on_frozen_processes,
the_books_command_takes_its_flags_and_asks_before_adopting,
adopted_books_old_copies_are_put_aside_from_the_command_line,
the_token_commands_and_the_bridge (the bridges there are held by serve
through Agent::start), an_agent_sends_and_saves_files_with_the_commands_it_is_given,
a_backup_is_restored_from_the_command_line,
books_are_backed_up_now_from_the_command_line,
connect_makes_anew_a_token_whose_file_is_gone_and_says_when_an_agent_refuses,
token_check_says_where_the_token_file_stands_and_an_unreadable_one_is_said
(these commands now run a server of their own with nothing running).
MOVED, rewritten for the new shape (15):
a_command_opens_the_books_and_they_close_after_the_last_holder ->
a_command_leaves_nothing_running_and_serve_closes_after_its_last_holder;
openers_share_one_host_and_one_server ->
serve_and_the_bridges_share_one_host_and_one_server (two serves at once
are the race now);
the_bridge_opens_closed_books_and_holds_them_for_the_session ->
the_bridge_reaches_the_books_serve_holds_and_holds_them_for_the_session;
the_host_starts_clean_from_a_hostile_bridge ->
the_host_serve_starts_is_clean_from_a_hostile_serve;
the_bridge_answers_initialize_itself_during_a_slow_start,
the_bridge_gives_up_on_books_that_never_open, a_call_cancelled_at_once_is_never_made,
a_signalled_bridge_goes_at_once, books_made_mid_session_and_bad_requests
(a slow `serve` holds the host; the bridge starts after it holds the root);
books_commands_hold_the_books_while_they_run (serve holds, the commands lease);
a_command_ends_at_its_deadline_during_a_restart (`token list`: `books list`
with nothing running reads the folder and waits for nothing);
a_bridge_started_without_stderr_keeps_its_descriptors_apart,
the_commands_given_run_as_the_agents_own_token,
an_agent_is_connected_and_reaches_the_books_by_what_it_was_given
(Home::keep_host);
doctor_says_whether_the_books_are_open_and_what_holds_them (new closed words).
RETIRED (1): the_viewers_hold_new_books_and_close_the_books. Its viewer
lease (hold_for_viewer) and "Close the books" (close_books) no longer
exist: the app is the host. Covered by ledger-gui serving.rs
(a_tab_opening_asks_the_server_to_open_that_company, a_tab_closing_asks_the_server_to_close_that_company,
closing_the_window_stops_the_server_and_waits_for_it), owner_menu.rs (no
"Close the books" item), and the replacement
the_viewers_new_books_are_made_by_the_server (new_books through a server).
Behaviours retired inside the moved tests, and what covers them: a command
or a bridge starting a host and holding it for the close delay does not
exist (app_server.rs: a_command_with_the_app_running_goes_to_its_server_and_leaves_it_running,
with_nothing_running_a_command_runs_its_own_server_or_says_to_start_wanderbooks,
the_bridge_says_the_app_isnt_running_then_works_once_it_is,
a_command_leaves_nothing_running_and_serve_closes_after_its_last_holder);
the close delay itself is kept for serve's host (same test).
update.rs (16 tests)
KEPT (6): an_update_replaces_the_program_keeps_the_old_one_and_rollback_brings_it_back,
update_is_atomic, failed_update_rolls_back, unsigned_update_refused,
package_managed_install_refuses_update, rollback_refuses_after_a_book_consented_to_a_newer_format,
an_update_never_replaces_another_apps_appimage (the `update` command and
the AppImage guard: no host involved).
MOVED (9): bridge_survives_update, update_waits_for_a_running_call,
a_replaced_appimage_restarts_the_books, the_host_stages_a_daily_update_and_the_next_start_applies_it,
a_daily_update_that_is_not_ours_is_not_staged,
update_installs_the_copy_the_host_staged_without_downloading_again,
a_staged_update_that_was_tampered_with_is_dropped_not_applied,
books_start_says_an_update_waits, the_owner_accepts_a_staged_update_in_the_app:
the host they describe is serve's (restart onto a replaced file,
update.lock, the daily look, the staged copy applied before a host
starts), so the harness's Agent::start has a `serve` hold the books
(Home::keep_host); the bridge's tool calls carry the request_key every
write needs since D-88. RETIRED (0).
translocation.rs (1 test)
KEPT: translocated_app_refuses_to_connect. The refusal stays: an agent's
pointer file records this program's path, which a quarantined download
loses when the app closes, whatever starts the books.
app_server.rs: no test retired. Changed: the_bridge_says_the_app_isnt_running_then_works_once_it_is
(no marker; the words now name `wanderbooks serve`), a refusal touches
nothing (the retired marker). New: a_mark_an_earlier_build_left_is_ignored_and_removed,
a_terminal_ctrl_c_reaches_the_window_and_never_the_server (fails without the
server's own process group: checked by removing it),
a_command_with_the_app_running_goes_to_its_server_and_leaves_it_running,
with_nothing_running_a_command_runs_its_own_server_or_says_to_start_wanderbooks,
a_command_waits_in_words_for_a_server_that_is_still_opening.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Plan P15 3.1: the desktop app is the host. The bridge and every command that
needs the books now find what runs (a host held by serve, the app's server,
or nothing) and never start a host. The permanent run/app-hosted marker is
gone: a root is the app's only while a server runs on it with no host.
- opener: no host and no server is HoldError::NotRunning for every holder
but serve; a server holding run/server.lock with no admin socket yet is
waited for, in words (an opening or finishing server); the admin socket
answering is the leaseless hold on the app's server, marker or none.
- commands: with nothing running, a command that manages the books' files
or reads (list, create, adopt, restore, back-up, upgrade, token, connect)
runs a server of its own, the one the app starts, for the length of the
work and closes it, taking the same server.lock and books.lock; a command
that needs an open company held by Wanderbooks (books open/close, upload,
download) says "Start Wanderbooks first". The format upgrade goes to the
server as an admin request when no host is there. doctor and close say
what runs. hold_for_viewer and close_books are removed.
- bridge: the line to the app is the default with no host; a bridge whose
host went away becomes it. The words an assistant gets name both ways to
start the books (the app, or wanderbooks serve).
- app server: the child is its own process group on Unix (a terminal Ctrl+C
reaches the window alone) and breaks away from a launcher's job on
Windows (a kill-on-close job no longer kills it mid-backup); a stale
marker from an earlier build is removed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Make the key asks the server first and never replaces: a live key whose copy
is missing here may be in use, so it is said in words and left alone. A
page-made key carries read, write and post, not admin (the connect command
keeps its scopes). Revoke names the key's id, so a stale row cannot end a
newer key of the same name; a revoke that leaves the token file says the key
is dead and where the file is. The copyable command is single-quoted for a
POSIX shell and PowerShell, and refused when cmd.exe would act on a part.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A bridge session opened with a key is on the roster; revoking the key
takes the key and its session off, refuses the session's next call and
deletes the token file's copy.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
AppHost holds what the window does with its books server, so what the tests
drive is what the window runs. A server that is alive but not ready is waited
for; a failed start, or a window closed before the child was stored, closes
the child's input and waits for it, so no server runs that nothing manages.
The close first closes each open company, so a closing backup that was not
whole, and a server that exited badly, come back as words. The format
upgrade goes to the server as an admin request (there is no host to ask),
and the companies the window wanted that the server did not open are told.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The server child starts, closes on input close and on the window's death (a
killed stand-in window leaves no server and a whole book), a stop that runs out
of time leaves it closing and says so, a start is refused while a server or host
holds the books; a tab opened or closed opens or closes that company, in order,
with failures said in words; closing the window waits in view and asks the owner
once; the bridge answers 'Wanderbooks isn't running' and 'Company X isn't open'
in one running session, starting no host. Claims for WB-app-1 to WB-app-4 name
them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>