← Back to Pull requests

fix(workqueue): settle items after execution cancellation #659

Open
OUAO-FRANK opened this pull request with 78 lines diff across 2 files
View on GitHub
OUAO-FRANK OUAO-FRANK commented on Dec 01, 2026 17:35 UTC
Author

Problem


A pull-queue deployment can use BeforeExecutionCallback to give each execution a deadline or cancellation scope. When this context expires, the queue's default Complete/Return inherits the expired context, so a backend using context-aware I/O cannot settle the item. The reference SQL work queue uses ExecContext for this write and can later reclaim an unsettled row.

Change


Give default settlement its own bounded context, retaining callback context values. The execution and custom after-execution callback keep their existing context.

Verification


  • TestPullQueue_ExecutionCancellationDoesNotPreventSettlement failed for all three outcomes on the original implementation, across three runs.

  • go test -mod=readonly -race ./a2asrv/workqueue -count=10

  • go test -mod=readonly -race ./a2asrv/... -count=1

  • go vet and go build for ./a2asrv/workqueue

  • golangci-lint for ./a2asrv/workqueue and git diff --check.
  • Prepared with OpenAI Codex.

    Diff: 78 lines (+75 / -3) across 2 files Reviewer: yarolegovich Review duration: 4767m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.36) × (1 − Review Confidence (0.48)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 78 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.00 · 1 substantive comment(s)
    0.00
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    48%
    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.350
    Diff Size diff_size
    0.261
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    2 items
    yarolegovich yarolegovich approved these changes on Dec 02, 2026 13:55 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    OUAO-FRANK OUAO-FRANK
    Labels
    risk: low confidence: 48.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: 35.6% (MEDIUM) · Higher = larger blast radius
    35.6%
    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: 48.5% · Lower = rushed or shallow review
    48.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: 18.3% · Safe to merge
    18.3%