llm-relay 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounting-store-io.js +0 -33
- package/dist/accounting-store-io.js.map +1 -1
- package/dist/accounting-store-schema.js +0 -65
- package/dist/accounting-store-schema.js.map +1 -1
- package/dist/accounting-store.js +0 -195
- package/dist/accounting-store.js.map +1 -1
- package/dist/accounting.js +0 -72
- package/dist/accounting.js.map +1 -1
- package/dist/anthropic.js +0 -18
- package/dist/anthropic.js.map +1 -1
- package/dist/authEnv.js +0 -78
- package/dist/authEnv.js.map +1 -1
- package/dist/availability-snapshot.js +0 -58
- package/dist/availability-snapshot.js.map +1 -1
- package/dist/availability.js +0 -162
- package/dist/availability.js.map +1 -1
- package/dist/backend.js +1 -416
- package/dist/backend.js.map +1 -1
- package/dist/benchmarks.js +1 -63
- package/dist/benchmarks.js.map +1 -1
- package/dist/breaker-persistence.js +0 -59
- package/dist/breaker-persistence.js.map +1 -1
- package/dist/candidates.js +0 -64
- package/dist/candidates.js.map +1 -1
- package/dist/catalog.js +1 -140
- package/dist/catalog.js.map +1 -1
- package/dist/circuit-breaker.js +1 -90
- package/dist/circuit-breaker.js.map +1 -1
- package/dist/claude-hook.js +0 -81
- package/dist/claude-hook.js.map +1 -1
- package/dist/cli.d.ts +36 -0
- package/dist/cli.js +73 -730
- package/dist/cli.js.map +1 -1
- package/dist/config-edit.js +0 -11
- package/dist/config-edit.js.map +1 -1
- package/dist/config.d.ts +21 -0
- package/dist/config.js +22 -372
- package/dist/config.js.map +1 -1
- package/dist/configured-limits.js +0 -58
- package/dist/configured-limits.js.map +1 -1
- package/dist/context-limits.js +0 -97
- package/dist/context-limits.js.map +1 -1
- package/dist/control-authorization.js +0 -36
- package/dist/control-authorization.js.map +1 -1
- package/dist/cooldown-clear.js +0 -6
- package/dist/cooldown-clear.js.map +1 -1
- package/dist/credential-fleet.js +0 -5
- package/dist/credential-fleet.js.map +1 -1
- package/dist/credential-select.js +4 -30
- package/dist/credential-select.js.map +1 -1
- package/dist/dashboard-auth.js +0 -29
- package/dist/dashboard-auth.js.map +1 -1
- package/dist/dashboard-contract.js +0 -46
- package/dist/dashboard-contract.js.map +1 -1
- package/dist/dashboard-routes.js +0 -32
- package/dist/dashboard-routes.js.map +1 -1
- package/dist/dashboard-snapshot.js +0 -154
- package/dist/dashboard-snapshot.js.map +1 -1
- package/dist/dashboard-static.js +0 -22
- package/dist/dashboard-static.js.map +1 -1
- package/dist/delegate-gate/cast-necessity.js +1 -22
- package/dist/delegate-gate/cast-necessity.js.map +1 -1
- package/dist/delegate-gate/cli.js +0 -6
- package/dist/delegate-gate/cli.js.map +1 -1
- package/dist/delegate-gate/diff-parser.js +0 -32
- package/dist/delegate-gate/diff-parser.js.map +1 -1
- package/dist/delegate-gate/fix.js +0 -10
- package/dist/delegate-gate/fix.js.map +1 -1
- package/dist/delegate-gate/gate.js +0 -12
- package/dist/delegate-gate/gate.js.map +1 -1
- package/dist/delegate-gate/minimality.js +0 -38
- package/dist/delegate-gate/minimality.js.map +1 -1
- package/dist/delegate-gate/post-image.js +1 -13
- package/dist/delegate-gate/post-image.js.map +1 -1
- package/dist/delegate-gate/shared-state.js +0 -23
- package/dist/delegate-gate/shared-state.js.map +1 -1
- package/dist/delegate-gate/test-assertions.js +1 -54
- package/dist/delegate-gate/test-assertions.js.map +1 -1
- package/dist/delegate-gate/types.js +0 -11
- package/dist/delegate-gate/types.js.map +1 -1
- package/dist/dialect-stream.js +9 -37
- package/dist/dialect-stream.js.map +1 -1
- package/dist/dispatch-exhaustion-persistence.js +0 -35
- package/dist/dispatch-exhaustion-persistence.js.map +1 -1
- package/dist/dispatch.js +0 -269
- package/dist/dispatch.js.map +1 -1
- package/dist/documents.js +0 -92
- package/dist/documents.js.map +1 -1
- package/dist/dotenv.js +0 -22
- package/dist/dotenv.js.map +1 -1
- package/dist/dynamic-pools.js +0 -93
- package/dist/dynamic-pools.js.map +1 -1
- package/dist/emitSse.js +0 -64
- package/dist/emitSse.js.map +1 -1
- package/dist/executable-lookup.js +0 -59
- package/dist/executable-lookup.js.map +1 -1
- package/dist/hard-cap.js +1 -32
- package/dist/hard-cap.js.map +1 -1
- package/dist/host-routing.js +0 -40
- package/dist/host-routing.js.map +1 -1
- package/dist/installed-hosts.js +0 -71
- package/dist/installed-hosts.js.map +1 -1
- package/dist/json-shape.js +0 -19
- package/dist/json-shape.js.map +1 -1
- package/dist/kernel/contracts.js +0 -26
- package/dist/kernel/contracts.js.map +1 -1
- package/dist/kernel/request-lifecycle.js +0 -4
- package/dist/kernel/request-lifecycle.js.map +1 -1
- package/dist/key-checker.js +0 -115
- package/dist/key-checker.js.map +1 -1
- package/dist/key-import.js +0 -20
- package/dist/key-import.js.map +1 -1
- package/dist/keys-cli.js +0 -15
- package/dist/keys-cli.js.map +1 -1
- package/dist/keystore.js +2 -51
- package/dist/keystore.js.map +1 -1
- package/dist/lane-cadence.js +1 -51
- package/dist/lane-cadence.js.map +1 -1
- package/dist/lane-manifest.js +0 -54
- package/dist/lane-manifest.js.map +1 -1
- package/dist/lane-probe.js +0 -36
- package/dist/lane-probe.js.map +1 -1
- package/dist/lane-quota-probe.js +0 -61
- package/dist/lane-quota-probe.js.map +1 -1
- package/dist/log.js +0 -17
- package/dist/log.js.map +1 -1
- package/dist/mcp/lane-runner.d.ts +114 -0
- package/dist/mcp/lane-runner.js +186 -0
- package/dist/mcp/lane-runner.js.map +1 -0
- package/dist/mcp/protocol.d.ts +98 -0
- package/dist/mcp/protocol.js +67 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/server.d.ts +78 -0
- package/dist/mcp/server.js +360 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/metadata.js +0 -73
- package/dist/metadata.js.map +1 -1
- package/dist/network-block.js +0 -45
- package/dist/network-block.js.map +1 -1
- package/dist/offload.js +0 -21
- package/dist/offload.js.map +1 -1
- package/dist/onboarding.js +0 -36
- package/dist/onboarding.js.map +1 -1
- package/dist/openai-dialect.js +0 -32
- package/dist/openai-dialect.js.map +1 -1
- package/dist/openai-request.js +0 -236
- package/dist/openai-request.js.map +1 -1
- package/dist/os-keyring.js +0 -28
- package/dist/os-keyring.js.map +1 -1
- package/dist/ping/cadence.js +3 -90
- package/dist/ping/cadence.js.map +1 -1
- package/dist/ping/metrics.js +0 -91
- package/dist/ping/metrics.js.map +1 -1
- package/dist/ping/ping.js +0 -17
- package/dist/ping/ping.js.map +1 -1
- package/dist/ping/probe-cache.js +2 -53
- package/dist/ping/probe-cache.js.map +1 -1
- package/dist/ping/quota.js +0 -17
- package/dist/ping/quota.js.map +1 -1
- package/dist/ping/runtime-telemetry.js +1 -18
- package/dist/ping/runtime-telemetry.js.map +1 -1
- package/dist/pool-health.js +0 -49
- package/dist/pool-health.js.map +1 -1
- package/dist/presets.js +0 -4
- package/dist/presets.js.map +1 -1
- package/dist/process-safety-net.js +0 -36
- package/dist/process-safety-net.js.map +1 -1
- package/dist/quota-demotion.js +1 -35
- package/dist/quota-demotion.js.map +1 -1
- package/dist/quota-observation.js +0 -21
- package/dist/quota-observation.js.map +1 -1
- package/dist/rate-limits.js +1 -94
- package/dist/rate-limits.js.map +1 -1
- package/dist/refusal-interpretation.js +2 -327
- package/dist/refusal-interpretation.js.map +1 -1
- package/dist/registry.js +0 -11
- package/dist/registry.js.map +1 -1
- package/dist/repair.js +1 -119
- package/dist/repair.js.map +1 -1
- package/dist/request-log.js +0 -2
- package/dist/request-log.js.map +1 -1
- package/dist/reshaper.js +0 -85
- package/dist/reshaper.js.map +1 -1
- package/dist/resolved-attempt.js +0 -3
- package/dist/resolved-attempt.js.map +1 -1
- package/dist/responses-request.js +0 -187
- package/dist/responses-request.js.map +1 -1
- package/dist/routes/admin.js +0 -38
- package/dist/routes/admin.js.map +1 -1
- package/dist/secret-file-acl.js +0 -26
- package/dist/secret-file-acl.js.map +1 -1
- package/dist/self-update.js +0 -118
- package/dist/self-update.js.map +1 -1
- package/dist/server.js +15 -952
- package/dist/server.js.map +1 -1
- package/dist/session-pin.js +0 -9
- package/dist/session-pin.js.map +1 -1
- package/dist/setup-claude.js +0 -9
- package/dist/setup-claude.js.map +1 -1
- package/dist/spend-headroom.js +0 -20
- package/dist/spend-headroom.js.map +1 -1
- package/dist/sse-frames.js +0 -31
- package/dist/sse-frames.js.map +1 -1
- package/dist/sse.js +1 -19
- package/dist/sse.js.map +1 -1
- package/dist/state-paths.js +0 -16
- package/dist/state-paths.js.map +1 -1
- package/dist/stream-commit.js +1 -27
- package/dist/stream-commit.js.map +1 -1
- package/dist/target-facts.js +2 -130
- package/dist/target-facts.js.map +1 -1
- package/dist/telemetry.js +0 -8
- package/dist/telemetry.js.map +1 -1
- package/dist/think-tags.js +1 -38
- package/dist/think-tags.js.map +1 -1
- package/dist/tier-data.js +0 -29
- package/dist/tier-data.js.map +1 -1
- package/dist/tool-dialects.js +1 -103
- package/dist/tool-dialects.js.map +1 -1
- package/dist/tool-use-ids.js +0 -51
- package/dist/tool-use-ids.js.map +1 -1
- package/dist/usage-observer.js +0 -52
- package/dist/usage-observer.js.map +1 -1
- package/dist/validator.js +1 -25
- package/dist/validator.js.map +1 -1
- package/dist/winenv.js +0 -63
- package/dist/winenv.js.map +1 -1
- package/dist/write-behind.js +0 -12
- package/dist/write-behind.js.map +1 -1
- package/package.json +2 -2
- package/skills/llm-relay/SKILL.md +26 -1
package/dist/availability.js
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Availability ladders — spec §5.1-5.3 of docs/quota-metering-spec-2026-08-16.md.
|
|
3
|
-
*
|
|
4
|
-
* `remaining` and `resetsAt` are resolved per (scope, axis, period) through fixed rungs, and
|
|
5
|
-
* staleness is handled HERE, at read time, as a pure function of the caller's clock — never by a
|
|
6
|
-
* repair write. freellmapi runs an UPDATE inside its GET path to restore `remaining` once a reset
|
|
7
|
-
* passes; the same correctness falls out of simply declining an observation that predates the
|
|
8
|
-
* current period boundary, because rung 2 recomputes from the ledger and rung 3 is null. A read
|
|
9
|
-
* path that never mutates cannot invent a replenished number.
|
|
10
|
-
*
|
|
11
|
-
* Provenance (repo invariant): every figure carries its basis; unknown stays null, never 0;
|
|
12
|
-
* no published limit, ceiling or multiplier is invented anywhere in this module. The one
|
|
13
|
-
* arithmetic step — rung 2's limit − localUsed — is labelled with WHERE its inputs came from
|
|
14
|
-
* ("derived:<limit-provenance>"), so a reader can always tell a stated figure from a computed one.
|
|
15
|
-
*
|
|
16
|
-
* Pure: no IO, no clock of its own (`now` is an argument), no imports from server.ts. It reads no
|
|
17
|
-
* store either — callers hand it observations, limits, usage and facts they already read. Its
|
|
18
|
-
* runtime imports are pure vocabularies: configured-limit axes/mapping and `target-facts.ts`'s
|
|
19
|
-
* closed kind set, so neither can be restated (and drift) in consumers. Gap 12 calls
|
|
20
|
-
* `resolveRemaining` from the routing path under `routingEligible`; nothing here reorders or
|
|
21
|
-
* refuses anything today.
|
|
22
|
-
*/
|
|
23
1
|
import { bucketKey } from "./quota-observation.js";
|
|
24
2
|
import { CONFIGURED_LIMIT_AXES, configuredLimitQuotaShape, } from "./configured-limits.js";
|
|
25
|
-
/**
|
|
26
|
-
* Project one raw accounting window onto the requested quota axis. The store's `basis` describes
|
|
27
|
-
* its TOKEN figure only; completed requests are counted by the relay and must never borrow that
|
|
28
|
-
* token provenance. Keeping this projection in one place makes the three ledger consumers agree.
|
|
29
|
-
*/
|
|
30
3
|
export function projectLocalUsed(reading, axis) {
|
|
31
4
|
if (reading === null)
|
|
32
5
|
return { value: null, basis: null };
|
|
@@ -38,26 +11,11 @@ export function projectLocalUsed(reading, axis) {
|
|
|
38
11
|
}
|
|
39
12
|
return { value: reading.tokens, basis: reading.basis };
|
|
40
13
|
}
|
|
41
|
-
/**
|
|
42
|
-
* The ONE definition of "which buckets may read the local ledger at all", wrapping
|
|
43
|
-
* `projectLocalUsed` so its three consumers cannot disagree.
|
|
44
|
-
*
|
|
45
|
-
* ⚠ An `"unknown"` period has no window to count, so rung 2 must not run for it and the ledger is
|
|
46
|
-
* never asked. `AccountingStore.usedInWindow` also declines the period by type; this is the
|
|
47
|
-
* runtime half of the same rule, in one place rather than hand-copied into
|
|
48
|
-
* `quota-demotion.ts`, `availability-snapshot.ts` and `candidates.ts` — three hand-copies of the
|
|
49
|
-
* quota bucket key is exactly how the last drift of this shape happened.
|
|
50
|
-
*/
|
|
51
14
|
export function localUsedForPeriod(read, period, axis) {
|
|
52
15
|
if (period === "unknown")
|
|
53
16
|
return { value: null, basis: null };
|
|
54
17
|
return projectLocalUsed(read(period), axis);
|
|
55
18
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Gather every (axis, period) carrying admissible quota evidence into insertion order.
|
|
58
|
-
* Callers still choose whether learned figures participate, how buckets are ordered after
|
|
59
|
-
* collection, and which local ledger reading feeds resolution.
|
|
60
|
-
*/
|
|
61
19
|
export function collectQuotaBuckets(input) {
|
|
62
20
|
const buckets = new Map();
|
|
63
21
|
const bucketFor = (axis, period) => {
|
|
@@ -70,11 +28,6 @@ export function collectQuotaBuckets(input) {
|
|
|
70
28
|
return bucket;
|
|
71
29
|
};
|
|
72
30
|
for (const observation of input.observations) {
|
|
73
|
-
// An unknown PERIOD is not an unknown QUOTA. The row still carries the provider's own
|
|
74
|
-
// limit/remaining, and it is admissible exactly when the provider also stated when the window
|
|
75
|
-
// resets — that reset is what the demotion expires against, so nothing has to be invented.
|
|
76
|
-
// Without one there is no boundary in reach and no period to derive one from, which is the
|
|
77
|
-
// case the old blanket `continue` was written for; keep declining it.
|
|
78
31
|
if (observation.period === "unknown" && !Number.isFinite(observation.resetsAt ?? Number.NaN))
|
|
79
32
|
continue;
|
|
80
33
|
bucketFor(observation.axis, observation.period).observations.push(observation);
|
|
@@ -93,18 +46,12 @@ export function collectQuotaBuckets(input) {
|
|
|
93
46
|
}
|
|
94
47
|
return buckets;
|
|
95
48
|
}
|
|
96
|
-
/** Rung-2 remaining basis for each limit provenance; a null basis never reaches this map. */
|
|
97
49
|
const DERIVED_BASIS = {
|
|
98
50
|
"provider-stated": "derived:provider-stated",
|
|
99
51
|
configured: "derived:configured",
|
|
100
52
|
learned: "derived:learned",
|
|
101
53
|
published: "derived:published",
|
|
102
54
|
};
|
|
103
|
-
/**
|
|
104
|
-
* UTC period boundaries (spec §5.2 ⚠ C4): providers overwhelmingly reset on UTC or a fixed vendor
|
|
105
|
-
* timezone, so EVERY provider-facing boundary here cuts on UTC. No local time anywhere. Month
|
|
106
|
-
* boundaries use real month lengths (leap years included) via Date.UTC normalization.
|
|
107
|
-
*/
|
|
108
55
|
const MINUTE_MS = 60_000;
|
|
109
56
|
const DAY_MS = 86_400_000;
|
|
110
57
|
export function periodStart(now, period) {
|
|
@@ -128,8 +75,6 @@ export function periodEnd(now, period) {
|
|
|
128
75
|
return null;
|
|
129
76
|
const at = new Date(start);
|
|
130
77
|
switch (period) {
|
|
131
|
-
// Next minute/day boundaries are simple offsets; month length varies, so let Date.UTC
|
|
132
|
-
// normalize month+1 day-1 → the first instant of the NEXT month.
|
|
133
78
|
case "minute":
|
|
134
79
|
return start + MINUTE_MS;
|
|
135
80
|
case "day":
|
|
@@ -140,15 +85,6 @@ export function periodEnd(now, period) {
|
|
|
140
85
|
return null;
|
|
141
86
|
}
|
|
142
87
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Is this observation still describing the CURRENT window?
|
|
145
|
-
*
|
|
146
|
-
* For a named period the test is the UTC boundary. For `"unknown"` there is no boundary to test
|
|
147
|
-
* against, so the observation's OWN stated reset is the window: before it, the figure describes
|
|
148
|
-
* the live window; at or after it, the window has rolled over and the figure is gone. That reset
|
|
149
|
-
* is the same fact `collectQuotaBuckets` required to admit the row at all, so an unknown-period
|
|
150
|
-
* observation reaching here always has one.
|
|
151
|
-
*/
|
|
152
88
|
function withinCurrentPeriod(observation, now, period) {
|
|
153
89
|
const { observedAt } = observation;
|
|
154
90
|
if (!Number.isFinite(observedAt) || observedAt > now)
|
|
@@ -160,20 +96,11 @@ function withinCurrentPeriod(observation, now, period) {
|
|
|
160
96
|
const start = periodStart(now, period);
|
|
161
97
|
return start !== null && observedAt >= start;
|
|
162
98
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Rung 1 eligibility: the observation must have been made WITHIN THE CURRENT PERIOD (UTC) and not
|
|
165
|
-
* in the future. An observation from yesterday's minute window says nothing about this one — but
|
|
166
|
-
* its `limit` half remains durable knowledge and feeds rung 2 below, which is why staleness is
|
|
167
|
-
* reported as a count instead of discarding the row.
|
|
168
|
-
*/
|
|
169
99
|
function eligibleObservation(observations, now, axis, period) {
|
|
170
100
|
let eligible = null;
|
|
171
101
|
let staleCount = 0;
|
|
172
102
|
for (const candidate of observations) {
|
|
173
|
-
// The bucket is (axis, period): a tokens/minute observation must never answer a
|
|
174
|
-
// requests/minute question even when it is the freshest thing on the cell.
|
|
175
103
|
if (candidate.axis === axis && candidate.period === period) {
|
|
176
|
-
// Newest-wins per tuple; ties keep the first seen (callers merge newest-first).
|
|
177
104
|
if (withinCurrentPeriod(candidate, now, period)) {
|
|
178
105
|
eligible ??= candidate;
|
|
179
106
|
}
|
|
@@ -184,23 +111,7 @@ function eligibleObservation(observations, now, axis, period) {
|
|
|
184
111
|
}
|
|
185
112
|
return { eligible, staleCount };
|
|
186
113
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Rung 2's LIMIT, when several provenances offer one.
|
|
189
|
-
*
|
|
190
|
-
* provider-stated > configured > learned > published, justified:
|
|
191
|
-
* - A limit read off THIS deployment's response header is first-party evidence about the exact
|
|
192
|
-
* quota window being resolved. Even an old observation's limit stays usable — a header limit is
|
|
193
|
-
* a statement about entitlement, not point-in-time state, and nothing fresher contradicts it.
|
|
194
|
-
* - An operator-declared figure outranks a parsed one because the operator can see their plan;
|
|
195
|
-
* `configured` is also the only rung whose wording was validated against a closed axis list.
|
|
196
|
-
* - `learned` came from a regex over refusal prose — real evidence, but parse-risky, so it ranks
|
|
197
|
-
* below both statements.
|
|
198
|
-
* - `published` (Gap 13) ranks last: catalogue figures are generic and frequently stale for free
|
|
199
|
-
* rosters (the context-window measurement recorded 0 of 29 pool/high members publishing any).
|
|
200
|
-
*/
|
|
201
114
|
export function resolveLimit(input) {
|
|
202
|
-
// Same tuple rule as rung 1: a limit stated for the tokens axis is not this requests-axis
|
|
203
|
-
// bucket's ceiling, however fresh it is.
|
|
204
115
|
const bucket = input.observations.find((observation) => observation.axis === input.axis && observation.period === input.period);
|
|
205
116
|
if (bucket?.limit !== undefined &&
|
|
206
117
|
Number.isFinite(bucket.limit) &&
|
|
@@ -219,13 +130,7 @@ export function resolveLimit(input) {
|
|
|
219
130
|
}
|
|
220
131
|
return { limit: null, basis: null };
|
|
221
132
|
}
|
|
222
|
-
/** The spec §5.1 ladder, one call per (scope, axis, period). */
|
|
223
133
|
export function resolveRemaining(input) {
|
|
224
|
-
// ⚠ Rung 2 subtracts THIS PERIOD's usage from a stated ceiling, so it needs a period to count.
|
|
225
|
-
// An `"unknown"` period has none, and a figure counted over some other window would be an
|
|
226
|
-
// invented remaining wearing a `derived:` label. Every caller already routes its ledger read
|
|
227
|
-
// through `localUsedForPeriod`, which returns null here — but this function is exported and
|
|
228
|
-
// pure, so it owns the rule rather than trusting each caller to remember it.
|
|
229
134
|
const localUsedValue = input.period !== "unknown" &&
|
|
230
135
|
typeof input.localUsed.value === "number" &&
|
|
231
136
|
Number.isFinite(input.localUsed.value)
|
|
@@ -247,11 +152,8 @@ export function resolveRemaining(input) {
|
|
|
247
152
|
}
|
|
248
153
|
const { limit, basis: limitBasis } = resolveLimit(input);
|
|
249
154
|
if (limit !== null && localUsedValue !== null) {
|
|
250
|
-
// NOT clamped: a negative remaining is information — it says this credential overshot its
|
|
251
|
-
// ceiling — and clamping would turn that into a plausible-looking zero. Renderers clamp.
|
|
252
155
|
return {
|
|
253
156
|
remaining: limit - localUsedValue,
|
|
254
|
-
// limitBasis is non-null here because `limit` is.
|
|
255
157
|
basis: DERIVED_BASIS[limitBasis],
|
|
256
158
|
limit,
|
|
257
159
|
limitBasis,
|
|
@@ -259,12 +161,9 @@ export function resolveRemaining(input) {
|
|
|
259
161
|
localUsedBasis: input.localUsed.basis,
|
|
260
162
|
eligibleObservation: null,
|
|
261
163
|
staleObservations: staleCount,
|
|
262
|
-
// M2: only figures derived from a STATEMENT (header or operator config) are trustworthy
|
|
263
|
-
// enough to act on. Learned prose-parses and catalog borrowings stay display-only.
|
|
264
164
|
routingEligible: limitBasis === "configured" || limitBasis === "provider-stated",
|
|
265
165
|
};
|
|
266
166
|
}
|
|
267
|
-
// Rung 3: unknown means NO OPINION — never 0, never "unlimited".
|
|
268
167
|
return {
|
|
269
168
|
remaining: null,
|
|
270
169
|
basis: null,
|
|
@@ -277,21 +176,7 @@ export function resolveRemaining(input) {
|
|
|
277
176
|
routingEligible: false,
|
|
278
177
|
};
|
|
279
178
|
}
|
|
280
|
-
/**
|
|
281
|
-
* The §5.2 ladder. Rung 1 (provider-stated) carries the same read-time eligibility rule as §5.1:
|
|
282
|
-
* a stated reset must still be in the future, else it is declined and the next rung answers.
|
|
283
|
-
*
|
|
284
|
-
* `providerStated` / `reviewedRule` arrive pre-resolved: the request path already applies
|
|
285
|
-
* ResetRules beside header parses (`server.ts` resolveReset), and re-parsing vendor prose here
|
|
286
|
-
* would risk two readers disagreeing about one response. This module only decides WHICH rung wins
|
|
287
|
-
* and computes the fallback boundary.
|
|
288
|
-
*/
|
|
289
179
|
export function resolveResetsAt(input) {
|
|
290
|
-
// A provider-stated reset must still be IN THE FUTURE to be authoritative. A skewed header or
|
|
291
|
-
// an observation whose reset passed while the period had not (freellmapi's UPDATE-on-read makes
|
|
292
|
-
// this observable) would otherwise render a reset time that has already passed — ranked ABOVE
|
|
293
|
-
// the correct derived-boundary rung. Non-future ⇒ ineligible, same read-time eligibility shape
|
|
294
|
-
// as rung 1; the ladder falls through rather than repairing the value.
|
|
295
180
|
if (input.providerStated !== null && Number.isFinite(input.providerStated) && input.providerStated > input.now) {
|
|
296
181
|
return { resetsAt: input.providerStated, basis: "provider-stated" };
|
|
297
182
|
}
|
|
@@ -303,46 +188,7 @@ export function resolveResetsAt(input) {
|
|
|
303
188
|
return { resetsAt: end, basis: "derived-boundary" };
|
|
304
189
|
return { resetsAt: null, basis: null };
|
|
305
190
|
}
|
|
306
|
-
// ── §5.2 rung inputs from persisted target-facts ────────────────────────────────────────────────
|
|
307
191
|
import { QUOTA_RESET_FACT_KINDS, FACT_RESET_BASIS_RUNG } from "./target-facts.js";
|
|
308
|
-
/**
|
|
309
|
-
* Turn the facts covering ONE credential×deployment cell into this bucket's rung-1/rung-2 inputs.
|
|
310
|
-
*
|
|
311
|
-
* The ONE place that policy lives, because both the dashboard producer (`availability-snapshot.ts`)
|
|
312
|
-
* and `llm-relay candidates` (`candidates.ts`) resolve the same cell: two implementations is how
|
|
313
|
-
* the two surfaces come to disagree about one row (the shape CLAUDE.md's "two paths, one policy
|
|
314
|
-
* empty" gotcha names). Neither caller re-parses vendor prose — a fact already carries the reset
|
|
315
|
-
* the request path resolved AND the rung it came from (`untilBasis`, minted by `server.ts`
|
|
316
|
-
* `resolveReset`).
|
|
317
|
-
*
|
|
318
|
-
* A fact may answer a bucket only when EVERY one of these holds; each clause is a provenance
|
|
319
|
-
* guard, not a nicety:
|
|
320
|
-
* - the fact's kind is one the QUOTA vocabulary can speak about (`QUOTA_RESET_FACT_KINDS`): an
|
|
321
|
-
* evicting condition ("this deployment is removed from selection") is not a statement about when
|
|
322
|
-
* an allowance refills, and rendering it as one is a category error dressed as a measurement;
|
|
323
|
-
* - the fact carries an explicit `untilBasis`: a legacy row or a kind's default TTL is the relay's
|
|
324
|
-
* own fallback, never something anybody stated;
|
|
325
|
-
* - its `until` is still in the future (rung 2 has no eligibility test of its own, so it gets one
|
|
326
|
-
* here rather than rendering a reset that has already passed);
|
|
327
|
-
* - the bucket is MEASURED-SPENT (`remaining !== null && remaining <= 0`). Unknown remaining has no
|
|
328
|
-
* effect whatsoever — the same rule quota demotion follows — and a bucket with headroom must
|
|
329
|
-
* never be handed a credential-wide reset: that would invent availability for a bucket nobody
|
|
330
|
-
* made a claim about, which is precisely the provenance invariant;
|
|
331
|
-
* - the ladder would otherwise fall through to the derived boundary (`observationReset === null`).
|
|
332
|
-
* A reset this response stated about this bucket always outranks a stored one.
|
|
333
|
-
*
|
|
334
|
-
* Within those gates the MOST-SPECIFIC scope wins per basis class, not the soonest expiry: callers
|
|
335
|
-
* pass `facts` in `factsFor()` order (attempt → group → deployment → credential → provider →
|
|
336
|
-
* model), and the first hit of each class is taken. Racing the two classes on recency would let an
|
|
337
|
-
* unrelated short fact pre-empt rung 2 entirely, so both inputs are returned independently and
|
|
338
|
-
* `resolveResetsAt` picks the rung.
|
|
339
|
-
*
|
|
340
|
-
* ⚠ Residual, stated rather than papered over: a fact carries no axis/period attribution, so a
|
|
341
|
-
* fact admitted here answers whichever spent bucket of the cell asked. The conjunction above IS
|
|
342
|
-
* the containment (same cell, measured-spent, and the provider said nothing about this bucket
|
|
343
|
-
* itself); an axis/period mapping inferred from the fact's kind would be exactly the invention
|
|
344
|
-
* `target-facts.ts` refuses ("scope comes from evidence, never from counting").
|
|
345
|
-
*/
|
|
346
192
|
export function factResetInputs(input) {
|
|
347
193
|
const spent = input.remaining !== null && input.remaining <= 0;
|
|
348
194
|
if (!spent || input.observationReset !== null) {
|
|
@@ -357,8 +203,6 @@ export function factResetInputs(input) {
|
|
|
357
203
|
continue;
|
|
358
204
|
if (!Number.isFinite(fact.until) || fact.until <= input.now)
|
|
359
205
|
continue;
|
|
360
|
-
// Read the rung from the single table in target-facts.ts. A missing key is a compile
|
|
361
|
-
// error there, so no unrecognised basis can reach here.
|
|
362
206
|
const rung = FACT_RESET_BASIS_RUNG[fact.untilBasis];
|
|
363
207
|
if (rung === "reviewed")
|
|
364
208
|
reviewed ??= fact.until;
|
|
@@ -367,11 +211,6 @@ export function factResetInputs(input) {
|
|
|
367
211
|
}
|
|
368
212
|
return { providerStated: stated, reviewedRule: reviewed };
|
|
369
213
|
}
|
|
370
|
-
/**
|
|
371
|
-
* Map internal bases onto the dashboard wire vocabulary in ONE place, so the producer and the
|
|
372
|
-
* contract cannot drift. `derived:published` maps onto `derived_configured`'s sibling spelling
|
|
373
|
-
* `derived_published`, added to the contract additively (see the design-doc note dated 2026-08-22).
|
|
374
|
-
*/
|
|
375
214
|
export function mapRemainingBasis(basis) {
|
|
376
215
|
if (basis === null)
|
|
377
216
|
return null;
|
|
@@ -405,7 +244,6 @@ export function mapLimitBasis(basis) {
|
|
|
405
244
|
return null;
|
|
406
245
|
}
|
|
407
246
|
}
|
|
408
|
-
/** The request-count spelling is additive on the dashboard wire; token spellings are unchanged. */
|
|
409
247
|
export function mapLocalUsedBasis(basis) {
|
|
410
248
|
if (basis === null)
|
|
411
249
|
return null;
|
package/dist/availability.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../src/availability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../src/availability.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAA2D,MAAM,wBAAwB,CAAC;AAE5G,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAE1B,MAAM,wBAAwB,CAAC;AAoBhC,MAAM,UAAU,gBAAgB,CAAC,OAAmC,EAAE,IAAe;IACnF,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC1D,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,QAAQ;YACvB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe;SAC1D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,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