feat(worker): serve/watch 唤醒也进服务端 ledger(广播 vs 已消费分明),补齐唤醒审计(#107)#309
Merged
Conversation
wake_delivery_ledger 原只覆盖 webhook。serve/watch 是拉模型,服务端能诚实记录的事实是: 这条 @ 被广播了、且被 @ 的目标是已登记 serve/watch 的可唤醒 agent → result='broadcast' (不是已确认消费);该 agent 之后 resume 且引用了这条 @(复用 #191 的 @->resume 观测, linkWakeResume)才升为 result='consumed'。绝不因广播了就声称唤醒成功。 adapter_kind 记 serve/watch/webhook;被 #180 暂停的目标不落 broadcast 行; wake 预算(#108)只计 adapter_kind='webhook'(烧订阅那类),serve/watch 拉模型不入预算。
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.
做什么(#107,[P3][design])
wake_delivery_ledger原只覆盖 webhook 唤醒;serve/watch 的唤醒无服务端 ledger——无法审计它们是否被唤醒(#191 也标了这缺口阻塞了 serve/watch 探针失败的可观测性)。怎么修(诚实的 ledger,不 overclaim)
recordServeWatchWakes(msg)(afterSend、消息已落库广播后):对每个被 @ 的、已登记 serve/watch 的可唤醒目标,写一行 ledgeradapter_kind='serve'/'watch'、result='broadcast'——诚实:serve/watch 是拉模型,服务端能确证的只是「这条 @ 被广播了、目标是可唤醒 agent」,不是「已消费」。linkWakeResume)→ 升为result='consumed'。broadcast 与 consumed 泾渭分明,绝不因「广播了」就声称唤醒成功。adapter_kind='webhook'(烧订阅那类),serve/watch 的 broadcast/consumed 行不入预算(拉模型不烧对方订阅)。门禁(对 origin HEAD rebase 到含 #108 的 main 后亲验)
recordServeWatchWakes空转 → [P3][design] wake 投递审计只覆盖 webhook:serve/watch 的唤醒链路无服务端 ledger #107 spec 红。复绿。🤖 opus agent 实现(诚实区分 broadcast/consumed、复用 #191、协调 #108/#180)、收尾截断我接管(审+提交+复验)。