Skip to content

fleet: reconcile closes an issue a merged PR delivered - #5232

Open
jakildev wants to merge 1 commit into
masterfrom
claude/5168-reconcile-close-delivered
Open

jakildev wants to merge 1 commit into
masterfrom
claude/5168-reconcile-close-delivered

Conversation

@jakildev

Copy link
Copy Markdown
Owner

Summary

fleet-claim reconcile --apply now closes a queued issue by itself (rule R13) when a worker declined it with --delivered-by <PR> and that merged PR is also the issue's branch match. Until now nothing closed it, so every PR parked on it and every issue blocked by it waited for a cued run. R13 re-reads the issue, the PR and the open PRs before its one close, posts one citing comment, and records the close so fleet-decisions lists it once.

The first --apply pass on the Mac after this merges will close four live issues: #4904 (PR #5103), #4960 (PR #5101), #5126 (PR #5127), #5204 (PR #5207). Report-only on this branch lists exactly those four.

Acceptance evidence

Criterion Check run Observed
1. Close case test_fleet_claim_reconcile_close_delivered.sh § 1 one issue close 6100 … --reason completed, then one comment with the PR, merge SHA, bare reason and residual #6300; one ledger line; a second pass adds nothing
2. No-close cases same suite, § 3 and § 4 every listed case: 0 closes, 0 comments, 0 ledger lines. Mutation check: each of 23 removed conditions turns the suite red
3. Window fallback same suite, § 5 row match absent: memory match equal to the decline's PR closes; another PR, or none, does not
4. Report-only same suite, § 2 finding printed; 0 closes, 0 comments, no ledger
5. Park release same suite, § 7 the Parked-until: #6100 PR gets one --remove-label fleet:awaiting-infra in the same pass
6. Decisions digest run_all.sh --only decisions passes; own heading with issue and PR, absent on the second run, game offset unmoved by --repo engine
7. Docs git grep -n -w R13 -- docs/agents/fleet-labels-reference.md scripts/fleet/fleet-claim; lint_instruction_size.py --against origin/master; run_all.sh --only survey both files hit; nothing under introduced:; survey passes; the ghost row and the survey ghost line name fleet-claim reconcile
8. Reconcile suites and positive control run_all.sh --only reconcile; fleet-positive-control … origin/master 9 of 9 suites pass; MEANINGFUL: 55 of 135 assertions fail at fa65f0004, the § 1 close case among them
Reviewer notes

Plan departures

  • The predicates and the apply arm are a new module, scripts/fleet/fleet_close_delivered.py (the R12 shape), not inline in fleet-claim; fleet_task_class.py needed no change.
  • A failed listing skips R13 for that repo, beside the plan's at-limit listing: reconcile reads a failed fetch as an empty list, which cannot show that no open PR resolves the issue.
  • fleet-decisions: the pending close-out's close: line now says it is for an issue R13 reports as not closed.

Notes for reviewer

  • The 80 assertions that pass on origin/master are the no-close cases, which a tree without R13 satisfies vacuously. The mutation check is their proof: it removes one condition at a time, and includes the two cases added after the first pass left them green (the classifier's label check, the live listing limit).
  • Write order and write failures: § 1 checks that the close precedes the comment, § 6 that a failed close writes nothing else and a failed comment is recorded and not retried.
  • Gated, for a human: .claude/skills/fleet-unblock/SKILL.md's description still says the skill "closes delivered ghost issues"; it is now the fallback.
  • fleet-pr-overlap: #5122 scripts/fleet/fleet-claim clean, VERDICT: overlap.

Closes #5168

🤖 Generated with Claude Code

Reconcile R13 closes a queued issue whose current worker decline names a
merged PR (`--delivered-by`) that is also the issue's branch match. It
re-reads the issue, the PR and the open PRs first, posts one citing
comment, and appends a ledger line that fleet-decisions lists once.

The close precedes the comment: a comment moves the issue's updatedAt
past the decline stamp, so a close that failed after it would never be
retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend labels Nov 23, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review — fleet: reconcile closes an issue a merged PR delivered

Verdict: approve

The close path is appropriately fail-closed: it verifies the snapshot candidate, repeats the live issue/PR/open-PR reads before writing, closes before commenting, and preserves the outcome in a per-host ledger.

Acceptance (issue #5168)

7 of 8 criteria were established from the implementation and focused suites. The aggregate reconcile-suite criterion is pending the current fleet-tests CI run; no completed check is being treated as green.

Checked

  • Read the complete PR and issue #5168 threads, the full changed R13 implementation, and its fleet-script context.
  • bash scripts/fleet/tests/test_fleet_claim_reconcile_close_delivered.sh — 135 passed, 0 failed.
  • bash scripts/fleet/tests/test_decisions.sh — 198 passed, 0 failed.
  • Current-head CI: completed linters and policy checks are successful; fleet-tests / all-checks are still in progress.

🤖 Reviewed by Codex (sonnet review class; review-pr skill)
Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:reviewing-mac-pool-2 labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fleet: close a delivered issue automatically once a merged PR shipped it and a worker has declined it as done

1 participant