@gobing-ai/knowledge-kit 0.1.15 → 0.1.17

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 (116) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +1765 -40
  3. package/package.json +1 -1
  4. package/plugins/generations/content-gen/dist/index.js +58 -52
  5. package/plugins/generations/content-gen/src/storm.ts +94 -61
  6. package/plugins/generations/core-facts-gen/dist/index.js +1 -1
  7. package/plugins/generations/daily-article-gen/dist/index.js +1 -1
  8. package/plugins/generations/dailynews-gen/dist/index.js +1 -1
  9. package/plugins/generations/episode-plan-gen/dist/index.js +1 -1
  10. package/plugins/generations/gemini-tts/dist/index.js +1 -1
  11. package/plugins/generations/image-gen/README.md +31 -10
  12. package/plugins/generations/image-gen/assets/sample/cover__quasi-news-podcast.jpg +0 -0
  13. package/plugins/generations/image-gen/assets/sample/daily-news-cover__quasi-news-podcast.jpg +0 -0
  14. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__clean-webapp-ui.jpg +0 -0
  15. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__cute.jpg +0 -0
  16. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__daily-news.jpg +0 -0
  17. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__editorial.jpg +0 -0
  18. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__fresh.jpg +0 -0
  19. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__minimalist.jpg +0 -0
  20. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__photorealistic.jpg +0 -0
  21. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__quasi-news-podcast.jpg +0 -0
  22. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__sketch.jpg +0 -0
  23. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__technical-diagram.jpg +0 -0
  24. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__vibrant.jpg +0 -0
  25. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__warm.jpg +0 -0
  26. package/plugins/generations/image-gen/assets/sample/daily-news-podcast-cover__xhs-knowledge.jpg +0 -0
  27. package/plugins/generations/image-gen/assets/sample/free__quasi-news-podcast.jpg +0 -0
  28. package/plugins/generations/image-gen/assets/sample/illustration__quasi-news-podcast.jpg +0 -0
  29. package/plugins/generations/image-gen/assets/sample/xhs-card__quasi-news-podcast.jpg +0 -0
  30. package/plugins/generations/image-gen/dist/index.js +1 -1
  31. package/plugins/generations/image-gen/presets/formats/daily-news-podcast-cover.yaml +18 -0
  32. package/plugins/generations/image-gen/presets/styles/quasi-news-podcast.yaml +9 -0
  33. package/plugins/generations/news-report-gen/dist/index.js +1 -1
  34. package/plugins/generations/voice-gen/dist/index.js +1 -1
  35. package/plugins/generations/voxcpm-tts/dist/index.js +1 -1
  36. package/plugins/ingestions/aihot-ingest/dist/index.js +1 -1
  37. package/plugins/ingestions/horizon-ingest/dist/index.js +1 -1
  38. package/plugins/ingestions/last30days-ingest/dist/index.js +1 -1
  39. package/plugins/ingestions/web-search/dist/index.js +1 -1
  40. package/plugins/kk/plugin.json +1 -1
  41. package/plugins/kk/publish-presets/daily-ai-voice-migration.json +12 -3
  42. package/plugins/kk/publish-presets/daily-ai-voice.json +17 -9
  43. package/plugins/kk/publish-presets/itc-main.json +42 -0
  44. package/plugins/kk/scripts/cover-compositor.ts +198 -0
  45. package/plugins/kk/scripts/daily-cover-mock.ts +164 -0
  46. package/plugins/kk/scripts/daily-scheduled-run.ts +188 -3
  47. package/plugins/kk/scripts/daily-stages.ts +134 -26
  48. package/plugins/kk/scripts/daily-triage-core.ts +451 -0
  49. package/plugins/kk/scripts/daily-triage.ts +74 -0
  50. package/plugins/kk/scripts/itc-stages.ts +3 -2
  51. package/plugins/kk/scripts/kk-workflow-stages.ts +31 -2
  52. package/plugins/kk/scripts/voice3-publish-window.ts +5 -1
  53. package/plugins/kk/skills/content-safety/references/platforms/wechatmp.md +16 -10
  54. package/plugins/kk/skills/news-editorial/SKILL.md +3 -3
  55. package/plugins/kk/skills/news-editorial/references/style-contract.zh.md +2 -1
  56. package/plugins/kk/skills/publish/SKILL.md +1 -1
  57. package/plugins/kk/skills/wiki-authoring/SKILL.md +53 -0
  58. package/plugins/kk/skills/wiki-authoring/references/page-shapes.md +44 -0
  59. package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +3 -3
  60. package/plugins/kk/workflows/kk-daily-publish3.yaml +10 -3
  61. package/plugins/kk/workflows/kk-daily-safety.yaml +32 -7
  62. package/plugins/publishings/bilibili-pub/dist/index.js +90 -17
  63. package/plugins/publishings/bilibili-pub/dist/profile-check.js +90 -16
  64. package/plugins/publishings/cnblogs-pub/dist/index.js +90 -17
  65. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +90 -16
  66. package/plugins/publishings/csdn-pub/dist/index.js +90 -17
  67. package/plugins/publishings/csdn-pub/dist/profile-check.js +91 -17
  68. package/plugins/publishings/emdash-pub/dist/index.js +1 -1
  69. package/plugins/publishings/infoq-pub/dist/index.js +120 -19
  70. package/plugins/publishings/infoq-pub/dist/profile-check.js +95 -18
  71. package/plugins/publishings/infoq-pub/src/index.ts +40 -1
  72. package/plugins/publishings/jike-pub/dist/index.js +90 -17
  73. package/plugins/publishings/jike-pub/dist/profile-check.js +91 -17
  74. package/plugins/publishings/juejin-pub/dist/index.js +117 -20
  75. package/plugins/publishings/juejin-pub/dist/profile-check.js +94 -18
  76. package/plugins/publishings/juejin-pub/src/index.ts +41 -2
  77. package/plugins/publishings/linkedin-pub/dist/index.js +90 -17
  78. package/plugins/publishings/linkedin-pub/dist/profile-check.js +91 -17
  79. package/plugins/publishings/medium-pub/dist/index.js +1 -1
  80. package/plugins/publishings/podcast-pub/dist/index.js +1 -1
  81. package/plugins/publishings/qiita-pub/dist/index.js +1 -1
  82. package/plugins/publishings/shipinhao-pub/dist/index.js +311 -66
  83. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +138 -17
  84. package/plugins/publishings/shipinhao-pub/plugin.json +2 -2
  85. package/plugins/publishings/shipinhao-pub/src/flow.ts +335 -79
  86. package/plugins/publishings/shipinhao-pub/src/index.ts +16 -8
  87. package/plugins/publishings/shipinhao-pub/src/profile-check.ts +1 -1
  88. package/plugins/publishings/shipinhao-pub/src/selectors.ts +103 -5
  89. package/plugins/publishings/sspai-pub/dist/index.js +90 -17
  90. package/plugins/publishings/sspai-pub/dist/profile-check.js +90 -16
  91. package/plugins/publishings/substack-pub/dist/index.js +90 -17
  92. package/plugins/publishings/substack-pub/dist/profile-check.js +91 -17
  93. package/plugins/publishings/surfdash-pub/dist/index.js +244 -13
  94. package/plugins/publishings/surfdash-pub/src/index.ts +144 -8
  95. package/plugins/publishings/surfdash-pub/src/topic-claims.ts +189 -0
  96. package/plugins/publishings/threads-pub/dist/index.js +1 -1
  97. package/plugins/publishings/wechatmp-pub/dist/index.js +186 -39
  98. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +96 -19
  99. package/plugins/publishings/wechatmp-pub/src/cgi-draft.ts +14 -2
  100. package/plugins/publishings/wechatmp-pub/src/enrich.ts +10 -3
  101. package/plugins/publishings/wechatmp-pub/src/flow.ts +158 -25
  102. package/plugins/publishings/wechatmp-pub/src/page.ts +14 -0
  103. package/plugins/publishings/wechatmp-pub/src/profile-check.ts +8 -1
  104. package/plugins/publishings/weibo-pub/dist/index.js +90 -17
  105. package/plugins/publishings/weibo-pub/dist/profile-check.js +91 -17
  106. package/plugins/publishings/x-pub/dist/index.js +90 -17
  107. package/plugins/publishings/x-pub/dist/profile-check.js +91 -17
  108. package/plugins/publishings/xhs-pub/dist/index.js +646 -47
  109. package/plugins/publishings/xhs-pub/dist/profile-check.js +109 -17
  110. package/plugins/publishings/xhs-pub/src/errors.ts +45 -0
  111. package/plugins/publishings/xhs-pub/src/flow.ts +773 -45
  112. package/plugins/publishings/xhs-pub/src/page.ts +33 -0
  113. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +90 -17
  114. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +90 -16
  115. package/plugins/publishings/zenn-pub/dist/index.js +94 -2
  116. package/plugins/publishings/zenn-pub/src/index.ts +134 -1
