Send article content hash to Podcaster handoff
Send candidate.content_sha256 as article_sha256 so Podcaster validation checks the exact UTF-8 article_content bytes while retaining summary_sha256 as a fallback for older manifests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aedd832c-b34f-4b82-868b-2968af68c656
Juan Manuel Servera committed
Jul 24, 2026 at 01:14 UTC
a70873b31cbe83d4c84d784b42e43ec9b7667e3a
2 files changed
+7
-8
scripts/podcaster_handoff.py
+4
-5
@@ -690,11 +690,10 @@ def build_payload(
690
payload["article_title"] = title
691
if summary:
692
payload["article_summary"] = summary
693
- article_sha = (
694
- manifest.get("candidate", {}).get("summary_sha256")
695
- if isinstance(manifest.get("candidate"), dict)
696
- else None
697
- )
693
+ candidate = manifest.get("candidate")
694
+ article_sha = None
695
+ if isinstance(candidate, dict):
696
+ article_sha = candidate.get("content_sha256") or candidate.get("summary_sha256")
697
if (
698
isinstance(article_sha, str)
699
and len(article_sha) == 64
tests/test_podcaster_handoff.py
+3
-3
@@ -181,7 +181,7 @@ class PodcasterHandoffTests(unittest.TestCase):
181
self.assertEqual(payload["article_path"], "content/weekly/2026/W23.md")
182
self.assertEqual(payload["publish_run_id"], "123456789")
183
self.assertEqual(payload["publish_mode"], "normal")
184
- self.assertEqual(payload["article_sha256"], "a" * 64)
184
+ self.assertEqual(payload["article_sha256"], "c" * 64)
185
self.assertEqual(
186
payload["source_artifacts"],
187
[
@@ -252,10 +252,10 @@ class PodcasterHandoffTests(unittest.TestCase):
252
"signal worth reading in full.\n"
253
)
254
(article_dir / "W23.md").write_text(article_text, encoding="utf-8")
255
- # Point candidate.summary_sha256 at the real article bytes so the emitted
255
+ # Point candidate.content_sha256 at the real article bytes so the emitted
256
# payload.article_sha256 matches what the Podcaster recomputes and checks.
257
manifest_data = json.loads(manifest.read_text(encoding="utf-8"))
258
- manifest_data["candidate"]["summary_sha256"] = hashlib.sha256(
258
+ manifest_data["candidate"]["content_sha256"] = hashlib.sha256(
259
article_text.encode("utf-8")
260
).hexdigest()
261
manifest.write_text(json.dumps(manifest_data), encoding="utf-8")