docs(comments): 注释中文化 · internal/runtime/orchestration(29 文件,纯替换)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 只翻注释/文档字符串:剥离注释后代码行逐字节不变(机械校验只剩允许的行尾注释形态)
- 裁决编号与 design 节号(02.4.3 / 11.4.2 / design/05 §9 等)逐字保留
- 复核:go build 绿;orchestration 及其子包(audit/comm)测试绿;gofmt 干净
This commit is contained in:
AskaEth committed 2026-10-04 13:30:04 +08:00
1 parent fe90f64a56
commit eb1828ee7a
29 files changed
+751 -949

No files matched your search

@@ -12,9 +12,8 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/bus"
)
// recvEvent blocks until an event arrives on ch or d elapses, failing the test
// on timeout. It makes delivery assertions deterministic instead of relying on a
// bare sleep.
// recvEvent 阻塞到 ch 上到达一个事件或 d 到期,超时则判测试失败。它让投递断言确定化,
// 而不必依赖干等的 sleep。
func recvEvent(t *testing.T, ch <-chan Event, d time.Duration) Event {
t.Helper()
select {
@@ -110,7 +109,7 @@ func TestAsk_TimeoutNoReply(t *testing.T) {
b := bus.New()
defer b.Close()
alice := New(b, "alice")
// bob has no ask handler, so nothing ever replies.
// bob 没有任何 ask 处理函数,因此永远不会有人回复。
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()
@@ -233,7 +232,7 @@ func TestEventSend_AddressedAndIsolated(t *testing.T) {
t.Fatalf("bob event = %+v, want name=direct from=alice", e)
}
// An event addressed to bob must not reach carol.
// 定向给 bob 的事件不得抵达 carol。
select {
case e := <-carolEvents:
t.Fatalf("carol unexpectedly received %+v", e)
@@ -266,9 +265,8 @@ func TestEventHandler_Concurrent(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
// Fire a mix of broadcasts and events addressed to recv so both event
// subscriptions (and their separate worker goroutines) invoke the handler
// concurrently.
// 混合发射广播与定向给 recv 的事件,使两个事件订阅(及其各自的工作 goroutine)
// 并发调用处理函数。
var wg sync.WaitGroup
for i := 0; i < n; i++ {
wg.Add(1)
@@ -349,7 +347,7 @@ func TestSend_NoErrorAndNoReceiver(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
// Publishing to a subject with no subscriber is a no-op, not an error.
// 向没有订阅者的 subject 发布是空操作,不是错误。
if err := alice.Send(ctx, "ghost", Event{Name: "nobody"}); err != nil {
t.Fatalf("Send to lost receiver: %v", err)
}