Skip to main content

Module corpus

Module corpus 

Source
Expand description

Base-rate measurement over a real repository’s history (D23).

The revised D23 tripwire’s first clause is “measure our own semantic-conflict base rate”, and nothing else on D23 can proceed without it: a detector’s recall is meaningless at an unknown prevalence, and the escalation threshold t = 1 - c/r cannot be calibrated against a rate nobody has counted.

Our own history cannot supply it — 60-odd commits, zero reverts, no CI — so the corpus is borrowed: point this at a repository the D21 bridge has mirrored and measure there.

§What the label actually means

This weak-labels a merge as bad if it was reverted within a window of following commits. That is a proxy, and it is wrong in both directions in ways worth stating rather than discovering:

  • False negatives dominate. A bad merge that was fixed forward, or noticed after the window, or never noticed, is labelled good. So the measured rate is a lower bound on the true rate.
  • False positives exist. Reverts also happen for reasons that are not defects — a feature deferred, a release scoped down.

It is used anyway because it needs nothing but git: no CI history, no issue tracker, no human labelling. A lower bound on prevalence is enough to answer the question that actually blocks D23, which is whether a detector’s false-positive rate is survivable at our rate.

Same split as crate::blast: parsing is a pure function over git log output, and the shell-out is a separate call, so tests are hermetic.

Structs§

Attribution
Maps a reverted commit back to the mainline commit that introduced it.
BaseRate
Base rate over a labelled history.
Commit
One commit, reduced to what the labelling needs.
MergeRecord
One merge and whether history later took it back.

Constants§

LOG_FORMAT
The --format string parse_history expects.

Functions§

attribute
Places every target in targets on the mainline history.
base_rate
Rolls labelled merges up into a base rate.
history
Runs git log --first-parent in repo and returns output for parse_history.
label_merges
Labels every merge in history (newest first) as reverted or not, looking at most window commits forward from each merge.
parse_history
Parses git log LOG_FORMAT output, newest commit first.
revert_targets
Every distinct commit named by a This reverts commit line.