docs(comments): 注释中文化 · internal/runtime/model + internal/services/backthink(54 文件,纯替换)
- 只翻注释/文档字符串:`go/scanner` 剥注释后按 token 序列+literal 逐 token 比对,**54/54 文件 SAME**;
改动文件总行数与 HEAD 漂移 = 0(严格 1:1,无合并/拆行)
- 裁决编号与 design 节号逐字保留(03.4.1/03.4.2/03.4.3/14.4.1/14.4.5/07.4.2-4、design/04 §3.1/§3.2 等);
`chat_template_kwargs` / `enable_thinking` / `reasoning_effort` / `thinking:{type}` 字段名与形状说明未动
- 存疑译法(已登记):`persona` 在叙事语境用「角色」、标识符语境保留 `persona`(仓库既有模块本身混用);
`rung`→「级」;`provider` 存在「提供商/提供者」两种落笔(可按需一键统一)
- 复核:build/vet 绿 + 两包测试绿;gofmt 干净;残留英文注释 0 条
- 既有存量(未修,只报告):`model/anthropic_test.go` 612 行 >500;`applyAnthropicEvent` 115 行 >80
This commit is contained in:
1 parent
f5cf117482
commit
3dc1232bc2
54 files changed
+1923
-1923
No files matched your search
@@ -1,20 +1,20 @@
|
||||
package backthink
|
||||
|
||||
// eventRedundant reports whether tr is a duplicate of the immediately preceding
|
||||
// event-driven push (same source + summary), so a repeating device/reminder event
|
||||
// does not spam the owner (防刷). It is the one guard that still applies to an
|
||||
// event-driven push while the PushGate itself is bypassed for events (owner
|
||||
// mandate: "该发就发" — a genuine event goes out, only a true duplicate is held).
|
||||
// eventRedundant 报告 tr 是否与前一次事件驱动的推送重复
|
||||
// (同源 + 同摘要),因此重复的设备/提醒事件
|
||||
// 不会刷屏主人(防刷)。当 PushGate 对事件本身被绕过时,
|
||||
// 它是仅剩的一道仍适用于事件驱动推送的
|
||||
// 门(主人要求:"该发就发"——真正的事件照发,只扣下真正的重复)。
|
||||
//
|
||||
// It atomically records tr as the latest event key when the push proceeds, and
|
||||
// clears the key on any non-event push (heartbeat) so a later repeat of a prior
|
||||
// event is not spuriously suppressed by an intervening reflection.
|
||||
// 推送进行时它原子地把 tr 记为最新事件键,并在任何非事件推送
|
||||
// (心跳)时清除该键,以免更早事件的再次重复
|
||||
// 被中间一次反思错误地抑制。
|
||||
//
|
||||
// The caller runs it before handing the push to the Pusher; a true duplicate is
|
||||
// recorded as suppressed (RouteNone) rather than delivered.
|
||||
// 调用方把它跑在把推送交给 Pusher 之前;真正的重复
|
||||
// 会被记为已抑制(RouteNone),而不是投递出去。
|
||||
func (b *Backthink) eventRedundant(tr Trigger) bool {
|
||||
if tr.Kind != TriggerEvent {
|
||||
// A non-event push (heartbeat) breaks the same-event chain.
|
||||
// 非事件推送(心跳)会打断同一事件链。
|
||||
b.eventMu.Lock()
|
||||
b.lastEventKey = ""
|
||||
b.eventMu.Unlock()
|
||||
|
||||
Reference in new issue
Block a user