@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
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Replayable calibration harness for the daily topic/selection boundary (task 0392 R1).
3
+ *
4
+ * The problem the task names: the deterministic floor (`topic-boundary.json`, since 2026-10-22 the
5
+ * single `prc-leadership` rule) is narrow, but the editorial Agent still excluded whole
6
+ * public-affairs classes (`plugins/kk/skills/news-editorial/SKILL.md` "Topic boundary"), so the
7
+ * shipped policy excluded AI-industry mainlines — regulation, litigation, export controls,
8
+ * procurement — that the column exists to cover. Narrowing that policy by opinion is how 0189's
9
+ * five broad rules happened. This module makes the calibration evidence-based: every sample is a
10
+ * TAGGED fixture (historical exclusion / counterexample) with an expected verdict, replayed against
11
+ * the spec in force, so a rule change that re-breaks a known-good AI story fails a test.
12
+ *
13
+ * Fixtures are data (`tests/fixtures/topic-selection-cases.json`), not code, so the record of which
14
+ * historical exclusions were replayed — and under which rule they once hit — survives without
15
+ * editing a prompt.
16
+ *
17
+ * Node/Bun builtins only plus the sibling boundary engine.
18
+ */
19
+ import { applyTopicBoundary, type TopicBoundarySpec } from './kk-workflow-stages.ts';
20
+
21
+ /** `historical` = a real prior exclusion; `counterexample` = a sample the policy must NOT drop. */
22
+ export type CalibrationTag = 'historical' | 'counterexample';
23
+
24
+ export interface CalibrationCaseDoc {
25
+ id: string;
26
+ title: string;
27
+ body: string;
28
+ publishedAt?: string;
29
+ }
30
+
31
+ export interface CalibrationCase {
32
+ id: string;
33
+ tag: CalibrationTag;
34
+ /** Where the sample came from (run id, store item, date) — the audit trail. */
35
+ source: string;
36
+ /** What this case proves, in one line. */
37
+ note: string;
38
+ doc: CalibrationCaseDoc;
39
+ expect: 'kept' | 'excluded';
40
+ /** Rule id expected to exclude it; absent when `expect === 'kept'`. */
41
+ expectRule?: string;
42
+ }
43
+
44
+ export interface CalibrationCaseResult {
45
+ id: string;
46
+ tag: CalibrationTag;
47
+ note: string;
48
+ expected: 'kept' | 'excluded';
49
+ actual: 'kept' | 'excluded';
50
+ rule: string | null;
51
+ matched: string | null;
52
+ agrees: boolean;
53
+ }
54
+
55
+ export interface CalibrationSummary {
56
+ cases: number;
57
+ kept: number;
58
+ excluded: number;
59
+ /** Rule id → hits across all replayed cases. */
60
+ perRuleHits: Record<string, number>;
61
+ /** Unique candidate IDs excluded — the count the report must use, not `ruleHits`. */
62
+ uniqueIds: number;
63
+ ruleHits: number;
64
+ mismatches: CalibrationCaseResult[];
65
+ /** tag → case/mismatch counts, so a regression names which sample class broke. */
66
+ byTag: Record<CalibrationTag, { cases: number; mismatches: number }>;
67
+ passes: boolean;
68
+ }
69
+
70
+ /** Replay every fixture through the boundary spec in force, recording the verdict and the rule. */
71
+ export function replayCalibrationCases(
72
+ cases: CalibrationCase[],
73
+ spec: TopicBoundarySpec,
74
+ runDate = '20261117',
75
+ ): CalibrationCaseResult[] {
76
+ return cases.map((entry) => {
77
+ // `applyTopicBoundary` reads `publishedAt` from `metadata` (the store's Doc shape); the
78
+ // fixtures keep it flat on the sample so a reviewer can read one line per case.
79
+ const doc = {
80
+ id: entry.doc.id,
81
+ title: entry.doc.title,
82
+ body: entry.doc.body,
83
+ metadata: entry.doc.publishedAt === undefined ? {} : { publishedAt: entry.doc.publishedAt },
84
+ };
85
+ const { excluded } = applyTopicBoundary([doc], runDate, spec);
86
+ const hit = excluded[0];
87
+ const actual: 'kept' | 'excluded' = hit === undefined ? 'kept' : 'excluded';
88
+ const rule = hit?.rule ?? null;
89
+ const agrees = actual === entry.expect && (entry.expectRule === undefined || entry.expectRule === rule);
90
+ return {
91
+ id: entry.id,
92
+ tag: entry.tag,
93
+ note: entry.note,
94
+ expected: entry.expect,
95
+ actual,
96
+ rule,
97
+ matched: hit?.matched ?? null,
98
+ agrees,
99
+ };
100
+ });
101
+ }
102
+
103
+ /** Fold per-case results into the numbers the calibration record and its test assert on. */
104
+ export function summarizeCalibration(results: CalibrationCaseResult[]): CalibrationSummary {
105
+ const perRuleHits: Record<string, number> = {};
106
+ for (const result of results) {
107
+ if (result.rule !== null) perRuleHits[result.rule] = (perRuleHits[result.rule] ?? 0) + 1;
108
+ }
109
+ const mismatches = results.filter((result) => !result.agrees);
110
+ const byTag: CalibrationSummary['byTag'] = {
111
+ historical: { cases: 0, mismatches: 0 },
112
+ counterexample: { cases: 0, mismatches: 0 },
113
+ };
114
+ for (const result of results) {
115
+ byTag[result.tag].cases += 1;
116
+ if (!result.agrees) byTag[result.tag].mismatches += 1;
117
+ }
118
+ const excluded = results.filter((result) => result.actual === 'excluded');
119
+ return {
120
+ cases: results.length,
121
+ kept: results.length - excluded.length,
122
+ excluded: excluded.length,
123
+ perRuleHits,
124
+ uniqueIds: excluded.length,
125
+ ruleHits: Object.values(perRuleHits).reduce((total, hits) => total + hits, 0),
126
+ mismatches,
127
+ byTag,
128
+ passes: mismatches.length === 0,
129
+ };
130
+ }
131
+
132
+ /** Parse the fixture file's cases, rejecting a case that forgets its tag or its expectation. */
133
+ export function parseCalibrationCases(raw: unknown): CalibrationCase[] {
134
+ if (!Array.isArray(raw)) throw new Error('topic-selection fixtures: expected a case array');
135
+ return raw.map((value, index) => {
136
+ const entry = (value ?? {}) as Record<string, unknown>;
137
+ const tag = entry.tag;
138
+ if (tag !== 'historical' && tag !== 'counterexample') {
139
+ throw new Error(`topic-selection fixtures[${index}]: tag must be historical|counterexample`);
140
+ }
141
+ const expect = entry.expect;
142
+ if (expect !== 'kept' && expect !== 'excluded') {
143
+ throw new Error(`topic-selection fixtures[${index}]: expect must be kept|excluded`);
144
+ }
145
+ const doc = (entry.doc ?? {}) as Record<string, unknown>;
146
+ return {
147
+ id: String(entry.id ?? ''),
148
+ tag,
149
+ source: String(entry.source ?? ''),
150
+ note: String(entry.note ?? ''),
151
+ doc: {
152
+ id: String(doc.id ?? entry.id ?? ''),
153
+ title: String(doc.title ?? ''),
154
+ body: String(doc.body ?? ''),
155
+ ...(typeof doc.publishedAt === 'string' ? { publishedAt: doc.publishedAt } : {}),
156
+ },
157
+ expect,
158
+ ...(typeof entry.expectRule === 'string' ? { expectRule: entry.expectRule } : {}),
159
+ };
160
+ });
161
+ }
@@ -21,7 +21,8 @@ LLM-as-judge is **not** a knowledge-kit plugin kind (ADR-007 amdt 2026-08-07). I
21
21
 
