OAuth/UAT 子系统深度优化 (audit P0/P1/P2 + 3 轮 review 全收口):
Security:
- redact authorization code in oauth.js token-exchange log
- delete dead oauth-auto.js (Playwright helper with token-leak)
- refreshUAT 错误消息不再 dump 响应 JSON
- identity-state _classifyUatFailure 加 [A-Za-z0-9._-]{40,} redact 兜底
- OAuth 浏览器回调 HTML 不再显示 access_token 前 20 字节
Fixed:
- UAT refresh 跨进程锁 ~/.claude/ → ~/.feishu-user-plugin/
- cookie heartbeat 改为 ws-owner 单跑
- invalid_grant 显式 err.uatRevoked + _refineIdentity → UAT_REVOKED 状态机贯通
- 三层 adoptPersistedUATIfNewer race-shield
- withUAT retry 后也走 auth-code 检查
- OAuth + setup 全 fetch 加 timeoutMs
- credentials-monitor forceInvalidate 翻转 _initialized
- Lark Desktop reactor 冷启动 _lastSwitchAt debounce
- decodeTokenExpiry 失败 breadcrumb 按 sha256 dedup
- scripts/test-uat-race-child 修 (v1.3.7 起静默坏)
Changed:
- LarkOfficialClient.loadUAT() 标 @deprecated
- cli.js keepalive 不再污染 process.env
- 新 src/auth/env-backfill.js helper, 4 个 legacy caller 共用
Added:
- src/test-uat-lifecycle.js (18 case) + src/test-cookie-heartbeat.js (9 case) 接入 npm test
Docs:
- TROUBLESHOOTING 4 个新段
- error-codes "30-day" → "7-day refresh-token window"
- AUTH-SETUP ws-owner stale 30→60 秒 + 加 uat-refresh.lock
- RELEASING.md Step 2 显式列 6 处版本号
Release:
- 6 处版本号同步 bump + 10 个 CI gate 全通
- npm test: 84 PASS / 0 FAIL; smoke OK; cross-process race ~1500ms PASS
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>