Skip to content

OLS-3793 spec: remove verification retry mechanism, escalate on failure - #421

Open
onmete wants to merge 1 commit into
openshift:mainfrom
onmete:spec/OLS-3793-remove-verification-retries
Open

OLS-3793 spec: remove verification retry mechanism, escalate on failure#421
onmete wants to merge 1 commit into
openshift:mainfrom
onmete:spec/OLS-3793-remove-verification-retries

Conversation

@onmete

@onmete onmete commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Spec-only change, pre-push reviewed.

Verification failure now leads directly to escalation instead of re-executing remediation. Removes maxAttempts from ApprovalPolicy and AgenticRunApproval, removes retryIndex from result CRs, simplifies phase derivation logic. Convergence-dependent checks are handled within the verification agent prompt.

Changes:

  • run-lifecycle.md: Rewrite rules 7–8 (verification failure → escalation, no retries), simplify Verified=False derivation
  • approval.md: Remove rules 18–21 (maxAttempts), add single-execution-attempt rule, update CEL invariants and config surface
  • crd-api.md: Remove retryCount, retryIndex, maxAttempts from CRD field descriptions
  • audit-logging.md: Remove retry events section and retry_count attribute
  • sandbox-execution.md: Remove retryIndex rule, simplify execution timeout rule

Related: OLS-3781, OLS-3793

Made with Cursor

Verification failure now leads directly to escalation instead of
re-executing remediation. Removes maxAttempts from ApprovalPolicy and
AgenticRunApproval, removes retryIndex from result CRs, simplifies
phase derivation. Convergence-dependent checks are handled within
the verification agent prompt.

Related: OLS-3781, OLS-3793
Co-authored-by: Cursor <cursoragent@cursor.com>
@onmete onmete added the kind/design Categorizes issue or PR as related to design. label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Behavior Changes

    • Analysis execution now runs once per iteration.
    • Verification failures proceed directly to escalation instead of retrying execution.
    • Escalation summaries include the relevant execution and verification results.
    • Execution timeouts now fail the run immediately.
  • Configuration

    • Retry and attempt-limit settings are no longer supported.
  • Audit Logging

    • Verification completion events are recorded whenever verification results are created, including failed verifications.
    • Retry-specific audit details have been removed.

Walkthrough

The specifications remove retry and attempt configuration. Execution runs once per analysis iteration. Verification failure sets failure state and enters escalation. Audit logging records verification completion for every created VerificationResult CR.

Changes

Execution lifecycle changes

Layer / File(s) Summary
Approval and CRD contracts
.ai/spec/what/approval.md, .ai/spec/what/crd-api.md
Approval rules define execution-option trimming, single-attempt execution, escalation approval, and agent overrides. CRD documentation removes maxAttempts, retryIndex, and execution retry counters.
Execution and escalation lifecycle
.ai/spec/what/run-lifecycle.md, .ai/spec/what/sandbox-execution.md
Execution runs once per analysis iteration. Verification failure enters escalation without re-execution. Timeout handling still causes immediate run failure.
Verification audit events
.ai/spec/what/audit-logging.md
Retry traces and retry attributes are removed. agenticrun.verification.completed is emitted when any VerificationResult CR is created.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the removal of verification retries and direct escalation on failure.
Description check ✅ Passed The description directly explains the spec changes, removed retry fields, lifecycle updates, and related objectives.
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.

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

@openshift-ci
openshift-ci Bot requested review from harche and xrajesh August 6, 2026 09:43
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onmete for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

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

Actionable comments posted: 3

🤖 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 @.ai/spec/what/audit-logging.md:
- Line 44: Update the agenticrun.verification.completed emission described in
the audit-logging table to occur only when the operator first observes
VerificationResult status Completed=True, rather than when the
VerificationResult CR is created. Include both successful and failed completed
results, and ensure the event payload contains the fully populated status and
does not represent an in-progress verification.

In @.ai/spec/what/run-lifecycle.md:
- Line 23: Update the phase-derivation rule for Verified=False to remove the
obsolete dedicated retrying-execution exception; state that it derives Failed
unless an earlier escalation or denial rule takes precedence, and update the
referenced Rule 16 wording consistently.

In @.ai/spec/what/sandbox-execution.md:
- Line 63: Align the removed retryIndex contract across both specifications: in
.ai/spec/what/sandbox-execution.md lines 63-63, remove retryIndex from Rule 7a
line 14; in .ai/spec/what/crd-api.md lines 31-39, retain its removal and update
the execution and verification result-template definitions so neither requires
retryIndex.
🪄 Autofix

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: 50882a2b-c54d-4061-b4c0-69f42a1586cf

📥 Commits

Reviewing files that changed from the base of the PR and between dd9bf29 and 93c5c7f.

