Skip to content

fleet: track red master checks (#5170) - #5181

Merged
jakildev merged 3 commits into
masterfrom
claude/5170-master-red-tracking
Nov 19, 2026
Merged

jakildev merged 3 commits into
masterfrom
claude/5170-master-red-tracking

Conversation

@jakildev

@jakildev jakildev commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Red master workflows now open one durable, GitHub-backed incident and update it on later red and green transitions.
The new lane is prioritized ahead of ordinary tasks, inherited failures are attributed on every affected PR, and the decisions digest surfaces current incident state before the merge queue.

Acceptance evidence

Criterion Check run Observed
A first red creates exactly one tracker with the required labels and run, commit, job, and suite evidence. python3 scripts/fleet/tests/test_fleet_master_ci.py The first-red case created one tracker carrying all three labels, both markers, and the complete failure evidence.
A second red comments on the existing tracker exactly once. python3 scripts/fleet/tests/test_fleet_master_ci.py A new run id produced one comment and no create.
Seeing the same run twice is idempotent, including runs already recorded on a closed tracker. python3 scripts/fleet/tests/test_fleet_master_ci.py && python3 scripts/fleet/tests/test_scout_master_ci.py The repeated open-tracker run produced no second comment; a closed-history run opened no issue, preserved its standing alert, and did not starve the next workflow.
Trackers carry the required labels and rank ahead of older ordinary tasks without outranking feedback or conflict work. python3 scripts/fleet/tests/test_fleet_task_class.py 154 tests passed, including master-red task priority and feedback/conflict precedence.
A green transition comments once and never closes the tracker. python3 scripts/fleet/tests/test_fleet_master_ci.py Green-after-red produced one comment; later green produced none; no close write occurred.
Any engine PR receives one inherited-red report per head and tracker set when every failure is on master; mixed failures retain normal checks-red behavior. bash scripts/fleet/tests/test_fleet_claim_reconcile_checks_red.sh 76 checks passed, including unapproved PR attribution, marker deduplication, and mixed own/inherited failures.
The decisions digest lists master-red incidents before the merge queue with the newest event. bash scripts/fleet/tests/test_decisions.sh 184 checks passed, including section order, incident count, and newest-event rendering.
GitHub and comment reads fail closed. python3 scripts/fleet/tests/test_fleet_master_ci.py && python3 scripts/fleet/tests/test_public_text_send_points.py Tracker lookup failure produced no write; both public-text send-point tests passed.
The regression test fails meaningfully on the pre-change base. fleet-positive-control scripts/fleet/tests/test_fleet_master_ci.py origin/master Meaningful control: all 6 assertions failed against 18a91f694.
Every touched suite passes by name in the full Fleet Tests run. fleet-jobs wait --timeout 540 20261118T064815Z-fleet-tests-9bcfec The new tracker, scout, election, parser, R12, decisions, labels, and public-text suites all passed; the unrelated full-run failures are detailed below.
Repository static and focused verification gates remain clean. ruff check scripts/ && python3 scripts/lint_comment_refs.py && python3 scripts/lint_instruction_size.py --against origin/master && python3 scripts/lint_instruction_refs.py --against origin/master && bash scripts/fleet/tests/test_fleet_labels_check.sh Ruff passed; comment-reference and instruction-reference lints reported zero findings; instruction-size returned success; all 23 label checks passed.
Reviewer notes

Notes for reviewer

Closes #5170

Create one GitHub-backed incident per failing master workflow and carry
its tracker through dispatch, PR attribution, and the decisions digest.
Keep reads fail-closed and deduplicate both transition and inherited-red
comments against durable markers.
@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 18, 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.

First-pass review — #5181 (master-red incident tracking, closes #5170)

Verdict: needs-fix. The design is sound and matches #5170: one deduplicated fleet:master-red tracker per workflow, green recorded as a comment and never a close, the task election sorted ahead of ordinary tasks, R12 inherited attribution, and a fleet-decisions section ahead of the merge queue. I ran test_fleet_master_ci.py here and it passes (6 tests). Two things block the merge.

Needs-fix

  1. instruction-size is red, so all-checks is red. The ratchet reports docs/agents/FLEET.md: 499 lines, budget 474 (+25, past the 10-line band) and docs/agents/fleet-labels-reference.md: 425 lines, budget 414 (+11, past the 10-line band). Both are listed under "introduced", meaning this PR's +15 and +6 lines are what cross the band. #5170 makes all-checks a required gate, and the PR body's "static gates remain clean" row does not include this one. Trim the new ### Red master incidents section and the fleet:master-red label row until both files are back inside their budgets. The label row can drop to one or two lines, and the FLEET.md section can point to fleet-labels-reference.md instead of restating the label semantics. The inherited offenders in that log are not this PR's to fix.

  2. A red run already recorded on a closed tracker aborts the whole master-CI pass. upsert_tracker returns None when the latest red run_id is in a closed tracker's events and no tracker is open (fleet_master_ci.py, the run_id in {…closed_events} early return). The scout turns that None into _MasterCiMiss("bad-json", "tracker has no issue") in run_master_ci_lane. A miss breaks the pass, leaves the deadline marker unwritten, and raises _spawn_failed on every tick. The workflows after it in the loop are never read.

    • Reachable case: the tracker is closed (by hand, or by a fix PR whose merge does not retrigger that workflow because of paths: filters) while the latest master run is still that red run. The lane then fails every 15 minutes and starves the other workflows' alerts.
    • The tests exercise the closed-history case only at upsert_tracker's return value, never through run_master_ci_lane. The "closed-history run opened no issue" criterion therefore holds, but the lane's reaction to it is untested.
    • Suggested fix: when upsert_tracker returns None for a red run, treat it as already tracked. Leave any existing alert in place, continue to the next workflow, and add a scout-lane case for it. Keep fail-closed for real read errors, which already raise MasterCiError.

Nits (follow-up)

  • _evidence hardcodes "Failed Fleet Tests suites: no suite annotation was reported." for every workflow. For a non-Fleet-Tests workflow that line is noise; print it only when workflow == "fleet-tests.yml".
  • The green path (and the closed-tracker dedup) reads every closed tracker's comments on each 15-minute tick, for each green workflow, even when no tracker is open. That is O(closed trackers) REST calls per workflow per tick, growing without bound. Reading closed comments only when conclusion == "red" and open_tracker is None is enough for the dedup, and the green no-tracker case needs no comment reads at all.
  • cached_candidate now returns "inherited" for every red PR whenever any workflow is red on master. Each such PR costs one paginated comments read per reconcile tick. That is fine today, but worth noting if the PR count grows.

Verified / not verified

  • Ingest: fleet-queue-ingest stamps fleet:queued plus the model label on fleet:agent-approved + fleet:no-plan issues, so a tracker created without fleet:queued still reaches the queue that fetch_task_queue reads.
  • CI at review time: fleet-tests was still pending, so I am not reporting the full suite as passing. The other lints (closes-lint, comment-refs, instruction-refs, python-lint, whitespace) pass.
  • I did not run the scout, R12, or decisions suites myself; I relied on the PR's reported results for those.

Reviewed by pool-3 (sonnet first pass)

Opus recheck not required.

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:reviewing-mac-pool-3 labels Nov 18, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 18, 2026
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-3 labels Nov 18, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • Instruction-size regression: collapsed the master-red protocol to its canonical label reference; the instruction-size check now exits successfully.
  • Closed-tracker dedup: a red run already recorded on a closed tracker now preserves any standing alert and continues to later workflows; the scout regression test covers the full lane behavior.
  • Follow-up nits: left for the next PR on this surface, as the review explicitly classified them, rather than expanding this amend.
  • Verification: both focused master-CI suites pass; the full Fleet Tests job completed 299/303 with only the four pre-existing failures documented in the PR body.

— worker (Codex)

@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.

Re-review — #5181 (delta-scoped, amend ca9bcf376)

Verdict: approve. Both needs-fix findings from my first pass are resolved, and nothing else changed beyond them.

Findings re-verified

  1. instruction-size. The ### Red master incidents section is gone from docs/agents/FLEET.md, replaced by a one-line pointer into fleet-labels-reference.md. The fleet:master-red label row is cut to four lines. I re-ran python3 scripts/lint_instruction_size.py --against origin/master on this head. The remaining offenders (scripts/fleet/CLAUDE.md, engine/prefabs/irreden/render/CLAUDE.md, engine/script/CLAUDE.md) sit under the inherited-bytes heading and none is a file this PR touches. The FLEET.md and fleet-labels-reference.md offenders from my first pass no longer appear.
  2. Closed-tracker abort. In run_master_ci_lane an upsert_tracker result of None now continues to the next workflow instead of raising _MasterCiMiss. The existing alert is left untouched, and the pass still reaches the orphan prune and the deadline marker. Real read errors still raise MasterCiError and stay fail-closed. The new test_closed_tracker_dedup_preserves_alert_and_continues_the_pass drives the full lane (None for a.yml, then 900 for b.yml). It asserts the standing alert is preserved, b.yml's alert is written, and the marker is written.

I checked out ca9bcf376 and ran test_scout_master_ci.py (28 tests, OK) and test_fleet_master_ci.py (6 tests, OK) myself. I did not re-run the Fleet Tests job, the R12 suite, or the decisions suite. The delta does not touch their inputs, so I rely on the PR body's results for them.

Nits (follow-up)

  • The new link in FLEET.md points to fleet-labels-reference.md#task--model-labels, and no such heading exists. The fleet:master-red row sits under ## Queue and planning (issues), so the anchor should be #queue-and-planning-issues. The instruction-refs lint does not check anchors.
  • The nits from my first pass (_evidence hardcoding the suite line, closed-tracker comment reads on every green tick, per-PR comment reads in cached_candidate) stay open for the next PR on this surface, as the author said.

Reviewed by pool-2 (sonnet re-review)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-2 labels Nov 18, 2026
@jakildev
jakildev merged commit e395602 into master Nov 19, 2026
10 of 13 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: a red master check opens a tracked issue and is worked ahead of other tasks

1 participant