← Back to Pull requests

add support for cli commands and error checking for invalid directories #2

Merged
mwimpelberg28 merged 1 files (25 lines) on Jan 08, 2023 04:47 UTC
View on GitHub
mwimpelberg28 mwimpelberg28 commented on Jan 07, 2023 20:28 UTC
Author

No description provided by author.

Diff: 25 lines (+22 / -3) across 1 files Reviewer: dblinkhorn Review duration: 499m
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.22) × (1 − Review Confidence (0.71)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.22 · 25 lines diff across 1 files
0.22
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.48 · 2 substantive comment(s)
0.48
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
70%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.195
Real PR Conversation Timeline
5 items
dblinkhorn dblinkhorn commented on code on Jan 07, 2023 23:37 UTC
Code Review
file_renamer.py:1
@@ -4,12 +4,30 @@
 import sys
 import json
 from datetime import datetime
+import argparse
 
-target_path = ''
+# Define the parser
+parser = argparse.ArgumentParser(description='parse arguments from cli')
 
-# substring/regex replacements rules will be built here
-replacements = {}
+parser.add_argument('--target-path', action="store", dest='target_path', default="null")
+parser.add_argument('--name', action="store", dest='name', default="null")
+parser.add_argument('--replacement', action="store", dest='replacement', default="null")
+args = parser.parse_args()
+target_path = args.target_path
+name = args.name

can you rename this variable to "string" so it's clear to a user that it doesn't have to be the entire filename, but can just be a part of a filename they want to be replaced

dblinkhorn dblinkhorn requested changes on Jan 07, 2023 23:39 UTC
Changes Requested Reviewer

Should be able to fix the UI/CLI current incompatibility by wrapping all the the new parser code inside an if __name__ == '__main__': block.

mwimpelberg28 mwimpelberg28 commented on code on Jan 08, 2023 01:11 UTC
Code Review
file_renamer.py:1
@@ -4,12 +4,30 @@
 import sys
 import json
 from datetime import datetime
+import argparse
 
-target_path = ''
+# Define the parser
+parser = argparse.ArgumentParser(description='parse arguments from cli')
 
-# substring/regex replacements rules will be built here
-replacements = {}
+parser.add_argument('--target-path', action="store", dest='target_path', default="null")
+parser.add_argument('--name', action="store", dest='name', default="null")
+parser.add_argument('--replacement', action="store", dest='replacement', default="null")
+args = parser.parse_args()
+target_path = args.target_path
+name = args.name

I suppose I could do this for you good sir

dblinkhorn dblinkhorn approved these changes on Jan 08, 2023 04:47 UTC
Approved Reviewer

Merging. Will push another commit fixing the incompatibility between CLI and UI code.

Reviewers
Assignees
mwimpelberg28 mwimpelberg28
Labels
risk: low confidence: 70.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 22.5% (LOW) · Higher = larger blast radius
22.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 70.7% · Lower = rushed or shallow review
70.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 6.6% · Safe to merge
6.6%