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:
parent
51bdd6298a
commit
ea4d362a10
8 changed files with 44 additions and 31 deletions
|
|
@ -59,8 +59,9 @@ int main() {
|
|||
Ids(seats) == "api1,1,2" && Ids(SeatPool::LoadSeats({}, std::nullopt, "")) == "local", Ids(seats));
|
||||
const std::string summary = DumpSpaced(SeatPool::Summary(seats));
|
||||
Check("no secret in the summary or the table", !(summary + SeatPool::Table(seats)).contains("tok-one") && !summary.contains("sk-ant"));
|
||||
Check("the pool's default projection is 0.25% of the 5-hour window per process (measured 0.08, 2026-10-15); the env overrides",
|
||||
Dyn::Equal(SeatPool::PoolConfig({}).at("lensCostPct"), 0.25) && Dyn::Equal(SeatPool::PoolConfig({{"REVIEW_GATES_LENS_COST_PCT", "5"}}).at("lensCostPct"), 5));
|
||||
Check("the 5-hour share of a pass follows the run's effort (0.125 at xhigh, 0.5 at max and any other); the env overrides every effort",
|
||||
Dyn::Equal(SeatPool::PoolConfig({}).at("lensCostPct"), 0.5) && Dyn::Equal(SeatPool::PoolConfig({}, "max").at("lensCostPct"), 0.5)
|
||||
&& Dyn::Equal(SeatPool::PoolConfig({}, "xhigh").at("lensCostPct"), 0.125) && Dyn::Equal(SeatPool::PoolConfig({{"REVIEW_GATES_LENS_COST_PCT", "5"}}, "xhigh").at("lensCostPct"), 5));
|
||||
|
||||
const double now = std::floor(Platform::Now());
|
||||
Json& api1 = seats[0];
|
||||
|
|
@ -109,7 +110,7 @@ int main() {
|
|||
Check("...and the seat is back after the back-off", !requeued && sc.at("state") == "ok" && SeatPool::Eligible(sc, now + SeatPool::ConcurrentBackoffS + 1, cfg, acfg));
|
||||
// 2026-10-31: an account whose 5-hour limit is removed reports the weekly
|
||||
// window alone; until then the pool took it for an unprobed seat - ranked
|
||||
// after every other, never held to the weekly cutoff. The cutoff is 95 %.
|
||||
// after every other, never held to the weekly cutoff. The cutoff is 99 %.
|
||||
const Json px = SeatPool::PoolConfig({}, "xhigh");
|
||||
Json nf = With(SeatPool::NewSeat("n", "oauth", "tn"), {{"state", "ok"}, {"running", 0}, {"pauseUntil", 0}, {"windows", {{"seven_day", {{"utilization", 3}, {"resetsAt", now + 6 * 86400}}}}}});
|
||||
Json f15 = With(SeatPool::NewSeat("f", "oauth", "tf"), {{"state", "ok"}, {"running", 0}, {"pauseUntil", 0},
|
||||
|
|
@ -119,13 +120,13 @@ int main() {
|
|||
for (const Json* s : SeatPool::Ranked(pair, now, px, acfg)) order.push_back(s->at("id").get<std::string>());
|
||||
Check("an account without a 5-hour window is placed by its weekly one: ranked by it, ahead of a seat at 5h 15 %, its running passes projected at the weekly figure",
|
||||
order == std::vector<std::string>{"n", "f"} && std::abs(SeatPool::OauthProjected(With(nf, {{"running", 100}}), px) - 7.0) < 1e-9, Dyn::Join(order, ","));
|
||||
Json n93 = With(nf, {{"windows", {{"seven_day", {{"utilization", 93}, {"resetsAt", now + 86400}}}}}});
|
||||
Json n93r40 = With(n93, {{"running", 40}});
|
||||
Json n93r60 = With(n93, {{"running", 60}});
|
||||
Check("...under the weekly cutoff alone, no 5-hour ceiling: at 93 % it takes a pass with 40 running, not with 60 (93 + 61 x 0.04 >= 95)",
|
||||
SeatPool::Eligible(n93r40, now, px, acfg) && !SeatPool::Eligible(n93r60, now, px, acfg));
|
||||
Json n95 = With(nf, {{"windows", {{"seven_day", {{"utilization", 95}, {"resetsAt", now + 86400}}}}}});
|
||||
Check("...and over the cutoff it waits for its weekly reset + 30 s", !SeatPool::Eligible(n95, now, px, acfg) && SeatPool::EarliestResume({n95}, now) == now + 86430);
|
||||
Json n97 = With(nf, {{"windows", {{"seven_day", {{"utilization", 97}, {"resetsAt", now + 86400}}}}}});
|
||||
Json n97r40 = With(n97, {{"running", 40}});
|
||||
Json n97r60 = With(n97, {{"running", 60}});
|
||||
Check("...under the weekly cutoff alone, no 5-hour ceiling: at 97 % it takes a pass with 40 running, not with 60 (97 + 61 x 0.04 >= 99)",
|
||||
SeatPool::Eligible(n97r40, now, px, acfg) && !SeatPool::Eligible(n97r60, now, px, acfg));
|
||||
Json n99 = With(nf, {{"windows", {{"seven_day", {{"utilization", 99}, {"resetsAt", now + 86400}}}}}});
|
||||
Check("...and over the cutoff it waits for its weekly reset + 30 s", !SeatPool::Eligible(n99, now, px, acfg) && SeatPool::EarliestResume({n99}, now) == now + 86430);
|
||||
Json n127 = With(nf, {{"running", 127}});
|
||||
Json n128 = With(nf, {{"running", 128}});
|
||||
Json nShared = With(nf, {{"running", 100}, {"foreign", {{"count", 28}, {"cost5h", 0.0}, {"cost7d", 0.0}, {"costUsd", 0.0}}}});
|
||||
|
|
|
|||
Loading…
Reference in a new issue