From 3d42f65f2e57c04c617ae29535b87688302a813f Mon Sep 17 00:00:00 2001 From: argszero Date: Thu, 3 Dec 2026 19:02:13 +0800 Subject: [PATCH] chore(release): v0.7.36 Five commits since v0.7.35 (#449, #451, #452, #453, #454). No schema change (18 either side). The version string moves in the five carriers the deploy gate guards: Cargo.toml, Cargo.lock, Dockerfile, docker-compose.yml and the new CHANGELOG heading. --- CHANGELOG.md | 12 ++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- Dockerfile | 6 +++--- docker-compose.yml | 4 ++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 361aac5..75b0186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 花了多少。 diff --git a/Cargo.lock b/Cargo.lock index b7bc167..3c2ae70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,7 +51,7 @@ dependencies = [ [[package]] name = "aitokenpool" -version = "0.7.35" +version = "0.7.36" dependencies = [ "aes-gcm", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 01d3ae8..6c34141 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aitokenpool" -version = "0.7.35" +version = "0.7.36" edition = "2021" description = "AI Token 共享池 — 企业 key 池 + 公共共享市场" license = "MIT" diff --git a/Dockerfile b/Dockerfile index 4a42c03..3445b28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index adad028..c160a15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# AITokenPool — Docker Compose 一键部署(v0.7.35) +# AITokenPool — Docker Compose 一键部署(v0.7.36) # # 快速开始: # export ATP_MASTER_KEY=$(openssl rand -hex 32) # 必填,见下方说明 @@ -16,7 +16,7 @@ services: aitokenpool: build: . - image: aitokenpool:0.7.35 + image: aitokenpool:0.7.36 ports: - "8080:8080" volumes: