Repository navigation
Mark which Security finding a Security run's fix addresses in its Run notification - #1173
Merged
Merged
Conversation
…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.
# Conflicts: # site/docs/index.html
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.rstests, each failing before the change (the notification had oneSecurity findings:list andAudit: 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 underRecorded, waiting for the Day shift:, theAudit:line is the audit's, andstatus --jsonshowsneeds_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 underAlso 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: failedandFix attempted, not fixed:.Validation results:
scripts/affected-tests mainon this head: the full Rust suite plusnpm test --prefix siteand its other site checks. Exit 0, no failures. It was run withtag.gpgsign=falsethroughGIT_CONFIG_COUNT, because this machine's globaltag.gpgsign = truefails the threeworktree::synchronization_teststhat create lightweight tags. Those tests are unrelated to this change.cargo clippy --all-targets -- -D warnings: clean.npm test --prefix site: 49/49 pass, andsite/docs/index.htmlis regenerated fromdocs/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_waitingkeeps 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.htmlwas grepped by the Standards reviewer and not read by the Spec reviewer. It is generated fromdocs/guide.md, which both read, andnpm run docs:checkpasses.Unaddressed findings
Standards
Errarm and the whole auditEndedcarried into the fix: declined.run_throughdispatches a fix only underif 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 rebuildingEndedon theOk(None)andErrpaths of the samematch.Account;Outcome::FixedandEnding::SecurityFixare twins: declined. This follows the existing shape:Ending::Security(security::Ended)mirrorsOutcome::Audited, andAccountalready carriessecurity_findings,failed_reproductionandpre_audit_failureside by side. RegroupingAccountwould be a refactor beyond Security run notification: mark which Security finding the fix's pull request addresses #1072.security_fixinbody;slice::from_ref(finding)for a fix without an audit: declined.security_findingsis 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.finding.url == *urlinaudit_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'printsin-sync. Smell (e), the duplicated staging script, is fixed by thestage_private_title()helper.)Spec
(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 insecurity::Ended::waitingstay in process; the command record keeps only itssecurity_findings_waitingflag.Closes #1072
Built with claude · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.