Skip to content

fleet: grade released claims by target progress (#4980) - #5032

Merged
jakildev merged 1 commit into
masterfrom
codex/4980-dispatch-noop-progress
Nov 12, 2026
Merged

jakildev merged 1 commit into
masterfrom
codex/4980-dispatch-noop-progress

Conversation

@jakildev

Copy link
Copy Markdown
Owner

Summary

  • grade released claims with no target progress as noop using the paginated GitHub timeline
  • keep no-op dispatches in the target circuit-breaker count and fold them into lane empty-exit backoff
  • preserve explicit declines, open task/stack PR coverage, merge completion, and fail-closed unknown results
  • document the expanded completion contract and add hermetic unit, dispatcher, and health coverage

Test plan

  • bash scripts/fleet/tests/run_all.sh --only completion — 2 suites passed, 0 failed, 0 skipped
  • bash scripts/fleet/tests/run_all.sh --only fleet_health — 1 suite passed, 0 failed, 0 skipped
  • fleet-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 pass
  • claim-namespace mutation — deleting the exclusion makes the claim-only fixture return finished; 1 of 26 assertions fails
  • ruff check scripts/ — all checks passed
  • python3 scripts/lint_instruction_size.py --against origin/master — no introduced instruction-size offenders
  • python3 scripts/light-verify.py --if-changed — 0 of 40 changed paths in the trigger surface; not required

Acceptance evidence

Criterion Check run Observed
1. Claim-only timelines are noop; review, comment, non-claim label, push, and decline are distinguished python3 scripts/fleet/tests/test_fleet_completion.py; bash scripts/fleet/tests/test_dispatcher_completion.sh 26 unit tests and the dispatcher verdict fixtures pass, including every required progress event and foreign claim churn
2. Unreadable or truncated timelines are unknown bash scripts/fleet/tests/test_dispatcher_completion.sh both a failed timeline request and truncated JSON grade unknown
3. Five noops retain the counter; the sixth election parks; progress clears it bash scripts/fleet/tests/test_dispatcher_completion.sh the fixture observes counter 5, fleet:needs-human on election six, and counter removal after progress
4. Three noops stand the lane down bash scripts/fleet/tests/test_dispatcher_completion.sh worker__opus empty streak reaches 3 after the third noop
5. Task/stack open PR coverage and merge verdicts are unchanged bash scripts/fleet/tests/test_dispatcher_completion.sh task and stack targets with an open PR remain finished; all claimless merge cases pass
6. Positive and mutation controls fire fleet-positive-control scripts/fleet/tests/test_fleet_completion.py origin/master; claim-namespace mutation pre-change fails 10 of 26 assertions; deleting the exclusion fails the claim-only assertion

Plan departures

  • Current master also enumerates completion verdicts in docs/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 --paginate with per_page=100. Timeline JSON null represents a failed fetch so task/stack PR coverage can still finish while every released claim without coverage fails closed to unknown.

Open-PR overlap is clean and limited to documentation:

#5029 docs/agents/FLEET.md clean
VERDICT: overlap

Closes #4980

Authored by Codex (GPT-5 runtime).

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 jakildev added fleet:wip Work in progress — not ready for review fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend and removed fleet:wip Work in progress — not ready for review labels Nov 11, 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: 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_completion fetches the timeline even when the claim label is still standing (an abandoned verdict that never reads it). It is one extra guarded call per such exit; skipping it when the label is present would save it.
  • unknown now reaches ASSESS_LINE, so a gh-down exit logs verdict=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 grepping dispatcher.log.

Praise

  • Treating foreign claim-label flapping as non-progress, and the explicit per_page=100 plus --paginate, match the incident evidence in the issue (157 labeled / 151 unlabeled events on one PR).
  • Failing closed to unknown instead of noop on 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.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:reviewing-mac-pool-3 labels Nov 11, 2026
@jakildev
jakildev merged commit 64576b7 into master Nov 12, 2026
7 of 9 checks passed
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-codex Implementation last authored by Codex; route review to Claude 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: count a dispatch as finished only when its target shows progress, so no-op loops reach the circuit breaker

1 participant