@gobing-ai/knowledge-kit 0.0.37 → 0.1.1

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 (157) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/collect/index.css +654 -16
  3. package/dist/board/collect/index.js +191 -64
  4. package/dist/board/daily-voice/index.css +679 -12
  5. package/dist/board/daily-voice/index.js +185 -66
  6. package/dist/board/itc/index.css +679 -13
  7. package/dist/board/itc/index.js +188 -66
  8. package/dist/index.js +2864 -139
  9. package/package.json +3 -2
  10. package/plugins/generations/content-gen/dist/index.js +158 -12
  11. package/plugins/generations/core-facts-gen/dist/index.js +158 -12
  12. package/plugins/generations/daily-article-gen/dist/index.js +158 -12
  13. package/plugins/generations/dailynews-gen/dist/index.js +158 -12
  14. package/plugins/generations/episode-plan-gen/dist/index.js +158 -12
  15. package/plugins/generations/gemini-tts/README.md +4 -3
  16. package/plugins/generations/gemini-tts/dist/index.js +158 -12
  17. package/plugins/generations/image-gen/dist/index.js +158 -12
  18. package/plugins/generations/news-report-gen/dist/index.js +158 -12
  19. package/plugins/generations/omni-voice-gen/README.md +15 -4
  20. package/plugins/generations/omni-voice-gen/profiles.json +1 -2
  21. package/plugins/generations/voice-gen/dist/index.js +158 -12
  22. package/plugins/generations/voxcpm-tts/README.md +21 -1
  23. package/plugins/generations/voxcpm-tts/dist/index.js +173 -13
  24. package/plugins/generations/voxcpm-tts/scripts/audit-speaker-consistency.py +109 -0
  25. package/plugins/generations/voxcpm-tts/src/voxcpm-client.ts +28 -1
  26. package/plugins/ingestions/aihot-ingest/dist/index.js +158 -12
  27. package/plugins/ingestions/horizon-ingest/dist/index.js +158 -12
  28. package/plugins/ingestions/last30days-ingest/dist/index.js +158 -12
  29. package/plugins/ingestions/web-search/dist/index.js +158 -12
  30. package/plugins/kk/commands/workflow-run.md +56 -18
  31. package/plugins/kk/decisions/kk-itc.yaml +46 -0
  32. package/plugins/kk/decisions/kk-seo-keyword.yaml +57 -0
  33. package/plugins/kk/decisions/kk-seo-page.yaml +230 -0
  34. package/plugins/kk/decisions/kk-seo-pair.yaml +21 -0
  35. package/plugins/kk/decisions/kk-seo-site.yaml +90 -0
  36. package/plugins/kk/plugin.json +1 -1
  37. package/plugins/kk/publish-presets/chinese-article.json +14 -0
  38. package/plugins/kk/publish-presets/technical-article.json +14 -0
  39. package/plugins/kk/references/smart-seo-attribution.md +85 -0
  40. package/plugins/kk/scripts/daily-stages.ts +42 -2
  41. package/plugins/kk/scripts/itc-stages.ts +25 -118
  42. package/plugins/kk/scripts/kk-workflow-stages.ts +38 -1
  43. package/plugins/kk/scripts/seo-decisions.ts +491 -0
  44. package/plugins/kk/scripts/seo-enrich.ts +728 -0
  45. package/plugins/kk/scripts/seo-facts.ts +610 -0
  46. package/plugins/kk/scripts/seo-fetch.ts +766 -0
  47. package/plugins/kk/scripts/seo-report.ts +460 -0
  48. package/plugins/kk/scripts/seo-rules.ts +1882 -0
  49. package/plugins/kk/scripts/seo-stages.ts +1044 -0
  50. package/plugins/kk/skills/article-adapt/SKILL.md +2 -2
  51. package/plugins/kk/skills/smart-seo/SKILL.md +183 -0
  52. package/plugins/kk/skills/smart-seo/references/method.md +126 -0
  53. package/plugins/kk/skills/smart-seo/references/narrative.md +125 -0
  54. package/plugins/kk/skills/smart-seo/references/operations.md +209 -0
  55. package/plugins/kk/skills/smart-seo/references/seo-geo-sources.md +90 -0
  56. package/plugins/kk/workflows/feature-verification.yaml +28 -24
  57. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +85 -17
  58. package/plugins/kk/workflows/kk-itc-author.yaml +406 -0
  59. package/plugins/kk/workflows/kk-itc.yaml +208 -682
  60. package/plugins/kk/workflows/kk-smart-seo.yaml +251 -0
  61. package/plugins/publishings/bilibili-pub/dist/index.js +21782 -0
  62. package/plugins/publishings/bilibili-pub/dist/profile-check.js +20410 -0
  63. package/plugins/publishings/bilibili-pub/package.json +20 -0
  64. package/plugins/publishings/bilibili-pub/plugin.json +12 -0
  65. package/plugins/publishings/bilibili-pub/src/flow.ts +1296 -0
  66. package/plugins/publishings/bilibili-pub/src/index.ts +139 -0
  67. package/plugins/publishings/bilibili-pub/src/profile-check.ts +19 -0
  68. package/plugins/publishings/bilibili-pub/src/selectors.ts +222 -0
  69. package/plugins/publishings/bilibili-pub/tsconfig.json +4 -0
  70. package/plugins/publishings/cnblogs-pub/dist/index.js +21383 -0
  71. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +20412 -0
  72. package/plugins/publishings/cnblogs-pub/package.json +19 -0
  73. package/plugins/publishings/cnblogs-pub/plugin.json +12 -0
  74. package/plugins/publishings/cnblogs-pub/src/flow.ts +708 -0
  75. package/plugins/publishings/cnblogs-pub/src/index.ts +172 -0
  76. package/plugins/publishings/cnblogs-pub/src/profile-check.ts +24 -0
  77. package/plugins/publishings/cnblogs-pub/src/selectors.ts +104 -0
  78. package/plugins/publishings/cnblogs-pub/tsconfig.json +4 -0
  79. package/plugins/publishings/csdn-pub/dist/index.js +21552 -0
  80. package/plugins/publishings/csdn-pub/dist/profile-check.js +20963 -0
  81. package/plugins/publishings/csdn-pub/package.json +19 -0
  82. package/plugins/publishings/csdn-pub/plugin.json +12 -0
  83. package/plugins/publishings/csdn-pub/src/index.ts +1178 -0
  84. package/plugins/publishings/csdn-pub/src/profile-check.ts +23 -0
  85. package/plugins/publishings/csdn-pub/tsconfig.json +4 -0
  86. package/plugins/publishings/emdash-pub/dist/index.js +158 -12
  87. package/plugins/publishings/emdash-pub/plugin.json +22 -1
  88. package/plugins/publishings/infoq-pub/dist/index.js +160 -12
  89. package/plugins/publishings/infoq-pub/dist/profile-check.js +160 -12
  90. package/plugins/publishings/infoq-pub/plugin.json +21 -0
  91. package/plugins/publishings/jike-pub/dist/index.js +21379 -0
  92. package/plugins/publishings/jike-pub/dist/profile-check.js +20951 -0
  93. package/plugins/publishings/jike-pub/package.json +19 -0
  94. package/plugins/publishings/jike-pub/plugin.json +12 -0
  95. package/plugins/publishings/jike-pub/src/index.ts +800 -0
  96. package/plugins/publishings/jike-pub/src/profile-check.ts +21 -0
  97. package/plugins/publishings/jike-pub/tsconfig.json +4 -0
  98. package/plugins/publishings/juejin-pub/dist/index.js +160 -12
  99. package/plugins/publishings/juejin-pub/dist/profile-check.js +160 -12
  100. package/plugins/publishings/juejin-pub/plugin.json +21 -0
  101. package/plugins/publishings/medium-pub/dist/index.js +158 -12
  102. package/plugins/publishings/medium-pub/plugin.json +22 -1
  103. package/plugins/publishings/podcast-pub/dist/index.js +158 -12
  104. package/plugins/publishings/qiita-pub/dist/index.js +158 -12
  105. package/plugins/publishings/qiita-pub/plugin.json +24 -1
  106. package/plugins/publishings/shipinhao-pub/dist/index.js +21715 -0
  107. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +20431 -0
  108. package/plugins/publishings/shipinhao-pub/package.json +19 -0
  109. package/plugins/publishings/shipinhao-pub/plugin.json +12 -0
  110. package/plugins/publishings/shipinhao-pub/src/flow.ts +1323 -0
  111. package/plugins/publishings/shipinhao-pub/src/index.ts +173 -0
  112. package/plugins/publishings/shipinhao-pub/src/profile-check.ts +25 -0
  113. package/plugins/publishings/shipinhao-pub/src/selectors.ts +241 -0
  114. package/plugins/publishings/shipinhao-pub/tsconfig.json +4 -0
  115. package/plugins/publishings/sspai-pub/dist/index.js +21371 -0
  116. package/plugins/publishings/sspai-pub/dist/profile-check.js +20414 -0
  117. package/plugins/publishings/sspai-pub/package.json +19 -0
  118. package/plugins/publishings/sspai-pub/plugin.json +12 -0
  119. package/plugins/publishings/sspai-pub/src/flow.ts +624 -0
  120. package/plugins/publishings/sspai-pub/src/index.ts +167 -0
  121. package/plugins/publishings/sspai-pub/src/profile-check.ts +25 -0
  122. package/plugins/publishings/sspai-pub/src/selectors.ts +122 -0
  123. package/plugins/publishings/sspai-pub/tsconfig.json +4 -0
  124. package/plugins/publishings/substack-pub/dist/index.js +160 -12
  125. package/plugins/publishings/substack-pub/dist/profile-check.js +160 -12
  126. package/plugins/publishings/substack-pub/plugin.json +21 -0
  127. package/plugins/publishings/surfdash-pub/dist/index.js +158 -12
  128. package/plugins/publishings/surfdash-pub/plugin.json +22 -1
  129. package/plugins/publishings/threads-pub/dist/index.js +158 -12
  130. package/plugins/publishings/wechatmp-pub/dist/index.js +1669 -502
  131. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +204 -21
  132. package/plugins/publishings/wechatmp-pub/plugin.json +32 -0
  133. package/plugins/publishings/wechatmp-pub/src/cgi-draft.ts +540 -0
  134. package/plugins/publishings/wechatmp-pub/src/cgi-media.ts +380 -0
  135. package/plugins/publishings/wechatmp-pub/src/cgi.ts +485 -0
  136. package/plugins/publishings/wechatmp-pub/src/flow.ts +104 -0
  137. package/plugins/publishings/weibo-pub/dist/index.js +160 -12
  138. package/plugins/publishings/weibo-pub/dist/profile-check.js +160 -12
  139. package/plugins/publishings/weibo-pub/plugin.json +35 -0
  140. package/plugins/publishings/x-pub/dist/index.js +160 -12
  141. package/plugins/publishings/x-pub/dist/profile-check.js +160 -12
  142. package/plugins/publishings/x-pub/plugin.json +40 -0
  143. package/plugins/publishings/xhs-pub/dist/index.js +160 -12
  144. package/plugins/publishings/xhs-pub/dist/profile-check.js +160 -12
  145. package/plugins/publishings/xhs-pub/plugin.json +37 -0
  146. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +21491 -0
  147. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +20417 -0
  148. package/plugins/publishings/xiaoyuzhou-pub/package.json +19 -0
  149. package/plugins/publishings/xiaoyuzhou-pub/plugin.json +12 -0
  150. package/plugins/publishings/xiaoyuzhou-pub/src/flow.ts +826 -0
  151. package/plugins/publishings/xiaoyuzhou-pub/src/index.ts +174 -0
  152. package/plugins/publishings/xiaoyuzhou-pub/src/profile-check.ts +26 -0
  153. package/plugins/publishings/xiaoyuzhou-pub/src/selectors.ts +125 -0
  154. package/plugins/publishings/xiaoyuzhou-pub/tsconfig.json +4 -0
  155. package/plugins/publishings/zenn-pub/dist/index.js +158 -12
  156. package/plugins/publishings/zenn-pub/plugin.json +22 -1
  157. package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
