* [ANT-ONLY] Log classifier evaluation results for analysis. * This helps us understand which classifier rules are being evaluated * and how the classifier is deciding on commands.
( command: string, behavior: ClassifierBehavior, descriptions: string[], result: ClassifierResult, )
| 115 | * and how the classifier is deciding on commands. |
| 116 | */ |
| 117 | function logClassifierResultForAnts( |
| 118 | command: string, |
| 119 | behavior: ClassifierBehavior, |
| 120 | descriptions: string[], |
| 121 | result: ClassifierResult, |
| 122 | ): void { |
| 123 | if (process.env.USER_TYPE !== 'ant') { |
| 124 | return |
| 125 | } |
| 126 | |
| 127 | logEvent('tengu_internal_bash_classifier_result', { |
| 128 | behavior: |
| 129 | behavior as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 130 | descriptions: jsonStringify( |
| 131 | descriptions, |
| 132 | ) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 133 | matches: result.matches, |
| 134 | matchedDescription: (result.matchedDescription ?? |
| 135 | '') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 136 | confidence: |
| 137 | result.confidence as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 138 | reason: |
| 139 | result.reason as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 140 | // Note: command contains code/filepaths - this is ANT-ONLY so it's OK |
| 141 | command: |
| 142 | command as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 143 | }) |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Extract a stable command prefix (command + subcommand) from a raw command string. |
no test coverage detected