fix(audit): clean Ctrl-C handling, all/quit prompts, exit-code semantics, survivor validation - #135
Merged
Merged
Conversation
…nswers Ctrl-C during a `--reconcile --all --apply` prompt killed the main thread while ThreadPool workers kept prompting, then Python's atexit hung joining a worker blocked in input() — requiring repeated Ctrl-C. Restructure bulk_reconcile into parallel detection (workers, no stdin) and a main-thread resolution phase that prompts and removes sequentially. Ctrl-C now acts as quit: the current prompt is declined, remaining tools are marked aborted, and the run ends cleanly with a summary. The prompt also accepts 'a' (confirm this and all remaining removals) and 'q' (decline this and all remaining): [y/N/a=all/q=quit]. Claude-Session: https://claude.ai/code/session_01MH3EaniXCnJdwqNvrMB4Ym Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
…ands `make reconcile-all` ended in `Error 1` even when the run worked exactly as designed: removals that require sudo are refused on purpose and handed to the user as copy-paste commands, so they are an expected outcome, not an error. Classify results whose failures are all of the "manual sudo needed" kind as action 'manual_required': shown with ⚠ instead of ✗, counted in a new "Manual action required" summary line, included in the aggregated command block, and excluded from the non-zero exit (both --all and single-tool apply paths). Genuine errors still exit 1. Claude-Session: https://claude.ai/code/session_01MH3EaniXCnJdwqNvrMB4Ym Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
Reconcile assumed same-named executables are interchangeable duplicates. That broke byobu: the kept ~/.local/bin/byobu was a stray copy of the package's launcher script, which sources /usr/lib/byobu/include/common — removing the apt package silently broke the survivor. After a successful removal, probe the kept installation with its version command; if it no longer runs, mark the result failed with guidance to reinstall the removed package or delete the broken survivor. Claude-Session: https://claude.ai/code/session_01MH3EaniXCnJdwqNvrMB4Ym Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
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.



Problems
Three issues from real
make reconcile-allruns after #134:input()— repeated Ctrl-C required.make reconcile-allended inError 1even when everything worked as designed — removals that need sudo are refused on purpose and handed over as copy-paste commands, yet still counted as failures for the exit code.~/.local/binand removed the apt package that owned/usr/lib/byobu— the survivor sourced those files and broke.Fixes (one commit each)
bulk_reconcilenow detects in parallel (workers, no stdin) and prompts/removes sequentially on the main thread. Ctrl-C acts as quit: current prompt declined, remaining tools marked aborted, clean summary, no traceback. Prompt is now[y/N/a=all/q=quit]with sticky all/quit semantics.manual_requiredoutcome. Failures that only need a manual sudo command classify asmanual_required: shown with ⚠, counted in a new "Manual action required" summary line, included in the aggregated command block, and excluded from the non-zero exit. Genuine errors still exit 1.Test plan
test_reconcile_aggressive_modenow patches the survivor probe).https://claude.ai/code/session_01MH3EaniXCnJdwqNvrMB4Ym