← Back to Pull requests

fix(queue): a dead seat's sweep finding names the rule that chose its recovery seat #2033

Closed
unknown closed this pull request without merging on Oct 25, 2026 16:38 UTC
View on GitHub
unknown unknown commented on Oct 25, 2026 15:47 UTC
Author

What a person gets

When a seat's session is confirmed missing, the stuck sweep sends its finding to a live recovery seat. The finding's "why" now says which rule chose that seat, so whoever receives it knows why it landed on them, and which setting to change if it shouldn't have:

  • "… so this finding goes to operator-admin@kernel, the operator agent (agents.operator_session)"

  • "… goes to approver@r, the operator seat (workspace.operator_seat_name)"

  • "… goes to sender@r, the row's creator"
  • Before, it named only the destination. The sentence for "no live recovery seat is available" is unchanged.

    The change

  • packages/daemon/src/domain/queue-stuck-sweep.ts:

  • - the recovery seat is picked by index over the same candidates, in the same order, with the same rules;
    - a constant names each rule;
    - the reroute sentence appends the name.
  • Routing doesn't change.
  • Proof

  • Tests: queue-stuck-sweep.test.ts pins the rule name for each of the three outcomes. The operator-seat case only checked the destination before.

  • Fail-before: against main's source, exactly those three fail and the other 116 pass.

  • At this head:

  • - queue-stuck-sweep, queue-stuck-sweep-human-custody and queue-wake-ladder pass 184 of 184 (two workers);
    - the daemon's tsc --noEmit exits 0.

    🤖 Generated with Claude Code

    Diff: 172 lines (+129 / -43) across 2 files Reviewer: openrig-review Review duration: 51m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). 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.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.308
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2033"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.9% · Safe to merge
    15.9%