Fix review issues: I/O error handling, console color safety, requirements traceability#45
Merged
Malcolmnixon merged 1 commit intomainfrom Apr 4, 2026
Merged
Conversation
… Context.cs, missing test refs in cli.yaml Agent-Logs-Url: https://github.com/demaconsulting/ReviewMark/sessions/ac56b6a1-fc95-41b9-8f21-2a884f7253a0 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Malcolmnixon
April 4, 2026 00:37
View session
Malcolmnixon
approved these changes
Apr 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves ReviewMark’s CLI robustness and requirements traceability by hardening error handling for output file writes, making stderr color changes safer, and updating ReqStream links to existing tests.
Changes:
- Wrap
File.WriteAllText()for--planand--reportoutputs to convert expected I/O failures into user-facing errors (exit code 1 instead of crash). - Ensure
Console.ForegroundColoris restored viatry/finallyinContext.WriteError. - Add missing test references for
--plan-depth/--report-depthconstraints in ReqStream CLI requirements.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/DemaConsulting.ReviewMark/Program.cs | Converts certain plan/report file write exceptions into InvalidOperationException for graceful CLI failure. |
| src/DemaConsulting.ReviewMark/Cli/Context.cs | Uses try/finally to restore console color after writing errors. |
| docs/reqstream/review-mark/cli/cli.yaml | Adds missing links from CLI requirements to existing tests for depth flag validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 6, 2026
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
Formal code reviews were performed on all 14 review-sets defined in
.reviewmark.yaml. Three issues were found and fixed.Changes
src/DemaConsulting.ReviewMark/Program.cs(Critical)File.WriteAllText()calls (for--planand--reportoutput files) intry-catchblocks that convertIOException,UnauthorizedAccessException, andDirectoryNotFoundExceptionintoInvalidOperationException. Previously these propagated as unhandled exceptions causing a crash (exit code 134) instead of a graceful error (exit code 1).src/DemaConsulting.ReviewMark/Cli/Context.cs(Medium)WriteErrorto use atry-finallyblock when setting/restoringConsole.ForegroundColor, ensuring the console color is always restored even ifConsole.Error.WriteLinethrows an exception.docs/reqstream/review-mark/cli/cli.yaml(Medium)ReviewMark-Cmd-PlanDepth:Context_Create_PlanDepthFlag_WithValueGreaterThanFive_ThrowsArgumentExceptionReviewMark-Cmd-ReportDepth:Context_Create_ReportDepthFlag_WithValueGreaterThanFive_ThrowsArgumentException,Context_Create_ReportDepthFlag_MissingValue_ThrowsArgumentException,Context_Create_ReportDepthFlag_NonNumeric_ThrowsArgumentException,Context_Create_ReportDepthFlag_Zero_ThrowsArgumentException