Package-level declarations

Types

Link copied to clipboard
data class CorpusAsset(val url: String, val sha256: String, val bytes: Long)

Where the frozen corpus is hosted and the hashes a download must match.

Link copied to clipboard
class CorpusBuild(manifest: CorpusManifest, source: PageSource, work: Path, log: (String) -> Unit = {}, pause: (Long) -> Unit = { Thread.sleep(it) })

Builds the triage corpus. Each repo is paged newest first into <work>/<owner>__<name>.jsonl (already redacted, one canonical JSON issue per line) with a .state file beside it, so a stopped run resumes at the last whole page. assemble sorts everything into one file whose bytes depend only on those lines.

Link copied to clipboard
class CorpusClean(salt: String)

Redaction and hashing for stored issue text. A login becomes u and twelve hex digits of HMAC-SHA256 keyed with the manifest salt over the lowercase login, so it cannot be looked up in a table of unsalted hashes.

Link copied to clipboard

Downloads the frozen corpus; a file that differs from the manifest hash or size is refused.

Link copied to clipboard
class CorpusIssue(val repo: String, val number: Int, val created: String, val state: String, val title: String, val author: String?, val body: String)

An issue as stored: no raw login, and the title and body pass through CorpusClean.

Link copied to clipboard
data class CorpusManifest(val cutoff: String, val cap: Int, val salt: String, val repos: List<CorpusRepo>, val asset: CorpusAsset?)

cap is the most issues kept per repo and cutoff the last creation day, yyyy-mm-dd.

Link copied to clipboard

Reads the corpus file written by CorpusBuild.assemble, one issue at a time.

Link copied to clipboard
data class CorpusRepo(val repo: String, val host: String, val stratum: String, val formPolicy: String, val why: String)

One tracker in triage/corpus.yml. formPolicy is the issue template policy of the repo.

Link copied to clipboard
class CorpusSummary(val jsonSha256: String, val jsonBytes: Long, val zstSha256: String?, val zstBytes: Long?, val counts: Map<String, Int>)

What a build wrote: hashes and sizes of the JSON and of its zstd file, and counts per repo.

Link copied to clipboard
class Coverage

How much the extractor read from issues of one kind, with or without ground truth.

Link copied to clipboard
class EvalResult(val dev: Slice, val heldOut: Slice, val claims: Map<String, Int>, val bodies: Long, val excludedTruth: Long = 0)
Link copied to clipboard
class EvalTriage(manifest: CorpusManifest, seed: String = SEED, onClaim: (CorpusIssue, String, Int, String) -> Unit = { _, _, _, _ -> }, onMiss: (CorpusIssue, Fact, Set<String>) -> Unit = { _, _, _ -> })

Scores the free-text extractor on the corpus. A form body (### Label sections, from a repo whose issue template is a form) states its environment under labelled headings; the facts read from those sections are the truth. The sections that gave a fact are cut out of the body and the extractor runs again on what is left, so the tool-output, key-value and pattern paths are judged against what the reporter typed into the form fields. Facts on keys the form did not label cannot be judged and are not scored. Heading-to-key mapping and value normalization are shared between the truth and the extractor, so the section path itself is not measured here.

Link copied to clipboard
class GithubSource(shell: Shell = ProcessShell) : PageSource

GitHub issues through gh api graphql, which lists issues only and never pull requests.

Link copied to clipboard
class GitlabSource(shell: Shell = ProcessShell) : PageSource

GitLab issues through glab api, paged by number; the cursor is the next page number.

Link copied to clipboard
class HostSource(github: PageSource, gitlab: PageSource) : PageSource

Sends each repo to the source for its host.

Link copied to clipboard
class Page(val issues: List<RawIssue>, val next: String?)

One page of issues, newest first. next is the cursor of the next page, null at the end.

Link copied to clipboard
fun interface PageSource
Link copied to clipboard
Link copied to clipboard
class RawIssue(val number: Int, val created: String, val state: String, val title: String, val author: String?, val body: String)

An issue as the fetcher read it, before redaction. author is a raw login.

Link copied to clipboard
class Score

Counts for one slice of the corpus; every number in the report is a ratio of these.

Link copied to clipboard
fun interface Shell

Runs a command and returns its output; the real one starts gh or glab.

Link copied to clipboard
class Slice
Link copied to clipboard

Functions

Link copied to clipboard
fun main(args: Array<String>)