refactor: simplify invite interaction and lifecycle orchestration - #49
Merged
Merged
Conversation
Combine the default terminal lifetime prompts and share per-display account observations. Separate invite option handling, expose explicit upgrade outcomes, share timer/deletion steps, and consolidate doctor guidance. Keep existing flags, backends, identity checks, recovery rules, and confirmation gates. Retire the old menu process after a visible upgrade even when durability confirmation fails. Validated with ordinary and race suites as nobody, full root race integration in an isolated container, real systemd/PTY/SSH lifecycle checks, static analysis, script checks, and amd64/arm64 static builds.
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.
Summary
Default terminal invites now ask for lifetime once: Enter selects 24 hours, a number selects custom hours, and explicit
neverselects permanence. Account displays share one observation per render, and an upgrade that visibly replaces the executable retires the old menu process even if durability confirmation fails.Separate invite option parsing and preconditions, share identical timer validation and controlled deletion steps, and consolidate repeated doctor guidance. Existing flags, piped-input behavior, backends, state formats, identity checks, confirmation gates, and recovery rules remain in place. The invite entry point is reduced from 316 to 110 lines; bilingual user documents are updated.
Testing
Real Debian 13/systemd/PTY checks covered default/custom/permanent lifetime cancellation and EOF without mutation, a 24-hour account and active timer, SSH login without sudo, SSH refusal after revoke, automatic quarantine finalization, and uninstall cleanup. The upgrade regression covers successful replacement, failure before writing, visible replacement with an injected durability error, and no-op; it verifies write execution, bytes/inode, audit, and menu exit. The durability error is injected after a real atomic write, rather than by failing an actual fsync syscall.
Safety Notes
The accepted 159-file source tree matches the final root test snapshot. Real platform validation covered Debian 13/amd64; ARM64 was cross-built, and the full distribution/reboot matrix was not repeated for this refactor.