Skip to content

feat: add /qualify AI qualification workflow#474

Open
myakove wants to merge 8 commits into
mainfrom
feature/qualify-workflow
Open

feat: add /qualify AI qualification workflow#474
myakove wants to merge 8 commits into
mainfrom
feature/qualify-workflow

Conversation

@myakove
Copy link
Copy Markdown
Collaborator

@myakove myakove commented May 6, 2026

Summary

Adds the /qualify AI qualification workflow — a fully automated end-to-end pipeline that takes a feature design doc or bug report and produces verified tests with cluster proof.

What's Included

Prompt Template

  • llm/qualify/prompts/qualify.md — Main /qualify command that orchestrates all 4 phases

Agents

  • llm/qualify/agents/test-planner.md — Reads feature/bug docs → produces structured test plans
  • llm/qualify/agents/cluster-verifier.md — Independently verifies OpenShift cluster state after test execution

Skill

  • llm/qualify/skills/proof-generator/SKILL.md — Assembles proof.md reports with test results + cluster evidence

Templates

  • llm/qualify/templates/test-plan-template.md — Test plan skeleton
  • llm/qualify/templates/proof-template.md — Proof report skeleton

Documentation

  • llm/qualify/README.md — Full usage guide with setup instructions for pi, Claude Code, Cursor, and other AI CLIs
  • llm/qualify/workflow-diagrams.md — Mermaid flowcharts (workflow, components, sequence diagram)

Workflow Overview

/qualify --type feature --source <url> --cluster ~/kubeconfig
  1. Phase 0: Parse args, validate cluster, collect versions (OCP/MTV/CNV)
  2. Phase 1: AI reads source → produces test plan → human reviews
  3. Phase 2: AI writes tests → runs on real cluster → cluster-verifier independently validates
  4. Phase 3: 3 parallel code reviewers → pre-commit → PR
  5. Phase 4: Generates self-contained proof.md with verdict (QUALIFIED / NOT QUALIFIED / BUG FIXED / BUG NOT FIXED)

Human Checkpoints

  • Test plan review (Phase 1)
  • Bug: permanent test or verify-only? (Phase 0)
  • AI stuck after 3 retries (Phase 2)
  • PR review (Phase 3)

Do NOT auto-merge. This needs human review.

Summary by CodeRabbit

  • New Features

    • Added a /qualify end-to-end qualification workflow to generate tests, run them on a real cluster when explicitly invoked, perform independent cluster-state verification, and produce a self-contained qualification proof.
  • Documentation

    • Added comprehensive docs, templates, prompts, agent/skill specs, workflow diagrams, and README guidance covering planning, test-writing, verification, review, and proof generation.
  • Chores

    • Updated ignore rules to exclude qualification output artifacts.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds an AI-driven /qualify workflow: orchestration prompt, agent and skill specs (test-planner, cluster-verifier, proof-generator), templates, documentation, and a .qualify/ gitignore/policy note for storing generated artifacts.

Changes

AI Qualification Workflow for MTV API Tests

