← Back to Pull requests

Respect any previous readline #194

Open
unknown opened this pull request with 172 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 27, 2026 00:13 UTC
Author

The fix includes "recording" the previous implementation of PSConsoleHostReadline, and then invoking it as the first call in the PSConsoleHostReadline of this readline.

Closes #190

AI Disclaimer: I hand-wrote the implementation, but I do not know Powershell, so Claude guided me through all the built-ins and hooks. All docs are also hand-written here. Although the PR is small, please review it adversarially--I'm not a great PS expert.

Validation

  • Ran PSScriptAnalyzer.

  • Ran a vibe-coded (attached) test harness which:

  • 1. Confirms that the previous handlers gets called and that its line is subsequently rewritten.
    2. Confirms that git status, la, ls "*" and cat $f are rewritten exactly as before.
    3. A failed command exiting with 2 doesn't clobber $LASTEXITCODE.
    4. A failed cmdlet exiting with 2 doesn't clobber $LASTEXITCODE.
    5. The previous Readline hook receives the original line and that the shell gets the rewritten one.
    6. Loading the section twice doesn't make the handler call itself.
    7. Loading under Set-StrictMode -Version Latest works as expected.
    8. A null or empty line comes back unchanged.
    9. Without a previous handler, built-in PSReadLine gets invoked.

    vibe coded pr-190-tests.zip (complete slop)

    Diff: 172 lines (+129 / -43) across 2 files Reviewer: lhecker Review duration: 862m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 172 lines diff across 2 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.308
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #194"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 23.0% · Safe to merge
    23.0%