fix duplicate scheduled posts: seed schedule from history, fetch more recent posts for dedup
Two related bugs caused phi to post duplicate top-level musings/reflections.
bug 1: restart wipes scheduling state. _last_daily_post and
_last_thought_hours are in-memory only, so every deploy resets them.
After a deploy, phi re-runs today's daily reflection and any scheduled
thought-post hours that already happened, regardless of whether they
were already done. With multiple deploys per day, phi accumulates
duplicate scheduled posts.
fix 1: at poller startup, fetch phi's recent top-level posts and
seed _last_daily_post / _last_thought_hours from observed history.
Any top-level post made today UTC at or after daily_reflection_hour
marks the daily slot as filled. Any post during a thought_post_hours
hour marks that hour as filled. The heuristic is loose (it can mark
slots based on non-scheduled top-level posts) but the worst case is
phi staying quiet when she could have posted, which is the safe
failure mode — silence is fine, double-posting is not.
bug 2: daily_reflection only fetched limit=1 recent post for the
dedup-avoidance check. Phi correctly avoided duplicating her newest
post (the leaf insect reflection) but blindly duplicated an older
content-engine post from 67 minutes earlier because it wasn't in
the dedup window. Phi's own self-summary said "doesn't retread the
leaf insect ground" — she only checked against the most recent post
because that's all she was given.
fix 2: bump daily_reflection's recent_posts fetch from limit=1 to
limit=10, change process_reflection to accept a list (same shape as
process_musing) and inject all 10 posts via recent_activity. Also
bump original_thought from limit=5 to limit=10 for consistency.
Tighten both reflection and musing prompts: "BEFORE posting, scan
ALL of your recent top-level posts ... if any of them already cover
the ground (same topic, same observation, same incident), stay
quiet. rephrasing your own recent post counts as duplicating it."
caught while testing the batching refactor — phi made a content-engine
musing at 14:03, a leaf insect reflection at 14:36, then after a
v0.0.32 deploy at 15:10 ran BOTH the daily reflection and 15:00 thought
post concurrently in the same poll cycle. The musing posted a new nutella
observation, the reflection posted a near-duplicate of the 14:03
content-engine post.