Skip to content

Add time-windowed message deduplication (exactly-once inbox)#312

Merged
JE-Chen merged 1 commit into
devfrom
feat/dedup-window-batch
Jun 22, 2026
Merged

Add time-windowed message deduplication (exactly-once inbox)#312
JE-Chen merged 1 commit into
devfrom
feat/dedup-window-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

work_queue dedups only new/in_progress references — once an item completes the same reference enqueues again, and redelivered webhooks reprocess.

  • DedupWindow(ttl_s, *, clock) — sliding window of recently-seen message ids.
  • check_and_mark(id)True first time within the window (marks it), False for a duplicate.
  • seen / mark / purge_expired / size.

Converts at-least-once delivery to exactly-once-in-window. Injectable clock, bounded size.

Layers

  • Headless core: utils/dedup_window/ (pure stdlib, zero PySide6).
  • Facade: DedupWindow + __all__.
  • Executor: AC_dedup_check (named-instance registry).
  • MCP: ac_dedup_check.
  • Script Builder: under Flow.
  • Tests: test/unit_test/headless/test_dedup_window_batch.py (7 tests; TTL via injected clock).
  • Docs: v104_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest → 7 passed; ruff/pylint 10.00/bandit/radon clean; Qt-free.

work_queue dedups only new/in_progress references — once an item
completes the same reference enqueues again and redelivered webhooks
reprocess. Add DedupWindow: a sliding-window inbox whose check_and_mark
returns True the first time an id is seen within ttl_s and False for a
duplicate, converting at-least-once delivery to exactly-once-in-window.
Injectable clock, bounded size. Wired through facade, executor
(AC_dedup_check, named-instance registry), MCP, and the Script Builder
with a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 25 complexity · 0 duplication

Metric Results
Complexity 25
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 618a104 into dev Jun 22, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/dedup-window-batch branch June 22, 2026 02:20
@sonarqubecloud

Copy link
Copy Markdown

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