← Back to Pull requests

fix(backlog): a reopened node stops binding its dead PR #3915

Open
unknown opened this pull request with 263 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 25, 2026 13:19 UTC
Author

Summary

Reopening a node left its completed PR stamped as the primary, so the store kept deriving in_review over the rung status reopen had just written, the patch door held every later status move, and the stop gate's PR selector pinned a dead PR forever. Two fixes, one root cause: reopen now demotes the completed PR into additional_prs with its recorded outcome, and the selector age-gates its unstamped-row lift so an older unstamped row is history, never live work.

Changes

  • crates/fno-agents/src/backlog/workflows.rs: clear_completion_fields moves the completed primary PR into additional_prs (preserving number, url, and the recorded merge_status) and clears the top-level scalars; idempotent across a reopen of a reopen, and a null additional_prs normalizes to an array.

  • crates/fno-agents/src/loopcheck/pr_read.rs: manifest_node_pr_selector computes the newest stamped-terminal number and lifts an unstamped row above the stamped rows only when its number is greater than every stamp; attached rows that predate the newest stamp sort as history, so a merged current pr_number pins the gate again.

  • Tests: a selector fixture for the reopened shape, two unit tests for the demotion (including the duplicate guard), and a door-level reopen test asserting the demotion and the idea status after it.
  • Test Plan

  • CI runs the Rust unit suite and the Python door suite; the existing selector tests (newer unstamped rows still lift) keep their asserted answers.

  • The added tests each guard one distinct contract; the local test freeze (2026-10-25) defers execution to CI.
  • Test delta

    | Language | Added | Removed | Net |
    |---|---:|---:|---:|
    | Python | 1 | 0 | 1 |
    | Rust | 2 | 0 | 2 |
    | Shell | 0 | 0 | 0 |
    | Total | 3 | 0 | +3 |

    Audited owners: crates/fno-agents/src/backlog/workflows.rs (no cut: the two added tests guard distinct contracts, demotion with its recorded stamp and null-array normalization, and the neighboring reopen tests keep their own contracts)

    Review

    Reviewed at 024cac8a9f: 1 rounds, 0 findings disposed.

    Fixes x-4ba0

    Diff: 263 lines (+197 / -66) across 3 files Reviewer: chatgpt-codex-connector[bot] Review duration: 3m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.39) × (1 − Review Confidence (0.31)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 263 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: 55% · Reviewer familiarity: 35%
    31%
    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.334
    Real PR Conversation Timeline
    1 comments
    "Review active on #3915"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 31% 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: 39.3% (MEDIUM) · Higher = larger blast radius
    39.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: 31% · Lower = rushed or shallow review
    31%
    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: 27.1% · Safe to merge
    27.1%
    Repository