@gobing-ai/knowledge-kit 0.1.20 → 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.
Files changed (115) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/collect/index.js +1 -0
  3. package/dist/board/daily-voice/index.js +1279 -261
  4. package/dist/board/itc/index.js +1 -0
  5. package/dist/index.js +13893 -8995
  6. package/package.json +1 -1
  7. package/plugins/generations/dailynews-gen/dist/index.js +285 -16
  8. package/plugins/generations/dailynews-gen/src/editorial-claims.ts +215 -0
  9. package/plugins/generations/dailynews-gen/src/index.ts +23 -4
  10. package/plugins/generations/dailynews-gen/src/script-builder.ts +10 -3
  11. package/plugins/generations/dailynews-gen/src/script-plan.ts +74 -14
  12. package/plugins/generations/music-gen/README.md +277 -0
  13. package/plugins/generations/music-gen/dist/index.js +23544 -0
  14. package/plugins/generations/music-gen/package.json +24 -0
  15. package/plugins/generations/music-gen/plugin.json +23 -0
  16. package/plugins/generations/music-gen/presets/SOURCE.md +39 -0
  17. package/plugins/generations/music-gen/presets/formats/clip.yaml +21 -0
  18. package/plugins/generations/music-gen/presets/formats/jingle.yaml +22 -0
  19. package/plugins/generations/music-gen/presets/formats/loop.yaml +21 -0
  20. package/plugins/generations/music-gen/presets/formats/song.yaml +31 -0
  21. package/plugins/generations/music-gen/presets/formats/underscore.yaml +22 -0
  22. package/plugins/generations/music-gen/presets/themes/ambient-tech.yaml +30 -0
  23. package/plugins/generations/music-gen/presets/themes/cinematic.yaml +30 -0
  24. package/plugins/generations/music-gen/presets/themes/lofi.yaml +30 -0
  25. package/plugins/generations/music-gen/presets/themes/synthwave.yaml +30 -0
  26. package/plugins/generations/music-gen/scripts/gen-preset-index.ts +181 -0
  27. package/plugins/generations/music-gen/scripts/resolve-preset.ts +64 -0
  28. package/plugins/generations/music-gen/src/adapter/index.ts +35 -0
  29. package/plugins/generations/music-gen/src/adapter/instance.ts +904 -0
  30. package/plugins/generations/music-gen/src/adapter/offline.ts +124 -0
  31. package/plugins/generations/music-gen/src/artifact.ts +223 -0
  32. package/plugins/generations/music-gen/src/audio/checks.ts +618 -0
  33. package/plugins/generations/music-gen/src/audio/master.ts +267 -0
  34. package/plugins/generations/music-gen/src/audio/measure.ts +507 -0
  35. package/plugins/generations/music-gen/src/audio/profile.ts +131 -0
  36. package/plugins/generations/music-gen/src/audio.ts +122 -0
  37. package/plugins/generations/music-gen/src/brief.ts +191 -0
  38. package/plugins/generations/music-gen/src/config.ts +451 -0
  39. package/plugins/generations/music-gen/src/content.ts +199 -0
  40. package/plugins/generations/music-gen/src/digest.ts +100 -0
  41. package/plugins/generations/music-gen/src/index.ts +147 -0
  42. package/plugins/generations/music-gen/src/job.ts +131 -0
  43. package/plugins/generations/music-gen/src/plugin.ts +371 -0
  44. package/plugins/generations/music-gen/src/presets.ts +918 -0
  45. package/plugins/generations/music-gen/src/render.ts +87 -0
  46. package/plugins/generations/music-gen/src/request.ts +102 -0
  47. package/plugins/generations/music-gen/src/spend.ts +495 -0
  48. package/plugins/generations/music-gen/tsconfig.json +8 -0
  49. package/plugins/kk/plugin.json +1 -1
  50. package/plugins/kk/schedules/kk-serve.launchd.plist.tmpl +2 -1
  51. package/plugins/kk/scripts/cover-compositor.ts +380 -32
  52. package/plugins/kk/scripts/daily-cover-mock.ts +40 -3
  53. package/plugins/kk/scripts/daily-stages.ts +659 -20
  54. package/plugins/kk/scripts/episode-identity.ts +180 -0
  55. package/plugins/kk/scripts/kk-workflow-stages.ts +37 -1
  56. package/plugins/kk/scripts/music-stages.ts +624 -0
  57. package/plugins/kk/scripts/news-editorial-ledger.ts +906 -0
  58. package/plugins/kk/scripts/source-citation.ts +187 -0
  59. package/plugins/kk/scripts/topic-selection-attempts.ts +446 -0
  60. package/plugins/kk/scripts/topic-selection-calibration.ts +161 -0
  61. package/plugins/kk/skills/content-judge/SKILL.md +11 -6
  62. package/plugins/kk/skills/content-judge/references/music-quality-rubric.md +147 -0
  63. package/plugins/kk/skills/content-judge/references/rubrics.md +15 -0
  64. package/plugins/kk/skills/content-safety/SKILL.md +12 -0
  65. package/plugins/kk/skills/music-authoring/SKILL.md +276 -0
  66. package/plugins/kk/skills/music-authoring/references/judge-input.md +117 -0
  67. package/plugins/kk/skills/news-editorial/SKILL.md +102 -15
  68. package/plugins/kk/skills/news-editorial/references/selection.md +4 -0
  69. package/plugins/kk/skills/news-editorial/references/style-contract.zh.md +58 -11
  70. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +8 -8
  71. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +7 -7
  72. package/plugins/kk/workflows/kk-music.yaml +328 -0
  73. package/plugins/kk/workflows/kk-news-generate.yaml +58 -3
  74. package/plugins/publishings/bilibili-pub/dist/index.js +11 -1
  75. package/plugins/publishings/bilibili-pub/dist/profile-check.js +11 -1
  76. package/plugins/publishings/cnblogs-pub/dist/index.js +11 -1
  77. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +11 -1
  78. package/plugins/publishings/csdn-pub/dist/index.js +11 -1
  79. package/plugins/publishings/csdn-pub/dist/profile-check.js +11 -1
  80. package/plugins/publishings/infoq-pub/dist/index.js +11 -1
  81. package/plugins/publishings/infoq-pub/dist/profile-check.js +11 -1
  82. package/plugins/publishings/jike-pub/dist/index.js +11 -1
  83. package/plugins/publishings/jike-pub/dist/profile-check.js +11 -1
  84. package/plugins/publishings/juejin-pub/dist/index.js +11 -1
  85. package/plugins/publishings/juejin-pub/dist/profile-check.js +11 -1
  86. package/plugins/publishings/linkedin-pub/dist/index.js +11 -1
  87. package/plugins/publishings/linkedin-pub/dist/profile-check.js +11 -1
  88. package/plugins/publishings/podcast-pub/dist/index.js +586 -20
  89. package/plugins/publishings/podcast-pub/src/corrections.ts +509 -0
  90. package/plugins/publishings/podcast-pub/src/index.ts +257 -5
  91. package/plugins/publishings/podcast-pub/src/show-notes-brief.ts +240 -0
  92. package/plugins/publishings/podcast-pub/src/show-notes.ts +69 -13
  93. package/plugins/publishings/shipinhao-pub/dist/index.js +59 -8
  94. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +11 -1
  95. package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +105 -6
  96. package/plugins/publishings/sspai-pub/dist/index.js +11 -1
  97. package/plugins/publishings/sspai-pub/dist/profile-check.js +11 -1
  98. package/plugins/publishings/substack-pub/dist/index.js +11 -1
  99. package/plugins/publishings/substack-pub/dist/profile-check.js +11 -1
  100. package/plugins/publishings/surfdash-pub/dist/index.js +72 -20
  101. package/plugins/publishings/surfdash-pub/src/digest-check.ts +7 -3
  102. package/plugins/publishings/surfdash-pub/src/index.ts +100 -17
  103. package/plugins/publishings/surfdash-pub/src/topic-claims.ts +3 -1
  104. package/plugins/publishings/threads-pub/dist/index.js +11 -1
  105. package/plugins/publishings/threads-pub/dist/profile-check.js +11 -1
  106. package/plugins/publishings/wechatmp-pub/dist/index.js +11 -1
  107. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +11 -1
  108. package/plugins/publishings/weibo-pub/dist/index.js +11 -1
  109. package/plugins/publishings/weibo-pub/dist/profile-check.js +11 -1
  110. package/plugins/publishings/x-pub/dist/index.js +11 -1
  111. package/plugins/publishings/x-pub/dist/profile-check.js +11 -1
  112. package/plugins/publishings/xhs-pub/dist/index.js +11 -1
  113. package/plugins/publishings/xhs-pub/dist/profile-check.js +11 -1
  114. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +11 -1
  115. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +11 -1
