fix(ploeg): only the worker says whether a Run delivered a pull request #199
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ryangr0/ploeg-worker-owns-delivery"
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?
Stacked on #188. The first commit here is #188's commit, and this PR's own change is the second commit (
abb2e2ea). Merge #188 first; after that, this PR shows only its own commit. First slice of VIK-1732 (handoff EXEC-02). Implements the worker side of ADR-0059, which is still proposed; see "Owner decisions" below.Problem
An agent could decide whether its Run delivered, and where:
outcome,links,checkpointandfailureReasonwhenever the adapter concluded nothing. OpenHands and the exec adapter returned the file as the whole report.resolveOutcomethen kept any valid structured outcome together with its own links. So a drop box with{"outcome":"pr_opened","links":[".../other/repo/pulls/123"]}reached ploegd as this Run's pull request;TestAWriterThatClaimsAPullRequestItNeverOpenedDeliversNothingreproduces this.pr_updated.Invariant
pr_opened,pr_updated,links,checkpoint,failureReason,verificationordelivery. The worker derives them from its own forge reads before and after the harness.Change
harness.MergeDropBoxkeeps only what the agent may report: findings, verdict, problem, solution, proposed Work Items, and a non-delivery outcome with its summary and stuck reason. OpenHands, the exec adapter and Claude Code now all read the drop box through it; ACP already did. A new conformance property,DeliveryClaimsNeverSurviveTheAdapter, checks all four adapters.pr_*claim becomes "no structured outcome", so the forge decides.head.repo.full_name, GitLabsource_project_id/target_project_id.failed/infra_node, before any key is minted or money spent. A reader keeps today's behaviour of warning and continuing.unknown, and a writer endsstuck(through #188's guard).deliveryfield on the outcome carries forge, repository, branch, number, URL, base,head,headBefore, andobserved(opened|updated|none|unknown) with a reason.outcomereport.v1gains it additively: ploegd's decoder is lenient, so older ploegd ignores it.docs/concepts/inside-a-run.mdand a dated note in ADR-0059 describe what is implemented.Owner decisions this PR takes provisionally (ADR-0059 is proposed)
infra_node, as the reviewer's fetch failure already does, not a newinfra_forge. A failed read after the harness isstuckwith no failure reason.Not in this slice (next slice of VIK-1732)
deliveryyet. It does not checkdeliveryagainst the claimed Work Item, does not store it, and does not read it inpullRequest(publication), the review watch orreadyForReview. A direct outcome API call with crafted links is therefore still trusted by ploegd.pr_updatedwithout a push. A clean exit on an already-open pull request is stillpr_updatedeven when its head did not move. Fixing that needs ploegd to settle withdeliveryfirst, otherwise a uniform-plan item would settledonewith its pull request still open.Tests
MergeDropBoxandresolveOutcomehandling, ran these, then removed it again:TestAWriterThatClaimsAPullRequestItNeverOpenedDeliversNothing, a real ACP agent writing the exploit drop box. The old handling reportedpr_openedwith.../other/repo/pulls/123andfailureReason: budget.TestAnAgentCannotClaimDelivery, with 3 cases.TestMergeDropBox_DeliveryClaimsNeverSurvive.observedDeliveryin all 6 states, including a pull request replaced during the Rundeliverypr_openedclaim. Their fake agent now really pushes, and the fake forge lists the pull request.Commands (at
abb2e2ea, Go 1.27.1, Node 24.21.0)mise exec -- go test ./pkg/worker/... ./pkg/harness/... -count=1 -v: 281 passed, 0 failed, 2 skipped (TestLiveCanaries,TestLiveClaudeCodeIgnoresTargetHooksAndMCPServers, both opt-in live tests)mise exec -- go test ./... -count=1in apps/ploeg: 34 packages okmise run verify: all gates passed (vloer 7, demo-replay 1, vloer-extension 4, ploeg 7, brand 1, site 5, site-demo 1, helm 15, release 3, integration 1, docs 1)Refs VIK-1732
🤖 Generated with Claude Code
Pull request closed