Skip to content

fix(xtask): require terminal agent-eval verification (#16292) - #16294

Draft
EffortlessSteven wants to merge 1 commit into
mainfrom
fix/16292-agent-eval-terminal-verify
Draft

EffortlessSteven wants to merge 1 commit into
mainfrom
fix/16292-agent-eval-terminal-verify

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Make the deterministic agent evaluator read the final report line when scoring loop closure. A successful line earlier in the report cannot override a later refusal, unrecognized line or blank line. Both documented completion states still count on the final line.

Swarm / Source Boundary

  • Follow-up for a same-repo swarm PR.

Source-of-truth Links

Proposal: none
Spec: RIPR-SPEC-0147 and the Agent Quickstart
ADR: none
Plan item: Deterministic evaluator follow-up to #14298 and #15322.
Governing issue or accepted claim: Closes #16292.
Acceptance delta (one sentence): Count verification completion only when a documented completion record starts the final report line and the existing exit and gap conditions hold.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): fix/16292-agent-eval-terminal-verify
Stack parent or prerequisite PR (if any): none. #15322 is already in the base.
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): One candidate for #16292.

Scope

The change is in the evaluator's report-reading predicate. The exit and gap checks stay in the scoring caller. The producer, analyzer, score schema, evaluation scenarios, #15320 and the broader A/B program are outside this change.

  • One evaluator behavior
  • No support-tier impact

The contributor-only changelog entry is changelog.d/16292-agent-eval-terminal-verify.md.

Proof

Local source tree e6496b037a9abeb1a59a279c843c458ab1b81f19 matches candidate head 3c92bea842d66d6ca03da761c47053087cd438a5. Base is 69c74906e470cba42c9cf0a8f6809c3fe8aff7a8.

  • Rust 1.95.0: cargo test --locked -p xtask --bin xtask verify_requires_completion_on_the_last_report_line failed on the base implementation with the new test, at the earlier-completion/later-refusal assertion (exit 101).
  • Rust 1.95.0: cargo test --locked -p xtask --bin xtask reports::agent_eval::tests:: passed 13 tests on the candidate.
  • Independent review of the source tree also challenged the last-known-record and trailing-whitespace-trimming alternatives. The regression rejected both.
  • Rust 1.95.0: cargo test --locked -p ripr --test cli_smoke verify_complete_with_limits:: passed both producer contract tests. Real ripr check --quiet --format agent calls emitted verify=complete|outcome=complete_with_findings|findings=1|exposed=1, verify=complete_with_limits|outcome=complete_with_findings|findings=1|exposed=0|limits=infection_unknown:1, and verify=refused|outcome=complete_with_findings|findings=1|exposed=0|reason=unexposed_findings_remain. Each was the final line followed by one newline, with exit 0.
  • Seven cases passed through the built xtask agent-eval --scenario boundary_threshold --skip-cargo scoring command. The reference loop closed for each real completion record. It stayed open after appending a refusal, an unknown record, ordinary text, or a blank line, and when the producer returned exit 7 with genuine successful stdout. The replay wrapped only the reference check, preserved the weak-test result, and checked schema ripr-agent-eval-v1.
  • cargo fmt --check, check-changelog-fragments, check-output-contracts, and offline check-pr-shape passed.
  • check-fast selected the two expected paths. Formatting, static-language, command-catalog, support-tier, no-panic and allow-attributes checks passed before I stopped the aggregate at its broader policy-test builds under the runner's 16 GiB memory ceiling. The aggregate has no pass result.
  • worktree doctor reported the one-commit base advance to 06fd39af8780cb18bf89effed806ec1f2dbc36b5. That commit leaves the evaluator, producer, and quickstart paths unchanged, and the local merge-tree check was clean. The candidate retains its tested base.
  • Independent source review is bound to the published head. The final conversation inventory contained no inline review threads. Hosted qualification is outside this Draft pass.

Qualification handoff

