IF Commons GitHub

ci/collect

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-libraries-ci-findings FR-006

The gathering of the findings of a workflow (commons 0038-build-policy FR-005, FR-011, FR-012): bun commons/libraries/src/ci/collect.ts --dir DIR --out DIR --workflow NAME [--expect JOB:MODULES ...] [--policy-review] [--check-run] merges the files that the steps wrote, makes sure that every cell that ran left its file (the red cause reports-not-produced: the only way it ends red), writes the merged file and a summary, and gives the commit the neutral check findings. A finding is never a reason to end red.

It imports no package. The check run is made with gh; where it cannot be done the run says so and is not red for it. It never writes the history: that is the job keep-findings, on the default branch only, with the permission to write to itself (the pipeline is sound where its findings were kept, and the artifact keeps them).

import { mergeFiles } from "./collect.ts";
mergeFiles([], { id: "1", workflow: "ci", commit: "c", at: "2026-11-22T00:00:00Z" }).findings.length; // 0

Source: commons/libraries/src/ci/collect.ts

3 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

readFilesfunctionno test imports it
function readFiles(dir: string): { readonly files: readonly FindingsFile[]; readonly problems: readonly string[]; }

The files of a folder (and the folders under it) that are findings files, with the sentences for the ones that are not.

mergeFilesfunction
function mergeFiles(files: readonly FindingsFile[], run: RunInfo): FindingsFile

The files of the steps as one file of the run, the findings once each (the same finding read by two steps is one).

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

expectationProblemsfunction
function expectationProblems(merged: FindingsFile, expect: readonly { readonly job: string; readonly modules: number; }[]): readonly string[]

What is missing against what was expected (job:count pairs: how many modules of the job ran): the reasons the pipeline is not sound (empty where it is).

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

summaryTextfunction
function summaryText(f: FindingsFile): string

The counts of a merged file by severity, for the summary of a check.

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.