Repository navigation
fleet: grade released claims by target progress (#4980) - #5032
Conversation
Use the paginated issue timeline to distinguish target progress from claim-label churn. Released claims that leave no progress now count as no-op exits instead of resetting both circuit breakers. Keep open task and stack PRs productive, preserve merge semantics, and fail closed when timeline data is unavailable.
jakildev
left a comment
There was a problem hiding this comment.
Review — fleet: grade released claims by target progress (#4980)
Verdict: approve
The change does what #4980 asks. A released claim whose timeline since dispatch holds only claim-label churn now grades noop. noop keeps the per-target dispatch counter and records a non-productive outcome, so it feeds both the 5-dispatch cap and the lane's empty-exit streak. finished still clears the counter. Unreadable timelines, declined, abandoned, and the task/stack open-PR arm behave as before or fail closed.
I read fleet_completion.py and the dispatcher arms in full, not just the hunks. I also ran the suites directly on the PR head (1d5266ab6):
test_fleet_completion.py: 26 tests, OK.test_dispatcher_completion.sh: 141 passed, 0 failed.test_fleet_health.py: 52 tests, OK (1 skipped).
I did not re-run fleet-positive-control or the claim-namespace mutation. Those are the author's reported evidence only.
CI: every check is green except fleet-tests, which was still pending when I read it. My verdict rests on the local runs above, not on that check.
Live timeline check. The main risk in this design is that one timestamp-less event anywhere in a timeline makes the whole timeline unknown, which silently switches noop off for that target. I fetched four real PR timelines through the same gh api --paginate ...?per_page=100 call: #3857 (334 events), #4914, #1636, #1001. Across all of them, every event carries one of the four timestamp fields the code reads, and gh --paginate returns one merged JSON array. So the fail-closed path does not fire on current data. Event types seen: labeled, unlabeled, commented, reviewed, committed, head_ref_force_pushed, cross-referenced, merged, closed, added_to_stack, renamed, ready_for_review, base_ref_changed, referenced.
Acceptance (issue #4980)
| # | Criterion | Status |
|---|---|---|
| 1 | Claim-only timeline grades noop; review, comment, non-claim label and push each grade finished; declined: grades declined |
Met. test_released_claim_with_only_claim_label_churn_is_noop covers all six claim namespaces. test_progress_event_since_dispatch_is_finished covers the progress events. The decline arm is unchanged and runs first. |
| 2 | Unreadable or truncated timeline grades unknown |
Met. The dispatcher test covers both a failed fetch and truncated JSON. The unit tests cover None and a timestamp-less event. |
| 3 | Five noops leave the counter at five, the sixth election parks, progress clears it, log shows verdict=noop outcome=no |
Met. T8b/T8c drive this through the real claim_target gate via the new --claim-target test arm. |
| 4 | Three noops stand the lane down | Met. T8c asserts the empty-exit streak file reaches 3 at the third noop. |
| 5 | task, stack and merge unchanged |
Met. The existing cases still pass, and a new stack-target open-PR case is added. Moving the open-PR check ahead of the claim-label check gives the same result either way. |
| 6 | Positive control and mutation | Reported by the author with counts (10 of 26 fail on the pre-change tree; 1 of 26 under the mutation). Not re-run here, and the claimed evidence is plausible against the diff. |
Nits (follow-up)
docs/agents/FLEET.md"How a launch ends": the rewrap replaced "Marker-vouched reviewing, resolving, and planning claims release on the first abandonment; they have no pane affinity or reservation to resume" with "marker-vouched mutation claims release on the first abandonment". The lane list and the reason for it are lost. Restore them in the next touch of that paragraph.assess_target_completionfetches the timeline even when the claim label is still standing (anabandonedverdict that never reads it). It is one extra guarded call per such exit; skipping it when the label is present would save it.unknownnow reachesASSESS_LINE, so a gh-down exit logsverdict=unknown, where it logged no verdict before. The outcome is still the marker-derived one, so this is only a log-line change; worth knowing when greppingdispatcher.log.
Praise
- Treating foreign claim-label flapping as non-progress, and the explicit
per_page=100plus--paginate, match the incident evidence in the issue (157 labeled / 151 unlabeled events on one PR). - Failing closed to
unknowninstead ofnoopon any missing timestamp is the right default for a verdict that parks work.
Escalation: none. Safe for merge.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.
Summary
noopusing the paginated GitHub timelineTest plan
bash scripts/fleet/tests/run_all.sh --only completion— 2 suites passed, 0 failed, 0 skippedbash scripts/fleet/tests/run_all.sh --only fleet_health— 1 suite passed, 0 failed, 0 skippedfleet-positive-control scripts/fleet/tests/test_fleet_completion.py origin/master— 10 of 26 assertions fail on the pre-change tree; 16 non-regression assertions passfinished; 1 of 26 assertions failsruff check scripts/— all checks passedpython3 scripts/lint_instruction_size.py --against origin/master— no introduced instruction-size offenderspython3 scripts/light-verify.py --if-changed— 0 of 40 changed paths in the trigger surface; not requiredAcceptance evidence
noop; review, comment, non-claim label, push, and decline are distinguishedpython3 scripts/fleet/tests/test_fleet_completion.py;bash scripts/fleet/tests/test_dispatcher_completion.shunknownbash scripts/fleet/tests/test_dispatcher_completion.shunknownbash scripts/fleet/tests/test_dispatcher_completion.shfleet:needs-humanon election six, and counter removal after progressbash scripts/fleet/tests/test_dispatcher_completion.shworker__opusempty streak reaches 3 after the third noopbash scripts/fleet/tests/test_dispatcher_completion.shfinished; all claimless merge cases passfleet-positive-control scripts/fleet/tests/test_fleet_completion.py origin/master; claim-namespace mutationPlan departures
masteralso enumerates completion verdicts indocs/agents/FLEET.md, so that canonical paragraph was updated alongside the planned runtime doc and module docstring.Notes for reviewer
The timeline request uses
gh api --paginatewithper_page=100. Timeline JSONnullrepresents a failed fetch so task/stack PR coverage can still finish while every released claim without coverage fails closed tounknown.Open-PR overlap is clean and limited to documentation:
Closes #4980
Authored by Codex (GPT-5 runtime).