@@ -4,19 +4,23 @@ Review-item IDs here are **this skill's bookkeeping numbers**, not official plat
4
4
 
5
5
  | Field | Value |
6
6
  |-------|-------|
7
- | Official source | 微信公众平台协议与《微信公众平台运营规范》,入口 <https://mp.weixin.qq.com>(具体条款深链未在本次任务核验,勿引用未经核验的深链) |
7
+ | Official source | ①《人工智能生成合成内容标识办法》原文(国信办通字〔2025〕2号)<https://www.cac.gov.cn/2025-03/14/c_1743654684782215.htm>(gov.cn 政策库镜像同文);② 微信平台公告《关于进一步规范人工智能生成合成内容标识的公告》(珊瑚安全公众号,2025-08-31)<https://mp.weixin.qq.com/s/XPemoV-jUB5wcJHWR6anlA>;③《微信公众平台运营规范》入口 <https://mp.weixin.qq.com>(规范原文仍未见逐条核验,自动化条款经官方口径转述核验,见 WX-05) |
8
8
  | Scope | 公众号图文、音频素材库、标题/摘要/合集 |
9
- | Effective date | unknown(运营规范版本/生效日期未核验) |
10
- | Last verified | 2026-09-29(仅事件层面;规则原文未逐条核验) |
11
- | Evidence status | 规则条文**未核验**;2026-09-29 图文下架事件为**用户报告**,平台未给出书面理由 |
12
- | Changelog | 2026-09-29 — file created after the takedown report (task 0189) · 2026-10-10 — 操作者裁定:WX-02 降级为 note,不再 escalate |
9
+ | Effective date | 《标识办法》2025-09-01 施行(第十四条);运营规范版本/生效日期仍未核验 |
10
+ | Last verified | 2026-11-11(《标识办法》全文 + 微信平台 AI 标识公告原文已读;运营规范仅官方口径转述) |
11
+ | Evidence status | **AI 标识义务已核验**(《标识办法》官方原文 + 微信平台公告原文);WX-01/WX-04 仍为保守立场(规范原文未核验);2026-09-29 图文下架事件为**用户报告**,平台未给出书面理由 |
12
+ | Changelog | 2026-09-29 — file created after the takedown report (task 0189) · 2026-10-10 — 操作者裁定:WX-02 降级为 note,不再 escalate · 2026-11-11 — 核验《人工智能生成合成内容标识办法》全文(cac.gov.cn 原文)与微信平台 2025-08-31 AI 标识公告;WX-03 由 evidenceGap 升级为已核验条文;新增 WX-05(自动化创作条款,官方口径转述) |
13
13
 
14
14
  ## Evidence distinctions
15
15
 
16
- - **官方规则**:存在(平台协议体系众所周知),但本任务未逐条核验 → 任何条文引用都标
17
- `evidenceGap: true`。
16
+ - **官方规则(已核验原文)**:《人工智能生成合成内容标识办法》(cac.gov.cn,2025-03-14 发布,2025-09-01 施行);微信珊瑚安全公众号公告(2025-08-31)。关键条文:
17
+ - 办法第三条:AI 生成合成内容 = 利用 AI 技术生成的文本、图片、音频、视频、虚拟场景等;标识分显式与隐式。
18
+ - 办法第六条(四):传播平台应提供必要的标识功能,并**提醒用户主动声明**发布内容中是否包含生成合成内容。
19
+ - 办法第十条:用户使用传播服务发布生成合成内容的,**应当主动声明并使用服务提供者提供的标识功能进行标识**;不得恶意删除、篡改、伪造、隐匿标识。
20
+ - 微信公告(2025-08-31):依《办法》,平台对 AI 生成合成内容添加显式/隐式标识;「用户发布的内容为 AI 生成合成的,**发布时需主动进行声明**」;不得删除、篡改、伪造、隐匿平台添加的 AI 标识;违规视情况处罚。
21
+ - **官方口径(媒体转述,未读规范原文)**:运营规范 2026 年更新——公众号不得利用 AI、脚本、接口或自动化方式替代真人完成内容创作/发布;平台「鼓励创作者合理使用工具辅助创作」,反对完全由自动化程序替代真人生产(第一财经 2026-04-09 报道微信团队回应)。→ 见 WX-05。
18
22
  - **用户报告**:2026-09-29 下架事件;无平台反馈。
19
- - **编辑建议(本技能)**:以下审核项为保守立场。
23
+ - **编辑建议(本技能)**:WX-01/WX-04 为保守立场,规范原文未核验。
20
24
 
21
25
  ## Review items
22
26
 
@@ -24,9 +28,11 @@ Review-item IDs here are **this skill's bookkeeping numbers**, not official plat
24
28
  |----|------|-------|
25
29
  | WX-01 | 时政/公共事务主线:政治、外交/贸易管制、军事、公共政策争议、社会公共事件为主的图文或音频 | block |
26
30
  | WX-02 | 资质口径:不做新闻资讯播报形态的标题/摘要(未持有相关资质;同小宇宙 XY-01 的教训)。**操作者裁定 2026-10-10**:同小宇宙 XY-01 裁定——本号不持有也不声称持有新闻资质,剩余风险只在单集标题/摘要是否真的退回播报形态,按 note 记录,不要因「账号无新闻资质」而 block 或 `escalate: true`;仅当某集实际呈现新闻播报形态时才升级为 block。 | note |
27
- | WX-03 | AI 生成声明:图文含 AI 生成内容时按平台入口如实声明(声明入口以平台当前设置为准,未核验 → evidenceGap) | disclose |
31
+ | WX-03 | AI 生成声明:**已核验(2026-11-11)**——《标识办法》第十条 + 微信 2025-08-31 公告:发布含 AI 生成内容时,**发布时通过平台声明入口主动声明**,并使用平台标识功能;声明属发布时元数据侧动作,不要求正文内声明句(同 AP-05 操作者裁定 2026-10-08 的栏目级说明口径)。不得删除/篡改/伪造/隐匿平台标识。审核问法:该集发布流程是否走声明入口;正文缺声明句不记 fix。 | disclose |
28
32
  | WX-04 | 可识别个人信息;标题党/夸大断言(未经核实断言按类别 4 处理) | desensitize / fix |
33
+ | WX-05 | 真人创作/自动化条款(官方口径转述,规范原文未核验):不得利用 AI、脚本、接口等完全替代真人完成内容创作、发布;平台鼓励「合理使用工具辅助创作」。本栏目姿态为真人选题/编辑 + AI 辅助 + AI 合成配音,属鼓励范围;如运营规范原文可读时复核条款字样并更新本行。 | note |
29
34
 
30
35
  ## Open questions / escalation
31
36
 
32
- - 运营规范原文未核验 → 涉及条文的判断一律人工复审;本文件不得被当作条文依据引用。
37
+ - 运营规范原文仍未逐条核验 → WX-01/WX-04/WX-05 涉及条文判断一律人工复审;AI 标识义务(WX-03)已可依据已核验原文直接判断。
38
+ - 《标识办法》配套强制性国家标准(GB 45438-2025 等标识方法标准)未核验 → 显式/隐式标识的具体样式以平台实现为准。
@@ -66,7 +66,7 @@ At the episode level, write:
66
66
  - `intro` (≤150 chars): names the top two or three concrete in-scope developments.
67
67
  - `outro` (≤150 chars): a short close tying the items together.
68
68
  - `excluded`: copy the array from `--excluded` (`21-plan/<date>_03_curate_excluded.json`) verbatim so the script plan records every dropped candidate with its Chinese reason.
69
- - `cover` (≤240 chars): one concrete visual scene in English for the lead item (objects, settings, symbols, metaphor; no text, letters, numbers, logos, flags, or recognizable people).
69
+ - `cover` (≤240 chars): one concrete visual scene in English for the lead item (objects, settings, symbols, metaphor; no text, letters, numbers, logos, flags, or recognizable people). 0347 R4: it may instead be `{ "scene": "…", "headline": "…" }` — `scene` keeps the same English visual contract (≤240 chars), and `headline` is a punchy 1–2 line Chinese Hook headline (≤25 chars per line) grounded in the lead news story, for deterministic lower-third typesetting downstream.
70
70
  - `cards`: `{ "title": "≤20字总标题", "body": "中文导语段落 + 3-5个话题标签" }` for the episode card series.
71
71
  - `social`: `{ "short": "≤140字 X/Threads 短帖", "long": "≤500字 微博/LinkedIn 长帖" }` (plain text, no markdown headings, no emoji spam, grounded in the plan).
72
72
 
@@ -77,7 +77,7 @@ Output:
77
77
  "version": 1,
78
78
  "intro": "…",
79
79
  "outro": "…",
80
- "cover": "…",
80
+ "cover": { "scene": "…", "headline": "…" },
81
81
  "cards": { "title": "…", "body": "…" },
82
82
  "social": { "short": "…", "long": "…" },
83
83
  "items": [
@@ -101,7 +101,7 @@ validator). Change only what the errors name and copy everything else unchanged.
101
101
 
102
102
  | Rule | Fix |
103
103
  |---|---|
104
- | `cap:<field>` | Shorten that field (`intro`, `outro`, `lead`, `insight`, `cover`, `cardCopy`, `cardTitle`, `socialShort`, `socialLong`) below its cap in the contract. Cut opinion, not the actor |
104
+ | `cap:<field>` | Shorten that field (`intro`, `outro`, `lead`, `insight`, `cover`, `coverHeadline`, `cardCopy`, `cardTitle`, `socialShort`, `socialLong`) below its cap in the contract. Cut opinion, not the actor |
105
105
  | `banned:<phrase>` | Rephrase without the phrase (applies to spoken, card and social fields alike) |
106
106
  | `redundant-insight` | Rewrite the insight as commentary; drop the restated facts |
107
107
  | `duplicate-insight` | Make each insight specific to its own item |
@@ -47,7 +47,7 @@
47
47
  - `lead`:一句话口语桥段,引出下一个主题的【标题】;只做铺垫,不得复述标题本身,不用设问句把新闻改写成抽象问题,不超过 80 字。
48
48
  - `insight`:只基于这一条自身可核事实的点评(2–4 句),说清这一条对行业或开发者的意义、或接下来值得关注的节点;不得挪用其他条目的话题,不超过 380 字(这是上限不是目标,常规 150–280 字)。听众刚听完这一条的事实叙述,insight 是点评不是复读:不得复述正文已讲过的事实、数字或成串措辞(最多点到一两个关键词);也不得脱离这条新闻泛泛讲方法论或给通用建议。时长契约:全片按 15–20 分钟口播设计,时长靠覆盖更多条目和完整的事实叙述撑起,不靠拉长点评。字数按配音驱动折算:gemini ≈3.3 字/秒(正文约 4300–5800 字);Voicebox robin-news ≈6.3 字/秒(正文约 5700–7600 字,或增加条目数)。
49
49
  - `outro`:简短收束语,接在固定致谢之前,不超过 150 字。
50
- - `cover`:头版英文具象视觉场景,不超过 240 字符,不含文字、数字、商标、旗帜或可辨识真人。
50
+ - `cover`:头版具象视觉内容。字符串形态是英文画面场景(不超过 240 字符,不含文字、数字、商标、旗帜或可辨识真人);0347 R4 起也可写作对象 `{ "scene": "…", "headline": "…" }` —— `scene` 沿用同一英文画面契约,`headline` 是锚定头条新闻的中文 Hook 大标题(1–2 行,每行不超过 25 字),供下游确定性排版小标题层。
51
51
  - `cards`:小红书图文笔记总标题 `title`(不超过 20 字)与导语 `body`,单条卡片标题 `card.copy`(不超过 12 字)、2–4 条短要点 `card.points`、英文画面 `card.subject`。
52
52
  - `social`:面向 X / Threads 的短帖 `short`(不超过 140 字)与面向微博 / LinkedIn 的长帖 `long`(不超过 500 字)。
53
53
 
@@ -66,6 +66,7 @@
66
66
  "lead": 80,
67
67
  "insight": 380,
68
68
  "cover": 240,
69
+ "coverHeadline": 25,
69
70
  "cardCopy": 12,
70
71
  "cardTitle": 20,
71
72
  "socialShort": 140,
@@ -31,7 +31,7 @@ not add a `kk publish` noun.
31
31
  | substack | `substack-pub` | `browser` / `script` | `kk executor run substack-pub --in <content.json> --out <result.json>` (needs `SUBSTACK_PUBLICATION_URL`) |
32
32
  | threads | `threads-pub` | `file-cli` (Threads Graph, container → `threads_publish`) | `kk executor run threads-pub --in <content.json> --out <result.json>` — text only; needs `THREADS_ACCESS_TOKEN` + `THREADS_USER_ID`, no browser path |
33
33
  | weibo | `weibo-pub` | `browser` / `script` | `kk executor run weibo-pub --in <content.json> --out <result.json>`; `options.operation` `article` (头条文章, draft via 保存草稿 by default) or `post` (home composer, which has **no draft** — it requires `metadata.publishStatus: public`) |
34
- | xhs | `xhs-pub` | `browser` / `script` | `kk executor run xhs-pub --in <content.json> --out <result.json>` — its default `script` driver uploads the ordered card images with Playwright `setInputFiles`; the `agent` driver fails loud for this channel (ADR-024) |
34
+ | xhs | `xhs-pub` | `browser` / `script` | `kk executor run xhs-pub --in <content.json> --out <result.json>` — its default `script` driver uploads the ordered card images with Playwright `setInputFiles`; the `agent` driver fails loud for this channel (ADR-024). A draft returns `ok: true` only after the plugin reopens the saved note and checks slot count, `https` srcs, title, body, and 合集; a miss is `DraftVerifyError` and `ok: false`. Daily voice and publish tiers call this same executor, so that reopen is their post-save check |
35
35
 
