@gobing-ai/knowledge-kit 0.1.19 → 0.1.22
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/collect/index.js +1 -0
- package/dist/board/daily-voice/index.js +1315 -264
- package/dist/board/itc/index.js +1 -0
- package/dist/index.js +14674 -8775
- package/package.json +1 -1
- package/plugins/generations/dailynews-gen/dist/index.js +285 -16
- package/plugins/generations/dailynews-gen/src/editorial-claims.ts +215 -0
- package/plugins/generations/dailynews-gen/src/index.ts +23 -4
- package/plugins/generations/dailynews-gen/src/script-builder.ts +10 -3
- package/plugins/generations/dailynews-gen/src/script-plan.ts +74 -14
- 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/generations/music-gen/README.md +277 -0
- package/plugins/generations/music-gen/dist/index.js +23544 -0
- package/plugins/generations/music-gen/package.json +24 -0
- package/plugins/generations/music-gen/plugin.json +23 -0
- package/plugins/generations/music-gen/presets/SOURCE.md +39 -0
- package/plugins/generations/music-gen/presets/formats/clip.yaml +21 -0
- package/plugins/generations/music-gen/presets/formats/jingle.yaml +22 -0
- package/plugins/generations/music-gen/presets/formats/loop.yaml +21 -0
- package/plugins/generations/music-gen/presets/formats/song.yaml +31 -0
- package/plugins/generations/music-gen/presets/formats/underscore.yaml +22 -0
- package/plugins/generations/music-gen/presets/themes/ambient-tech.yaml +30 -0
- package/plugins/generations/music-gen/presets/themes/cinematic.yaml +30 -0
- package/plugins/generations/music-gen/presets/themes/lofi.yaml +30 -0
- package/plugins/generations/music-gen/presets/themes/synthwave.yaml +30 -0
- package/plugins/generations/music-gen/scripts/gen-preset-index.ts +181 -0
- package/plugins/generations/music-gen/scripts/resolve-preset.ts +64 -0
- package/plugins/generations/music-gen/src/adapter/index.ts +35 -0
- package/plugins/generations/music-gen/src/adapter/instance.ts +904 -0
- package/plugins/generations/music-gen/src/adapter/offline.ts +124 -0
- package/plugins/generations/music-gen/src/artifact.ts +223 -0
- package/plugins/generations/music-gen/src/audio/checks.ts +618 -0
- package/plugins/generations/music-gen/src/audio/master.ts +267 -0
- package/plugins/generations/music-gen/src/audio/measure.ts +507 -0
- package/plugins/generations/music-gen/src/audio/profile.ts +131 -0
- package/plugins/generations/music-gen/src/audio.ts +122 -0
- package/plugins/generations/music-gen/src/brief.ts +191 -0
- package/plugins/generations/music-gen/src/config.ts +451 -0
- package/plugins/generations/music-gen/src/content.ts +199 -0
- package/plugins/generations/music-gen/src/digest.ts +100 -0
- package/plugins/generations/music-gen/src/index.ts +147 -0
- package/plugins/generations/music-gen/src/job.ts +131 -0
- package/plugins/generations/music-gen/src/plugin.ts +371 -0
- package/plugins/generations/music-gen/src/presets.ts +918 -0
- package/plugins/generations/music-gen/src/render.ts +87 -0
- package/plugins/generations/music-gen/src/request.ts +102 -0
- package/plugins/generations/music-gen/src/spend.ts +495 -0
- package/plugins/generations/music-gen/tsconfig.json +8 -0
- package/plugins/kk/config.example.yaml +3 -0
- package/plugins/kk/decisions/extract/ai-news.yaml +5 -2
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/publish-presets/daily-ai-voice.json +48 -7
- package/plugins/kk/schedules/kk-serve.launchd.plist.tmpl +2 -1
- package/plugins/kk/scripts/cover-compositor.ts +380 -32
- package/plugins/kk/scripts/daily-cover-mock.ts +40 -3
- package/plugins/kk/scripts/daily-stages.ts +897 -34
- package/plugins/kk/scripts/episode-identity.ts +180 -0
- package/plugins/kk/scripts/kk-workflow-stages.ts +37 -1
- package/plugins/kk/scripts/music-stages.ts +624 -0
- package/plugins/kk/scripts/news-editorial-ledger.ts +906 -0
- package/plugins/kk/scripts/source-citation.ts +187 -0
- package/plugins/kk/scripts/topic-selection-attempts.ts +446 -0
- package/plugins/kk/scripts/topic-selection-calibration.ts +161 -0
- package/plugins/kk/skills/content-judge/SKILL.md +11 -6
- package/plugins/kk/skills/content-judge/references/music-quality-rubric.md +147 -0
- package/plugins/kk/skills/content-judge/references/rubrics.md +15 -0
- package/plugins/kk/skills/content-safety/SKILL.md +12 -0
- 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/music-authoring/SKILL.md +276 -0
- package/plugins/kk/skills/music-authoring/references/judge-input.md +117 -0
- package/plugins/kk/skills/news-editorial/SKILL.md +102 -15
- package/plugins/kk/skills/news-editorial/references/selection.md +4 -0
- package/plugins/kk/skills/news-editorial/references/style-contract.zh.md +58 -11
- package/plugins/kk/skills/publish/SKILL.md +11 -0
- package/plugins/kk/skills/web-automation/SKILL.md +31 -1
- package/plugins/kk/workflows/kk-collect.yaml +8 -4
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +10 -9
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +11 -9
- package/plugins/kk/workflows/kk-music.yaml +328 -0
- package/plugins/kk/workflows/kk-news-generate.yaml +58 -3
- package/plugins/publishings/bilibili-pub/dist/index.js +11 -1
- package/plugins/publishings/bilibili-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/cnblogs-pub/dist/index.js +11 -1
- package/plugins/publishings/cnblogs-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/csdn-pub/dist/index.js +11 -1
- package/plugins/publishings/csdn-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/infoq-pub/dist/index.js +11 -1
- package/plugins/publishings/infoq-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/jike-pub/dist/index.js +11 -1
- package/plugins/publishings/jike-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/juejin-pub/dist/index.js +11 -1
- package/plugins/publishings/juejin-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/linkedin-pub/dist/index.js +54 -7
- package/plugins/publishings/linkedin-pub/dist/profile-check.js +43 -6
- package/plugins/publishings/linkedin-pub/src/index.ts +52 -6
- package/plugins/publishings/podcast-pub/dist/index.js +586 -20
- package/plugins/publishings/podcast-pub/src/corrections.ts +509 -0
- package/plugins/publishings/podcast-pub/src/index.ts +257 -5
- package/plugins/publishings/podcast-pub/src/show-notes-brief.ts +240 -0
- package/plugins/publishings/podcast-pub/src/show-notes.ts +69 -13
- package/plugins/publishings/shipinhao-pub/dist/index.js +437 -32
- package/plugins/publishings/shipinhao-pub/dist/profile-check.js +14 -2
- package/plugins/publishings/shipinhao-pub/plugin.json +1 -1
- package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +492 -0
- package/plugins/publishings/shipinhao-pub/src/flow.ts +227 -12
- package/plugins/publishings/shipinhao-pub/src/selectors.ts +13 -0
- package/plugins/publishings/sspai-pub/dist/index.js +11 -1
- package/plugins/publishings/sspai-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/substack-pub/dist/index.js +11 -1
- package/plugins/publishings/substack-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/surfdash-pub/dist/index.js +122 -28
- package/plugins/publishings/surfdash-pub/src/digest-check.ts +7 -3
- package/plugins/publishings/surfdash-pub/src/index.ts +159 -25
- package/plugins/publishings/surfdash-pub/src/topic-claims.ts +37 -4
- package/plugins/publishings/threads-pub/dist/index.js +9206 -296
- package/plugins/publishings/threads-pub/dist/profile-check.js +21149 -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 +18 -1
- package/plugins/publishings/wechatmp-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/wechatmp-pub/src/flow.ts +13 -0
- package/plugins/publishings/weibo-pub/dist/index.js +57 -3
- package/plugins/publishings/weibo-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/weibo-pub/src/index.ts +74 -2
- package/plugins/publishings/x-pub/dist/index.js +274 -44
- package/plugins/publishings/x-pub/dist/profile-check.js +14 -2
- 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 +11 -1
- package/plugins/publishings/xhs-pub/dist/profile-check.js +11 -1
- package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +11 -1
- package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +11 -1
|
@@ -6,19 +6,34 @@
|
|
|
6
6
|
|
|
7
7
|
## 栏目定位
|
|
8
8
|
|
|
9
|
-
「每日AI乱炖」是「咸话咸说」下的 AI
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
「每日AI乱炖」是「咸话咸说」下的 AI 行业新闻栏目,完整名称「咸话咸说之每日AI乱炖」,副题
|
|
10
|
+
「工具、论文与实践随聊」。栏目名突出当天,不是把节目名当成说话人。口播面向通勤路上的白领听众
|
|
11
|
+
(0385 R1:产品、运营、市场、职能岗位,不必是工程师),是 AI 行业动态的新闻播报:先让听众及时
|
|
12
|
+
知道谁、在何时、发布/宣布/披露了什么,再给克制的点评。
|
|
13
|
+
不以任何代称、绰号或「闲聊」包装政治人物本人、武装冲突或与 AI 无关事件主线的内容——这类条目在
|
|
14
|
+
选题/QC 阶段就应被排除(0189 R2;0392 校准口径)。以 AI 为主体的公共政策照常播报:AI 监管立法、
|
|
15
|
+
模型责任与诉讼、出口管制、采购、标准与安全执法都属于栏目范围,不得以「公共政策争议/社会公共事件」
|
|
16
|
+
为由整类排除。选题边界之内的行业动态与机构信息照常播报。身份与
|
|
14
17
|
经历必须真实:只讲真实做过的实测与实践。制作方式由栏目设置说明,口播、正文和 show notes
|
|
15
18
|
不要再附「文字由 AI 辅助整理,音频为 AI 合成配音」或「本期音频为 AI 合成配音」。
|
|
16
19
|
|
|
17
20
|
## 人设与语域
|
|
18
21
|
|
|
19
|
-
-
|
|
22
|
+
- 口语化普通话,第一人称「我」,像一位冷静、有依据的新闻主播:讲清事实,判断有据,不端着。
|
|
20
23
|
- 平实、克制、不炒作:不夸大单一消息的意义,不使用惊叹式渲染或营销话术。
|
|
21
|
-
-
|
|
24
|
+
- 面向白领听众说明「这件事为什么重要」或「怎么用得上」,而不是堆砌术语。
|
|
25
|
+
|
|
26
|
+
## 受众取舍(0385 R1)
|
|
27
|
+
|
|
28
|
+
- 选题按**时效**与**对白领听众的影响**排序:今天发生的、会影响他们用什么工具、成本多少、工作
|
|
29
|
+
方式要不要改动的排前面;纯研究细节、纯工程实现、纯圈内八卦排后面或只留一句。
|
|
30
|
+
- 术语先给白话再说名词:必要术语用一句「也就是说……」解释(例如「推理成本——也就是每次调用
|
|
31
|
+
模型要付的钱」),不展开科普,不堆参数。
|
|
32
|
+
- 深度专题留到周更:日更里一条新闻最多两句机制说明,成篇的原理拆解、选型对比、系统性评测
|
|
33
|
+
不写进当天稿件。
|
|
34
|
+
- 机械核对(0385 AC R2,advisory):计划里出现术语表内的词(`推理引擎`/`上下文缓存`/`微调`/
|
|
35
|
+
`token`/`算子` 等)而同一句没有「也就是说/即/相当于」或括号、破折号解释时,
|
|
36
|
+
`dailynews-gen` 报 `r2:unexplained-jargon`;只提示,不拒稿。
|
|
22
37
|
|
|
23
38
|
## 新闻性、点评与技术细节的平衡(2026-11-08)
|
|
24
39
|
|
|
@@ -34,6 +49,24 @@
|
|
|
34
49
|
KV cache)不展开科普,参数、基准、实现细节择其最关键的一两个。
|
|
35
50
|
- 不重复:同一事实在一条里只讲一次。
|
|
36
51
|
|
|
52
|
+
## 事实、评论与待证推断(0385 R2)
|
|
53
|
+
|
|
54
|
+
文案里三种话必须分得开,听众不看字幕也能听出哪句是事实、哪句是判断:
|
|
55
|
+
|
|
56
|
+
- **可归因事实**:主体 + 动作 + 时间,并交代来源(谁说的、在哪个公告/采访/财报/诉状里)。
|
|
57
|
+
引语只归给原始说话人,不转述成自己的口吻。
|
|
58
|
+
- **评论**:说清「为什么重要」或「接下来看什么」,锚定这一条的具体主体与事实;可以带主语
|
|
59
|
+
「我看」一次,不连用。
|
|
60
|
+
- **待证推断**:还没有证据的猜测(传闻、内部消息、行业推测)不得写成事实。写法只有两种:明确
|
|
61
|
+
归因(据路透社报道、当事人称、公司未证实)或**直接省略**。商业声明(融资金额、用户数、性能
|
|
62
|
+
提升、合规资质)尤其要核查来源:只有当事人自述时按「公司称」归因,并说明未独立核实。
|
|
63
|
+
- 证据不足时的默认动作是省略,不是加对冲词:不写「读者宜另行核实」「仍待验证」这类脚手架话术
|
|
64
|
+
(`banned` 已列),也不把没核实的数字说成整数结论。
|
|
65
|
+
- 机械核对(0385 AC R3,advisory):一条里第一人称评论标记超过一次报 `r3:commentary-repeat`,
|
|
66
|
+
评论标记出现在 `lead` 报 `r3:commentary-in-facts`,`insight` 超过一句报
|
|
67
|
+
`r3:insight-multi-sentence`,`lead` 里的数字/倍数/最-第一-唯一-首个类断言同句没有归因(据/公告/
|
|
68
|
+
财报/公司称/链接)报 `r3:unattributed-claim`。只提示,不拒稿。
|
|
69
|
+
|
|
37
70
|
## 固定开场与收尾
|
|
38
71
|
|
|
39
72
|
开场问候与收尾致谢由 builder 固定输出,计划文本只填充两者之间的内容,节目身份永不漂移:
|
|
@@ -43,14 +76,28 @@
|
|
|
43
76
|
|
|
44
77
|
## 段落角色
|
|
45
78
|
|
|
46
|
-
- `intro
|
|
79
|
+
- `intro`:开场导语,接在固定问候之后,只点名今天最重要的一到两条动态(谁、做了什么),不超过 150 字;不写「今天我想聊聊怎么判断……」式的议题清单,也不在开场铺陈价值判断。口播节奏上,开场是一句问候加一到两句要点,听众要尽快听到第一条新闻。
|
|
47
80
|
- `lead`:一句话口语桥段,引出下一个主题的【标题】;只做铺垫,不得复述标题本身,不用设问句把新闻改写成抽象问题,不超过 80 字。
|
|
48
|
-
- `insight
|
|
49
|
-
- `outro`:简短收束语,接在固定致谢之前,不超过 150
|
|
50
|
-
- `cover`:头版具象视觉内容。字符串形态是英文画面场景(不超过 240 字符,不含文字、数字、商标、旗帜或可辨识真人);
|
|
81
|
+
- `insight`:可选。观点不足、证据单薄或这条本身不需要判断时,允许省略(省略与写成空字符串等价,两者都能通过校验;留空即由 builder 与正文渲染跳过**这句点评**,条目本身照常播报、照常出现在正文里,也不补罐头评论);写了就只基于这一条自身可核事实(2–4 句,短条可压到一句),说清这一条对行业或开发者的意义、或接下来值得关注的节点;不得挪用其他条目的话题,不超过 380 字(这是上限不是目标,常规 150–280 字)。听众刚听完这一条的事实叙述,insight 是点评不是复读:不得复述正文已讲过的事实、数字或成串措辞(最多点到一两个关键词);也不得脱离这条新闻泛泛讲方法论或给通用建议。时长契约:全片按 15–20 分钟口播设计,时长靠覆盖更多条目和完整的事实叙述撑起,不靠拉长点评。字数按配音驱动折算:gemini ≈3.3 字/秒(正文约 4300–5800 字);Voicebox robin-news ≈6.3 字/秒(正文约 5700–7600 字,或增加条目数)。
|
|
82
|
+
- `outro`:简短收束语,接在固定致谢之前,不超过 150 字。跨条目的综评也在这里:当天有真实可归纳的共性才写,价值不够或时长紧张时省略,只留一句收束;不为了「串起来」生造主题,不把综评写成第二个开场。
|
|
83
|
+
- `cover`:头版具象视觉内容。字符串形态是英文画面场景(不超过 240 字符,不含文字、数字、商标、旗帜或可辨识真人);0385 R4 起要冻结节目标题就必须写对象形态 `{ "scene": "…", "headline": "…", "sourceIds": ["<计划条目 id>"] }`:`headline`(必填,不超过 25 字)是本期冻结的**当日要点**,单行白话,不带日期、期号、栏目名;`scene` 可选,沿用同一英文画面契约(缺省时封面图回落默认画面主题);`sourceIds` 可选,写明这条要点依据的计划条目 id(通常是头条),一旦准入把这些条目全部丢弃,这条要点就被撤下而不是带着无依据的标题发布;不写 `sourceIds` 时默认取准入后的头条条目。只写字符串形态不会冻结要点,标题只能回落旧标题。
|
|
51
84
|
- `cards`:小红书图文笔记总标题 `title`(不超过 20 字)与导语 `body`,单条卡片标题 `card.copy`(不超过 12 字)、2–4 条短要点 `card.points`、英文画面 `card.subject`。
|
|
52
85
|
- `social`:面向 X / Threads 的短帖 `short`(不超过 140 字)与面向微博 / LinkedIn 的长帖 `long`(不超过 500 字)。
|
|
53
86
|
|
|
87
|
+
## 节目标题与节目身份(0385 R4)
|
|
88
|
+
|
|
89
|
+
一期节目只有一个身份,由**节目日期**和**一条当日要点**冻结而成,所有发布目标共用,不得各自改写:
|
|
90
|
+
|
|
91
|
+
- 中文发布标题:`第261120期 · 当日要点`——`第<YYMMDD>期` 由节目日期唯一决定(2026-11-20 →
|
|
92
|
+
`第261120期`),要点是当天最重要的一条动态的白话摘要,单行、不超过 25 字,不带日期、期号、
|
|
93
|
+
栏目名(标题前缀已给出)。
|
|
94
|
+
- 封面复用**同一条**要点作为 `cover.headline`,不换一种说法重写;标题和封面共用一份冻结记录
|
|
95
|
+
(`plugins/kk/scripts/episode-identity.ts`),任何渠道都不再自行拼标题。
|
|
96
|
+
- 冻结即固定:重试、补发、历史重放沿用节目中已经冻结的身份(记录写在 Content 的
|
|
97
|
+
`metadata.episodeIdentity`),不会因为这次运行的输入变化而得到第二个标题。
|
|
98
|
+
- 支持源消失即撤稿:如果准入(选题边界、QC、安全)把要点所依据的来源条目去掉,先按留下的条目
|
|
99
|
+
重新生成要点;无法重新生成时**撤下标题与由它派生的封面文案**,不得保留一个没有依据的标题。
|
|
100
|
+
|
|
54
101
|
## 机器可读契约
|
|
55
102
|
|
|
56
103
|
`caps` 是各字段的字数上限;`banned` 是任何计划字段都不得出现的短语——包括旧模板的全部罐头
|
|
@@ -108,3 +108,14 @@ the confirmed live status; otherwise fail naming the switch.
|
|
|
108
108
|
| weibo-pub | none — its session lives in the browser profile (`WEIBO_PROFILE_DIR` overrides the dir; tier: `--profile` > `WEIBO_PROFILE_DIR` > `KK_BROWSER_PROFILE_DIR` > `~/.config/kk/browser-profiles/weibo`) |
|
|
109
109
|
|
|
110
110
|
Missing env → plugin exit 1, `Result.ok false`, error names the variable.
|
|
111
|
+
|
|
112
|
+
## Authoring or repairing a browser rail
|
|
113
|
+
|
|
114
|
+
Do not guess a selector. A browser rail (`plugins/publishings/<plugin>/src/*rail*.ts`,
|
|
115
|
+
`*flow*.ts`) is measured: `kk bot record <bot>` → `kk bot replay <bot> <transcript>` →
|
|
116
|
+
`kk bot codegen <transcript> --plugin <plugin> --operation <op>`, then promote by hand. The receipt
|
|
117
|
+
must come from the recorded submit response, and the rail carries a `// transcript:` header (the
|
|
118
|
+
`rail-transcript-header` rule enforces it). The playbook is
|
|
119
|
+
`plugins/kk/skills/web-automation/SKILL.md` § Scenario E; the contract is
|
|
120
|
+
`docs/design/kk-bot-record-codegen.md`. This skill stays transport-free — it shells these verbs, it
|
|
121
|
+
does not own them.
|
|
@@ -23,7 +23,7 @@ and never report an outcome that was not observed.
|
|
|
23
23
|
| Operation | When | Tier & Substrate | Output |
|
|
24
24
|
| --- | --- | --- | --- |
|
|
25
25
|
| **discover** | New/changed site; "figure out this UI", inspect selectors/shadow roots | **Tier 3** (`kk bot open` + CDP/Playwright) | Evidence dir (`frames/`, `signals.json`) + drift list (`docs/design/<channel>-ui-discovery.md`) |
|
|
26
|
-
| **enhance** | Selectors drifted; a plugin or collection plan fails on a live console | **Tier 2 / 3** (`kk bot exec`, probe script) | Root-cause fix in plugin + updated discovery doc in same commit |
|
|
26
|
+
| **enhance** | Selectors drifted; a plugin or collection plan fails on a live console | **Tier 2 / 3** (`kk bot exec`, `kk bot record`/`replay`, probe script) | Root-cause fix in plugin + updated discovery doc in same commit; a rail change names its transcript |
|
|
27
27
|
| **automate** | Repeatable web task (data collection, form fill, draft save, health audit) | **Tier 1 / 2** (`kk bot exec`, `runBotCollection`) | Bounded Result + captured artifacts (draft-safe by default, fail-closed) |
|
|
28
28
|
|
|
29
29
|
This skill owns **method**. It does not own transport (that belongs to `kind: publish` / `ingestion` plugins) or orchestration
|
|
@@ -239,6 +239,36 @@ await withProfileLease(profileName, async () => {
|
|
|
239
239
|
3. If selector changed, launch `kk bot open <channel>`, observe the updated DOM element.
|
|
240
240
|
4. Update selector in shared helper, re-verify with probe script, commit alongside discovery doc.
|
|
241
241
|
|
|
242
|
+
### Scenario E: Measured Rail Authoring — record → replay → codegen (`enhance`)
|
|
243
|
+
A rail whose selectors were guessed is a rail that will fail live. Measure the session instead.
|
|
244
|
+
|
|
245
|
+
1. **Record** — `kk bot record <bot> -o <file>` opens the bot's saved page headed. Perform the flow
|
|
246
|
+
by hand *up to but not including* the final submit (the transcript is evidence, not a publish).
|
|
247
|
+
Close the window to finish. Typed text is a length marker unless `--include-text`; the transcript
|
|
248
|
+
is 0600 and its URL queries are dropped.
|
|
249
|
+
2. **Read the recording, not the prose** — each step carries a ranked selector
|
|
250
|
+
(`data-testid` > `name` > exact `aria-label` > `role`+exact text > exact text > structural path) or
|
|
251
|
+
an explicit `ambiguous` marker. An `ambiguous` step is a real finding: the site has two visible
|
|
252
|
+
nodes with that attribute, so the flow needs a stronger landmark — re-record after the console is
|
|
253
|
+
in the right state.
|
|
254
|
+
3. **Replay before generating** — `kk bot replay <bot> <transcript>` stops before the submit click
|
|
255
|
+
unless `--submit`, and writes one screenshot plus a `replay.json` row per step. A step that does
|
|
256
|
+
not resolve exactly one visible node fails the run: fix the recording, not the assertion. Cite
|
|
257
|
+
`.spur/run/bot-replay-<bot>/` as evidence in the repair task.
|
|
258
|
+
4. **Generate** — `kk bot codegen <transcript> --plugin <name> --operation <op>` prints a rail
|
|
259
|
+
skeleton; `--apply` writes `<op>-rail.generated.ts` beside the plugin. The receipt is a
|
|
260
|
+
`page.waitForResponse` matcher over the recorded submit response with the id's dot path — never a
|
|
261
|
+
DOM-text comparison. No response in the transcript ⇒ an explicit `TODO receipt` warning, because a
|
|
262
|
+
rail with no receipt reports a publish it cannot prove.
|
|
263
|
+
5. **Promote by hand** — read the generated file against the recording, then move what you accept into
|
|
264
|
+
the live rail. Never ship the generated file as the live rail.
|
|
265
|
+
6. **Name the recording** — the live rail keeps a `// transcript: <repo path>` (or
|
|
266
|
+
`// transcript: none — <reason>`) header; the `rail-transcript-header` rule fails the tree without
|
|
267
|
+
it. Fixtures for offline tests live under
|
|
268
|
+
`packages/publish-harness/tests/fixtures/bot-record/`.
|
|
269
|
+
|
|
270
|
+
Contract detail: `docs/design/kk-bot-record-codegen.md`.
|
|
271
|
+
|
|
242
272
|
---
|
|
243
273
|
|
|
244
274
|
## Safety Rails (Non-Negotiable)
|
|
@@ -71,12 +71,16 @@ states:
|
|
|
71
71
|
- kind: shell
|
|
72
72
|
options:
|
|
73
73
|
# The claim is re-entrant for the same run and is stolen once its TTL has
|
|
74
|
-
# passed
|
|
75
|
-
#
|
|
76
|
-
#
|
|
74
|
+
# passed. The TTL must stay BELOW the 6 h tick cadence (incident 2026-11-15): a run
|
|
75
|
+
# killed between `lock` and `release` — a `spur serve` restart aborts the tick in the
|
|
76
|
+
# queue, so `release-failed` never runs — leaves its claim behind, and a cadence-sized
|
|
77
|
+
# TTL made the very next tick skip instead of steal: the 16:05 tick was killed at
|
|
78
|
+
# 16:16 and the 22:05 tick reported `{"skipped":"locked"}`, costing 12 h of collection
|
|
79
|
+
# instead of one tick. 4 h is still ~20x the observed collect (12-15 min), so a live run
|
|
80
|
+
# is never overtaken. stdout IS the lock contract, and the guard below reads it back:
|
|
77
81
|
# `{"acquired":true}` or `{"skipped":"locked","holder":<run>}` (R1).
|
|
78
82
|
command: >-
|
|
79
|
-
kk lock acquire --name collect --run "${vars.__runId}" --ttl
|
|
83
|
+
kk lock acquire --name collect --run "${vars.__runId}" --ttl 14400000 > "${vars.work_dir}/lock.json"
|
|
80
84
|
|
|
81
85
|
- id: collect
|
|
82
86
|
description: >-
|
|
@@ -70,7 +70,8 @@ vars:
|
|
|
70
70
|
xhs_cards: "4"
|
|
71
71
|
xhs_style: "xhs-knowledge"
|
|
72
72
|
# Same credential surface as the cover pin: the provider/model must be one this machine can
|
|
73
|
-
# actually reach, and each provider renders its own look.
|
|
73
|
+
# actually reach, and each provider renders its own look. This retired workflow stays frozen;
|
|
74
|
+
# the 0379 H3 XHS opt-in lives in kk-daily-ai-voice2 and the consolidated kk news config.
|
|
74
75
|
xhs_provider: "minimax"
|
|
75
76
|
xhs_model: "image-01"
|
|
76
77
|
# ADR-022 rail: draft-box only. "true" posts live and stays a launch-time opt-in.
|
|
@@ -232,9 +233,9 @@ states:
|
|
|
232
233
|
input: |
|
|
233
234
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — metadata.docs (Doc[]) is the translated plan; don't edit it.
|
|
234
235
|
Write a tech-sharing prose article in natural simplified Chinese for the 「AI 乱炖」 column (show 「咸话咸说」, tools/papers/hands-on practice 随聊): no title line (the pipeline computes it), an intro paragraph (2–3 sentences), then one section per item (## numbered title, 2–4 sentences of flowing prose, source link [来源:<label>](<sourceUri>) inline), a closing paragraph tying items together.
|
|
235
|
-
|
|
236
|
+
选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)」。
|
|
236
237
|
事实纪律:每个事实取自该条计划内容,不虚构、不引他处;数字与主体不得放大(如 16 张卡不得写成「几十张卡」,具名主体不得写成「顶级大厂」);引语只能归属其原句主语;保留「据报道/称/承诺」等限定词;导语/收束不加计划外程度词(如「稳定解决」「高维」「治理」);材料不足就少写或不写,不凑数。
|
|
237
|
-
Narrative register — smooth transitions, no list-like bulleting, no scaffold labels
|
|
238
|
+
Narrative register — smooth transitions, no list-like bulleting, no scaffold labels, no hedging labels. 「」 quotes.
|
|
238
239
|
Output the markdown to ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md.
|
|
239
240
|
expectFile: ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md
|
|
240
241
|
allowAppend: false
|
|
@@ -260,7 +261,7 @@ states:
|
|
|
260
261
|
# ADR-115 error tier: keep this prompt <= 1000 chars.
|
|
261
262
|
input: |
|
|
262
263
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of plan docs; don't edit it.
|
|
263
|
-
Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline
|
|
264
|
+
Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline IS a political figure, an armed conflict or a non-AI event, take the first in-scope item instead; an AI-subject public-policy story (AI regulation, model liability/litigation, export controls, procurement, standards and safety enforcement) is in scope — keep it.
|
|
264
265
|
Write one concrete visual scene in English, ≤240 characters, that a viewer would connect to that story: objects, settings, symbols, metaphor.
|
|
265
266
|
No text, letters, numbers, logos, brand marks, flags, or recognizable real people. No style, color, lighting, or composition words — the preset owns those.
|
|
266
267
|
Output strictly valid JSON {"subject": "..."} to ${vars.work_dir}/23-cover/${vars.run_date}_07_cover-brief.json.
|
|
@@ -296,8 +297,8 @@ states:
|
|
|
296
297
|
# ADR-115 error tier: keep this prompt <= 1000 chars.
|
|
297
298
|
input: |
|
|
298
299
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of docs; don't edit it. Also read the style contract ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_style.md and obey its char caps, duration budget and banned phrases.
|
|
299
|
-
For each doc write a `lead` (
|
|
300
|
-
intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both.
|
|
300
|
+
For each doc write a `lead` (spoken bridge, not the title) and an `insight` (only that doc's facts: keep its numbers and hedges(据报道), no new degree words).
|
|
301
|
+
intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both. 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。各在 excluded 配中文原因;读文章 22-article/*_06_article-write_body.md,其文末注记点名的 id 一并进 excluded。
|
|
301
302
|
Output only JSON {"version":1,"intro":"…","outro":"…","items":[{"id":"…","lead":"…","insight":"…"}],"excluded":[{"id":"…","reason":"…"}]} to ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json. Exactly one `items` entry per doc not in `excluded`.
|
|
302
303
|
expectFile: ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
|
|
303
304
|
allowAppend: false
|
|
@@ -481,9 +482,9 @@ states:
|
|
|
481
482
|
input: |
|
|
482
483
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of news docs; don't edit it.
|
|
483
484
|
Take item 1 only (its "title" and "metadata.brief") — the lead story.
|
|
484
|
-
Write an XHS note: "title" (≤20 chars) and "body" (
|
|
485
|
-
Write
|
|
486
|
-
Ground every
|
|
485
|
+
Write an XHS note: "title" (≤20 chars) and "body" (≤1000 Chinese chars, 3-5 hashtags at the end). 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。
|
|
486
|
+
Write ${vars.xhs_cards} cards: card 1 "cover", the rest "content", a final "closing". Each card: "role", "copy" (≤12 chars), "points" (2-4 bullets), "layout", "subject" (English visual scene), "sourcePoint" (the story fact that card uses).
|
|
487
|
+
Ground every field in that story — no invented facts. No text, letters, numbers, logos or real people in "subject".
|
|
487
488
|
Output strictly valid JSON {"title": "...", "body": "...", "cards": [...]} to ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json.
|
|
488
489
|
expectFile: ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json
|
|
489
490
|
allowAppend: false
|
|
@@ -55,8 +55,10 @@ vars:
|
|
|
55
55
|
xhs_enabled: "true"
|
|
56
56
|
xhs_cards: "4"
|
|
57
57
|
xhs_style: "xhs-knowledge"
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
# 0379 K2: the local text-free/composition rehearsal passed; H3 remains an explicit XHS opt-in.
|
|
59
|
+
# Rollback: xhs_provider=minimax, xhs_model=image-01. The cover pin above is unchanged.
|
|
60
|
+
xhs_provider: "h3-local"
|
|
61
|
+
xhs_model: "h3"
|
|
60
62
|
# ADR-022 rail: draft-box only. "true" posts live and stays a launch-time opt-in.
|
|
61
63
|
xhs_live: "false"
|
|
62
64
|
wechat_enabled: "true"
|
|
@@ -389,9 +391,9 @@ nodes:
|
|
|
389
391
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — metadata.docs (Doc[]) is the translated plan; don't edit it.
|
|
390
392
|
Write vivid simplified-Chinese tech news for 咸话咸说之每日AI乱炖 (column 每日AI乱炖, host Robin). No title line. Open with exactly「这里是由Robin为你带来的咸话咸说之每日AI乱炖」。Never「我是咸话咸说」or an AI-production footer. Each ## section: what happened, why it matters, one concrete detail — a human reporter, not a telegram. Inline [来源:<label>](<sourceUri>). Close by tying the items together.
|
|
391
393
|
标题纪律(站点 digest 契约,不满足则 refine 拒绝发布):每个 ## 标题必须以主体起头,第一个逗号/冒号之前的那段不超过 14 个汉字(英文专名与数字各算 1 个字位),且是一个名词短语——如「TSMC 把存储搬进逻辑芯片」「OpenAI 新证明」「Qwen3.5 纯汇编推理」。禁止以动词或「上周/一条/再」这类虚词起头的整句式标题;冒号之后可自由展开。
|
|
392
|
-
|
|
394
|
+
选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)」。
|
|
393
395
|
事实纪律:每个事实取自该条计划内容,不虚构、不引他处;数字与主体不得放大;引语只能归属其原句主语;保留「据报道/称/承诺」等限定词;导语/收束不加计划外程度词;材料不足就少写或不写,不凑数。
|
|
394
|
-
Narrative register — smooth transitions, no list-like bulleting, no scaffold labels
|
|
396
|
+
Narrative register — smooth transitions, no list-like bulleting, no scaffold labels, no hedging labels. 「」 quotes.
|
|
395
397
|
Output the markdown to ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md.
|
|
396
398
|
expectFile: ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md
|
|
397
399
|
allowAppend: false
|
|
@@ -463,7 +465,7 @@ nodes:
|
|
|
463
465
|
# ADR-115 error tier: keep this prompt <= 1000 chars.
|
|
464
466
|
input: |
|
|
465
467
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of plan docs; don't edit it.
|
|
466
|
-
Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline
|
|
468
|
+
Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline IS a political figure, an armed conflict or a non-AI event, take the first in-scope item instead; an AI-subject public-policy story (AI regulation, model liability/litigation, export controls, procurement, standards and safety enforcement) is in scope — keep it.
|
|
467
469
|
Write one concrete visual scene in English, ≤240 characters, that a viewer would connect to that story: objects, settings, symbols, metaphor.
|
|
468
470
|
No text, letters, numbers, logos, brand marks, flags, or recognizable real people. No style, color, lighting, or composition words — the preset owns those.
|
|
469
471
|
Output strictly valid JSON {"subject": "..."} to ${vars.work_dir}/23-cover/${vars.run_date}_07_cover-brief.json.
|
|
@@ -527,7 +529,7 @@ nodes:
|
|
|
527
529
|
input: |
|
|
528
530
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of docs; don't edit it. Also read the style contract ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_style.md and obey its char caps, duration budget and banned phrases.
|
|
529
531
|
For each doc write a `lead` (a spoken bridge, not containing the title) and an `insight` (a take, not a recap: the narration just read that doc's facts — never restate its facts, numbers or wording; give only your angle, judgment or what-to-watch, no new facts, keep hedges(据报道), no new degree words).
|
|
530
|
-
intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both.
|
|
532
|
+
intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both. 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。各在 excluded 配中文原因;读文章 22-article/*_06_article-write_body.md,其文末注记点名的 id 一并进 excluded。
|
|
531
533
|
Output only JSON {"version":1,"intro":"…","outro":"…","items":[{"id":"…","lead":"…","insight":"…"}],"excluded":[{"id":"…","reason":"…"}]} to ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json. Exactly one `items` entry per doc not in `excluded`.
|
|
532
534
|
expectFile: ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
|
|
533
535
|
allowAppend: false
|
|
@@ -767,9 +769,9 @@ nodes:
|
|
|
767
769
|
# ADR-115 error tier: keep this prompt <= 1000 chars.
|
|
768
770
|
input: |
|
|
769
771
|
Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of news docs; don't edit it.
|
|
770
|
-
Plan the whole episode
|
|
771
|
-
Write an XHS note: "title" (≤20 chars) and "body" (Chinese lead paragraph + 3-5 hashtags) — the stage appends one numbered line per image below it.
|
|
772
|
-
Write
|
|
772
|
+
Plan the whole episode; card 1 is the hook.
|
|
773
|
+
Write an XHS note: "title" (≤20 chars) and "body" (Chinese lead paragraph + 3-5 hashtags) — the stage appends one numbered line per image below it. 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。
|
|
774
|
+
Write ${vars.xhs_cards} cards in plan order: card 1 "cover"; one "content" per plan item (max ${vars.xhs_cards} - 2); last "closing". Each card: "role", "copy" (≤12 chars), "points" (2-4 bullets), "layout", "subject" (English visual scene), "sourcePoint" (that item's fact), "itemId" (its "id").
|
|
773
775
|
Ground every field in that item — no invented facts. No writing, letters, numbers, logos or people; screens stay blank.
|
|
774
776
|
Output strictly valid JSON {"title": "...", "body": "...", "cards": [...]} to ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json.
|
|
775
777
|
expectFile: ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json
|