22
22
  - A spur workflow needs a quality gate between `generate` and `publish`.
23
23
  - A user asks to "judge", "evaluate", "quality-check", or "gate" generated content.
24
- - A workflow or skill names a rubric (`tech-accuracy` / `brand-tone` / `compliance` / `news-balance` / `general`).
24
+ - A workflow or skill names a rubric (`tech-accuracy` / `brand-tone` / `compliance` / `news-balance` /
25
+ `music-quality` / `general`).
25
26
 
26
27
  ## Verdict output contract
27
28
 
@@ -99,7 +100,7 @@ and `escalate` flag; treat `LOW` as a signal to demand human review before publi
99
100
  1. **Read the Content** from the path given in the evaluation request (the `content.json` written
100
101
  by the preceding `kk executor run <generator>` step).
101
102
  2. **Select the rubric** — named in the request (`tech-accuracy`, `brand-tone`,
102
- `compliance`, `news-balance`, `general`). Default: `general`.
103
+ `compliance`, `news-balance`, `music-quality`, `general`). Default: `general`.
103
104
  3. **Evaluate each criterion** in the rubric. For each, produce a `pass` / `fail` / `warn` status
104
105
  backed by a specific, quotable evidence reference (quote, section, claim).
105
106
  4. **Score** — weighted aggregate per the rubric's scoring rules. `score` is 0.0–1.0.
