Skip to content

fix(triage-security): improve remediation task generation logic in Step 8#261

Open
ruromero wants to merge 3 commits into
RHEcosystemAppEng:mainfrom
ruromero:TC-5378
Open

fix(triage-security): improve remediation task generation logic in Step 8#261
ruromero wants to merge 3 commits into
RHEcosystemAppEng:mainfrom
ruromero:TC-5378

Conversation

@ruromero

@ruromero ruromero commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reorder Case B (cross-stream) before Case A (affected) in Step 8 to match the mermaid flowchart evaluation order
  • Inline the ecosystem-dependent two-task rule (upstream + downstream for source deps, single task for system packages) directly in Case A
  • Add a 5-item pre-creation checklist at the confirmation gate before Jira mutations
  • Simplify Rule 8 in the guardrails to cross-reference Case A and the checklist instead of restating the rule

Test plan

  • Manual smoke test: invoke /triage-security on a test Vulnerability issue with a source dependency scoped to one stream and verify the skill proposes the correct task count including downstream subtasks
  • Verify the pre-creation checklist items are evaluated before presenting the recommendation

Resolves: TC-5378

🤖 Generated with Claude Code

Summary by Sourcery

Refine the triage-security Step 8 workflow to align remediation task generation, cross-stream handling, and guardrails with the documented flow and ecosystem-specific rules.

New Features:

  • Introduce a pre-creation checklist gate before executing Jira mutations in the triage-security workflow.

Enhancements:

  • Reorder Step 8 evaluation so cross-stream impact (Case B) is processed before affected-stream remediation (Case A) to match the flowchart.
  • Inline ecosystem-specific task count rules into Case A, differentiating source dependency and system package remediation tasks.
  • Clarify guardrail Rule 8 to reference the Case A ecosystem rule and the pre-creation checklist instead of restating the full logic.

Documentation:

  • Expand SKILL documentation with a detailed pre-creation checklist and updated Case A/B descriptions to guide remediation task creation and linking behavior.

…ep 8

Reorder Case B before Case A to match flowchart evaluation order,
inline the ecosystem-dependent two-task rule at the Case A action point,
add a 5-item pre-creation checklist at the confirmation gate, and
simplify Rule 8 to cross-reference instead of restating.

Root cause: CVE-2026-13149 triage (TC-5051) missed downstream
propagation subtasks and preemptive cross-stream tasks because
Case A committed to single tasks before Case B could add preemptive
ones, and the two-task ecosystem rule was buried in the guardrails.

Resolves: TC-5378

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Step 8 triage-security documentation is updated to reorder Case B before Case A, inline ecosystem-specific task-count rules into Case A, add a pre-creation checklist before Jira mutations, and simplify guardrail Rule 8 to reference the new Case A logic and checklist.

File-Level Changes

Change Details Files
Reorder Step 8 evaluation so Case B (cross-stream impact) is documented before Case A (affected remediation).
  • Move the Case A section below Case B so the narrative order matches the mermaid flowchart evaluation order.
  • Remove the original Case A block and reinsert an updated version after the Case B section.
plugins/sdlc-workflow/skills/triage-security/SKILL.md
Inline ecosystem-dependent task-count rules directly into Case A remediation logic.
  • Change the Case A instructions from a generic one-task-per-stream rule to ecosystem-aware guidance.
  • Specify that source dependency ecosystems (Cargo, npm) create two tasks per stream (upstream + downstream, with a blocking relationship).
  • Specify that system package ecosystems (RPM) create a single task per stream, with fixes happening in the Konflux release repo.
  • Keep linkage requirements from tasks back to the Vulnerability issue.
plugins/sdlc-workflow/skills/triage-security/SKILL.md
Introduce a pre-creation checklist gate before Jira mutations to validate recommendations.
  • Add a five-item checklist under the confirmation step to validate task count per stream, cross-stream coverage, link types, preemptive labels, and coordination guidance.
  • Clarify required link types between tasks and CVE issues, and between upstream and downstream tasks.
  • Document labeling expectations for preemptive tasks and content requirements for Implementation Notes.
plugins/sdlc-workflow/skills/triage-security/SKILL.md
Simplify guardrail Rule 8 to reference the new Case A logic and checklist instead of restating task-count rules.
  • Replace the detailed description of per-stream task and downstream subtask behavior with a concise rule that task count depends on ecosystem.
  • Point readers to Case A and the pre-creation checklist for full details while preserving constraints about per-stream tasks and dev-only/build-only labeling and priority.
  • Retain references to the dependency scope decision tree documentation.
plugins/sdlc-workflow/skills/triage-security/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The ecosystem-specific rules are now described in both Case A and the pre-creation checklist; consider consolidating the canonical description in one place (e.g., Case A) and keeping the checklist purely as a short verification list to reduce the risk of these drifting out of sync when adding new ecosystems.
  • Case A and the guardrail Rule 8 both constrain task count by ecosystem using hard-coded examples (Cargo, npm, RPM); if additional ecosystems are expected, you may want to explicitly call out how to handle ‘other’ ecosystems or centralize the mapping so authors don’t have to update multiple narrative sections when the set changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The ecosystem-specific rules are now described in both Case A and the pre-creation checklist; consider consolidating the canonical description in one place (e.g., Case A) and keeping the checklist purely as a short verification list to reduce the risk of these drifting out of sync when adding new ecosystems.
- Case A and the guardrail Rule 8 both constrain task count by ecosystem using hard-coded examples (Cargo, npm, RPM); if additional ecosystems are expected, you may want to explicitly call out how to handle ‘other’ ecosystems or centralize the mapping so authors don’t have to update multiple narrative sections when the set changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eval Results

Eval Results: triage-security

Eval Passed Failed Pass Rate
eval-1 11/11 0 100%
eval-2 5/5 0 100%
eval-3 5/5 0 100%
eval-4 5/5 0 100%
eval-5 6/6 0 100%
eval-6 6/6 0 100%
eval-7 5/5 0 100%
eval-8 8/8 0 100%
eval-9 5/5 0 100%
eval-10 3/5 2 60%
eval-11 5/5 0 100%
eval-12 5/5 0 100%
eval-13 5/5 0 100%
eval-14 4/5 1 80%
eval-15 5/5 0 100%
eval-16 7/7 0 100%
eval-17 3/5 2 60%
eval-18 5/5 0 100%
eval-19 4/5 1 80%
eval-20 1/4 3 25%
eval-21 4/4 0 100%
eval-22 4/4 0 100%
eval-23 4/4 0 100%
eval-24 4/4 0 100%
eval-25 4/4 0 100%
eval-26 5/5 0 100%
eval-27 5/5 0 100%
eval-28 5/5 0 100%
eval-29 5/5 0 100%
eval-30 4/4 0 100%
eval-31 4/4 0 100%
eval-32 4/4 0 100%

Failed Assertions

eval-10: 2 failing assertions
  • Assertion: "Step 8 Case A creates standard remediation tasks for the current stream (rhtpa-2.2) with standard labels ['ai-generated-jira', 'Security', 'CVE-2026-55123'] and 'Depend' link to TC-8020"
    Evidence: "The output swaps Case A and Case B labels. The assertion expects Case A to be standard remediation for the current stream (rhtpa-2.2), but the output labels that as Case B and assigns Case A to the preemptive cross-stream tasks for rhtpa-2.1."

  • Assertion: "Step 8 Case B detects that stream rhtpa-2.1 is also affected but has no CVE Jira — creates proactive preemptive remediation tasks (§1.60)"
    Evidence: "Same label swap. The assertion expects Case B to be preemptive remediation for rhtpa-2.1, but the output labels that as Case A and assigns Case B to standard remediation for rhtpa-2.2."

eval-14: 1 failing assertion
  • Assertion: "The rpms.lock.yaml classification remains the primary signal — the SBOM result supplements but does not override it (Step 2.3.5 non-MVP enhancement)"
    Evidence: "Contradictory evidence. The introductory text says rpms.lock.yaml determines the classification with SBOM as a cross-check, but the actual behavior shows that when they disagree, the origin becomes CONFLICTING — requires manual investigation rather than defaulting to the rpms.lock.yaml answer of explicit install. This means the SBOM result effectively overrides the rpms.lock.yaml classification rather than merely supplementing it."
