feat(seats): a pass's share of the windows by the run's effort, the weekly cutoff at 99 %

The 5-hour share of a running pass was a flat 0.25 points; it follows the
run's effort now, as the weekly share already did: 0.5 at max and any other
effort, 0.125 at xhigh - the pooled means of 5438 Opus 5.5 passes on 141
seat-runs (2026-10-12..15), rounded up. The weekly cutoff moves from 95 %
to 99 %: the weekly window is the budget the lenses run out of, and with
the running passes projected against the cutoff the last percent is spent
a pass at a time, not in a burst. REVIEW_GATES_LENS_COST_PCT and
REVIEW_GATES_LENS_COST_7D_PCT still override every effort.
This commit is contained in:
Jorijn van der Graaf 2026-10-31 21:13:55 +01:00
commit ea4d362a10
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
8 changed files with 44 additions and 31 deletions

View file

@ -82,7 +82,7 @@ int main() {
Eq(lines.at(3), "| 2 | 61% | 10:10 (in 10 min) | 18% | Thu 10 Sept, 10:00 (in 3d 0h) | — |");
Eq(lines.at(4), "| 3 | 62% | 10:15 (in 15 min) | 16% | Thu 10 Sept, 10:00 (in 3d 0h) | 22% |");
Eq(lines.at(5), "");
Eq(lines.at(6), "policy spread · ceiling 85% · handover at 90% · a lens is placed at +10% · 7d cutoff 95%");
Eq(lines.at(6), "policy spread · ceiling 85% · handover at 90% · a lens is placed at +10% · 7d cutoff 99%");
Eq(lines.at(7), "eligible now: seat 2 (25% headroom), seat 3 (25% headroom) → next lens: seat 2");
Eq(lines.at(8), "fable lenses: seat 3 (63% fable headroom)");
Eq(lines.at(9), "limited: seat 1 until 10:05 (in 5 min)");
@ -223,8 +223,8 @@ int main() {
auto pair = [](const std::pair<Json, std::string>& p) { return Json::array({p.first, p.second}); };
EqJson(pair(SeatUtil({{"five_hour", {{"utilization", 61}, {"resetsAt", 1}}}, {"seven_day", {{"utilization", 18}, {"resetsAt", 2}}}})), Json::array({60, "five_hour"}));
EqJson(pair(SeatUtil({{"five_hour", {{"utilization", 12}, {"resetsAt", 1}}}, {"seven_day_fable", {{"utilization", 97}, {"resetsAt", 2}}}})), Json::array({95, "seven_day_fable"}));
Eq(IsEligible(seat(1, 10, 96), With(cfg, {{"maxUtil", 100}})), false);
Eq(IsEligible(seat(1, 10, 94), With(cfg, {{"maxUtil", 100}})), true);
Eq(IsEligible(seat(1, 10, 99), With(cfg, {{"maxUtil", 100}})), false);
Eq(IsEligible(seat(1, 10, 98), With(cfg, {{"maxUtil", 100}})), true);
Eq(IsEligible(seat(1, 10, 94), cfg), false);
// Redaction: the seat's own token, token shapes and addresses; auth
// failures by status or by text.