Skip to content

release: 0.6.7——.cac 采集修复 + 线程池扩容 + updater 闭环 + dashboard P2 | .cac collection fix, thread-pool, updater hardening, dashboard P2 - #77

Merged
370025263 merged 12 commits into
mainfrom
release/0.6.7
Jul 10, 2026
Merged

Conversation

@370025263

Copy link
Copy Markdown
Collaborator

内容

修复

  • collector 补 nga3 分支:detect 认识 `~/.cac/projects` 但 collector 分发链漏了它,.cac(CodeAgent3)用户的轨迹从未被采集(客户反馈)。daemon 侧一直是好的,坏的只有这条平行链。
  • anyio 线程池扩容:所有 def 路由(search/resolve/team_sync/整个 dashboard)共享默认 40 线程池,embedding 后端慢时 /sync 打满它 → 网页失联(2026-07-10 生产事故)。`server.thread_pool_tokens` 可配默认 300。抬水位保命,根治见 openspec/backend-slow-resilience(docs(openspec): 慢后端韧性设计提案 | backend-slow resilience proposal #76)。
  • updater 三处闭环:PyPI 不领先时仍查 server(内网 server wheel 领先公网是常态,旧行为静默失效);pip 挂死加 600s 硬超时(代理黑洞会永久卡死单线程 updater);/version /wheel 加 client_id 日志(按用户排查更新链路)。

功能

  • dashboard console P2 整分支:登录/角色、我的控制台、管理页、设置页、skill_prefs 控制面、users_status 版本列、client 版本上报(X-Xskill-Version)。

测试

431 passed;唯一失败 test_canary_flip_promote_and_install_new_version 为 main 存量问题。新增回归:nga3 collector 覆盖、线程池容量、updater pypi_not_ahead / pip 超时。

🤖 Generated with Claude Code

370025263 and others added 12 commits July 10, 2026 14:11
…ion reporting

P2-2.1(D5): trajectories.user_key 列,canonical=user_name。team_client 桶
discover 入库时从 watch_dirs.label 写入;存量 scripts/backfill_user_key.py
一次性回填(幂等);metrics._traj_client_map 弃 label JOIN 改读新列。

P2-2.10: RegisterRequest.client_version + sync X-Xskill-Version header;
clients.client_version 列(touch 时 upsert,未上报不清既有值)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- clients.dashboard_token:--name 注册时发放(幂等),RegisterResponse 回传,
  connect 成功后 client 侧打印一次
- dashboard/auth.py:HMAC 签名 cookie 会话(secret 落 ~/.xskill/
  dashboard_secret.json 0600);登录=user_name+token;admin=dashboard.admins
  名单+admin_password 强口令(为空=admin 登录关闭);require_user/require_admin
  依赖(匿名 401/越权 403)
- mount_dashboard 增 serve_builtin 开关(D4):独立只读实例登录/写路由物理不挂载

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- registry:skill_prefs(user_key|*global*,skill,pref,set_by) + skill_lifecycle
  (retired);写入侧 pin 配额校验(D8,全局 pin 对全员合计),PinQuotaExceeded→409
- build_manifest 注入顺序(2.4):blocked 排除→pinned 占位→ranked→recommended
  回填;retired 无条件不分发(即便被 pin);bucket 枚举加 'pinned';推荐引擎
  exclude 集合并入 blocked/retired;sync 读路径 best-effort 绝不 500
- canary.check_and_decide:retired skill 返回 action='retired',不再晋升/翻牌
- dashboard/console.py(仅 serve 内置形态挂载,D4):
  /my/manifest /my/prefs /my/contributions /my/reco-trigger
  /admin/users-matrix /admin/user/{k}/prefs /admin/prefs /admin/skills
  /admin/skill/{n}/retire|unretire DELETE /admin/skill/{n}(confirm_name 二次
  确认+skill_repo_lock+prefs 清理,删后同名再生从零开始)
- admin 设置的条目普通用户不可取消/屏蔽(403);用户级推荐×触发口径:曝光=
  去重 recommendation_log(client→user_name 经 ClientRegistry 翻译,D5),
  触发=.ux_scores.jsonl 按用户轨迹归因;结论列阈值注释写死

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- /admin/config GET/validate/reload:校验失败不落盘不生效(no-fallback);
  原子落盘(tmp+rename);热加载=原地更新 _config(watcher/canary 持同一引用
  每轮现取)+推荐引擎缓存失效;llm/watch_dirs 段显式标注需重启
- tests/test_dashboard_console_p2.py:登录角色(匿名 401/越权 403/登出),
  注入顺序,全局 pin 排序,写入侧超量 409(含全局全员合计),admin 条目用户
  不可动,retire 断分发断裁决,delete 二次确认+prefs 清理,users-matrix
  版本列,config validate/reload

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
client_version 空=未上报;packaging.Version 比对 server 版本标 version_stale,
解析失败(dev 版)按不落后处理。旧 team_clients.db 无列时兼容读取。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ings

- 侧栏登录区(HMAC cookie 会话,/me 恢复);我的/管理/设置导航按角色显隐
- 我的(图④):槽位清单(pinned·自己/admin/全局 chip,admin 项置灰锁定),
  pin/✕屏蔽/恢复,贡献去向四级步进+使用者列表,推荐×触发结论列
- 管理(图⑤):用户矩阵(版本/触发率/停推建议)+右侧抽屉代 pin/代屏蔽,
  全局 pin chips,技能生命周期表(下线/恢复/删除输名确认)
- 设置(图⑦):config.yaml 原文编辑,仅校验/校验并热加载,热生效与需重启
  分色提示;用户连接状态表点亮版本列(落后=amber)
- Tailwind 重编译产物内联(BUILD.md 流程,零 CDN)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rdless of ecosystem

CS 用户桶注册时 ecosystem 是 bridge 检出的真实生态(ngagent 等)而非
team_client;P1 的 label 归因本就不分 ecosystem。discover/backfill 改为
label 非空即写 user_key,读语义与 P1 完全一致,source 唯一(D5)。
直插 trajectories 的测试 fixture 补 user_key 字段。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…) sessions in team client

detect_known_ecosystems 一直认识 ~/.cac/projects,但 collector.start_ingesters
的 if/elif 链漏了 nga3,落进 else: continue 被静默跳过。daemon 侧
(api/app.py:1043)和 skill 下发(daemon.py 的 installer dict)都是好的,
坏的只有这条平行分发链——典型的第 N 份拷贝忘了改。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…capacity

所有 def 路由(search/resolve/team_sync/整个 dashboard 含静态页)共享
anyio 默认线程池(40)。embedding 后端慢时 /sync 单请求可占线程数分钟,
40 被打满 → 网页整体失联(2026-07-10 生产事故,29ce2fe 之后的新一层)。
server.thread_pool_tokens 可配,默认 300。只是抬水位保命,堆积机制的
根治走 openspec/backend-slow-resilience(PR #76)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…date path, pip hang timeout, per-client audit log

三处闭环 client 自动更新链路(0.6.5 存量 client 收不到内网更新的病根):
1. latest<=current 曾直接 return——内网 server 预置 wheel 领先公网 PyPI
   是常态,只要 pypi.org JSON API 可达且无新版,server 渠道永远不被查询,
   更新静默失效。现在补 reason=pypi_not_ahead 的 server 检查。
2. subprocess.run 无 timeout——pip 遇代理黑洞挂死会永久卡死单线程
   updater,之后每小时检查全部消失。加 600s 硬上限 + pip --timeout/--retries。
3. /version /wheel 加 client_id 日志——access log 只有 IP 没身份,这是
   唯一能按用户查'更新请求到过没'的服务端痕迹。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@370025263
370025263 merged commit 335a2c7 into main Jul 10, 2026
7 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant