RepoDNA Documentation

Offline evidence-label dataset audit

RepoDNA can train native pointwise and pairwise evidence-ranking models using locally reviewed labels. Before training, inspect the quality and split structure of those datasets. Training can still learn from poor, copied, or misleading labels if you do not check them.

cargo run --locked -p repodna-ai --bin audit-repodna-labels -- \
  examples/native-ai/train.demo.json \
  examples/native-ai/holdout.demo.json \
  examples/native-ai/test.demo.json

Use these synthetic fixtures only to test the tooling, not to claim a model has learned from real codebases.

The audit enforces three nonempty repository-disjoint splits (train, validation, final test). It checks canonical repository aliases, duplicate evidence IDs, source-excerpt exclusions, input sizes, required label fields, mixed positive/negative training examples within at least one question, and answerable validation/final-test questions.

Its aggregate JSON report includes sample counts, independent repository counts, question groups, positive and negative judgments, answerable and unanswerable question counts, same-question positive/negative pairing coverage, distribution across evidence kinds, maximum share of examples from a single repository, and a SHA-256 fingerprint of each split's labels.

Possible copied evidence across splits#

An additional check compares the exact question, evidence kind, reference and detail while deliberately ignoring repository IDs and evidence IDs. If the same question and evidence text occurs in different splits, the command reports aggregate matching-signature counts and warns about possible cloned-repository or annotation leakage.

The audit also reports case/whitespace-normalized signature matches using the same four fields. This second pass lowercases text and collapses Unicode whitespace runs, catching labels copied with only cosmetic edits. It reports both exact and normalized aggregate counts separately for each split pair, plus normalized repetition within each split. Neither check changes training data, human labels or the full-fidelity SHA-256 label fingerprints; both produce warnings rather than rejecting valid input.

The audit also counts contradictory relevance judgments for the same question and evidence within one canonical repository. Both exact and case/whitespace-normalized matches are counted, with separate aggregate conflictingRelevanceJudgmentsWithinSplit and normalizedConflictingRelevanceJudgmentsWithinSplit fields. The counts are for distinct conflicting signatures, not individual annotations. They do not contain repository IDs, raw questions or evidence. These contradictions generate warnings for manual adjudication; a cross-repository match alone is not a contradiction because relevance may legitimately vary with context.

A matching signature is not proof of leakage. Independent repositories can share familiar file and dependency metadata. Conversely, these checks still miss synonyms, changed punctuation, reordered words, renamed paths, and semantically copied repository content. Normalized matches include exact matches, so do not add the two counts together. Review suspicious findings and confirm repository-family provenance manually.

When a dataset has fewer than five training repository IDs, fewer than three validation or test repository IDs, extreme repository concentration, or exact/cosmetically repeated evidence signatures, the tool warns. These thresholds are research heuristics, not statistical power guarantees.

Independent reviewer agreement#

For human-reviewed benchmarks, double-review a fixed subset before finalizing training labels. The offline reviewer agreement audit compares two complete reviews of identical evidence records and reports aggregate observed agreement, disagreement counts and Cohen's kappa. It never invents missing labels, discloses evidence content or proves label accuracy. Adjudicate disagreements privately and record the rubric and aggregate results.

Privacy and interpretation#

The audit never prints raw repository identifiers, evidence details, source paths, questions, or labels. It prints aggregate statistics and SHA-256 dataset fingerprints. The latter can still reveal whether the same labeled dataset was reused, so review before publishing reports.

Passing structural checks is not evidence that labels were reviewed correctly, that the repositories are truly independent, that a dataset is licensed for training, or that the ranker generalizes. A reviewer must verify those properties independently, document repository provenance, and avoid repeatedly modifying experiments based on an already used final-test set.

Run the audit before using compare-repodna-rankers; examine warnings and any suspicious repeated content before drawing conclusions from validation or test metrics. All operations stay local. Inputs must be regular files; reads are capped to 8 MiB plus one detection byte, even if a file grows after its initial size check. Each label JSON file allows a maximum of 8 MiB and 100,000 labels.

Optional fork-family disjointness gate#

For reviewed benchmarks, provide a manually curated repository-family manifest as an additional final argument (FAMILIES.json). This rejects cross-split forks and copied-repository families even when the repository IDs differ. See family provenance validation for the JSON format and limitations. Without a manifest, only distinct repository IDs are enforced; familyManifestChecked: false must not be interpreted as clone-family independence.

Edit this page on GitHub