fix(ploeg): read a writer's branch on the forge before it counts as no change or updated #188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ryangr0/ploeg-writer-branch-delivery-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #177 (merged), which replaced #159. Covers the EXEC-06 acceptance criteria #177 left open.
Problem
#177 compares a writer's checkout with its starting commit, but only when the Run resolves to
no_change_needed, and it trusts an empty pull request lookup. Still complete ondevelopment:pr_updatedwhile its edits or commits stay in the clone.no_change_neededand the Work Itemdone.Invariant
A writing Run ends
no_change_neededonly when the worker read the forge successfully, the Run's branch did not move on the forge, and the clone holds nothing the forge does not have. It endspr_updatedonly when the branch moved, or when the clone holds nothing unpublished (the case where nothing at all was pushed is left to VIK-1732 / ADR-0059). An unknown read never completes a Run.Change
git ls-remote).no_change_neededorpr_updated, it reads the branch again:stuck, "whether this Run pushed or opened a pull request is unknown";stuck, naming the branch and both heads;pr_updatedand the branch moved → unchanged;stuck, naming them.git statuslists counts as a change, so the repository's.gitignoredecides what is build output. This is tested both ways.pr_opened,failed,stuckand every reader are untouched. Usage and failure reasons keep their meaning.docs/concepts/inside-a-run.mdstep 8 describes the rule.No automatic push or pull request (EXEC-06 non-goal). The stuck reason names the paths and commits. The content itself is not saved off the pod.
Tests (worker + real ACP adapter + git-http-backend forge)
New: an edit-tool change, a commit on the base branch, a pushed branch without a pull request, local-only changes under an open pull request (3 variants), a real push to the open pull request (stays
pr_updated), a new pull request with a stray file (stayspr_opened), a failed forge read (2 variants), untracked output the repository does not ignore, a reader that leaves files (keeps its approval), and a harness failure or pod termination that also edited the checkout (keepsagent_error/infra_node). Usage cost from the ACP agent survives the conversion tostuck.Before the fix, 6 of these failed on #177's head (the
pr_updatedvariants, the forge-read variants, and the wrong reason for a pushed branch).TestOpenSpecWorkItem_WriterBriefedAndGatedis split. The gate still checks the pushed branch, and a fix left only in the working tree is now caught earlier as unpublished.Commands (at
7fc6f8d9, Go 1.27.1, Node 24.21.0)mise exec -- go test ./pkg/worker/ -count=1 -v: 154 top-level tests passed, 0 failedmise exec -- go test ./... -count=1in apps/ploeg: 34 packages ok, 0 failedmise run verify: all gates passed (vloer 7, demo-replay 1, vloer-extension 4, ploeg 7 incl. gofmt/vet/build/test/openspec, brand 1, site 5, site-demo 1, helm 15, release 3, integration 1, docs 1)Still open (tracked)
pr_updatedwhen nothing at all was pushed and the clone is clean; a failed pre-run pull request lookup (VIK-1732, ADR-0059).Refs VIK-1737
🤖 Generated with Claude Code