36
36
  Already-harvested file-cli channels (`qiita-pub`, `zenn-pub`, `surfdash-pub`,
37
37
  `emdash-pub`, `podcast-pub`) compose the same way.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: wiki-authoring
3
+ version: 0.1.0
4
+ requires: [cli:kk, local-fs]
5
+ description: This skill should be used when a personal Markdown vault needs authored page text — "summarize this source into the vault", "synthesize a concept page for X", "extend the page about Y", or when a kk wiki pipeline step needs agent-written prose. Supplies text to `kk wiki summarize|synthesize`; the CLI owns placement, the guard and the graph.
6
+ ---
7
+
8
+ # wiki-authoring — author vault pages through the CLI
9
+
10
+ The vault at `content/` is plain Markdown that a human edits and Quartz publishes. This skill writes
11
+ prose; `kk wiki` does everything else. Never edit a page file directly.
12
+
13
+ ## Contract
14
+
15
+ 1. Read what exists first: `kk wiki context "<topic>"` (or `kk wiki query "<prompt>"`) to see the
16
+ pages and neighbours already in the vault.
17
+ 2. Compose the text: dense, factual, no navigation chatter. One page per concept or entity, and each
18
+ paragraph should stand alone because a later `compile` copies it into the index.
19
+ 3. Hand the text to the CLI on stdin — never write the file yourself:
20
+
21
+ ```bash
22
+ kk wiki synthesize "<Topic>" --from - --json <<'TEXT'
23
+ <authored markdown>
24
+ TEXT
25
+ ```
26
+
27
+ Use `--type entity` for a tool, project or framework page; the default is `concept`.
28
+ Use `kk wiki summarize <page> --from -` to place a summary into an existing page.
29
+ 4. Verify: `kk wiki lint` exits 0 and `kk wiki link` reports no unlinked mention of a title you
30
+ just introduced.
31
+
32
+ ## The guard (never work around it)
33
+
34
+ - A page whose frontmatter carries `user_edited: true` is **never** replaced. Your text lands under
35
+ `## AI Updates (<YYYY-MM-DD>)`, and the CLI reports `guard: appended`.
36
+ - Never pass a "replace anyway" intent, never rewrite the file with an editor tool, and never strip
37
+ `user_edited`.
38
+ - `index.md` and `MAP.md` are compiled — do not author them; run `kk wiki compile`.
39
+
40
+ ## Frontmatter you may rely on
41
+
42
+ `title`, `type` (`concept|entity|source|index`), `tags[]`, `sources[]`, `updated_at`,
43
+ `user_edited?`, `redirect_to?`. Values are flat: scalars and string arrays only.
44
+
45
+ ## Modes
46
+
47
+ | Mode | Command | Use |
48
+ | --- | --- | --- |
49
+ | `synthesize` (new) | `kk wiki synthesize "<Topic>" --from -` | A concept or entity the vault does not have |
50
+ | `synthesize` (extend) | `kk wiki synthesize <page-path> --from -` | New material for an existing page |
51
+ | `summarize` | `kk wiki summarize <page-path> --from -` | A raw asset's summary placed into its page |
52
+
53
+ See [references/page-shapes.md](references/page-shapes.md) for the shapes a page must satisfy.
@@ -0,0 +1,44 @@
1
+ # Page shapes
2
+
3
+ A page is `<frontmatter block>` then a body. The frontmatter is flat: `key: value` lines, arrays as
4
+ `- item` lines, no nested maps.
5
+
6
+ ```markdown
7
+ ---
8
+ title: Vector index
9
+ type: concept
10
+ tags:
11
+ - retrieval
12
+ sources:
13
+ - raw/html/a1
14
+ updated_at: 2026-11-10
15
+ ---
16
+
17
+ # Vector index
18
+
19
+ One paragraph a reader can act on. Mention other pages by title — the CLI links the first
20
+ occurrence of every existing title it sees in your text.
21
+
22
+ ## Summary
23
+
24
+ Two to four sentences: what it is, why it matters, what it costs.
25
+
26
+ ## Detail
27
+
28
+ Structured notes. Keep headings at `##` or deeper; `## AI Updates` and `## Summary` are reserved.
29
+ ```
30
+
31
+ ## Rules the lint enforces
32
+
33
+ | Rule | Consequence |
34
+ | --- | --- |
35
+ | `title` and `type` present | Missing either is `missing-frontmatter` / `invalid-frontmatter` |
36
+ | Slugs are title-derived | Two pages with the same title produce `duplicate-slug` |
37
+ | Links resolve | `[[unknown-page]]` is a `broken-link` |
38
+ | Pages are reachable | A page no other page links to is an `orphan` (`index.md`/`MAP.md` exempt) |
39
+
40
+ ## What the skill must not produce
41
+
42
+ - Navigation prose ("In this article we will…"), task markers left for later, or empty headings.
43
+ - A page that duplicates an existing title; extend that page instead.
44
+ - `user_edited: true` on a page it authored — that flag belongs to the operator.
@@ -533,7 +533,7 @@ nodes:
533
533
  kk stage daily-article "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
534
534
 
535
535
  - id: cover
536
- description: "Render the daily cover through the pinned daily-news presets (F614)"
536
+ description: "Render the daily cover through the pinned quasi-news podcast presets (F614, 0349: daily-news-podcast-cover x quasi-news-podcast)"
537
537
  dependsOn: [editorial-render, pool-gate]
538
538
  condition:
539
539
  kind: shell
@@ -575,7 +575,7 @@ nodes:
575
575
  command: >-
576
576
  env -u SPUR_WORKFLOW_RUN_ACTIVE -u SPUR_EXPECTED_DEFINITION_DIGEST
577
577
  spur workflow run plugins/kk/workflows/kk-daily-safety.yaml
578
- --vars "{\"work_dir\":\"${vars.work_dir}\",\"run_date\":\"${vars.run_date}\",\"safety_max_revise\":\"${vars.safety_max_revise}\",\"safety_platforms\":\"${vars.safety_platforms}\",\"agent\":\"${vars.agent}\"}"
578
+ --vars "{\"work_dir\":\"${vars.work_dir}\",\"run_date\":\"${vars.run_date}\",\"safety_max_revise\":\"${vars.safety_max_revise}\",\"safety_platforms\":\"${vars.safety_platforms}\",\"agent\":\"${vars.agent}\",\"agent_retry\":\"${vars.agent_retry}\"}"
579
579
  --quiet --no-plan
580
580
 
581
581
  - id: review
@@ -834,7 +834,7 @@ nodes:
834
834
  kk stage run daily-safety-manifest "${vars.work_dir}" "${vars.run_date}" &&
835
835
  env -u SPUR_WORKFLOW_RUN_ACTIVE -u SPUR_EXPECTED_DEFINITION_DIGEST
836
836
  spur workflow run plugins/kk/workflows/kk-daily-safety.yaml
837
- --vars "{\"work_dir\":\"${vars.work_dir}\",\"run_date\":\"${vars.run_date}\",\"safety_max_revise\":\"${vars.safety_max_revise}\",\"safety_platforms\":\"${vars.safety_platforms}\",\"agent\":\"${vars.agent}\",\"safety_scope_dir\":\"4-safety-variants\"}"
837
+ --vars "{\"work_dir\":\"${vars.work_dir}\",\"run_date\":\"${vars.run_date}\",\"safety_max_revise\":\"${vars.safety_max_revise}\",\"safety_platforms\":\"${vars.safety_platforms}\",\"agent\":\"${vars.agent}\",\"agent_retry\":\"${vars.agent_retry}\",\"safety_scope_dir\":\"4-safety-variants\"}"
838
838
  --quiet --no-plan
839
839
 
840
840
  - id: bundle-freeze
@@ -19,6 +19,10 @@ vars:
19
19
  window: after-generate
20
20
  # Empty = the operator's `workflows.kk-daily-ai-voice3.publish_preset` selector decides.
21
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"
22
26
  channels: ""
23
27
  live_channels: ""
24
28
  dummy: "false"
@@ -114,15 +118,18 @@ nodes:
114
118
  - id: send-confirm
115
119
  description: >-
116
120
  Operator approval of a LIVE send: `pause: true` stops the run and RESUME is the approval;
117
- cancelling is the rejection. Skipped for a draft-only window, so an unattended draft run and
118
- every rehearsal proceed without a human.
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.
119
125
  dependsOn: [check]
120
126
  pause: true
121
127
  condition:
122
128
  kind: shell
123
129
  options:
124
130
  command: >-
125
- jq -e '[.rows[] | select(.mode == "live")] | length > 0'
131
+ test "${vars.live_confirm}" = "true"
132
+ && jq -e '[.rows[] | select(.mode == "live")] | length > 0'
126
133
  "${vars.work_dir}/4-publish/plan.${vars.window}.json" >/dev/null 2>&1
127
134
 
128
135
  - id: send
@@ -12,17 +12,23 @@ description: >-
12
12
  gate that classifies the pair into pass|escalate|exclude|revise|block, `revise` applies the
13
13
  findings to the two drafts and re-opens the review. The loop is bounded by `safety_max_revise`
14
14
  (the gate spends one unit per pass and stops revising at the bound). Terminal `clean` covers
15
- every outcome that is not a draft-integrity refusal — pass, escalate and exclude all publish what
16
- the gate admitted — and `block` is the failure state, so this run exits non-zero only on a block
15
+ every outcome that is not a refusal — pass, escalate and exclude all publish what the gate
16
+ admitted — and `block` is a failure state, so this run exits non-zero on a block, an infra-fail
17
17
  or an integrity failure. The caller (`kk-daily-ai-voice2`'s `safety` node) therefore reads
18
18
  "non-zero = never publish", which is the same contract the flat workflow's `safety-judge -> failed`
19
- edge carried.
19
+ edge carried. 0347 F4 (2026-11-10) splits the failure state in two: `infra-fail` is a gate refusal
20
+ caused by missing evidence (executor/agent death — request/report/verdict never appeared, marker
21
+ file `<scope>/<date>_09_safety-infra.json`), so machine retries are meaningful; `block` is a real
22
+ content verdict (or a refusal with evidence present), so only a human should retry it. Both are
23
+ failureStates, so the caller's "non-zero = never publish" contract is unchanged.
20
24
  initialState: review
21
25
  terminalStates:
22
26
  - clean
23
27
  - block
28
+ - infra-fail
24
29
  failureStates:
25
30
  - block
31
+ - infra-fail
26
32
 
27
33
  vars:
28
34
  # Effective run workspace, passed by the caller via --vars (the DAG owns the layout; this
@@ -170,7 +176,7 @@ states:
170
176
  timeoutMs: 600000
171
177
  # ADR-115 error tier: keep this prompt <= 1000 chars. Shared with the retry below.
172
178
  input: &safety-revise-input |
173
- Read ${vars.work_dir}/${vars.safety_scope_dir}/${vars.run_date}_09_safety-review_report.json — its per-platform findings carry `revision` proposals, and its `content_ref` names the reviewed files. Read the judge `feedback` beside it.
179
+ Read ${vars.work_dir}/${vars.safety_scope_dir}/${vars.run_date}_09_safety-review_report.json — its per-platform findings carry `revision` proposals, and its `content_ref` names the reviewed files. Read the judge feedback beside it.
174
180
  Invoke kk:content-safety in detect+revise mode; apply only named findings to the files listed in the request's `content` array.
175
181
  Scope `drafts`: keep the article title「每日AI乱炖 · <date>」, the opening「这里是由Robin为你带来的咸话咸说之每日AI乱炖」, the VoiceScript's date greeting, and valid YAML. Scope `variants`: keep valid JSON with non-empty `title`/`body`. Never add「我是咸话咸说」or an AI-production closer, even if a finding asks.
176
182
  Keep every fact, number, name, quote, hedge(据报道)and 来源 link, the ## structure, segment order and `title`.
@@ -206,6 +212,12 @@ states:
206
212
  - id: block
207
213
  description: "Terminal — draft integrity refused the drafts (PII on a blocked platform, a must-pass judge fail outside the admission criteria, an out-of-contract verdict, or drafts edited after review); the caller must not publish"
208
214
 
215
+ - id: infra-fail
216
+ description: >-
217
+ Terminal — the gate refused for missing evidence (executor/agent outage: the request, report
218
+ or verdict never appeared), not a content verdict. Machine-retryable once executors recover;
219
+ drafts and reviewed bytes are preserved (the gate skips quarantine for this case).
220
+
209
221
  transitions:
210
222
  - from: review
211
223
  to: review-retry
@@ -293,13 +305,26 @@ transitions:
293
305
  options:
294
306
  command: 'test "${vars.safety_status}" = "revise"'
295
307
 
308
+ - from: judge
309
+ to: infra-fail
310
+ description: >-
311
+ 0347 F4: the gate refused for missing evidence (request/report/verdict never appeared — an
312
+ executor or agent outage), recorded in the safety-infra.json marker it wrote.
313
+ Machine-retryable: distinct from a content `block`, same caller contract
314
+ (non-zero = never publish).
315
+ terminalReason: failed-agent
316
+ guard:
317
+ kind: shell
318
+ options:
319
+ command: test -f "${vars.work_dir}/${vars.safety_scope_dir}/${vars.run_date}_09_safety-infra.json"
320
+
296
321
  - from: judge
297
322
  to: block
298
323
  description: >-
299
324
  block (draft integrity — PII on a blocked platform, a must-pass fail outside the admission
300
- criteria, drafts edited after review), or no usable status (missing/unreadable report or
301
- verdict, non-PASS) -> never publish. Unconditional, so a refused verdict leaves the state
302
- instead of deadlocking the loop.
325
+ criteria, drafts edited after review, or a refusal with evidence present), or no usable status
326
+ (missing/unreadable report or verdict, non-PASS) -> never publish. Unconditional, so a refused
327
+ verdict leaves the state instead of deadlocking the loop.
303
328
  terminalReason: failed-check
304
329
  guard:
305
330
  kind: always
@@ -19905,7 +19905,7 @@ var PLATFORM_CONTENT_LIMITS = Object.freeze({
19905
19905
  shortVideo: Object.freeze({
19906
19906
  douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
19907
19907
  kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
19908
- shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
19908
+ shipinhao: Object.freeze({ max: 100, unit: "unicode_code_points" })
19909
19909
  })
19910
19910
  })
19911
19911
  });
@@ -20446,8 +20446,11 @@ import {
20446
20446
  mkdirSync as mkdirSync2,
20447
20447
  openSync,
20448
20448
  readdirSync as readdirSync2,
20449
+ readlinkSync,
20449
20450
  realpathSync as realpathSync2,
20450
- rmdirSync
20451
+ renameSync as renameSync2,
20452
+ rmdirSync,
20453
+ unlinkSync
20451
20454
  } from "fs";
20452
20455
  function lstat(path) {
20453
20456
  try {
@@ -20482,6 +20485,33 @@ function rmdir(path) {
20482
20485
  throw error;
20483
20486
  }
20484
20487
  }
20488
+ function readlink(path) {
20489
+ try {
20490
+ return readlinkSync(path);
20491
+ } catch {
20492
+ return null;
20493
+ }
20494
+ }
20495
+ function unlink(path) {
20496
+ try {
20497
+ unlinkSync(path);
20498
+ return true;
20499
+ } catch (error) {
20500
+ if (error.code === "ENOENT")
20501
+ return false;
20502
+ throw error;
20503
+ }
20504
+ }
20505
+ function rename(from, to) {
20506
+ try {
20507
+ renameSync2(from, to);
20508
+ return true;
20509
+ } catch (error) {
20510
+ if (error.code === "ENOENT")
20511
+ return false;
20512
+ throw error;
20513
+ }
20514
+ }
20485
20515
  function chmod(path, mode) {
20486
20516
  chmodSync(path, mode);
20487
20517
  }
@@ -20493,14 +20523,14 @@ var DEFAULT_BOT_TRANSACTION_ROOT = join2(homedir2(), ".config", "kk", "browser-t
20493
20523
 
20494
20524
  // ../../packages/publish-harness/src/profile-lease.ts
20495
20525
  import { createHash, randomBytes } from "crypto";
20496
- import { homedir as homedir3 } from "os";
20526
+ import { homedir as homedir3, hostname } from "os";
20497
20527
  import { basename, dirname as dirname3, join as join3, resolve as resolve3 } from "path";
20498
20528
  var DEFAULT_BOT_LEASE_ROOT = join3(homedir3(), ".config", "kk", "browser-leases");
20499
20529
  var KK_BOT_LEASE_PATH = "KK_BOT_LEASE_PATH";
20500
20530
  var KK_BOT_LEASE_TOKEN = "KK_BOT_LEASE_TOKEN";
20501
20531
  var OWNER_FILE = "owner.json";
20502
20532
  var HOLDER_PREFIX = "holder-";
20503
- var NATIVE_LOCK_FILES = ["SingletonLock", "SingletonSocket"];
20533
+ var NATIVE_LOCK_FILES = ["SingletonLock", "SingletonSocket", "SingletonCookie"];
20504
20534
  async function acquireProfileLease(profileDir, options = {}) {
20505
20535
  const fileSystem = options.fileSystem ?? createNodeFileSystem();
20506
20536
  const leaseRoot = options.leaseRoot ?? DEFAULT_BOT_LEASE_ROOT;
@@ -20668,6 +20698,8 @@ function isProcessAlive(pid) {
20668
20698
  }
20669
20699
  }
20670
20700
  function refuseNativeLock(profileDir) {
20701
+ if (reclaimStaleNativeLock(profileDir))
20702
+ return;
20671
20703
  for (const name of NATIVE_LOCK_FILES) {
20672
20704
  const path = join3(profileDir, name);
20673
20705
  if (lstat(path) !== null) {
@@ -20675,6 +20707,24 @@ function refuseNativeLock(profileDir) {
20675
20707
  }
20676
20708
  }
20677
20709
  }
20710
+ function reclaimStaleNativeLock(profileDir) {
20711
+ const lockPath = join3(profileDir, "SingletonLock");
20712
+ const target = readlink(lockPath);
20713
+ if (target === null)
20714
+ return false;
20715
+ const match = /^(.*)-(\d+)$/.exec(target);
20716
+ if (match === null)
20717
+ return false;
20718
+ const [, host, pidText] = match;
20719
+ if (host !== hostname())
20720
+ return false;
20721
+ const pid = Number(pidText);
20722
+ if (!Number.isInteger(pid) || pid <= 0 || isProcessAlive(pid))
20723
+ return false;
20724
+ for (const name of NATIVE_LOCK_FILES)
20725
+ unlink(join3(profileDir, name));
20726
+ return true;
20727
+ }
20678
20728
  function sha256Hex(value) {
20679
20729
  return createHash("sha256").update(value).digest("hex");
20680
20730
  }
@@ -20709,6 +20759,27 @@ var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
20709
20759
  // ../../packages/publish-harness/src/browser.ts
20710
20760
  var DEFAULT_CHECK_TIMEOUT_MS = 30000;
20711
20761
  var DEFAULT_POLL_MS = 500;
20762
+ function isInstantBrowserDeath(message) {
20763
+ return /target page, context or browser has been closed|browser has been closed|target closed/i.test(message);
20764
+ }
20765
+ function classifyLaunchError(error, profileDir, channel) {
20766
+ const message = errorMessage2(error);
20767
+ if (/singleton|already in use|in use by another/i.test(message))
20768
+ return new BrowserProfileBusyError(profileDir, error);
20769
+ if (/playwright install|executable doesn't exist/i.test(message)) {
20770
+ return new PlaywrightUnavailableError(`Browser channel '${channel}' is not installed. Run \`bunx playwright install chromium\` (or install Google Chrome for KK_BROWSER_CHANNEL=chrome).`, { cause: error });
20771
+ }
20772
+ if (isInstantBrowserDeath(message)) {
20773
+ return new PlaywrightUnavailableError(`browser profile ${profileDir} makes Chromium exit during startup (no diagnostic reported). Move it aside (\`mv ${profileDir} ${profileDir}.broken-<date>\`) and log in again; \`storage-state.json\` is the only state worth keeping.`, { cause: error });
20774
+ }
20775
+ return error instanceof Error ? error : new Error(message);
20776
+ }
20777
+ function quarantineProfileSyncData(profileDir) {
20778
+ const syncData = join5(profileDir, "Default", "Sync Data");
20779
+ if (lstat(syncData) === null)
20780
+ return false;
20781
+ return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}`);
20782
+ }
20712
20783
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
20713
20784
  return {
20714
20785
  async launch(request) {
@@ -20737,23 +20808,25 @@ async function launchKkContext(loadPlaywright, profileDir, headless) {
20737
20808
  throw new PlaywrightUnavailableError('The "playwright" dependency is not installed. Run `bunx playwright install chromium`.', { cause: error });
20738
20809
  }
20739
20810
  const channel = process.env.KK_BROWSER_CHANNEL?.trim() || "chromium";
20811
+ const launch = () => playwright.chromium.launchPersistentContext(profileDir, {
20812
+ headless,
20813
+ channel,
20814
+ args: ["--disable-blink-features=AutomationControlled"],
20815
+ ignoreDefaultArgs: ["--enable-automation"]
20816
+ });
20740
20817
  let context;
20741
20818
  try {
20742
- context = await playwright.chromium.launchPersistentContext(profileDir, {
20743
- headless,
20744
- channel,
20745
- args: ["--disable-blink-features=AutomationControlled"],
20746
- ignoreDefaultArgs: ["--enable-automation"]
20747
- });
20819
+ context = await launch();
20748
20820
  } catch (error) {
20749
- const message = errorMessage2(error);
20750
- if (/singleton|already in use|in use by another/i.test(message)) {
20751
- throw new BrowserProfileBusyError(profileDir, error);
20752
- }
20753
- if (/playwright install|executable doesn't exist/i.test(message)) {
20754
- throw new PlaywrightUnavailableError(`Browser channel '${channel}' is not installed. Run \`bunx playwright install chromium\` (or install Google Chrome for KK_BROWSER_CHANNEL=chrome).`, { cause: error });
20821
+ if (!isInstantBrowserDeath(errorMessage2(error)))
20822
+ throw classifyLaunchError(error, profileDir, channel);
20823
+ if (!quarantineProfileSyncData(profileDir))
20824
+ throw classifyLaunchError(error, profileDir, channel);
20825
+ try {
20826
+ context = await launch();
20827
+ } catch (retryError) {
20828
+ throw classifyLaunchError(retryError, profileDir, channel);
20755
20829
  }
20756
- throw error;
20757
20830
  }
20758
20831
  try {
20759
20832
  await context.addInitScript(() => {