Expand description
candor-classify — the curated effect classifier (crate+path -> effect), extracted to a STABLE
crate so both the nightly rustc_private lint AND a stable backend share ONE source of truth
(no drift). Pure string logic; no rustc internals. The effect vocabulary lives in candor-report.
Constants§
- CALIBRATED_
CRATES - The exact third-party crates
classifyhas effect rules for, and the crate-name PREFIXES it recognizes. This is the single source of truth for “what candor knows”: it is emitted beside the JSON report (<prefix>.calibrated.json) so the Claude Code receipt’s coverage check reads candor’s real coverage instead of a hand-copied list. Keep in lockstep withclassifybelow — thecalibrated_set_covers_classifiertest enforces that every named crate the classifier matches appears here. - CALIBRATED_
PREFIXES - DB_
CRATES - Database client crates whose execution verbs are I/O (see the DB branch in
classify). Module-level sodb_crates_are_calibratedcan enforceDB_CRATES ⊆ CALIBRATED_CRATES. - PATH_
CALIBRATED_ CRATES - Crates
classifymatches by PATH prefix rather than crate-name equality (their effectful modules are recognised, e.g.tokio::net::/async_std::fs::/mio::net::), so they’re absent fromCALIBRATED_CRATES(which the liveness test probes by crate name). The coverage check must still treat them as covered — otherwise it would mislabel the most common async crates as blind spots.
Functions§
- cap_
from_ name - capstd_
cap - Map a cap-std capability type to the effect it authorises. Holding one of these
(e.g.
&Dir) is the real, unforgeable right to perform that effect — so candor treats it as a declared capability, exactly like its own&Fstoken. - classify
- Classify a resolved callee by the crate it belongs to and its full path.
- classify_
extra - Project-supplied rules, consulted only when the built-in
classifyreturns None.