docs(patrol): 2026-06-18 文档维护 — session key 公式 + Pool 指标同步#759
Merged
Conversation
变更窗口 44f461f..5bc8c0c(WebChat 多租户 spec ②③⑤ + 测试/CI): - session-lifecycle.md: DeriveSessionKey 公式补全 workspaceID 维度。 key.go:52 实际签名为 5 字段 (ownerID|workerType|clientKey[|workspaceID]|workDir), 原文档漏 workspaceID(spec ① 方案3 锚点)。spec ③ 回归测试重新锁定 key 派生维度不变量,使该公式描述落本次窗口照射范围。 - metrics.md Pool 指标表: 补 5 个 ObservableGauge(utilization / active_sessions / distinct_users / distinct_workspaces / memory_reserved_bytes),其中后 4 个为 spec ⑤ 新增;获取结果标签表补 workspace_quota_exceeded / memory_exceeded。spec ⑤ 重新照亮 Pool 配额 监控区域,按 reference 1:1 同步原则补全整个 Pool 指标表。 WebChat 多租户 HTTP 端点(/api/workspaces、/api/auth)自 spec ① 起潜伏、 未注册路由(routes.go TODO spec ⑥),前端 UI 归 spec ⑥,故 multi-tenant.md / admin-api.md / agent-config-system.md 对潜伏功能保持沉默,一致不文档化。 Co-Authored-By: Claude <noreply@anthropic.com>
hotplex-ai
approved these changes
Jun 17, 2026
hotplex-ai
left a comment
Owner
There was a problem hiding this comment.
Code Review — hotplex-ai
Verdict: ✅ APPROVE | P0:0 P1:0 P2:0 P3:1
纯文档维护 PR(+8/-1,2 文件)。逐条核对文档声称与源码,全部吻合:
session-lifecycle.md — DeriveSessionKey 公式
key.go:52-58签名确为 5 字段,workspaceID != ""时才加入派生 → 与文档[|workspaceID]及"仅非空时加入"完全一致;切换 workspace 产生新 Key 成立。MaxClientKeyLen = 256(manager.go:41)与文档一致。
metrics.md — Pool 指标 + result 标签
- 5 个 ObservableGauge 名称/描述与
pool.go:33-72逐一匹配;utilization确为 Float64ObservableGauge,文档 "(float)" 标注准确;其余为 Int64。 workerMemoryEstimate = 512MB(pool.go:122)与文档"512MB/worker 估算值"一致。- result 标签
workspace_quota_exceeded/memory_exceeded与常量(pool.go:127-128)+ Acquire emit(184-198)一致;配置键max_per_workspace(config_types.go:619)与文档注释一致。 distinct_workspaces仅在 workspaceID 非空时累加,platform/cron 走workspaceID=""确实被排除 → 与文档"不含 platform 会话"一致。
[P3] 表格类型标注风格不一致 (docs/reference/metrics.md:142)
hotplex.pool.utilization 标为 ObservableGauge (float),而同表新增的其他 4 个 gauge 及全文其他 ObservableGauge(worker.memory.bytes / gateway.connections)均只写 ObservableGauge。utilization 是 Float64、其余是 Int64,单点标注略显突兀——建议要么统一标 (float)/(int),要么统一不标。非阻塞,可选。
可选 FYI(超本 PR scope,勿在此处理):hotplex.session.transition.guard.repersist.failures / .overwrites(instruments.go:674,688)两个 Counter 已注册但 metrics.md 未文档化,可纳入下一轮文档巡逻。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
变更驱动巡逻,窗口
44f461ff..5bc8c0ce(WebChat 多租户 spec ②③⑤ + 测试/CI)。docs/explanation/session-lifecycle.md— DeriveSessionKey 公式补全workspaceID维度。key.go:52实际签名为 5 字段(ownerID|workerType|clientKey[|workspaceID]|workDir),原文档漏workspaceID(spec ① 方案3 锚点)。spec ③ 回归测试重新锁定 key 派生维度不变量,使该公式描述落本次窗口照射范围。docs/reference/metrics.md— Pool 指标表补 5 个 ObservableGauge(utilization/active_sessions/distinct_users/distinct_workspaces/memory_reserved_bytes,后 4 个为 spec ⑤ 新增);获取结果标签表补workspace_quota_exceeded/memory_exceeded。spec ⑤ 重新照亮 Pool 配额监控区域,按 reference 1:1 同步原则补全。判断依据
WebChat 多租户 HTTP 端点(
/api/workspaces、/api/auth)自 spec ① 起潜伏、未注册路由(routes.goTODO spec ⑥),前端登录 UI 归 spec ⑥。故multi-tenant.md/admin-api.md/agent-config-system.md对潜伏功能保持沉默,一致不文档化——待 spec ⑥ 前端上线后统一补充。Closes #758
🤖 Generated with Claude Code