effectiveTierFor method
Returns the effective evidence tier for a specific stable ID, applying any perStableIdTier override on top of the detector's base tier. Returns tier when no override is set.
With severity ('warning', 'critical'), a result of
runtimeVerified or above stands only when '<stableId>.<severity>' is
covered, through the canonical coveredThresholds or an
additionalBrackets spec. Otherwise the result is the base tier, or
EvidenceTier.reproducerOnly when the base itself is runtimeVerified
or above.
A colon-parametric id (high_frequency_same_path:<fingerprint>,
tracked_resource_concurrent:<name>) with no entry of its own reads
its family's tier and coverage.
Implementation
EvidenceTier effectiveTierFor(String stableId, {String? severity}) {
final colon = stableId.indexOf(':');
final family =
colon > 0 && !(perStableIdTier?.containsKey(stableId) ?? false)
? stableId.substring(0, colon)
: stableId;
final effective = perStableIdTier?[family] ?? tier;
if (severity == null ||
effective.index < EvidenceTier.runtimeVerified.index) {
return effective;
}
final key = '$family.$severity';
final covered =
(coveredThresholds?.contains(key) ?? false) ||
(additionalBrackets?.any((b) => b.coveredThresholds.contains(key)) ??
false);
if (covered) return effective;
return tier.index >= EvidenceTier.runtimeVerified.index
? EvidenceTier.reproducerOnly
: tier;
}