Skip to content

Security run closes a Security finding its fix merged, noting the pull request, when allowed #1073

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Why

On lower-stakes repositories, the Day shift's triage of a fixed Security finding is mechanical. They open the fix's merged pull request, confirm it fixes the advisory, paste the PR link onto the draft advisory and close it with a comment. This should be possible to hand to thirdshift, opt-in, per command line or per machine.

Related: #1072 (the notification should say which finding a fix's pull request addresses).

Decisions so far (Day shift, 2026-10-22)

  • Trigger: only when this Security run's own fix (a Run or Spec run) ended merged. A fix left ready for review stays a draft for the Day shift. Closing findings whose PR a human merged later is not part of this.
  • Gate: before closing, re-run the reproduction's proof-of-concept test (kept in the private record) against the merged Base branch, in the same sandbox reproduction uses. It failed before the fix. Close only if it now passes. On any other result (still fails, cannot run, sandbox unavailable, refusal), leave the record as it is for the Day shift and say why.
  • Private repositories too: a security-finding issue gets a comment naming the PR and is closed.
  • Names: command words security-close and no-security-close, accepted wherever security-fix is, and close = true under [security] in the User config. Off by default. They only take effect when fixing is also allowed. no-security-close overrides the setting.

Agent Brief

Category: enhancement
Summary: With closing allowed, a Security run whose fix merged re-checks the proof-of-concept and closes the finding's private record, naming the pull request.

Current behavior:
A fix's ending is written into the private record's description as a Fix Run: succeeded / Fix Run: failed line under its fix Ticket link. The record is never closed: the guide says a Security run "never publishes or closes an advisory". ADR 0015 lists closing the draft advisory among the Day shift's triage decisions, the one that "settles whether it was real".

Desired behavior:

  • With closing allowed (by the command word or the setting) and fixing allowed, after the dispatched fix ends merged:
    1. Re-run the private record's proof-of-concept test against the merged Base branch in the reproduction sandbox.
    2. If it passes, append a line naming the merged pull request (for a Spec run, the Spec PR) to the private record, then close it. GitHub has no REST endpoint for advisory comments, so for an advisory this goes into the private description and the state is set to closed. For a security-finding issue, post a comment naming the PR, then close the issue.
    3. If it doesn't pass, or any step fails, leave the record open with a private note of what happened. The Security run's outcome stays the fix's outcome, and the Day shift is told (stderr and Run notification). A failed close must never turn a merged fix into a failed run.
  • The Run notification says when a finding was closed, and by which PR. It still includes no write-up.
  • Never publish an advisory. A closed advisory carries nothing new in public.
  • The private-record write keeps the existing guard against concurrent edits: the record must not have changed since it was read.

Key interfaces:

  • User config: [security] close (bool, default false), written out by Setup like the other [security] settings, which offers it only when fixing is on.
  • Shared Pass words: security-close / no-security-close, with or without dashes, passed through as security-fix is.
  • The private-record operations, which today cover linking a fix and recording its ending: add a close-with-PR operation for both advisory and issue storage.
  • SecurityRecords waiting and next-fix rules: a closed record must not be picked up as waiting or as the next fix. Check the existing behavior holds for it.

Acceptance criteria:

  • With security-fix security-close, a fix that merges and whose PoC test now passes leaves the advisory closed, with a description line naming the merged PR URL. A private repository's security-finding issue is closed with a comment naming it.
  • Without closing allowed, or with no-security-close overriding close = true, nothing is closed (today's behavior).
  • A fix ending ready for review (no merge) closes nothing.
  • A PoC test that still fails, or can't run, closes nothing. It leaves a private note, the notification says the finding was left open and why, and the run's outcome is unchanged.
  • A close-step failure (API error, record changed meanwhile) is reported and does not change the Security run's outcome.
  • The Run notification and Activity log say which finding was closed by which PR, without any write-up text.
  • ADR 0015 is amended (or a new ADR added) to say a Security run may close a finding it fixed, when allowed, and why the PoC re-check is the gate. GLOSSARY entries for Security run and Security finding, docs/guide.md and Setup are updated.
  • Fake-backed tests cover the advisory path, the issue path, the gate failing and the setting/word precedence.

Out of scope:

Activity

  1. added
    enhancement
    needs-triage
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 22, 2026
  2. added a commit that references this issue on Oct 23, 2026
  3. removed
    in-progress
    on Oct 23, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions