Package org.egothor.methodatlas
Enum Class TagAiDrift
- All Implemented Interfaces:
Serializable,Comparable<TagAiDrift>,Constable
Describes the agreement between a source-level
@Tag("security") annotation
and the AI classification of the same test method.
Both the static annotation and the AI judgment are independent sources of truth. When they disagree the discrepancy is called drift:
TAG_ONLY— the method carries@Tag("security")in source but the AI considers it non-security-relevant. The annotation may be stale, inaccurate, or applied to the wrong method. Tag-based CI gates and audit dashboards over-count security coverage.AI_ONLY— the AI classifies the method as security-relevant but no@Tag("security")is present in source. Coverage dashboards and tag-based CI gates silently miss this test.NONE— both sources agree; no action needed.
Drift detection requires an active AI classification. When no
AiMethodSuggestion is available (AI disabled, class too large, etc.)
compute(java.util.List<java.lang.String>, org.egothor.methodatlas.ai.AiMethodSuggestion) returns null.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic TagAiDriftcompute(List<String> sourceTags, AiMethodSuggestion suggestion) Computes the drift between source-level security tags and the AI classification.toValue()Returns the lowercase hyphenated string representation used in CSV and SARIF output.static TagAiDriftReturns the enum constant of this class with the specified name.static TagAiDrift[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Both sources agree — either both say security-relevant or neither does. -
TAG_ONLY
Source code carries@Tag("security")but the AI disagrees. The annotation may be stale, inaccurate, or applied to the wrong method. -
AI_ONLY
AI classifies the method as security-relevant but no@Tag("security")is present in source. Coverage dashboards and tag-based CI gates will miss it.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
compute
Computes the drift between source-level security tags and the AI classification.- Parameters:
sourceTags- JUnit@Tagvalues extracted from the methodsuggestion- AI classification for the method, ornullwhen AI is disabled or unavailable- Returns:
- computed drift value, or
nullwhensuggestionisnull(drift cannot be determined without AI classification)
-
toValue
Returns the lowercase hyphenated string representation used in CSV and SARIF output.- Returns:
"none","tag-only", or"ai-only"
-