Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci-evidence-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# The daily digest and the weekly evidence report, generated from the
# measurement data ref (docs/decisions/ci-evidence.md). Measurement only: never
# a proof/merge gate. Executes trusted default-branch tooling with no
# dependency install, reads the archive and main's history, and writes nothing
# but its own artifacts and job summary.
name: ci-evidence-report

on:
workflow_dispatch:
inputs:
weekly:
description: Also generate the weekly report, whatever the day
type: boolean
default: false
schedule:
# An hour after the 02:17 UTC archive compaction, which has a 60-minute limit.
- cron: "37 3 * * *"

permissions: {}

concurrency:
group: ci-evidence-report
cancel-in-progress: false

jobs:
report:
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read # the data ref and main's history; reports write nothing
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
# Proof-policy epochs classify main's first-parent squashes locally.
fetch-depth: 0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.4.2"
- name: Generate the daily digest, and the weekly report on Mondays
env:
REPORT_REPO: ${{ github.repository }}
REPORT_WEEKLY: ${{ inputs.weekly && 'true' || 'false' }}
run: |
bun scripts/ci-evidence-report.ts --cadence daily --repo "$REPORT_REPO" --from-archive origin --out tmp/ci-evidence
if [ "$REPORT_WEEKLY" = true ] || [ "$(date -u +%u)" = 1 ]; then
bun scripts/ci-evidence-report.ts --cadence weekly --repo "$REPORT_REPO" --from-archive origin --out tmp/ci-evidence
fi
- name: Write the reports to the job summary
if: always()
run: |
for report in tmp/ci-evidence/weekly.md tmp/ci-evidence/digest.md; do
if [ -s "$report" ]; then cat "$report" >> "$GITHUB_STEP_SUMMARY"; fi
done
- name: Retain the reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: ci-evidence-report
path: tmp/ci-evidence/
if-no-files-found: error
retention-days: 90
23 changes: 12 additions & 11 deletions docs/process/ci-evidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ are refused; future schemas append rather than rewrite history.
| `collection` (`collection.json`, `collections/<id>/collection.json`) v1 | Collection ID, requested window, discovered attempts, errors, budget and seed observations. | Every collect invocation, including partial acquisition. | API responses transient; manifests in hourly artifacts request 90 days. |
| `enrichment` (`enrichment.json`) v1 | `LifecycleAcquisition`, repository, timestamp, expected PRs and acquisition errors. | Every lifecycle enrichment. | API responses transient; artifacts request 90 days. |
| `source` (archive only) v1 | `ArchiveSource`, repository/artifact; collector run, artifact creation time, SHA-256 digest, archived and refused record counts. | Daily archive compaction, one per retained artifact. | Written to the data ref; the artifact it names expires after 90 days. |
| `summary` (`summary.json`) v1 | `summarize` and report joins: derived timings, throughput, epochs, red-main and coverage sections. Markdown is a rendering, not another schema. | Local `report` and hourly collect; scheduled archive-based daily/weekly report planned in #2956. | Derived from retained inputs; artifacts request 90 days. |
| `summary` (`summary.json`) v1 | `summarize` and report joins: derived timings, throughput, epochs, red-main and coverage sections. Markdown is a rendering, not another schema. | Local `report` and hourly collect. | Derived from retained inputs; artifacts request 90 days. |
| `evidence report` (`digest.json`, `weekly.json`) v1 | `evidenceReport` (`scripts/ci-evidence-report.ts`): gate, throughput headline, epochs, red-main, families, runner wait, contention, activity and coverage for one window, read from the data ref. Markdown is a rendering. | Daily digest, weekly report on Mondays ([scheduled reports](ci-timings.md#scheduled-evidence-reports)). | Derived from the data ref; the `ci-evidence-report` artifact requests 90 days. |

Schema anchors: (`TimingSnapshot`, `scripts/ci-timings.ts:40-52`),
(`PullObservation`, `scripts/ci-throughput.ts:7-13`),
Expand Down Expand Up @@ -90,13 +91,13 @@ cost. Durations report sample counts and median/p90; unknowns stay separate.
| Metric | Definition and source / producing file or task | Kind/version → report field | Status |
| --- | --- | --- | --- |
| First-main failing categories | Failed primary job categories per first-main attempt; `ci-throughput.ts`. | R + P → S `reliability.firstMainFailedJobCategories` | collected |
| Failure families and attribution | Evidence-linked product/test/infrastructure/stale-candidate/intentional-feedback annotations, optionally job-specific; annotation presence is not complete causal attribution. | E + R → S `reliability.classificationRecords`; #2956 ranks families | collected locally; hosted publication planned #2954 |
| Failure families and attribution | Evidence-linked product/test/infrastructure/stale-candidate/intentional-feedback annotations, optionally job-specific; annotation presence is not complete causal attribution. | E + R → S `reliability.classificationRecords`; report `families` ranks them | collected locally; hosted publication planned #2954 |
| Red-main incidents | Opening run, first bad SHA/refinements, test/category/reasons, incident issue, declared/expedited fixes and clearance; #2942 producer, #2953 collector (`ci-red-main.ts`). | M → S `redMain.incidents` | collected hourly |
| Time to green | Record opened → cleared using server time; open incidents have unknown duration. | M → S `redMain.timeToGreenSeconds`, `openIncidents` | collected hourly |
| Suspected flakes, verdicts and reruns | Per-test suspicions, probe outcomes, linked issues and repeated-suspicion/probe-reproduced escalations; rerun attempts retained separately. | M + R → S `redMain.flakes`; ranked report #2956 | collected hourly |
| Suspected flakes, verdicts and reruns | Per-test suspicions, probe outcomes, linked issues and repeated-suspicion/probe-reproduced escalations; rerun attempts retained separately. | M + R → S `redMain.flakes`; report `families.suspectedFlaky` | collected hourly |
| Cancelled/refused proof while red | Coordinator cancellation IDs and hosted gate refusal steps, observed consumed seconds and estimated saved seconds versus median successful PR attempt; missing snapshots/reference remain unknown. | C + M + R → S `redMain.cancellations`, `refusals`, `savingReference` | collected hourly |
| Merges during red | Reported non-fix squashes matched to exact PR identity; unresolved PR counted separately. | M + P → S `redMain.mergesDuringRed` | collected hourly |
| Explicit incidents/reverts/expedited fixes | Supplied public evidence with affected/repair PR; overall product incident rate remains unknown without surveillance. | E → S reliability records | collected locally; publication #2954, archive/report #2955/#2956 |
| Explicit incidents/reverts/expedited fixes | Supplied public evidence with affected/repair PR; overall product incident rate remains unknown without surveillance. | E → S reliability records | collected locally; publication #2954, archived and reported |
| Worker activity and work lifetime | Paired opaque worker/task work boundaries; overlapping tasks do not double count a worker. No instrumentation means unknown, not zero active agents. | E → S `parallelism.recordedWorkers`, `completedWorkIntervals` | collected only when orchestrator records; hosted publication planned #2954 |
| Caller wait and conflict effort | Paired waits by reservation/CI/review/conflict/other reason; elapsed wait is not CPU effort. | E → S `parallelism.waits` | collected locally when emitted; publication planned #2954 |
| Local host-slot admission wait | #2943 `host-admission.mjs` automatically emits wait pairs, reason `other`, task `admission-<slot>`. | E → S `parallelism.waits.other` | collected locally; publication planned #2954 |
Expand All @@ -106,18 +107,18 @@ cost. Durations report sample counts and median/p90; unknowns stay separate.
| Escape classes | #2937 historical public issue-comment audit: bypassed-confirmation, selection-miss, harness-change, confirmed-then-flaked, inherited-red, unknown. Issue comments have no configured collector expiry; failure classifications alone do not supply escape classes. | No normalized kind/version | gap #4043 |
| Reservation requests | Request → admission/refusal demand, including unsuccessful callers, beyond acquired leases. Live command outcomes are not an archived event stream; no raw retention guarantee. | No kind/version | gap #4044 |
| Reconfirmation reasons | Distinguish base advance, head change and other reproof causes; current leases/ready times cannot establish them. No retained structured source. | No kind/version | gap #4044 |
| Coverage gaps | Missing attempts, incomplete snapshots, lifecycle errors, budget/seed stops, failed reservation/red-main scopes and unknown coordinator logs; `ci-timings.ts` acquisition/report joins. | collection + enrichment v1, R/L/M/C → S coverage/acquisition | collected; missing hours/expired sources and archive-wide self-check planned #2956; collection recovery #3853 |
| Coverage gaps | Missing attempts, incomplete snapshots, lifecycle errors, budget/seed stops, failed reservation/red-main scopes and unknown coordinator logs; `ci-timings.ts` acquisition/report joins. | collection + enrichment v1, R/L/M/C → S coverage/acquisition → report `coverage` (missing hours, expired sources, failed acquisitions, unknowns) | collected; collection recovery #3853 |

## Phase B gate and scheduled report

| Metric | Definition and source / producing file or task | Kind/version | Status |
| --- | --- | --- | --- |
| Seven consecutive days | One proof-policy epoch, opening at a classified proof-system squash; unknown/unbounded history cannot prove stability. `ci-epochs.ts` classifies first-parent Git history using the parent's path set (#3270). Git history has no configured TTL; derived on every report, hourly checkout fetches full history. | R + P + Git → S `throughput.epochs.current.days` | collected input; gate evaluation planned #2956 |
| At least 80% first-main green | Green / known first-main outcomes in that same epoch, carrying denominator, unknown outcomes and coverage limits. | R + P → S `throughput.epochs.current.firstMainGreen` | collected input; gate evaluation planned #2956 |
| Every red incident attributed | Requires evidence for every red incident in the epoch. Current `incidentAttribution` counts failed first-main attempts with any annotation; it cannot establish complete attribution of all failures or incidents. | E + R + P → S `throughput.epochs.current.incidentAttribution`; M supplies incident coverage | planned #2956 for complete gate assessment; current input collected with this limitation |
| Phase B gate state/change | All three requirements qualified together; no mixed epoch or incomplete attribution promoted to met. Measurement only, no rollout authorization. | No implemented gate kind/version; future report schema owned by #2956 | planned #2956 |
| Daily digest / weekly report | Archive-derived cohorts, first-main per epoch, red incidents/recovery, failing/flaky families, escape classes, runner wait, local contention and coverage. | Current S v1 is local/hourly; scheduled schema owned by #2956 | planned #2955/#2956 |
| Delivery/change triggers | Weekly always; daily newly observed incident (no duration threshold), gate change or collection gap; unchanged incident is not new. Artifacts daily, comments on one pinned issue. | No implemented delivery record/version; #2957 owns delivery state | planned #2956/#2957 |
| Seven consecutive days | One proof-policy epoch, opening at a classified proof-system squash; unknown/unbounded history cannot prove stability. `ci-epochs.ts` classifies first-parent Git history using the parent's path set (#3270). Git history has no configured TTL; derived on every report, hourly checkout fetches full history. | R + P + Git → S `throughput.epochs.current.days` → report `gate.conditions.epoch` | collected, evaluated |
| At least 80% first-main green | Green / known first-main outcomes in that same epoch, carrying denominator, unknown outcomes and coverage limits. | R + P → S `throughput.epochs.current.firstMainGreen` → report `gate.conditions.firstMainGreen` | collected, evaluated |
| Every red incident attributed | Every red-main incident open in the gate's seven days has a `failure-classified` event naming its opening run; missing red-main history is unknown. `incidentAttribution` separately counts failed first-main attempts with any annotation. | M + E → report `gate.conditions.incidentsAttributed` | collected, evaluated; annotation is not complete causal attribution |
| Phase B gate state/change | All three requirements qualified together; no mixed epoch or incomplete attribution promoted to met. Measurement only, no rollout authorization. | Report `gate`, `previousGate`, `triggers.gateChanged` | evaluated daily |
| Daily digest / weekly report | Archive-derived cohorts, first-main per epoch, red incidents/recovery, failing/flaky families, escape classes, runner wait, local contention and coverage. | `evidence report` v1 | generated daily and weekly |
| Delivery/change triggers | Weekly always; daily newly observed incident (no duration threshold), gate change or collection gap; unchanged incident is not new. Artifacts daily, comments on one pinned issue. | Report `changed` and `triggers`; #2957 owns delivery state | triggers computed; delivery planned #2957 |

## Trace a reported value

Expand Down
5 changes: 3 additions & 2 deletions docs/process/ci-throughput.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ hourly collector checks out full history for this reason.
| `epochs.current` | The epoch holding the newest squash before the window end: `days` since its boundary and `firstMainGreen`, the two numeric inputs of the #2934 Phase B gate, plus `incidentAttribution`. |
| `epochs.current.incidentAttribution` | Failed first-main attempts in the epoch and how many carry a `failure-classified` record. `unknown` when none do, `partial` when some do, `recorded` when all do. No record is unknown, not unattributed; incidents outside first-main runs are not observed. |

The report states these inputs; it does not decide whether the gate is met.
An `unknown` boundary on the current epoch means its days are counted from a
This report states these inputs; it does not decide whether the gate is met.
The [scheduled evidence reports](ci-timings.md#scheduled-evidence-reports)
evaluate the gate from them every day. An `unknown` boundary on the current epoch means its days are counted from a
squash that may not have changed policy, so they are not evidence of a stable
epoch.

Expand Down
Loading
Loading