feat(ingest): per-post body-capture + recapture diagnostics logging
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 33s
CI / integration (push) Successful in 3m30s

Operator-flagged: a recapture 'caught nothing' for a post and there were no
logs explaining why. Three silent spots now log, so a recapture's per-post
outcome is diagnosable (retention bounds the volume):

- patreon_client.fetch_post_detail_content: the 200-OK-but-null-content branch
  was silent — now logs 'fetched N chars' on success AND 'empty/null content
  (tier-gated or no text)' on the empty case (the most common silent miss).
- patreon_downloader.write_post_record: logs each post's FINAL body outcome
  (captured N chars / NO body) read off the memoized attrs after detail-fetch.
- ingest_core summary: appends post-record + relinked counts to the run summary
  (surfaces on the event stdout the operator already reads).
- download_service phase3: logs how many on-disk images got source_filehash
  relinked (N/total) per recapture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 22:10:59 -04:00
parent 65ec29ba9b
commit b999480db5
5 changed files with 43 additions and 6 deletions
+11 -1
View File
@@ -609,7 +609,17 @@ class PatreonClient:
data = payload.get("data") if isinstance(payload, dict) else None
attrs = data.get("attributes") if isinstance(data, dict) else None
content = attrs.get("content") if isinstance(attrs, dict) else None
return content if isinstance(content, str) and content.strip() else None
if isinstance(content, str) and content.strip():
log.info("post-detail: fetched %d chars (post %s)", len(content), post_id)
return content
# 200 OK but content is null/empty — the common silent case (a tier-gated
# post serves content:null, or the post genuinely has no text body). Logged
# so a recapture that "caught nothing" is diagnosable, not invisible.
log.info(
"post-detail: empty/null content (post %s) — body unavailable "
"(tier-gated, or post has no text)", post_id,
)
return None
# -- verify ------------------------------------------------------------