Commit Graph
2 Commits
Author SHA1 Message Date
tzt 3250e4e099 feat(proxy): T-P5 规范化+桶(canonical_hash 五规则/整形顺序/doc_version 失效)
- normalizer.py:resolve_bucket(X-Campus-Bucket 头 > 映射 > default,D-P2);
  normalize_messages(role\u0001content\u0002 串接,剔易变字段与时间戳行,
  多模态 content 取 text);is_cacheable(system 外 >1 条 = 多轮不缓存,D-P5);
  canonical_hash(bucket|doc_version|sha256(norm)——模板/资料不参与哈希,
  资料更新 = 版本+1 旧键失效);shape([canonical_system(无才注入)] ->
  [课程资料前缀(文件读取,不入git)] -> [原 messages],易变顶层字段剔除)
- 测试 +8:同义同哈希/易变剔除/模板不入哈希/doc_version 失效/多轮判定/
  整形顺序+资料注入/桶解析回落/序列化形态,全量 370 passed
2026-09-05 09:40:05 +08:00
tzt b109576707 feat(proxy): T-P0 代理层骨架(包结构/DDL/门控挂载/单进程校验)
- gateway/proxy/ 十文件:config(ProxyConfig:元->毫元加载期换算 D-P1、差异化售价、
  桶/峰谷/限流/semcache 配置)/ errors(8 类 HTTP 语义异常)/ ledger(四表两索引 DDL,
  WAL,ReviewQueue 连接纪律)/ auth·pricing·normalizer·semcache·upstream(§6 签名占位)
  / routes(/proxy/v1/models OpenAI 形状)/ __init__(build_proxy_router 组装点)
- settings DEFAULTS 增 proxy 段(enabled 默认 False,D-P7)
- api.py 首次 include_router(enabled 门控 + 装配失败不拖垮主应用)
- serve.py workers>1 拒绝启动(D-P9:WEB_CONCURRENCY/UVICORN_WORKERS 校验)
- 测试 +4(门控 404/DDL 幂等/毫元换算/池模型列表),全量 322 passed
2026-09-05 08:35:31 +08:00