Function
determineTier
(
hasText: boolean,
textLength: number,
budgetRemaining: number,
forceTier?: AnalysisTier,
)
Source from the content-addressed store, hash-verified
| 191 | } |
| 192 | |
| 193 | function determineTier( |
| 194 | hasText: boolean, |
| 195 | textLength: number, |
| 196 | budgetRemaining: number, |
| 197 | forceTier?: AnalysisTier, |
| 198 | ): AnalysisTier { |
| 199 | if (forceTier !== undefined) return forceTier; |
| 200 | |
| 201 | // No text or very short text: Tier 0 only |
| 202 | if (!hasText || textLength < MIN_TEXT_LENGTH) return 0; |
| 203 | |
| 204 | // Budget exhausted: fall back to Tier 0 |
| 205 | if (budgetRemaining <= 0) return 0; |
| 206 | |
| 207 | // Has text and budget: use Tier 1 |
| 208 | return 1; |
| 209 | } |
| 210 | |
| 211 | // --- Batch Processing --- |
| 212 | |
Tested by
no test coverage detected