bot/eval/corpus.ts
openaliro/openaliro
Module

corpus.ts

@file What gets indexed, and how it is cut up for the Stage 0 baseline.

bot/eval/corpus.ts2 documented symbols

Overview

@file What gets indexed, and how it is cut up for the Stage 0 baseline. The chunker here is deliberately naive: fixed line windows with overlap, no grammar awareness at all. That is the point. Stage 0 measures the floor, so the custom Kconfig/devicetree/Makefile chunkers proposed for Stage 1 have a number to beat rather than an assertion to agree with. File selection is git ls-files minus binaries and minus anything generated, so a hit can never come from a file that would be rebuilt rather than edited.

depends on golden.ts  ·  used by chunk-kconfig.ts headers.ts independent.ts retrieve.ts scope.ts stage0.ts stage1-probe.ts

flowchart TD
  buildChunks --> indexableFiles
  buildChunks --> readLines

API

Ffunction readLines(file: string): string[] | null

bot/eval/corpus.ts:66

Read a file as lines, or null when it is not valid UTF-8 text.

called by buildChunks

Fexport function covers(chunk: Chunk, file: string, line: number): boolean

bot/eval/corpus.ts:97

True when chunk covers line of file — the hit test the scorer uses.

called by hitAt, hitAt, hitAt, main, makeScorer, score, scoreQuestion, seen
Undocumented (2)

indexableFiles, buildChunks