@@ -0,0 +1,406 @@
1
+ ---
2
+ "$schema": "@gobing-ai/spur/schemas/state-machine-workflow.schema.json"
3
+ name: kk-itc-author
4
+ kind: state-machine
5
+ version: "2"
6
+ description: >-
7
+ Child state-machine workflow for bounded IT content authoring: outline -> draft -> unslop -> review/judge -> complete receipt
8
+ initialState: author-init
9
+ terminalStates:
10
+ - done
11
+ - failed
12
+ failureStates:
13
+ - failed
14
+
15
+ vars:
16
+ work_dir: ""
17
+ agent: "inline"
18
+ writer: "topic"
19
+ playbook: "generic"
20
+ rubric: "tech-accuracy"
21
+ auto: "false"
22
+ unslop: "false"
23
+ judge: "true"
24
+ outline: ""
25
+ max_revisions: "2"
26
+ parent_run_id: ""
27
+ child_run_id: ""
28
+ definition_digest: ""
29
+ options_digest: ""
30
+ __hitlAnswer: ""
31
+ __hitlInput: ""
32
+ __verdictFeedback: ""
33
+
34
+ states:
35
+ - id: author-init
36
+ description: "Initialize child authoring state and write .itc/author-run.json identity"
37
+ onEnter:
38
+ - kind: shell
39
+ options:
40
+ command: >-
41
+ mkdir -p "${vars.work_dir}/.itc" &&
42
+ cat <<EOF > "${vars.work_dir}/.itc/author-run.json"
43
+ {
44
+ "schemaVersion": 1,
45
+ "parentRunId": "${vars.parent_run_id}",
46
+ "childRunId": "${vars.child_run_id}",
47
+ "definitionDigest": "${vars.definition_digest}",
48
+ "optionsDigest": "${vars.options_digest}"
49
+ }
50
+ EOF
51
+
52
+ - id: outline-write
53
+ description: "Generate outline options a, b (and optional c) via writer skill"
54
+ onEnter:
55
+ - kind: agent.run
56
+ options:
57
+ role: scribe
58
+ agent: ${vars.agent}
59
+ input: |
60
+ Invoke the kk:${vars.writer} skill.
61
+ Generate outline options (outline-option-a.md, outline-option-b.md, and optionally outline-option-c.md) in ${vars.work_dir}/2-outline/ from the brief at ${vars.work_dir}/brief.md using playbook ${vars.playbook}.
62
+ When auto mode is on (auto=true), also write 2-outline/outline-recommendation.json as {"pick": "a|b|c", "rationale": "<why this option is strongest>"} recommending the option you would commit.
63
+ Do not wait for operator selection; write the option files.
64
+ expectFile: ${vars.work_dir}/2-outline/outline-option-a.md
65
+ - kind: shell
66
+ options:
67
+ command: >-
68
+ test -f "${vars.work_dir}/2-outline/outline-option-b.md" || { echo "missing required outline-option-b.md" >&2; exit 1; }
69
+
70
+ - id: outline-select
71
+ description: "Operator selects preferred outline option"
72
+ pause: true
73
+ onEnter:
74
+ - kind: hitl.select
75
+ options:
76
+ prompt: "Select an approved outline option from ${vars.work_dir}/2-outline/ (outline-option-a.md, outline-option-b.md, or outline-option-c.md):"
77
+ options:
78
+ - a
79
+ - b
80
+ - c
81
+ var: __hitlAnswer
82
+
83
+ - id: outline-autopick
84
+ description: "Auto mode — validate the writer's recommendation, then bind the bounded catalog decision (empty on defer)"
85
+ onEnter:
86
+ - kind: shell
87
+ options:
88
+ command: >-
89
+ kk stage run itc-outline-pick "${vars.work_dir}" &&
90
+ kk stage run itc-decision --outline "${vars.work_dir}" "${vars.parent_run_id}"
91
+ - kind: file.read.into-var
92
+ options:
93
+ path: ${vars.work_dir}/2-outline/.auto-pick
94
+ var: outline
95
+
96
+ - id: outline-commit
97
+ description: "Copy selected outline to outline-approved.md"
98
+ onEnter:
99
+ - kind: shell
100
+ options:
101
+ command: >-
102
+ sel="${vars.outline}";
103
+ if [ -z "$sel" ]; then sel="${vars.__hitlAnswer}"; fi;
104
+ if [ -z "$sel" ]; then sel="a"; fi;
105
+ src="${vars.work_dir}/2-outline/outline-option-$sel.md";
106
+ if [ ! -f "$src" ]; then
107
+ echo "selected outline file not found: $src" >&2; exit 1;
108
+ fi;
109
+ cp "$src" "${vars.work_dir}/2-outline/outline-approved.md";
110
+
111
+ - id: draft-write
112
+ description: "Author full technical draft from approved outline"
113
+ onEnter:
114
+ - kind: agent.run
115
+ options:
116
+ role: scribe
117
+ agent: ${vars.agent}
118
+ input: |
119
+ Invoke the kk:${vars.writer} skill.
120
+ Author the technical draft at ${vars.work_dir}/3-draft-draft-article.md based on approved outline ${vars.work_dir}/2-outline/outline-approved.md and brief ${vars.work_dir}/brief.md using playbook ${vars.playbook}.
121
+ Revision feedback: ${vars.__hitlInput}
122
+ expectFile: ${vars.work_dir}/3-draft-draft-article.md
123
+
124
+ - id: unslop
125
+ description: "De-slop pass — kk:taste-unslop line-edits the draft"
126
+ onEnter:
127
+ - kind: agent.run
128
+ options:
129
+ role: scribe
130
+ agent: ${vars.agent}
131
+ input: |
132
+ Invoke the kk:taste-unslop skill.
133
+ Read ${vars.work_dir}/3-draft-draft-article.md and write the line-edited version to ${vars.work_dir}/3-draft-draft-article.new.md, removing slop (AI-tell phrasing, filler, hedging) while preserving the technical claims, code blocks, links, and the approved outline's structure. Do not modify or delete the original file; the pipeline swaps the edited file in.
134
+ expectFile: ${vars.work_dir}/3-draft-draft-article.new.md
135
+ - kind: shell
136
+ options:
137
+ command: mv -f "${vars.work_dir}/3-draft-draft-article.new.md" "${vars.work_dir}/3-draft-draft-article.md"
138
+
139
+ - id: draft-review
140
+ description: "Operator reviews and approves or requests revision on draft-article.md"
141
+ pause: true
142
+ onEnter:
143
+ - kind: hitl.confirm
144
+ options:
145
+ prompt: "Review draft at ${vars.work_dir}/3-draft-draft-article.md. Approve?"
146
+ var: __hitlAnswer
147
+
148
+ - id: draft-revise
149
+ description: "Collect revision feedback from operator (bounded by 3 rounds)"
150
+ pause: true
151
+ onEnter:
152
+ - kind: shell
153
+ options:
154
+ command: >-
155
+ n=$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0);
156
+ echo $((n + 1)) > "${vars.work_dir}/.revise-count";
157
+ - kind: hitl.input
158
+ options:
159
+ prompt: "Provide specific revision feedback for ${vars.work_dir}/3-draft-draft-article.md:"
160
+ var: __hitlInput
161
+
162
+ - id: draft-autorevise
163
+ description: "Auto mode — apply judge feedback to the draft"
164
+ onEnter:
165
+ - kind: shell
166
+ options:
167
+ command: >-
168
+ n=$(cat "${vars.work_dir}/.auto-revise-count" 2>/dev/null || echo 0);
169
+ echo $((n + 1)) > "${vars.work_dir}/.auto-revise-count";
170
+ - kind: agent.run
171
+ options:
172
+ role: scribe
173
+ agent: ${vars.agent}
174
+ input: |
175
+ Invoke the kk:${vars.writer} skill.
176
+ Read the draft at ${vars.work_dir}/3-draft-draft-article.md and write a revised version to ${vars.work_dir}/3-draft-draft-article.new.md, applying every item of feedback[] in ${vars.work_dir}/.itc-verdict.json.
177
+ expectFile: ${vars.work_dir}/3-draft-draft-article.new.md
178
+ - kind: shell
179
+ options:
180
+ command: mv -f "${vars.work_dir}/3-draft-draft-article.new.md" "${vars.work_dir}/3-draft-draft-article.md"
181
+
182
+ - id: judge
183
+ description: "Evaluate technical draft with content-judge"
184
+ onEnter:
185
+ - kind: agent.run
186
+ options:
187
+ role: reviewer
188
+ agent: ${vars.agent}
189
+ input: |
190
+ Invoke the kk:content-judge skill.
191
+ Evaluate the draft at ${vars.work_dir}/3-draft-draft-article.md against the ${vars.rubric} rubric.
192
+ Research evidence: if ${vars.work_dir}/docs.json exists, read it and weigh it when judging.
193
+ Write the verdict JSON to ${vars.work_dir}/.itc-verdict.json per the skill's verdict contract.
194
+ Print the verdict path as the last line of stdout.
195
+ expectFile: ${vars.work_dir}/.itc-verdict.json
196
+ - kind: file.read.into-var
197
+ options:
198
+ path: ${vars.work_dir}/.itc-verdict.json
199
+ var: __verdictFeedback
200
+ - kind: shell
201
+ options:
202
+ command: >-
203
+ KK_ITC_AUTO="${vars.auto}" KK_ITC_MAX_REVISIONS="${vars.max_revisions}" kk stage run itc-author-verdict "${vars.work_dir}"
204
+
205
+ - id: author-finish
206
+ description: "Validate non-empty draft, approved outline, and review/judge disposition, then write .itc/author-complete.json"
207
+ onEnter:
208
+ - kind: shell
209
+ options:
210
+ command: >-
211
+ kk stage run itc-author-complete "${vars.work_dir}" "${vars.parent_run_id}"
212
+
213
+ - id: done
214
+ description: "Terminal — IT content authoring completed successfully"
215
+
216
+ - id: failed
217
+ description: "Terminal — IT content authoring failed or rejected"
218
+
219
+ transitions:
220
+ - from: author-init
221
+ to: outline-write
222
+ guard:
223
+ kind: always
224
+
225
+ - from: outline-write
226
+ to: outline-commit
227
+ description: "Outline pre-selected -> commit directly"
228
+ guard:
229
+ kind: shell
230
+ options:
231
+ command: 'test -n "${vars.outline}"'
232
+
233
+ - from: outline-write
234
+ to: outline-autopick
235
+ description: "Auto mode -> run auto pick"
236
+ guard:
237
+ kind: shell
238
+ options:
239
+ command: 'test "${vars.auto}" = "true" -a -z "${vars.outline}"'
240
+
241
+ - from: outline-write
242
+ to: outline-select
243
+ description: "Interactive mode -> pause for operator selection"
244
+ guard:
245
+ kind: shell
246
+ options:
247
+ command: 'test "${vars.auto}" != "true" -a -z "${vars.outline}"'
248
+
249
+ - from: outline-select
250
+ to: outline-commit
251
+ guard:
252
+ kind: always
253
+
254
+ - from: outline-autopick
255
+ to: outline-commit
256
+ description: "Decision chose a validated slot"
257
+ guard:
258
+ kind: shell
259
+ options:
260
+ command: 'test -s "${vars.work_dir}/2-outline/.auto-pick"'
261
+
262
+ - from: outline-autopick
263
+ to: outline-select
264
+ description: "Decision deferred -> pause for operator selection (never a guessed first choice)"
265
+ guard:
266
+ kind: shell
267
+ options:
268
+ command: 'test ! -s "${vars.work_dir}/2-outline/.auto-pick"'
269
+
270
+ - from: outline-commit
271
+ to: draft-write
272
+ guard:
273
+ kind: always
274
+
275
+ - from: draft-write
276
+ to: unslop
277
+ guard:
278
+ kind: shell
279
+ options:
280
+ command: 'test "${vars.unslop}" = "true"'
281
+
282
+ - from: draft-write
283
+ to: judge
284
+ guard:
285
+ kind: shell
286
+ options:
287
+ command: 'test "${vars.judge}" = "true" -a "${vars.unslop}" != "true"'
288
+
289
+ - from: draft-write
290
+ to: draft-review
291
+ guard:
292
+ kind: shell
293
+ options:
294
+ command: 'test "${vars.judge}" != "true" -a "${vars.auto}" != "true" -a "${vars.unslop}" != "true"'
295
+
296
+ - from: draft-write
297
+ to: author-finish
298
+ guard:
299
+ kind: shell
300
+ options:
301
+ command: 'test "${vars.judge}" != "true" -a "${vars.auto}" = "true" -a "${vars.unslop}" != "true"'
302
+
303
+ - from: unslop
304
+ to: judge
305
+ guard:
306
+ kind: shell
307
+ options:
308
+ command: 'test "${vars.judge}" = "true"'
309
+
310
+ - from: unslop
311
+ to: draft-review
312
+ guard:
313
+ kind: shell
314
+ options:
315
+ command: 'test "${vars.judge}" != "true" -a "${vars.auto}" != "true"'
316
+
317
+ - from: unslop
318
+ to: author-finish
319
+ guard:
320
+ kind: shell
321
+ options:
322
+ command: 'test "${vars.judge}" != "true" -a "${vars.auto}" = "true"'
323
+
324
+ - from: draft-review
325
+ to: author-finish
326
+ description: "Operator approved draft"
327
+ guard:
328
+ kind: shell
329
+ options:
330
+ command: 'test "${vars.__hitlAnswer}" = "true" -o "${vars.__hitlAnswer}" = "yes"'
331
+
332
+ - from: draft-review
333
+ to: draft-revise
334
+ description: "Operator requested revision and revision budget remains"
335
+ guard:
336
+ kind: shell
337
+ options:
338
+ command: >-
339
+ test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
340
+ test "$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0)" -lt 3
341
+
342
+ - from: draft-review
343
+ to: failed
344
+ terminalReason: failed-guard
345
+ description: "Operator rejected draft and revision budget exhausted"
346
+ guard:
347
+ kind: shell
348
+ options:
349
+ command: >-
350
+ test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
351
+ test "$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0)" -ge 3
352
+
353
+ - from: draft-revise
354
+ to: draft-write
355
+ guard:
356
+ kind: always
357
+
358
+ - from: judge
359
+ to: author-finish
360
+ description: "Judge PASS with a HIGH/MEDIUM/LOW confidence"
361
+ guard:
362
+ kind: shell
363
+ options:
364
+ command: 'grep -qx finish "${vars.work_dir}/.itc/disposition.txt"'
365
+
366
+ - from: judge
367
+ to: draft-autorevise
368
+ description: "Auto mode, NEEDS_REVISION, and auto-revision budget remains"
369
+ guard:
370
+ kind: shell
371
+ options:
372
+ command: 'grep -qx autorevise "${vars.work_dir}/.itc/disposition.txt"'
373
+
374
+ - from: judge
375
+ to: draft-revise
376
+ description: "Interactive mode, NEEDS_REVISION, and manual revision budget remains"
377
+ guard:
378
+ kind: shell
379
+ options:
380
+ command: 'grep -qx revise "${vars.work_dir}/.itc/disposition.txt"'
381
+
382
+ - from: judge
383
+ to: failed
384
+ terminalReason: failed-guard
385
+ description: "FAIL, exhausted revision budget, or an out-of-contract verdict (0149 review P3)"
386
+ guard:
387
+ kind: shell
388
+ options:
389
+ command: 'grep -qx fail "${vars.work_dir}/.itc/disposition.txt"'
390
+
391
+ - from: draft-autorevise
392
+ to: unslop
393
+ guard:
394
+ kind: shell
395
+ options:
396
+ command: 'test "${vars.unslop}" = "true"'
397
+
398
+ - from: draft-autorevise
399
+ to: judge
400
+ guard:
401
+ kind: always
402
+
403
+ - from: author-finish
404
+ to: done
405
+ guard:
406
+ kind: always