@@ -6,19 +6,34 @@
6
6
 
7
7
  ## 栏目定位
8
8
 
9
- 「每日AI乱炖」是「咸话咸说」下的 AI 技术分享栏目,完整名称「咸话咸说之每日AI乱炖」,副题
10
- 「工具、论文与实践随聊」。栏目名突出当天,不是把节目名当成说话人。口播是开发者视角的 AI
11
- 行业动态与技术分享:先让听众及时知道谁、在何时、发布/宣布/披露了什么,再给克制的点评。
12
- 不以任何代称、绰号或「闲聊」包装政治、外交、军事、公共政策争议或社会公共事件主线的内容——
13
- 这类条目在选题/QC 阶段就应被排除(0189 R2);选题边界之内的行业动态与机构信息照常播报。身份与
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
- - 口语化普通话,第一人称「我」,像一位冷静、有依据的 AI 技术分享主播。
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`:开场导语,点名今天最重要的两三条动态(谁、做了什么),接在固定问候之后,不超过 150 字;不写「今天我想聊聊怎么判断……」式的议题清单。
79
+ - `intro`:开场导语,接在固定问候之后,只点名今天最重要的一到两条动态(谁、做了什么),不超过 150 字;不写「今天我想聊聊怎么判断……」式的议题清单,也不在开场铺陈价值判断。口播节奏上,开场是一句问候加一到两句要点,听众要尽快听到第一条新闻。
47
80
  - `lead`:一句话口语桥段,引出下一个主题的【标题】;只做铺垫,不得复述标题本身,不用设问句把新闻改写成抽象问题,不超过 80 字。
48
- - `insight`:只基于这一条自身可核事实的点评(2–4 句),说清这一条对行业或开发者的意义、或接下来值得关注的节点;不得挪用其他条目的话题,不超过 380 字(这是上限不是目标,常规 150–280 字)。听众刚听完这一条的事实叙述,insight 是点评不是复读:不得复述正文已讲过的事实、数字或成串措辞(最多点到一两个关键词);也不得脱离这条新闻泛泛讲方法论或给通用建议。时长契约:全片按 15–20 分钟口播设计,时长靠覆盖更多条目和完整的事实叙述撑起,不靠拉长点评。字数按配音驱动折算:gemini ≈3.3 字/秒(正文约 4300–5800 字);Voicebox robin-news ≈6.3 字/秒(正文约 5700–7600 字,或增加条目数)。
49
- - `outro`:简短收束语,接在固定致谢之前,不超过 150 字。
50
- - `cover`:头版具象视觉内容。字符串形态是英文画面场景(不超过 240 字符,不含文字、数字、商标、旗帜或可辨识真人);0347 R4 起也可写作对象 `{ "scene": "…", "headline": "…" }` —— `scene` 沿用同一英文画面契约,`headline` 是锚定头条新闻的中文 Hook 大标题(1–2 行,每行不超过 25 字),供下游确定性排版小标题层。
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` 是任何计划字段都不得出现的短语——包括旧模板的全部罐头
@@ -233,9 +233,9 @@ states:
233
233
  input: |
