Documentation
¶
Overview ¶
Package evidence computes review evidence the author cannot fake, scoped to an item's declared targets (T-01KYD88KE): the B-0009 class (exported, declared, never consumed) and the B-0003 class (one call site diverging from twenty siblings). The server surfaces, the agent judges — records render one line each, capped, deterministic, never a veto.
Index ¶
- Constants
- func DivergentCallers(g graph.Graph, targets []string, load func(path string) []byte) []string
- func Duplicates(changed []IndexedNode, index []IndexedNode) []string
- func Similarity(a, b Print) float64
- func Unconsumed(g graph.Graph, targets []string, suppressed map[string]string) []string
- type IndexedNode
- type Print
Constants ¶
const DupThreshold = 0.85
DupThreshold marks a pair redundant: at 0.85 shingle-Jaccard the two blocks share their structure with only local renames — the proving gate/rule twin scores well above, unrelated same-idiom code well below (calibrated by the fixture test, T-01KYD9R).
Variables ¶
This section is empty.
Functions ¶
func DivergentCallers ¶
DivergentCallers reports call sites whose argument shape is in a small minority against their siblings — the B-0003 class. The graph carries no argument metadata (rejected: grows every edge for one consumer), so the sweep re-parses only the files the inbound call edges name, bounded.
func Duplicates ¶
func Duplicates(changed []IndexedNode, index []IndexedNode) []string
Duplicates reports, for each changed node, its best index match at or above DupThreshold — one match per node (the best; more is noise), test against test and production against production only (fixture boilerplate across tests is a deliberate idiom, not redundancy). Bucketed by shared shingle so the comparison is candidates-only, never all-pairs.
func Unconsumed ¶
Unconsumed reports exported function-kind symbols under the target paths with zero inbound call/use edges from outside their own file — declared and never consumed. Suppressions (unconsumed-ok body directives) render visibly instead of counting; a directive naming an unflagged symbol is itself flagged stale, so suppressions never outlive their reason.
Types ¶
type IndexedNode ¶
IndexedNode pairs a node with its fingerprint.
func BuildDupIndex ¶
BuildDupIndex fingerprints every function-kind node's span, reading spans only (never whole files repeatedly — spans come from one read per file). load returns nil to skip a file (unreadable or generated).
type Print ¶
Print is a fingerprint: the shingle-hash set plus its significant-token count.
func Fingerprint ¶
Fingerprint normalizes a span and shingles it. Go spans normalize via go/scanner with identifiers and basic literals replaced by kind placeholders (type-2 clones: renamed copies still match); non-Go spans fall back to whitespace-normalized byte shingles.