Files
werkrevisor/docs/prs/2026-10-23-PR#133-fold-only-own-results.md
claude-code 10932838c7
werkator build succeeded after 00:12
werkator/werkrevisor-statistics build succeeded after 00:32
werkator/release build succeeded after 00:18
werkrevisor 0.61.1: a new result folds only the earlier results of werkrevisor, not the Codex reviews (#133)
Co-authored-by: claude-code <claude-code@javagil.de>
2026-10-23 10:57:51 +02:00

57 lines
2.3 KiB
Markdown

# PR#133: A New Result Folds Only the Earlier Results of werkrevisor, Not the Codex Reviews
Version: patch
> **WARNING:** This document describes only the change applied in this PR.
> It may already be outdated once the next PR is merged.
> Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
## Problem
When werkrevisor posts the result for a new head, it folds the result comments of earlier heads.
It selects them by the account `ai-reviewer` and by a marker line `<!-- werkrevisor…-->`.
The Codex runner posts its result comments as the same account,
with the markers `<!-- werkrevisor-codex:<sha> -->` or `<!-- werkrevisor-codex-error:<sha> -->`.
So werkrevisor also folded the Codex comments of earlier heads,
and labelled them "⚠️ werkrevisor ERROR for `?`", e.g. the comments 7124 and 7142 of PR#132.
## Non-Goals
- The Codex runner does not fold its own earlier comments; it did not before either.
## Specification
### Feature: fold only the results of werkrevisor
#### Scenario#133.01: a Codex comment of an earlier head stays as it is
&hellip; so that a Codex review is not shown as a failed werkrevisor review.
- **Given** a Codex result comment of an earlier head, posted by the account of werkrevisor
- **When** werkrevisor posts the result for a new head
- **Then** the Codex comment is not changed
##### Verified by
- [test_line_comments.FoldTest.test_a_codex_comment_of_an_earlier_head_is_not_folded](../../tests/test_line_comments.py)
- [test_line_comments.FoldTest.test_folded_comment_keeps_its_markers](../../tests/test_line_comments.py)
## Solution
- `werkrevisor/report.py`: `fold` folds a comment only if it holds a marker line
`<!-- werkrevisor:<sha> -->` or `<!-- werkrevisor-error:<sha> -->`; else it returns `None`.
So the summary always names the head; the fallback `?` is gone.
The Codex runner does not fold its own comments, so no comment is folded twice.
- `tests/test_line_comments.py`: the new test failed before the fix with the edit of the Codex comment 3,
and `report.fold` returned the label "⚠️ werkrevisor ERROR for `?`" for a Codex comment.
- `docs/werkrevisor.werkbaum`: node `#model.codex.fold`.
- `werkrevisor/__init__.py` and `statistics/build.gradle.kts`: version 0.61.1.
## Open Questions
None.
## Follow-up PRs
- The Codex runner could fold its own comments of earlier heads.