234
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.
235
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.
236
- 选题边界:只写技术内容;某条主线若属政治/外交或贸易管制/军事/公共政策争议/社会公共事件,跳过该条并在文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)、<id>(<原因>)」。
236
+ 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)」。
237
237
  事实纪律:每个事实取自该条计划内容,不虚构、不引他处;数字与主体不得放大(如 16 张卡不得写成「几十张卡」,具名主体不得写成「顶级大厂」);引语只能归属其原句主语;保留「据报道/称/承诺」等限定词;导语/收束不加计划外程度词(如「稳定解决」「高维」「治理」);材料不足就少写或不写,不凑数。
238
- Narrative register — smooth transitions, no list-like bulleting, no scaffold labels (「可做角度」「背景」「潜在影响」), no hedging (「读者宜另行核实」「仍待验证」). 「」 quotes.
238
+ Narrative register — smooth transitions, no list-like bulleting, no scaffold labels, no hedging labels. 「」 quotes.
239
239
  Output the markdown to ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md.
240
240
  expectFile: ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md
241
241
  allowAppend: false
@@ -261,7 +261,7 @@ states:
261
261
  # ADR-115 error tier: keep this prompt <= 1000 chars.
262
262
  input: |
263
263
  Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of plan docs; don't edit it.
264
- Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline is public affairs (politics/diplomacy, trade controls, military, policy disputes, social events), take the first in-scope item instead.
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.
265
265
  Write one concrete visual scene in English, ≤240 characters, that a viewer would connect to that story: objects, settings, symbols, metaphor.
266
266
  No text, letters, numbers, logos, brand marks, flags, or recognizable real people. No style, color, lighting, or composition words — the preset owns those.
267
267
  Output strictly valid JSON {"subject": "..."} to ${vars.work_dir}/23-cover/${vars.run_date}_07_cover-brief.json.
@@ -297,8 +297,8 @@ states:
297
297
  # ADR-115 error tier: keep this prompt <= 1000 chars.
298
298
  input: |
