Repository navigation
Description
This was generated by AI during triage.
Agent Brief
Category: bug
Summary: A Security review whose private report is malformed fails as "session failed, ended early or omitted a valid final line". The real cause is hidden. agy regularly writes the report with severity and fix_size one level too high.
Current behavior:
fareloch #129 (thirdshift 0.37.0, stephens.page, Security review on agy · gemini-4-hydrogen-xhigh) failed twice on 2026-11-19, at 02:49 and 03:40 EST, with:
Security review incomplete: session failed, ended early or omitted a valid final line; see Session trace
The session didn't fail. agy's final message ended with a valid line:
Security review: {"unaddressed_count":0,"findings":[],"pre_existing_count":4}
and its private report (security-reviews/129-…/pre-existing.json) held exactly 4 findings. Each of them had this shape:
{fingerprint, title, description, severity, fix_size, proof_of_concept: {test, command, head_exit_code, merge_base_exit_code, notes}}
OldFinding and ProofOfConcept in src/security/review.rs are deny_unknown_fields, and they expect severity and fix_size inside proof_of_concept. Deserialising fails, and Outcome::of maps that error, which is neither Incomplete, SafeguardRefusal nor SessionFailure, to the generic message. The Command log never shows the parse error.
The same message has come up repeatedly since agy took over Security reviews on 2026-11-15, and a plain retry sometimes passed. That fits a schema slip agy makes only some of the time.
Desired behavior:
- Name the real cause. A report that fails to parse or validate ends with a specific reason, for example "Security review's private report is invalid: unknown field
severityat finding 1", carried into the outcome and the Command log. The generic message stays only for a genuinely missing final line or a failed session. - Make the shape hard to get wrong. The prompt that asks for the report shows a complete example object with
severityandfix_sizeinsideproof_of_concept, so the nesting is unambiguous. If the Day shift prefers, the parser could instead accept these two fields at the finding's top level when they are absent fromproof_of_concept, still rejecting conflicts and unknown fields. Pick one approach and keep the schema in one place.
Key interfaces:
OldFinding,ProofOfConcept,OldFinding::reproductionandOutcome::ofinsrc/security/review.rs.- The Security review prompt text in
src/prompt.rsthat describes the private report and the final line.
Acceptance criteria:
- A report whose findings carry
severity/fix_sizeat the top level produces an outcome naming the report and the offending field, not the generic message. If the lenient option is chosen instead, it is accepted and recorded correctly. - A missing or invalid final line still produces today's messages.
- The Security review prompt shows the full report shape with
severityandfix_sizeplaced as the parser expects. If prompts are regenerated,UPDATE_PROMPTS=1 cargo test prompts_pageis re-run. - Unit tests cover both shapes.
Out of scope:
- agy's 503 "No capacity" and quota errors, which are transient and routed.
Activity
Restrict invalid Security report errors to schema field names (#2298)
Update Security review tests for invalid report messages (#2298)
Name invalid Security review reports instead of generic failure (Jaco…
Address Spec review findings: name fields in report validation (Jacob…