@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.
Files changed (147) 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 +1315 -264
  4. package/dist/board/itc/index.js +1 -0
  5. package/dist/index.js +14674 -8775
  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/image-gen/README.md +31 -31
  13. package/plugins/generations/image-gen/assets/sample/provenance.json +314 -0
  14. package/plugins/generations/image-gen/config.example.yaml +3 -0
  15. package/plugins/generations/image-gen/dist/index.js +154 -14
  16. package/plugins/generations/image-gen/presets/SOURCE.md +65 -0
  17. package/plugins/generations/image-gen/scripts/eval-style-presets.ts +513 -0
  18. package/plugins/generations/image-gen/scripts/gen-samples.ts +57 -7
  19. package/plugins/generations/image-gen/src/presets.ts +6 -5
  20. package/plugins/generations/image-gen/src/providers/h3-local.ts +196 -0
  21. package/plugins/generations/image-gen/src/providers/types.ts +11 -1
  22. package/plugins/generations/music-gen/README.md +277 -0
  23. package/plugins/generations/music-gen/dist/index.js +23544 -0
  24. package/plugins/generations/music-gen/package.json +24 -0
  25. package/plugins/generations/music-gen/plugin.json +23 -0
  26. package/plugins/generations/music-gen/presets/SOURCE.md +39 -0
  27. package/plugins/generations/music-gen/presets/formats/clip.yaml +21 -0
  28. package/plugins/generations/music-gen/presets/formats/jingle.yaml +22 -0
  29. package/plugins/generations/music-gen/presets/formats/loop.yaml +21 -0
  30. package/plugins/generations/music-gen/presets/formats/song.yaml +31 -0
  31. package/plugins/generations/music-gen/presets/formats/underscore.yaml +22 -0
  32. package/plugins/generations/music-gen/presets/themes/ambient-tech.yaml +30 -0
  33. package/plugins/generations/music-gen/presets/themes/cinematic.yaml +30 -0
  34. package/plugins/generations/music-gen/presets/themes/lofi.yaml +30 -0
  35. package/plugins/generations/music-gen/presets/themes/synthwave.yaml +30 -0
  36. package/plugins/generations/music-gen/scripts/gen-preset-index.ts +181 -0
  37. package/plugins/generations/music-gen/scripts/resolve-preset.ts +64 -0
  38. package/plugins/generations/music-gen/src/adapter/index.ts +35 -0
  39. package/plugins/generations/music-gen/src/adapter/instance.ts +904 -0
  40. package/plugins/generations/music-gen/src/adapter/offline.ts +124 -0
  41. package/plugins/generations/music-gen/src/artifact.ts +223 -0
  42. package/plugins/generations/music-gen/src/audio/checks.ts +618 -0
  43. package/plugins/generations/music-gen/src/audio/master.ts +267 -0
  44. package/plugins/generations/music-gen/src/audio/measure.ts +507 -0
  45. package/plugins/generations/music-gen/src/audio/profile.ts +131 -0
  46. package/plugins/generations/music-gen/src/audio.ts +122 -0
  47. package/plugins/generations/music-gen/src/brief.ts +191 -0
  48. package/plugins/generations/music-gen/src/config.ts +451 -0
  49. package/plugins/generations/music-gen/src/content.ts +199 -0
  50. package/plugins/generations/music-gen/src/digest.ts +100 -0
  51. package/plugins/generations/music-gen/src/index.ts +147 -0
  52. package/plugins/generations/music-gen/src/job.ts +131 -0
  53. package/plugins/generations/music-gen/src/plugin.ts +371 -0
  54. package/plugins/generations/music-gen/src/presets.ts +918 -0
  55. package/plugins/generations/music-gen/src/render.ts +87 -0
  56. package/plugins/generations/music-gen/src/request.ts +102 -0
  57. package/plugins/generations/music-gen/src/spend.ts +495 -0
  58. package/plugins/generations/music-gen/tsconfig.json +8 -0
  59. package/plugins/kk/config.example.yaml +3 -0
  60. package/plugins/kk/decisions/extract/ai-news.yaml +5 -2
  61. package/plugins/kk/plugin.json +1 -1
  62. package/plugins/kk/publish-presets/daily-ai-voice.json +48 -7
  63. package/plugins/kk/schedules/kk-serve.launchd.plist.tmpl +2 -1
  64. package/plugins/kk/scripts/cover-compositor.ts +380 -32
  65. package/plugins/kk/scripts/daily-cover-mock.ts +40 -3
  66. package/plugins/kk/scripts/daily-stages.ts +897 -34
  67. package/plugins/kk/scripts/episode-identity.ts +180 -0
  68. package/plugins/kk/scripts/kk-workflow-stages.ts +37 -1
  69. package/plugins/kk/scripts/music-stages.ts +624 -0
  70. package/plugins/kk/scripts/news-editorial-ledger.ts +906 -0
  71. package/plugins/kk/scripts/source-citation.ts +187 -0
  72. package/plugins/kk/scripts/topic-selection-attempts.ts +446 -0
  73. package/plugins/kk/scripts/topic-selection-calibration.ts +161 -0
  74. package/plugins/kk/skills/content-judge/SKILL.md +11 -6
  75. package/plugins/kk/skills/content-judge/references/music-quality-rubric.md +147 -0
  76. package/plugins/kk/skills/content-judge/references/rubrics.md +15 -0
  77. package/plugins/kk/skills/content-safety/SKILL.md +12 -0
  78. package/plugins/kk/skills/image-authoring/SKILL.md +7 -3
  79. package/plugins/kk/skills/image-authoring/references/providers.md +27 -0
  80. package/plugins/kk/skills/image-authoring/references/style-extraction.md +1 -1
  81. package/plugins/kk/skills/music-authoring/SKILL.md +276 -0
  82. package/plugins/kk/skills/music-authoring/references/judge-input.md +117 -0
  83. package/plugins/kk/skills/news-editorial/SKILL.md +102 -15
  84. package/plugins/kk/skills/news-editorial/references/selection.md +4 -0
  85. package/plugins/kk/skills/news-editorial/references/style-contract.zh.md +58 -11
  86. package/plugins/kk/skills/publish/SKILL.md +11 -0
  87. package/plugins/kk/skills/web-automation/SKILL.md +31 -1
  88. package/plugins/kk/workflows/kk-collect.yaml +8 -4
  89. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +10 -9
  90. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +11 -9
  91. package/plugins/kk/workflows/kk-music.yaml +328 -0
  92. package/plugins/kk/workflows/kk-news-generate.yaml +58 -3
  93. package/plugins/publishings/bilibili-pub/dist/index.js +11 -1
  94. package/plugins/publishings/bilibili-pub/dist/profile-check.js +11 -1
  95. package/plugins/publishings/cnblogs-pub/dist/index.js +11 -1
  96. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +11 -1
  97. package/plugins/publishings/csdn-pub/dist/index.js +11 -1
  98. package/plugins/publishings/csdn-pub/dist/profile-check.js +11 -1
  99. package/plugins/publishings/infoq-pub/dist/index.js +11 -1
  100. package/plugins/publishings/infoq-pub/dist/profile-check.js +11 -1
  101. package/plugins/publishings/jike-pub/dist/index.js +11 -1
  102. package/plugins/publishings/jike-pub/dist/profile-check.js +11 -1
  103. package/plugins/publishings/juejin-pub/dist/index.js +11 -1
  104. package/plugins/publishings/juejin-pub/dist/profile-check.js +11 -1
  105. package/plugins/publishings/linkedin-pub/dist/index.js +54 -7
  106. package/plugins/publishings/linkedin-pub/dist/profile-check.js +43 -6
  107. package/plugins/publishings/linkedin-pub/src/index.ts +52 -6
  108. package/plugins/publishings/podcast-pub/dist/index.js +586 -20
  109. package/plugins/publishings/podcast-pub/src/corrections.ts +509 -0
  110. package/plugins/publishings/podcast-pub/src/index.ts +257 -5
  111. package/plugins/publishings/podcast-pub/src/show-notes-brief.ts +240 -0
  112. package/plugins/publishings/podcast-pub/src/show-notes.ts +69 -13
  113. package/plugins/publishings/shipinhao-pub/dist/index.js +437 -32
  114. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +14 -2
  115. package/plugins/publishings/shipinhao-pub/plugin.json +1 -1
  116. package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +492 -0
  117. package/plugins/publishings/shipinhao-pub/src/flow.ts +227 -12
  118. package/plugins/publishings/shipinhao-pub/src/selectors.ts +13 -0
  119. package/plugins/publishings/sspai-pub/dist/index.js +11 -1
  120. package/plugins/publishings/sspai-pub/dist/profile-check.js +11 -1
  121. package/plugins/publishings/substack-pub/dist/index.js +11 -1
  122. package/plugins/publishings/substack-pub/dist/profile-check.js +11 -1
  123. package/plugins/publishings/surfdash-pub/dist/index.js +122 -28
  124. package/plugins/publishings/surfdash-pub/src/digest-check.ts +7 -3
  125. package/plugins/publishings/surfdash-pub/src/index.ts +159 -25
  126. package/plugins/publishings/surfdash-pub/src/topic-claims.ts +37 -4
  127. package/plugins/publishings/threads-pub/dist/index.js +9206 -296
  128. package/plugins/publishings/threads-pub/dist/profile-check.js +21149 -0
  129. package/plugins/publishings/threads-pub/package.json +3 -1
  130. package/plugins/publishings/threads-pub/plugin.json +6 -1
  131. package/plugins/publishings/threads-pub/src/index.ts +8 -1
  132. package/plugins/publishings/threads-pub/src/post-rail.ts +357 -0
  133. package/plugins/publishings/threads-pub/src/profile-check.ts +17 -0
  134. package/plugins/publishings/wechatmp-pub/dist/index.js +18 -1
  135. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +11 -1
  136. package/plugins/publishings/wechatmp-pub/src/flow.ts +13 -0
  137. package/plugins/publishings/weibo-pub/dist/index.js +57 -3
  138. package/plugins/publishings/weibo-pub/dist/profile-check.js +11 -1
  139. package/plugins/publishings/weibo-pub/src/index.ts +74 -2
  140. package/plugins/publishings/x-pub/dist/index.js +274 -44
  141. package/plugins/publishings/x-pub/dist/profile-check.js +14 -2
  142. package/plugins/publishings/x-pub/src/index.ts +15 -1
  143. package/plugins/publishings/x-pub/src/post-rail.ts +334 -0
  144. package/plugins/publishings/xhs-pub/dist/index.js +11 -1
  145. package/plugins/publishings/xhs-pub/dist/profile-check.js +11 -1
  146. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +11 -1
  147. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +11 -1
@@ -1,4 +1,13 @@
1
1
  // ../board/src/daily-voice/index.tsx
2
+ import {
3
+ Badge,
4
+ Diagnostic,
5
+ EmptyState,
6
+ ModuleHeader,
7
+ ModuleShell,
8
+ ModuleTabs,
9
+ withBase
10
+ } from "@gobing-ai/spur/board/ui";
2
11
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
12
 
4
13
  // ../board/src/shared/api.ts
@@ -520,6 +529,7 @@ function createBoardClient(options) {
520
529
  storeSelections: (query = {}) => isNativeSpur ? nativeStoreSelections(query) : getJson(`${reader}/api/workflows/kk-collect/store/selections?${storeSelectionsQueryString(query)}`),
521
530
  storeChannels: (query) => getJson(`${aggregateReader}/api/workflows/kk-collect/store/channels?${storeChannelsQueryString(query)}`),
522
531
  runDetail: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}`),
532
+ evidence: (workflow, runId) => getJson(`${reader}/api/workflows/${encodeURIComponent(workflow)}/runs/${encodeURIComponent(runId)}/evidence`),
523
533
  progress: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}/progress`)
