Problem
Cursor tracking logic for ingestion is repeated across import-openclaw.ts, import-cron.ts, and ingestion-state.ts. Each ingestion source implements its own cursor read/write pattern with no shared abstraction. There is also no deduplication logic for events that may be ingested more than once.
Proposed Solution
- Shared
IngestionCursor class — Encapsulates cursor read, advance, and persist operations
- Event deduplication — Check for existing event IDs before insert (idempotent ingestion)
- Consistent error handling — Shared retry/skip logic for malformed records
- Ingestion registry — Central registry of ingestion sources with their cursor states
Acceptance Criteria
🤖 Generated with Claude Code
Problem
Cursor tracking logic for ingestion is repeated across
import-openclaw.ts,import-cron.ts, andingestion-state.ts. Each ingestion source implements its own cursor read/write pattern with no shared abstraction. There is also no deduplication logic for events that may be ingested more than once.Proposed Solution
IngestionCursorclass — Encapsulates cursor read, advance, and persist operationsAcceptance Criteria
IngestionCursorutility handles all cursor state operationsimport-openclaw.tsandimport-cron.tsuse the shared utility🤖 Generated with Claude Code