Repository navigation
Add error type, process runner and output helpers (P1-02) - #5
Merged
Merged
Conversation
verone-core gains an error type that carries a message, an optional hint and a kind that maps to the command's exit code, and a process module that runs external programs with an argument list, a time limit and captured or pass-through output. verone-cli gains the global --json and --verbose options, helpers that print results as text or JSON, and error printing that sets the exit code from the error kind. The printing helpers live in verone-cli rather than verone-core, so the plan text for P1-02 is corrected to match. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What changed
Task P1-02 from
docs/phases/phase-1.md.crates/verone-core/src/error.rs: error type with a message, an optional "what to do" hint, and a kind that maps to the command's exit code (1 failed, 2 usage, 3 host check, 4 not found, 5 busy).crates/verone-core/src/process.rs: runs external programs with an argument list (never a shell string), a time limit, and captured or pass-through output. Logs each command to standard error when verbose.crates/verone-cli/src/output.rs: prints results as text or JSON, and errors aserror: …thenhint: ….crates/verone-cli/src/main.rs: global--jsonand-v/--verboseoptions; errors set the exit code.docs/phases/phase-1.md: P1-02 text corrected (see below).CHANGELOG.mdupdated.Why
Every later task runs the container runtime, adb or scrcpy through the process runner and reports failures through this error type, so both need to exist and be tested first.
Acceptance test ("Done when")
Run on the reference laptop (Arch Linux, Rust 1.99.1):
The process runner tests cover the cases the plan lists (time limit, non-zero exit, program not found, output capture) and four more: large output, a program ended by a signal, a background child holding the output open, and arguments with shell characters passed literally.
Notes for the reviewer
verone-core. They are inverone-cli, because the desktop app and server will reuse the core and should not inherit terminal printing. The plan text is updated in this pull request.thiserror,serde,serde_json.emitand twoContextfields carryexpect(dead_code)with the task that will first use them, so the attribute must be removed when that task lands.🤖 Generated with Claude Code