Includes current frontend and backend work in progress and removes generated artifacts from tracking to keep the repository clean for дальнейшая разработка. Co-authored-by: Cursor <[email protected]>
17 lines
436 B
TypeScript
17 lines
436 B
TypeScript
import type { RuleEvalHit } from "./types.js"
|
|
|
|
export type RecoveryMode = "always" | "never" | "conditional"
|
|
|
|
export function isRecoveryTransition(hit: RuleEvalHit | null): boolean {
|
|
return hit?.transition === "recovery"
|
|
}
|
|
|
|
export function shouldAllowRecoveryByPolicy(
|
|
hit: RuleEvalHit | null,
|
|
policy: RecoveryMode,
|
|
): boolean {
|
|
if (!isRecoveryTransition(hit)) return true
|
|
if (policy === "never") return false
|
|
return true
|
|
}
|