corpus.ts
@file What gets indexed, and how it is cut up for the Stage 0 baseline.
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
Read a file as lines, or null when it is not valid UTF-8 text.
buildChunksFexport function covers(chunk: Chunk, file: string, line: number): boolean
True when chunk covers line of file — the hit test the scorer uses.
hitAt, hitAt, hitAt, main, makeScorer, score, scoreQuestion, seenUndocumented (2)
indexableFiles, buildChunks