Skip to content

Preserve integration concerns and diagnostics for large reviews - #425

Merged
Vilin97 merged 4 commits into
mainfrom
fix/review-integration-edges
Sep 12, 2026
Merged

Vilin97 merged 4 commits into
mainfrom
fix/review-integration-edges

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

Integration could report pass while retaining its own unresolved findings or questions. Treat those final concerns as obligations that prevent approval. Convert remaining input tokens to characters and validate the fully serialized follow-up input, including escaping and per-query metadata, when retrieving source, and let the input budget bound source-request lists instead of rejecting more than 20 requests.

Keep source reports in portion order in the completed evidence artifact. Checkpoint every completed model call and upload evidence even on failure, so malformed integration output does not lose the preceding source work.

Validation: all 374 Python tests pass; Ruff check/format and diff checks pass. Regressions cover final concerns, excerpt budget units, ordered source reports, 25-source-request retrieval, and incremental evidence persistence. This follows up on #424 and a source-request validation failure in the first #393 re-review.

@greptile-apps

greptile-apps Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

Retrigger

The PR is not yet safe to merge because model-directed source retrieval can perform unbounded full-diff work before enforcing the input budget.

Findings

  1. P1 Unbounded Source Retrieval ▶
  2. P2 Checkpoint Errors Abort Reviews ▶
  3. P2 Portion Results Stored Twice ▶
  4. P2 This changes the LLM review workflow’s artifact-upload condition and path. The repository directive prohibits changes to .github/workflows/ unless they were explicitly requested, so this requirement must be satisfied before merging. ▶

Summary

  • Final findings and questions now prevent an approving integration verdict without duplicating concrete findings.
  • Source-follow-up sizing accounts for serialized metadata and accepts request lists beyond the former fixed limit.
  • Completed model calls are retained in ordered evidence and uploaded even when a later review stage fails.
  • The current implementation still needs a work bound before source retrieval and best-effort handling for checkpoint I/O.

Reviews (3) · Last reviewed commit: "Fit serialized follow-up evidence and av..."

Comment thread python/lean_pool/review.py Outdated
Comment thread python/lean_pool/review_portions.py
Comment on lines +1211 to +1212
return replace(
final, portions=len(results), coverage=manifest, source_reviews=tuple(results)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Portion Results Stored Twice

source_reviews retains the same source-portion results that _ReviewSession.accounted already stores in requests. Since _write_review_evidence recursively serializes both fields, large portioned reviews keep and write every source-review payload twice, unnecessarily increasing memory use and evidence-artifact size.

@Vilin97 Vilin97 changed the title Preserve final integration concerns and use full excerpt budget Preserve integration concerns and diagnostics for large reviews Sep 12, 2026
Comment on lines +228 to +232
if: always() && steps.ci.outputs.conclusion == 'success'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: review-evidence
path: ${{ runner.temp }}/review-evidence.json
path: ${{ runner.temp }}/review-evidence*

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 This changes the LLM review workflow’s artifact-upload condition and path. The repository directive prohibits changes to .github/workflows/ unless they were explicitly requested, so this requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@Vilin97
Vilin97 merged commit fcadd3c into main Sep 12, 2026
8 checks passed
Comment on lines 1238 to 1244
queries = final.payload.get("source_requests", [])
if (
not isinstance(queries, list)
or len(queries) > 20
or any(not isinstance(query, str) or not query.strip() for query in queries)
if not isinstance(queries, list) or any(
not isinstance(query, str) or not query.strip() for query in queries
):
raise ValueError(
"Integration source requests must be at most 20 nonempty strings"
f"Integration source requests must be nonempty strings: {queries!r}"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Unbounded Source Retrieval

A model response with many source requests now passes validation. _fit_source_followups then scans the complete diff once for every request and allocates all excerpts before checking the candidate message against the input budget. A large request list can therefore exhaust review-worker CPU or memory and prevent the review from producing a verdict. Bound the retrieval work with the available budget before calling source_excerpts.

Knowledge Base Used: Fit oversized pull-request diffs to the review budget

Comment on lines +1302 to +1304
if destination := os.environ.get("REVIEW_EVIDENCE_PATH"):
with Path(destination).with_suffix(".calls.jsonl").open("a") as stream:
stream.write(json.dumps(asdict(result), default=vars) + "\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Checkpoint Errors Abort Reviews

If the artifact filesystem is full, unavailable, or misconfigured, this unguarded checkpoint write raises after the model call has succeeded. The filesystem error then aborts the entire review, so a best-effort diagnostic can discard a successful result and waste the completed model call. Handle checkpoint persistence failures separately from the review result.

Knowledge Base Used: Continuous integration and repository automation

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.

1 participant