524
534
  };
525
535
  }
@@ -721,9 +731,6 @@ function availabilityLabel(availability) {
721
731
  return "Unverified";
722
732
  }
723
733
  }
724
- function diagnosticLine(diagnostic) {
725
- return `${diagnostic.code}: ${diagnostic.message}`;
726
- }
727
734
  function formatElapsed(startedAt, now) {
728
735
  if (startedAt === null || startedAt === undefined)
729
736
  return "elapsed unknown";
@@ -1114,23 +1121,461 @@ function supplyContextOf(windowSetting, startedAt) {
1114
1121
  untilLabel: formatTimestamp(new Date(started).toISOString())
1115
1122
  };
1116
1123
  }
1124
+ var DAILY_VIEWS = ["summary", "generation", "publishing"];
1125
+ var DAILY_VIEW_ALIASES = {
1126
+ results: "generation",
1127
+ progress: "generation",
1128
+ config: "summary"
1129
+ };
1130
+ var DAILY_WORKFLOW = "kk-news-generate";
1131
+ var RETIRED_DAILY_WORKFLOWS = ["kk-daily-ai-voice2", "kk-daily-ai-voice"];
1132
+ function pickDailyFamily(current, retired) {
1133
+ if (current.length > 0)
1134
+ return { family: DAILY_WORKFLOW, rows: current, retired: false };
1135
+ const hit = retired.find((source) => source.rows.length > 0);
1136
+ if (hit !== undefined)
1137
+ return { family: hit.family, rows: hit.rows, retired: true };
1138
+ return { family: DAILY_WORKFLOW, rows: current, retired: false };
1139
+ }
1140
+ function retiredLayoutNotice(choice) {
1141
+ if (!choice.retired)
1142
+ return null;
1143
+ const days = choice.rows.length === 1 ? "1 run" : `${choice.rows.length} runs`;
1144
+ return `Showing ${days} recorded under the retired ${choice.family} layout. New runs are recorded as ${DAILY_WORKFLOW}, so this list stops growing until that workflow runs.`;
1145
+ }
1146
+
1147
+ // ../board/src/daily-voice/evidence.ts
1148
+ function captureState(evidence) {
1149
+ return evidence.capture ? "captured" : "uncaptured";
1150
+ }
1151
+ function asRecord2(value) {
1152
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
1153
+ }
1154
+ function asString2(value) {
1155
+ return typeof value === "string" && value.length > 0 ? value : null;
1156
+ }
1157
+ function asNumber2(value) {
1158
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
1159
+ }
1160
+ function asBool2(value) {
1161
+ return typeof value === "boolean" ? value : null;
1162
+ }
1163
+ function newsSummaryOf(evidence) {
1164
+ if (!evidence.results)
1165
+ return null;
1166
+ return newsSummaryOfResults(evidence.results);
1167
+ }
1168
+ function newsSummaryOfResults(results) {
1169
+ const summary = asRecord2(results.summary);
1170
+ if (!summary)
1171
+ return null;
1172
+ const generation = generationOf(summary);
1173
+ const publishing = publishingOf(summary);
1174
+ const counts = countsOf(summary);
1175
+ const outcome = asString2(summary.outcome);
1176
+ return {
1177
+ status: asString2(summary.status) ?? "unknown",
1178
+ startedAt: asString2(summary.startedAt),
1179
+ completedAt: asString2(summary.completedAt),
1180
+ outcome,
1181
+ generation,
1182
+ publishing,
1183
+ counts
1184
+ };
1185
+ }
1186
+ function generationOf(summary) {
1187
+ const bag = asRecord2(summary.generation) ?? {};
1188
+ const gate = asRecord2(bag.gate) ?? {};
1189
+ const launch = asRecord2(bag.launch) ?? {};
1190
+ const progress = asRecord2(bag.progress) ?? null;
1191
+ const engines = Array.isArray(bag.engines) ? bag.engines.flatMap((entry) => {
1192
+ const row = asRecord2(entry);
1193
+ if (!row)
1194
+ return [];
1195
+ const attempts = Array.isArray(row.attempts) ? row.attempts.flatMap((attempt) => {
1196
+ const a = asRecord2(attempt);
1197
+ if (!a)
1198
+ return [];
1199
+ return [
1200
+ {
1201
+ status: asString2(a.status) ?? "unknown",
1202
+ timing: asString2(a.timing) ?? "unknown"
1203
+ }
1204
+ ];
1205
+ }) : [];
1206
+ return [
1207
+ {
1208
+ node: asString2(row.node) ?? "unknown",
1209
+ state: asString2(row.state) ?? "unknown",
1210
+ attempts
1211
+ }
1212
+ ];
1213
+ }) : [];
1214
+ return {
1215
+ outcome: asString2(bag.outcome),
1216
+ gate: { status: asString2(gate.status) },
1217
+ launch: {
1218
+ status: asString2(launch.status),
1219
+ runId: asString2(launch.runId),
1220
+ startedAt: asString2(launch.startedAt),
1221
+ finishedAt: asString2(launch.finishedAt),
1222
+ reason: asString2(launch.reason),
1223
+ stale: asBool2(launch.stale) === true
1224
+ },
1225
+ engines,
1226
+ progress
1227
+ };
1228
+ }
1229
+ function publishingOf(summary) {
1230
+ const bag = asRecord2(summary.publishing) ?? {};
1231
+ const bundleBag = asRecord2(bag.bundle) ?? null;
1232
+ const bundle = bundleBag ? {
1233
+ identity: asString2(bundleBag.identity) ?? "unknown",
1234
+ runDate: asString2(bundleBag.runDate) ?? "unknown",
1235
+ parentRunId: asString2(bundleBag.parentRunId),
1236
+ title: asString2(bundleBag.title),
1237
+ variants: Array.isArray(bundleBag.variants) ? bundleBag.variants.flatMap((v) => {
1238
+ const s = asString2(v);
1239
+ return s ? [s] : [];
1240
+ }) : [],
1241
+ safety: asString2(bundleBag.safety)
1242
+ } : null;
1243
+ const windows = Array.isArray(bag.windows) ? bag.windows.flatMap((entry) => {
1244
+ const row = asRecord2(entry);
1245
+ if (!row)
1246
+ return [];
1247
+ const windowId = asString2(row.window);
1248
+ if (!windowId)
1249
+ return [];
1250
+ const provenance = asRecord2(row.provenance) ?? {};
1251
+ const recorded = asString2(row.recordedStatus);
1252
+ return [
1253
+ {
1254
+ window: windowId,
1255
+ recordedStatus: isWindowStatus(recorded) ? recorded : null,
1256
+ provenance: {
1257
+ dateMatch: asBool2(provenance.dateMatch),
1258
+ bundleMatch: asBool2(provenance.bundleMatch),
1259
+ parentMatch: asBool2(provenance.parentMatch),
1260
+ digestMatch: asBool2(provenance.digestMatch)
1261
+ },
1262
+ targets: Array.isArray(row.targets) ? row.targets.flatMap((target) => {
1263
+ const t = asRecord2(target);
1264
+ if (!t)
1265
+ return [];
1266
+ const id = asString2(t.id);
1267
+ if (!id)
1268
+ return [];
1269
+ const evidenceFiles = asRecord2(t.evidence) ?? {};
1270
+ return [
1271
+ {
1272
+ id,
1273
+ tier: asNumber2(t.tier),
1274
+ mode: asString2(t.mode),
1275
+ target: asString2(t.target),
1276
+ status: isTargetStatus(asString2(t.status)) ? asString2(t.status) : "planned",
1277
+ effect: asString2(t.effect),
1278
+ url: asString2(t.url),
1279
+ guid: asString2(t.guid),
1280
+ finishedAt: asString2(t.finishedAt),
1281
+ error: asString2(t.error),
1282
+ evidence: {
1283
+ plan: asString2(evidenceFiles.plan) ?? "unknown",
1284
+ receipt: asString2(evidenceFiles.receipt)
1285
+ }
1286
+ }
1287
+ ];
1288
+ }) : []
1289
+ }
1290
+ ];
1291
+ }) : [];
1292
+ return { bundle, windows };
1293
+ }
1294
+ function isWindowStatus(value) {
1295
+ return value === "full" || value === "partial" || value === "none" || value === "dummy";
1296
+ }
1297
+ function isTargetStatus(value) {
1298
+ return value === "succeeded" || value === "failed" || value === "uncertain" || value === "planned" || value === "dummy" || value === "skipped";
1299
+ }
1300
+ function countsOf(summary) {
1301
+ const bag = asRecord2(summary.counts) ?? {};
1302
+ const n = (key) => asNumber2(bag[key]);
1303
+ return {
1304
+ artifactsAvailable: n("artifactsAvailable"),
1305
+ artifactsTotal: n("artifactsTotal"),
1306
+ targetsSucceeded: n("targetsSucceeded"),
1307
+ targetsFailed: n("targetsFailed"),
1308
+ targetsUncertain: n("targetsUncertain"),
1309
+ targetsPlanned: n("targetsPlanned"),
1310
+ windowsFull: n("windowsFull"),
1311
+ windowsPartial: n("windowsPartial"),
1312
+ windowsNone: n("windowsNone")
1313
+ };
1314
+ }
1315
+ var ENGINE_WORDS = {
1316
+ success: { word: "done", tone: "success" },
1317
+ failure: { word: "failed", tone: "error" },
1318
+ pending: { word: "active", tone: "info" },
1319
+ unknown: { word: "unrecorded", tone: "neutral" }
1320
+ };
1321
+ function engineStateWord(state) {
1322
+ return ENGINE_WORDS[state] ?? { word: state, tone: "neutral" };
1323
+ }
1324
+ var TARGET_WORDS = {
1325
+ succeeded: { word: "sent", tone: "success" },
1326
+ failed: { word: "failed", tone: "error" },
1327
+ uncertain: { word: "uncertain", tone: "warn" },
1328
+ planned: { word: "no evidence recorded", tone: "warn" },
1329
+ dummy: { word: "rehearsal only", tone: "neutral" },
1330
+ skipped: { word: "skipped", tone: "neutral" }
1331
+ };
1332
+ function targetStateWord(target) {
1333
+ return TARGET_WORDS[target.status] ?? { word: target.status, tone: "neutral" };
1334
+ }
1335
+ var WINDOW_WORDS = {
1336
+ full: { word: "all targets sent", tone: "success" },
1337
+ partial: { word: "partially sent", tone: "warn" },
1338
+ none: { word: "nothing sent", tone: "error" },
1339
+ dummy: { word: "rehearsal only", tone: "neutral" }
1340
+ };
1341
+ function windowStateWord(status) {
1342
+ return status ? WINDOW_WORDS[status] ?? null : null;
1343
+ }
1344
+ function windowLabel(window2) {
1345
+ if (window2 === "after-generate")
1346
+ return "After generate";
1347
+ if (window2 === "cn-peak")
1348
+ return "CN peak";
1349
+ if (window2 === "overseas-rss")
1350
+ return "Overseas RSS";
1351
+ return window2;
1352
+ }
1353
+ function provenanceRows(window2) {
1354
+ return [
1355
+ { label: "run date matches the bundle", matched: window2.provenance.dateMatch },
1356
+ { label: "plan references this bundle", matched: window2.provenance.bundleMatch },
1357
+ { label: "plan references this parent run", matched: window2.provenance.parentMatch },
1358
+ { label: "receipt digests match the plan", matched: window2.provenance.digestMatch }
1359
+ ];
1360
+ }
1361
+ function generationStageRows(summary) {
1362
+ const recorded = new Set;
1363
+ const engineRows = summary.generation.engines.map((engine) => {
1364
+ recorded.add(engine.node);
1365
+ const { word, tone } = engineStateWord(engine.state);
1366
+ const attempts = engine.attempts.length;
1367
+ return {
1368
+ id: engine.node,
1369
+ label: engineNodeLabel(engine.node),
1370
+ status: engine.state,
1371
+ word: attempts > 1 ? `${word} after ${attempts} attempts` : word,
1372
+ tone,
1373
+ timing: engine.attempts.at(-1)?.timing ?? null,
1374
+ engine
1375
+ };
1376
+ });
1377
+ const progress = asRecord2(summary.generation.progress);
1378
+ const nodes = progress && Array.isArray(progress.nodes) ? progress.nodes : [];
1379
+ const progressRows = nodes.flatMap((entry) => {
1380
+ const row = asRecord2(entry);
1381
+ if (!row)
1382
+ return [];
1383
+ const id = asString2(row.id);
1384
+ if (!id || recorded.has(id))
1385
+ return [];
1386
+ const status = asString2(row.status) ?? "unknown";
1387
+ const { word, tone } = engineStateWord(status);
1388
+ return [
1389
+ {
1390
+ id,
1391
+ label: engineNodeLabel(id),
1392
+ status,
1393
+ word,
1394
+ tone,
1395
+ timing: asString2(row.timing),
1396
+ engine: null
1397
+ }
1398
+ ];
1399
+ });
1400
+ return [...engineRows, ...progressRows];
1401
+ }
1402
+ function engineNodeLabel(node) {
1403
+ const labels = {
1404
+ prepare: "Prepare sources",
1405
+ curate: "Curate topics",
1406
+ "script-write": "Write script",
1407
+ "editorial-judge": "Editorial review",
1408
+ render: "Render article & cover",
1409
+ safety: "Safety review",
1410
+ voice: "Generate audio",
1411
+ "voice-fallback": "Generate audio (retry A)",
1412
+ "voice-fallback2": "Generate audio (retry B)",
1413
+ freeze: "Freeze bundle"
1414
+ };
1415
+ return labels[node] ?? node;
1416
+ }
1417
+ function publishingWindowRows(summary) {
1418
+ return summary.publishing.windows.map((window2) => ({
1419
+ window: window2.window,
1420
+ label: windowLabel(window2.window),
1421
+ recorded: windowStateWord(window2.recordedStatus),
1422
+ provenance: provenanceRows(window2),
1423
+ targets: window2.targets.map((target) => {
1424
+ const { word, tone } = targetStateWord(target);
1425
+ return { ...target, word, tone };
1426
+ })
1427
+ }));
1428
+ }
1429
+ var STAGE_ORDER = [
1430
+ "prepare",
1431
+ "curate",
1432
+ "script-write",
1433
+ "editorial-judge",
1434
+ "render",
1435
+ "safety",
1436
+ "voice",
1437
+ "freeze"
1438
+ ];
1439
+ function outputGroups(results, readerOrigin) {
1440
+ const views = artifactViews(results, readerOrigin);
1441
+ const producersOf = new Map(views.map((view) => [view.id, view]));
1442
+ const byProducer = new Map;
1443
+ for (const descriptor of results.artifacts) {
1444
+ const view = producersOf.get(descriptor.id);
1445
+ if (!view)
1446
+ continue;
1447
+ const producer = descriptor.producerNode ?? "";
1448
+ const bucket = byProducer.get(producer);
1449
+ if (bucket)
1450
+ bucket.push(view);
1451
+ else
1452
+ byProducer.set(producer, [view]);
1453
+ }
1454
+ const producers = [...byProducer.keys()].sort((a, b) => {
1455
+ const ia = STAGE_ORDER.indexOf(a);
1456
+ const ib = STAGE_ORDER.indexOf(b);
1457
+ return (ia === -1 ? STAGE_ORDER.length : ia) - (ib === -1 ? STAGE_ORDER.length : ib);
1458
+ });
1459
+ return producers.map((producer) => ({
1460
+ producer,
1461
+ label: producer ? engineNodeLabel(producer) : "Unattributed",
1462
+ artifacts: byProducer.get(producer) ?? []
1463
+ }));
1464
+ }
1465
+ function stamp(value) {
1466
+ if (!value)
1467
+ return "not recorded";
1468
+ const ms = Date.parse(value);
1469
+ return Number.isNaN(ms) ? value : new Date(ms).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
1470
+ }
1471
+ function newsSummaryFacts(evidence) {
1472
+ const summary = newsSummaryOf(evidence);
1473
+ const facts = [{ label: "Status", value: evidence.run.status, availability: "available" }];
1474
+ if (!summary) {
1475
+ facts.push({
1476
+ label: "Projection",
1477
+ value: "No captured projection for this attempt",
1478
+ availability: "unverified"
1479
+ });
1480
+ return facts;
1481
+ }
1482
+ const workspace = evidence.results?.availability;
1483
+ const availabilityOf = (present) => present ? workspace === "superseded" ? "superseded" : "available" : "missing";
1484
+ facts.push({
1485
+ label: "Outcome",
1486
+ value: summary.outcome ?? "not recorded",
1487
+ availability: summary.outcome ? "available" : "missing"
1488
+ });
1489
+ facts.push({
1490
+ label: "Gate",
1491
+ value: summary.generation.gate.status ?? "not recorded",
1492
+ availability: summary.generation.gate.status ? "available" : "missing"
1493
+ });
1494
+ facts.push({
1495
+ label: "Started",
1496
+ value: stamp(summary.startedAt),
1497
+ availability: availabilityOf(summary.startedAt !== null)
1498
+ });
1499
+ facts.push({
1500
+ label: "Completed",
1501
+ value: stamp(summary.completedAt),
1502
+ availability: availabilityOf(summary.completedAt !== null)
1503
+ });
1504
+ const { artifactsAvailable, artifactsTotal, targetsSucceeded, targetsFailed, targetsUncertain } = summary.counts;
1505
+ const countsRecorded = artifactsAvailable !== null && artifactsTotal !== null && targetsSucceeded !== null && targetsFailed !== null && targetsUncertain !== null;
1506
+ facts.push({
1507
+ label: "Artifacts",
1508
+ value: artifactsAvailable === null || artifactsTotal === null ? "not recorded" : `${artifactsAvailable} available of ${artifactsTotal}`,
1509
+ availability: countsRecorded ? availabilityOf(true) : "unverified"
1510
+ });
1511
+ const sent = targetsSucceeded ?? 0;
1512
+ const bad = (targetsFailed ?? 0) + (targetsUncertain ?? 0);
1513
+ facts.push({
1514
+ label: "Publishing",
1515
+ value: !countsRecorded ? "not recorded" : bad > 0 ? `${sent} sent, ${bad} failed or uncertain` : `${sent} sent`,
1516
+ availability: countsRecorded ? availabilityOf(true) : "unverified"
1517
+ });
1518
+ return facts;
1519
+ }
1520
+ function latestIssue(summary, diagnostics) {
1521
+ if (summary) {
1522
+ for (const window2 of summary.publishing.windows) {
1523
+ for (const target of window2.targets) {
1524
+ if (target.status === "failed" || target.status === "uncertain") {
1525
+ const why = target.error ?? "no error detail recorded";
1526
+ return {
1527
+ title: `${windowLabel(window2.window)}: ${target.id} ${target.status}`,
1528
+ detail: why
1529
+ };
1530
+ }
1531
+ }
1532
+ }
1533
+ if (summary.generation.launch.stale) {
1534
+ return {
1535
+ title: "Launch receipt points at another run",
1536
+ detail: `receipt run ${summary.generation.launch.runId ?? "unknown"} is not this attempt`
1537
+ };
1538
+ }
1539
+ }
1540
+ const first = diagnostics.find((d) => typeof d.message === "string" && d.message.length > 0);
1541
+ return first ? { title: first.code, detail: first.message } : null;
1542
+ }
1543
+ function uncapturedDiagnostic(evidence) {
1544
+ if (captureState(evidence) !== "uncaptured")
1545
+ return null;
1546
+ const found = evidence.diagnostics.find((d) => d.code === "board.evidence.uncaptured");
1547
+ return found ?? null;
1548
+ }
1117
1549
 
1118
1550
  // ../board/src/daily-voice/index.tsx
1119
1551
  import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
1120
- var WORKFLOW = "kk-daily-ai-voice2";
1121
1552
  var MODULE_PATH = "/board/modules/kk-daily-ai-voice2";
1122
- var TAB_LABELS = {
1553
+ var VIEW_TABS_ID = "daily-voice-view";
1554
+ var VIEW_LABELS = {
1123
1555
  summary: "Summary",
1124
- results: "Results",
1125
- progress: "Execution progress",
1126
- config: "Workflow Config Summary"
1556
+ generation: "Generation",
1557
+ publishing: "Publishing"
1127
1558
  };
1128
- function messageOf(error) {
1129
- return error instanceof Error ? error.message : String(error);
1559
+ var TONE_BADGE = {
1560
+ info: "info",
1561
+ success: "success",
1562
+ warn: "warning",
1563
+ error: "error",
1564
+ neutral: "neutral"
1565
+ };
1566
+ function statusBadgeVariant(status) {
1567
+ if (status === "done" || status === "success" || status === "passed")
1568
+ return "success";
1569
+ if (status === "failed" || status === "failure")
1570
+ return "error";
1571
+ return "info";
1130
1572
  }
1131
1573
  function isOfflineError(message) {
1132
1574
  return message.includes("Failed to fetch") || message.includes("NetworkError") || message.includes("ECONNREFUSED");
1133
1575
  }
1576
+ function messageOf(error) {
1577
+ return error instanceof Error ? error.message : String(error);
1578
+ }
1134
1579
  function usePolling(loader, intervalMs, refresh) {
1135
1580
  const loaderRef = useRef(loader);
1136
1581
  loaderRef.current = loader;
@@ -1153,7 +1598,7 @@ function usePolling(loader, intervalMs, refresh) {
1153
1598
  }, [intervalMs]);
1154
1599
  }
1155
1600
  function DailyVoiceModule() {
1156
- const [link] = useState(() => parseDeepLink(window.location.search));
1601
+ const [link] = useState(() => parseDeepLink(window.location.search, DAILY_VIEWS, DAILY_VIEW_ALIASES));
1157
1602
  const [reader] = useState(() => readerOriginFrom(window.location.search));
1158
1603
  const [aggregateReader] = useState(() => readerOriginFrom(window.location.search, DEFAULT_READER_ORIGIN));
1159
1604
  const readerOrigin = reader.origin;
@@ -1164,7 +1609,10 @@ function DailyVoiceModule() {
1164
1609
  }), [readerOrigin, aggregateReader.origin]);
1165
1610
  const [rows, setRows] = useState([]);
1166
1611
  const [cursor, setCursor] = useState(null);