eval-17: 2 failing assertions
  • Assertion: "Step 0 extracts the Embargo policy URL from the Security Configuration as an optional field without raising an error (§1.71 — backward compatible extraction)"
    Evidence: "No Step 0 output file exists. The embargo policy URL extraction appears in Step 1.7 Configuration Check section, not in a dedicated Step 0. No evidence of optional-field or backward-compatible extraction handling."

  • Assertion: "The embargo warning gate does NOT trigger for Low or Moderate severity CVEs (CVSS < 7.0) — it is skipped silently when severity is below threshold (§1.70)"
    Evidence: "The outputs only cover the CVSS 7.5 (above-threshold) case. No output demonstrates or explicitly states that the gate is skipped silently for CVSS < 7.0 scenarios."

eval-19: 1 failing assertion
  • Assertion: "Step 0.3 runs before Step 0.5 (JIRA Access Initialization) — no Jira operations are attempted before the staleness check"
    Evidence: "Only one output file exists (staleness-check.md). There is no evidence of Step 0.5 execution or workflow ordering. The absence of Jira operations in this single file does not prove Step 0.3 ran before Step 0.5 — no ordering evidence exists."
eval-20: 3 failing assertions
  • Assertion: "Step 0.3 determines the matrix is within the 14-day threshold and proceeds without displaying a staleness warning"
    Evidence: "The matrix is 27 days old, exceeding the 14-day threshold. Both streams are marked STALE with warnings displayed — the opposite of what the assertion claims."

  • Assertion: "No user prompt or options are presented for a fresh matrix — the check is silent on success"
    Evidence: "The matrix is not fresh, so the silent on success behavior cannot be confirmed. Instead, user prompts with three options are presented for each stale stream."

  • Assertion: "The triage continues to Step 0.5 and beyond without interruption from the staleness check"
    Evidence: "The staleness check explicitly interrupted triage, stating Action required and demanding the engineer choose an option before continuing."

Pass rate: 94% · Tokens: 58,588 · Duration: 128s

Baseline (1dab64e0): 99% · 58,181 tokens · 124s


Generated by sdlc-workflow/run-evals v0.13.6

The cases were ordered B, A, C in the document but retained their
original letter names, making the flow confusing. Rename so the
document order matches alphabetical naming: cross-stream impact
is now Case A (listed first), remediation tasks is now Case B
(listed second), Case C unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ruromero

Copy link
Copy Markdown
Collaborator Author

[sdlc-workflow/verify-pr] Re: @sourcery-ai[bot] review —

  1. "Consolidate ecosystem rules": Classified as suggestion — proposes reducing duplication between Case A and the checklist; no documented convention requires this consolidation. No sub-task created.
  2. "Centralize ecosystem mapping": Classified as suggestion — proposes a centralized mapping for ecosystem task-count rules; no documented convention or established codebase pattern requires this. No sub-task created.

@ruromero

Copy link
Copy Markdown
Collaborator Author

Verification Report for TC-5378 (commit 386ed9d)

Check Result Details
Review Feedback PASS 2 suggestions (sourcery-ai), 0 code change requests
Root-Cause Investigation N/A No sub-tasks created
Scope Containment PASS Changes limited to SKILL.md as specified
Diff Size PASS Single-file rename/reorder within expected scope
Commit Traceability PASS Commit references TC-5378
Sensitive Patterns PASS No secrets or sensitive data detected
CI Status PASS All CI checks passed
Acceptance Criteria PASS 4 of 4 criteria met
Test Quality PASS Eval Quality: PASS (32/32 evals, 164 assertions)
Test Change Classification N/A No test files modified
Verification Commands N/A No verification commands specified

Overall: PASS

No issues requiring attention. All acceptance criteria met. Eval suite confirms no regressions from the case rename.


This comment was AI-generated by sdlc-workflow/verify-pr v0.13.3.

Add a canonical ecosystem classification table as the single source of
truth for ecosystem categories and task counts. Update all downstream
references (Case B, checklist, remediation templates, guardrail Rule 8,
and mermaid flowcharts) to point to the table instead of re-listing
ecosystem names inline, reducing duplication from 6 sites to 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ruromero
ruromero requested a review from mrizzi July 25, 2026 10:50
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.

1 participant