On 2026-11-26 GitHub published merge ref d626d03b9dc2c6551808a0b6cc1e36f334d99652, tree 706d081f868ea5c1486a8003f35cf15c4efd0d56, with first parent 06fd39af8780cb18bf89effed806ec1f2dbc36b5 and second parent 3c92bea842d66d6ca03da761c47053087cd438a5. Its delta against current main is exactly the evaluator and changelog. The base advance landed in #16288 and changes Rust oracle admission, analysis-cache identity, and dependent fixtures. The evaluator and producer contract sources are byte-identical to the reviewed head.

  • On the fetched composition and warm Rust 1.95.0 target, both cargo test --locked --offline -j 2 -p ripr --test cli_smoke verify_complete_with_limits:: tests and cargo test --locked --offline -j 2 -p ripr --test matches_or_pattern_strength passed. Seven scorer cases also passed using the newly built composed-tree producer and the retained evaluator executable whose source is unchanged. The earlier aggregate check-fast was outside this rerun.
  • The base change's qualification passed Rust gates, both hosted test shards, shard verification, and Ripr Rust Small Result. This Rust-only candidate reasonably expects green on the ordinary Rust route. Its actual hosted results are still pending qualification.
  • The exact-head source review remains current, and the latest inventory has no inline threads.
  • This session could not establish authorized native queue access. The read-only GitHub CLI GraphQL probe returned Forbidden and the browser showed a signed-out GitHub session. The PR stays Draft and the qualification request was withheld. Resume from a signed-in session authorized for the native queue, confirm the live head/base and threads, then proceed through Ready, merge-ready, exact-head qualification and protected enqueue.

Claim boundary

The failure was reproduced with a constructed report. No current mis-scored run has been established.

Rollback

Revert the candidate commit. The patch changes no score shape or persisted inputs.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 140 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 55e45229-8468-4a8d-beb3-365cc8064741
Commits

Reviewing files that changed from the base of the PR and between 06fd39a and 3c92bea.

Files selected for processing: 2

  • changelog.d/16292-agent-eval-terminal-verify.md
  • xtask/src/reports/agent_eval.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

An independent in-session reviewer fetched head 3c92bea842d66d6ca03da761c47053087cd438a5 and verified parent 69c74906e470cba42c9cf0a8f6809c3fe8aff7a8, tree e6496b037a9abeb1a59a279c843c458ab1b81f19, and both changed blobs against the audited candidate. No actionable findings.

The reviewer traced the quickstart, renderer and both scoring callers. With pinned Rust 1.95.0, an isolated harness used the committed formatter, parser and score conditions. It accepted both completion variants with LF and CRLF, refused a later refusal, unknown record, text, blank line or unterminated later line, and verified the existing nonzero/missing-exit and gap conditions. The committed test refused the old any-line parser and two alternatives that skip nonrecords or trim trailing whitespace. The harness uses synthetic verdicts passed into the formatter. The full evaluator test run independently passed all 13 focused tests.

The candidate changes only positioning in the evaluator and its regression coverage. Producer semantics and the score schema are preserved. Hosted qualification is outside this review.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request modifies the verify_complete function in xtask/src/reports/agent_eval.rs to require that the completion record is on the final line of the agent report before scoring the loop as closed. It also adds a comprehensive test suite to validate this behavior and includes a changelog entry. No review comments were provided, and there is no additional feedback.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY for head 3c92bea

Native Windows review of fix(xtask): require terminal agent-eval verification (#16292) at 3c92bea.

What changed

verify_complete in xtask/src/reports/agent_eval.rs changes from "any line starts with a completion record" to "the last line starts with one". A report that reaches verify=complete and then logs anything later (a refusal, an unrecognized record, even a trailing blank line) no longer reads as DONE.

Source review (verified against source)

  • The strictness matches the documented producer contract: the agent report renderer's module doc (crates/ripr/src/output/human/agent.rs:21) states "The last line is always verify=complete|...", and the agent protocol docs in init_agents.rs (lines 54-55 and siblings) require "its last line verify=complete|...". This PR closes a checker/producer contract drift where the checker was looser than the documented protocol.
  • Exact record names are still required (verify=complete|, verify=complete_with_limits|); a future verify=completed| variant does not read as DONE even on the last line.
  • CRLF handled: Rust lines() strips \r; the test pins {refused}\r\n{terminal}\r\n.
  • The new unit test is a proper discriminator: refuses-after-complete, unrecognized-after-complete, blank/space-after-complete, unterminated trailing text, empty report, bare verify=complete (no pipe), and the refused-only report — all negative; header-prefixed and CRLF forms positive.
  • The removed assertions moved out of the neighboring test into the dedicated one; changelog present.

Native proof

  • Native proof (native Windows, worktree wt-16294 at head 3c92bea): sections 16294 xtask verify_requires_completion => 1 passed; 0 failed across 43 test-binary result(s) (all exits 0).

Residuals

None blocking. The trailing-blank-line rejection is strict by design; the producer never emits one, and a hand-trimmed report failing closed is the safe direction for an eval gate.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-eval: require verification completion on the final report line

1 participant