@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.
Files changed (95) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/daily-voice/index.js +40 -7
  3. package/dist/index.js +8428 -4448
  4. package/package.json +1 -1
  5. package/plugins/generations/image-gen/README.md +31 -31
  6. package/plugins/generations/image-gen/assets/sample/provenance.json +314 -0
  7. package/plugins/generations/image-gen/config.example.yaml +3 -0
  8. package/plugins/generations/image-gen/dist/index.js +154 -14
  9. package/plugins/generations/image-gen/presets/SOURCE.md +65 -0
  10. package/plugins/generations/image-gen/scripts/eval-style-presets.ts +513 -0
  11. package/plugins/generations/image-gen/scripts/gen-samples.ts +57 -7
  12. package/plugins/generations/image-gen/src/presets.ts +6 -5
  13. package/plugins/generations/image-gen/src/providers/h3-local.ts +196 -0
  14. package/plugins/generations/image-gen/src/providers/types.ts +11 -1
  15. package/plugins/kk/config.example.yaml +7 -2
  16. package/plugins/kk/decisions/extract/ai-news.yaml +5 -2
  17. package/plugins/kk/plugin.json +1 -1
  18. package/plugins/kk/publish-presets/chinese-article.json +8 -2
  19. package/plugins/kk/publish-presets/daily-ai-voice-migration.json +1 -1
  20. package/plugins/kk/publish-presets/daily-ai-voice.json +57 -16
  21. package/plugins/kk/publish-presets/itc-main.json +36 -9
  22. package/plugins/kk/publish-presets/technical-article.json +8 -2
  23. package/plugins/kk/schedules/kk-daily-ai-voice3.cron.tmpl +8 -9
  24. package/plugins/kk/schedules/kk-daily-publish3-cn-peak.cron.tmpl +13 -19
  25. package/plugins/kk/schedules/kk-daily-publish3-overseas.cron.tmpl +11 -9
  26. package/plugins/kk/scripts/daily-stages.ts +238 -14
  27. package/plugins/kk/scripts/daily-triage-core.ts +43 -25
  28. package/plugins/kk/scripts/daily-triage.ts +1 -1
  29. package/plugins/kk/skills/image-authoring/SKILL.md +7 -3
  30. package/plugins/kk/skills/image-authoring/references/providers.md +27 -0
  31. package/plugins/kk/skills/image-authoring/references/style-extraction.md +1 -1
  32. package/plugins/kk/skills/publish/SKILL.md +15 -2
  33. package/plugins/kk/skills/web-automation/SKILL.md +31 -1
  34. package/plugins/kk/workflows/kk-article-generate.yaml +485 -0
  35. package/plugins/kk/workflows/kk-collect.yaml +8 -4
  36. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +2 -1
  37. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +4 -2
  38. package/plugins/kk/workflows/kk-daily-safety.yaml +5 -7
  39. package/plugins/kk/workflows/kk-news-generate.yaml +410 -0
  40. package/plugins/kk/workflows/kk-publish.yaml +236 -0
  41. package/plugins/publishings/bilibili-pub/dist/profile-check.js +49 -10
  42. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +60 -10
  43. package/plugins/publishings/csdn-pub/dist/profile-check.js +60 -10
  44. package/plugins/publishings/infoq-pub/dist/profile-check.js +60 -10
  45. package/plugins/publishings/jike-pub/dist/profile-check.js +60 -10
  46. package/plugins/publishings/juejin-pub/dist/profile-check.js +60 -10
  47. package/plugins/publishings/linkedin-pub/dist/index.js +43 -6
  48. package/plugins/publishings/linkedin-pub/dist/profile-check.js +92 -15
  49. package/plugins/publishings/linkedin-pub/src/index.ts +52 -6
  50. package/plugins/publishings/shipinhao-pub/dist/index.js +391 -32
  51. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +52 -11
  52. package/plugins/publishings/shipinhao-pub/plugin.json +1 -1
  53. package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +393 -0
  54. package/plugins/publishings/shipinhao-pub/src/flow.ts +243 -14
  55. package/plugins/publishings/shipinhao-pub/src/selectors.ts +13 -0
  56. package/plugins/publishings/sspai-pub/dist/profile-check.js +60 -10
  57. package/plugins/publishings/substack-pub/dist/profile-check.js +60 -10
  58. package/plugins/publishings/surfdash-pub/dist/index.js +50 -8
  59. package/plugins/publishings/surfdash-pub/src/index.ts +59 -8
  60. package/plugins/publishings/surfdash-pub/src/topic-claims.ts +34 -3
  61. package/plugins/publishings/threads-pub/dist/index.js +9196 -296
  62. package/plugins/publishings/threads-pub/dist/profile-check.js +21139 -0
  63. package/plugins/publishings/threads-pub/package.json +3 -1
  64. package/plugins/publishings/threads-pub/plugin.json +6 -1
  65. package/plugins/publishings/threads-pub/src/index.ts +8 -1
  66. package/plugins/publishings/threads-pub/src/post-rail.ts +357 -0
  67. package/plugins/publishings/threads-pub/src/profile-check.ts +17 -0
  68. package/plugins/publishings/wechatmp-pub/dist/index.js +454 -81
  69. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +401 -102
  70. package/plugins/publishings/wechatmp-pub/src/flow.ts +42 -4
  71. package/plugins/publishings/wechatmp-pub/src/index.ts +142 -102
  72. package/plugins/publishings/wechatmp-pub/src/profile-check.ts +36 -58
  73. package/plugins/publishings/weibo-pub/dist/index.js +136 -22
  74. package/plugins/publishings/weibo-pub/dist/profile-check.js +61 -11
  75. package/plugins/publishings/weibo-pub/src/index.ts +208 -22
  76. package/plugins/publishings/x-pub/dist/index.js +263 -43
  77. package/plugins/publishings/x-pub/dist/profile-check.js +63 -11
  78. package/plugins/publishings/x-pub/src/index.ts +15 -1
  79. package/plugins/publishings/x-pub/src/post-rail.ts +334 -0
  80. package/plugins/publishings/xhs-pub/dist/index.js +193 -201
  81. package/plugins/publishings/xhs-pub/dist/profile-check.js +380 -85
  82. package/plugins/publishings/xhs-pub/src/automation-guard.ts +2 -3
  83. package/plugins/publishings/xhs-pub/src/flow.ts +177 -205
  84. package/plugins/publishings/xhs-pub/src/index.ts +65 -59
  85. package/plugins/publishings/xhs-pub/src/modes.ts +1 -1
  86. package/plugins/publishings/xhs-pub/src/page.ts +2 -2
  87. package/plugins/publishings/xhs-pub/src/profile-check.ts +86 -150
  88. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +60 -10
  89. package/plugins/kk/scripts/daily-scheduled-run.ts +0 -581
  90. package/plugins/kk/scripts/voice3-publish-window.ts +0 -206
  91. package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +0 -903
  92. package/plugins/kk/workflows/kk-daily-publish3.yaml +0 -353
  93. package/plugins/kk/workflows/kk-itc-author.yaml +0 -484
  94. package/plugins/kk/workflows/kk-itc-publish-tail.yaml +0 -112
  95. package/plugins/kk/workflows/kk-itc.yaml +0 -291
