Skip to content

feat(#314): add posted-tweet dedup ledger and send-window enforcement#6

Open
Chkhikvadze wants to merge 1 commit into
mainfrom
feature/task-314
Open

feat(#314): add posted-tweet dedup ledger and send-window enforcement#6
Chkhikvadze wants to merge 1 commit into
mainfrom
feature/task-314

Conversation

@Chkhikvadze
Copy link
Copy Markdown
Contributor

Summary

  • Adds posted_ledger.json durable state: reruns skip already-posted items (skipped_duplicate) so operators can safely rerun the batch
  • post_tweet.py gains send_window param + `is_within_send_window()\ guard (day-range + morning/afternoon/Tbilisi TZ); dry_run bypasses
  • window_blocked items are NOT ledgered so they retry in the next valid window
  • 21 new tests in tests/test_wave_guardrails.py; all 60 tests pass
  • README documents rerun behavior, ledger semantics, and window format

Test plan

  • uv run pytest tests/ -q → all 60 tests pass
  • Rerun run_validation_wave.py with existing ledger → skips already-posted items
  • Post attempt outside send_window → window_blocked result, no tweet sent

🤖 Generated with Claude Code

- posted_ledger.json records each successfully posted item by batch_id:order;
  reruns skip already-posted items (skipped_duplicate) and never re-attempt them
- window_blocked items are not ledgered so they retry in the next valid window
- post_tweet() gains send_window param with is_within_send_window() guard
  (day-range + morning/afternoon/Tbilisi; week-wrap handled; dry_run bypasses)
- playwright import made lazy so pure-Python helpers are testable without browser
- 21 new tests in tests/test_wave_guardrails.py; all 60 tests pass
- README documents rerun behavior, ledger semantics, and window format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant