refactor(core): share page media resolution and composition - #416
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 12:01 AM ET / 04:01 UTC. ClawSweeper reviewWhat this changesShares media detection, transcript resolution, and article/transcript composition between HTML and Firecrawl extraction while preserving their separate extraction policies. Merge readiness✅ Ready for maintainer review Keep open: this is a useful internal refactor, and the duplicated orchestration remains on pinned main and in the latest release. No actionable correctness or security findings were identified. Priority: P3 Review scores
Verification
How this fits togetherSummarize’s core extraction library turns fetched HTML or Firecrawl results into content for summarization. The shared media layer resolves embedded transcripts and combines them with article text and diagnostics. flowchart TD
A[Page URL and extraction options] --> B[Fetch coordinator]
B --> C[HTML extraction]
B --> D[Firecrawl extraction]
C --> E[Shared media resolution]
D --> E
E --> F[Transcript and source metrics]
F --> G[Article and transcript composition]
G --> H[Extracted content and diagnostics]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep shared media orchestration private to core while retaining source-specific extraction policies in the two builders. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior rather than reporting a bug; source comparison and regression-test inspection found no introduced failure. Is this the best way to solve the issue? Yes: the shared helper reuses existing policy and composition functions while leaving HTML, Firecrawl, and Markdown-specific decisions with their current owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8308778d4e30. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: refactor(core): share page media resolution and composition This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Shared page-media ownership
HTML and Firecrawl extraction previously repeated media detection, embedded-video policy, transcript resolution, source-metric refresh, content composition, and diagnostic shaping. A shared page-media module now owns those operations and their typed context; the fetch coordinator builds common options once.
The page builders retain their distinct Readability/Reddit, metadata, Markdown, empty-result, and video-only policies. Metrics still use the deadline captured at builder entry. Empty Firecrawl HTML is passed through unchanged without a metric refresh; raw HTML keeps its existing refresh behavior. Markdown conversion remains after transcript resolution.
Production code is 64 lines smaller. Eight new contract tests add coverage rather than trading away behavior for line count.
Proof
No dependency or public API changes. The new functions and context are private implementation boundaries.
Hosted CI also passes on the exact PR head: Node 24 gate, Chromium E2E, and Firefox smoke, with security checks green.