Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes are recorded here. Versions follow [SemVer](https://semver.org/).

## v0.7.36 (2026-12-03)

自 v0.7.35 起累计 5 个提交(#449–#454)。**无 schema 变更(仍 18)**。这一版全在「说的事和做的不一致」上:两处门禁放过了它本该拦下的写法、两处散文把不存在的机制说成事实,另有一处端点不认协议自己的凭据。

- **Anthropic 端点接受协议自己的凭据头(#453,`94dd76e`)** — `POST /anthropic/v1/messages` 是 Anthropic 协议的端点,而入站提取器只读 `Authorization: Bearer`,没有 `x-api-key` 分支;官方 SDK 读 `ANTHROPIC_API_KEY` 发的正是 `x-api-key` ⇒ 一把有效 key 得到 `401 {"error":"unauthorized"}`,界面报成「API 密钥无效」,用户换 key、换多少次都一样。出站方向早就按协议分了(anthropic 上游发 `x-api-key`、openai/responses 发 `Bearer`),缺的只是入站这一半。新增 `presented_key`:Bearer 优先,回退只在 `Authorization` 缺失或不是 `Bearer` 形态时读 `x-api-key`;校验一行没动,放宽的是**携带方式**不是凭据强度。⚠️ 一处刻意的边界:写成 `Bearer <废值>` 时**不**回退 —— 一个写得不对的 Bearer 被另一个头救回来,「凭据错」与「凭据没带」在排障时又混成一种。⚠️ 射程如实说:`AuthUser` 是共享提取器 ⇒ 回退对**每个已认证路由**生效,不只 Anthropic 端点。
- **usage 保留门禁不再放过未配对读者(#449,`278dbbd`)** — 门禁守的是「每个读 `usage_records` 的地方都有窗口约束」,而它只按名册数人头:一个读点在语料里出现两次(一次带窗口、一次不带)时,成对与否它看不见,于是**静默丢弃读者**。改为按配对判定:出现即须成对,缺一就红。test-only,生产代码零改动。
- **同一门禁的生产区段只在模块边界结束(#451,`b419c54`)** — 截断判据此前按「第一个非模块标记」取,遇到引出模块的标记就提前收尾,后半段的读者出在语料之外、等于没被检查。改为只在引出一个模块的标记处截断,并补一条守卫这条截断本身。test-only。
- **`gift` 的触发点散文不再说「每个已认证请求」(#454,`0a517d4`)** — 三处载体(`ui/README.md`、`state_gate.rs` 的门禁注释、本文件 v0.7.26 条目里的括注)声称 `gift::ensure_daily_gift` 挂在每个已认证请求上、且管理员/运营者**恒**有 `gift_balance > 0`。两个断言都关于今天为假:生产调用点只有三处(`forward`、`forward_stream`、`GET /api/wallet`),鉴权入口只调 `touch_api_key`;赠送只在注册后 **10 天**窗口内发放。改后照 `gift.rs` 自己的头注写:由需要「可用余额含当日赠送」的读取点各自调用。⛔ `dao.rs` 三处与 v0.7.26 的 NFS 条目里同一短语说的是 `touch_api_key`,为真,未动。
- **`tx_retention_gate.rs` 的自数改对(#452,`f16fd01`)** — 注释写「四条测试」,实为五条(多出的是空转守卫)。属自数型散文、出生即错。

`cargo test` **614 → 616**。本版无 UI 改动,资产令牌不变:`app.js` `?v=20261112-2`、`i18n.js` `?v=20261112-2`、`style.css` `?v=20261012-1`、`api.js` `?v=20261012-1`、`data.js` `?v=20261017-2`。

## v0.7.35 (2026-11-12)

自 v0.7.34 起累计 2 个提交(#445–#446)。**无 schema 变更(仍 18)**。这一版补上两处「数据都在,就是看不见」的缺口:API Key 只能一撤到底、交易页看不出哪把 key 花了多少。
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aitokenpool"
version = "0.7.35"
version = "0.7.36"
edition = "2021"
description = "AI Token 共享池 — 企业 key 池 + 公共共享市场"
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# AITokenPool — multi-stage release image (v0.7.35)
# AITokenPool — multi-stage release image (v0.7.36)
#
# Build: docker build -t aitokenpool:0.7.35 .
# Build: docker build -t aitokenpool:0.7.36 .
# Run: docker run -p 8080:8080 -v "$PWD/atp-data:/data" \
# -e ATP_MASTER_KEY="$(openssl rand -hex 32)" \
# aitokenpool:0.7.35
# aitokenpool:0.7.36
#
# Notes:
# - unified data dir (rant 2026-08-19T20:53:23): ATP_DATA_DIR=/data holds
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AITokenPool — Docker Compose 一键部署(v0.7.35)
# AITokenPool — Docker Compose 一键部署(v0.7.36)
#
# 快速开始:
# export ATP_MASTER_KEY=$(openssl rand -hex 32) # 必填,见下方说明
Expand All @@ -16,7 +16,7 @@
services:
aitokenpool:
build: .
image: aitokenpool:0.7.35
image: aitokenpool:0.7.36
ports:
- "8080:8080"
volumes:
Expand Down
Loading