← Back to Pull requests

feat: impact analysis (XWING-3088) #411

Open
unknown opened this pull request with 313 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 09, 2026 23:36 UTC
Author

https://redhat.atlassian.net/browse/XWING-3088
Plan: https://github.com/traust-security/traust-foundry/blob/main/plans/impact-analysis/features/2026-11-impact-analysis.md
Stack: core #407 (merged into this branch) → traust #394 · traust-sdk #59 (both pin this branch's merge commit)

What

The impact-analysis feature's traust-core share, merged from #407:

  • The impact read — impact(identifier): every tracked ref's outcome for one advisory. Rows for refs whose SBOM uses the advisory's ecosystems (affected / fixed / not using / unresolved manifest / undetermined), counts for the proven rest and every gap (stale line, no SBOM, coverage unknown) — never silently missing; complete, fixable, as_of, unmodelled ecosystems.

  • The fill door — fill(identifier, principal): one run_batch per advisory, one repo_state + manifest_sbom order pair per gap repository, healing on retry; repositories this caller may not take are skipped (a caller denied everywhere learns no batch), and the batch lookup is deterministic under a concurrent create.

  • Tracked lines — a tracked ref is the latest commit of any named branch line (default, release-imported, or user-attached): tracked_refs / tracked_refs_of, list_lines, attach_branch + POST /v1/repositories/{id}/branches (the Snyk-style "scan this branch"), observe_lines for the materializers' line walks.

  • REST — GET/POST /v1/advisories/{identifier}/impact[/fill].
  • The decisions

  • No data-model change: orders stay repository-scoped; an order's work walks its repository's tracked lines (the traust PR deepens the materializers). Bare commits and tags are not lines; registration is the attachment (untracking is parked in the plan's Later).

  • Trust rule both ways: not_using/fixed proven only under resolved coverage; unorderable versions are undetermined, never safe; a ref whose named scan no longer resolves raises.

  • Ecosystem narrowing bounded by the tracked fleet's SBOMs; the fill reaches batches and orders through the ops doors (ratchet-enforced).
  • How tested

  • #407's checks all green at merge: lint, test 3.11/3.12 (12,005), api-check, postgres, ratchet; coverage 95.8%; Qodo PR reviews resolved across #407 and this PR (13 fixed, 2 false positives, 7 intentional, 3 deferred with rationale recorded on the findings). Parity round (Michele's review + the legacy audit): grading, verdict join, carriers and coverage narrowing landed; the parity steps P3–P7 are tracked in the plan.
  • Diff: 313 lines (+234 / -79) across 3 files Reviewer: chubirka Review duration: 18537m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 313 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.344
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #411"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23% · Safe to merge
    23%