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.
- Base
Rate - Base rate over a labelled history.
- Commit
- One commit, reduced to what the labelling needs.
- Merge
Record - One merge and whether history later took it back.
Constants§
- LOG_
FORMAT - The
--formatstringparse_historyexpects.
Functions§
- attribute
- Places every target in
targetson the mainlinehistory. - base_
rate - Rolls labelled merges up into a base rate.
- history
- Runs
git log --first-parentinrepoand returns output forparse_history. - label_
merges - Labels every merge in
history(newest first) as reverted or not, looking at mostwindowcommits forward from each merge. - parse_
history - Parses
git log LOG_FORMAToutput, newest commit first. - revert_
targets - Every distinct commit named by a
This reverts commitline.