1167
- const [selection, setSelection] = useState({ runId: link.runId ?? null, tab: link.tab ?? "summary" });
1612
+ const [selection, setSelection] = useState({
1613
+ runId: link.runId ?? null,
1614
+ tab: link.tab ?? "summary"
1615
+ });
1168
1616
  const [diagnostics, setDiagnostics] = useState(() => [
1169
1617
  ...link.diagnostics,
1170
1618
  ...reader.diagnostic === null ? [] : [reader.diagnostic],
@@ -1172,6 +1620,7 @@ function DailyVoiceModule() {
1172
1620
  ]);
1173
1621
  const [historyRefresh, setHistoryRefresh] = useState(() => initialRefresh(HISTORY_POLL_MS));
1174
1622
  const [readerRefresh, setReaderRefresh] = useState(() => initialRefresh(ACTIVE_POLL_MS));
1623
+ const [evidence, setEvidence] = useState(null);
1175
1624
  const [results, setResults] = useState(null);
1176
1625
  const [config, setConfig] = useState(null);
1177
1626
  const [filterQuery, setFilterQuery] = useState("");
@@ -1183,15 +1632,30 @@ function DailyVoiceModule() {
1183
1632
  const readerBusy = useRef(false);
1184
1633
  const selectionRef = useRef(selection);
1185
1634
  selectionRef.current = selection;
1635
+ const [family, setFamily] = useState(DAILY_WORKFLOW);
1636
+ const familyRef = useRef(DAILY_WORKFLOW);
1186
1637
  const loadHistory = useCallback(async () => {
1187
1638
  if (historyBusy.current)
1188
1639
  return;
1189
1640
  historyBusy.current = true;
1190
1641
  setHistoryRefresh((state) => tick(state));
1191
1642
  try {
1192
- const page = await client.runs(WORKFLOW);
1193
- setRows((existing) => mergeRunPages(existing, page).runs);
1194
- setCursor(page.nextCursor);
1643
+ const current = await client.runs(DAILY_WORKFLOW);
1644
+ let chosen = { family: DAILY_WORKFLOW, page: current };
1645
+ if (current.runs.length === 0) {
1646
+ const retiredPages = await Promise.all(RETIRED_DAILY_WORKFLOWS.map(async (retired) => ({
1647
+ family: retired,
1648
+ page: await client.runs(retired)
1649
+ })));
1650
+ const choice = pickDailyFamily(current.runs, retiredPages.map((entry) => ({ family: entry.family, rows: entry.page.runs })));
1651
+ const hit = retiredPages.find((entry) => entry.family === choice.family);
1652
+ if (choice.retired && hit !== undefined)
1653
+ chosen = { family: hit.family, page: hit.page };
1654
+ }
1655
+ familyRef.current = chosen.family;
1656
+ setFamily(chosen.family);
1657
+ setRows((existing) => mergeRunPages(existing, chosen.page).runs);
1658
+ setCursor(chosen.page.nextCursor);
1195
1659
  setHistoryRefresh(() => succeeded(Date.now(), HISTORY_POLL_MS));
1196
1660
  } catch (error) {
1197
1661
  setDiagnostics((existing) => [
@@ -1213,16 +1677,28 @@ function DailyVoiceModule() {
1213
1677
  setReaderRefresh((state) => tick(state));
1214
1678
  let stale = false;
1215
1679
  try {
1216
- const [nextResults, nextConfig] = await Promise.all([
1217
- client.results(WORKFLOW, runId),
1218
- client.config(WORKFLOW, runId)
1219
- ]);
1220
- if (selectionRef.current.runId !== runId) {
1221
- stale = true;
1222
- return;
1680
+ if (familyRef.current === DAILY_WORKFLOW) {
1681
+ const envelope = await client.evidence(familyRef.current, runId);
1682
+ if (selectionRef.current.runId !== runId) {
1683
+ stale = true;
1684
+ return;
1685
+ }
1686
+ setEvidence(envelope);
1687
+ setResults(null);
1688
+ setConfig(null);
1689
+ } else {
1690
+ const [nextResults, nextConfig] = await Promise.all([
1691
+ client.results(familyRef.current, runId),
1692
+ client.config(familyRef.current, runId)
1693
+ ]);
1694
+ if (selectionRef.current.runId !== runId) {
1695
+ stale = true;
1696
+ return;
1697
+ }
1698
+ setResults(nextResults);
1699
+ setConfig(nextConfig);
1700
+ setEvidence(null);
1223
1701
  }
1224
- setResults(nextResults);
1225
- setConfig(nextConfig);
1226
1702
  setReaderRefresh(() => succeeded(Date.now(), ACTIVE_POLL_MS));
1227
1703
  } catch (error) {
1228
1704
  if (selectionRef.current.runId !== runId) {
@@ -1244,20 +1720,26 @@ function DailyVoiceModule() {
1244
1720
  usePolling(loadReader, ACTIVE_POLL_MS, readerRefresh);
1245
1721
  useEffect(() => {
1246
1722
  if (selection.runId === null && rows.length > 0) {
1247
- setSelection((state) => state.runId === null ? resolveSelection(rows, link) : state);
1723
+ setSelection((state) => state.runId === null ? resolveSelection(rows, link, "summary") : state);
1248
1724
  }
1249
1725
  }, [rows, selection.runId, link]);
1250
1726
  useEffect(() => {
1251
1727
  syncSelectionUrl(selection, { location: window.location, history: window.history }, MODULE_PATH);
1252
1728
  }, [selection]);
1253
- const tab = selection.tab;
1729
+ const view = selection.tab;
1730
+ const newsFamily = family === DAILY_WORKFLOW;
1254
1731
  const now = Date.now();
1255
- const summary = results === null ? null : dailySummary(results);
1256
- const facts = results === null ? [] : dailySummaryFacts(results, now);
1732
+ const legacySummary = results === null ? null : dailySummary(results);
1733
+ const news = evidence !== null && newsFamily ? newsSummaryOf(evidence) : null;
1734
+ const newsFacts = evidence !== null && newsFamily ? newsSummaryFacts(evidence) : [];
1735
+ const issue = evidence !== null && newsFamily ? latestIssue(news, evidence.diagnostics) : null;
1257
1736
  const funnel = funnelView(results?.summary.funnel);
1258
- const context = supplyContextOf(config?.settings.window ?? null, summary?.startedAt ?? null);
1737
+ const legacyArtifacts = results === null ? [] : artifactViews(results, readerOrigin);
1738
+ const outputRows = evidence !== null && newsFamily && evidence.results !== null ? outputGroups(evidence.results, readerOrigin) : [];
1739
+ const stageRows = news === null ? [] : generationStageRows(news);
1740
+ const context = supplyContextOf(newsFamily ? evidence?.capture?.settings.window ?? null : config?.settings.window ?? null, news?.startedAt ?? legacySummary?.startedAt ?? null);
1259
1741
  useEffect(() => {
1260
- const bounds = tab === "summary" && context !== null ? context : null;
1742
+ const bounds = view === "summary" && context !== null ? context : null;
1261
1743
  const key = bounds === null ? null : `${selection.runId}:${bounds.fromMs}:${bounds.untilMs}`;
1262
1744
  if (key === supplyKeyRef.current)
1263
1745
  return;
@@ -1289,8 +1771,7 @@ function DailyVoiceModule() {
1289
1771
  return () => {
1290
1772
  cancelled = true;
1291
1773
  };
1292
- }, [client, tab, context, selection.runId]);
1293
- const artifacts = results === null ? [] : artifactViews(results, readerOrigin);
1774
+ }, [client, view, context, selection.runId]);
1294
1775
  const selectedRow = rows.find((row) => row.id === selection.runId);
1295
1776
  const filteredRows = useMemo(() => {
1296
1777
  const q = filterQuery.trim().toLowerCase();
@@ -1298,141 +1779,171 @@ function DailyVoiceModule() {
1298
1779
  return rows;
1299
1780
  return rows.filter((r) => r.id.toLowerCase().includes(q) || r.status.toLowerCase().includes(q));
1300
1781
  }, [rows, filterQuery]);
1301
- return /* @__PURE__ */ jsxs2("div", {
1302
- className: "kk-board kk-board-daily-voice",
1782
+ const displayDiagnostics = dedupeDiagnostics([
1783
+ ...diagnostics,
1784
+ ...evidence?.diagnostics ?? results?.diagnostics ?? []
1785
+ ]);
1786
+ const freshness = freshnessLabel(readerRefresh);
1787
+ const availability = evidence?.results?.availability ?? results?.availability ?? "unverified";
1788
+ const outcomeWord = newsFamily ? news?.outcome ?? null : legacySummary?.outcome ?? null;
1789
+ const filterBox = /* @__PURE__ */ jsxs2("div", {
1790
+ className: "kk-board-run-filter-group",
1303
1791
  children: [
1304
- /* @__PURE__ */ jsxs2("header", {
1305
- className: "kk-board-header",
1792
+ /* @__PURE__ */ jsx2("input", {
1793
+ type: "text",
1794
+ className: "kk-board-run-filter-input",
1795
+ placeholder: "Filter runs...",
1796
+ value: filterQuery,
1797
+ onChange: (e) => setFilterQuery(e.target.value),
1798
+ "aria-label": "Filter runs"
1799
+ }),
1800
+ /* @__PURE__ */ jsxs2("label", {
1801
+ className: "kk-board-run-selector",
1306
1802
  children: [
1307
- /* @__PURE__ */ jsxs2("div", {
1308
- className: "kk-board-header-left",
1803
+ "Run",
1804
+ /* @__PURE__ */ jsxs2("select", {
1805
+ value: selection.runId ?? "",
1806
+ onChange: (event) => setSelection((state) => ({ ...state, runId: event.target.value || null })),
1309
1807
  children: [
1310
- /* @__PURE__ */ jsxs2("div", {
1311
- className: "kk-board-header-title-row",
1312
- children: [
1313
- /* @__PURE__ */ jsx2("h1", {
1314
- children: "Daily AI Voice"
1315
- }),
1316
- selectedRow ? /* @__PURE__ */ jsx2("span", {
1317
- className: `kk-badge ${selectedRow.status === "done" ? "kk-badge-success" : selectedRow.status === "failed" ? "kk-badge-failed" : "kk-badge-running"}`,
1318
- children: selectedRow.status
1319
- }) : null
1320
- ]
1808
+ /* @__PURE__ */ jsx2("option", {
1809
+ value: "",
1810
+ children: rows.length === 0 ? "No runs recorded" : filteredRows.length === 0 ? "No matching runs" : "Select a run"
1321
1811
  }),
1322
- /* @__PURE__ */ jsxs2("p", {
1323
- children: [
1324
- "Run ",
1325
- /* @__PURE__ */ jsx2("code", {
1326
- children: selection.runId ?? "none selected"
1327
- }),
1328
- " · ",
1329
- freshnessLabel(readerRefresh),
1330
- summary === null ? "" : ` · Outcome ${summary.outcome ?? "unknown"} · ${results?.availability ?? "unverified"}`
1331
- ]
1332
- })
1333
- ]
1334
- }),
1335
- /* @__PURE__ */ jsxs2("div", {
1336
- className: "kk-board-header-right",
1337
- children: [
1338
- /* @__PURE__ */ jsxs2("div", {
1339
- className: "kk-board-run-filter-group",
1812
+ filteredRows.map((row) => /* @__PURE__ */ jsxs2("option", {
1813
+ value: row.id,
1340
1814
  children: [
1341
- /* @__PURE__ */ jsx2("input", {
1342
- type: "text",
1343
- className: "kk-board-run-filter-input",
1344
- placeholder: "Filter runs...",
1345
- value: filterQuery,
1346
- onChange: (e) => setFilterQuery(e.target.value),
1347
- "aria-label": "Filter runs"
1348
- }),
1349
- /* @__PURE__ */ jsxs2("label", {
1350
- className: "kk-board-run-selector",
1351
- children: [
1352
- "Run",
1353
- /* @__PURE__ */ jsxs2("select", {
1354
- value: selection.runId ?? "",
1355
- onChange: (event) => setSelection((state) => ({ ...state, runId: event.target.value || null })),
1356
- children: [
1357
- /* @__PURE__ */ jsx2("option", {
1358
- value: "",
1359
- children: rows.length === 0 ? "No runs recorded" : filteredRows.length === 0 ? "No matching runs" : "Select a run"
1360
- }),
1361
- filteredRows.map((row) => /* @__PURE__ */ jsxs2("option", {
1362
- value: row.id,
1363
- children: [
1364
- row.id,
1365
- " — ",
1366
- row.status
1367
- ]
1368
- }, row.id))
1369
- ]
1370
- })
1371
- ]
1372
- })
1815
+ row.id,
1816
+ " — ",
1817
+ row.status
1373
1818
  ]
1374
- }),
1375
- /* @__PURE__ */ jsx2("button", {
1376
- type: "button",
1377
- onClick: () => void loadReader(),
1378
- title: "Refresh run data",
1379
- children: "↻ Refresh"
1380
- }),
1381
- selection.runId === null ? null : /* @__PURE__ */ jsx2("a", {
1382
- href: selectionPath(selection, window.location.search, MODULE_PATH),
1383
- className: "kk-btn-action",
1384
- title: "Permanent link",
1385
- children: "\uD83D\uDD17 Link"
1386
- })
1819
+ }, row.id))
1387
1820
  ]
1388
1821
  })
1389
1822
  ]
1390
1823
  }),
1391
- /* @__PURE__ */ jsx2("nav", {
1392
- className: "kk-board-tabs",
1393
- "aria-label": "Daily AI Voice tabs",
1394
- children: BOARD_TABS.map((candidate) => /* @__PURE__ */ jsx2("button", {
1395
- type: "button",
1396
- "aria-current": candidate === tab ? "page" : undefined,
1397
- onClick: () => setSelection((state) => ({ ...state, tab: candidate })),
1398
- children: TAB_LABELS[candidate]
1399
- }, candidate))
1824
+ /* @__PURE__ */ jsx2("button", {
1825
+ type: "button",
1826
+ onClick: () => void loadReader(),
1827
+ title: "Refresh run data",
1828
+ children: "↻ Refresh"
1829
+ }),
1830
+ selection.runId === null ? null : /* @__PURE__ */ jsx2("a", {
1831
+ href: selectionPath(selection, window.location.search, MODULE_PATH),
1832
+ className: "kk-btn-action",
1833
+ title: "Permanent link",
1834
+ children: "\uD83D\uDD17 Link"
1835
+ })
1836
+ ]
1837
+ });
1838
+ return /* @__PURE__ */ jsxs2(ModuleShell, {
1839
+ className: "kk-board kk-board-daily-voice",
1840
+ children: [
1841
+ /* @__PURE__ */ jsx2(ModuleHeader, {
1842
+ icon: /* @__PURE__ */ jsx2("span", {
1843
+ "aria-hidden": "true",
1844
+ children: "\uD83C\uDF99️"
1845
+ }),
1846
+ title: "Daily AI Voice",
1847
+ subtitle: /* @__PURE__ */ jsxs2(Fragment, {
1848
+ children: [
1849
+ "Run ",
1850
+ /* @__PURE__ */ jsx2("code", {
1851
+ children: selection.runId ?? "none selected"
1852
+ }),
1853
+ " · ",
1854
+ freshness,
1855
+ " ·",
1856
+ " ",
1857
+ outcomeWord === null ? "outcome unknown" : `Outcome ${outcomeWord}`,
1858
+ " · ",
1859
+ availability
1860
+ ]
1861
+ }),
1862
+ status: selectedRow ? /* @__PURE__ */ jsx2(Badge, {
1863
+ variant: statusBadgeVariant(selectedRow.status),
1864
+ size: "sm",
1865
+ children: selectedRow.status
1866
+ }) : undefined,
1867
+ filters: filterBox,
1868
+ tabs: /* @__PURE__ */ jsx2(ModuleTabs, {
1869
+ tabs: DAILY_VIEWS.map((id) => ({ id, label: VIEW_LABELS[id] })),
1870
+ value: view,
1871
+ onChange: (id) => setSelection((state) => ({ ...state, tab: id })),
1872
+ label: "Daily AI Voice views",
1873
+ idPrefix: VIEW_TABS_ID
1874
+ })
1875
+ }),
1876
+ newsFamily ? null : /* @__PURE__ */ jsx2("p", {
1877
+ className: "kk-board-empty kk-board-retired-layout",
1878
+ children: retiredLayoutNotice({ family, rows, retired: true })
1400
1879
  }),
1401
- rows.length === 0 ? /* @__PURE__ */ jsxs2("p", {
1402
- className: "kk-board-empty",
1880
+ rows.length === 0 ? /* @__PURE__ */ jsxs2(EmptyState, {
1881
+ testId: "daily-voice-no-runs",
1403
1882
  children: [
1404
- "No runs recorded for kk-daily-ai-voice2. Configure the workflow in",
1883
+ "No runs recorded for ",
1884
+ DAILY_WORKFLOW,
1885
+ ". Configure the workflow in",
1405
1886
  " ",
1406
1887
  /* @__PURE__ */ jsx2("a", {
1407
- href: "/board/settings/workflows",
1888
+ href: withBase("/board/settings/workflows"),
1408
1889
  children: "Settings → Workflows"
1409
1890
  }),
1410
1891
  "."
1411
1892
  ]
1412
1893
  }) : null,
1413
- tab === "summary" ? /* @__PURE__ */ jsx2(SummaryPanel, {
1414
- facts,
1415
- results,
1416
- funnel,
1417
- artifacts,
1418
- context,
1419
- supply,
1420
- storeOffline
1421
- }) : null,
1422
- tab === "results" ? /* @__PURE__ */ jsx2(ResultsPanel, {
1423
- artifacts,
1424
- channels: summary?.channels ?? []
1425
- }) : null,
1426
- tab === "progress" ? /* @__PURE__ */ jsx2(ProgressPanel, {
1427
- progress: summary?.progress ?? null
1428
- }) : null,
1429
- tab === "config" ? /* @__PURE__ */ jsx2(ConfigPanel, {
1430
- config
1431
- }) : null,
1432
- dedupeDiagnostics([...diagnostics, ...results?.diagnostics ?? []]).map((diagnostic) => /* @__PURE__ */ jsx2("p", {
1433
- role: "status",
1434
- className: "kk-board-diagnostic",
1435
- children: diagnosticLine(diagnostic)
1894
+ DAILY_VIEWS.map((panelView) => {
1895
+ const active = panelView === view;
1896
+ const panel = panelView === "summary" ? newsFamily ? /* @__PURE__ */ jsx2(NewsSummaryPanel, {
1897
+ evidence,
1898
+ news,
1899
+ facts: newsFacts,
1900
+ issue,
1901
+ context,
1902
+ supply,
1903
+ storeOffline
1904
+ }) : /* @__PURE__ */ jsx2(LegacySummaryPanel, {
1905
+ facts: results === null ? [] : dailySummaryFacts(results, now),
1906
+ results,
1907
+ config,
1908
+ funnel,
1909
+ artifacts: legacyArtifacts,
1910
+ context,
1911
+ supply,
1912
+ storeOffline
1913
+ }) : panelView === "generation" ? newsFamily ? /* @__PURE__ */ jsx2(NewsGenerationPanel, {
1914
+ evidence,
1915
+ news,
1916
+ stages: stageRows,
1917
+ groups: outputRows
1918
+ }) : /* @__PURE__ */ jsxs2(Fragment, {
1919
+ children: [
1920
+ /* @__PURE__ */ jsx2(LegacyResultsPanel, {
1921
+ artifacts: legacyArtifacts,
1922
+ channels: legacySummary?.channels ?? []
1923
+ }),
1924
+ /* @__PURE__ */ jsx2(LegacyProgressPanel, {
1925
+ progress: legacySummary?.progress ?? null
1926
+ })
1927
+ ]
1928
+ }) : newsFamily ? /* @__PURE__ */ jsx2(NewsPublishingPanel, {
1929
+ news
1930
+ }) : /* @__PURE__ */ jsx2(LegacyChannelList, {
1931
+ channels: legacySummary?.channels ?? []
1932
+ });
1933
+ return /* @__PURE__ */ jsx2("div", {
1934
+ id: `${VIEW_TABS_ID}-panel-${panelView}`,
1935
+ role: "tabpanel",
1936
+ "aria-labelledby": `${VIEW_TABS_ID}-${panelView}`,
1937
+ hidden: !active,
1938
+ style: active ? { display: "flex", flexDirection: "column", gap: "0.875rem" } : undefined,
1939
+ children: panel
1940
+ }, panelView);
1941
+ }),
1942
+ displayDiagnostics.map((diagnostic) => /* @__PURE__ */ jsx2(Diagnostic, {
1943
+ tone: "error",
1944
+ title: diagnostic.code,
1945
+ detail: diagnostic.message,
1946
+ testId: "daily-voice-diagnostic"
1436
1947
  }, diagnostic.code)),
1437
1948
  cursor === null ? null : /* @__PURE__ */ jsx2("button", {
1438
1949
  type: "button",
@@ -1452,41 +1963,239 @@ function DailyVoiceModule() {
1452
1963
  ]
1453
1964
  });
1454
1965
  }
1455
- function SummaryPanel({
1966
+ function NewsSummaryPanel({
1967
+ evidence,
1968
+ news,
1456
1969
  facts,
1457
- results,
1458
- funnel,
1459
- artifacts,
1970
+ issue,
1460
1971
  context,
1461
1972
  supply,
1462
1973
  storeOffline
1463
1974
  }) {
1464
- if (results === null)
1465
- return /* @__PURE__ */ jsx2("p", {
1466
- children: "No captured results for the selected run."
1975
+ if (evidence === null)
1976
+ return /* @__PURE__ */ jsx2(EmptyState, {
1977
+ children: "No evidence for the selected run yet."
1467
1978
  });
1468
- const summary = dailySummary(results);
1469
- const liveChannels = summary.channels.filter((c) => c.state === "live").length;
1470
- return /* @__PURE__ */ jsxs2("div", {
1471
- style: { display: "flex", flexDirection: "column", gap: "0.875rem" },
1979
+ const capture = evidence.capture;
1980
+ const settings = capture === null ? [] : Object.entries(capture.settings);
1981
+ return /* @__PURE__ */ jsxs2(Fragment, {
1982
+ children: [
1983
+ issue === null ? null : /* @__PURE__ */ jsx2(Diagnostic, {
1984
+ tone: "error",
1985
+ title: issue.title,
1986
+ detail: issue.detail,
1987
+ testId: "daily-voice-issue"
1988
+ }),
1989
+ uncapturedDiagnostic(evidence) === null ? null : /* @__PURE__ */ jsx2(Diagnostic, {
1990
+ tone: "warning",
1991
+ title: "Attempt not captured",
1992
+ detail: uncapturedDiagnostic(evidence)?.message,
1993
+ code: uncapturedDiagnostic(evidence)?.code,
1994
+ testId: "daily-voice-uncaptured"
1995
+ }),
1996
+ /* @__PURE__ */ jsx2("dl", {
1997
+ className: "kk-board-facts",
1998
+ "data-testid": "daily-voice-summary-facts",
1999
+ children: facts.map((fact) => /* @__PURE__ */ jsxs2("div", {
2000
+ children: [
2001
+ /* @__PURE__ */ jsx2("dt", {
2002
+ children: fact.label
2003
+ }),
2004
+ /* @__PURE__ */ jsxs2("dd", {
2005
+ children: [
2006
+ fact.value,
2007
+ " ",
2008
+ /* @__PURE__ */ jsx2("span", {
2009
+ className: "kk-board-state",
2010
+ children: fact.availability
2011
+ })
2012
+ ]
2013
+ })
2014
+ ]
2015
+ }, fact.label))
2016
+ }),
2017
+ capture === null ? null : /* @__PURE__ */ jsxs2("details", {
2018
+ className: "kk-card",
2019
+ "data-testid": "daily-voice-captured-settings",
2020
+ children: [
2021
+ /* @__PURE__ */ jsxs2("summary", {
2022
+ children: [
2023
+ "Captured settings ",
2024
+ /* @__PURE__ */ jsxs2("span", {
2025
+ className: "kk-stat-sub",
2026
+ children: [
2027
+ "stamp ",
2028
+ capture.stamp
2029
+ ]
2030
+ })
2031
+ ]
2032
+ }),
2033
+ /* @__PURE__ */ jsxs2("div", {
2034
+ className: "kk-board-config",
2035
+ children: [
2036
+ /* @__PURE__ */ jsxs2("p", {
2037
+ children: [
2038
+ "Captured ",
2039
+ formatTimestamp(capture.capturedAt)
2040
+ ]
2041
+ }),
2042
+ settings.length === 0 ? /* @__PURE__ */ jsx2("p", {
2043
+ children: "No settings were recorded for this attempt."
2044
+ }) : null,
2045
+ /* @__PURE__ */ jsx2("dl", {
2046
+ children: settings.map(([key, value]) => /* @__PURE__ */ jsxs2("div", {
2047
+ children: [
2048
+ /* @__PURE__ */ jsx2("dt", {
2049
+ children: key
2050
+ }),
2051
+ /* @__PURE__ */ jsx2("dd", {
2052
+ children: value
2053
+ })
2054
+ ]
2055
+ }, key))
2056
+ }),
2057
+ capture.definitionDigest === undefined ? null : /* @__PURE__ */ jsxs2("p", {
2058
+ children: [
2059
+ "Definition digest ",
2060
+ /* @__PURE__ */ jsx2("code", {
2061
+ children: capture.definitionDigest
2062
+ })
2063
+ ]
2064
+ })
2065
+ ]
2066
+ })
2067
+ ]
2068
+ }),
2069
+ /* @__PURE__ */ jsx2(SupplyPanel, {
2070
+ context,
2071
+ supply,
2072
+ storeOffline
2073
+ }),
2074
+ news === null ? /* @__PURE__ */ jsx2("p", {
2075
+ className: "kk-board-footnote",
2076
+ children: "The generation and publishing views stay empty for an uncaptured attempt — fixed artifacts are unknown, never invented."
2077
+ }) : null
2078
+ ]
2079
+ });
2080
+ }
2081
+ function StageRow({ stage }) {
2082
+ return /* @__PURE__ */ jsxs2("li", {
2083
+ children: [
2084
+ /* @__PURE__ */ jsx2("strong", {
2085
+ children: stage.label
2086
+ }),
2087
+ " ",
2088
+ /* @__PURE__ */ jsx2(Badge, {
2089
+ variant: TONE_BADGE[stage.tone],
2090
+ size: "sm",
2091
+ children: stage.word
2092
+ }),
2093
+ stage.timing === null ? null : /* @__PURE__ */ jsxs2("span", {
2094
+ className: "kk-board-state",
2095
+ children: [
2096
+ " ",
2097
+ stage.timing
2098
+ ]
2099
+ })
2100
+ ]
2101
+ });
2102
+ }
2103
+ function ArtifactRow({ artifact }) {
2104
+ if (artifact.href === null) {
2105
+ return /* @__PURE__ */ jsx2("li", {
2106
+ children: /* @__PURE__ */ jsxs2("span", {
2107
+ children: [
2108
+ artifact.label,
2109
+ " — ",
2110
+ artifact.state
2111
+ ]
2112
+ })
2113
+ }, artifact.id);
2114
+ }
2115
+ if (artifact.kind === "audio") {
2116
+ return /* @__PURE__ */ jsxs2("li", {
2117
+ children: [
2118
+ /* @__PURE__ */ jsx2("audio", {
2119
+ controls: true,
2120
+ src: artifact.href,
2121
+ children: /* @__PURE__ */ jsx2("track", {
2122
+ kind: "captions"
2123
+ })
2124
+ }),
2125
+ " ",
2126
+ /* @__PURE__ */ jsxs2("a", {
2127
+ href: artifact.href,
2128
+ download: true,
2129
+ children: [
2130
+ "download ",
2131
+ artifact.label
2132
+ ]
2133
+ }),
2134
+ " ",
2135
+ "— ",
2136
+ artifact.state
2137
+ ]
2138
+ }, artifact.id);
2139
+ }
2140
+ if (artifact.kind === "image") {
2141
+ return /* @__PURE__ */ jsxs2("li", {
2142
+ children: [
2143
+ /* @__PURE__ */ jsx2("img", {
2144
+ src: artifact.href,
2145
+ alt: artifact.label
2146
+ }),
2147
+ " ",
2148
+ artifact.label,
2149
+ " — ",
2150
+ artifact.state
2151
+ ]
2152
+ }, artifact.id);
2153
+ }
2154
+ return /* @__PURE__ */ jsxs2("li", {
2155
+ children: [
2156
+ /* @__PURE__ */ jsx2("a", {
2157
+ href: artifact.href,
2158
+ children: artifact.label
2159
+ }),
2160
+ " — ",
2161
+ artifact.state
2162
+ ]
2163
+ }, artifact.id);
2164
+ }
2165
+ function NewsGenerationPanel({
2166
+ evidence,
2167
+ news,
2168
+ stages,
2169
+ groups
2170
+ }) {
2171
+ if (evidence === null || evidence.results === null) {
2172
+ return /* @__PURE__ */ jsx2(EmptyState, {
2173
+ testId: "daily-voice-generation-empty",
2174
+ children: "No captured projection for the selected run."
2175
+ });
2176
+ }
2177
+ const gate = news?.generation.gate.status ?? null;
2178
+ const launch = news?.generation.launch ?? null;
2179
+ return /* @__PURE__ */ jsxs2(Fragment, {
1472
2180
  children: [
1473
2181
  /* @__PURE__ */ jsxs2("div", {
1474
2182
  className: "kk-stat-grid",
2183
+ "data-testid": "daily-voice-generation-facts",
1475
2184
  children: [
1476
2185
  /* @__PURE__ */ jsxs2("div", {
1477
2186
  className: "kk-stat-card",
1478
2187
  children: [
1479
2188
  /* @__PURE__ */ jsx2("span", {
1480
2189
  className: "kk-stat-label",
1481
- children: "Episode Outcome"
2190
+ children: "Generation outcome"
1482
2191
  }),
1483
2192
  /* @__PURE__ */ jsx2("span", {
1484
2193
  className: "kk-stat-value",
1485
- children: summary.outcome ?? "—"
2194
+ children: news?.generation.outcome ?? "—"
1486
2195
  }),
1487
2196
  /* @__PURE__ */ jsx2("span", {
1488
2197
  className: "kk-stat-sub",
1489
- children: summary.articleTitle ? summary.articleTitle.slice(0, 32) : "Daily podcast"
2198
+ children: "from the recorded result files"
1490
2199
  })
1491
2200
  ]
1492
2201
  }),
@@ -1495,19 +2204,15 @@ function SummaryPanel({
1495
2204
  children: [
1496
2205
  /* @__PURE__ */ jsx2("span", {
1497
2206
  className: "kk-stat-label",
1498
- children: "Distribution"
2207
+ children: "Pool gate"
1499
2208
  }),
1500
- /* @__PURE__ */ jsxs2("span", {
2209
+ /* @__PURE__ */ jsx2("span", {
1501
2210
  className: "kk-stat-value",
1502
- children: [
1503
- liveChannels,
1504
- " / ",
1505
- summary.channels.length
1506
- ]
2211
+ children: gate ?? "—"
1507
2212
  }),
1508
2213
  /* @__PURE__ */ jsx2("span", {
1509
2214
  className: "kk-stat-sub",
1510
- children: "Channels published live"
2215
+ children: "pool-gate verdict"
1511
2216
  })
1512
2217
  ]
1513
2218
  }),
@@ -1516,68 +2221,281 @@ function SummaryPanel({
1516
2221
  children: [
1517
2222
  /* @__PURE__ */ jsx2("span", {
1518
2223
  className: "kk-stat-label",
1519
- children: "Quality Score"
2224
+ children: "Launch receipt"
1520
2225
  }),
1521
2226
  /* @__PURE__ */ jsx2("span", {
1522
2227
  className: "kk-stat-value",
1523
- children: summary.quality?.overallScore ?? "—"
2228
+ children: launch?.status ?? "—"
1524
2229
  }),
1525
2230
  /* @__PURE__ */ jsx2("span", {
1526
2231
  className: "kk-stat-sub",
1527
- children: summary.quality?.passed ? "Passed QC standard" : "Under evaluation"
2232
+ children: launch === null ? "not recorded" : launch.stale ? `stale — receipt run ${launch.runId ?? "unknown"} is not this attempt` : `run ${launch.runId ?? "unknown"}`
2233
+ })
2234
+ ]
2235
+ })
2236
+ ]
2237
+ }),
2238
+ stages.length === 0 ? /* @__PURE__ */ jsx2("p", {
2239
+ children: "No producer stages were recorded for this attempt."
2240
+ }) : /* @__PURE__ */ jsx2("ul", {
2241
+ className: "kk-board-progress",
2242
+ "data-testid": "daily-voice-generation-stages",
2243
+ children: stages.map((stage) => /* @__PURE__ */ jsx2(StageRow, {
2244
+ stage
2245
+ }, stage.id))
2246
+ }),
2247
+ groups.length === 0 ? /* @__PURE__ */ jsx2("p", {
2248
+ children: "No fixed artifacts were recorded for this attempt."
2249
+ }) : groups.map((group) => /* @__PURE__ */ jsxs2("details", {
2250
+ className: "kk-card",
2251
+ "data-testid": "daily-voice-artifact-group",
2252
+ children: [
2253
+ /* @__PURE__ */ jsxs2("summary", {
2254
+ children: [
2255
+ group.label,
2256
+ " ",
2257
+ /* @__PURE__ */ jsxs2("span", {
2258
+ className: "kk-stat-sub",
2259
+ children: [
2260
+ group.artifacts.filter((a) => a.href !== null).length,
2261
+ " available of",
2262
+ " ",
2263
+ group.artifacts.length
2264
+ ]
1528
2265
  })
1529
2266
  ]
1530
2267
  }),
2268
+ /* @__PURE__ */ jsx2("ul", {
2269
+ className: "kk-board-artifacts",
2270
+ children: group.artifacts.map((artifact) => /* @__PURE__ */ jsx2(ArtifactRow, {
2271
+ artifact
2272
+ }, artifact.id))
2273
+ })
2274
+ ]
2275
+ }, group.producer || "unattributed"))
2276
+ ]
2277
+ });
2278
+ }
2279
+ function countWord(value) {
2280
+ return value === null ? "not recorded" : `${value}`;
2281
+ }
2282
+ function countSumWord(left, right) {
2283
+ return left === null || right === null ? "not recorded" : `${left + right}`;
2284
+ }
2285
+ function ProvenanceRow({ label, matched }) {
2286
+ const word = matched === null ? "unknown" : matched ? "matched" : "MISMATCHED";
2287
+ const tone = matched === null ? "neutral" : matched ? "success" : "error";
2288
+ return /* @__PURE__ */ jsxs2("li", {
2289
+ children: [
2290
+ label,
2291
+ " ",
2292
+ /* @__PURE__ */ jsx2(Badge, {
2293
+ variant: TONE_BADGE[tone],
2294
+ size: "sm",
2295
+ children: word
2296
+ })
2297
+ ]
2298
+ });
2299
+ }
2300
+ function TargetRow({ target }) {
2301
+ return /* @__PURE__ */ jsxs2("li", {
2302
+ "data-testid": "daily-voice-publish-target",
2303
+ children: [
2304
+ /* @__PURE__ */ jsx2("strong", {
2305
+ children: target.id
2306
+ }),
2307
+ " ",
2308
+ /* @__PURE__ */ jsx2(Badge, {
2309
+ variant: TONE_BADGE[target.tone],
2310
+ size: "sm",
2311
+ children: target.word
2312
+ }),
2313
+ target.target === null ? null : /* @__PURE__ */ jsxs2("span", {
2314
+ children: [
2315
+ " · ",
2316
+ target.target
2317
+ ]
2318
+ }),
2319
+ target.mode === null ? null : /* @__PURE__ */ jsxs2("span", {
2320
+ children: [
2321
+ " (",
2322
+ target.mode,
2323
+ ")"
2324
+ ]
2325
+ }),
2326
+ target.url === null ? null : /* @__PURE__ */ jsxs2(Fragment, {
2327
+ children: [
2328
+ " ",
2329
+ /* @__PURE__ */ jsx2("a", {
2330
+ href: target.url,
2331
+ rel: "noreferrer",
2332
+ children: "open"
2333
+ })
2334
+ ]
2335
+ }),
2336
+ target.error === null ? null : /* @__PURE__ */ jsxs2("span", {
2337
+ className: "kk-board-state",
2338
+ children: [
2339
+ " — ",
2340
+ target.error
2341
+ ]
2342
+ }),
2343
+ target.finishedAt === null ? null : /* @__PURE__ */ jsxs2("span", {
2344
+ className: "kk-board-state",
2345
+ children: [
2346
+ " finished ",
2347
+ formatTimestamp(target.finishedAt)
2348
+ ]
2349
+ }),
2350
+ /* @__PURE__ */ jsxs2("span", {
2351
+ className: "kk-board-state",
2352
+ children: [
2353
+ " ",
2354
+ "evidence ",
2355
+ /* @__PURE__ */ jsx2("code", {
2356
+ children: target.evidence.plan
2357
+ }),
2358
+ target.evidence.receipt === null ? " · receipt not recorded" : /* @__PURE__ */ jsxs2("code", {
2359
+ children: [
2360
+ " · ",
2361
+ target.evidence.receipt
2362
+ ]
2363
+ })
2364
+ ]
2365
+ })
2366
+ ]
2367
+ }, target.id);
2368
+ }
2369
+ function NewsPublishingPanel({ news }) {
2370
+ if (news === null) {
2371
+ return /* @__PURE__ */ jsx2(EmptyState, {
2372
+ testId: "daily-voice-publishing-empty",
2373
+ children: "No captured publishing projection for the selected run."
2374
+ });
2375
+ }
2376
+ const bundle = news.publishing.bundle;
2377
+ const rows = publishingWindowRows(news);
2378
+ return /* @__PURE__ */ jsxs2(Fragment, {
2379
+ children: [
2380
+ /* @__PURE__ */ jsxs2("div", {
2381
+ className: "kk-stat-grid",
2382
+ "data-testid": "daily-voice-bundle",
2383
+ children: [
1531
2384
  /* @__PURE__ */ jsxs2("div", {
1532
2385
  className: "kk-stat-card",
1533
2386
  children: [
1534
2387
  /* @__PURE__ */ jsx2("span", {
1535
2388
  className: "kk-stat-label",
1536
- children: "Safety Verdict"
2389
+ children: "Bundle"
1537
2390
  }),
1538
2391
  /* @__PURE__ */ jsx2("span", {
1539
2392
  className: "kk-stat-value",
1540
- children: summary.safety?.verdict ?? "—"
2393
+ children: bundle?.title ?? "—"
2394
+ }),
2395
+ /* @__PURE__ */ jsx2("span", {
2396
+ className: "kk-stat-sub",
2397
+ children: bundle === null ? "not recorded" : bundle.identity
2398
+ })
2399
+ ]
2400
+ }),
2401
+ /* @__PURE__ */ jsxs2("div", {
2402
+ className: "kk-stat-card",
2403
+ children: [
2404
+ /* @__PURE__ */ jsx2("span", {
2405
+ className: "kk-stat-label",
2406
+ children: "Run date"
2407
+ }),
2408
+ /* @__PURE__ */ jsx2("span", {
2409
+ className: "kk-stat-value",
2410
+ children: bundle?.runDate ?? "—"
2411
+ }),
2412
+ /* @__PURE__ */ jsx2("span", {
2413
+ className: "kk-stat-sub",
2414
+ children: bundle?.variants.length ? `variants ${bundle.variants.join(", ")}` : "variants unrecorded"
2415
+ })
2416
+ ]
2417
+ }),
2418
+ /* @__PURE__ */ jsxs2("div", {
2419
+ className: "kk-stat-card",
2420
+ children: [
2421
+ /* @__PURE__ */ jsx2("span", {
2422
+ className: "kk-stat-label",
2423
+ children: "Targets"
2424
+ }),
2425
+ /* @__PURE__ */ jsxs2("span", {
2426
+ className: "kk-stat-value",
2427
+ children: [
2428
+ countWord(news.counts.targetsSucceeded),
2429
+ " sent"
2430
+ ]
1541
2431
  }),
1542
2432
  /* @__PURE__ */ jsxs2("span", {
1543
2433
  className: "kk-stat-sub",
1544
2434
  children: [
1545
- "Confidence: ",
1546
- summary.safety?.confidence ?? "—"
2435
+ countSumWord(news.counts.targetsFailed, news.counts.targetsUncertain),
2436
+ " failed or uncertain ·",
2437
+ " ",
2438
+ countWord(news.counts.targetsPlanned),
2439
+ " planned"
1547
2440
  ]
1548
2441
  })
1549
2442
  ]
1550
2443
  })
1551
2444
  ]
1552
2445
  }),
1553
- /* @__PURE__ */ jsx2("dl", {
1554
- className: "kk-board-facts",
1555
- children: facts.map((fact) => /* @__PURE__ */ jsxs2("div", {
1556
- children: [
1557
- /* @__PURE__ */ jsx2("dt", {
1558
- children: fact.label
1559
- }),
1560
- /* @__PURE__ */ jsxs2("dd", {
1561
- children: [
1562
- fact.value,
1563
- " ",
1564
- /* @__PURE__ */ jsx2("span", {
1565
- className: "kk-board-state",
1566
- children: fact.availability
1567
- })
1568
- ]
1569
- })
1570
- ]
1571
- }, fact.label))
2446
+ bundle?.parentRunId == null ? null : /* @__PURE__ */ jsxs2("p", {
2447
+ children: [
2448
+ "Parent run ",
2449
+ /* @__PURE__ */ jsx2("code", {
2450
+ children: bundle.parentRunId
2451
+ })
2452
+ ]
1572
2453
  }),
1573
- /* @__PURE__ */ jsx2(FunnelPanel, {
1574
- funnel,
1575
- artifacts
2454
+ bundle?.safety == null ? null : /* @__PURE__ */ jsxs2("p", {
2455
+ children: [
2456
+ "Safety: ",
2457
+ bundle.safety
2458
+ ]
1576
2459
  }),
1577
- /* @__PURE__ */ jsx2(SupplyPanel, {
1578
- context,
1579
- supply,
1580
- storeOffline
2460
+ rows.length === 0 ? /* @__PURE__ */ jsx2(EmptyState, {
2461
+ children: "No publishable window was recorded for this attempt."
2462
+ }) : rows.map((row) => /* @__PURE__ */ jsxs2("section", {
2463
+ className: "kk-card",
2464
+ "data-testid": "daily-voice-publish-window",
2465
+ children: [
2466
+ /* @__PURE__ */ jsxs2("div", {
2467
+ className: "kk-card-header",
2468
+ children: [
2469
+ /* @__PURE__ */ jsx2("h2", {
2470
+ children: row.label
2471
+ }),
2472
+ /* @__PURE__ */ jsx2(Badge, {
2473
+ variant: row.recorded === null ? "neutral" : TONE_BADGE[row.recorded.tone],
2474
+ size: "sm",
2475
+ children: row.recorded === null ? "outcome not recorded" : row.recorded.word
2476
+ })
2477
+ ]
2478
+ }),
2479
+ /* @__PURE__ */ jsx2("ul", {
2480
+ className: "kk-board-edges",
2481
+ children: row.provenance.map((check) => /* @__PURE__ */ jsx2(ProvenanceRow, {
2482
+ label: check.label,
2483
+ matched: check.matched
2484
+ }, check.label))
2485
+ }),
2486
+ row.targets.length === 0 ? /* @__PURE__ */ jsx2("p", {
2487
+ children: "No target plan was recorded for this window."
2488
+ }) : /* @__PURE__ */ jsx2("ul", {
2489
+ className: "kk-board-channels",
2490
+ children: row.targets.map((target) => /* @__PURE__ */ jsx2(TargetRow, {
2491
+ target
2492
+ }, target.id))
2493
+ })
2494
+ ]
2495
+ }, row.window)),
2496
+ /* @__PURE__ */ jsx2("p", {
2497
+ className: "kk-board-footnote",
2498
+ children: "Evidence paths are workspace-relative references recorded by the run — shown as text, never turned into links."
1581
2499
  })
1582
2500
  ]
1583
2501
  });
@@ -1851,14 +2769,199 @@ function SupplyPanel({
1851
2769
  }) : null,
1852
2770
  /* @__PURE__ */ jsx2("p", {
1853
2771
  className: "kk-board-footnote",
1854
- children: "A source absent from this window recorded 0 contributions; its health is unknown. The episode funnel above stays artifact-backed — supply here is context, not the run’s consumption record."
2772
+ children: "A source absent from this window recorded 0 contributions; its health is unknown. The artifact-backed evidence stays the consumption record — supply here is context, not consumption."
1855
2773
  })
1856
2774
  ]
1857
2775
  });
1858
2776
  }
1859
- function ChannelList({ channels }) {
2777
+ function LegacySummaryPanel({
2778
+ facts,
2779
+ results,
2780
+ config,
2781
+ funnel,
2782
+ artifacts,
2783
+ context,
2784
+ supply,
2785
+ storeOffline
2786
+ }) {
2787
+ if (results === null)
2788
+ return /* @__PURE__ */ jsx2(EmptyState, {
2789
+ children: "No captured results for the selected run."
2790
+ });
2791
+ const summary = dailySummary(results);
2792
+ const settings = config === null ? [] : Object.entries(config.settings);
2793
+ const liveChannels = summary.channels.filter((c) => c.state === "live").length;
2794
+ return /* @__PURE__ */ jsxs2(Fragment, {
2795
+ children: [
2796
+ /* @__PURE__ */ jsxs2("div", {
2797
+ className: "kk-stat-grid",
2798
+ children: [
2799
+ /* @__PURE__ */ jsxs2("div", {
2800
+ className: "kk-stat-card",
2801
+ children: [
2802
+ /* @__PURE__ */ jsx2("span", {
2803
+ className: "kk-stat-label",
2804
+ children: "Episode Outcome"
2805
+ }),
2806
+ /* @__PURE__ */ jsx2("span", {
2807
+ className: "kk-stat-value",
2808
+ children: summary.outcome ?? "—"
2809
+ }),
2810
+ /* @__PURE__ */ jsx2("span", {
2811
+ className: "kk-stat-sub",
2812
+ children: summary.articleTitle ? summary.articleTitle.slice(0, 32) : "Daily podcast"
2813
+ })
2814
+ ]
2815
+ }),
2816
+ /* @__PURE__ */ jsxs2("div", {
2817
+ className: "kk-stat-card",
2818
+ children: [
2819
+ /* @__PURE__ */ jsx2("span", {
2820
+ className: "kk-stat-label",
2821
+ children: "Distribution"
2822
+ }),
2823
+ /* @__PURE__ */ jsxs2("span", {
2824
+ className: "kk-stat-value",
2825
+ children: [
2826
+ liveChannels,
2827
+ " / ",
2828
+ summary.channels.length
2829
+ ]
2830
+ }),
2831
+ /* @__PURE__ */ jsx2("span", {
2832
+ className: "kk-stat-sub",
2833
+ children: "Channels published live"
2834
+ })
2835
+ ]
2836
+ }),
2837
+ /* @__PURE__ */ jsxs2("div", {
2838
+ className: "kk-stat-card",
2839
+ children: [
2840
+ /* @__PURE__ */ jsx2("span", {
2841
+ className: "kk-stat-label",
2842
+ children: "Quality Score"
2843
+ }),
2844
+ /* @__PURE__ */ jsx2("span", {
2845
+ className: "kk-stat-value",
2846
+ children: summary.quality?.overallScore ?? "—"
2847
+ }),
2848
+ /* @__PURE__ */ jsx2("span", {
2849
+ className: "kk-stat-sub",
2850
+ children: summary.quality?.passed ? "Passed QC standard" : "Under evaluation"
2851
+ })
2852
+ ]
2853
+ }),
2854
+ /* @__PURE__ */ jsxs2("div", {
2855
+ className: "kk-stat-card",
2856
+ children: [
2857
+ /* @__PURE__ */ jsx2("span", {
2858
+ className: "kk-stat-label",
2859
+ children: "Safety Verdict"
2860
+ }),
2861
+ /* @__PURE__ */ jsx2("span", {
2862
+ className: "kk-stat-value",
2863
+ children: summary.safety?.verdict ?? "—"
2864
+ }),
2865
+ /* @__PURE__ */ jsxs2("span", {
2866
+ className: "kk-stat-sub",
2867
+ children: [
2868
+ "Confidence: ",
2869
+ summary.safety?.confidence ?? "—"
2870
+ ]
2871
+ })
2872
+ ]
2873
+ })
2874
+ ]
2875
+ }),
2876
+ /* @__PURE__ */ jsx2("dl", {
2877
+ className: "kk-board-facts",
2878
+ children: facts.map((fact) => /* @__PURE__ */ jsxs2("div", {
2879
+ children: [
2880
+ /* @__PURE__ */ jsx2("dt", {
2881
+ children: fact.label
2882
+ }),
2883
+ /* @__PURE__ */ jsxs2("dd", {
2884
+ children: [
2885
+ fact.value,
2886
+ " ",
2887
+ /* @__PURE__ */ jsx2("span", {
2888
+ className: "kk-board-state",
2889
+ children: fact.availability
2890
+ })
2891
+ ]
2892
+ })
2893
+ ]
2894
+ }, fact.label))
2895
+ }),
2896
+ config === null ? null : /* @__PURE__ */ jsxs2("details", {
2897
+ className: "kk-card",
2898
+ "data-testid": "daily-voice-captured-config",
2899
+ children: [
2900
+ /* @__PURE__ */ jsxs2("summary", {
2901
+ children: [
2902
+ "Captured configuration",
2903
+ " ",
2904
+ /* @__PURE__ */ jsx2("span", {
2905
+ className: "kk-stat-sub",
2906
+ children: config.capturedAt === null ? "capture time not recorded" : `captured ${formatTimestamp(config.capturedAt)}`
2907
+ })
2908
+ ]
2909
+ }),
2910
+ /* @__PURE__ */ jsxs2("div", {
2911
+ className: "kk-board-config",
2912
+ children: [
2913
+ /* @__PURE__ */ jsx2("p", {
2914
+ children: config.capturedAt === null ? "This run predates capture: its settings are unknown, never today’s defaults." : `Captured ${formatTimestamp(config.capturedAt)}`
2915
+ }),
2916
+ settings.length === 0 ? /* @__PURE__ */ jsx2("p", {
2917
+ children: "No settings were recorded for this run."
2918
+ }) : /* @__PURE__ */ jsx2("dl", {
2919
+ children: settings.map(([key, value]) => /* @__PURE__ */ jsxs2("div", {
2920
+ children: [
2921
+ /* @__PURE__ */ jsx2("dt", {
2922
+ children: key
2923
+ }),
2924
+ /* @__PURE__ */ jsx2("dd", {
2925
+ children: value
2926
+ })
2927
+ ]
2928
+ }, key))
2929
+ }),
2930
+ config.unavailableKeys.length === 0 ? null : /* @__PURE__ */ jsxs2("p", {
2931
+ children: [
2932
+ "Not captured: ",
2933
+ /* @__PURE__ */ jsx2("code", {
2934
+ children: config.unavailableKeys.join(", ")
2935
+ })
2936
+ ]
2937
+ }),
2938
+ config.definitionDigest === undefined ? null : /* @__PURE__ */ jsxs2("p", {
2939
+ children: [
2940
+ "Definition digest ",
2941
+ /* @__PURE__ */ jsx2("code", {
2942
+ children: config.definitionDigest
2943
+ })
2944
+ ]
2945
+ })
2946
+ ]
2947
+ })
2948
+ ]
2949
+ }),
2950
+ /* @__PURE__ */ jsx2(FunnelPanel, {
2951
+ funnel,
2952
+ artifacts
2953
+ }),
2954
+ /* @__PURE__ */ jsx2(SupplyPanel, {
2955
+ context,
2956
+ supply,
2957
+ storeOffline
2958
+ })
2959
+ ]
2960
+ });
2961
+ }
2962
+ function LegacyChannelList({ channels }) {
1860
2963
  if (channels.length === 0)
1861
- return /* @__PURE__ */ jsx2("p", {
2964
+ return /* @__PURE__ */ jsx2(EmptyState, {
1862
2965
  children: "No channel outcomes recorded for the selected run."
1863
2966
  });
1864
2967
  return /* @__PURE__ */ jsx2("ul", {
@@ -1892,12 +2995,9 @@ function ChannelList({ channels }) {
1892
2995
  }, channel.channel))
1893
2996
  });
1894
2997
  }
1895
- function ResultsPanel({
1896
- artifacts,
1897
- channels
1898
- }) {
2998
+ function LegacyResultsPanel({ artifacts, channels }) {
1899
2999
  if (artifacts.length === 0)
1900
- return /* @__PURE__ */ jsx2("p", {
3000
+ return /* @__PURE__ */ jsx2(EmptyState, {
1901
3001
  children: "No artifact evidence for the selected run."
1902
3002
  });
1903
3003
  const media = artifacts.filter((artifact) => artifact.kind === "image" || artifact.kind === "audio");
@@ -1963,15 +3063,15 @@ function ResultsPanel({
1963
3063
  })
1964
3064
  }, artifact.id))
1965
3065
  }),
1966
- /* @__PURE__ */ jsx2(ChannelList, {
3066
+ /* @__PURE__ */ jsx2(LegacyChannelList, {
1967
3067
  channels
1968
3068
  })
1969
3069
  ]
1970
3070
  });
1971
3071
  }
1972
- function ProgressPanel({ progress }) {
3072
+ function LegacyProgressPanel({ progress }) {
1973
3073
  if (progress === null || progress.nodes.length === 0) {
1974
- return /* @__PURE__ */ jsx2("p", {
3074
+ return /* @__PURE__ */ jsx2(EmptyState, {
1975
3075
  children: "Recorded progress is unavailable for the selected run."
1976
3076
  });
1977
3077
  }
@@ -2013,7 +3113,7 @@ function ProgressPanel({ progress }) {
2013
3113
  "Dependency edges are unknown — no digest-verified topology was captured. See",
2014
3114
  " ",
2015
3115
  /* @__PURE__ */ jsx2("a", {
2016
- href: "/board/settings/workflows",
3116
+ href: withBase("/board/settings/workflows"),
2017
3117
  children: "Settings → Workflows"
2018
3118
  }),
2019
3119
  " for the current graph."
@@ -2030,55 +3130,6 @@ function ProgressPanel({ progress }) {
2030
3130
  ]
2031
3131
  });
2032
3132
  }
2033
- function ConfigPanel({ config }) {
2034
- if (config === null)
2035
- return /* @__PURE__ */ jsx2("p", {
2036
- children: "No captured configuration for the selected run."
2037
- });
2038
- const entries = Object.entries(config.settings);
2039
- return /* @__PURE__ */ jsxs2("div", {
2040
- className: "kk-board-config",
2041
- children: [
2042
- /* @__PURE__ */ jsxs2("p", {
2043
- children: [
2044
- "Captured ",
2045
- formatTimestamp(config.capturedAt)
2046
- ]
2047
- }),
2048
- entries.length === 0 ? /* @__PURE__ */ jsx2("p", {
2049
- children: "Recorded configuration unavailable for this run."
2050
- }) : null,
2051
- /* @__PURE__ */ jsx2("dl", {
2052
- children: entries.map(([key, value]) => /* @__PURE__ */ jsxs2("div", {
2053
- children: [
2054
- /* @__PURE__ */ jsx2("dt", {
2055
- children: key
2056
- }),
2057
- /* @__PURE__ */ jsx2("dd", {
2058
- children: value
2059
- })
2060
- ]
2061
- }, key))
2062
- }),
2063
- config.unavailableKeys.length === 0 ? null : /* @__PURE__ */ jsxs2("p", {
2064
- children: [
2065
- "Uncaptured keys: ",
2066
- config.unavailableKeys.join(", ")
2067
- ]
2068
- }),
2069
- /* @__PURE__ */ jsxs2("p", {
2070
- children: [
2071
- "Current definitions and defaults live in ",
2072
- /* @__PURE__ */ jsx2("a", {
2073
- href: "/board/settings/workflows",
2074
- children: "Settings → Workflows"
2075
- }),
2076
- "."
2077
- ]
2078
- })
2079
- ]
2080
- });
2081
- }
2082
3133
  var webModule = { apiVersion: 1, component: DailyVoiceModule };
2083
3134
  export {
2084
3135
  DailyVoiceModule,