Skip to content

Mark which Security finding a Security run's fix addresses in its Run notification - #1173

Merged
JacobStephens2 merged 4 commits into
mainfrom
issue-1072
Oct 23, 2026
Merged

JacobStephens2 merged 4 commits into
mainfrom
issue-1072

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Security run that audits then fixes no longer reads as if the fix's pull request resolved every Security finding. Its Run notification names the one finding the fix addresses, lists the audit's other findings apart from it, and keeps how the audit ended apart from how the fix ended.

 Result:       merged
 Command:      Security run
-Audit:        PR https://github.com/<owner>/<repo>/pull/26 is merged
+Audit:        Security audit recorded 7 new finding(s), 0 already recorded   # or: not run
 
-Security findings:
-- medium: <title>: <link>
-- high:   <title>: <link>
-- ... 5 more ...
+Addressed by the pull request:            # "Fix attempted, not fixed:" when the fix failed or was interrupted
+- high: <title>: <link>
+
+Recorded, waiting for the Day shift:      # the audit's others whose records wait for triage
+- medium: <title>: <link>
+- ...
+
+Also recorded by the audit:               # the audit's others the Day shift already graded
+- ...
 
 Pull request: https://github.com/<owner>/<repo>/pull/26
 security::Outcome::Fixed {
   ended,
-  findings,                   # the audit's findings, or just the fixed one
+  finding,                    # the finding the fix was dispatched for
+  audit: Option<Box<Ended>>,  # the audit before it, if the run audited
 }
 security::Ended {
-  findings_waiting: bool,
+  waiting: Vec<String>,       # private links of the records waiting for triage
 }

The finding the fix addresses no longer counts as waiting. When an audit-then-fix leaves other findings waiting for triage, the Security run now appears in the Inbox's Needs you, as an audit-only run does. Before this change, a fix ending never flagged it. The Console's findings list and the Activity log end line are unchanged. Whether they need the same distinction was left open in #1072 and is now #1174 (needs-triage).

Evidence

New tests/security_run.rs tests, each failing before the change (the notification had one Security findings: list and Audit: PR … is ready for review):

  • an_audit_then_fix_notification_marks_the_fixed_finding_apart_from_those_waiting: an audit records two findings and fixes the high one. The test checks that the low one is listed under Recorded, waiting for the Day shift:, the Audit: line is the audit's, and status --json shows needs_you_kind: finding.
  • an_audit_then_fix_notification_lists_a_graded_finding_apart_from_those_waiting: a finding the Day shift already graded is listed under Also recorded by the audit:.
  • an_audit_then_fix_that_leaves_nothing_waiting_flags_no_finding: fixing the audit's only finding leaves the Inbox clear. This is the Spec reviewer's test, which failed as they said on the first version.
  • a_fix_without_an_audit_notification_says_the_audit_did_not_run: Audit: not run, and only the fixed finding is listed.
  • a_failed_fix_notification_marks_its_finding_attempted_not_fixed: Result: failed and Fix attempted, not fixed:.

Validation results:

  • scripts/affected-tests main on this head: the full Rust suite plus npm test --prefix site and its other site checks. Exit 0, no failures. It was run with tag.gpgsign=false through GIT_CONFIG_COUNT, because this machine's global tag.gpgsign = true fails the three worktree::synchronization_tests that create lightweight tags. Those tests are unrelated to this change.
  • cargo clippy --all-targets -- -D warnings: clean.
  • npm test --prefix site: 49/49 pass, and site/docs/index.html is regenerated from docs/guide.md.

Merge Danger

Door: two-way

Only the notification text, the in-process ending types and the Inbox flag change. No stored record format changes: security_findings_waiting keeps its field and meaning.

Blast Radius: narrow

Only Security runs with fixing allowed are affected: their notification layout, and their place in the Inbox when findings are left waiting.

Review coverage

Both reviewers read every changed file at the reviewed commit. The regenerated site/docs/index.html was grepped by the Standards reviewer and not read by the Spec reviewer. It is generated from docs/guide.md, which both read, and npm run docs:check passes.

Unaddressed findings

Standards

  • (a) Impossible Err arm and the whole audit Ended carried into the fix: declined. run_through dispatches a fix only under if fixing && audited.outcome.is_ok() (src/security.rs). The arm renders the audit's failure honestly if that ever changes. A narrower type would mean rebuilding Ended on the Ok(None) and Err paths of the same match.
  • (b) Security-only fields clumped on Account; Outcome::Fixed and Ending::SecurityFix are twins: declined. This follows the existing shape: Ending::Security(security::Ended) mirrors Outcome::Audited, and Account already carries security_findings, failed_reproduction and pre_audit_failure side by side. Regrouping Account would be a refactor beyond Security run notification: mark which Security finding the fix's pull request addresses #1072.
  • (c) Two matches on security_fix in body; slice::from_ref(finding) for a fix without an audit: declined. security_findings is also what the command record keeps for the Console (src/logs/command_record.rs:257). Before this change it held the fixed finding on that path (vec![metadata]), and keeping it there preserves the Console's list.
  • (d) A finding's identity is its URL: declined. The audit already matches findings to records by URL (finding.url == *url in audit_and_record, src/security.rs). The private link is the finding's identity across the notification and records.

(The hard violation, the unregenerated site/docs/index.html, is fixed: git show HEAD:site/docs/index.html | grep -q 'Addressed by the pull request' prints in-sync. Smell (e), the duplicated staging script, is fixed by the stage_private_title() helper.)

Spec

  • (b1) Inbox flag carried into the fix ending (scope): kept. The issue's incident was six findings waiting for triage with no sign of it. GLOSSARY's Needs you includes "a Security finding waiting on a decision", which a fix ending never raised before. Its wrong case (c1) is fixed and tested above.

(c1 and c2 are fixed. The heading now lists only findings whose records wait for triage, and graded ones go under Also recorded by the audit:.)

Security

None. The change only regroups what a Security run's notification already carried: each Security finding's severity, title and private link, never its write-up. The new Audit: text is fixed strings and counts (not run, Security audit recorded N new finding(s), M already recorded, audit failed), and the private links in security::Ended::waiting stay in process; the command record keeps only its security_findings_waiting flag.

Closes #1072

Built with claude · claude-opus-5-5 · high

Security review outcome

No unaddressed introduced findings.

…ication

A Security run that audited then fixed listed every recorded finding as if
the fix's pull request resolved them all, and its Audit line showed the fix's
ending. The fix now carries the finding it was dispatched for and the audit
before it, if any. The notification lists that finding under 'Addressed by
the pull request' (or 'Fix attempted, not fixed' when the fix failed or was
interrupted), the audit's others under 'Recorded, waiting for the Day shift',
and says how the audit ended, or 'not run'. Findings left waiting after a fix
now flag the Inbox as an audit-only run's do.

Closes #1072
The Inbox flag and the notification's waiting list now come from which
records the audit found waiting for triage, leaving out the finding the fix
addresses; findings the Day shift already graded are listed as also recorded.
@JacobStephens2
JacobStephens2 merged commit 4bd098e into main Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1072 branch October 23, 2026 18:42
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security run notification: mark which Security finding the fix's pull request addresses

1 participant