feat(plugins): expose historical quota observations by window

Let plugins page through retained account observations and find a prior baseline without reading raw provider documents or refreshing upstream. Reuse provider window identities and the existing completion index, preserving resets and gaps.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-11-17 17:06:55 +08:00
co-authored by Codex
parent 4d4c1e48ce
commit 832858dade
31 changed files with 706 additions and 34 deletions
+3 -1
View File
@@ -1175,7 +1175,9 @@ Admin 按卡片与所选指标向 Store 请求计数、金额或分布,缓存
预测数值复用统计投影的十五分钟开始时间桶,并以账号与五分钟完成时间桶分组。
完整完成时间桶合并累计量,跨采样截止值的小桶、开始时间边界和重建区间读取窄事实;
同一快照撤销待投影旧版本并加入当前源版本。预测采样保留请求完成状态,不按恢复标记排除请求;其他业务统计排除恢复请求。
Provider 文档按账号和完成时间索引读取,每个采样槽只保留最后一份
Provider 文档按账号和完成时间索引读取,预测每个采样槽只保留最后一份。
插件的[额度历史查询](../backend/crates/gateway-plugin/sdk/docs/capabilities.md#基础事实)沿同一索引分页,由 Provider 解释所选窗口;
它保留重置前后的读数,不计算预测或累计消耗
### 请求记录与交付