Repository navigation
chore(ci): generate the daily digest and weekly evidence report from the archive - #4141
Merged
Merged
Conversation
…the archive (#2956) Adds scripts/ci-evidence-report.ts and the read-only ci-evidence-report workflow. Every day, an hour after the archive compaction, it reads the measurement data ref and main's history and writes the daily digest. On Mondays it also writes the weekly report. Both are written as Markdown and JSON to the job summary and a 90-day artifact. Each report covers throughput cohorts, first-main green per proof-policy epoch, red-main incidents and time to green, the top failing and suspected-flaky test families, runner-slot wait, local contention, activity per day, the Phase B gate over the trailing seven days and a coverage section (missing collection hours, expired sources, failed acquisitions, unknowns). A missing hour never reads as zero activity. The digest's `changed` flag follows the decision record: a newly observed red-main incident with no duration threshold, a gate state change, or a collection gap. check-ci-workflows holds the workflow to no write permission, trusted default-branch code with full history and an always-uploaded artifact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
schlessera
marked this pull request as ready for review
November 17, 2026 05:39
This was referenced Nov 17, 2026
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.
Refs #2956
What changed
Two scheduled reports now come from the durable data ref rather than from hand-run commands.
scripts/ci-evidence-report.tsbuilds a daily digest (the UTC day before--until) and a weekly full report (the seven days before it) as Markdown and JSON. The new read-only workflowci-evidence-report.ymlruns at 03:37 UTC, an hour after the 02:17 compaction. It writes the digest every day and adds the weekly report on Mondays, or on dispatch withweekly. Both go to the job summary and to a 90-dayci-evidence-reportartifact.Each report contains throughput cohorts, first-main green per proof-policy epoch, red-main incidents and time to green, the top failing and suspected-flaky test families, runner-slot wait, local contention, activity per day, the #2934 Phase B gate, and a coverage section. The coverage section lists missing collection hours, expired sources, failed acquisitions, missing run attempts and named unknowns. Escape classes are reported as unknown until #4043 lands. A day with a missing collection hour reports
nullcounts and gives the observed numbers separately, so a missing hour never reads as zero.The digest's
changedflag, withtriggersnaming the cause, is true when:Each Markdown report starts with a
## Summarysection that ends at the next heading. File names are fixed:digest.{json,md}andweekly.{json,md}. The JSON isversion: 1. This keeps the output stable for #2957, which posts it. Posting is out of scope here.Why this shape
metonly when all three conditions hold: the current epoch opened at a classified proof-system squash at least seven days earlier; at least 80% of known first-main outcomes in those days are green; and every red-main incident open in those days has afailure-classifiedevent naming its opening run. Missing evidence makes a conditionunknown, and unknown is not met (Epic: independent changes land on main concurrently, with only overlapping work serialized #2934: partial coverage is not qualification). An unbounded or unknown epoch boundary, no known outcome, a missing collection hour, or no red-main history collected in those days all count as missing evidence. A gate change is computed against the same rule one day earlier, from the same archive.partialOnlybut is not a gap. Otherwise almost every digest would fire on routine partial manifests.check-ci-workflowsholdsci-evidence-archive.ymlto its single write-scoped job. The newreportWorkflowProblemscheck holds the report job tocontents: readonly, no workflow-level permission, trusted default-branch code with full history (the epochs need it), no event interpolation or install, and an always-uploaded 90-day artifact.Builds on the #2955 archive format, not on backfill completeness. The reports read
YYYY-MM/<kind>.jsononrefs/heads/brain-ci-metricsthrough the existingarchiveInputs/readArchive.archiveInputsgained an optional checkout root, so tests can read a fixture remote. #2955's remaining backfill dispatches (still pending when this was written) only change which hours are covered, and every report states that coverage. If #4130 changes the monthly partition, it needs to updatereadArchiveonly. This PR adds no new layout dependency. The reports read archive files listed bygit ls-tree, which is sorted and whose rows are already merged per identity, so they do not depend on the directory-listing order behind #4131.Proof
Focused suite
tests/ci-evidence-report.test.ts(7 tests). The acceptance criteria map as follows:publishBatchwriter to a bare remote, then read back witharchiveInputs. Merges, first-main green, per-day rates, latencies, size cohorts, runner-slot wait, time to green, families, contention and activity are each compared with values recomputed by hand from the fixture definitions.coverage.collectionHours.missingand in the Markdown. The day reportsnullcounts with observed lower bounds, and the Markdown never prints a zero row for it.metat exactly 80%. Each condition fails on its own: a young epoch, 2/5 green, an unattributed incident. Missing red-main history and missing history are eachnot metwith the condition named.changedfor each trigger and false otherwise. True for a new incident, a gate change and a collection gap, each isolated so it is the only trigger. False for a quiet day and for an incident re-observed unchanged.Mutation receipts (each mutation applied, the named assertion failed, then restored with
cmp):scripts/ci-evidence-report.ts/check-ci-workflows.tsMISSING_HOUR_LISTED,COLLECTION_GAPMISSING_HOUR_NOT_ZERO>)GATE_MET,REOBSERVED_INCIDENT_UNCHANGED, weekly gatetoBe("met")EPOCH_TOO_YOUNG,GATE_CHANGEINCIDENT_UNATTRIBUTEDNO_RED_MAIN_HISTORY_IS_NOT_METchangedignores a gate changeGATE_CHANGEREOBSERVED_NOT_NEWchangedignores a collection gapCOLLECTION_GAP(first survived because the gap also flipped the gate; the test now isolates the gap as the only trigger, and the mutation fails it)GAP_LEAVES_GATE_UNKNOWNREPORT_JOB_READ_ONLYAlso run:
bun run test tests/ci-workflows.test.ts tests/ci-archive.test.ts tests/ci-timings.test.ts tests/ci-throughput.test.ts tests/ci-red-main.test.ts tests/ci-epochs.test.ts, 131 pass. Roottsc --noEmitis clean. No package exports changed.{"version":1,"kind":"brain-check-pr-receipt","head":"78447eb1ecdd20bfbfa083733d48b9c7ef289fee","base":"origin/main","mode":"focused","startedAt":"2026-11-17T05:32:27.702Z","finishedAt":"2026-11-17T05:33:56.408Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12901.038618},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":123.24315299999944},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":98.18703899999855},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.375918999998248},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":75546.65655}]}Collisions
bun scripts/collisions.ts --json --pr 4141at head78447eb1ecdd20bfbfa083733d48b9c7ef289fee(graph built at that commit) found closure-only overlaps and no path or textual collision. The PRs are #3054, #3056, #3059, #3069, #3581, #3622, #4002, #4036, #4102 and #4139. #3056, #3059 and #4102 share the ci-timings/red-main test closure,tests/ci-*.test.ts.Checklist
packages/ui-react/,packages/ui-kit/,packages/ui-server/orpackages/core/(fast-lane eligible).0.45.0on this PR and ci: generate the daily digest and weekly evidence report from the archive #2956.odysseus/chronicle, pinned 2026-07-12 week).--jsoncontract command, MCP tool or frontmatter).docs/process/ci-timings.md(new "Scheduled evidence reports" section), the evidence inventorydocs/process/ci-evidence.md, anddocs/process/ci-throughput.md.reportWorkflowProblemsis a static workflow lint like its archive sibling.Anything left open
Refs. After merge, the first scheduled run (03:37 UTC), or a dispatch ofci-evidence-reporton main, gets its run andci-evidence-reportartifact linked on ci: generate the daily digest and weekly evidence report from the archive #2956, and then ci: generate the daily digest and weekly evidence report from the archive #2956 can close.