fix(ploeg): fail a reviewer that cannot fetch the branch under review #158

Merged
ryangr0 merged 1 commit from ryangr0/ploeg-reviewer-fetch-failure into development 2026-10-03 00:28:54 +00:00 AGit
Owner

A reading Run treated every error fetching the Shift's branch as "no
branch under review yet" and reviewed the base branch instead. A network
outage, a 401 or a 5xx from the forge looked the same as a genuinely
absent branch, and the later pull request poll still linked the writer's
pull request, so an approval of the wrong checkout counted.

The worker now probes the branch with git ls-remote --exit-code, which
separates "the forge answered: no such branch" (exit 2) from every
transport or authentication failure, and bounds the probe and fetch with
a timeout. ploegd tells the worker whether the reader is pre-author: the
claim carries preAuthor when no writing Run precedes the reader's Round
in its Shift. Only a pre-author reader with a genuinely absent branch
reviews the base. A forge failure ends the Run failed/infra_node before
the harness starts; an absent branch after a writer ends it stuck. The
commit a reader checked out is recorded on its first checkpoint and on
the outcome's checkpoint (new optional commit field).

ploegd now tells the worker (new claim field preAuthor) whether a reader comes before any writing Round; only then may it review the base. Uses git ls-remote --exit-code to tell an absent branch (exit 2) from an unreachable forge. Adds an optional commit field to the checkpoint contract for the reviewed SHA (audit only, no migration). Deploy ploegd and workers together: a new worker against an old ploegd treats every reader as post-writer. A failed reader is not retried yet; that is VIK-1304. Conflicts lightly with the VIK-1737 PR in worker.go; whichever merges second needs a rebase.

Verified with mise run verify on the pinned toolchain (all gates passed).

Ticket: https://vikunja.webgrip.dev/tasks/1736

🤖 Generated with Claude Code

A reading Run treated every error fetching the Shift's branch as "no branch under review yet" and reviewed the base branch instead. A network outage, a 401 or a 5xx from the forge looked the same as a genuinely absent branch, and the later pull request poll still linked the writer's pull request, so an approval of the wrong checkout counted. The worker now probes the branch with `git ls-remote --exit-code`, which separates "the forge answered: no such branch" (exit 2) from every transport or authentication failure, and bounds the probe and fetch with a timeout. ploegd tells the worker whether the reader is pre-author: the claim carries preAuthor when no writing Run precedes the reader's Round in its Shift. Only a pre-author reader with a genuinely absent branch reviews the base. A forge failure ends the Run failed/infra_node before the harness starts; an absent branch after a writer ends it stuck. The commit a reader checked out is recorded on its first checkpoint and on the outcome's checkpoint (new optional `commit` field). ploegd now tells the worker (new claim field preAuthor) whether a reader comes before any writing Round; only then may it review the base. Uses git ls-remote --exit-code to tell an absent branch (exit 2) from an unreachable forge. Adds an optional commit field to the checkpoint contract for the reviewed SHA (audit only, no migration). Deploy ploegd and workers together: a new worker against an old ploegd treats every reader as post-writer. A failed reader is not retried yet; that is VIK-1304. Conflicts lightly with the VIK-1737 PR in worker.go; whichever merges second needs a rebase. Verified with `mise run verify` on the pinned toolchain (all gates passed). Ticket: https://vikunja.webgrip.dev/tasks/1736 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ploeg): fail a reviewer that cannot fetch the branch under review
Some checks failed
[Workflow] On Pull Request / release-policy (pull_request) Failing after 43s
[Workflow] On Pull Request / checks (pull_request) Successful in 8m16s
[Workflow] On Pull Request / warnings (pull_request) Successful in 0s
1b0b544e1c
A reading Run treated every error fetching the Shift's branch as "no
branch under review yet" and reviewed the base branch instead. A network
outage, a 401 or a 5xx from the forge looked the same as a genuinely
absent branch, and the later pull request poll still linked the writer's
pull request, so an approval of the wrong checkout counted.

The worker now probes the branch with `git ls-remote --exit-code`, which
separates "the forge answered: no such branch" (exit 2) from every
transport or authentication failure, and bounds the probe and fetch with
a timeout. ploegd tells the worker whether the reader is pre-author: the
claim carries preAuthor when no writing Run precedes the reader's Round
in its Shift. Only a pre-author reader with a genuinely absent branch
reviews the base. A forge failure ends the Run failed/infra_node before
the harness starts; an absent branch after a writer ends it stuck. The
commit a reader checked out is recorded on its first checkpoint and on
the outcome's checkpoint (new optional `commit` field).

VIK-1736

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 merged commit 5bd8d1a11a into development 2026-10-03 00:28:54 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webgrip/unfold!158
No description provided.