Repository navigation
chore(ci): archive and report red-main incidents, flakes, cancellations and merges during red - #4013
Merged
Merged
Conversation
…ns and merges during red The hourly collector reads the red-main record's history from the shared coordination ref, and the coordinator's cancellation lines for the hours main was red, into normalized archive files. The report gains a red-main section: each incident's lifecycle and time to green, flake verdicts with their escalation to real, PR proof cancelled or refused by the gate with consumed and estimated saved runner minutes (unknowns counted separately), and non-fix merges during red with their PR. The probe path now prints the same cancellation line as a main run. Refs #2953 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
3 of 5 tasks
This was referenced Nov 15, 2026
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2953. Part of #2948.
What changes
The hourly
ci-timingscollector gains--red-main, and the scheduled workflow passes it. It writes normalized red-main evidence next to the existing timing files. That output is what #2955's daily compaction will move into the data ref.ci-timings reportgains aredMainsection insummary.jsonandsummary.md, which is the report #2956 builds on.red-main.json): reads the shared coordination ref through Git (no API), walking only the commits that changedred-main.json, back to the last green state before the window. Each record is keyed by its opening run and gives: opened, first bad SHA with its bisect refinements, failing tests and categories with estimator reasons, incident issue, declared and expedited fixes, non-fix squashes reported while red, and the clear. Time to green is opened → cleared, on server time.repeated-suspected-flakewith its prior suspect run, orprobe-reproduced) comes from the incident failure's reasons.coordinator-<run>-attempt-<n>.json): parses the coordinator'sBRAIN_RED_MAINlines fromred-mainworkflow runs created while main was red. A green window costs no API request. Each archived attempt is seeded forward (the seed now accepts these files) and never fetched twice.changesetjob failed the "Refuse doomed proof while main is red" step, read from the existing timing snapshots.unknownConsumed,unknownSavedoracquisition.coordinatorUnknown, never as zero. A run that finished before its cancel took effect saved 0.unknownPRcounts the rest.scripts/red-main-coordinator.ts): the probe path now prints the sameBRAIN_RED_MAINcancellation line as the main-run path. Its cancellations were otherwise invisible. Its decisions are unchanged. Earlier successful probe attempts without the line read as no cancellations;docs/process/ci-throughput.mdrecords that limit.Archive prerequisite: the #2955 data ref does not need to exist first. These records go into the hourly artifact like
reservations.json. No archive ref is written here. Record versions are1, as for the existing kinds; #2950's inventory should list them.Acceptance criteria
tests/ci-red-main.test.ts"a fixture red-main lifecycle…" (overlapping archives, 90 min), plus the native offline-remote history walkclassifyFailurereportCLI testMutation receipts
Each guard was broken, the named assertion failed for the claimed reason, and the guard was restored:
openinstead ofclearTIME_TO_GREEN_FROM_OPEN_TO_CLEARONE_INCIDENT_PER_RECORD(length > 1)ESCALATED_TO_REALNO_REFERENCE_IS_UNKNOWNCANCELLED_SAVINGS_AND_UNKNOWNSCANCELLED_SAVINGS_AND_UNKNOWNSMERGE_DURING_RED_HAS_PREARLIER_INCIDENT_OUTSIDE_WINDOWGREEN_HOURS_COST_NOTHINGFAILED_BEFORE_PRINTING_IS_UNKNOWNARCHIVED_ATTEMPT_NOT_REFETCHEDUNREAD_COORDINATOR_LOGS_ARE_A_GAPCOORDINATOR_OBSERVATION_SEEDEDPROBE_CANCELLATIONS_PRINTED(tests/red-main.test.ts)Validation
bun run check:pr --base origin/mainpassed: lint and leakage, environment docs, changesets, and affected fast invariants (1222 tests). This host has nozipbinary, whichtests/ci-timings-collection.test.tsuses to build its seed fixture. Without it the seeded tests fail the same way onorigin/main. I put a Pythonzipfileshim onPATHfor the local run. No test or harness was changed for this.bun run typecheckis clean.{"version":1,"kind":"brain-check-pr-receipt","head":"db486064efcb62814cf66438fab2fefb711c5c56","base":"origin/main","mode":"focused","startedAt":"2026-11-15T13:37:32.747Z","finishedAt":"2026-11-15T13:38:57.362Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12383.291926999998},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":124.16728599999988},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":142.14264600000024},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.50779700000021},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":71930.943212}]}Refreshed by merging
origin/main(#4006, #4011); neither touches this PR's files, so the receipt above still describes its changes.Contract impact: none.
🤖 Generated with Claude Code