Repository navigation
Setup owns its flow and questions, tested in-process behind a seam - #412
Merged
Merged
Conversation
) A new Setup module owns Setup end to end: `setup` and the first Run's offer, the questions as a private child, and the helpers that write the answers into the User config. Everything it does outside itself goes through a private `Outside` seam, with a real adapter on the machine and a scripted one in tests. The User config module keeps parsing, loading, the defaults and completing. The Setup rules are now tested in-process, and the end-to-end Setup and Setup-offer tests they cover are deleted, keeping only those for the wiring into a Run and the command line, and the real terminal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and its offer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
Setup now has its own module. Its rules sit in front of a private
Outsideseam. The User config module keeps parsing, loading, the defaults and completing.Evidence
tests/setup.rs(56) andtests/setup_offer.rs(14) were the only way to check a Setup rule.After: 59 in-process tests in
src/setup.rsdrive Setup throughScripted. That adapter checks each prompt in order and records every line said and every write, save and send. The end-to-end suites keep only the 16 tests for wiring and the real terminal that the issue lists.cargo testpasses in full, andcargo clippy --all-targetsis clean.Two rules from deleted end-to-end tests live outside Setup, so they moved to unit tests in the module that owns them:
config.rs);resend_key.rs).Merge Danger
Door: two-way
This is a refactor with no change to prompts, lines, files or exit codes, so a revert is clean.
Blast Radius: Setup
The risk is a behaviour drift on a real terminal that the deleted end-to-end tests would have caught. The kept tests cover Ctrl-C, hidden key input, Enter throughout, and the offer's wiring into a Run.
Unaddressed findings
Standards
Outsideis wide (16 methods);read/read_hidden,say/stepand the two User config reads could merge. Skipped: the issue lists these exact methods, and it keeps hidden input as its own method on purpose.set/set_email_touse config's TOML helpers, which becamepub. Skipped: the issue says writing the answers, setting a key in place and settingemail.tomove to Setup, while completing stays in config.with_no_terminal_and_no_user_config_setup_writes_the_defaultsandon_a_terminal_pressing_enter_throughout…duplicate in-process names. Skipped: the issue's keep list names both. Each checks the real file and terminal, not only the rule.questionscalls the parent'ssuggested_address. Skipped: the lookup must stay lazy, made only when notifications are on and there is noemail.to. A child module using its parent's private helper is ordinary in Rust.Scripteduses&'static strfor scripted failures. Skipped: this is test-only and matches the other scripted adapters.Spec
progress::step, notOutside::step. Skipped: the real adapter makes the call "as the code does today" throughChoice::test_call, which a Run shares. The line is unchanged.Closes #411
🤖 Generated with Claude Code