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

@ -43,6 +43,16 @@ export namespace Crafter::Review::SeatPool {
// rejections, none of the 119 with 139 or fewer.
// REVIEW_GATES_OAUTH_CONCURRENCY overrides.
constexpr std::int64_t OauthConcurrency = 128;
// What one running pass is projected to cost of an OAuth seat's windows,
// in percentage points, by the run's reasoning effort (every lens of a run
// shares --effort): the pooled means of 5438 Opus 5.5 passes on 141
// seat-runs (2026-10-12..15), rounded up - max 0.44 / 0.118, xhigh
// 0.12 / 0.033. The 85 % ceiling and the cutoff's last percent absorb the
// spread. An effort not in the table projects at the max figures;
// REVIEW_GATES_LENS_COST_PCT and REVIEW_GATES_LENS_COST_7D_PCT override
// every effort.
constexpr double LensCostPct(std::string_view effort) { return effort == "xhigh" ? 0.125 : 0.5; }
constexpr double LensCost7dPct(std::string_view effort) { return effort == "xhigh" ? 0.04 : 0.125; }
// The kinds whose processes cost money the ledger counts.
constexpr std::array<std::string_view, 2> Paid = {"api", "openrouter"};
// The kinds whose out/invalid verdict crosses drivers on the board.
@ -101,12 +111,9 @@ export namespace Crafter::Review::SeatPool {
void ApplyProbe(Json& seat, const Json& result);
std::string Describe(const Json& seat);
// The OAuth placement knobs, with the pool's own per-process projections:
// 0.25 of the 5-hour window (the 2026-10-15 load test moved a 20x seat's
// window 0.08 points a pass) and, for an account without a 5-hour limit,
// the measured share of the weekly window at the run's effort (0.04 at
// xhigh, 0.125 otherwise; REVIEW_GATES_LENS_COST_7D_PCT); and the
// per-account cap.
// The OAuth placement knobs, with the pool's own per-pass projections at
// the run's effort (LensCostPct, LensCost7dPct; the env overrides them)
// and the per-account cap.
Json PoolConfig(const std::map<std::string, std::string>& env, std::string_view effort = {});
double OauthProjected(const Json& seat, const Json& config);
// A window whose reset has passed counts as empty until the next reading.