← Back to Pull requests

Refractor /host/guest-agent.py script #65

Open
unknown opened this pull request with 247 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 30, 2026 10:39 UTC
Author

Addressing PR #5 review feedback

  • Replaced mutable module-level state with per-instance target resolution and caching. Consolidated shared execution, status and output handling, and applied the team’s naming, quoting, docstring and annotation conventions while retaining Python 3.9 compatibility.

  • Removed get and exec-nowait after checking direct and wrapped calls on the target branch. No tracked executable callers were found; external or manual use is not covered by the audit. The host README still mentions get and is outside this diff.

  • Kept the existing exec-crash command and the psfile system temp path. Added a mocked regression test distinguishing launch failure from a disconnect after launch. No-argument execution already printed help; this change updates that help and the callable docstrings. Incomplete put arguments now print usage and exit 2.

  • Updated the affected Python tests and added Bats coverage in the same commit, so the refactor does not depend on a separate test PR landing first. The commit uses the repository template with a linked reference.
  • Related To


  • PR #5: refactor(bsod-detector): simplify and scope guest-agent.py to pipeline use cases
  • Description


    One commit changes guest-agent.py, test_reliability.py, and test-rhov-reliability.bats. The test runner is unchanged.

    Validation


  • 29 focused Python tests and 9 focused Bats tests passed with Python 3.9 and 3.14. Python lint, type checking, compilation, and whitespace checks passed.

  • The broader runner hit the same recovery test failures and errors as the base and stopped before Bats on both. Running Bats separately showed the same seven baseline failures.

  • Validation used mocks only. Live VM, CI, and CodeRabbit validation were not run.
  • ---
    AI-generated. Review for accuracy.

    @hijoshi-re requested from Slack

    Chai persona: OpenShift Virtualization AI Helpdesk

    Diff: 247 lines (+185 / -62) across 3 files Reviewer: amp-rh Review duration: 703m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 247 lines diff across 3 files
    0.39
    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%
    46%
    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.330
    Real PR Conversation Timeline
    1 comments
    "Review active on #65"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.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: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    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: 46.7% · Lower = rushed or shallow review
    46.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: 20.7% · Safe to merge
    20.7%