@baoanaz/cviauto 0.6.6 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/templates/claude/agents/trellis-check.md +61 -61
  2. package/dist/templates/claude/agents/trellis-implement.md +58 -58
  3. package/dist/templates/claude/agents/trellis-research.md +67 -67
  4. package/dist/templates/codebuddy/agents/trellis-check.md +61 -61
  5. package/dist/templates/codebuddy/agents/trellis-implement.md +58 -58
  6. package/dist/templates/codebuddy/agents/trellis-research.md +67 -67
  7. package/dist/templates/codex/agents/trellis-check.toml +99 -30
  8. package/dist/templates/codex/agents/trellis-implement.toml +99 -16
  9. package/dist/templates/codex/agents/trellis-research.toml +116 -39
  10. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +41 -41
  11. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +194 -261
  12. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +59 -93
  13. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +72 -110
  14. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +120 -171
  15. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +35 -43
  16. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +78 -78
  17. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +24 -24
  18. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +29 -29
  19. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +46 -46
  20. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +28 -28
  21. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +66 -66
  22. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +32 -32
  23. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +40 -40
  24. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +40 -40
  25. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +44 -44
  26. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +79 -79
  27. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +37 -37
  28. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +43 -43
  29. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +47 -47
  30. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +40 -40
  31. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +33 -33
  32. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +61 -61
  33. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +41 -41
  34. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +31 -31
  35. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +40 -40
  36. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +40 -41
  37. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +36 -36
  38. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +36 -38
  39. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +52 -52
  40. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +45 -45
  41. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +41 -42
  42. package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +28 -28
  43. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +30 -30
  44. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +34 -34
  45. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +30 -30
  46. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +39 -39
  47. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +40 -40
  48. package/dist/templates/common/commands/continue.md +28 -29
  49. package/dist/templates/common/commands/finish-work.md +32 -40
  50. package/dist/templates/cursor/agents/trellis-check.md +61 -61
  51. package/dist/templates/cursor/agents/trellis-implement.md +58 -58
  52. package/dist/templates/cursor/agents/trellis-research.md +67 -67
  53. package/dist/templates/droid/droids/trellis-check.md +64 -56
  54. package/dist/templates/droid/droids/trellis-implement.md +61 -53
  55. package/dist/templates/droid/droids/trellis-research.md +67 -67
  56. package/dist/templates/gemini/agents/trellis-check.md +64 -57
  57. package/dist/templates/gemini/agents/trellis-implement.md +61 -54
  58. package/dist/templates/gemini/agents/trellis-research.md +67 -67
  59. package/dist/templates/kiro/agents/trellis-check.json +15 -3
  60. package/dist/templates/kiro/agents/trellis-implement.json +15 -3
  61. package/dist/templates/kiro/agents/trellis-research.json +10 -2
  62. package/dist/templates/kiro/agents/trellis.json +19 -5
  63. package/dist/templates/opencode/agents/trellis-check.md +61 -61
  64. package/dist/templates/opencode/agents/trellis-implement.md +58 -59
  65. package/dist/templates/opencode/agents/trellis-research.md +67 -67
  66. package/dist/templates/pi/agents/trellis-check.md +99 -21
  67. package/dist/templates/pi/agents/trellis-implement.md +90 -22
  68. package/dist/templates/pi/agents/trellis-research.md +124 -12
  69. package/dist/templates/qoder/agents/trellis-check.md +64 -57
  70. package/dist/templates/qoder/agents/trellis-implement.md +61 -54
  71. package/dist/templates/qoder/agents/trellis-research.md +67 -67
  72. package/dist/templates/trae/agents/trellis-check.md +64 -57
  73. package/dist/templates/trae/agents/trellis-implement.md +61 -54
  74. package/dist/templates/trae/agents/trellis-research.md +67 -67
  75. package/dist/templates/trellis/agents/check.md +29 -29
  76. package/dist/templates/trellis/agents/implement.md +30 -30
  77. package/dist/templates/trellis/workflow.md +349 -356
  78. package/dist/templates/zcode/agents/trellis-check.md +64 -51
  79. package/dist/templates/zcode/agents/trellis-implement.md +61 -53
  80. package/package.json +2 -2
@@ -1,25 +1,18 @@
1
- # Forum Channels
1
+ # 论坛频道(Forum Channels
2
2
 