299
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.
300
- For each doc write a `lead` (a spoken bridge, not containing the title) and an `insight` (grounded only in that doc's facts: keep its numbers and hedges(据报道), add no new degree words like「高预算穷举」).
301
- intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both. 选题边界:政治/外交、贸易管制、军事、公共政策争议、社会公共事件条目绝不复述;读文章 22-article/*_06_article-write_body.md,其文末注记点名的 id 一并进 excluded,各配中文原因。
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。
302
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`.
303
303
  expectFile: ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
304
304
  allowAppend: false
@@ -482,9 +482,9 @@ states:
482
482
  input: |
483
483
  Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of news docs; don't edit it.
484
484
  Take item 1 only (its "title" and "metadata.brief") — the lead story.
485
- Write an XHS note: "title" (≤20 chars) and "body" (Chinese note ≤1000 chars, ending with 3-5 hashtags). 选题边界:公共事务主线不写入,只写技术内容。
486
- Write exactly ${vars.xhs_cards} cards: card 1 role "cover", the rest "content", except a final "closing". Each card carries "role", "copy" (Chinese on-card headline ≤12 chars), "points" (2-4 short Chinese bullets), "layout", "subject" (one concrete English visual scene), "sourcePoint" (the lead-story fact that card uses).
487
- Ground every "copy", "points" and "sourcePoint" in that story — no invented facts. No text, letters, numbers, logos or real people in "subject".
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".
488
488
  Output strictly valid JSON {"title": "...", "body": "...", "cards": [...]} to ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json.
489
489
  expectFile: ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json
490
490
  allowAppend: false
@@ -391,9 +391,9 @@ nodes:
391
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.
392
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.
393
393
  标题纪律(站点 digest 契约,不满足则 refine 拒绝发布):每个 ## 标题必须以主体起头,第一个逗号/冒号之前的那段不超过 14 个汉字(英文专名与数字各算 1 个字位),且是一个名词短语——如「TSMC 把存储搬进逻辑芯片」「OpenAI 新证明」「Qwen3.5 纯汇编推理」。禁止以动词或「上周/一条/再」这类虚词起头的整句式标题;冒号之后可自由展开。
394
- 选题边界:只写技术内容;某条主线若属政治/外交或贸易管制/军事/公共政策争议/社会公共事件,跳过该条并在文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)、<id>(<原因>)」。
394
+ 选题边界:只写 AI 主题;主线是政治人物本人、武装冲突或非 AI 事件就跳过;AI 监管、模型责任与诉讼、出口管制、采购、标准与安全执法属 AI 主题公共政策,照常写入。文末加一行「> 注:<N> 条条目因选题边界未写入:<id>(<原因>)」。
395
395
  事实纪律:每个事实取自该条计划内容,不虚构、不引他处;数字与主体不得放大;引语只能归属其原句主语;保留「据报道/称/承诺」等限定词;导语/收束不加计划外程度词;材料不足就少写或不写,不凑数。
396
- Narrative register — smooth transitions, no list-like bulleting, no scaffold labels (「可做角度」「背景」「潜在影响」), no hedging (「读者宜另行核实」「仍待验证」). 「」 quotes.
396
+ Narrative register — smooth transitions, no list-like bulleting, no scaffold labels, no hedging labels. 「」 quotes.
397
397
  Output the markdown to ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md.
398
398
  expectFile: ${vars.work_dir}/22-article/${vars.run_date}_06_article-write_body.md
399
399
  allowAppend: false
@@ -465,7 +465,7 @@ nodes:
465
465
  # ADR-115 error tier: keep this prompt <= 1000 chars.
466
466
  input: |
467
467
  Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of plan docs; don't edit it.
468
- Take item 1 only (its "title" and "metadata.brief") — the episode's lead story. If item 1's mainline is public affairs (politics/diplomacy, trade controls, military, policy disputes, social events), take the first in-scope item instead.
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.
469
469
  Write one concrete visual scene in English, ≤240 characters, that a viewer would connect to that story: objects, settings, symbols, metaphor.
470
470
  No text, letters, numbers, logos, brand marks, flags, or recognizable real people. No style, color, lighting, or composition words — the preset owns those.
471
471
  Output strictly valid JSON {"subject": "..."} to ${vars.work_dir}/23-cover/${vars.run_date}_07_cover-brief.json.
@@ -529,7 +529,7 @@ nodes:
529
529
  input: |
530
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.
531
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).
532
- intro/outro hook only in-scope items; no greeting or sign-off — the builder adds both. 选题边界:政治/外交、贸易管制、军事、公共政策争议、社会公共事件条目绝不复述;读文章 22-article/*_06_article-write_body.md,其文末注记点名的 id 一并进 excluded,各配中文原因。
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。
533
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`.
534
534
  expectFile: ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
535
535
  allowAppend: false
@@ -769,9 +769,9 @@ nodes:
769
769
  # ADR-115 error tier: keep this prompt <= 1000 chars.
770
770
  input: |
771
771
  Read ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json — a JSON array of news docs; don't edit it.
772
- Plan the whole episode, not the lead item alone. Card 1 is the episode 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. 选题边界:公共事务主线不写入,只写技术内容。
774
- Write exactly ${vars.xhs_cards} cards in plan order: card 1 "cover"; one "content" card per plan item, up to ${vars.xhs_cards} - 2 of them; the last "closing". Each card carries "role", "copy" (Chinese headline ≤12 chars), "points" (2-4 short Chinese bullets), "layout", "subject" (one concrete English visual scene), "sourcePoint" (that item's fact) and "itemId" (its "id").
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").
775
775
  Ground every field in that item — no invented facts. No writing, letters, numbers, logos or people; screens stay blank.
776
776
  Output strictly valid JSON {"title": "...", "body": "...", "cards": [...]} to ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json.
777
777
  expectFile: ${vars.work_dir}/25-xhs/${vars.run_date}_18_xhs_plan.json
@@ -0,0 +1,328 @@
1
+ ---
2
+ # kk-music — one idea → a measured, judged, loudness-normalized take (feature D8, task 0403).
3
+ #
4
+ # prepare → brief → explore → select → analyze → check → judge → master → finalize → done
5
+ # ↘ failed
6
+ #
7
+ # **The spend shape (R2).** `explore` authors-or-adopts one brief per direction and takes exactly
8
+ # ONE take per brief in the FORMAT's own model (the preset names it: pro for song/jingle/underscore,
9
+ # clip for clip/loop). There is no Clip→Pro explore: a Clip render is a different model and cannot
10
+ # exhibit arrangement, structure timing or lyrics past 0:30. `select` is the only operator gate;
11
+ # `auto` skips it only when exactly one take exists (one take is not a choice). `analyze` runs on
12
+ # the selected take only. A brief whose take is already on disk is adopted by `music-stages.ts`, so
13
+ # re-running `explore` into the same run directory pays for nothing (0400's digest dedupe is the
14
+ # backstop), and anything else needs `force` + `force_reason`.
15
+ #
16
+ # **The gate order (R3).** `check` (`kk music check`, 0405 take checks) exits 0 before `judge`;
17
+ # `judge` is one `agent.run` on kk:content-judge with the `music-quality` rubric, routed through the
18
+ # same confidence-aware jq filter every kk judge gate uses (a `PASS` without a HIGH/MEDIUM/LOW
19
+ # confidence is `PASS!`, which no accept guard matches); `master` is reached only on `PASS`, or on
20
+ # `NEEDS_REVISION` with `accept_revision=true`; and `master` (0405's delivery check) exits 0 before
21
+ # `finalize`. A failing action aborts the run as failed at that state (the engine's default
22
+ # onError), which is what keeps an unmeasured take out of the judge and a failed file out of the
23
+ # report — the explicit `failed` edges below are the judgement route.
24
+ #
25
+ # **ADR-115.** Each shell action is one bounded call: a `kk music` verb, or one `kk stage run
26
+ # music-*` subcommand whose body lives in `plugins/kk/scripts/music-stages.ts` (fan-out and bundle
27
+ # assembly are verbs here, never YAML). Both `agent.run` prompts are skill invocations under the
28
+ # 1000-character cap and paste no brief, no rows and no rubric.
29
+ #
30
+ # **Resume (R5).** Every state is artifact-gated: briefs, prompt text, take sidecars, the analysis,
31
+ # `checks.json`, the judge bundle and the verdict all survive a failure, so a resumed run continues
32
+ # from the first artifact that is missing and never re-pays for a take that is on disk.
33
+ "$schema": "@gobing-ai/spur/schemas/state-machine-workflow.schema.json"
34
+ name: kk-music
35
+ kind: state-machine
36
+ description: >-
37
+ One musical idea into one delivered take: author differentiated briefs, explore them in the
38
+ format's own model, let the operator pick, analyze and measure that take, judge it against the
39
+ music-quality rubric, loudness-normalize it to a delivery profile and report the run.
40
+ initialState: prepare
41
+ terminalStates:
42
+ - done
43
+ - failed
44
+ failureStates:
45
+ - failed
46
+ iterationBound: 12
47
+ vars:
48
+ # --- the idea (R1): a one-line topic, or an existing idea/brief file ---
49
+ topic: ""
50
+ idea_file: ""
51
+ # --- the musical direction: shipped format + theme presets (`kk music presets`) ---
52
+ format: "song"
53
+ theme: ""
54
+ # --- the run directory: <works>/kk-music/<topic-slug>/ ---
55
+ works: ".works"
56
+ run_dir: ""
57
+ # --- spend shape: differentiated briefs to explore (default 2, never above music.takesCap) ---
58
+ directions: "2"
59
+ # --- who runs the authoring and judging agent.run steps ---
60
+ agent: ""
61
+ # --- delivery: the loudness profile `kk music master` normalizes to ---
62
+ delivery_profile: "streaming"
63
+ # --- gates ---
64
+ auto: "false"
65
+ accept_revision: "false"
66
+ force: "false"
67
+ force_reason: ""
68
+ # --- free rehearsal: KK_MUSIC_DRY_RUN=1 for every paid verb (offline adapter, no network) ---
69
+ dry_run: "false"
70
+ # --- projected from the run directory, never authored by hand ---
71
+ take_file: ""
72
+ instance_id: ""
73
+ brief_number: ""
74
+ verdict: ""
75
+ __runId: ""
76
+ __hitlAnswer: ""
77
+
78
+ states:
79
+ - id: prepare
80
+ description: >-
81
+ Resolve <works>/kk-music/<topic-slug>/, stage 1-brief/ and 3-takes/, write idea.md and publish
82
+ the run-bound path this workflow projects into vars.run_dir. No instance traffic.
83
+ onEnter:
84
+ - kind: shell
85
+ options:
86
+ command: >-
87
+ kk stage run music-prepare "${vars.works}" "${vars.topic}" "${vars.idea_file}"
88
+ "${vars.format}" "${vars.theme}" "${vars.directions}" "${vars.force}" "${vars.__runId}"
89
+ - kind: file.read.into-var
90
+ options:
91
+ path: ".spur/run/${vars.__runId}-music-run-dir.txt"
92
+ var: run_dir
93
+
94
+ - id: brief
95
+ description: >-
96
+ Author `directions` differentiated briefs and render each one's prompt text (agent.run on
97
+ kk:music-authoring). Free: render opens no socket. Existing briefs are reused verbatim.
98
+ onEnter:
99
+ - kind: agent.run
100
+ options:
101
+ role: scribe
102
+ agent: ${vars.agent}
103
+ input: |
104
+ Invoke the kk:music-authoring skill, operation `brief`.
105
+ Run directory: ${vars.run_dir} — idea at ${vars.run_dir}/idea.md.
106
+ Format ${vars.format}, theme ${vars.theme}, ${vars.directions} differentiated direction(s).
107
+ For each number 01..0${vars.directions}: write 1-brief/brief-<nn>.yaml in the 0397 authoring form
108
+ (takes: 1, no invented keys) and render it — kk music render --in 1-brief/brief-<nn>.yaml
109
+ --out 1-brief/brief-<nn>.prompt.txt, stdout into 1-brief/brief-<nn>.render.txt.
110
+ Reuse any brief-<nn>.yaml that already exists verbatim; never edit an authored brief.
111
+ Do not call kk music gen: exploring is the next state's job.
112
+ expectFile: ${vars.run_dir}/1-brief/brief-01.prompt.txt
113
+ - kind: shell
114
+ options:
115
+ command: >-
116
+ test -f "${vars.run_dir}/1-brief/brief-${vars.directions}.yaml" &&
117
+ test -f "${vars.run_dir}/1-brief/brief-${vars.directions}.prompt.txt"
118
+
119
+ - description: >-
120
+ One take per differentiated brief, in the format's own model. A brief whose sidecar and take
121
+ are on disk is adopted (no request); a digest already paid for refuses without force+reason.
122
+ id: explore
123
+ onEnter:
124
+ - kind: shell
125
+ options:
126
+ command: >-
127
+ kk stage run music-explore "${vars.run_dir}" "${vars.directions}" "${vars.force}"
128
+ "${vars.force_reason}" "${vars.dry_run}" "${vars.__runId}"
129
+
130
+ - id: select
131
+ description: "The only operator gate: pick which take becomes the deliverable (skipped by `auto` only when one take exists)"
132
+ pause: true
133
+ onEnter:
134
+ - kind: hitl.select
135
+ options:
136
+ prompt: >-
137
+ Pick the take to deliver from ${vars.run_dir}/3-takes/ — 01..0${vars.directions}. Each take's
138
+ prompt text is at 1-brief/brief-<nn>.prompt.txt and its spend is in 3-takes/explore.json.
139
+ options:
140
+ - "01"
141
+ - "02"
142
+ - "03"
143
+ - "04"
144
+ var: __hitlAnswer
145
+ # No auto path skips this state except the single-take route below, so the gate asks.
146
+ decision:
147
+ mode: never
148
+ - kind: shell
149
+ options:
150
+ command: >-
151
+ kk stage run music-select "${vars.run_dir}" "${vars.__hitlAnswer}" "${vars.auto}"
152
+ - kind: file.read.into-var
153
+ options:
154
+ path: ${vars.run_dir}/3-takes/.brief
155
+ var: brief_number
156
+
157
+ - id: analyze
158
+ description: >-
159
+ Bind the selected take (already bound by explore when there is exactly one) and pay for that
160
+ take's instance analysis once. A cached analysis-<instanceId>.json is adopted, never re-bought.
161
+ onEnter:
162
+ - kind: shell
163
+ options:
164
+ command: 'kk stage run music-select "${vars.run_dir}" "" "${vars.auto}"'
165
+ - kind: file.read.into-var
166
+ options:
167
+ path: ${vars.run_dir}/3-takes/.take-file
168
+ var: take_file
169
+ - kind: file.read.into-var
170
+ options:
171
+ path: ${vars.run_dir}/3-takes/.instance-id
172
+ var: instance_id
173
+ - kind: file.read.into-var
174
+ options:
175
+ path: ${vars.run_dir}/3-takes/.brief
176
+ var: brief_number
177
+ - kind: shell
178
+ options:
179
+ command: 'kk stage run music-analyze "${vars.run_dir}" "${vars.dry_run}"'
180
+
181
+ - id: check
182
+ description: >-
183
+ Measure the selected take (0405 take checks: duration band, leading/trailing silence, analysis
184
+ present, warn-only brief agreement) and write <take>.checks.json. A fail row exits 1, so no
185
+ unmeasured take reaches the judge.
186
+ onEnter:
187
+ - kind: shell
188
+ options:
189
+ command: >-
190
+ kk music check "${vars.run_dir}/3-takes/${vars.take_file}"
191
+ --brief "${vars.run_dir}/1-brief/brief-${vars.brief_number}.yaml"
192
+
193
+ - id: judge
194
+ description: >-
195
+ Assemble 4-judge-input.md from the five verbatim inputs once checks are clean, then judge the
196
+ take against the music-quality rubric (agent.run on kk:content-judge).
197
+ onEnter:
198
+ - kind: shell
199
+ options:
200
+ command: 'kk stage run music-judge-input "${vars.run_dir}"'
201
+ - kind: agent.run
202
+ options:
203
+ role: reviewer
204
+ agent: ${vars.agent}
205
+ input: |
206
+ Invoke the kk:content-judge skill with rubric `music-quality`.
207
+ content_path: ${vars.run_dir}/4-judge-input.md
208
+ content_ref: ${vars.run_dir}/3-takes/${vars.take_file}
209
+ verdict_path: ${vars.run_dir}/4-verdict-music.json
210
+ Grade only what the bundle shows; every measurement is quoted from checks.json with its
211
+ unit and source, never re-derived and never scored by ear. Emit the existing verdict
212
+ contract (verdict, confidence HIGH|MEDIUM|LOW, rubric, findings[], content_ref) and no
213
+ second verdict file.
214
+ expectFile: ${vars.run_dir}/4-verdict-music.json
215
+
216
+ - id: master
217
+ description: >-
218
+ Loudness-normalize the selected take to the delivery profile (0405). The post-master delivery
219
+ check is the last word: a delivery miss exits 1 and never reaches finalize.
220
+ onEnter:
221
+ - kind: shell
222
+ options:
223
+ command: >-
224
+ kk music master "${vars.run_dir}/3-takes/${vars.take_file}" --profile "${vars.delivery_profile}"
225
+
226
+ - id: finalize
227
+ description: >-
228
+ Write the run report: spend summed from the take sidecars, instance ids, verdict, the delivery
229
+ profile with its measured LUFS/true peak, and the final artifact path (R4).
230
+ onEnter:
231
+ - kind: shell
232
+ options:
233
+ command: >-
234
+ kk stage run music-finalize "${vars.run_dir}" "${vars.delivery_profile}" "${vars.format}"
235
+ "${vars.__runId}"
236
+
237
+ - id: done
238
+ description: "Terminal — the take is measured, judged PASS, normalized and reported."
239
+ - id: failed
240
+ description: >-
241
+ Terminal — the verdict refused the take (FAIL, an out-of-contract PASS, or NEEDS_REVISION
242
+ without accept_revision). A failing deterministic action fails the run at its own state.
243
+
244
+ transitions:
245
+ - from: prepare
246
+ to: brief
247
+ description: "Run directory staged and idea.md written -> author the briefs"
248
+ guard:
249
+ kind: always
250
+
251
+ - from: brief
252
+ to: explore
253
+ description: "Every direction has a brief and a rendered prompt -> take one take per brief"
254
+ guard:
255
+ kind: always
256
+
257
+ - from: explore
258
+ to: analyze
259
+ description: "auto with exactly one take -> the single take is not a choice, skip the operator gate"
260
+ guard:
261
+ kind: shell
262
+ options:
263
+ command: >-
264
+ test "${vars.auto}" = "true" &&
265
+ jq -e '.takes == 1' "${vars.run_dir}/3-takes/explore.json" >/dev/null
266
+
267
+ - from: explore
268
+ to: select
269
+ description: "Takes on disk -> pause for the operator's pick (always, when there is more than one take)"
270
+ guard:
271
+ kind: always
272
+
273
+ - from: select
274
+ to: analyze
275
+ description: "A take was selected -> bind and analyze that take only"
276
+ guard:
277
+ kind: always
278
+
279
+ - from: analyze
280
+ to: check
281
+ description: "The selected take's analysis is on disk -> measure it"
282
+ guard:
283
+ kind: always
284
+
285
+ - from: check
286
+ to: judge
287
+ description: "Every take check passed (checks.json has no fail row) -> assemble the bundle and judge"
288
+ guard:
289
+ kind: always
290
+
291
+ - from: judge
292
+ to: master
293
+ description: "PASS with a HIGH/MEDIUM/LOW confidence -> normalize"
294
+ guard:
295
+ kind: shell
296
+ options:
297
+ command: >-
298
+ v="$(jq -r 'if (.verdict // "") == "PASS" then (.verdict + (if ((.confidence // "") | test("^(HIGH|MEDIUM|LOW)$")) then "" else "!" end)) else (.verdict // "") end' ${vars.run_dir}/4-verdict-music.json 2>/dev/null)";
299
+ test "$v" = PASS
300
+
301
+ - from: judge
302
+ to: master
303
+ description: "NEEDS_REVISION with accept_revision=true -> normalize the take as it is"
304
+ guard:
305
+ kind: shell
306
+ options:
307
+ command: >-
308
+ v="$(jq -r 'if (.verdict // "") == "PASS" then (.verdict + (if ((.confidence // "") | test("^(HIGH|MEDIUM|LOW)$")) then "" else "!" end)) else (.verdict // "") end' ${vars.run_dir}/4-verdict-music.json 2>/dev/null)";
309
+ test "$v" = NEEDS_REVISION && test "${vars.accept_revision}" = "true"
310
+
311
+ - from: judge
312
+ to: failed
313
+ terminalReason: failed-guard
314
+ description: "FAIL, an out-of-contract PASS, or NEEDS_REVISION without accept_revision -> block master"
315
+ guard:
316
+ kind: always
317
+
318
+ - from: master
319
+ to: finalize
320
+ description: "Delivery check passed on the encoded output -> report the run"
321
+ guard:
322
+ kind: always
323
+
324
+ - from: finalize
325
+ to: done
326
+ description: "Run report written -> complete"
327
+ guard:
328
+ kind: always
@@ -91,7 +91,10 @@ nodes:
91
91
  --in ${vars.work_dir}/21-plan/${vars.run_date}_04_quality-control-content_candidates.json (metadata.docs is the candidate Doc[]; don't edit it)
92
92
  --out-plan ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json
93
93
  --out-excluded ${vars.work_dir}/21-plan/${vars.run_date}_03_curate_excluded.json
94
- Deliver both JSON files with your file-write tool (a headless sandbox may block shell writes).
94
+ Then follow mode `align` (SKILL.md) and deliver ${vars.work_dir}/21-plan/${vars.run_date}_judgment-proposal.json:
95
+ evidence-backed judgments over the SAME selected ids, superseding (never rewriting) an aired one;
96
+ no new evidence = {"version":1,"judgments":[]}. Ledger for reference: ${vars.work_dir}/../conclusion.md
97
+ Deliver all three JSON files with your file-write tool (a headless sandbox may block shell writes).
95
98
  expectFile: ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json
96
99
  allowAppend: false
97
100
 
@@ -135,7 +138,7 @@ nodes:
135
138
  allowAppend: false
136
139
 
137
140
  - id: curate-final
138
- description: "`generate-check --step curate --final`: the documented fallback — untranslated candidates with `[]` exclusions — when the fix pass still fails"
141
+ description: "`generate-check --step curate --final`: the documented fallback — untranslated candidates with `[]` exclusions — when the fix pass still fails; also commits the editorial judgment ledger (0384), the deterministic alignment entry before `script-write`"
139
142
  dependsOn: [curate-check, curate-fix]
140
143
  condition:
141
144
  kind: shell
@@ -167,6 +170,9 @@ nodes:
167
170
  --in ${vars.work_dir}/21-plan/${vars.run_date}_03_plan_plan.json (don't edit it)
168
171
  --excluded ${vars.work_dir}/21-plan/${vars.run_date}_03_curate_excluded.json
169
172
  --out ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
173
+ Draft from the frozen judgments at ${vars.work_dir}/21-plan/${vars.run_date}_judgment-snapshot.json (never the live
174
+ ledger): acknowledge any correction it carries openly (error, apology, corrected fact), and never restate
175
+ a superseded claim.
170
176
  Output only the JSON file.
171
177
  expectFile: ${vars.work_dir}/24-script/${vars.run_date}_08_script-write_plan.json
172
178
  allowAppend: false
@@ -291,6 +297,55 @@ nodes:
291
297
  test "${vars.skip_review}" != "true"
292
298
  && grep -q "status.*PASS" "${vars.work_dir}/pool-gate.json" 2>/dev/null
293
299
 
300
+ # ── 13a. localize: en/ja translations of the reviewed zh article, before the freeze ────────
301
+ - id: localize
302
+ description: >-
303
+ Translate the reviewed zh article into en/ja (0409 R1) and write
304
+ `22-article/locales/{en,ja}.md` (first line `# <title>`, rest the body). The site's publish
305
+ orchestrator refuses a `sub-category:ai-daily` post whose locale set is incomplete, and the
306
+ translations must exist BEFORE the freeze so the variant — hence the variants safety review
307
+ and the freeze digest — covers exactly the bytes that publish (ADR-053). Translating here,
308
+ not in the plugin, keeps the model call in the workflow and the plugin deterministic.
309
+ dependsOn: [render, review]
310
+ condition:
311
+ kind: shell
312
+ options:
313
+ command: 'grep -q "status.*PASS" "${vars.work_dir}/pool-gate.json" 2>/dev/null'
314
+ action:
315
+ kind: agent.run
316
+ options:
317
+ role: scribe
318
+ agent: ${vars.agent}
319
+ timeoutMs: 900000
320
+ # ADR-115 error tier: keep this prompt <= 1000 chars.
321
+ input: |
322
+ Translate the daily AI digest article into English and Japanese (task 0409).
323
+ Source: ${vars.work_dir}/22-article/${vars.run_date}_06_article_content.json (title, body).
324
+ Write TWO plain markdown files with your file-write tool (a headless sandbox may block shell writes):
325
+ ${vars.work_dir}/22-article/locales/en.md and ${vars.work_dir}/22-article/locales/ja.md
326
+ Each file: first line `# <translated title>`, then a blank line, then the translated body.
327
+ Keep every code block, URL, model name, company name and reference intact; translate prose only.
328
+ English: natural tech-journalism English. Japanese: natural です・ます tech-journalism Japanese.
329
+ Neither file may contain Chinese text — a zh draft under /en/ or /ja/ fails the gate.
330
+ expectFile: ${vars.work_dir}/22-article/locales/ja.md
331
+ allowAppend: false
332
+
333
+ - id: localize-check
334
+ description: >-
335
+ `news-localize-validate` (0409 R1): a deterministic gate on the two translations — missing,
336
+ empty, untitled, or untranslated (a zh document under en/ja) fails the run HERE, before the
337
+ variants are built and long before `surfdash-pub` would hit the site's opaque
338
+ "missing locale file(s)". No `onError: continue`: a half-localized day must not freeze.
339
+ dependsOn: [localize]
340
+ condition:
341
+ kind: shell
342
+ options:
343
+ command: 'grep -q "status.*PASS" "${vars.work_dir}/pool-gate.json" 2>/dev/null'
344
+ action:
345
+ kind: shell
346
+ options:
347
+ command: 'kk stage news-localize-validate "${vars.work_dir}"'
348
+
294
349
  # ── 14–16. voice: one engine per attempt, the fallback chain visible in the graph ───────────
295
350
  - id: voice
296
351
  description: >-
@@ -359,7 +414,7 @@ nodes:
359
414
  `daily-safety-manifest` in one process: `31-publish/` prep, `30-variants/*` payloads and the
360
415
  manifest the nested variants review registers. Two stages, because the review of those
361
416
  variants has to run between them and a nested workflow call cannot live inside a verb.
362
- dependsOn: [voice, voice-fallback, voice-fallback2, cards]
417
+ dependsOn: [voice, voice-fallback, voice-fallback2, cards, localize-check]
363
418
  condition:
364
419
  kind: shell
365
420
  options: