Skip to content

OLS-3813 Remove confidence/risk from eval schemas - #152

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
vimalk78:OLS-3813-remove-confidence-risk
Aug 6, 2026
Merged

OLS-3813 Remove confidence/risk from eval schemas#152
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
vimalk78:OLS-3813-remove-confidence-risk

Conversation

@vimalk78

@vimalk78 vimalk78 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove confidence from diagnosis schemas (top-level and per-option) in evals/schemas.py
  • Remove risk from remediation plan schema
  • Update required arrays to exclude these fields
  • Clean up test fixtures and assertions in test_schemas.py and test_skill_invocation.py

Test plan

  • make test — 212 tests pass
  • Image builds successfully

Jira

https://redhat.atlassian.net/browse/OLS-3813

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7b3bff6c-f993-497a-98d6-db0556e0fc3e

📥 Commits

Reviewing files that changed from the base of the PR and between 7357b1f and 37d2ab6.

📒 Files selected for processing (7)
  • evals/schemas.py
  • evals/test_schemas.py
  • evals/test_skill_invocation.py
  • evals/workspace/skills/find-token/tools/find-token.sh
  • evals/workspace/tools/find-token.sh
  • src/lightspeed_agentic/routes/query.py
  • tests/test_routes.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-operator (manual)
💤 Files with no reviewable changes (3)
  • evals/test_skill_invocation.py
  • evals/workspace/tools/find-token.sh
  • evals/workspace/skills/find-token/tools/find-token.sh
🚧 Files skipped from review as they are similar to previous changes (4)
  • evals/schemas.py
  • src/lightspeed_agentic/routes/query.py
  • evals/test_schemas.py
  • tests/test_routes.py

📝 Walkthrough

Summary by CodeRabbit

  • Changes
    • Simplified diagnosis results by removing confidence values from diagnoses and diagnosis options.
    • Removed risk values from remediation plans and remediation context.
    • Improved handling of missing reversibility information by displaying “unknown.”
    • Updated validation and test coverage to reflect the streamlined result format.

Walkthrough

The evaluation schema removes confidence from diagnosis objects and risk from remediation plans. Generated responses, fixtures, route formatting, and route tests now use the reduced contracts.

Changes

Evaluation and remediation contract updates

Layer / File(s) Summary
Schema and generated response contracts
evals/schemas.py, evals/test_schemas.py, evals/test_skill_invocation.py, evals/workspace/skills/find-token/tools/find-token.sh, evals/workspace/tools/find-token.sh
Diagnosis schemas and fixtures omit confidence. Remediation plans and generated responses omit risk. Skill invocation tests no longer validate the removed fields.
Approved-remediation formatting
src/lightspeed_agentic/routes/query.py, tests/test_routes.py
The route renders only Reversible and defaults missing values to unknown. Route fixtures and assertions use the updated output.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the removal of confidence and risk from the evaluation schemas.
Description check ✅ Passed The description directly explains the schema changes, test updates, and reported validation results.
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.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
evals/test_schemas.py (1)

14-19: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Run this check through the live eval harness.

The changed fixtures feed a local schema test. test_action_required_false_with_diagnosis directly validates an in-memory document at Lines 49-51. Move this test out of evals/ if it remains a unit test, or invoke the containerized live runner as shown in evals/test_skill_invocation.py Lines 21-50.

As per path instructions, “Evals are integration-only checks and must run against live endpoints in the containerized harness rather than as ordinary unit tests.”

Also applies to: 41-41

🤖 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 `@evals/test_schemas.py` around lines 14 - 19, Update
test_action_required_false_with_diagnosis so it runs through the containerized
live eval harness, following the invocation pattern in test_skill_invocation.py,
rather than validating an in-memory document as a unit test. If it must remain a
unit test, move it out of evals/ and keep the eval fixture changes limited to
integration coverage.

Source: Path instructions

evals/schemas.py (1)

31-38: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Make the schema removal enforceable.

The three objects omit "additionalProperties": False, so jsonschema.validate still accepts confidence and risk. If OLS-3813 requires rejection, add the guard to both diagnosis objects and remediationPlan, add rejection tests, and update both find-token fixtures. The operator CRD still declares these fields, so do not describe them as removed from the overall contract until that schema is updated.

🤖 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 `@evals/schemas.py` around lines 31 - 38, Add "additionalProperties": False to
both diagnosis object definitions and the remediationPlan schema so undeclared
fields such as confidence and risk are rejected by validation. Add tests
covering rejection of those fields and update both find-token fixtures
accordingly; do not claim the fields are removed from the overall contract while
the operator CRD still declares them.
🤖 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.

