Skip to content

A Security run on an already-fixed finding ends as a failure ("no PR found") #2097

Open

Description

@JacobStephens2

This was generated by AI during triage.

What happened

On 2026-11-12 at 01:29 EST, a tourbot Security run on finding #2147 ended "failed: no PR found" after 9m47s. The implement Session had correctly found the finding already fixed on master (by #1836 / #1722), ran the regression tests (10 passed), and closed #2147 as already fixed. With nothing to change there could be no PR, so thirdshift reported a failure and labelled the issue agent-failed. "no PR found" comes from src/pull_request.rs (as of origin/main 5e573fe).

#1174 asks how the Console and activity log should show a fixed Security finding. This issue is about the Run outcome itself.

Why needs-triage

Two fixes are possible, and the Day shift should pick one (or both):

  1. Before dispatching a Security fix for an existing finding, re-check that it still reproduces on the current Base branch, and close it as already fixed without starting a fix Session if it doesn't.
  2. Treat "the Session closed the issue as already fixed and left an empty diff" as a successful outcome (perhaps a distinct outcome such as "already fixed"), not a failure, and don't apply agent-failed.

Option 2 trusts the agent's claim that the finding is fixed; option 1 needs a reproduction step that may already exist in the Security review.

Acceptance in either case: a Security run on a finding that is already fixed on the Base branch ends without agent-failed and without counting toward the Failure limit, and the outcome says it was already fixed.

Activity

  1. added
    bug
    needs-triage
    in-progress
    and removed
    needs-triage
    on Nov 12, 2026
  2. JacobStephens2 commented on Nov 12, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    The current code at selected Base commit 5e573fe supports the reported failure mechanism. The historical tourbot Session and its regression-test results remain supplied report evidence, not independently replayed observations.

    Confirmed control flow:

    • src/github/advisories.rs:180 selects fixes using the stored reproduced outcome, without checking the current Base branch. src/processes/security.rs:63 skips audit and reproduction when a pending fix exists.
    • Initial reproduction runs at the finding's audited commit (src/security/reproduction.rs:156), rather than verifying that it still reproduces on the current Base branch. Completed reproductions are deliberately reused by src/security/findings.rs:128.
    • Security fixes bypass ordinary bug diagnosis (src/implement.rs:40). There is no dedicated already-fixed resolution in src/run.rs:63. An implementation Session that produces no PR proceeds toward Delivery; src/delivery.rs:714 calls PR readiness, which requires a PR and returns "no PR found" when absent (src/pull_request.rs:416).
    • A failed Security fix maps to Claim Ending::Failed and swaps in-progress for agent-failed, even without pushed work (src/run.rs:381; src/claim.rs:425,478). Closing the issue during the Session is not a successful completion protocol.
    • The existing current-Base proof-of-concept check is available only after this run's fix merged (src/processes/security.rs:114; src/security.rs:314). It cannot resolve this no-PR case.

    Failure-limit nuance: src/pickup.rs:351,403 sweeps closed issues and counts only open agent-failed issues. A finding already closed by its Session should therefore not count on the next successful Sweep. The incorrect Run failure and stale failure label remain valid problems.

    Decision and next steps

    Recommend an explicit, verified already-fixed outcome that bypasses Delivery and leaves no agent-failed label. An optional pre-dispatch check can avoid unnecessary fix Sessions, but alone cannot handle a finding fixed while a Session is running. Do not equate an empty diff or closed issue alone with proof that a vulnerability is fixed.

    ADR 0015 currently permits automatic finding closure only following a merged fix and a passing proof-of-concept check. Closing an already-fixed finding without this run merging a PR extends that policy and needs an explicit decision. Coordinate closure behavior with #1727. #1174 concerns display distinctions and does not cover this Run-outcome defect.

    After the decision, cover public advisories and private finding issues, successful verified no-PR completion, a Base branch advancing during implementation, verification failures/refusals, and closing disabled. Ensure the result, notification, Claim ending and Failure-limit behavior agree.

    Questionnaire

    For the Day shift deciding #2097:

    The repository confirms that stored reproductions can become stale and that a Security fix without a PR has no already-fixed completion path. Automatic closure without this run merging a fix also extends ADR 0015.

    1. Should an already-fixed success require a separate proof-of-concept check against the untouched current Base branch, or may the implementation Session's evidence suffice? I recommend the separate check; this defines the completion contract and prevents closed-issue or empty-diff false successes.
    2. May that verified outcome close the private finding without a PR from this run, and should it follow security-close/no-security-close or the setting proposed in make setting that allows closing security issue or private advisory if not reproduced #1727? This settles the ADR change and record lifecycle.
    3. Should this become a Spec with two Tickets: (A) verified already-fixed completion after implementation, including Delivery bypass, Claim ending and outcome reporting; (B) pre-dispatch verification on the current Base branch using the same evidence contract? I recommend A first, then optional B. This handles the reported failure and the race before adding the optimization; coordinate broader Console presentation with Security run fix: should the Console and Activity log tell the fixed Security finding apart? #1174.
  3. added
    ready-for-human
    and removed
    in-progress
    on Nov 12, 2026
  4. JacobStephens2 commented on Nov 24, 2026

    @JacobStephens2
    OwnerAuthor

    Second occurrence, 2026-11-24 08:34 EST, on stephens.page (thirdshift 0.42.0, grok-4.7 xhigh). A weekly Security run re-recorded a finding whose fix had merged 5 days earlier, dispatched a security-fix Ticket for it, and the implement Session correctly found the fix already on the Base branch, re-ran the regression tests and closed the Ticket as a duplicate of the original. The run still ended "failed: the implement session made no commits and opened no pull request" (Stopped at: Pull request readiness) after 33m 50s and about $5 of sessions. The reproduction step had reproduced it against commits from before the fix, so option 1 here (re-check against the current Base branch head before dispatching) would have stopped it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions