feat(backthink): 自排 C1-2 本体 + TriggerUnknown 修 fail-open(V1)

- selfwake.go:WakeNow + 待跑槽容量 1(先探槽合并不过闸、槽空才过闸、同锁)+ 闸 4 轮/小时
  ($DATA_DIR/config/backthink.json,零新 env 键)+ 审计四条 what + 启动日志两键 + 组合根接线
- G-A(主人已批):TriggerUnknown 作零值、既有两值编号后移(语义不动),未知触发走**最紧分支**
- 5 个变异自检(拆闸/≤0 未回落/过闸挪到探槽前=G1 失效形态/槽无界/零值挪走)
⚠️ 服务侧已就绪但**她仍调不到**(自排工具面属 C1-3)⇒ 不得写「C 已完成」
This commit is contained in:
AskaEth committed 2026-10-06 20:25:04 +08:00
1 parent 301f8b4276
commit ed5005307a
12 files changed
+1193 -8

No files matched your search

+17
View File
@@ -25,6 +25,23 @@ func (b *Backthink) SetIMSink(im IMAdapter) {
b.rebuildPusherLocked()
}
// SetAuditSink 接入审计出口(网关,design/12 §N C.5)。它与上面两个 setter 同属
// **晚绑定**:网关比 backthink 晚组装,构造时拿不到。它不重建推送器——审计不在推送
// 路径上,换一个出口(或注入 nil)都不影响投递。
func (b *Backthink) SetAuditSink(a Auditor) {
b.mu.Lock()
defer b.mu.Unlock()
b.deps.Audit = a
}
// currentAuditor 在生命周期锁下返回当前审计出口,因此在途的一轮自排拿到的是
// 一致快照,而不是「一半旧一半新」的两个出口。
func (b *Backthink) currentAuditor() Auditor {
b.mu.Lock()
defer b.mu.Unlock()
return b.deps.Audit
}
// rebuildPusherLocked 用当前槽位、频率门与推送出口替换
// 推送器。调用方必须持有 b.mu。
func (b *Backthink) rebuildPusherLocked() {