Expand description
The SURPRISE heuristic (the cold-repo hook) — SHARED so candor-scan’s scan-time note and
candor-query’s tour verb can’t drift. Generic over the effect element type.
The SURPRISE heuristic — the single (or top-N) most surprising transitive reach in a crate (the
cold-repo hook). SHARED so candor-scan’s scan-time note and candor-query’s tour verb CANNOT
drift: this crate hosts the one implementation, both callers delegate here.
Fully deterministic — pure call-graph + name analysis, NO LLM. A CANDIDATE is a function F that
INHERITS an effect E (E ∈ inferred[F] but E ∉ direct[F]); we BFS to the nearest local direct SOURCE
S and score by how surprising the reach is (a benign-named function reaching a scary effect). The
find is never wrong: candor path re-derives the chain and the gate is ground truth. When nothing
clears the bar the caller emits an honest “nothing hidden” fallback — never a manufactured surprise.
Generic over the effect element type (E: AsRef<str>), so BOTH candor-scan’s
BTreeSet<&'static str> maps AND candor-query’s BTreeSet<String> maps drive the SAME code.
Structs§
- Find
- A scored candidate reach. Generic over the caller’s effect-string type via owned
Stringfields, so the SAME struct serves candor-scan (&'static strmaps) and candor-query (Stringmaps).
Functions§
- any_
effectful - Is the crate EFFECTFUL — does ANY function carry a real (non-Unknown) effect? Governs whether the caller emits the honest “nothing hidden” fallback (effectful, but nothing clears the bar) vs nothing at all (a genuinely effect-free crate).
- best_
finds - Compute the top-
top_nmost surprising reaches, most-surprising first. DEDUPED by function — each function appears at most once (its single highest-scoring reach). The list is empty when nothing clears the bar (the caller decides whether to emit the honest fallback vs nothing, usingany_effectful).