@@ -0,0 +1,196 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { randomBytes } from 'node:crypto';
3
+ import { mkdir, rm } from 'node:fs/promises';
4
+ import { tmpdir } from 'node:os';
5
+ import { resolve } from 'node:path';
6
+ import { readBytes } from '../bytes';
7
+ import type { ImageProvider, ImageRequest, ImageResult, ProviderFactory, ProviderOptions } from './types';
8
+
9
+ /**
10
+ * no-direct-fs-io / no-direct-process-spawn exemption is recorded as per-file
11
+ * exclusions in .spur/rules/strict/runtime-boundaries.yaml: this provider's transport
12
+ * IS spawning the local `h3gen.sh` wrapper and staging one temp output file for it
13
+ * (same vendor-CLI-boundary class as codex-cli).
14
+ */
15
+
16
+ /**
17
+ * h3-local adapter (task 0379, feature K2) — Robin's local Apple Silicon MLX image runtime,
18
+ * reached through its `h3gen.sh` wrapper. Never auto-selected: a 6-minute-per-image local
19
+ * render must be an explicit operator choice, and the wrapper's readiness (venv, 49 GB of
20
+ * weights, a mounted external volume) cannot be expressed as env presence.
21
+ *
22
+ * Why a subprocess and not an import: the runtime is a Python venv (`../gitops/apps/h3-image-mlx`),
23
+ * so shelling out to its documented wrapper is the whole integration. `h3gen.sh` forwards every
24
+ * unknown flag to `h3-image-mlx generate`, resolves a relative `--output` against the caller's
25
+ * cwd, and echoes the written path.
26
+ */
27
+
28
+ const DEFAULT_MODEL = 'h3';
29
+
30
+ /** H3 accepts multiples of 32 within 256–4096 (h3-image-mlx README). */
31
+ const H3_DIM_MIN = 256;
32
+ const H3_DIM_MAX = 4096;
33
+ const H3_DIM_STEP = 32;
34
+
35
+ /**
36
+ * Default timeout is the measured worst case, not a guess: a cold 1024² text-to-image render is
37
+ * ~6–7 min and a two-reference edit measured 27 min 46 s (h3gen.sh README table). Anything
38
+ * tighter would kill paid-for work; `H3_LOCAL_TIMEOUT_MS` overrides per machine.
39
+ */
40
+ const DEFAULT_TIMEOUT_MS = 30 * 60 * 1000;
41
+
42
+ /** The canvas an aspect-only request lands on: 1024 on the short side, snapped and clamped. */
43
+ function snapDim(value: number): number {
44
+ const snapped = Math.round(value / H3_DIM_STEP) * H3_DIM_STEP;
45
+ return Math.min(H3_DIM_MAX, Math.max(H3_DIM_MIN, snapped));
46
+ }
47
+
48
+ /** True when both dimensions are canvases H3 can actually render. */
49
+ export function h3ExactSize(width: number, height: number): boolean {
50
+ if (!Number.isFinite(width) || !Number.isFinite(height)) return false;
51
+ const legal = (value: number): boolean =>
52
+ Number.isInteger(value) && value % H3_DIM_STEP === 0 && value >= H3_DIM_MIN && value <= H3_DIM_MAX;
53
+ return legal(width) && legal(height);
54
+ }
55
+
56
+ /**
57
+ * Translate an aspect-only request ("3:4", "21:9") into a legal H3 canvas. Returns null when the
58
+ * ratio is missing or unparseable, so the caller can fall back to a square instead of guessing.
59
+ */
60
+ export function h3Canvas(aspectRatio: string | undefined): { width: number; height: number } | null {
61
+ const match = /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/.exec(aspectRatio?.trim() ?? '');
62
+ if (match === null) return null;
63
+ const ratioWidth = Number(match[1]);
64
+ const ratioHeight = Number(match[2]);
65
+ if (!(ratioWidth > 0) || !(ratioHeight > 0)) return null;
66
+ const height = snapDim(1024);
67
+ return { width: snapDim((1024 * ratioWidth) / ratioHeight), height };
68
+ }
69
+
70
+ interface SpawnResult {
71
+ stdout: string;
72
+ stderr: string;
73
+ code: number;
74
+ timedOut: boolean;
75
+ }
76
+
77
+ function spawnWrapper(command: string, args: string[], timeoutMs: number): Promise<SpawnResult> {
78
+ return new Promise((resolveSpawn, rejectSpawn) => {
79
+ // Detached: a timeout must kill the wrapper AND the python runtime it spawned, or a
80
+ // timed-out render keeps burning the GPU after the caller has moved on.
81
+ const child = spawn(command, args, { stdio: ['ignore', 'pipe', 'pipe'], detached: true });
82
+ let stdout = '';
83
+ let stderr = '';
84
+ let timedOut = false;
85
+ const timer = setTimeout(() => {
86
+ timedOut = true;
87
+ try {
88
+ if (child.pid !== undefined) process.kill(-child.pid, 'SIGKILL');
89
+ } catch {
90
+ // The group is already gone (ESRCH) — nothing left to kill.
91
+ }
92
+ }, timeoutMs);
93
+ child.stdout.on('data', (chunk: Buffer) => {
94
+ stdout += chunk.toString('utf8');
95
+ });
96
+ child.stderr.on('data', (chunk: Buffer) => {
97
+ stderr += chunk.toString('utf8');
98
+ });
99
+ child.on('error', (err) => {
100
+ clearTimeout(timer);
101
+ rejectSpawn(err);
102
+ });
103
+ child.on('close', (code) => {
104
+ clearTimeout(timer);
105
+ resolveSpawn({ stdout, stderr, code: code ?? 1, timedOut });
106
+ });
107
+ });
108
+ }
109
+
110
+ /** Keep thrown messages short but diagnostic: the tail is what a fallback reader needs. */
111
+ function stderrTail(text: string): string {
112
+ const trimmed = text.trim();
113
+ if (trimmed === '') return '';
114
+ return `; ${trimmed.slice(-800)}`;
115
+ }
116
+
117
+ function positiveInt(value: string): number | null {
118
+ if (value === '') return null;
119
+ const parsed = Number.parseInt(value, 10);
120
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
121
+ }
122
+
123
+ export const createH3Local: ProviderFactory = (options?: ProviderOptions): ImageProvider => {
124
+ const env = options?.env ?? process.env;
125
+ const readEnv = (key: string): string => env[key] ?? '';
126
+ const timeoutMs = options?.timeoutMs ?? positiveInt(readEnv('H3_LOCAL_TIMEOUT_MS')) ?? DEFAULT_TIMEOUT_MS;
127
+
128
+ return {
129
+ name: 'h3-local',
130
+ defaultModel: () => DEFAULT_MODEL,
131
+ // Env presence only: probing the venv, the weights or the external volume here would turn
132
+ // a synchronous selection into a multi-second filesystem stall on every run.
133
+ isAvailable: () => readEnv('H3_IMAGE_MLX_BIN') !== '',
134
+ supportsReferenceImages: () => true,
135
+ exactSize: (_model: string, width: number, height: number): boolean => h3ExactSize(width, height),
136
+ validate(req: ImageRequest): void {
137
+ if ((req.n ?? 1) > 1) {
138
+ throw new Error('h3-local provider supports only n=1 (the wrapper renders one image per call).');
139
+ }
140
+ },
141
+ async generate(req: ImageRequest): Promise<ImageResult> {
142
+ const wrapper = readEnv('H3_IMAGE_MLX_BIN');
143
+ if (wrapper === '') {
144
+ throw new Error(
145
+ 'h3-local provider requires H3_IMAGE_MLX_BIN pointing at an executable h3gen.sh (or set the provider explicitly with IMAGE_GEN_PROVIDER).',
146
+ );
147
+ }
148
+
149
+ const canvas =
150
+ req.width !== undefined && req.height !== undefined && h3ExactSize(req.width, req.height)
151
+ ? { width: req.width, height: req.height }
152
+ : (h3Canvas(req.aspectRatio) ?? { width: 1024, height: 1024 });
153
+
154
+ const sessionDir = resolve(tmpdir(), 'kk-image-gen-h3-local');
155
+ await mkdir(sessionDir, { recursive: true });
156
+ const tmpOutput = resolve(sessionDir, `out-${randomBytes(8).toString('hex')}.png`);
157
+
158
+ const args: string[] = [
159
+ '--prompt',
160
+ req.prompt,
161
+ '--output',
162
+ tmpOutput,
163
+ '--width',
164
+ String(canvas.width),
165
+ '--height',
166
+ String(canvas.height),
167
+ ];
168
+ for (const ref of req.referenceImages ?? []) {
169
+ args.push('--reference', resolve(ref));
170
+ }
171
+
172
+ try {
173
+ const spawnResult = await spawnWrapper(wrapper, args, timeoutMs);
174
+ if (spawnResult.timedOut) {
175
+ throw new Error(
176
+ `h3-local wrapper timed out after ${timeoutMs}ms (${canvas.width}x${canvas.height})${stderrTail(spawnResult.stderr)}`,
177
+ );
178
+ }
179
+ if (spawnResult.code !== 0) {
180
+ throw new Error(
181
+ `h3-local wrapper exited with code ${spawnResult.code}${stderrTail(spawnResult.stderr)}`,
182
+ );
183
+ }
184
+ const bytes = await readBytes(tmpOutput).catch(() => null);
185
+ if (bytes === null) {
186
+ throw new Error(
187
+ `h3-local wrapper wrote no output at ${tmpOutput}${stderrTail(spawnResult.stderr)}`,
188
+ );
189
+ }
190
+ return { bytes, extension: 'png', provider: 'h3-local', model: req.model };
191
+ } finally {
192
+ await rm(tmpOutput, { force: true }).catch(() => undefined);
193
+ }
194
+ },
195
+ };
196
+ };
@@ -14,6 +14,7 @@ import { createAzure } from './azure';
14
14
  import { createCodexCli } from './codex-cli';
15
15
  import { createDashscope } from './dashscope';
16
16
  import { createGoogle } from './google';
17
+ import { createH3Local } from './h3-local';
17
18
  import { createHuggingface } from './huggingface';
18
19
  import { createJimeng } from './jimeng';
19
20
  import { createMinimax } from './minimax';
@@ -111,7 +112,7 @@ export type ProviderFactory = (options?: ProviderOptions) => ImageProvider;
111
112
  const IMAGE_GEN_PROVIDER_ENV = 'IMAGE_GEN_PROVIDER';
112
113
 
113
114
  /** Providers that may never be auto-selected, even if listed in AUTO_ORDER later (task 0103 R3). */
114
- const NEVER_AUTO: ReadonlySet<string> = new Set(['codex-cli']);
115
+ const NEVER_AUTO: ReadonlySet<string> = new Set(['codex-cli', 'h3-local']);
115
116
 
116
117
  /** Registry row: the availability facts an adapter must honour, verbatim from its baoyu source. */
117
118
  interface ProviderSpec {
@@ -170,6 +171,15 @@ export const PROVIDERS: Readonly<Record<string, ProviderRegistration>> = {
170
171
  ],
171
172
  create: createGoogle,
172
173
  },
174
+ 'h3-local': {
175
+ name: 'h3-local',
176
+ env: ['H3_IMAGE_MLX_BIN'],
177
+ defaultModel: 'h3',
178
+ // Local MLX runtime: readiness is the env var, but a render costs minutes of wall time,
179
+ // so it stays opt-in (never auto-selected) unless the operator pins it (0379, feature K2).
180
+ note: 'requires H3_IMAGE_MLX_BIN pointing at the local h3gen.sh wrapper (never auto-selected)',
181
+ create: createH3Local,
182
+ },
173
183
  huggingface: {
174
184
  name: 'huggingface',
175
185
  env: ['HUGGINGFACE_API_TOKEN'],
@@ -11,8 +11,10 @@ defaults:
11
11
 
12
12
  # Per-workflow settings. `publish_preset` names the publish preset that owns the daily channel
13
13
  # matrix (files live in `plugins/kk/publish-presets/`, overridable per project under
14
- # `.kk/publish-presets/`). The preset decides WHICH channels publish; `live` is never in a preset
15
- # file — it is a launch var (`live_channels`) or an installed schedule entry (ADR-022).
14
+ # `.kk/publish-presets/`). The preset decides WHICH channels publish, and since the ADR-022
15
+ # amendment of 2026-11-12 a preset target may carry `mode: live` — the operator's consent lives in
16
+ # the preset they own, so a shipped preset can publish for real. `--live-channels` still promotes a
17
+ # single row for an ad-hoc window, and `live_confirm` keeps the send-confirm pause available.
16
18
  workflows:
17
19
  kk-daily-ai-voice3:
18
20
  publish_preset: "daily-ai-voice"
@@ -99,6 +101,9 @@ plugins:
99
101
  BAOYU_CODEX_IMAGEGEN_BIN: "" # optional — wrapper entrypoint override
100
102
  BAOYU_CODEX_IMAGEGEN_TIMEOUT_MS: "" # optional — per-call timeout (ms)
101
103
  BAOYU_CODEX_IMAGEGEN_RETRIES: "" # optional — retry count
104
+ # -- h3-local (local Apple Silicon MLX runtime; NEVER auto-selected — pin explicitly) --
105
+ H3_IMAGE_MLX_BIN: "" # absolute path to ../gitops/apps/h3-image-mlx/h3gen.sh — its presence IS readiness (0379)
106
+ H3_LOCAL_TIMEOUT_MS: "" # optional — per-render bound in ms; default 1800000 (30 min: a 2-reference edit measured 27m46s)
102
107
  # -- 0104 R6 runtime seams (behavior, not credentials; placeholder values only) --
103
108
  KK_IMAGE_MAX_IMAGES: "" # optional — per-run budget cap; default 4 (OPEN for the operator to set)
104
109
  KK_IMAGE_DRY_RUN: "" # optional — "1" composes every prompt, selects the provider, spends nothing
@@ -8,8 +8,11 @@
8
8
  #
9
9
  # Keys are decision ids from the sibling catalog (plugins/kk/decisions/kk-items.yaml);
10
10
  # an unknown key or decision id fails loud with `kk.store.profile.invalid`.
11
- # `limit` is omitted: the compiler's episode-cap default (20) applies unless
12
- # `kk store extract --limit` overrides it.
11
+ # `limit` 32 (2026-11-15, task 0377): the omitted default of 20 capped a week-wide pool at 20
12
+ # items, which after QC admitted ~11.4k chars = 10.3 min against the 15 min floor, so a thin week
13
+ # could never clear it however far the ladder widened. 32 items keeps the estimate inside the
14
+ # 15-25 min window (measured: 45,163 raw chars -> ~16.4 min) instead of refusing the day.
15
+ limit: 40
13
16
  topic: ai-news
14
17
  where:
15
18
  # 2026-10-21: the allowlist is the whole AI taxonomy, in lockstep with the workflow's
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "kk",
3
- "version": "0.1.17",
3
+ "version": "0.1.20",
4
4
  "description": "knowledge-kit Claude Code plugin: skills, commands, subagents, hooks, and rules"
5
5
  }
@@ -4,11 +4,17 @@
4
4
  "targets": [
5
5
  {
6
6
  "plugin": "juejin-pub",
7
- "profile": "article"
7
+ "profile": "article",
8
+ "variant": "article",
9
+ "tier": 0,
10
+ "required": true
8
11
  },
9
12
  {
10
13
  "plugin": "infoq-pub",
11
- "profile": "article"
14
+ "profile": "article",
15
+ "variant": "article",
16
+ "tier": 0,
17
+ "required": true
12
18
  }
13
19
  ]
14
20
  }
@@ -67,7 +67,7 @@
67
67
  "operation": "上传图文",
68
68
  "variant": "cards",
69
69
  "tier": 3,
70
- "window": "after-generate",
70
+ "window": "cn-peak",
71
71
  "mode": "off"
72
72
  },
73
73
  {
@@ -26,7 +26,7 @@
26
26
  "variant": "episode",
27
27
  "tier": 1,
28
28
  "window": "after-generate",
29
- "mode": "live"
29
+ "mode": "off"
30
30
  },
31
31
  {
32
32
  "plugin": "xhs-pub",
@@ -34,7 +34,7 @@
34
34
  "variant": "episode",
35
35
  "tier": 1,
36
36
  "window": "after-generate",
37
- "mode": "live"
37
+ "mode": "off"
38
38
  },
39
39
  {
40
40
  "plugin": "shipinhao-pub",
@@ -42,7 +42,10 @@
42
42
  "variant": "episode",
43
43
  "tier": 1,
44
44
  "window": "after-generate",
45
- "mode": "live"
45
+ "mode": "live",
46
+ "options": {
47
+ "collection": "每日AI乱炖"
48
+ }
46
49
  },
47
50
  {
48
51
  "plugin": "wechatmp-pub",
@@ -50,7 +53,7 @@
50
53
  "variant": "article",
51
54
  "tier": 2,
52
55
  "window": "after-generate",
53
- "mode": "live",
56
+ "mode": "draft",
54
57
  "options": {
55
58
  "collection": "每日AI资讯"
56
59
  }
@@ -63,14 +66,6 @@
63
66
  "window": "after-generate",
64
67
  "mode": "off"
65
68
  },
66
- {
67
- "plugin": "xhs-pub",
68
- "operation": "上传图文",
69
- "variant": "cards",
70
- "tier": 3,
71
- "window": "after-generate",
72
- "mode": "live"
73
- },
74
69
  {
75
70
  "plugin": "weibo-pub",
76
71
  "operation": "article",
@@ -79,6 +74,14 @@
79
74
  "window": "cn-peak",
80
75
  "mode": "live"
81
76
  },
77
+ {
78
+ "plugin": "xhs-pub",
79
+ "operation": "上传图文",
80
+ "variant": "cards",
81
+ "tier": 3,
82
+ "window": "cn-peak",
83
+ "mode": "off"
84
+ },
82
85
  {
83
86
  "plugin": "x-pub",
84
87
  "operation": "article",
@@ -93,7 +96,7 @@
93
96
  "variant": "social:x",
94
97
  "tier": 3,
95
98
  "window": "overseas-rss",
96
- "mode": "dummy"
99
+ "mode": "live"
97
100
  },
98
101
  {
99
102
  "plugin": "weibo-pub",
@@ -101,7 +104,7 @@
101
104
  "variant": "social:weibo",
102
105
  "tier": 3,
103
106
  "window": "overseas-rss",
104
- "mode": "dummy"
107
+ "mode": "live"
105
108
  },
106
109
  {
107
110
  "plugin": "threads-pub",
@@ -109,7 +112,7 @@
109
112
  "variant": "social:threads",
110
113
  "tier": 3,
111
114
  "window": "overseas-rss",
112
- "mode": "dummy"
115
+ "mode": "live"
113
116
  },
114
117
  {
115
118
  "plugin": "linkedin-pub",
@@ -117,7 +120,7 @@
117
120
  "variant": "social:linkedin",
118
121
  "tier": 3,
119
122
  "window": "overseas-rss",
120
- "mode": "dummy"
123
+ "mode": "live"
121
124
  },
122
125
  {
123
126
  "plugin": "shipinhao-pub",
@@ -134,6 +137,44 @@
134
137
  "tier": 3,
135
138
  "window": "overseas-rss",
136
139
  "mode": "off"
140
+ },
141
+ {
142
+ "plugin": "jike-pub",
143
+ "operation": "post",
144
+ "variant": "social:jike",
145
+ "tier": 3,
146
+ "window": "overseas-rss",
147
+ "mode": "live"
148
+ }
149
+ ],
150
+ "overrides": [
151
+ {
152
+ "plugin": "x-pub",
153
+ "operation": "post",
154
+ "mode": "live",
155
+ "reason": "operator instruction 2026-11-15: publish to all available platforms for the dogfood run; no draftable rail exists, so this is a recorded exception to ADR-022",
156
+ "until": "2026-11-16 dogfood run"
157
+ },
158
+ {
159
+ "plugin": "weibo-pub",
160
+ "operation": "post",
161
+ "mode": "live",
162
+ "reason": "operator instruction 2026-11-15: publish to all available platforms for the dogfood run; no draftable rail exists, so this is a recorded exception to ADR-022",
163
+ "until": "2026-11-16 dogfood run"
164
+ },
165
+ {
166
+ "plugin": "threads-pub",
167
+ "operation": "post",
168
+ "mode": "live",
169
+ "reason": "operator instruction 2026-11-15: publish to all available platforms for the dogfood run; no draftable rail exists, so this is a recorded exception to ADR-022",
170
+ "until": "2026-11-16 dogfood run"
171
+ },
172
+ {
173
+ "plugin": "linkedin-pub",
174
+ "operation": "post",
175
+ "mode": "live",
176
+ "reason": "operator instruction 2026-11-15: publish to all available platforms for the dogfood run; no draftable rail exists, so this is a recorded exception to ADR-022",
177
+ "until": "2026-11-16 dogfood run"
137
178
  }
138
179
  ]
139
180
  }
@@ -4,39 +4,66 @@
4
4
  "targets": [
5
5
  {
6
6
  "plugin": "surfdash-pub",
7
- "profile": "article"
7
+ "profile": "article",
8
+ "variant": "article",
9
+ "tier": 0,
10
+ "required": true
8
11
  },
9
12
  {
10
13
  "plugin": "infoq-pub",
11
- "profile": "article"
14
+ "profile": "article",
15
+ "variant": "article",
16
+ "tier": 0,
17
+ "required": true
12
18
  },
13
19
  {
14
20
  "plugin": "juejin-pub",
15
- "profile": "article"
21
+ "profile": "article",
22
+ "variant": "article",
23
+ "tier": 0,
24
+ "required": true
16
25
  },
17
26
  {
18
27
  "plugin": "wechatmp-pub",
19
- "profile": "article"
28
+ "profile": "article",
29
+ "variant": "article",
30
+ "tier": 0,
31
+ "required": true
20
32
  },
21
33
  {
22
34
  "plugin": "x-pub",
23
- "profile": "article-zh"
35
+ "profile": "article-zh",
36
+ "variant": "zh-article",
37
+ "tier": 0,
38
+ "required": true
24
39
  },
25
40
  {
26
41
  "plugin": "zenn-pub",
27
- "profile": "article"
42
+ "profile": "article",
43
+ "variant": "article",
44
+ "tier": 0,
45
+ "required": true
28
46
  },
29
47
  {
30
48
  "plugin": "qiita-pub",
31
- "profile": "article"
49
+ "profile": "article",
50
+ "variant": "article",
51
+ "tier": 0,
52
+ "required": true
32
53
  },
33
54
  {
34
55
  "plugin": "medium-pub",
35
- "profile": "article"
56
+ "profile": "article",
57
+ "variant": "article",
58
+ "tier": 0,
59
+ "required": true
36
60
  },
37
61
  {
38
62
  "plugin": "substack-pub",
39
- "profile": "article"
63
+ "profile": "article",
64
+ "variant": "article",
65
+ "tier": 0,
66
+ "required": true
40
67
  }
41
68
  ]
42
69
  }
@@ -4,11 +4,17 @@
4
4
  "targets": [
5
5
  {
6
6
  "plugin": "zenn-pub",
7
- "profile": "article"
7
+ "profile": "article",
8
+ "variant": "article",
9
+ "tier": 0,
10
+ "required": true
8
11
  },
9
12
  {
10
13
  "plugin": "qiita-pub",
11
- "profile": "article"
14
+ "profile": "article",
15
+ "variant": "article",
16
+ "tier": 0,
17
+ "required": true
12
18
  }
13
19
  ]
14
20
  }
@@ -1,13 +1,12 @@
1
- # kk-daily-ai-voice3 — shadow generation run (task 0334 R1/R6).
1
+ # kk-daily-ai-voice3 — the 04:30 daily generation job (task 0334 R1/R6; kk news verbs since 0369).
2
2
  #
3
- # 04:30 America/Los_Angeles, the same cadence as the voice2 daily run it shadows. The entry is
4
- # defined in the zone the machine already runs in, so it needs no DST adjustment.
3
+ # 04:30 America/Los_Angeles, the same cadence the voice2 daily run kept. The entry is defined in
4
+ # the zone the machine already runs in, so it needs no DST adjustment.
5
5
  #
6
- # Shadow posture is baked into the launch: `auto_publish` stays false, so this entry only
7
- # prepares, researches and generates — it publishes NOTHING on its own. The nested publish3
8
- # window runs only when an operator launch flips `publish_window` away from `after-generate`
9
- # (rehearsal flags in docs/design/kk-daily-ai-voice3.md). The workspace namespace stays
10
- # kk-daily-ai-voice2 (voice3 prepares under it) until the operator's cutover changes it.
6
+ # `kk news generate --publish` is the whole job: prepare, curate, script, render, safety, voice,
7
+ # cards, variants, the variants-scope safety review and the freeze, then the generation receipt.
8
+ # After successful generation, `--publish` launches the after-generate publish window.
9
+ # The run directory is <works>/kk-news-generate/<run>; the log below is the tick's own stdout.
11
10
  #
12
11
  # Rendered by `kk schedule render kk-daily-ai-voice3 --platform cron --repo <checkout>`;
13
12
  # kk never edits the operator's crontab. MERGE, never replace:
@@ -15,4 +14,4 @@
15
14
  # crontab -l > /tmp/kk-voice3.cron 2>/dev/null || :
16
15
  # kk schedule render kk-daily-ai-voice3 --platform cron --repo "$PWD" >> /tmp/kk-voice3.cron
