fix: batch summary writes to avoid output truncation on large harvests
When a harvest produced 15+ articles, asking the agent to emit the entire .summaries.json in a single response hit the model's output-token ceiling — the response was truncated and the tail articles silently got no summary (their 原文 kept the __SUMMARY_<slug>__ sentinel forever). Reproduced every time a high-volume source ran; ≤9-article sources never hit it. Add scripts/summary-add.js to incrementally merge small batches (≤4) into .summaries.json (keyed by url, overwrite-no-dup), with a --status mode that diffs manifest vs summaries so interrupted runs can resume. Rewrite SKILL.md Flow A Step 2 + Guardrails to mandate batching, and surface a batchHint in harvest.js's manifest so the agent sees the guidance on first contact.
Showing
scripts/summary-add.js
0 → 100644
This diff is collapsed.
Please register or sign in to comment