📒 Files selected for processing (5)
  • .ai/spec/what/approval.md
  • .ai/spec/what/audit-logging.md
  • .ai/spec/what/crd-api.md
  • .ai/spec/what/run-lifecycle.md
  • .ai/spec/what/sandbox-execution.md
🔗 Linked repositories identified

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

  • openshift/lightspeed-agentic-sandbox (manual)

| `agenticrun.execution.completed` | `agenticrun.execute` | ExecutionResult CR created | `result.name`, `result.uid`, `actions_taken.count` + full ExecutionResult CR serialization |
| `agenticrun.verification.completed` | `agenticrun.verify` | VerificationResult CR created, checks passed | `result.name`, `result.uid`, `checks.count` + full VerificationResult CR serialization |
| `agenticrun.verification.retry` | `agenticrun.verify` | Verification failed, retrying execution+verification | `result.name`, `retry_count`, `checks.count` + full VerificationResult CR serialization |
| `agenticrun.verification.completed` | `agenticrun.verify` | VerificationResult CR created | `result.name`, `result.uid`, `checks.count` + full VerificationResult CR serialization |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Emit verification completion after the Result CR is complete.

The rule triggers agenticrun.verification.completed when the VerificationResult CR is created. The sandbox creates the CR first and patches status in a second API call. Emit the event when the operator first observes Completed=True, including failed results, so the event contains the full status and does not label an in-progress verification as completed.

🤖 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 @.ai/spec/what/audit-logging.md at line 44, Update the
agenticrun.verification.completed emission described in the audit-logging table
to occur only when the operator first observes VerificationResult status
Completed=True, rather than when the VerificationResult CR is created. Include
both successful and failed completed results, and ensure the event payload
contains the fully populated status and does not represent an in-progress
verification.

- If `Verified` is `Unknown` → phase `Verifying`.
- If `Verified` is `False` AND reason indicates retrying execution → phase `Executing`.
- If `Verified` is `False` otherwise → phase `Failed`.
- If `Verified` is `False` → phase `Failed` (unless `Escalated` is set, which takes precedence per rule ordering).

Copy link
Copy Markdown

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

Remove the obsolete retry exception from phase derivation.

This change removes the retrying-execution phase. However, Rule 16, Line 51 still exempts a “dedicated retrying-execution reason” from the Failed phase. Delete that exception and state that Verified=False derives Failed unless an earlier escalation or denial rule takes precedence.

🤖 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 @.ai/spec/what/run-lifecycle.md at line 23, Update the phase-derivation rule
for Verified=False to remove the obsolete dedicated retrying-execution
exception; state that it derives Failed unless an earlier escalation or denial
rule takes precedence, and update the referenced Rule 16 wording consistently.

25. **Finalizers**: Non-deleted runs MUST gain a cleanup finalizer before leaving non-terminal phases so deletion can run RBAC and sandbox release hooks safely.
26. **[OLS-3066] Result CR writes**: Result CRs are created by the **sandbox** (not the operator) via `oc` — see rules 7a and 8. The operator's role is to (a) pre-compute the result template in the input ConfigMap, and (b) process the Result CR after the sandbox creates it. The Result CR retains the same shape: immutable spec, owner reference to the `AgenticRun`, started/completed conditions in status, embedded outcome payload, sandbox reference, and optional `failureReason` for system errors. Console field paths on Result CR `.status` are unchanged.
27. **Retry index**: `ExecutionResult` and `VerificationResult` MUST record the current execution retry index in spec for correlation with `status.steps.execution.retryCount`.
27. [REMOVED] `retryIndex` on `ExecutionResult` and `VerificationResult` has been removed. Execution runs exactly once per analysis iteration; verification failure escalates directly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Align the removed retryIndex contract across the specifications.

The CRD contract removes retryIndex, but the sandbox result-template rule still requires it.

  • .ai/spec/what/sandbox-execution.md#L63-L63: remove retryIndex from Rule 7a, Line 14.
  • .ai/spec/what/crd-api.md#L31-L39: retain the removal and align the execution and verification result-template definitions with it.
📍 Affects 2 files
  • .ai/spec/what/sandbox-execution.md#L63-L63 (this comment)
  • .ai/spec/what/crd-api.md#L31-L39
🤖 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 @.ai/spec/what/sandbox-execution.md at line 63, Align the removed retryIndex
contract across both specifications: in .ai/spec/what/sandbox-execution.md lines
63-63, remove retryIndex from Rule 7a line 14; in .ai/spec/what/crd-api.md lines
31-39, retain its removal and update the execution and verification
result-template definitions so neither requires retryIndex.

@onmete

onmete commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/design Categorizes issue or PR as related to design.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant