@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,353 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: kk-daily-publish3
|
|
3
|
-
kind: dag
|
|
4
|
-
version: "1"
|
|
5
|
-
description: >-
|
|
6
|
-
The publish half of voice3 (design `docs/design/kk-daily-ai-voice3.md` §5, §5a, §5b, task 0323):
|
|
7
|
-
three windows over one frozen bundle. `after-generate` drafts the draft-capable channels right
|
|
8
|
-
after generation, `cn-peak` goes live at 09:00 Asia/Shanghai, and `overseas-rss` runs behind the
|
|
9
|
-
podcast RSS gate. The channel matrix lives in the `daily-ai-voice` publish preset, never here.
|
|
10
|
-
Re-enter a failed window with
|
|
11
|
-
`spur workflow run plugins/kk/workflows/kk-daily-publish3.yaml --vars '{"work_dir":"<day dir>","window":"after-generate"}'`
|
|
12
|
-
— receipts make the rerun a no-op for anything already delivered.
|
|
13
|
-
|
|
14
|
-
# ADR-022: live is launch-only. A workflow file never yields a live send; the operator's launch var
|
|
15
|
-
# (or the installed schedule entry that carries it) is the consent. `dummy` is the rehearsal switch.
|
|
16
|
-
vars:
|
|
17
|
-
work_dir: ""
|
|
18
|
-
run_date: ""
|
|
19
|
-
window: after-generate
|
|
20
|
-
# Empty = the operator's `workflows.kk-daily-ai-voice3.publish_preset` selector decides.
|
|
21
|
-
preset: ""
|
|
22
|
-
# 2026-11-12 (ADR-022 amendment): the preset owns the live/draft decision, so the unattended
|
|
23
|
-
# daily posture runs without a human at the pause. `live_confirm: "true"` restores the
|
|
24
|
-
# send-confirm pause for an interactive, one-off window.
|
|
25
|
-
live_confirm: "false"
|
|
26
|
-
channels: ""
|
|
27
|
-
live_channels: ""
|
|
28
|
-
dummy: "false"
|
|
29
|
-
agent: "inline"
|
|
30
|
-
__runId: ""
|
|
31
|
-
__definitionDigest: ""
|
|
32
|
-
|
|
33
|
-
nodes:
|
|
34
|
-
# ── cn-peak: the schedule fires in local time, the audience peaks in Shanghai ──────────────
|
|
35
|
-
- id: wait-until
|
|
36
|
-
description: >-
|
|
37
|
-
cn-peak only: the launchd entry fires at 17:00 local because launchd intervals follow the
|
|
38
|
-
machine's zone, so this node sleeps the remainder to 09:00 Asia/Shanghai (DST-safe, no-op when
|
|
39
|
-
already past).
|
|
40
|
-
condition:
|
|
41
|
-
kind: shell
|
|
42
|
-
options:
|
|
43
|
-
command: 'test "${vars.window}" = "cn-peak"'
|
|
44
|
-
|
|
45
|
-
action:
|
|
46
|
-
kind: shell
|
|
47
|
-
options:
|
|
48
|
-
command: 'kk stage run publish-matrix-wait-until 09:00 Asia/Shanghai'
|
|
49
|
-
|
|
50
|
-
# ── overseas-rss: never publish an episode the feed cannot prove ──────────────────────────
|
|
51
|
-
- id: rss-gate
|
|
52
|
-
description: >-
|
|
53
|
-
The overseas RSS gate, as a node that ALWAYS succeeds: for after-generate and cn-peak it is a
|
|
54
|
-
no-op, and for overseas-rss it records the verdict in `4-publish/rss-gate.json` (a miss is a
|
|
55
|
-
verdict, not a node failure). The graph routes on that artifact — `plan` requires a hit,
|
|
56
|
-
`diagnose` requires a miss — because a failing node would instead cascade-skip its dependents
|
|
57
|
-
through the engine's all-deps-skipped rule and take the incident path with it. `run_date` is
|
|
58
|
-
the previous day by the time this window runs, so the caller passes it; the gate never guesses.
|
|
59
|
-
action:
|
|
60
|
-
kind: shell
|
|
61
|
-
options:
|
|
62
|
-
command: >-
|
|
63
|
-
test "${vars.window}" = "overseas-rss" || { echo "publish3: rss-gate not applicable to ${vars.window}"; exit 0; };
|
|
64
|
-
test -n "${vars.run_date}" || { echo "publish3: overseas-rss needs run_date" >&2; exit 1; };
|
|
65
|
-
kk stage run publish-matrix-rss-gate "${vars.work_dir}" --date "${vars.run_date}" || true
|
|
66
|
-
|
|
67
|
-
# ── every window: plan → check → send-confirm → send ──────────────────────────────────────
|
|
68
|
-
- id: plan
|
|
69
|
-
description: >-
|
|
70
|
-
Freeze this window's target rows and their payloads from the bundle and the preset
|
|
71
|
-
(`4-publish/plan.<window>.json`). Never runs for a gated-miss overseas day: the condition below
|
|
72
|
-
reads `rss-gate.json` (the gate itself always exits 0), so an unpublished episode cannot be planned.
|
|
73
|
-
dependsOn: [rss-gate]
|
|
74
|
-
condition:
|
|
75
|
-
kind: shell
|
|
76
|
-
options:
|
|
77
|
-
# A gated miss plans nothing: overseas targets only exist once the feed proves the episode.
|
|
78
|
-
command: >-
|
|
79
|
-
test "${vars.window}" != "overseas-rss"
|
|
80
|
-
|| jq -e '.hit == true' "${vars.work_dir}/4-publish/rss-gate.json" >/dev/null 2>&1
|
|
81
|
-
|
|
82
|
-
action:
|
|
83
|
-
kind: shell
|
|
84
|
-
options:
|
|
85
|
-
command: >-
|
|
86
|
-
BUNDLE="${vars.work_dir}/bundle.json";
|
|
87
|
-
test -f "$BUNDLE" || { echo "publish3: no bundle at $BUNDLE" >&2; exit 1; };
|
|
88
|
-
ARGS="--bundle $BUNDLE --window ${vars.window}";
|
|
89
|
-
test -z "${vars.preset}" || ARGS="$ARGS --preset ${vars.preset}";
|
|
90
|
-
test -z "${vars.channels}" || ARGS="$ARGS --channels ${vars.channels}";
|
|
91
|
-
test -z "${vars.live_channels}" || ARGS="$ARGS --live-channels ${vars.live_channels}";
|
|
92
|
-
test "${vars.dummy}" != "true" || ARGS="$ARGS --dummy";
|
|
93
|
-
kk stage run publish-matrix-plan "${vars.work_dir}" $ARGS
|
|
94
|
-
|
|
95
|
-
- id: check
|
|
96
|
-
description: >-
|
|
97
|
-
Readiness probes for the planned non-dummy channels. Warn-only by contract: a stale session is
|
|
98
|
-
recorded in `4-publish/check.<window>.json` and the window still runs, because the send's own
|
|
99
|
-
receipt is the authority on whether a channel could publish.
|
|
100
|
-
dependsOn: [plan]
|
|
101
|
-
action:
|
|
102
|
-
kind: shell
|
|
103
|
-
options:
|
|
104
|
-
command: 'kk stage run publish-matrix-check "${vars.work_dir}" --window "${vars.window}" || true'
|
|
105
|
-
|
|
106
|
-
- id: validate
|
|
107
|
-
description: >-
|
|
108
|
-
Bind the bundle's calendar day before any side effect (0332 R1): normalize the run date
|
|
109
|
-
(compact `YYYYMMDD` and ISO `YYYY-MM-DD` both accepted), refuse a garbage one, and write the
|
|
110
|
-
canonical `4-publish/run-date.txt` every later stage derives its day from.
|
|
111
|
-
dependsOn: []
|
|
112
|
-
action:
|
|
113
|
-
kind: shell
|
|
114
|
-
options:
|
|
115
|
-
command: >-
|
|
116
|
-
kk stage run publish-matrix-validate "${vars.work_dir}" --run-date "${vars.run_date}"
|
|
117
|
-
|
|
118
|
-
- id: send-confirm
|
|
119
|
-
description: >-
|
|
120
|
-
Operator approval of a LIVE send: `pause: true` stops the run and RESUME is the approval;
|
|
121
|
-
cancelling is the rejection. Skipped for a draft-only window, so a rehearsal proceeds without
|
|
122
|
-
a human. Since 2026-11-12 (ADR-022 amendment) the operator's consent for the scheduled daily
|
|
123
|
-
posture lives in the preset's own modes, so the pause now requires `live_confirm=true` —
|
|
124
|
-
a scheduled run with live rows sends without stopping here.
|
|
125
|
-
dependsOn: [check]
|
|
126
|
-
pause: true
|
|
127
|
-
condition:
|
|
128
|
-
kind: shell
|
|
129
|
-
options:
|
|
130
|
-
command: >-
|
|
131
|
-
test "${vars.live_confirm}" = "true"
|
|
132
|
-
&& jq -e '[.rows[] | select(.mode == "live")] | length > 0'
|
|
133
|
-
"${vars.work_dir}/4-publish/plan.${vars.window}.json" >/dev/null 2>&1
|
|
134
|
-
|
|
135
|
-
- id: send
|
|
136
|
-
description: >-
|
|
137
|
-
Dispatch in tier order: tier 0 serial and blocking, later tiers after the tier-0 links resolve.
|
|
138
|
-
Receipts key every target, so a rerun never resends what was delivered, and a dummy row never
|
|
139
|
-
spawns a plugin. `check` is listed beside `send-confirm` on purpose: the engine skips a node only
|
|
140
|
-
when ALL its dependencies were skipped, so a draft window (no live row → `send-confirm` skipped)
|
|
141
|
-
still sends, while a gated/blocked plan (both ancestors skipped) still stops here. A failing
|
|
142
|
-
target does NOT end the run here — `onError: continue` lets the bounded retry and the outcome
|
|
143
|
-
assertion decide, so the evidence (report, ledger, outcome) always survives to the operator.
|
|
144
|
-
dependsOn: [check, send-confirm]
|
|
145
|
-
action:
|
|
146
|
-
kind: shell
|
|
147
|
-
onError: continue
|
|
148
|
-
options:
|
|
149
|
-
command: 'kk stage run publish-matrix-send "${vars.work_dir}" --window "${vars.window}"'
|
|
150
|
-
|
|
151
|
-
- id: send-retry
|
|
152
|
-
description: >-
|
|
153
|
-
The ONE bounded retry (0333): `--retry` resends only rows whose receipt is a live/draft failure
|
|
154
|
-
with `effect: none` — a succeeded row is skipped, a live row with an unknown effect is never
|
|
155
|
-
resent, and a dummy row never spawns a plugin. No unbounded back-edge: one retry node, then the
|
|
156
|
-
outcome assertion rules. A targeted operator rerun of this node is the recovery path for a
|
|
157
|
-
window that still ends non-full.
|
|
158
|
-
dependsOn: [send]
|
|
159
|
-
condition:
|
|
160
|
-
kind: shell
|
|
161
|
-
options:
|
|
162
|
-
command: 'test "${vars.window}" != "overseas-rss"'
|
|
163
|
-
action:
|
|
164
|
-
kind: shell
|
|
165
|
-
options:
|
|
166
|
-
command: 'kk stage run publish-matrix-send "${vars.work_dir}" --window "${vars.window}" --retry'
|
|
167
|
-
|
|
168
|
-
- id: classify
|
|
169
|
-
description: >-
|
|
170
|
-
Turn the window's receipts into `full|partial|none|dummy` (`4-publish/outcome.<window>.json`),
|
|
171
|
-
always exit 0 — routing is this graph's job, not the classifier's. The run date comes from the
|
|
172
|
-
plans/`run-date.txt` (0332 R1), so a late `run_date` guard is gone; a provided one must match
|
|
173
|
-
the bundle's own day and the stage refuses a mismatch.
|
|
174
|
-
dependsOn: [send-retry, send]
|
|
175
|
-
action:
|
|
176
|
-
kind: shell
|
|
177
|
-
options:
|
|
178
|
-
command: >-
|
|
179
|
-
kk stage run publish-matrix-classify "${vars.work_dir}" --window "${vars.window}" --run-date "${vars.run_date}"
|
|
180
|
-
|
|
181
|
-
# ── after-generate only: the voice2-era tail stages keep working on the bridged names ─────
|
|
182
|
-
- id: patch-surfdash
|
|
183
|
-
description: >-
|
|
184
|
-
after-generate only: cover and podcast cross-link patching plus the CMS re-sync, and only when
|
|
185
|
-
a real surfdash receipt exists. The payload is derived from that receipt's aggregate
|
|
186
|
-
`metadata.postPath` — never from legacy aggregate files or any site-root argument: the plugin
|
|
187
|
-
resolves its own checkout. A dummy or missing podcast episode yields
|
|
188
|
-
explicit empty links; there is nothing to patch without a real post. The stage is its own gate:
|
|
189
|
-
with no real tier-0 post evidence it records an explicit skip and exits 0 (the channel matrix
|
|
190
|
-
lives in the preset, so the graph cannot name channels here). `onError: continue`: the sends
|
|
191
|
-
already happened, so a patch failure (e.g. a dirty surfdash checkout, run 74007847) stays a
|
|
192
|
-
failed node in the trace instead of failing a delivered window; outcome-assert owns the exit.
|
|
193
|
-
dependsOn: [classify]
|
|
194
|
-
condition:
|
|
195
|
-
kind: shell
|
|
196
|
-
options:
|
|
197
|
-
command: 'test "${vars.window}" = "after-generate"'
|
|
198
|
-
|
|
199
|
-
action:
|
|
200
|
-
kind: shell
|
|
201
|
-
onError: continue
|
|
202
|
-
options:
|
|
203
|
-
command: 'kk stage run publish-matrix-patch-surfdash "${vars.work_dir}" --window "${vars.window}"'
|
|
204
|
-
|
|
205
|
-
- id: partial-marker
|
|
206
|
-
description: >-
|
|
207
|
-
Record the partial/none recovery marker when the classifier said so: names the exact failed
|
|
208
|
-
target ids from the receipt-derived outcome and points at the receipt-scoped rerun (`--retry`).
|
|
209
|
-
A full window deletes any stale marker, so the report never re-flags recovered targets.
|
|
210
|
-
dependsOn: [classify]
|
|
211
|
-
condition:
|
|
212
|
-
kind: shell
|
|
213
|
-
options:
|
|
214
|
-
# classify writes the bare status to publish-status.<window>.txt (the outcome JSON is
|
|
215
|
-
# pretty-printed, so the old whole-line grep there never fired). `full` is admitted so the
|
|
216
|
-
# stage can delete a stale marker after a recovered retry; `dummy` writes nothing.
|
|
217
|
-
command: >-
|
|
218
|
-
grep -qxE 'full|partial|none' "${vars.work_dir}/4-publish/publish-status.${vars.window}.txt" 2>/dev/null
|
|
219
|
-
|
|
220
|
-
action:
|
|
221
|
-
kind: shell
|
|
222
|
-
options:
|
|
223
|
-
command: 'kk stage run publish-matrix-partial "${vars.work_dir}" --window "${vars.window}"'
|
|
224
|
-
|
|
225
|
-
- id: settle
|
|
226
|
-
description: >-
|
|
227
|
-
Promote the store selection only on receipt-proven completion (0333): every required real row
|
|
228
|
-
must carry a CURRENT-bundle receipt that is succeeded/confirmed/live — draft preparation and
|
|
229
|
-
dummy rehearsals HOLD the selection (no store call), never claim a publication. Writes
|
|
230
|
-
`4-publish/settlement.<window>.json` naming each unresolved row. Keyed to the bundle's
|
|
231
|
-
parentRunId, never to this publish run. Exit 0 while holding: the outcome assertion owns the
|
|
232
|
-
run's exit code, so this evidence file always survives.
|
|
233
|
-
dependsOn: [classify]
|
|
234
|
-
condition:
|
|
235
|
-
kind: shell
|
|
236
|
-
options:
|
|
237
|
-
command: 'test "${vars.window}" != "overseas-rss"'
|
|
238
|
-
action:
|
|
239
|
-
kind: shell
|
|
240
|
-
options:
|
|
241
|
-
command: 'kk stage run publish-matrix-settle "${vars.work_dir}" --window "${vars.window}" --topic ai-news'
|
|
242
|
-
|
|
243
|
-
- id: outcome-assert
|
|
244
|
-
description: >-
|
|
245
|
-
The run's honest exit (0333): when an outcome exists, every required real row must be
|
|
246
|
-
succeeded — a partial window with failed required targets fails the run AFTER report and ledger
|
|
247
|
-
are written, with the outcome, receipts and incident evidence preserved. Gated-miss windows
|
|
248
|
-
(no outcome file) stay done: the diagnose/repair path already classified them.
|
|
249
|
-
dependsOn: [ledger]
|
|
250
|
-
condition:
|
|
251
|
-
kind: shell
|
|
252
|
-
options:
|
|
253
|
-
command: 'test -f "${vars.work_dir}/4-publish/outcome.${vars.window}.json"'
|
|
254
|
-
|
|
255
|
-
action:
|
|
256
|
-
kind: shell
|
|
257
|
-
options:
|
|
258
|
-
command: >-
|
|
259
|
-
jq -e 'all(.rows[]; .required != true or .dummy == true or .status == "succeeded")' "${vars.work_dir}/4-publish/outcome.${vars.window}.json" >/dev/null
|
|
260
|
-
|| { echo "publish3: required targets failed — see outcome.${vars.window}.json and 5-report" >&2; exit 1; }
|
|
261
|
-
|
|
262
|
-
# ── the incident path: a gated miss is diagnosed, never silently dropped ─────────────────
|
|
263
|
-
- id: diagnose
|
|
264
|
-
description: >-
|
|
265
|
-
overseas-rss only, on a gate miss: classify why the episode is not in the feed
|
|
266
|
-
(`no-run | generation-failed@<node> | no-content | t0-failed | rss-lag`) and write
|
|
267
|
-
`4-publish/incident.json` + `incident.md`. `onError: continue` — a diagnosis must never mask the
|
|
268
|
-
miss it is describing.
|
|
269
|
-
dependsOn: [rss-gate]
|
|
270
|
-
condition:
|
|
271
|
-
kind: shell
|
|
272
|
-
options:
|
|
273
|
-
command: >-
|
|
274
|
-
test "${vars.window}" = "overseas-rss"
|
|
275
|
-
&& jq -e '.hit == false' "${vars.work_dir}/4-publish/rss-gate.json" >/dev/null 2>&1
|
|
276
|
-
|
|
277
|
-
action:
|
|
278
|
-
kind: agent.run
|
|
279
|
-
onError: continue
|
|
280
|
-
options:
|
|
281
|
-
role: scribe
|
|
282
|
-
agent: ${vars.agent}
|
|
283
|
-
timeoutMs: 600000
|
|
284
|
-
input: |
|
|
285
|
-
Diagnose a missed overseas publish window. Read only these paths:
|
|
286
|
-
- ${vars.work_dir}/4-publish/rss-gate.json (the miss reason)
|
|
287
|
-
- ${vars.work_dir}/bundle.json (absent = no generation ran)
|
|
288
|
-
- ${vars.work_dir}/4-publish/outcome.after-generate.json and receipts/ (tier-0 evidence)
|
|
289
|
-
Run `spur workflow trace --json` for the voice3 run named in bundle.json if it exists.
|
|
290
|
-
Write ${vars.work_dir}/4-publish/incident.json with exactly
|
|
291
|
-
{"schemaVersion":1,"date":"<run_date>","class":"<one of no-run|generation-failed|<node>|no-content|t0-failed|rss-lag>","reason":"<one line>","evidence":["<paths>"]}
|
|
292
|
-
and ${vars.work_dir}/4-publish/incident.md with 3 sentences of operator prose: what is missing,
|
|
293
|
-
which class, and the one action that would fix it. Never regenerate content.
|
|
294
|
-
expectFile: ${vars.work_dir}/4-publish/incident.json
|
|
295
|
-
|
|
296
|
-
- id: repair
|
|
297
|
-
description: >-
|
|
298
|
-
overseas-rss only, on a gate miss: the ONE safe automatic repair — resend tier-0 targets whose
|
|
299
|
-
receipt is `effect: none`. It never regenerates content and never resends an uncertain live send
|
|
300
|
-
(the shared `--retry` rules), so a lost generation stays an operator decision.
|
|
301
|
-
dependsOn: [diagnose]
|
|
302
|
-
action:
|
|
303
|
-
kind: shell
|
|
304
|
-
options:
|
|
305
|
-
command: 'kk stage run publish-matrix-send "${vars.work_dir}" --window after-generate --retry --tier 0'
|
|
306
|
-
|
|
307
|
-
# ── traceability: one episode, several publish runs ───────────────────────────────────────
|
|
308
|
-
- id: bundle-runs
|
|
309
|
-
description: >-
|
|
310
|
-
Append this run id to `bundle.json` `runs[]`, idempotently, so one day's episode is traceable
|
|
311
|
-
across its generation run and its windows.
|
|
312
|
-
dependsOn: [classify]
|
|
313
|
-
action:
|
|
314
|
-
kind: shell
|
|
315
|
-
options:
|
|
316
|
-
command: >-
|
|
317
|
-
BUNDLE="${vars.work_dir}/bundle.json";
|
|
318
|
-
test -f "$BUNDLE" || exit 0;
|
|
319
|
-
jq --arg id "${vars.__runId}" 'if (.runs // []) | index($id) then . else .runs = ((.runs // []) + [$id]) end'
|
|
320
|
-
"$BUNDLE" > "$BUNDLE.tmp" && mv "$BUNDLE.tmp" "$BUNDLE"
|
|
321
|
-
|
|
322
|
-
- id: report
|
|
323
|
-
description: >-
|
|
324
|
-
The publish half's report: per-window status and every receipt, on one page. It also depends on
|
|
325
|
-
`diagnose`, so a gated-miss day (skipped `bundle-runs`, executed `diagnose`) still writes its
|
|
326
|
-
page — the same all-deps-skipped rule, read the other way.
|
|
327
|
-
dependsOn: [bundle-runs, diagnose]
|
|
328
|
-
action:
|
|
329
|
-
kind: shell
|
|
330
|
-
options:
|
|
331
|
-
# Straight statements, no `{ … }` group and no heredoc: the engine's shell wrapper treats a
|
|
332
|
-
# multi-line group as an interactive read and never returns.
|
|
333
|
-
command: >-
|
|
334
|
-
OUT="${vars.work_dir}/5-report/publish-${vars.window}.md";
|
|
335
|
-
mkdir -p "${vars.work_dir}/5-report";
|
|
336
|
-
STATUS="$(cat "${vars.work_dir}/4-publish/publish-status.${vars.window}.txt" 2>/dev/null || echo unknown)";
|
|
337
|
-
printf '# Publish report — %s — %s\n\n- status: %s\n\n| target | tier | status | effect | dummy |\n| --- | --- | --- | --- | --- |\n'
|
|
338
|
-
"${vars.window}" "${vars.run_date}" "$STATUS" > "$OUT";
|
|
339
|
-
jq -r '.rows[] | "| \(.id) | \(.tier) | \(.status) | \(.effect // "-") | \(.dummy) |"'
|
|
340
|
-
"${vars.work_dir}/4-publish/outcome.${vars.window}.json" >> "$OUT" 2>/dev/null || true;
|
|
341
|
-
jq -r '.excluded[]? | "- excluded: \(.id) (\(.plugin)) — \(.reason)"'
|
|
342
|
-
"${vars.work_dir}/4-publish/outcome.${vars.window}.json" >> "$OUT" 2>/dev/null || true
|
|
343
|
-
|
|
344
|
-
- id: ledger
|
|
345
|
-
description: >-
|
|
346
|
-
Backfill the workflow ledger with every finished publish3 run it does not record yet. An in-run
|
|
347
|
-
`kk ledger append` of this run always refuses (`kk.ledger.run.running`), so this run lands on the
|
|
348
|
-
next window's sync. `|| true` — bookkeeping never fails a publish.
|
|
349
|
-
dependsOn: [report]
|
|
350
|
-
action:
|
|
351
|
-
kind: shell
|
|
352
|
-
options:
|
|
353
|
-
command: 'kk ledger sync --workflow kk-daily-publish3 || true'
|