Documentation
¶
Overview ¶
Command gencorpus generates a deterministic, network-free synthetic source-code corpus for the PERF-02 CI regression gate and the INDX-06 bounded-memory / peak-RSS assertion (see 08-RESEARCH.md Pattern 2).
Reproducibility contract: Generate(opts) with the same Options.Seed ALWAYS materializes a byte-identical directory tree — same file set, same paths, same contents (T-08-09). Every random decision is drawn from a single rand.New(rand.NewSource(opts.Seed)) instance consumed in a fixed, deterministic order (package index, then file index, low to high) — never the global math/rand source, never a wall-clock-derived value, and never anything ordered by map iteration.
This is a CI-gate build/test-time tool only: it is never shipped in the production binary, must never touch the network or clone a repo (D-04), and must never panic — every failure path returns a wrapped error.
Command gencorpus is the CLI wrapper around Generate: it materializes a deterministic, network-free synthetic source corpus for the PERF-02 CI regression gate and the INDX-06 100k+ file / bounded-memory assertion.
Usage:
gencorpus -seed 42 -out /tmp/corpus -count 120000