Skip to main content

Processed Tracker

@tagur/processed-trackerv2026.10.26.1· MIT· 4d agoBEHAVIORS
01README

A tiny dedup ledger for swamp pipelines: remember which ids have already been processed, so repeat runs skip work already done.

Backed entirely by swamp data — it never touches any external system. Keys are opaque strings, so it fits any id scheme (message ids, file hashes, record ids, URLs). The whole ledger is one accumulating set per scope, so several pipelines can share one tracker instance without colliding.

Methods operate on LISTS so a workflow fans out in one call rather than looping:

  • check — partition candidate ids into newIds (not yet processed) and knownIds (already in the ledger), without mutating. Process only the new.
  • mark — add ids to the ledger (call AFTER their work succeeds). Idempotent — re-marking is a no-op.
  • list — read the current ledger (count + ids).
  • forget — remove ids so they are reprocessed next run.

Quick Start

swamp extension pull @tagur/processed-tracker

swamp behavior create @tagur/processed-tracker dedup --global-arg scope=my-pipeline

# In a workflow: read the ledger, process only what is new, mark after success.
swamp behavior run dedup check --arg 'ids=["a","b","c"]'
swamp behavior run dedup mark  --arg 'ids=["a","b"]'
02Behaviors1
@tagur/processed-trackerv2026.10.26.1processed_tracker.ts

Global Arguments

ArgumentTypeDescription
scope?stringNamespace for this ledger, so multiple pipelines can share one tracker
fn check(ids: array)
Partition candidate ids into newIds (not yet processed) and knownIds
ArgumentTypeDescription
idsarrayCandidate ids to check.
fn mark(ids: array)
Add ids to the ledger (call AFTER their work succeeds). Idempotent —
ArgumentTypeDescription
idsarrayIds to record as processed.
fn list()
Read the current ledger: the count and set of processed ids.
fn forget(ids: array)
Remove ids from the ledger so they are reprocessed next run. Pass an
ArgumentTypeDescription
idsarrayIds to remove from the ledger.

Resources

ledger(infinite)— The accumulating set of processed ids for a scope.
check(1h)— Result of a check: which candidate ids are new vs known.
03Stats
A
100 / 100
Downloads
0
Archive size
6.5 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
04Platforms
05Labels