3
- Forum channels are durable, topic-style channels. They are created with
4
- `--type forum` at channel-creation time and are immutable after that. They are
5
- not normal chat streams: the default read path is
6
- **forum summary -> one thread timeline -> current context**.
3
+ 论坛频道是持久化、主题式的频道。在频道创建时通过 `--type forum` 指定,创建后不可更改。它们不是普通的聊天流:默认的阅读路径是
4
+ **论坛摘要(forum summary) -> 单个线程时间线(one thread timeline) -> 当前上下文(current context)**。
7
5
 
8
- ## Forum vs Regular Channel
6
+ ## 论坛 vs 普通频道
9
7
 
10
- A channel's type is set with `--type` on `channel create` and never changes:
8
+ 频道类型在 `channel create` 时通过 `--type` 设置,且永不改变:
11
9
 
12
- - `chat` (default) flat message timeline. `channel messages` always renders
13
- the event stream. Forum-only flags such as `--thread` and `--action` are
14
- rejected here.
15
- - `forum` — thread-oriented. `channel messages` without filters renders a
16
- thread-board summary instead of raw events. The `post`, `forum`, `thread`,
17
- and `thread rename` subcommands only apply to forum channels.
10
+ - `chat`(默认)—— 扁平消息时间线。`channel messages` 始终渲染事件流。论坛专用 flags `--thread` 和 `--action` 在此处会被拒绝。
11
+ - `forum` —— 面向线程(thread-oriented)。不带过滤条件的 `channel messages` 渲染线程面板摘要而非原始事件。`post`、`forum`、`thread` `thread rename` 子命令仅适用于论坛频道。
18
12
 
19
- Both types share the same scope model (`--scope project` is the default;
20
- `--scope global` puts the channel in the cross-project bucket).
13
+ 两种类型共享相同的作用域模型(scope model)(`--scope project` 为默认值;`--scope global` 将频道放入跨项目桶中)。
21
14
 
22
- ## Create A Forum Channel
15
+ ## 创建论坛频道
23
16
 
24
17
  ```bash
25
18
  cviauto channel create design-feedback \
@@ -30,14 +23,11 @@ cviauto channel create design-feedback \
30
23
  --by main
31
24
  ```
32
25
 
33
- Use `--scope project` for a board scoped to one repo, `--scope global` for a
34
- cross-project board.
26
+ 使用 `--scope project` 创建限定于单个仓库的面板,使用 `--scope global` 创建跨项目面板。
35
27
 
36
- ## Threads: Open, Comment, Status, Summary
28
+ ## 线程(Threads):打开、评论、状态、摘要
37
29
 
38
- Threads live inside a forum channel. Each thread is identified by a stable
39
- `--thread <key>` (lowercase kebab-case is conventional). The first action on
40
- a thread is `opened`; everything afterwards uses the same `--thread` key.
30
+ 线程存在于论坛频道内部。每个线程通过稳定的 `--thread <key>` 标识(约定使用小写 kebab-case)。对线程的第一个操作是 `opened`;之后的所有操作使用相同的 `--thread` key。
41
31
 
42
32
  ```bash
43
33
  cviauto channel post design-feedback opened \
@@ -69,22 +59,16 @@ cviauto channel post design-feedback summary \
69
59
  --summary "Adopted the option-B layout; ticket TRELLIS-123 owns the fix."
70
60
  ```
71
61
 
72
- Key distinctions:
62
+ 关键区别:
73
63
 
74
- - `--description` is the **durable** thread description (the answer to "what
75
- is this thread about?"). It is set on `opened` and edited by re-running
76
- `post` with `--description`.
77
- - `--text` / `--stdin` / `--text-file` is the **event body** — the comment or
78
- payload attached to this specific timeline entry.
79
- - `--labels` and `--assignees` are CSV and **replace** the current value; they
80
- do not append.
81
- - `--summary` is the rolling thread summary. Setting it on `status closed` is
82
- the standard way to mark a thread resolved with context.
64
+ - `--description` 是**持久化**的线程描述(回答"这个线程是关于什么的?")。在 `opened` 时设置,通过重新运行带 `--description` `post` 来编辑。
65
+ - `--text` / `--stdin` / `--text-file` 是**事件正文(event body)**—— 附属于此特定时间线条目的评论或负载。
66
+ - `--labels` 和 `--assignees` CSV 格式,会**替换**当前值而非追加。
67
+ - `--summary` 是滚动线程摘要。在 `status closed` 时设置它是标记线程已解决并附带上下文的标准方式。
83
68
 
84
- `--thread` is required for every action except `opened` (where it is also
85
- required in practice — there is no anonymous thread).
69
+ 每个操作都需要 `--thread`,除了 `opened`(实际上也需要 —— 不存在匿名线程)。
86
70
 
87
- ## Read A Forum
71
+ ## 阅读论坛
88
72
 
89
73
  ```bash
90
74
  cviauto channel messages design-feedback --scope global
@@ -93,53 +77,45 @@ cviauto channel thread design-feedback login-empty-state --scope global
93
77
  cviauto channel messages design-feedback --scope global --raw --thread login-empty-state
94
78
  ```
95
79
 
96
- If a peer says "I commented on the forum", run `channel forum` first to see
97
- which thread changed, then drill into that thread with `channel thread <name>
98
- <thread>`. Do not jump straight to ad-hoc `events.jsonl` parsing.
80
+ 如果同伴说"我在论坛上评论了",先运行 `channel forum` 查看哪个线程有变化,然后用 `channel thread <name> <thread>` 深入该线程。不要直接跳到临时的 `events.jsonl` 解析。
99
81
 
100
- ## Context
82
+ ## 上下文(Context
101
83
 
102
- Context entries are durable background that should always be in scope when
103
- reading a channel or a thread. They are **not** timeline events; they are
104
- projected separately and replayed for every reader.
84
+ 上下文条目(context entries)是持久化的背景信息,在阅读频道或线程时应始终处于作用域内。它们**不是**时间线事件;它们被单独投影,并为每个读者重放。
105
85
 
106
- Use the `context` subcommands. The legacy `--linked-context-file` /
107
- `--linked-context-raw` flags on `create` and `post` are deprecated aliases
108
- that fold into the canonical `--context-file` / `--context-raw`.
86
+ 使用 `context` 子命令。旧版的 `--linked-context-file` / `--linked-context-raw` flags(在 `create` 和 `post` 上)是已弃用的别名,会被折叠到规范的 `--context-file` / `--context-raw` 中。
109
87
 
110
- ### Add Context
88
+ ### 添加上下文
111
89
 
112
90
  ```bash
113
- # Channel-level context (whole forum)
91
+ # 频道级上下文(整个论坛)
114
92
  cviauto channel context add design-feedback \
115
93
  --scope global \
116
94
  --raw "Upstream feedback board; please link tasks before opening threads."
117
95
 
118
- # Thread-level context (one thread)
96
+ # 线程级上下文(单个线程)
119
97
  cviauto channel context add design-feedback \
120
98
  --scope global \
121
99
  --thread login-empty-state \
122
100
  --file "$PWD/.cviauto/tasks/05-13-login-redesign/design.md"
123
101
  ```
124
102
 
125
- - `--thread <key>` switches between channel-level and thread-level context.
126
- - `--file` paths **must be absolute**; relative paths are rejected.
127
- - `--raw` is plain text inline content.
128
- - Both flags are repeatable; at least one is required for `add` / `delete`.
129
- - `--as <agent>` records authorship; defaults to `main`.
103
+ - `--thread <key>` 在频道级上下文和线程级上下文之间切换。
104
+ - `--file` 路径**必须为绝对路径**;相对路径会被拒绝。
105
+ - `--raw` 是纯文本内联内容。
106
+ - 两个 flags 均可重复使用;`add` / `delete` 至少需要一个。
107
+ - `--as <agent>` 记录作者身份;默认为 `main`。
130
108
 
131
- ### List Context
109
+ ### 列出上下文
132
110
 
133
111
  ```bash
134
112
  cviauto channel context list design-feedback --scope global
135
113
  cviauto channel context list design-feedback --scope global --thread login-empty-state --raw
136
114
  ```
137
115
 
138
- `--raw` on `list` emits one JSON entry per line (useful for piping); without
139
- it you get a human-readable `file <path>` / `raw <truncated text>` listing.
140
- An empty store prints `(no context)`.
116
+ `list` 上的 `--raw` 每行输出一个 JSON 条目(适用于管道);不带它时,会得到人类可读的 `file <path>` / `raw <truncated text>` 列表。空存储打印 `(no context)`。
141
117
 
142
- ### Delete Context
118
+ ### 删除上下文
143
119
 
144
120
  ```bash
145
121
  cviauto channel context delete design-feedback \
@@ -148,24 +124,21 @@ cviauto channel context delete design-feedback \
148
124
  --raw "stale note"
149
125
  ```
150
126
 
151
- You delete by **value**, not by id: pass the same `--file` or `--raw` value
152
- that was added. Repeat the flag to delete multiple entries in one call.
127
+ 按**值**而非 id 删除:传入与添加时相同的 `--file` `--raw` 值。重复该 flag 可在一次调用中删除多个条目。
153
128
 
154
- ### Reading Order
129
+ ### 阅读顺序
155
130
 
156
- When reading a thread, work top-down:
131
+ 阅读线程时,按自上而下的顺序:
157
132
 
158
- 1. Thread `description` (the durable "what is this about").
159
- 2. Context entries (channel-level + thread-level).
160
- 3. Timeline (`opened`, `comment`, `status`, `summary`).
133
+ 1. 线程 `description`(持久化的"这是关于什么的")。
134
+ 2. 上下文条目(频道级 + 线程级)。
135
+ 3. 时间线(`opened`、`comment`、`status`、`summary`)。
161
136
 
162
- If a context file is missing or unreadable, state that explicitly and
163
- continue with the remaining data — do not fabricate the content.
137
+ 如果上下文文件缺失或不可读,明确说明并继续使用剩余数据 —— 不要凭空编造内容。
164
138
 
165
- ## Title Projection
139
+ ## 标题投影(Title Projection
166
140
 
167
- `title` projects a stable display title onto the channel without renaming the
168
- storage address. The channel `name` you pass to every command stays the same.
141
+ `title` 将稳定的显示标题投射到频道上,而不重命名存储地址。你传给每个命令的频道 `name` 保持不变。
169
142
 
170
143
  ```bash
171
144
  cviauto channel title set design-feedback \
@@ -175,16 +148,13 @@ cviauto channel title set design-feedback \
175
148
  cviauto channel title clear design-feedback --scope global
176
149
  ```
177
150
 
178
- - `title set` requires `--title`.
179
- - `--as <agent>` records authorship; defaults to `main`.
180
- - This is a presentation-layer change. Tooling and scripts keep using the
181
- original channel name.
151
+ - `title set` 需要 `--title`。
152
+ - `--as <agent>` 记录作者身份;默认为 `main`。
153
+ - 这是表现层(presentation-layer)的变更。工具和脚本继续使用原始频道名称。
182
154
 
183
- ## Thread Rename
155
+ ## 线程重命名(Thread Rename
184
156
 
185
- `thread rename` is the correction path when a thread was opened with the
186
- wrong key (typo, wrong slug convention, etc.). Threads do not support hard
187
- deletion — rename is the supported corrective action.
157
+ `thread rename` 是当线程以错误的 key(拼写错误、slug 约定错误等)打开时的修正路径。线程不支持硬删除 —— 重命名是支持的纠正操作。
188
158
 
189
159
  ```bash
190
160
  cviauto channel thread rename design-feedback old-key new-key \
@@ -192,24 +162,21 @@ cviauto channel thread rename design-feedback old-key new-key \
192
162
  --as main
193
163
  ```
194
164
 
195
- - `--as <agent>` is **required**.
196
- - `post <name> rename` is rejected you must use `thread rename`.
165
+ - `--as <agent>` **必须**提供。
166
+ - `post <name> rename` 会被拒绝 —— 必须使用 `thread rename`。
197
167
 
198
- ## Deletion Discipline
168
+ ## 删除原则(Deletion Discipline
199
169
 
200
- Do not model single-comment deletion or hard thread deletion as normal
201
- workflow. Forum threads are append-only collaboration history. To correct
202
- state, use:
170
+ 不要将单条评论删除或线程硬删除建模为正常工作流。论坛线程是仅追加的协作历史。要纠正状态,请使用:
203
171
 
204
- - `post ... status` to mark a thread closed / blocked / etc.
205
- - `post ... summary` to record the resolution.
206
- - `post ... --labels` to re-label (replaces the set).
207
- - `thread rename` to correct a bad thread key.
172
+ - `post ... status` 将线程标记为 closed / blocked 等。
173
+ - `post ... summary` 记录解决方案。
174
+ - `post ... --labels` 重新打标签(替换整个集合)。
175
+ - `thread rename` 纠正错误的线程 key
208
176
 
209
- ## Internal Changelog Pattern
177
+ ## 内部 Changelog 模式
210
178
 
211
- A common use of a global forum channel is an internal release / runtime
212
- changelog. One thread per notable change keeps history searchable:
179
+ 全局论坛频道的一个常见用途是内部发布/运行时 changelog。每个显著变更一个线程,保持历史可搜索:
213
180
 
214
181
  ```bash
215
182
  cviauto channel create release-notes \
@@ -229,5 +196,4 @@ cviauto channel post release-notes opened \
229
196
  --text-file /tmp/release-notes.md
230
197
  ```
231
198
 
232
- Use stable, descriptive thread keys (e.g. `release-2026-q1`,
233
- `runtime-event-schema-change`) so later readers can find them by name.
199
+ 使用稳定、描述性的线程 key(如 `release-2026-q1`、`runtime-event-schema-change`),以便后续读者能按名称找到它们。
@@ -1,134 +1,113 @@
1
- # Progress And Debugging
1
+ # 进度与调试(Progress And Debugging
2
2
 
3
- Pretty output is for operators. Raw output is the audit log. Subcommands
4
- (`forum`, `thread`, `messages`, `context`) are the audit *interface* — reach
5
- for them before grepping `events.jsonl` by hand.
3
+ 格式化输出(pretty output)面向运维人员。原始输出(raw output)是审计日志。子命令(`forum`、`thread`、`messages`、`context`)是审计的**接口**——在手动 grep `events.jsonl` 之前,请优先使用它们。
6
4
 
7
- ## Pretty vs `--raw`
5
+ ## Pretty 输出 vs `--raw`
8
6
 
9
- `cviauto channel messages <channel>` renders a compact, human-readable view:
10
- timestamps, identities, kind, and a short body. It is meant for operators
11
- scanning a channel, not for diagnostics.
7
+ `cviauto channel messages <channel>` 渲染紧凑、人类可读的视图:时间戳、身份标识、kind 和简短正文。它面向扫描通道的运维人员,而非诊断用途。
12
8
 
13
- Pretty output can and will truncate:
9
+ Pretty 输出会且将会截断以下内容:
14
10
 
15
- - long progress deltas (`text_delta`, partial tool args)
16
- - tool names and command lines
17
- - multi-line status fields and structured `detail` blobs
18
- - forum thread titles past the column budget
11
+ - 较长的 progress 增量(`text_delta`、部分工具参数)
12
+ - 工具名称和命令行
13
+ - 多行状态字段和结构化的 `detail` 数据块
14
+ - 超出列宽限制的 forum 线程标题
19
15
 
20
- When something looks "off" a worker appears stuck, a progress line ends
21
- mid-word, an action field shows `...` — switch to `--raw`. Raw mode emits
22
- one JSON event per line exactly as it lives in `events.jsonl`, so nothing
23
- is dropped.
16
+ 当某些内容看起来"不对劲"——worker 看起来卡住了、progress 行在单词中间截断、action 字段显示 `...`——请切换到 `--raw`。Raw 模式每行输出一条 JSON 事件,与 `events.jsonl` 中的内容完全一致,因此不会有任何内容被丢弃。
24
17
 
25
18
  ```bash
26
- # Pretty (operator view)
19
+ # Pretty(运维视图)
27
20
  cviauto channel messages <channel> --kind done --last 10
28
21
  cviauto channel messages <channel> --kind error --last 10
29
22
 
30
- # Raw (diagnostic view) — one JSON per line
23
+ # Raw(诊断视图)— 每行一条 JSON
31
24
  cviauto channel messages <channel> --raw --kind progress --last 20
32
25
  cviauto channel messages <channel> --raw --last 50
33
26
  ```
34
27
 
35
- Rule of thumb: never diagnose a worker from a truncated progress line.
28
+ 经验法则:永远不要根据截断的 progress 行来诊断 worker
36
29
 
37
- ### Rebuild Streaming Text
30
+ ### 重建流式文本
38
31
 
39
- To reconstruct what a model actually streamed during a turn, concatenate
40
- `detail.text_delta` from progress events:
32
+ 要重建模型在某个 turn 中实际流式输出的内容,将 progress 事件中的 `detail.text_delta` 拼接起来:
41
33
 
42
34
  ```bash
43
35
  cviauto channel messages <channel> --raw --kind progress --last 80 \
44
36
  | python3 -c 'import json,sys; [print((json.loads(l).get("detail") or {}).get("text_delta",""), end="") for l in sys.stdin if l.strip()]'
45
37
  ```
46
38
 
47
- ## Stalled Worker Diagnosis
39
+ ## 停滞 Worker 诊断
48
40
 
49
- Symptom: `cviauto channel list` shows the worker as running, but no new
50
- events appear in `messages` and `wait` keeps timing out.
41
+ 症状:`cviauto channel list` 显示 worker 正在运行,但 `messages` 中没有新事件出现,且 `wait` 持续超时。
51
42
 
52
- Triage order:
43
+ 排查顺序:
53
44
 
54
- 1. **Locate the channel files.** Use `list --all --all-projects` if you are
55
- not sure which bucket the channel lives in.
45
+ 1. **定位通道文件。** 如果不确定通道属于哪个 bucket,使用 `list --all --all-projects`。
56
46
 
57
47
  ```bash
58
48
  cviauto channel list --all --all-projects
59
49
  CHAN=~/.cviauto/channels/<bucket>/<channel>
60
50
  ```
61
51
 
62
- 2. **Confirm the supervisor and worker PIDs are alive.**
52
+ 2. **确认 supervisor worker PID 仍在运行。**
63
53
 
64
54
  ```bash
65
55
  cat "$CHAN/<worker>.pid" # supervisor PID
66
- cat "$CHAN/<worker>.worker-pid" # actual CLI subprocess PID
56
+ cat "$CHAN/<worker>.worker-pid" # 实际 CLI 子进程 PID
67
57
  ps -p "$(cat "$CHAN/<worker>.pid")"
68
58
  ps -p "$(cat "$CHAN/<worker>.worker-pid")"
69
59
  ```
70
60
 
71
- If the supervisor PID is gone but the channel still lists the worker,
72
- you have a ghost entry clean it with
73
- `cviauto channel kill <name> --as <worker> --force`.
61
+ 如果 supervisor PID 已不存在但通道仍列出该 worker,说明存在幽灵条目——使用
62
+ `cviauto channel kill <name> --as <worker> --force` 清理。
74
63
 
75
- 3. **Tail the worker log.** This is the canonical place to see provider /
76
- MCP / tool startup output that never makes it onto the channel.
64
+ 3. **跟踪 worker 日志。** 这是查看 provider / MCP / 工具启动输出(这些输出永远不会出现在通道上)的权威位置。
77
65
 
78
66
  ```bash
79
67
  tail -f "$CHAN/<worker>.log"
80
68
  ```
81
69
 
82
- 4. **Check the last raw events.** A worker that emitted `progress` but no
83
- `message`/`done` is usually mid-stream or blocked on a tool call:
70
+ 4. **检查最后几条 raw 事件。** 一个发出了 `progress` 但没有 `message`/`done` worker 通常处于流式输出中或被工具调用阻塞:
84
71
 
85
72
  ```bash
86
73
  cviauto channel messages <channel> --raw --last 50
87
74
  ```
88
75
 
89
- Common "alive but silent" causes:
76
+ 常见的"存活但静默"原因:
90
77
 
91
- - Provider cold start before the first token (long, but eventually moves).
92
- - A blocking MCP server during startup — visible in the worker log.
93
- - Worker is waiting for a tool result whose subprocess hung.
94
- - Prompt is huge / model is rate-limited; check provider-side errors in the
95
- worker log.
78
+ - Provider 在首个 token 之前的冷启动(耗时较长,但最终会推进)。
79
+ - 启动期间有阻塞的 MCP 服务器——可在 worker 日志中看到。
80
+ - Worker 正在等待工具调用结果,但其子进程已挂起。
81
+ - 提示词过大 / 模型被限速;检查 worker 日志中的 provider 侧错误。
96
82
 
97
- ## Progress Event Interpretation
83
+ ## Progress 事件解读
98
84
 
99
- A `progress` event represents an in-flight piece of work. Its shape varies
100
- by `action` field, but the load-bearing fields are always under `detail`:
85
+ `progress` 事件表示进行中的工作。其形态随 `action` 字段变化,但核心字段始终在 `detail` 下:
101
86
 
102
- - `detail.text_delta` — incremental model output (concatenate across events
103
- to rebuild the streamed reply).
104
- - `detail.tool_name`, `detail.tool_input`tool call about to run or
105
- currently running.
106
- - `detail.status` — short string used by long-running actions
107
- (`starting`, `running`, `flushing`, `done`).
108
- - `detail.action` — semantic label (e.g. `status` for thread heartbeats).
87
+ - `detail.text_delta` — 增量模型输出(跨事件拼接可重建流式回复)。
88
+ - `detail.tool_name`、`detail.tool_input` 即将运行或正在运行的工具调用。
89
+ - `detail.status` — 长耗时操作使用的简短字符串(`starting`、`running`、`flushing`、`done`)。
90
+ - `detail.action` — 语义标签(例如线程心跳使用 `status`)。
109
91
 
110
- Progress events are **noisy** by design. `wait` ignores them unless you
111
- pass `--include-progress`. When you do want to see them, prefer:
92
+ Progress 事件**在设计上就是嘈杂的**。`wait` 默认忽略它们,除非传入 `--include-progress`。当确实需要查看它们时,推荐使用:
112
93
 
113
94
  ```bash
114
95
  cviauto channel messages <channel> --raw --kind progress --last 80
115
96
  ```
116
97
 
117
- A stream that emits progress at a steady cadence but never closes with
118
- `done`/`error`/`message` is the classic shape of a hung tool call —
119
- inspect the worker log for the subprocess.
98
+ 一个以稳定节奏持续发出 progress 但从未以 `done`/`error`/`message` 结束的流,是工具调用挂起的典型形态——检查 worker 日志中的子进程。
120
99
 
121
- ## Wait Semantics (Quick Reference)
100
+ ## Wait 语义(快速参考)
122
101
 
123
- `channel wait` watches `events.jsonl` from EOF and wakes on:
102
+ `channel wait` EOF 开始监视 `events.jsonl`,并在以下事件上醒来:
124
103
 
125
104
  - `message`
126
105
  - `done`
127
106
  - `error`
128
107
  - `killed`
129
- - `progress` only with `--include-progress`
108
+ - `progress`(仅当带 `--include-progress` 时)
130
109
 
131
- Useful filters:
110
+ 实用过滤器:
132
111
 
133
112
  ```bash
134
113
  cviauto channel wait T --as main --from check --kind done --timeout 15m
@@ -137,73 +116,58 @@ cviauto channel wait T --as worker --tag interrupt --timeout 1h
137
116
  cviauto channel wait T --as main --thread release-note --action status --timeout 10m
138
117
  ```
139
118
 
140
- Exit codes: `0` matched, `124` timeout, `1`/`2` errors. On `wait --all`
141
- timeout, stderr names the workers still missing.
119
+ 退出码:`0` 匹配成功,`124` 超时,`1`/`2` 错误。在 `wait --all` 超时时,stderr 会列出仍然缺失的 worker。
142
120
 
143
- ## Auditing `events.jsonl` — Use Subcommands, Not `grep`
121
+ ## 审计 `events.jsonl` — 使用子命令,而非 `grep`
144
122
 
145
- Every channel persists its full history at `$CHAN/events.jsonl`. It is
146
- tempting to `tail` / `grep` / `jq` this file directly during debugging.
147
- Don't make it a habit, and **never** do it for forum channels.
123
+ 每个通道的完整历史记录持久化在 `$CHAN/events.jsonl` 中。调试时直接对该文件使用 `tail` / `grep` / `jq` 是很有诱惑力的。不要养成这个习惯,并且**绝对不要**对 forum 通道这样做。
148
124
 
149
- Why subcommands first:
125
+ 优先使用子命令的原因:
150
126
 
151
- - `messages` already replays the file with filters (`--kind`, `--from`,
152
- `--last`, `--tag`, `--thread`, `--action`) and gives you `--raw` for the
153
- exact JSON. Anything you would write a one-liner for, `messages` already
154
- does.
155
- - `wait` consumes the same file with EOF semantics — re-implementing that
156
- with `tail -f | jq` will drop events under load and misorder them under
157
- rotation.
158
- - `context` materializes a worker's inbox view, including cursor state.
159
- Hand-rolled filters do not respect `<worker>.inbox-cursor`.
127
+ - `messages` 已经可以带过滤器(`--kind`、`--from`、`--last`、`--tag`、`--thread`、`--action`)重放文件,并提供 `--raw` 获取精确的 JSON。任何你想用一行命令完成的事情,`messages` 已经做到了。
128
+ - `wait` EOF 语义消费同一个文件——用 `tail -f | jq` 重新实现会在线程压力下丢失事件,并在轮转时乱序。
129
+ - `context` 可以物化 worker 的收件箱视图,包括游标状态。手工编写的过滤器不会遵循 `<worker>.inbox-cursor`。
160
130
 
161
- ### Forum channels: never parse `events.jsonl` directly
131
+ ### Forum 通道:永远不要直接解析 `events.jsonl`
162
132
 
163
- Forum channels multiplex many logical threads onto a single `events.jsonl`.
164
- Each event carries `thread`, `action`, and tag fields that the forum
165
- subcommands know how to fold together. Parsing the file by hand will:
133
+ Forum 通道将多个逻辑线程多路复用到一个 `events.jsonl` 上。每个事件都携带 `thread`、`action` 和标签字段,forum 子命令知道如何将它们整合在一起。手工解析该文件会:
166
134
 
167
- - Mix threads together and make a thread look incoherent.
168
- - Miss thread lifecycle events (open / status / close) that change how
169
- later events should be interpreted.
170
- - Ignore worker inbox cursors, so you will "see" events a worker has
171
- already consumed and assume they are pending.
135
+ - 将线程混在一起,使某个线程看起来不连贯。
136
+ - 遗漏线程生命周期事件(open / status / close),这些事件会改变后续事件的解读方式。
137
+ - 忽略 worker 收件箱游标,因此你会"看到" worker 已经消费过的事件,并误以为它们仍是待处理的。
172
138
 
173
- Use the forum-aware views instead:
139
+ 请改用 forum 感知的视图:
174
140
 
175
141
  ```bash
176
- # List logical threads inside the forum channel
142
+ # 列出 forum 通道内的逻辑线程
177
143
  cviauto channel forum list <channel>
178
144
 
179
- # Inspect one thread end-to-end
145
+ # 端到端检查一个线程
180
146
  cviauto channel thread show <channel> <thread>
181
147
 
182
- # Replay messages for a thread (supports --raw, --kind, --last)
148
+ # 重放某线程的消息(支持 --raw、--kind、--last
183
149
  cviauto channel messages <channel> --thread <thread> --raw --last 100
184
150
 
185
- # What a specific worker still has pending
151
+ # 某个特定 worker 仍未处理的内容
186
152
  cviauto channel context <channel> --as <worker>
187
153
  ```
188
154
 
189
- Direct reads of `events.jsonl` are reserved for the case where the CLI
190
- itself is suspect — e.g. confirming an event was actually persisted, or
191
- diffing against `<worker>.inbox-cursor` while debugging the supervisor.
155
+ 直接读取 `events.jsonl` 仅保留用于 CLI 本身可疑的场景——例如确认某个事件确实已持久化,或在调试 supervisor 时对比 `<worker>.inbox-cursor`。
192
156
 
193
- ## Common Failures
157
+ ## 常见故障
194
158
 
195
- | Symptom | Cause | Fix |
159
+ | 症状 | 原因 | 修复方法 |
196
160
  |---|---|---|
197
- | `cviauto: command not found` | CLI not installed globally | install the internal Cviauto CLI package |
198
- | `wait` exits immediately | wrong filter or identity collision | use distinct `--as`, inspect raw messages |
199
- | zsh errors on message text | shell interpreted punctuation | use `--stdin` or `--text-file` |
200
- | progress line is cut off | pretty output truncation | use `messages --raw --kind progress` |
201
- | worker never speaks | provider startup / prompt / MCP delay | inspect `<worker>.log`, `ps`, raw events |
202
- | channel not found in another cwd | project bucket mismatch | `cd` to project, use `--scope global`, or `list --all-projects` |
203
- | ghost worker in list | supervisor died without cleanup | `cviauto channel kill <name> --as <worker> --force` |
204
- | forum thread looks scrambled | parsed `events.jsonl` directly | use `forum`, `thread`, `messages --thread` |
161
+ | `cviauto: command not found` | CLI 未全局安装 | `npm install -g @mindfoldhq/cviauto` |
162
+ | `wait` 立即退出 | 错误的过滤器或身份冲突 | 使用不同的 `--as`,检查 raw 消息 |
163
+ | zsh 对消息文本报错 | shell 解释了标点符号 | 使用 `--stdin` `--text-file` |
164
+ | progress 行被截断 | pretty 输出截断 | 使用 `messages --raw --kind progress` |
165
+ | worker 永远不会发言 | provider 启动 / 提示词 / MCP 延迟 | 检查 `<worker>.log`、`ps`、raw 事件 |
166
+ | 在另一个 cwd 中找不到通道 | 项目 bucket 不匹配 | `cd` 到项目目录,使用 `--scope global`,或 `list --all-projects` |
167
+ | 列表中显示幽灵 worker | supervisor 已退出但未清理 | `cviauto channel kill <name> --as <worker> --force` |
168
+ | forum 线程看起来混乱 | 直接解析了 `events.jsonl` | 使用 `forum`、`thread`、`messages --thread` |
205
169
 
206
- ## Storage Layout
170
+ ## 存储布局
207
171
 
208
172
  ```text
209
173
  ~/.cviauto/channels/
@@ -221,6 +185,4 @@ diffing against `<worker>.inbox-cursor` while debugging the supervisor.
221
185
  └── <worker>.spawnlock
222
186
  ```
223
187
 
224
- Agents normally use the CLI, not direct file reads. Direct file reads are
225
- for debugging when CLI views are insufficient — and even then, never on a
226
- forum channel's `events.jsonl`.
188
+ Agent 通常使用 CLI 而非直接读取文件。直接读取文件仅用于 CLI 视图不足以满足需求的调试场景——即便如此,也绝对不要直接读取 forum 通道的 `events.jsonl`。