17
16
  # crontab /tmp/kk-voice3.cron
18
- 30 4 * * * cd {{repo}} && mkdir -p .works/kk-daily-ai-voice3 && PATH="{{home}}/.bun/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" TZ=America/Los_Angeles spur workflow run plugins/kk/workflows/kk-daily-ai-voice3.yaml --vars '{"auto_publish":"false"}' >> {{repo}}/.works/kk-daily-ai-voice3/generation.log 2>&1
17
+ 30 4 * * * cd {{repo}} && mkdir -p .works/kk-news-generate && PATH="{{home}}/.bun/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" TZ=America/Los_Angeles kk news generate --publish >> {{repo}}/.works/kk-news-generate/generation.log 2>&1
@@ -1,22 +1,19 @@
1
- # kk-daily-publish3-cn-peak — domestic live window (tasks 0323 R5, 0334 R1-R3).
1
+ # kk-daily-publish3-cn-peak — domestic live window (tasks 0323 R5, 0334 R1-R3; kk news verbs
2
+ # since 0369).
2
3
  #
3
4
  # Fires at 17:00 local because the audience window is 09:00 Asia/Shanghai and launchd/cron
4
- # intervals follow the MACHINE's zone; the first node (`publish-matrix-wait-until 09:00
5
- # Asia/Shanghai`) sleeps the remainder, which is 1 h from 17:00 PDT and 0 h after the DST flip —
6
- # so the entry never needs editing twice a year.
5
+ # intervals follow the MACHINE's zone; the window's own wait node sleeps the remainder, which is
6
+ # 1 h from 17:00 PDT and 0 h after the DST flip — so the entry never needs editing twice a year.
7
7
  #
8
- # `live_channels` is baked in: this installed line IS the operator's ADR-022 consent for a live
9
- # send. Nothing in the workflow or the preset can produce `live` on its own. The window is
10
- # consent-scoped to tokens with a cn-peak row (weibo-pub). Every live launch
11
- # stops at the `send-confirm` gate and waits for the operator's manual resume; the entry never
12
- # delivers unattended.
8
+ # Which rows go live is the preset's decision, not this line's (ADR-022 amendment): the shipped
9
+ # `daily-ai-voice` preset owns the live/draft matrix for `cn-peak`, so the entry carries no
10
+ # `--live-channels`. A live row pauses only with `--live-confirm`; `--unattended` keeps the
11
+ # window honest about a gated miss (diagnose, tier-0 repair) instead of silently dropping it.
13
12
  #
14
- # The launch goes through plugins/kk/scripts/voice3-publish-window.ts (task 0334): a crontab
15
- # command ends at the first UNESCAPED percent sign, so inline `date +%F` shell silently truncates
16
- # the entry — the launcher owns the LA date math, resolves the GENERATION bundle from the
17
- # effective works root (never the publish3 output directory), refuses a missing/mismatched
18
- # bundle, validates the token list against the preset's cn-peak rows, and only then execs spur.
19
- # The rehearsal pins the shipped default preset; change it at cutover.
13
+ # `kk news publish` owns the LA date math. A crontab command ends at the first UNESCAPED percent
14
+ # sign, so an inline `date +%F` would silently truncate the entry; the verb computes dates in
15
+ # process. `run_date` is "today" in America/Los_Angeles, which is the day directory the 04:30
16
+ # generation wrote.
20
17
  #
21
18
  # Rendered by `kk schedule render kk-daily-publish3-cn-peak --platform cron --repo <checkout>`;
22
19
  # kk never edits the operator's crontab. MERGE, never replace:
@@ -24,7 +21,4 @@
24
21
  # crontab -l > /tmp/kk-cn-peak.cron 2>/dev/null || :
25
22
  # kk schedule render kk-daily-publish3-cn-peak --platform cron --repo "$PWD" >> /tmp/kk-cn-peak.cron
26
23
  # crontab /tmp/kk-cn-peak.cron
27
- #
28
- # `run_date` is computed at tick time in America/Los_Angeles by the launcher: a run that starts
29
- # at 17:00 PDT is still "today" for the day dir the 04:30 generation wrote.
30
- 0 17 * * * cd {{repo}} && mkdir -p .works/kk-daily-publish3 && PATH="{{home}}/.bun/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" TZ=America/Los_Angeles bun {{repo}}/plugins/kk/scripts/voice3-publish-window.ts --window cn-peak --preset daily-ai-voice --live-channels weibo-pub >> {{repo}}/.works/kk-daily-publish3/cn-peak.log 2>&1
24
+ 0 17 * * * cd {{repo}} && mkdir -p .works/kk-news-publish && PATH="{{home}}/.bun/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" TZ=America/Los_Angeles kk news publish --window cn-peak --unattended >> {{repo}}/.works/kk-news-publish/cn-peak.log 2>&1