lock threat: stepped ramp with +0.1 per level above 5

This commit is contained in:
Damocles 2026-04-22 23:27:10 +02:00
parent e24678ddce
commit 130627f39c

View file

@ -21,8 +21,11 @@ WlSessionLockSurface {
readonly property real _threat: {
if (!_threatEnabled || root.auth.failCount <= 0)
return 0;
const t = Math.min(1.0, root.auth.failCount / 5);
return t * t * 0.6; // quadratic: 1->0.024, 2->0.096, 3->0.216, 4->0.384, 5->0.6
const levels = [0, 0.05, 0.12, 0.3, 0.45, 0.6];
const n = root.auth.failCount;
if (n <= 5)
return levels[n];
return Math.min(1.0, 0.6 + (n - 5) * 0.1);
}
property real _heartbeat: 0