@gobing-ai/knowledge-kit 0.1.17 → 0.1.20
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/board/daily-voice/index.js +40 -7
- package/dist/index.js +8428 -4448
- package/package.json +1 -1
- package/plugins/generations/image-gen/README.md +31 -31
- package/plugins/generations/image-gen/assets/sample/provenance.json +314 -0
- package/plugins/generations/image-gen/config.example.yaml +3 -0
- package/plugins/generations/image-gen/dist/index.js +154 -14
- package/plugins/generations/image-gen/presets/SOURCE.md +65 -0
- package/plugins/generations/image-gen/scripts/eval-style-presets.ts +513 -0
- package/plugins/generations/image-gen/scripts/gen-samples.ts +57 -7
- package/plugins/generations/image-gen/src/presets.ts +6 -5
- package/plugins/generations/image-gen/src/providers/h3-local.ts +196 -0
- package/plugins/generations/image-gen/src/providers/types.ts +11 -1
- package/plugins/kk/config.example.yaml +7 -2
- package/plugins/kk/decisions/extract/ai-news.yaml +5 -2
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/publish-presets/chinese-article.json +8 -2
- package/plugins/kk/publish-presets/daily-ai-voice-migration.json +1 -1
- package/plugins/kk/publish-presets/daily-ai-voice.json +57 -16
- package/plugins/kk/publish-presets/itc-main.json +36 -9
- package/plugins/kk/publish-presets/technical-article.json +8 -2
- package/plugins/kk/schedules/kk-daily-ai-voice3.cron.tmpl +8 -9
- package/plugins/kk/schedules/kk-daily-publish3-cn-peak.cron.tmpl +13 -19
- package/plugins/kk/schedules/kk-daily-publish3-overseas.cron.tmpl +11 -9
- package/plugins/kk/scripts/daily-stages.ts +238 -14
- package/plugins/kk/scripts/daily-triage-core.ts +43 -25
- package/plugins/kk/scripts/daily-triage.ts +1 -1
- package/plugins/kk/skills/image-authoring/SKILL.md +7 -3
- package/plugins/kk/skills/image-authoring/references/providers.md +27 -0
- package/plugins/kk/skills/image-authoring/references/style-extraction.md +1 -1
- package/plugins/kk/skills/publish/SKILL.md +15 -2
- package/plugins/kk/skills/web-automation/SKILL.md +31 -1
- package/plugins/kk/workflows/kk-article-generate.yaml +485 -0
- package/plugins/kk/workflows/kk-collect.yaml +8 -4
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +2 -1
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +4 -2
- package/plugins/kk/workflows/kk-daily-safety.yaml +5 -7
- package/plugins/kk/workflows/kk-news-generate.yaml +410 -0
- package/plugins/kk/workflows/kk-publish.yaml +236 -0
- package/plugins/publishings/bilibili-pub/dist/profile-check.js +49 -10
- package/plugins/publishings/cnblogs-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/csdn-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/infoq-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/jike-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/juejin-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/linkedin-pub/dist/index.js +43 -6
- package/plugins/publishings/linkedin-pub/dist/profile-check.js +92 -15
- package/plugins/publishings/linkedin-pub/src/index.ts +52 -6
- package/plugins/publishings/shipinhao-pub/dist/index.js +391 -32
- package/plugins/publishings/shipinhao-pub/dist/profile-check.js +52 -11
- package/plugins/publishings/shipinhao-pub/plugin.json +1 -1
- package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +393 -0
- package/plugins/publishings/shipinhao-pub/src/flow.ts +243 -14
- package/plugins/publishings/shipinhao-pub/src/selectors.ts +13 -0
- package/plugins/publishings/sspai-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/substack-pub/dist/profile-check.js +60 -10
- package/plugins/publishings/surfdash-pub/dist/index.js +50 -8
- package/plugins/publishings/surfdash-pub/src/index.ts +59 -8
- package/plugins/publishings/surfdash-pub/src/topic-claims.ts +34 -3
- package/plugins/publishings/threads-pub/dist/index.js +9196 -296
- package/plugins/publishings/threads-pub/dist/profile-check.js +21139 -0
- package/plugins/publishings/threads-pub/package.json +3 -1
- package/plugins/publishings/threads-pub/plugin.json +6 -1
- package/plugins/publishings/threads-pub/src/index.ts +8 -1
- package/plugins/publishings/threads-pub/src/post-rail.ts +357 -0
- package/plugins/publishings/threads-pub/src/profile-check.ts +17 -0
- package/plugins/publishings/wechatmp-pub/dist/index.js +454 -81
- package/plugins/publishings/wechatmp-pub/dist/profile-check.js +401 -102
- package/plugins/publishings/wechatmp-pub/src/flow.ts +42 -4
- package/plugins/publishings/wechatmp-pub/src/index.ts +142 -102
- package/plugins/publishings/wechatmp-pub/src/profile-check.ts +36 -58
- package/plugins/publishings/weibo-pub/dist/index.js +136 -22
- package/plugins/publishings/weibo-pub/dist/profile-check.js +61 -11
- package/plugins/publishings/weibo-pub/src/index.ts +208 -22
- package/plugins/publishings/x-pub/dist/index.js +263 -43
- package/plugins/publishings/x-pub/dist/profile-check.js +63 -11
- package/plugins/publishings/x-pub/src/index.ts +15 -1
- package/plugins/publishings/x-pub/src/post-rail.ts +334 -0
- package/plugins/publishings/xhs-pub/dist/index.js +193 -201
- package/plugins/publishings/xhs-pub/dist/profile-check.js +380 -85
- package/plugins/publishings/xhs-pub/src/automation-guard.ts +2 -3
- package/plugins/publishings/xhs-pub/src/flow.ts +177 -205
- package/plugins/publishings/xhs-pub/src/index.ts +65 -59
- package/plugins/publishings/xhs-pub/src/modes.ts +1 -1
- package/plugins/publishings/xhs-pub/src/page.ts +2 -2
- package/plugins/publishings/xhs-pub/src/profile-check.ts +86 -150
- package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +60 -10
- package/plugins/kk/scripts/daily-scheduled-run.ts +0 -581
- package/plugins/kk/scripts/voice3-publish-window.ts +0 -206
- package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +0 -903
- package/plugins/kk/workflows/kk-daily-publish3.yaml +0 -353
- package/plugins/kk/workflows/kk-itc-author.yaml +0 -484
- package/plugins/kk/workflows/kk-itc-publish-tail.yaml +0 -112
- package/plugins/kk/workflows/kk-itc.yaml +0 -291
|
@@ -1,484 +0,0 @@
|
|
|
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
|
-
outline_bullets_only: "false"
|
|
26
|
-
max_revisions: "2"
|
|
27
|
-
parent_run_id: ""
|
|
28
|
-
child_run_id: ""
|
|
29
|
-
definition_digest: ""
|
|
30
|
-
options_digest: ""
|
|
31
|
-
__hitlAnswer: ""
|
|
32
|
-
__hitlInput: ""
|
|
33
|
-
__verdictFeedback: ""
|
|
34
|
-
|
|
35
|
-
states:
|
|
36
|
-
- id: author-init
|
|
37
|
-
description: "Initialize child authoring state and write .itc/author-run.json identity"
|
|
38
|
-
onEnter:
|
|
39
|
-
- kind: shell
|
|
40
|
-
options:
|
|
41
|
-
# jq one-liner, not a heredoc: this is a folded scalar (>-), so newlines become spaces
|
|
42
|
-
# and a heredoc body would land on cat's argv (dogfood 2026-10-16: "cat: {: No such file").
|
|
43
|
-
command: >-
|
|
44
|
-
mkdir -p "${vars.work_dir}/.itc" &&
|
|
45
|
-
jq -n --arg p "${vars.parent_run_id}" --arg c "${vars.child_run_id}"
|
|
46
|
-
--arg d "${vars.definition_digest}" --arg o "${vars.options_digest}"
|
|
47
|
-
'{schemaVersion:1, parentRunId:$p, childRunId:$c, definitionDigest:$d, optionsDigest:$o}'
|
|
48
|
-
> "${vars.work_dir}/.itc/author-run.json"
|
|
49
|
-
|
|
50
|
-
- id: outline-write
|
|
51
|
-
description: "Generate outline options a, b (and optional c) via writer skill"
|
|
52
|
-
onEnter:
|
|
53
|
-
- kind: agent.run
|
|
54
|
-
options:
|
|
55
|
-
role: scribe
|
|
56
|
-
agent: ${vars.agent}
|
|
57
|
-
input: |
|
|
58
|
-
Invoke the kk:${vars.writer} skill.
|
|
59
|
-
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}.
|
|
60
|
-
When outline_bullets_only is true (${vars.outline_bullets_only}), keep every option to a heading plus bullet points only — short bullets, no prose paragraphs, no section bodies.
|
|
61
|
-
Revision feedback: ${vars.__hitlInput}
|
|
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
|
-
# The auto paths bypass this state by edge guard, so this gate always asks the operator.
|
|
83
|
-
decision:
|
|
84
|
-
mode: never
|
|
85
|
-
|
|
86
|
-
- id: outline-autopick
|
|
87
|
-
description: "Auto mode — validate the writer's recommendation, then bind the bounded catalog decision (empty on defer)"
|
|
88
|
-
onEnter:
|
|
89
|
-
- kind: shell
|
|
90
|
-
options:
|
|
91
|
-
command: >-
|
|
92
|
-
kk stage run itc-outline-pick "${vars.work_dir}" &&
|
|
93
|
-
kk stage run itc-decision --outline "${vars.work_dir}" "${vars.parent_run_id}"
|
|
94
|
-
- kind: file.read.into-var
|
|
95
|
-
options:
|
|
96
|
-
path: ${vars.work_dir}/2-outline/.auto-pick
|
|
97
|
-
var: outline
|
|
98
|
-
|
|
99
|
-
- id: outline-commit
|
|
100
|
-
description: "Copy selected outline to outline-approved.md"
|
|
101
|
-
onEnter:
|
|
102
|
-
- kind: shell
|
|
103
|
-
options:
|
|
104
|
-
command: >-
|
|
105
|
-
sel="${vars.outline}";
|
|
106
|
-
if [ -z "$sel" ]; then sel="${vars.__hitlAnswer}"; fi;
|
|
107
|
-
if [ -z "$sel" ]; then sel="a"; fi;
|
|
108
|
-
src="${vars.work_dir}/2-outline/outline-option-$sel.md";
|
|
109
|
-
if [ ! -f "$src" ]; then
|
|
110
|
-
echo "selected outline file not found: $src" >&2; exit 1;
|
|
111
|
-
fi;
|
|
112
|
-
cp "$src" "${vars.work_dir}/2-outline/outline-approved.md";
|
|
113
|
-
|
|
114
|
-
- id: outline-review
|
|
115
|
-
description: "Operator reviews and approves or requests revision on outline-approved.md"
|
|
116
|
-
pause: true
|
|
117
|
-
onEnter:
|
|
118
|
-
- kind: hitl.confirm
|
|
119
|
-
options:
|
|
120
|
-
prompt: "Review the approved outline at ${vars.work_dir}/2-outline/outline-approved.md. Approve?"
|
|
121
|
-
var: __hitlAnswer
|
|
122
|
-
# The auto path bypasses this state by edge guard, so this gate always asks the operator.
|
|
123
|
-
decision:
|
|
124
|
-
mode: never
|
|
125
|
-
|
|
126
|
-
- id: outline-revise
|
|
127
|
-
description: "Collect outline revision feedback from operator (bounded by 3 rounds, same cap as draft-revise)"
|
|
128
|
-
pause: true
|
|
129
|
-
onEnter:
|
|
130
|
-
- kind: shell
|
|
131
|
-
options:
|
|
132
|
-
command: >-
|
|
133
|
-
n=$(cat "${vars.work_dir}/.outline-revise-count" 2>/dev/null || echo 0);
|
|
134
|
-
echo $((n + 1)) > "${vars.work_dir}/.outline-revise-count";
|
|
135
|
-
- kind: hitl.input
|
|
136
|
-
options:
|
|
137
|
-
prompt: "Provide specific revision feedback for the outline at ${vars.work_dir}/2-outline/outline-approved.md:"
|
|
138
|
-
var: __hitlInput
|
|
139
|
-
|
|
140
|
-
- id: draft-write
|
|
141
|
-
description: "Author full technical draft from approved outline"
|
|
142
|
-
onEnter:
|
|
143
|
-
- kind: agent.run
|
|
144
|
-
options:
|
|
145
|
-
role: scribe
|
|
146
|
-
agent: ${vars.agent}
|
|
147
|
-
input: |
|
|
148
|
-
Invoke the kk:${vars.writer} skill.
|
|
149
|
-
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}.
|
|
150
|
-
Revision feedback: ${vars.__hitlInput}
|
|
151
|
-
expectFile: ${vars.work_dir}/3-draft-draft-article.md
|
|
152
|
-
|
|
153
|
-
- id: unslop
|
|
154
|
-
description: "De-slop pass — kk:taste-unslop line-edits the draft"
|
|
155
|
-
onEnter:
|
|
156
|
-
- kind: agent.run
|
|
157
|
-
options:
|
|
158
|
-
role: scribe
|
|
159
|
-
agent: ${vars.agent}
|
|
160
|
-
input: |
|
|
161
|
-
Invoke the kk:taste-unslop skill.
|
|
162
|
-
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.
|
|
163
|
-
expectFile: ${vars.work_dir}/3-draft-draft-article.new.md
|
|
164
|
-
- kind: shell
|
|
165
|
-
options:
|
|
166
|
-
command: mv -f "${vars.work_dir}/3-draft-draft-article.new.md" "${vars.work_dir}/3-draft-draft-article.md"
|
|
167
|
-
|
|
168
|
-
- id: draft-review
|
|
169
|
-
description: "Operator reviews and approves or requests revision on draft-article.md"
|
|
170
|
-
pause: true
|
|
171
|
-
onEnter:
|
|
172
|
-
- kind: hitl.confirm
|
|
173
|
-
options:
|
|
174
|
-
prompt: "Review draft at ${vars.work_dir}/3-draft-draft-article.md. Approve?"
|
|
175
|
-
var: __hitlAnswer
|
|
176
|
-
# The auto paths bypass this state by edge guard, so this gate always asks the operator.
|
|
177
|
-
decision:
|
|
178
|
-
mode: never
|
|
179
|
-
|
|
180
|
-
- id: draft-revise
|
|
181
|
-
description: "Collect revision feedback from operator (bounded by 3 rounds)"
|
|
182
|
-
pause: true
|
|
183
|
-
onEnter:
|
|
184
|
-
- kind: shell
|
|
185
|
-
options:
|
|
186
|
-
command: >-
|
|
187
|
-
n=$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0);
|
|
188
|
-
echo $((n + 1)) > "${vars.work_dir}/.revise-count";
|
|
189
|
-
- kind: hitl.input
|
|
190
|
-
options:
|
|
191
|
-
prompt: "Provide specific revision feedback for ${vars.work_dir}/3-draft-draft-article.md:"
|
|
192
|
-
var: __hitlInput
|
|
193
|
-
|
|
194
|
-
- id: draft-autorevise
|
|
195
|
-
description: "Auto mode — apply judge feedback to the draft"
|
|
196
|
-
onEnter:
|
|
197
|
-
- kind: shell
|
|
198
|
-
options:
|
|
199
|
-
command: >-
|
|
200
|
-
n=$(cat "${vars.work_dir}/.auto-revise-count" 2>/dev/null || echo 0);
|
|
201
|
-
echo $((n + 1)) > "${vars.work_dir}/.auto-revise-count";
|
|
202
|
-
- kind: agent.run
|
|
203
|
-
options:
|
|
204
|
-
role: scribe
|
|
205
|
-
agent: ${vars.agent}
|
|
206
|
-
input: |
|
|
207
|
-
Invoke the kk:${vars.writer} skill.
|
|
208
|
-
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.
|
|
209
|
-
expectFile: ${vars.work_dir}/3-draft-draft-article.new.md
|
|
210
|
-
- kind: shell
|
|
211
|
-
options:
|
|
212
|
-
command: mv -f "${vars.work_dir}/3-draft-draft-article.new.md" "${vars.work_dir}/3-draft-draft-article.md"
|
|
213
|
-
|
|
214
|
-
- id: judge
|
|
215
|
-
description: "Evaluate technical draft with content-judge"
|
|
216
|
-
onEnter:
|
|
217
|
-
- kind: agent.run
|
|
218
|
-
options:
|
|
219
|
-
role: reviewer
|
|
220
|
-
agent: ${vars.agent}
|
|
221
|
-
input: |
|
|
222
|
-
Invoke the kk:content-judge skill.
|
|
223
|
-
Evaluate the draft at ${vars.work_dir}/3-draft-draft-article.md against the ${vars.rubric} rubric.
|
|
224
|
-
Research evidence: if ${vars.work_dir}/docs.json exists, read it and weigh it when judging.
|
|
225
|
-
Write the verdict JSON to ${vars.work_dir}/.itc-verdict.json per the skill's verdict contract.
|
|
226
|
-
Print the verdict path as the last line of stdout.
|
|
227
|
-
expectFile: ${vars.work_dir}/.itc-verdict.json
|
|
228
|
-
- kind: file.read.into-var
|
|
229
|
-
options:
|
|
230
|
-
path: ${vars.work_dir}/.itc-verdict.json
|
|
231
|
-
var: __verdictFeedback
|
|
232
|
-
- kind: shell
|
|
233
|
-
options:
|
|
234
|
-
command: >-
|
|
235
|
-
KK_ITC_AUTO="${vars.auto}" KK_ITC_MAX_REVISIONS="${vars.max_revisions}" kk stage run itc-author-verdict "${vars.work_dir}"
|
|
236
|
-
|
|
237
|
-
- id: author-finish
|
|
238
|
-
description: "Validate non-empty draft, approved outline, and review/judge disposition, then write .itc/author-complete.json"
|
|
239
|
-
onEnter:
|
|
240
|
-
- kind: shell
|
|
241
|
-
options:
|
|
242
|
-
command: >-
|
|
243
|
-
kk stage run itc-author-complete "${vars.work_dir}" "${vars.parent_run_id}"
|
|
244
|
-
|
|
245
|
-
- id: done
|
|
246
|
-
description: "Terminal — IT content authoring completed successfully"
|
|
247
|
-
|
|
248
|
-
- id: failed
|
|
249
|
-
description: "Terminal — IT content authoring failed or rejected"
|
|
250
|
-
|
|
251
|
-
transitions:
|
|
252
|
-
- from: author-init
|
|
253
|
-
to: outline-write
|
|
254
|
-
guard:
|
|
255
|
-
kind: always
|
|
256
|
-
|
|
257
|
-
- from: outline-write
|
|
258
|
-
to: outline-commit
|
|
259
|
-
description: "Outline pre-selected -> commit directly"
|
|
260
|
-
guard:
|
|
261
|
-
kind: shell
|
|
262
|
-
options:
|
|
263
|
-
command: 'test -n "${vars.outline}"'
|
|
264
|
-
|
|
265
|
-
- from: outline-write
|
|
266
|
-
to: outline-autopick
|
|
267
|
-
description: "Auto mode -> run auto pick"
|
|
268
|
-
guard:
|
|
269
|
-
kind: shell
|
|
270
|
-
options:
|
|
271
|
-
command: 'test "${vars.auto}" = "true" -a -z "${vars.outline}"'
|
|
272
|
-
|
|
273
|
-
- from: outline-write
|
|
274
|
-
to: outline-select
|
|
275
|
-
description: "Interactive mode -> pause for operator selection"
|
|
276
|
-
guard:
|
|
277
|
-
kind: shell
|
|
278
|
-
options:
|
|
279
|
-
command: 'test "${vars.auto}" != "true" -a -z "${vars.outline}"'
|
|
280
|
-
|
|
281
|
-
- from: outline-select
|
|
282
|
-
to: outline-commit
|
|
283
|
-
guard:
|
|
284
|
-
kind: always
|
|
285
|
-
|
|
286
|
-
- from: outline-autopick
|
|
287
|
-
to: outline-commit
|
|
288
|
-
description: "Decision chose a validated slot"
|
|
289
|
-
guard:
|
|
290
|
-
kind: shell
|
|
291
|
-
options:
|
|
292
|
-
command: 'test -s "${vars.work_dir}/2-outline/.auto-pick"'
|
|
293
|
-
|
|
294
|
-
- from: outline-autopick
|
|
295
|
-
to: outline-select
|
|
296
|
-
description: "Decision deferred -> pause for operator selection (never a guessed first choice)"
|
|
297
|
-
guard:
|
|
298
|
-
kind: shell
|
|
299
|
-
options:
|
|
300
|
-
command: 'test ! -s "${vars.work_dir}/2-outline/.auto-pick"'
|
|
301
|
-
|
|
302
|
-
- from: outline-commit
|
|
303
|
-
to: outline-review
|
|
304
|
-
description: "Interactive mode -> operator reviews the committed outline"
|
|
305
|
-
guard:
|
|
306
|
-
kind: shell
|
|
307
|
-
options:
|
|
308
|
-
command: 'test "${vars.auto}" != "true"'
|
|
309
|
-
|
|
310
|
-
- from: outline-commit
|
|
311
|
-
to: draft-write
|
|
312
|
-
description: "Auto mode: the outline pick is bound by itc-outline-pick, no operator outline review"
|
|
313
|
-
guard:
|
|
314
|
-
kind: shell
|
|
315
|
-
options:
|
|
316
|
-
command: 'test "${vars.auto}" = "true"'
|
|
317
|
-
|
|
318
|
-
- from: outline-review
|
|
319
|
-
to: draft-write
|
|
320
|
-
description: "Operator approved the outline"
|
|
321
|
-
guard:
|
|
322
|
-
kind: shell
|
|
323
|
-
options:
|
|
324
|
-
command: 'test "${vars.__hitlAnswer}" = "true" -o "${vars.__hitlAnswer}" = "yes"'
|
|
325
|
-
|
|
326
|
-
- from: outline-review
|
|
327
|
-
to: outline-revise
|
|
328
|
-
description: "Operator requested outline revision and budget remains"
|
|
329
|
-
guard:
|
|
330
|
-
kind: shell
|
|
331
|
-
options:
|
|
332
|
-
command: >-
|
|
333
|
-
test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
|
|
334
|
-
test "$(cat "${vars.work_dir}/.outline-revise-count" 2>/dev/null || echo 0)" -lt 3
|
|
335
|
-
|
|
336
|
-
- from: outline-review
|
|
337
|
-
to: failed
|
|
338
|
-
terminalReason: failed-guard
|
|
339
|
-
description: "Operator rejected the outline and revision budget exhausted"
|
|
340
|
-
guard:
|
|
341
|
-
kind: shell
|
|
342
|
-
options:
|
|
343
|
-
command: >-
|
|
344
|
-
test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
|
|
345
|
-
test "$(cat "${vars.work_dir}/.outline-revise-count" 2>/dev/null || echo 0)" -ge 3
|
|
346
|
-
|
|
347
|
-
- from: outline-revise
|
|
348
|
-
to: outline-write
|
|
349
|
-
description: "Regenerate outline options with the collected feedback"
|
|
350
|
-
guard:
|
|
351
|
-
kind: always
|
|
352
|
-
|
|
353
|
-
- from: draft-write
|
|
354
|
-
to: unslop
|
|
355
|
-
guard:
|
|
356
|
-
kind: shell
|
|
357
|
-
options:
|
|
358
|
-
command: 'test "${vars.unslop}" = "true"'
|
|
359
|
-
|
|
360
|
-
- from: draft-write
|
|
361
|
-
to: judge
|
|
362
|
-
guard:
|
|
363
|
-
kind: shell
|
|
364
|
-
options:
|
|
365
|
-
command: 'test "${vars.judge}" = "true" -a "${vars.unslop}" != "true"'
|
|
366
|
-
|
|
367
|
-
- from: draft-write
|
|
368
|
-
to: draft-review
|
|
369
|
-
guard:
|
|
370
|
-
kind: shell
|
|
371
|
-
options:
|
|
372
|
-
command: 'test "${vars.judge}" != "true" -a "${vars.auto}" != "true" -a "${vars.unslop}" != "true"'
|
|
373
|
-
|
|
374
|
-
- from: draft-write
|
|
375
|
-
to: author-finish
|
|
376
|
-
guard:
|
|
377
|
-
kind: shell
|
|
378
|
-
options:
|
|
379
|
-
command: 'test "${vars.judge}" != "true" -a "${vars.auto}" = "true" -a "${vars.unslop}" != "true"'
|
|
380
|
-
|
|
381
|
-
- from: unslop
|
|
382
|
-
to: judge
|
|
383
|
-
guard:
|
|
384
|
-
kind: shell
|
|
385
|
-
options:
|
|
386
|
-
command: 'test "${vars.judge}" = "true"'
|
|
387
|
-
|
|
388
|
-
- from: unslop
|
|
389
|
-
to: draft-review
|
|
390
|
-
guard:
|
|
391
|
-
kind: shell
|
|
392
|
-
options:
|
|
393
|
-
command: 'test "${vars.judge}" != "true" -a "${vars.auto}" != "true"'
|
|
394
|
-
|
|
395
|
-
- from: unslop
|
|
396
|
-
to: author-finish
|
|
397
|
-
guard:
|
|
398
|
-
kind: shell
|
|
399
|
-
options:
|
|
400
|
-
command: 'test "${vars.judge}" != "true" -a "${vars.auto}" = "true"'
|
|
401
|
-
|
|
402
|
-
- from: draft-review
|
|
403
|
-
to: author-finish
|
|
404
|
-
description: "Operator approved draft"
|
|
405
|
-
guard:
|
|
406
|
-
kind: shell
|
|
407
|
-
options:
|
|
408
|
-
command: 'test "${vars.__hitlAnswer}" = "true" -o "${vars.__hitlAnswer}" = "yes"'
|
|
409
|
-
|
|
410
|
-
- from: draft-review
|
|
411
|
-
to: draft-revise
|
|
412
|
-
description: "Operator requested revision and revision budget remains"
|
|
413
|
-
guard:
|
|
414
|
-
kind: shell
|
|
415
|
-
options:
|
|
416
|
-
command: >-
|
|
417
|
-
test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
|
|
418
|
-
test "$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0)" -lt 3
|
|
419
|
-
|
|
420
|
-
- from: draft-review
|
|
421
|
-
to: failed
|
|
422
|
-
terminalReason: failed-guard
|
|
423
|
-
description: "Operator rejected draft and revision budget exhausted"
|
|
424
|
-
guard:
|
|
425
|
-
kind: shell
|
|
426
|
-
options:
|
|
427
|
-
command: >-
|
|
428
|
-
test "${vars.__hitlAnswer}" != "true" -a "${vars.__hitlAnswer}" != "yes" &&
|
|
429
|
-
test "$(cat "${vars.work_dir}/.revise-count" 2>/dev/null || echo 0)" -ge 3
|
|
430
|
-
|
|
431
|
-
- from: draft-revise
|
|
432
|
-
to: draft-write
|
|
433
|
-
guard:
|
|
434
|
-
kind: always
|
|
435
|
-
|
|
436
|
-
- from: judge
|
|
437
|
-
to: author-finish
|
|
438
|
-
description: "Judge PASS with a HIGH/MEDIUM/LOW confidence"
|
|
439
|
-
guard:
|
|
440
|
-
kind: shell
|
|
441
|
-
options:
|
|
442
|
-
command: 'grep -qx finish "${vars.work_dir}/.itc/disposition.txt"'
|
|
443
|
-
|
|
444
|
-
- from: judge
|
|
445
|
-
to: draft-autorevise
|
|
446
|
-
description: "Auto mode, NEEDS_REVISION, and auto-revision budget remains"
|
|
447
|
-
guard:
|
|
448
|
-
kind: shell
|
|
449
|
-
options:
|
|
450
|
-
command: 'grep -qx autorevise "${vars.work_dir}/.itc/disposition.txt"'
|
|
451
|
-
|
|
452
|
-
- from: judge
|
|
453
|
-
to: draft-revise
|
|
454
|
-
description: "Interactive mode, NEEDS_REVISION, and manual revision budget remains"
|
|
455
|
-
guard:
|
|
456
|
-
kind: shell
|
|
457
|
-
options:
|
|
458
|
-
command: 'grep -qx revise "${vars.work_dir}/.itc/disposition.txt"'
|
|
459
|
-
|
|
460
|
-
- from: judge
|
|
461
|
-
to: failed
|
|
462
|
-
terminalReason: failed-guard
|
|
463
|
-
description: "FAIL, exhausted revision budget, or an out-of-contract verdict (0149 review P3)"
|
|
464
|
-
guard:
|
|
465
|
-
kind: shell
|
|
466
|
-
options:
|
|
467
|
-
command: 'grep -qx fail "${vars.work_dir}/.itc/disposition.txt"'
|
|
468
|
-
|
|
469
|
-
- from: draft-autorevise
|
|
470
|
-
to: unslop
|
|
471
|
-
guard:
|
|
472
|
-
kind: shell
|
|
473
|
-
options:
|
|
474
|
-
command: 'test "${vars.unslop}" = "true"'
|
|
475
|
-
|
|
476
|
-
- from: draft-autorevise
|
|
477
|
-
to: judge
|
|
478
|
-
guard:
|
|
479
|
-
kind: always
|
|
480
|
-
|
|
481
|
-
- from: author-finish
|
|
482
|
-
to: done
|
|
483
|
-
guard:
|
|
484
|
-
kind: always
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: kk-itc-publish-tail
|
|
3
|
-
kind: dag
|
|
4
|
-
version: "2"
|
|
5
|
-
description: >-
|
|
6
|
-
Re-entry seam for a failed kk-itc publish run: the seven post-authoring nodes only, so no
|
|
7
|
-
invocation can re-run authoring, and send-confirm keeps the live-send approval. Re-enter with
|
|
8
|
-
`spur workflow run plugins/kk/workflows/kk-itc-publish-tail.yaml --vars '{"work_dir":"<failed work_dir>"}'`.
|
|
9
|
-
Run identity comes from the frozen `$work_dir/itc-options.json` parentRunId, never from this run.
|
|
10
|
-
|
|
11
|
-
vars:
|
|
12
|
-
work_dir: ""
|
|
13
|
-
# Mirrors the kk-itc var so the shared nodes stay byte-identical (the drift test owns that);
|
|
14
|
-
# set plan_only=true on a re-entry to stop after check-targets without sending or settling.
|
|
15
|
-
plan_only: "false"
|
|
16
|
-
# Declared for the engine's own injection; no tail node templates it (run identity is frozen).
|
|
17
|
-
__runId: ""
|
|
18
|
-
__definitionDigest: ""
|
|
19
|
-
|
|
20
|
-
nodes:
|
|
21
|
-
- id: check-targets
|
|
22
|
-
description: "Check readiness probes for plannable publish targets"
|
|
23
|
-
action:
|
|
24
|
-
kind: shell
|
|
25
|
-
options:
|
|
26
|
-
command: >-
|
|
27
|
-
test -f "${vars.work_dir}/4-publish/publish-plan.json" || exit 0;
|
|
28
|
-
kk stage run itc-check-targets "${vars.work_dir}"
|
|
29
|
-
|
|
30
|
-
- id: send-confirm
|
|
31
|
-
description: >-
|
|
32
|
-
Operator approval of a send: `pause: true` stops the run and RESUME is the approval
|
|
33
|
-
(no action); cancelling is the rejection. Entered for any plan with targets — a draft
|
|
34
|
-
still creates real remote drafts, not only a LIVE send — and skipped for empty plans
|
|
35
|
-
and plan_only runs (the plan preview is the stop point).
|
|
36
|
-
dependsOn:
|
|
37
|
-
- check-targets
|
|
38
|
-
pause: true
|
|
39
|
-
condition:
|
|
40
|
-
kind: shell
|
|
41
|
-
options:
|
|
42
|
-
# Item 5: draft-only plans with targets also confirm (draft saves are real remote
|
|
43
|
-
# artifacts). plan_only runs stop at the plan instead of pausing for a no-op confirm.
|
|
44
|
-
command: 'jq -e "((.targets // []) | length) > 0" "${vars.work_dir}/4-publish/publish-plan.json" >/dev/null 2>&1 && test "${vars.plan_only}" != "true"'
|
|
45
|
-
|
|
46
|
-
- id: fanout-send
|
|
47
|
-
description: "Dispatch target payloads via executor fan-out and record receipts"
|
|
48
|
-
dependsOn:
|
|
49
|
-
- send-confirm
|
|
50
|
-
# plan_only stops after the confirmed plan: no sends, no recovery, no settle.
|
|
51
|
-
condition:
|
|
52
|
-
kind: shell
|
|
53
|
-
options:
|
|
54
|
-
command: 'test "${vars.plan_only}" != "true"'
|
|
55
|
-
action:
|
|
56
|
-
kind: shell
|
|
57
|
-
options:
|
|
58
|
-
command: >-
|
|
59
|
-
test -f "${vars.work_dir}/4-publish/publish-plan.json" || exit 0;
|
|
60
|
-
kk stage run itc-send-targets "${vars.work_dir}"
|
|
61
|
-
|
|
62
|
-
- id: fanout-recovery
|
|
63
|
-
description: "Retry safe effect-none target failures once within budget"
|
|
64
|
-
dependsOn:
|
|
65
|
-
- fanout-send
|
|
66
|
-
condition:
|
|
67
|
-
kind: shell
|
|
68
|
-
options:
|
|
69
|
-
command: 'test "${vars.plan_only}" != "true"'
|
|
70
|
-
action:
|
|
71
|
-
kind: shell
|
|
72
|
-
options:
|
|
73
|
-
command: >-
|
|
74
|
-
test -f "${vars.work_dir}/4-publish/publish-plan.json" || exit 0;
|
|
75
|
-
kk stage run itc-send-targets "${vars.work_dir}" --retry
|
|
76
|
-
|
|
77
|
-
- id: reconcile-settle
|
|
78
|
-
description: "Reconcile target receipts and settle store selection"
|
|
79
|
-
dependsOn:
|
|
80
|
-
- fanout-recovery
|
|
81
|
-
# plan_only left no receipts to reconcile; with targets present the stage would fail on
|
|
82
|
-
# their absence, so the plan preview ends the run before settle (report still runs).
|
|
83
|
-
condition:
|
|
84
|
-
kind: shell
|
|
85
|
-
options:
|
|
86
|
-
command: 'test "${vars.plan_only}" != "true"'
|
|
87
|
-
action:
|
|
88
|
-
kind: shell
|
|
89
|
-
options:
|
|
90
|
-
command: >-
|
|
91
|
-
kk stage run itc-reconcile-receipts "${vars.work_dir}"
|
|
92
|
-
|
|
93
|
-
- id: seo
|
|
94
|
-
description: "Export SEO prepublish request and published pages handoffs"
|
|
95
|
-
action:
|
|
96
|
-
kind: shell
|
|
97
|
-
options:
|
|
98
|
-
command: >-
|
|
99
|
-
kk stage run itc-export-seo "${vars.work_dir}" "$(jq -r '.seo' "${vars.work_dir}/itc-options.json")"
|
|
100
|
-
|
|
101
|
-
- id: report
|
|
102
|
-
description: "Produce final run report summary"
|
|
103
|
-
# Every tail branch: a skipped optional branch still satisfies the edge, so an all-skipped
|
|
104
|
-
# publication reports, but a report never races an unfinished send.
|
|
105
|
-
dependsOn:
|
|
106
|
-
- reconcile-settle
|
|
107
|
-
- seo
|
|
108
|
-
action:
|
|
109
|
-
kind: shell
|
|
110
|
-
options:
|
|
111
|
-
command: >-
|
|
112
|
-
kk stage run itc-report-summary "${vars.work_dir}" "$(jq -r '.maxRevisions' "${vars.work_dir}/itc-options.json")"
|