@@ -127,9 +128,10 @@ and `escalate` flag; treat `LOW` as a signal to demand human review before publi
127
128
 
128
129
  ## Rubrics
129
130
 
130
- Five built-in rubrics. Full definitions, weights, and thresholds live in
131
- `references/rubrics.md`. The skill body intentionally stays lean — load the reference when
132
- evaluating.
131
+ Six built-in rubrics. Full definitions, weights, and thresholds live in
132
+ `references/rubrics.md`, except `music-quality`, whose measurement-discipline rules live in
133
+ `references/music-quality-rubric.md`. The skill body intentionally stays lean — load the reference
134
+ when evaluating.
133
135
 
134
136
  | Rubric | Use when | Key must-pass criteria |
135
137
  |--------|----------|------------------------|
@@ -138,6 +140,7 @@ evaluating.
138
140
  | `brand-tone` | Published voice | tone consistency, banned-phrase compliance, audience fit |
139
141
  | `compliance` | Sensitive content | no prohibited claims, disclosure presence, jurisdictional rules |
140
142
  | `news-balance` | Daily news script plan | news-first, commentary-share, no-restatement |
143
+ | `music-quality` | Generated music takes (`kk-music`) | checks.clean — every measured take check passes |
141
144
 
142
145
  ## Prompt template
143
146
 
@@ -148,7 +151,7 @@ Use this template when the skill is invoked by an `agent.run` step. The workflow
148
151
  You are an LLM-as-judge evaluating generated content for the knowledge-kit pipeline.
149
152
 
150
153
  Content to evaluate: {{content_path}}
151
- Rubric: {{rubric}} # general | tech-accuracy | brand-tone | compliance | news-balance
154
+ Rubric: {{rubric}} # general | tech-accuracy | brand-tone | compliance | news-balance | music-quality
152
155
  Output verdict to: {{verdict_path}}
153
156
 
154
157
  Load the rubric definition from plugins/kk/skills/content-judge/references/rubrics.md (section: {{rubric}}).
@@ -173,4 +176,6 @@ section in `references/rubrics.md` and name it from the prompt — do not add a
173
176
  ## Additional resources
174
177
 
175
178
  - **`references/rubrics.md`** — full rubric definitions, criterion weights, and verdict thresholds
179
+ - **`references/music-quality-rubric.md`** — the `music-quality` rubric: craft dimensions, the
180
+ `checks.clean` must-pass, and the rule that measured facts are quoted from `checks.json`
176
181
  - **`references/workflow-integration.md`** — `agent.run` step shape, shell/`jq` guard, retry topology
@@ -0,0 +1,147 @@
1
+ # music-quality — music take evaluation rubric
2
+
3
+ Rubric id: **`music-quality`**. Loaded by `kk:content-judge` when the `kk-music` workflow (0403) or the
4
+ `kk:music-authoring` `review` operation judges a generated take. It is one more rubric section for the
5
+ existing verdict contract — **not** a second judge and not a second verdict shape.
6
+
7
+ The judge is reading a **bundle** (`4-judge-input.md`, written by `kk:music-authoring`): the brief, the
8
+ kk-rendered prompt text, the lyrics, the instance analysis and `checks.json` verbatim. It is not
9
+ listening to the take, and it must not pretend to.
10
+
11
+ ## Scoring
12
+
13
+ | Criterion | Weight | Must-pass |
14
+ | --- | --- | --- |
15
+ | `checks.clean` — `<take>.checks.json` exists for the take and contains no row with `result: fail` | 0.20 | yes |
16
+ | `brief-adherence` — genre, instrumentation, tempo, key, vocal character and language match the brief's technical direction | 0.25 | no |
17
+ | `arrangement` — the take's section layout agrees with the brief's declared `structure` | 0.20 | no |
18
+ | `lyric-intelligibility` — the authored lyric text is singable in the declared `language` and carries the intended syllables | 0.15 | no |
19
+ | `hook` — a repeated, identifiable hook exists where the structure declares it | 0.10 | no |
20
+ | `production-artefacts` — no dead air, click, dropout or clipping artefact is recorded against the take | 0.10 | no |
21
+
22
+ Thresholds: `pass_threshold = 0.75`
23
+
24
+ Same scoring model as every other rubric (`rubrics.md` §Scoring model): `pass` = full weight,
25
+ `warn` = half, `fail` = zero; a must-pass `fail` is `FAIL` regardless of score.
26
+
27
+ `checks.clean` is the **only** must-pass criterion. Craft criteria are never must-pass, because a
28
+ craft judgement made without hearing the take cannot be a blocking violation: the worst it can do is
29
+ pull the score under 0.75 and produce `NEEDS_REVISION` with actionable feedback.
30
+
31
+ ## Measurement discipline (applies to every criterion)
32
+
33
+ 1. **Measured facts come from `checks.json`, cited, never re-derived.** Duration, silence, BPM, key,
34
+ section count and delivery loudness exist as rows with `id`, `measured`, `threshold`, `unit`,
35
+ `source` and `result`. A finding that cites any of them quotes the value **with its unit and its
36
+ `source`**, and names the file — e.g. `duration.target: measured 34.2 s, threshold "20–40", unit s,
37
+ source ffprobe 8.1.2 (3-takes/…wav.checks.json)`. Never write "about 30 seconds"; either quote the
38
+ row or do not cite a number.
39
+ 2. **Never score a criterion from the prompt text.** The prompt is an instruction, not evidence of what
40
+ the model produced. "The brief asked for gated snare, so `brief-adherence` passes" is a
41
+ fabrication — grade it `warn` with "the bundle carries no evidence for this element".
42
+ 3. **Never score by ear.** The judge has no audio. Anything only audible (mix balance, timbre,
43
+ artefacts not recorded as rows) is `warn` with detail "not observable from the bundle".
44
+ 4. **`source` is the authority, so name it.** `ffprobe <version>` (duration), `ffmpeg <version>
45
+ silencedetect` (silence), `ffmpeg <version>` (delivery loudness/true peak), `lyria instance
46
+ analysis` (BPM/key/sections — a **model estimate**, which is why those rows are `warn`-only).
47
+ 5. **A `warn` row never becomes a `fail` finding.** BPM/key/section disagreement is a craft input
48
+ (toward `NEEDS_REVISION`), not a violation; only the measured `fail` rows in `checks.json` can fail
49
+ the take, and they do so through `checks.clean`.
50
+
51
+ ## Criterion guidance
52
+
53
+ ### `checks.clean` (must-pass, weight 0.20)
54
+
55
+ Read `<take>.checks.json` from the bundle. It **must exist** — an absent file is a `fail` of this
56
+ criterion, not a caveat. Then:
57
+
58
+ - any row with `result: "fail"` → this criterion is `fail` → the verdict is `FAIL`, and the finding
59
+ quotes that row (`id`, `measured`, `threshold`, `unit`, `source`, and its `note` when present);
60
+ - every row `pass` or `warn` → `pass`, quoting the row count and the `warn` ids.
61
+
62
+ Rows that typically fail and what they mean: `duration.target`/`duration.clip` (the take missed the
63
+ duration band — re-brief the length and iterate), `silence.leading`/`silence.trailing` (dead air at an
64
+ edge), `analysis.present` (the analyze step's result has not reached the check, so the take is
65
+ unmeasured in the sense this rubric needs — stop and fix the input, do not judge around it),
66
+ `delivery.*` (only present after `master`; a true-peak or loudness miss blocks delivery).
67
+
68
+ ### `brief-adherence` (weight 0.25)
69
+
70
+ Compare the brief's `style` (technical direction: genre, BPM, key, instrumentation, production) and
71
+ `language` against what the bundle can actually attest:
72
+
73
+ - the instance analysis' BPM and key (`analysis.bpm`, `analysis.key` rows) — agreement is `pass`,
74
+ disagreement is `warn` quoting both the measured value and the brief's band;
75
+ - instrumentation, vocal character and production texture — attestable only if the analysis object or
76
+ the take metadata names them; otherwise `warn`, "not observable from the bundle".
77
+
78
+ ### `arrangement` (weight 0.20)
79
+
80
+ Compare the brief's `structure[]` (`at`, `section`, `note`) against the analysis' section list
81
+ (`analysis.sections` row: measured count vs the brief's count) and any section detail in the analysis
82
+ object. A count mismatch is `warn` (the analysis is an estimate) with the measured value quoted. A
83
+ structure the brief declares but the analysis cannot see is `warn`, never `pass`: absence of evidence
84
+ is not agreement.
85
+
86
+ ### `lyric-intelligibility` (weight 0.15)
87
+
88
+ - `instrumental: true` brief → `pass`, detail "instrumental brief; no lyric text is sent", weight
89
+ intact: the criterion is satisfied by construction, not waived.
90
+ - lyrics present in the bundle → grade the **text**: tags match the structure's sections, the
91
+ language matches the brief's `language`, lines are singable (syllable counts consistent inside a
92
+ section, no prose sentences standing in for a hook line). Mix-level intelligibility stays
93
+ unobservable → say so in the detail.
94
+ - lyrics absent because the model wrote its own → `warn`, detail "model-authored lyrics are not in the
95
+ bundle". Never invent them.
96
+
97
+ ### `hook` (weight 0.10)
98
+
99
+ The hook must be locatable from the bundle: a repeated line in the lyric text, or a declared hook
100
+ section in `structure`. If the bundle can neither show nor exclude a hook, `warn`. Do not claim the
101
+ take "has a catchy chorus"; claim only what the text and the declared structure show.
102
+
103
+ ### `production-artefacts` (weight 0.10)
104
+
105
+ Cite the `silence.*` rows (dead air at either edge) and, when the take has been mastered, the
106
+ `delivery.*` rows. `pass` when those rows are `pass` and no artefact is recorded; `warn` when a row is
107
+ `warn`, or when an artefact class (clipping, dropout, clicks, unnatural vocal timbre) is only audible
108
+ and therefore unattested; `fail` only if `checks.json` itself carries the failing row — in which case
109
+ `checks.clean` already failed and this criterion simply corroborates it.
110
+
111
+ ## Verdict mapping
112
+
113
+ | Situation | Verdict |
114
+ | --- | --- |
115
+ | Any `checks.json` row with `result: "fail"`, or a missing `checks.json` | `FAIL` (via `checks.clean`) |
116
+ | No must-pass failure, `score >= 0.75` | `PASS` |
117
+ | No must-pass failure, `score < 0.75` | `NEEDS_REVISION` (feedback names the directive for one `iterate` round) |
118
+
119
+ `confidence` is self-assessed per the contract: `HIGH` when every criterion was grounded in a bundle
120
+ artifact and every number quoted from a row, `MEDIUM` when some element was attestable only through
121
+ the model's own analysis, `LOW` when the bundle is incomplete enough that the craft score could flip
122
+ (the verdict is still emitted, with the gap named).
123
+
124
+ ## Emit the existing contract
125
+
126
+ Write **one** verdict file (`verdict_path` from the review step), with the fields the
127
+ `content-judge` contract already defines — nothing added, nothing renamed:
128
+
129
+ ```json
130
+ {
131
+ "verdict": "PASS | FAIL | NEEDS_REVISION",
132
+ "confidence": "HIGH | MEDIUM | LOW",
133
+ "rubric": "music-quality",
134
+ "score": 0.0,
135
+ "summary": "<one paragraph, every claim traceable to the bundle>",
136
+ "findings": [{ "criterion": "checks.clean | brief-adherence | arrangement | lyric-intelligibility | hook | production-artefacts", "status": "pass | fail | warn", "detail": "<quoted row or bundle evidence>" }],
137
+ "feedback": ["<one directive for the next brief>"],
138
+ "content_ref": "<the take path>",
139
+ "evaluated_at": "<ISO-8601>"
140
+ }
141
+ ```
142
+
143
+ `findings[].criterion` values come from the table above and nowhere else. `content_ref` is the take
144
+ (`3-takes/<slug>-<model>-<instanceId>.<ext>`), not the bundle path. Do not write a
145
+ `music-verdict.json`, do not add a measured-values field, do not add a per-criterion score field: if
146
+ you want the numbers in the record, quote them inside `detail`, where the contract already puts
147
+ evidence.
@@ -114,12 +114,27 @@ For daily news episode script plans (`kk-daily-ai-voice3` advisory `editorial-ju
114
114
 
115
115
  Thresholds: `pass_threshold = 0.80`
116
116
 
117
+ ## music-quality
118
+
119
+ For generated music takes (`kk-music`, 0403; authored through `kk:music-authoring`). Its criteria are
120
+ **not** in this file: the rubric carries a measurement-discipline section (measured facts quoted from
121
+ `checks.json`, never re-derived and never scored by ear) that would sit awkwardly beside the text
122
+ rubrics, so it ships as its own reference —
123
+ [`music-quality-rubric.md`](music-quality-rubric.md).
124
+
125
+ Summary: weights `checks.clean` 0.20 (the **only** must-pass), `brief-adherence` 0.25,
126
+ `arrangement` 0.20, `lyric-intelligibility` 0.15, `hook` 0.10, `production-artefacts` 0.10;
127
+ `pass_threshold = 0.75`. The load-bearing rule: `checks.clean` reads `<take>.checks.json` and fails on
128
+ any row with `result: fail`.
129
+
117
130
  ## Adding a custom rubric
118
131
 
119
132
  1. Add a section to this file with a unique heading and a criteria table matching the schema
120
133
  above (criterion, weight, must-pass).
121
134
  2. Set `pass_threshold`.
122
135
  3. Reference the new rubric id from a thin wrapper's `rubric` field or an `agent.run` prompt.
136
+ A rubric whose rules are large enough to need their own file (as `music-quality` does) keeps a
137
+ pointer section here instead of an inline table, so this file stays the index.
123
138
 
124
139
  Weights must sum to 1.0; validation is the skill's responsibility at load time — if they do not
125
140
  sum to 1.0, normalize them and emit a `warn` finding noting the normalization.
@@ -41,6 +41,18 @@ prefer exclusion or abort over any rewording.
41
41
  | 4 | 未经核实断言 / 来源保真 | Claims resting on RSS titles, aggregation-page URLs, unknown model names, self-contradictory dates; invented facts | Remove the claim or downgrade to attributed uncertainty; insufficient material → shorten or stop, never pad |
42
42
  | 5 | 必要披露 | AI-generation disclosure, identity/experience truthfulness (only real hands-on experience claimed) | Missing disclosure → revise to add, unless that platform item is graded `note` (do not add it back); false identity claim → BLOCK |
43
43
 
44
+ **Unpoliced class — 黄赌毒 (adult content / gambling / drugs), 0392 inventory finding.** The 0392 inventory
45
+ names this class and the honest answer is: **nothing enforces it anywhere.** No selection rule
46
+ (`plugins/kk/scripts/topic-boundary.json` holds only `prc-leadership` + `dateConflict`), no row in the
47
+ table above, and no platform file (`references/platforms/*.md`) names adult content, gambling or drugs —
48
+ `grep -riE '黄赌毒|色情|赌博|毒品|porn|gambl|adult' plugins/kk/skills plugins/kk/scripts apps/cli/src`
49
+ returned nothing before this note (this paragraph is now its only hit — prose, not a rule). It is not a sub-case of category 2 (that row is political/diplomatic/trade-control/military/
50
+ public-policy/social-event), so an adult/gambling/drug story whose subject is an AI product passes every
51
+ rule in force today. Recorded here so the admission reviewer sees the gap instead of inferring coverage;
52
+ 0392 ships **no** filter for it (no observed harmful miss, and an unvetted keyword list would block AI
53
+ stories that merely mention addiction treatment or betting-market models). Any future rule belongs here
54
+ and in `topic-boundary.json`, with fixtures like `plugins/kk/tests/fixtures/topic-selection-cases.json`.
55
+
44
56
  ## Modes
45
57
 
46
58
  - **detect-only** (default): emit the report; touch nothing.