Skip to content

Add 3CMO false positive eval for payload-analysis - #626

Draft
theobarberbany wants to merge 2 commits into
openshift-eng:mainfrom
theobarberbany:add-payload-analysis-eval
Draft

Add 3CMO false positive eval for payload-analysis#626
theobarberbany wants to merge 2 commits into
openshift-eng:mainfrom
theobarberbany:add-payload-analysis-eval

Conversation

@theobarberbany

@theobarberbany theobarberbany commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 3 eval cases for payload-analysis targeting the CCCMO #488 false positive, plus judge improvements to catch hallucinated evidence and temporal-correlation-only attribution.

Eval cases

  • case-015 (5.0.0-0.nightly-2026-07-13-041249) — Rejected nightly with full JUnit data. MCO root cause is obvious from test results. Tests correct attribution when evidence is available.
  • case-016 (5.0.0-0.ci-2026-07-11-223154) — Original CI payload as the agent saw it: empty JUnit, no build logs. Tests whether the agent fabricates evidence when data is missing. This is the exact data condition that produced the false positive.
  • case-017 (5.0.0-0.ci-2026-07-11-223154-backfilled) — Same CI payload with JUnit backfilled from GCS. Tests correct attribution with the data that should have been there originally.

Judge improvements

  • analysis_quality: added hard rules — cap at 2 if report concludes a must_not_conclude verdict or cites fabricated error strings. Score definitions now reference distractors and discriminating_signal.
  • revert_scoring_accuracy: added hard rules for false-positive cases — cap at 1 if expected_candidates is empty and a must_not_conclude PR is recommended for revert. Score definitions now cover no-candidate cases.
  • Dataset schema updated to document key_evidence, discriminating_signal, distractors, must_not_conclude (borrowed from prow-job-analysis eval).

Snapshot script fix

  • payload_snapshot.py: failed blocking jobs missing JUnit or build logs now get a data_gaps field in summary.json (e.g. data_gaps: ["junit", "build_log"]) instead of silently omitting the data.

Snapshot data

Depends on stbenjam/historical-payload-data#2 for the 3 payload snapshots.

Context

The payload agent attributed GCP micro upgrade failures to CCCMO PR #488 at 100% confidence (revert PR #489, closed without merging). It fabricated the error string "Deployment cloud-controller-manager rollout not complete" — a klog.V(2) debug line from the PR diff that was never emitted. The actual root cause was MCO: "Operator upgrade machine-config" failed 10/10, while "verify operator conditions cloud-controller-manager" passed 2/2.

🤖 Generated with Claude Code

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2026
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: theobarberbany

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This change adds artifact-grounded payload-analysis cases for CCCMO false positives and missing data, updates judge scoring rules, and records missing JUnit or build-log artifacts as data gaps.

Changes

Payload analysis grounding

Layer / File(s) Summary
Missing artifact tracking
plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py
Records missing JUnit results and build logs as failed-job data gaps.
False-positive evaluation cases
plugins/ci/evals/cases/payload-analysis/case-015-5.0-nightly-cccmo-false-positive/*, plugins/ci/evals/cases/payload-analysis/case-016-5.0-ci-cccmo-no-junit/*, plugins/ci/evals/cases/payload-analysis/case-017-5.0-ci-cccmo-backfilled-junit/*
Adds payload identifiers, rejection expectations, artifact evidence, distractors, attribution guardrails, and zero revert candidates for three CCCMO-related cases.
Evidence-aware judge scoring
plugins/ci/evals/eval-payload-analysis.yaml
Extends annotation guidance and adds scoring rules for authoritative evidence, unsupported artifacts, prohibited conclusions, and invalid revert recommendations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • openshift-eng/ai-helpers#624: Covers the CCCMO false-positive attribution, hallucinated evidence, regression cases, and data-gap tracking addressed here.
🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Real People Names In Style References ✅ Passed No real-person names or style-reference examples appear in the touched prompts/docs; only technical terms and product/component names are used.
No Assumed Git Remote Names ✅ Passed The patch only adds data_gaps handling; no new origin/upstream remote-name assumptions appear in the added diff.
Git Push Safety Rules ✅ Passed PR only adds eval cases and payload-snapshot data-gap handling; no git push, force-push, or main/master push instructions appear in touched files.
No Untrusted Mcp Servers ✅ Passed The only changed code records data_gaps for failed jobs; no MCP/server package, npx, or install changes were introduced.
Ai-Helpers Overlap Detection ✅ Passed PASS: Changed files are eval YAML and payload_snapshot.py; none are commands/skills/agents docs, and relevant open PRs target different paths.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding a payload-analysis false-positive eval case and related evaluation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@theobarberbany
theobarberbany force-pushed the add-payload-analysis-eval branch from d09c44a to ad1d5fa Compare July 16, 2026 16:00
@theobarberbany
theobarberbany force-pushed the add-payload-analysis-eval branch from ad1d5fa to a479533 Compare July 17, 2026 15:14

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py (1)

1472-1474: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use setdefault for cleaner dictionary assignment.

Both blocks initializing and appending to data_gaps use a redundant get() and reassignment pattern. This can be simplified using Python's setdefault method, which is more concise and idiomatic.

  • plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py#L1472-L1474: Replace with entry.setdefault("data_gaps", []).append("junit")
  • plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py#L1488-L1490: Replace with entry.setdefault("data_gaps", []).append("build_log")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py` around lines
1472 - 1474, In the failure-handling blocks of the payload snapshot logic,
replace the redundant data_gaps get-and-reassign pattern with setdefault on
entry. Apply this to both the junit append path at
plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py lines 1472-1474
and the build_log append path at lines 1488-1490, preserving the existing append
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@plugins/ci/evals/cases/payload-analysis/case-017-5.0-ci-cccmo-backfilled-junit/annotations.yaml`:
- Around line 24-31: Update the artifact paths in the key_evidence entries to
use the payload tag’s “-backfilled” suffix, matching the input.yaml value.
Preserve the existing job and artifact filenames while replacing the payload
directory segment with the backfilled tag so evaluator matching succeeds.

In `@plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py`:
- Around line 1472-1474: Update the `summary.json Schema` section of `AGENTS.md`
to document the `data_gaps` field alongside `build_log_errors` and
`test_failure_count`, matching the field introduced in the failed-job handling
near the `state == "Failed"` branch. Keep the existing schema wording and path
documentation unchanged.

---

Nitpick comments:
In `@plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py`:
- Around line 1472-1474: In the failure-handling blocks of the payload snapshot
logic, replace the redundant data_gaps get-and-reassign pattern with setdefault
on entry. Apply this to both the junit append path at
plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py lines 1472-1474
and the build_log append path at lines 1488-1490, preserving the existing append
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cab79bba-09b2-4efb-b71f-e28d39510b5d

📥 Commits

Reviewing files that changed from the base of the PR and between ad1d5fa and a479533.

📒 Files selected for processing (8)
  • plugins/ci/evals/cases/payload-analysis/case-015-5.0-nightly-cccmo-false-positive/annotations.yaml
  • plugins/ci/evals/cases/payload-analysis/case-015-5.0-nightly-cccmo-false-positive/input.yaml
  • plugins/ci/evals/cases/payload-analysis/case-016-5.0-ci-cccmo-no-junit/annotations.yaml
  • plugins/ci/evals/cases/payload-analysis/case-016-5.0-ci-cccmo-no-junit/input.yaml
  • plugins/ci/evals/cases/payload-analysis/case-017-5.0-ci-cccmo-backfilled-junit/annotations.yaml
  • plugins/ci/evals/cases/payload-analysis/case-017-5.0-ci-cccmo-backfilled-junit/input.yaml
  • plugins/ci/evals/eval-payload-analysis.yaml
  • plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • plugins/ci/evals/cases/payload-analysis/case-015-5.0-nightly-cccmo-false-positive/input.yaml
  • plugins/ci/evals/eval-payload-analysis.yaml
  • plugins/ci/evals/cases/payload-analysis/case-015-5.0-nightly-cccmo-false-positive/annotations.yaml

Comment on lines +24 to +31
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
- fact: >-
"verify operator conditions cloud-controller-manager" passed 2/2
with 0 failures. "verify operator conditions machine-config"
failed 0/2.
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align artifact paths with the payload_tag.

The artifact paths in key_evidence are missing the -backfilled suffix. Since the input.yaml for this case specifies payload_tag: "5.0.0-0.ci-2026-07-11-223154-backfilled", the payload directory and the resulting artifact paths cited by the agent will include this suffix. The evaluator may fail to match these strings if they don't exactly align with the agent's output.

🔧 Proposed fix
     artifacts:
-      - "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
+      - "5.0/ci/5.0.0-0.ci-2026-07-11-223154-backfilled/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
   - fact: >-
       "verify operator conditions cloud-controller-manager" passed 2/2
       with 0 failures. "verify operator conditions machine-config"
       failed 0/2.
     artifacts:
-      - "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
+      - "5.0/ci/5.0.0-0.ci-2026-07-11-223154-backfilled/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
- fact: >-
"verify operator conditions cloud-controller-manager" passed 2/2
with 0 failures. "verify operator conditions machine-config"
failed 0/2.
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154-backfilled/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
- fact: >-
"verify operator conditions cloud-controller-manager" passed 2/2
with 0 failures. "verify operator conditions machine-config"
failed 0/2.
artifacts:
- "5.0/ci/5.0.0-0.ci-2026-07-11-223154-backfilled/jobs/blocking/aggregated-gcp-ovn-upgrade-5.0-micro/junit/results.json"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@plugins/ci/evals/cases/payload-analysis/case-017-5.0-ci-cccmo-backfilled-junit/annotations.yaml`
around lines 24 - 31, Update the artifact paths in the key_evidence entries to
use the payload tag’s “-backfilled” suffix, matching the input.yaml value.
Preserve the existing job and artifact filenames while replacing the payload
directory segment with the backfilled tag so evaluator matching succeeds.

Comment on lines +1472 to +1474
elif job_data.get("state") == "Failed":
entry["data_gaps"] = entry.get("data_gaps", [])
entry["data_gaps"].append("junit")

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the new data_gaps field in the schema.

The data_gaps field is introduced here for failed jobs, but it is not documented in the summary.json Schema section of AGENTS.md. The payload analysis agent relies on this schema to understand the available data, so omitting it could prevent the agent from utilizing the new missing-artifact context.

📝 Proposed fix for AGENTS.md schema

Update the schema documentation (around line 1388) to include data_gaps:

-            "  `failure_pattern`), `build_log_errors`, `test_failure_count`,",
-            "  and relative paths to `job_json`, `junit_results`, `build_log`",
+            "  `failure_pattern`), `build_log_errors`, `test_failure_count`, `data_gaps`,",
+            "  and relative paths to `job_json`, `junit_results`, `build_log`",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/ci/skills/payload-snapshot/scripts/payload_snapshot.py` around lines
1472 - 1474, Update the `summary.json Schema` section of `AGENTS.md` to document
the `data_gaps` field alongside `build_log_errors` and `test_failure_count`,
matching the field introduced in the failed-job handling near the `state ==
"Failed"` branch. Keep the existing schema wording and path documentation
unchanged.

@stbenjam

Copy link
Copy Markdown
Member

Heads-up from the payload-analysis A/B work in #659/#660: agent-eval-harness exposes the case directory name to the model, so descriptive names leak the expected diagnosis. We have renamed the existing dataset to opaque case-NNN directories and put the human mapping in plugins/ci/evals/cases/payload-analysis/README.md. Before this PR merges, could cases 015–017 likewise be named only case-015, case-016, and case-017? The index in #659/#660 already reserves those IDs for these scenarios.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants