← Back to Pull requests

Accept the dropped empty spec in the ReadProfile fuzz test #3598

Closed
unknown closed this pull request without merging on Oct 20, 2026 08:01 UTC
View on GitHub
unknown unknown commented on Oct 18, 2026 14:56 UTC
Author

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

The weekly fuzz run found an input that FuzzReadProfile rejects:

kind: SelinuxProfile
speC: {Allow: {}}

spec: {allow: {}} fails the same way. ReadProfile reads it correctly,
the assertion of the test is too strict. Spec is tagged omitzero and
allow is tagged omitempty, so the first encoding keeps spec: {}
because the empty allow map is not nil. Reading it back leaves allow
nil, and the second encoding drops spec entirely. Both encodings
describe the same profile, but the test required the first round trip to
produce identical YAML.

The test now requires:

  • the decoded profile to be semantically equal to the original one, using

  • equality.Semantic.DeepEqual, which treats nil and empty maps and
    slices as equal,
  • the YAML encoding to be stable from the second round trip on.
  • The failing input of the run is added as empty-selinux-allow below
    testdata/fuzz as a regression test.

    Which issue(s) this PR fixes:

    Fixes #3597

    Does this PR have test?

    Yes, the change is the test itself. The new corpus entry fails before the
    change and passes after it. Each assertion catches a broken ReadProfile
    injected locally: a profile that changes on each read (semantic check),
    and an encoding that alternates between spec: {} and no spec (stability
    check). FuzzReadProfile ran 15 minutes locally, 3.3M executions, without
    failure.

    Special notes for your reviewer:

    Changing the omitzero tag of the released v1 API to get an identical
    first round trip seemed out of proportion for a test, as both forms are
    equivalent.

    Does this PR introduce a user-facing change?

    ``release-note
    NONE
    ``

    Diff: 219 lines (+164 / -55) across 2 files Reviewer: saschagrunert Review duration: 2464m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 219 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3598"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 36.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.5% · Safe to merge
    14.5%