Outside diff comments:
In `@evals/schemas.py`:
- Around line 31-38: Add "additionalProperties": False to both diagnosis object
definitions and the remediationPlan schema so undeclared fields such as
confidence and risk are rejected by validation. Add tests covering rejection of
those fields and update both find-token fixtures accordingly; do not claim the
fields are removed from the overall contract while the operator CRD still
declares them.

In `@evals/test_schemas.py`:
- Around line 14-19: Update test_action_required_false_with_diagnosis so it runs
through the containerized live eval harness, following the invocation pattern in
test_skill_invocation.py, rather than validating an in-memory document as a unit
test. If it must remain a unit test, move it out of evals/ and keep the eval
fixture changes limited to integration coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 292ac77f-c003-4f11-a7b7-f7a1b047df94

📥 Commits

Reviewing files that changed from the base of the PR and between 7357b1f and 1fd54c0.

📒 Files selected for processing (3)
  • evals/schemas.py
  • evals/test_schemas.py
  • evals/test_skill_invocation.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-operator (manual)
💤 Files with no reviewable changes (1)
  • evals/test_skill_invocation.py

@vimalk78
vimalk78 force-pushed the OLS-3813-remove-confidence-risk branch from 1fd54c0 to bcf2bbc Compare August 6, 2026 10:59
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/test_routes.py (1)

263-263: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert that the removed field stays absent.

assert "Reversible: True" in text can pass even if the formatter also emits Risk:. Add assert "Risk:" not in text. Add a case without reversible to verify the "unknown" fallback.

🤖 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 `@tests/test_routes.py` at line 263, Strengthen the assertions around the
formatter test by verifying that "Risk:" is absent from the output alongside the
existing "Reversible: True" check. Add a test case with no reversible value and
assert the formatter uses the "unknown" fallback.
🤖 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.

Nitpick comments:
In `@tests/test_routes.py`:
- Line 263: Strengthen the assertions around the formatter test by verifying
that "Risk:" is absent from the output alongside the existing "Reversible: True"
check. Add a test case with no reversible value and assert the formatter uses
the "unknown" fallback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ac170918-ecaf-4975-842b-1378bbe988a9

📥 Commits

Reviewing files that changed from the base of the PR and between 7357b1f and bcf2bbc.

📒 Files selected for processing (7)
  • evals/schemas.py
  • evals/test_schemas.py
  • evals/test_skill_invocation.py
  • evals/workspace/skills/find-token/tools/find-token.sh
  • evals/workspace/tools/find-token.sh
  • src/lightspeed_agentic/routes/query.py
  • tests/test_routes.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-operator (manual)
💤 Files with no reviewable changes (3)
  • evals/workspace/skills/find-token/tools/find-token.sh
  • evals/workspace/tools/find-token.sh
  • evals/test_skill_invocation.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • evals/test_schemas.py
  • evals/schemas.py

@vimalk78 vimalk78 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial Review: OLS-3813 — PASS (100/100)

Mode: jira | Round: 1

Adherence

5/5 acceptance criteria met.

Code Quality

Original review found 1 should-fix issue:

  • evals/workspace/tools/find-token.sh and evals/workspace/skills/find-token/tools/find-token.sh still emitted "confidence" and "risk" in canned JSON outputFixed

Note (out of scope): src/lightspeed_agentic/routes/query.py:51 does plan['risk'] with direct dict access. When OLS-3811 makes risk optional in the operator CRD, this will KeyError if the operator sends an approved option without risk. Needs a separate fix.

All findings resolved. PR is ready for human review.

🤖 Reviewed with Claude Code

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

Nit: tests/test_routes.py still passes "risk": "low" in several approvedOption.remediationPlan fixtures (lines 250, 279, 304, 326). The production code no longer reads it so tests pass, but the leftover keys are misleading — a future reader might assume risk is still part of the contract.

Suggest removing the "risk" entries from those fixture dicts for consistency with the schema change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
@vimalk78
vimalk78 force-pushed the OLS-3813-remove-confidence-risk branch from bcf2bbc to 37d2ab6 Compare August 6, 2026 13:24
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@blublinsky

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2026
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: blublinsky

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 Aug 6, 2026
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

@vimalk78: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit e161290 into openshift:main Aug 6, 2026
10 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants