Commit Graph
4 Commits
Author SHA1 Message Date
BaaRai e233c02314 Translate all Chinese text to English
Comments, doc comments, UI labels, log and error messages, LLM prompt
strings, markdown docs, test data and assertions. Identifiers, enum
keys, routes, placeholders and code structure are unchanged.

Notes:
- docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md
- tests that exercised CJK specific handling (GBK zip names, Chinese
  full text search) now use ASCII equivalents; go build passes and the
  test suite matches the pre translation baseline (remaining failures
  need a PostgreSQL DSN and fail identically on the original)
- frontend mention syntax now uses English kinds (finding, asset, ...)
  matching the backend, chat mentions tests pass
2026-10-08 23:14:34 +02:00
榆木 6b146d6c1b fix(llm): 一次性 LLM 调用补挂 session id,让自定义会话头真正生效 (#175)
自定义会话头(profile 的 session_header_key)的头值取自请求 context 上的
session id,而该 id 由 agentcore 仅在挂载 transcript store 时才写入 context
(agentcore.Prompt 中 `if s.writer != nil` 那一行)。

目标拆解(第 0 轮,DecomposeGoalsWithProvider)与冷节点压缩(§4 body 调用)
都是不挂 store 的一次性调用,context 上没有 session id,quotaAwareTransport
因此跳过该头。对 opencode zen 这类「缺 x-opencode-session 直接 400
MissingSessionID」的端点,表现为「第 0 轮目标拆解 400 失败、后续 planner
轮次却完全正常」;压缩失败则只留一行日志,极难关联到本设置。

改为在这两条路径显式挂上按探索稳定的 session id(exp<N>-goals /
exp<N>-compactor),与旁路问答、连接测试已有的做法一致。附带修好用量归因:
这两个 id 能被 llmrec.parseSession 正确解析,此前这两条路径的 token 完全
记不进 llm_usage。
2026-09-29 18:21:30 +08:00
Autumn-27 a816941286 style(agent): 清理 compaction.go 静态检查提示
- generationFor 移除未使用的 genBySig 参数(连同只写不读的 map 构造)
- 两处 WriteString(x+"\n") 改为 WriteString + WriteByte,避免多余拼接
- 一处 WriteString(fmt.Sprintf(...)) 改为 fmt.Fprintf
2026-09-13 12:05:11 -04:00
Autumn-27 2faee6ed99 feat(digest): 探索图冷节点压缩(cold-digest)
把老且长期不活跃的意图/事实折叠成 digest 节点进 graph_overview 展示,
原始节点永久保留、按 id 可完整还原(存储无损、只压呈现、折叠可逆)。

- 数据模型:KindDigest 节点 + RelCovers 边(真相源);新列 content_version、
  cold_since_round(节点级)、round_no(任务级 planner 轮次);均带旧库迁移。
- 纯算法(coldgraph.go):冷热判定(逆向可达 + 任一活分支即热) + R=6 轮防抖 +
  连通分量分组(§3) + §3.1 同父兄弟归组(救"热 hub+扁平死叶") + §5.3 签名。
- 后台压缩(compaction.go):minor 折未覆盖冷块(tiered)、major 回源重压合并碎片;
  签名幂等复用 body;提交时活跃度复核(绝不覆盖已复活节点);60s 冷却 + 互斥。
- 概览折叠(§6):recent_* 剔除已折成员 + 渲染时复活检查;cold_digests + 按资产
  索引 cold_index(§6.2);expand_digest/expand_index 还原;covered_members 反查
  悬空血缘 id;60 兜底截断均衡保 live。
- planner 每轮 OnPlannerRound 维护戳记并触发后台压缩,绝不上热路径。

纯算法单测覆盖 §附/§3.1/§2.3/§5.3;已对 437 节点真实图验证:热 86、冷候选 324、
§3.1 分组 47 块 + 14 孤立冷点(对齐设计文档实测校验)。
2026-09-09 11:52:15 -04:00