Layer / File(s) Summary
Configuration and Policy
.gitignore, CLAUDE.md
Adds .qualify/ to .gitignore and documents that /qualify may run pytest on a real cluster when explicitly invoked with cluster credentials (pointer to llm/qualify/README.md).
Documentation Overview
README.md, llm/qualify/README.md
Adds the /qualify command overview, five-phase sequence, CLI args (--type,--source,--cluster,--name), usage examples, human checkpoints, AI-CLI setup instructions, expected directory structure, outputs, and prerequisites.
Workflow Architecture
llm/qualify/workflow-diagrams.md
Adds detailed Mermaid diagrams and sequence flows describing Phases 0–4, bug verify-only branching, component relationships, and key takeaways.
Main Orchestration Prompt
llm/qualify/prompts/qualify.md
Defines Phase 0 (arg parsing, cluster validation, version collection), Phase 1 (test-plan generation with human approval), Phase 2 (test writing, pytest execution, cluster verification with retry loop and verify-only path), Phase 3 (code review, pre-commit, PR creation), Phase 4 (proof assembly and verdict), and critical gating rules.
Test Planner Agent
llm/qualify/agents/test-planner.md
Specifies Phase 1 agent: required inputs/prereqs, exact test-plan.md structure (overview, scenarios, step→test mappings, expected outcomes, verification points, VM config, tests_params, pytest markers), quality checklist, and output behavior.
Templates
llm/qualify/templates/test-plan-template.md, llm/qualify/templates/proof-template.md
Adds Markdown templates for test-plan and proof reports: placeholders for metadata, prerequisites, scenarios, test configuration (tests_params), pytest marker guidance, test result tables with full output blocks, cluster verification evidence sections, and risk assessment.
Cluster Verifier Agent
llm/qualify/agents/cluster-verifier.md
Specifies independent oc-based verification: connectivity gating (oc whoami/oc cluster-info), mandatory version capture (OCP/MTV/CNV), migration verification checklist (VM readiness, disks/DVs/PVCs, networks, StorageMap/NetworkMap, Plans/Migrations), per-check evidence capture rules, structured Markdown report, bug verification mode (BUG FIXED / BUG NOT FIXED), and failure handling.
Proof Generator Skill
llm/qualify/skills/proof-generator/SKILL.md
Defines exact proof.md template and rules: Summary, Environment (versions), Test Execution Results (collapsible pytest output), Cluster Verification (verification table + raw evidence), Qualification Decision/verdict wording, evidence redaction rules, and output path conventions.
Orchestration: Write & Verify
llm/qualify/prompts/qualify.md
Describes delegation to test writers, running pytest on a real cluster (permanent test vs verify-only), logging pytest outputs, invoking cluster-verifier, retry/escalation loops, and branch to PR creation only for permanent tests.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Orchestrator
  participant TestPlannerAgent
  participant PythonWriter
  participant RealCluster
  participant ClusterVerifier
  participant ProofGenerator
  participant Git
  User->>Orchestrator: invoke /qualify --type --source [--cluster]
  Orchestrator->>TestPlannerAgent: generate test-plan.md from source
  Orchestrator->>User: request human approval of test-plan.md
  Orchestrator->>PythonWriter: write tests & config (branch for permanent tests)
  PythonWriter->>RealCluster: run pytest (capture output -> test-output.log)
  RealCluster-->>Orchestrator: pytest stdout/stderr + exit code
  Orchestrator->>ClusterVerifier: run independent cluster verification
  ClusterVerifier-->>Orchestrator: cluster verification report
  Orchestrator->>ProofGenerator: assemble proof.md (tests + verification + versions)
  Orchestrator->>Git: create PR (permanent-test path) with proof reference
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: introduction of a /qualify AI qualification workflow for automated test generation and cluster verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/qualify-workflow

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@rh-bot-1
Copy link
Copy Markdown

rh-bot-1 commented May 6, 2026

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. Status Checks: All required status checks must pass
  3. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  4. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • solenoci

Reviewers:

  • krcmarik
  • myakove
  • solenoci
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (claude/claude-opus-4-6[1m])
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])
  • Test Oracle: Triggers: approved (cursor/gpt-5.4-xhigh-fast); /test-oracle can be used anytime

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@rh-bot-1
Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (e42aac5).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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 `@llm/qualify/agents/cluster-verifier.md`:
- Around line 146-150: Add mandatory redaction rules to the evidence collection
section that currently instructs to store "The full output" and raw evidence
into proof.md: update the cluster-verifier.md checklist to require automatic
redaction before persisting raw logs (e.g., mask secrets, API keys, tokens,
emails, IPs, and YAML anchors), provide a short canonical redaction policy and
example regex patterns, and add a one-liner command or reference to the
redaction utility to run prior to saving evidence so any step that calls out
"The full output" or writes to proof.md enforces redaction.
- Line 35: The document currently has contradictory failure semantics ("stop
immediately" vs "continue checking other items"); update the verification
guidance to clearly distinguish connectivity/authentication failures from
individual check failures: state that failure of any cluster-level connectivity
or authentication check (the sentence currently saying "stop immediately") must
abort the entire verification and report no-trust, whereas non-connectivity
per-check failures should be logged and verification should continue to collect
all failures (the area currently saying "continue checking other items"); change
the two conflicting sentences so the first explicitly names
"connectivity/authentication checks" as abort conditions and the later paragraph
(around the per-check rules) explicitly documents that per-check failures do not
abort but are aggregated as partial failures, and ensure the same clarified rule
text replaces the existing lines referenced in the doc.

In `@llm/qualify/prompts/qualify.md`:
- Around line 136-139: The doc has a conflict between the temporary test
location and the verify-only execution command: update the verify-only example
to run pytest directly against the temporary test file path
(/tmp/qualify-<name>/<test_file>.py) instead of using the repo test selector
(tests/<path>::<TestClass>); change the command shown (the "uv run pytest ..."
example) to point to /tmp/qualify-<name>/<test_file>.py, keep the same pytest
flags (--tc-file, --tc-format, -p no:xdist), and continue piping output to
.qualify/<type>/<name>/test-output.log so verify-only remains isolated from repo
state.

In `@llm/qualify/skills/proof-generator/SKILL.md`:
- Around line 130-132: Update SKILL.md's evidence policy for proof.md so raw
YAML/logs are required to be sanitized before inclusion: change the bullet that
mandates raw evidence in collapsible <details> to require "sanitized, redacted
evidence" and add a short checklist in SKILL.md/proof.md that instructs
redacting secrets/PII (API keys, tokens, passwords, private IPs, certs),
replacing values with placeholders like <REDACTED> and documenting what was
removed; ensure the collapsible details still include enough context (file
names, non-sensitive fields, and diffs) and add a statement on how to mark
omitted sections (e.g., "[…redacted…]") so reviewers know evidence was
intentionally redacted.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: b340adfa-9cf1-4110-860e-e91ae4f91673

📥 Commits

Reviewing files that changed from the base of the PR and between 922e9a8 and 077b62d.

📒 Files selected for processing (15)
  • .gitignore
  • CLAUDE.md
  • README.md
  • llm/qualify/README.md
  • llm/qualify/agents/.gitkeep
  • llm/qualify/agents/cluster-verifier.md
  • llm/qualify/agents/test-planner.md
  • llm/qualify/prompts/.gitkeep
  • llm/qualify/prompts/qualify.md
  • llm/qualify/skills/proof-generator/.gitkeep
  • llm/qualify/skills/proof-generator/SKILL.md
  • llm/qualify/templates/.gitkeep
  • llm/qualify/templates/proof-template.md
  • llm/qualify/templates/test-plan-template.md
  • llm/qualify/workflow-diagrams.md

Comment thread llm/qualify/agents/cluster-verifier.md Outdated
Comment thread llm/qualify/agents/cluster-verifier.md Outdated
Comment thread llm/qualify/prompts/qualify.md
Comment thread llm/qualify/skills/proof-generator/SKILL.md
myakove added 4 commits May 11, 2026 11:19
Full qualification workflow: test plan → write tests → verify on cluster → PR with proof.

Components:
- /qualify prompt template (orchestrator)
- test-planner agent (reads feature/bug docs → test plans)
- cluster-verifier agent (independent cluster state verification)
- proof-generator skill (assembles proof.md reports)
- Templates for test plans and proof reports
- Clarify failure semantics in cluster-verifier agent
- Add redaction rules to proof-generator skill
- Fix verify-only path in qualify prompt
@myakove
Copy link
Copy Markdown
Collaborator Author

myakove commented May 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@llm/qualify/prompts/qualify.md`:
- Around line 42-53: After the "Collect environment versions" block in
qualify.md, add explicit failure-handling instructions: if any of the three oc
commands (OCP, MTV, CNV) fail (missing CSV/namespace or RBAC denied), record
that specific version as `UNKNOWN` and capture the command's error message;
state that the proof report will include these `UNKNOWN` entries and that
missing versions will cause proof-generator/SKILL.md's qualification logic to
mark the report NOT QUALIFIED, mirroring the behavior described in
cluster-verifier.md.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: b19bc28d-78cd-4c42-8328-1589dd033318

📥 Commits

Reviewing files that changed from the base of the PR and between 077b62d and 6453247.

📒 Files selected for processing (3)
  • llm/qualify/agents/cluster-verifier.md
  • llm/qualify/prompts/qualify.md
  • llm/qualify/skills/proof-generator/SKILL.md

Comment thread llm/qualify/prompts/qualify.md Outdated
@myakove
Copy link
Copy Markdown
Collaborator Author

myakove commented May 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (3)
llm/qualify/prompts/qualify.md (2)

65-67: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Bug artifact directory placeholder is inconsistent (<name> vs canonical bug identifier).

This can desynchronize artifact paths between prompt execution and README/consumers expecting .qualify/bugs/<id>/....

Suggested doc patch
-  - Bug: `.qualify/bugs/<name>/`
+  - Bug: `.qualify/bugs/<id>/`
🤖 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 `@llm/qualify/prompts/qualify.md` around lines 65 - 67, Update the bug artifact
directory placeholder so it uses the canonical bug identifier instead of a
generic <name>; change occurrences of ".qualify/bugs/<name>/" to
".qualify/bugs/<id>/" in the qualify.md prompt documentation (keep
".qualify/features/<name>/" as-is if features use names) so artifact paths match
README/consumers expecting .qualify/bugs/<id>/...

56-63: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Version collection commands can terminate the flow before UNKNOWN fallback is applied.

Plain ... | grep ... can exit non-zero on no match, which contradicts the “record as UNKNOWN with error message” behavior.

Suggested doc patch
-oc get csv -n openshift-mtv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep mtv
+oc get csv -n openshift-mtv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep mtv || true

-oc get csv -n openshift-cnv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep kubevirt
+oc get csv -n openshift-cnv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep kubevirt || true
#!/bin/bash
# Verify current prompt uses fatal grep pipelines for MTV/CNV collection.
rg -n 'openshift-mtv|openshift-cnv|grep mtv|grep kubevirt|UNKNOWN' llm/qualify/prompts/qualify.md
🤖 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 `@llm/qualify/prompts/qualify.md` around lines 56 - 63, The grep pipelines in
the version-collection snippets (the lines containing "oc get csv -n
openshift-mtv ... | grep mtv" and "oc get csv -n openshift-cnv ... | grep
kubevirt") can return a non-zero exit and abort scripts; change these snippets
so the pipeline never causes a fatal exit and instead captures grep failure
output and sets the version to "UNKNOWN" with the error message; implement this
by making the grep step non-fatal (e.g., allow the pipeline to continue on
no-match), detect grep's exit status or stderr, and explicitly emit the
"UNKNOWN: <error message>" fallback in the snippet so the documented behavior
("record it as UNKNOWN with the error message") always occurs.
llm/qualify/agents/cluster-verifier.md (1)

46-53: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: UNKNOWN with error message is not operationally satisfiable with current version commands.

grep ... || true prevents hard failure, but it also drops the signal needed to reliably capture why the version was missing. This can produce silent UNKNOWN without actionable diagnostics.

Suggested doc patch
-oc get csv -n openshift-mtv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep mtv || true
+MTV_VERSION_RAW="$(oc get csv -n openshift-mtv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' 2>&1)"
+MTV_VERSION="$(printf '%s\n' "$MTV_VERSION_RAW" | grep mtv || true)"
+# if empty -> record: UNKNOWN: <MTV_VERSION_RAW or "no CSV match">

-oc get csv -n openshift-cnv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' | grep kubevirt || true
+CNV_VERSION_RAW="$(oc get csv -n openshift-cnv -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.version}{"\n"}{end}' 2>&1)"
+CNV_VERSION="$(printf '%s\n' "$CNV_VERSION_RAW" | grep kubevirt || true)"
+# if empty -> record: UNKNOWN: <CNV_VERSION_RAW or "no CSV match">
#!/bin/bash
# Verify that current doc suppresses grep failures but does not define error-capture variables.
rg -n 'grep (mtv|kubevirt) \|\| true|UNKNOWN.*error message|_RAW=|2>&1' llm/qualify/agents/cluster-verifier.md
🤖 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 `@llm/qualify/agents/cluster-verifier.md` around lines 46 - 53, The current
shell snippets use "grep ... || true" which hides failures and prevents
capturing why a CSV/version lookup failed; modify the commands that run "oc get
csv -n openshift-mtv ..." and "oc get csv -n openshift-cnv ..." to capture both
stdout and stderr into variables (e.g., MTV_RAW and CNV_RAW), check the command
exit status, and if non-zero set the version variable to "UNKNOWN" while storing
the stderr/error message (e.g., MTV_ERROR or CNV_ERROR) for diagnostic output;
remove the "|| true" pattern, use command substitution with redirection
(cmd_output=$(oc ... 2>&1) && parse || { VERSION=UNKNOWN; ERROR="$cmd_output";
}) and ensure subsequent docs/logs print VERSION and ERROR when VERSION is
UNKNOWN.
🤖 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 `@llm/qualify/prompts/qualify.md`:
- Around line 3-25: The prompt currently treats `--cluster` as optional (see
`argument-hint` and "Phase 0: Parse Arguments & Setup") which conflicts with the
safety contract; update the prompt to require `--cluster` explicitly and to fail
fast when it is not provided: change the `argument-hint` text to mark
`--cluster` as REQUIRED and modify the Phase 0 parsing step to validate presence
of `--cluster` (or error/exit immediately with a clear message) so the
orchestrator will not proceed without an explicit kubeconfig path.

In `@llm/qualify/README.md`:
- Around line 45-47: Update the example CLI invocation in the README to include
the required --cluster argument so it matches the required-arguments table;
specifically modify the example line that currently reads "/qualify --type bug
--source https://issues.redhat.com/browse/MTV-5678 --name MTV-5678" to include a
placeholder cluster flag (e.g., --cluster <cluster-name>) so callers know to
supply the cluster when running the qualify command.

In `@llm/qualify/skills/proof-generator/SKILL.md`:
- Around line 166-169: Update the inconsistent bug proof path in SKILL.md:
replace the `.qualify/bugs/<bug-name-or-id>/proof.md` placeholder with the
canonical placeholder used elsewhere (e.g., `.qualify/bugs/<bug-name>/proof.md`)
so tooling and docs are consistent; edit the string in the SKILL.md content
where the proof path is documented to match the
`.qualify/features/<feature-name>/proof.md` style and ensure the directory
guidance line references `.qualify/bugs/<bug-name>/proof.md`.

---

Duplicate comments:
In `@llm/qualify/agents/cluster-verifier.md`:
- Around line 46-53: The current shell snippets use "grep ... || true" which
hides failures and prevents capturing why a CSV/version lookup failed; modify
the commands that run "oc get csv -n openshift-mtv ..." and "oc get csv -n
openshift-cnv ..." to capture both stdout and stderr into variables (e.g.,
MTV_RAW and CNV_RAW), check the command exit status, and if non-zero set the
version variable to "UNKNOWN" while storing the stderr/error message (e.g.,
MTV_ERROR or CNV_ERROR) for diagnostic output; remove the "|| true" pattern, use
command substitution with redirection (cmd_output=$(oc ... 2>&1) && parse || {
VERSION=UNKNOWN; ERROR="$cmd_output"; }) and ensure subsequent docs/logs print
VERSION and ERROR when VERSION is UNKNOWN.

In `@llm/qualify/prompts/qualify.md`:
- Around line 65-67: Update the bug artifact directory placeholder so it uses
the canonical bug identifier instead of a generic <name>; change occurrences of
".qualify/bugs/<name>/" to ".qualify/bugs/<id>/" in the qualify.md prompt
documentation (keep ".qualify/features/<name>/" as-is if features use names) so
artifact paths match README/consumers expecting .qualify/bugs/<id>/...
- Around line 56-63: The grep pipelines in the version-collection snippets (the
lines containing "oc get csv -n openshift-mtv ... | grep mtv" and "oc get csv -n
openshift-cnv ... | grep kubevirt") can return a non-zero exit and abort
scripts; change these snippets so the pipeline never causes a fatal exit and
instead captures grep failure output and sets the version to "UNKNOWN" with the
error message; implement this by making the grep step non-fatal (e.g., allow the
pipeline to continue on no-match), detect grep's exit status or stderr, and
explicitly emit the "UNKNOWN: <error message>" fallback in the snippet so the
documented behavior ("record it as UNKNOWN with the error message") always
occurs.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: b906dcdc-ef1b-4880-8451-498ce03b5b78

📥 Commits

Reviewing files that changed from the base of the PR and between 82e124d and 58cae0b.

📒 Files selected for processing (7)
  • llm/qualify/README.md
  • llm/qualify/agents/cluster-verifier.md
  • llm/qualify/prompts/qualify.md
  • llm/qualify/skills/proof-generator/SKILL.md
  • llm/qualify/templates/proof-template.md
  • llm/qualify/templates/test-plan-template.md
  • llm/qualify/workflow-diagrams.md

Comment thread llm/qualify/prompts/qualify.md Outdated
Comment thread llm/qualify/README.md
Comment thread llm/qualify/skills/proof-generator/SKILL.md
- require --cluster, normalize placeholders, capture version errors
@myakove
Copy link
Copy Markdown
Collaborator Author

myakove commented May 11, 2026

@coderabbitai[bot]

The following review comments were reviewed and a decision was made:

llm/qualify/prompts/qualify.md:65 (duplicate) — HIGH: Bug artifact directory placeholder is inconsistent (<name> vs canonical bug identifier).

Addressed: Normalized bug artifact directory to .qualify/bugs/<id>/.

llm/qualify/prompts/qualify.md:56 (duplicate) — HIGH: Version collection commands can terminate the flow before UNKNOWN fallback is applied.

Addressed: Added || true to grep commands in qualify.md to prevent flow termination.

llm/qualify/agents/cluster-verifier.md:46 (duplicate) — HIGH: UNKNOWN with error message is not operationally satisfiable with current version commands.

Addressed: Replaced simple grep with error-capturing variables (MTV_VERSION_RAW/CNV_VERSION_RAW) to enable actionable UNKNOWN diagnostics.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Tip

For best results, initiate chat on the files or code changes.

@myakove — all three HIGH-severity fixes look well-targeted:

  1. .qualify/bugs/<id>/ — Using the canonical bug identifier (rather than a freeform <name>) prevents ambiguous artifact directories when the same bug is referenced by ID across phases. ✅

  2. || true on grep commands — Critical defensive fix. Without it, a grep that finds no match exits non-zero, which under set -e or pipefail would silently abort the version-collection block before the UNKNOWN fallback has a chance to run. ✅

  3. MTV_VERSION_RAW/CNV_VERSION_RAW capture variables — The previous approach of inline grep gave no diagnostic context when version retrieval failed. Capturing raw output into named variables lets the UNKNOWN fallback include the actual error message, making failures actionable instead of opaque. ✅


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@myakove
Copy link
Copy Markdown
Collaborator Author

myakove commented May 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@llm/qualify/agents/cluster-verifier.md`:
- Line 4: Update the agents docs to clarify tool-name mappings: in
llm/qualify/agents/cluster-verifier.md locate the tools declaration "tools:
read, bash" and add a short mapping section that shows equivalent tool names for
other AI CLIs (e.g., map "bash" to "execute" or "run_command" for pi and note
"bash" for Cursor/Claude), and include a generic note to adapt shell execution
tool names for other frameworks so readers can easily translate the example to
their CLI.

In `@llm/qualify/prompts/qualify.md`:
- Around line 49-62: Update the CSV-version capture to record stderr into a raw
variable and derive the filtered version from it: run the oc get csv commands
with stderr redirected (capture into MTV_VERSION_RAW and CNV_VERSION_RAW), then
set MTV_VERSION and CNV_VERSION by grepping those raw vars (e.g., printf '%s\n'
"$MTV_VERSION_RAW" | grep mtv || true), and when the grep yields empty record
"UNKNOWN: <raw output or 'no CSV match'>"; apply this pattern for both MTV and
CNV (replace the current direct pipe + "|| true" uses) so diagnostic stderr is
preserved for the proof report.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 652fb002-6616-4851-9268-559f63e42bf8

📥 Commits

Reviewing files that changed from the base of the PR and between 58cae0b and a20761e.

📒 Files selected for processing (4)
  • llm/qualify/README.md
  • llm/qualify/agents/cluster-verifier.md
  • llm/qualify/prompts/qualify.md
  • llm/qualify/skills/proof-generator/SKILL.md

Comment thread llm/qualify/agents/cluster-verifier.md
Comment thread llm/qualify/prompts/qualify.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants