Repair Export Snapshot Drift

    by Mariusz Wrzeszczynski

    1

    Repair long-running exports that produce missing, duplicate, mixed-version, or inconsistent rows when source data changes mid-run.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    Our CSV export is missing rows when users add data during the run, and retrying after a worker crash creates duplicate entries. Repair the export logic in our Node.js worker.

    Your agent does

    Project Detected: Node.js / PostgreSQL / Redis Queue / CSV

    Snapshot Contract:

    • Snapshot type: High-water mark
    • Snapshot boundary: MAX(created_at) at job start
    • Source ordering: created_at ASC, id ASC
    • Mutation behavior: Exclude rows after boundary

    Repair Applied:

    • Snapshot and source query: Added sequence-based high-water mark
    • Ordering and chunk traversal: Replaced offset with keyset pagination
    • Checkpoint and resume: Implemented idempotent chunk writes with state persistence
    • File finalization: Added atomic rename from .tmp to .csv after checksum verification

    What you get

    Prevent duplicate rows after export job retries or worker restarts.Eliminate record skipping caused by offset pagination drift.Validate export integrity using row counts and checksums.Enforce atomic file publication to prevent partial downloads.

    About this skill

    The problem

    Large data exports often drift when source records change during generation. This leads to missing rows, duplicates in resumed jobs, and reports where totals don't match the exported records.

    What it does

    • Detects and repairs mixed snapshots and unstable pagination in long-running export workflows.
    • Establishes deterministic export contracts using stable snapshot boundaries and immutable ordering.
    • Implements resumable checkpoints and idempotent retries to handle worker crashes without data corruption.
    • Enforces atomic file finalization to prevent partial or corrupted downloads from being exposed to users.
    • Verifies integrity through row count, checksum, and aggregate total validation.

    Frameworks & tools

    Works with any database (SQL/NoSQL), ORM, or queue system. Supports CSV, XLSX, JSONL, and multi-file archives. Compatible with object storage providers like S3 for multipart uploads.

    Why this beats prompting it yourself

    Hand-writing consistent export logic requires complex handling of database transaction limits and race conditions. This skill provides a rigorous 17-step verification process that covers edge cases like concurrent mutations and cross-tenant isolation that simple prompts miss.

    Use cases

    • Repairing financial reports where totals must match a frozen point-in-time snapshot.
    • Fixing broken CSV exports that skip records due to offset drift.
    • Implementing safe resume logic for multi-gigabyte exports that frequently time out.
    • Ensuring legal and audit logs remain immutable and complete across distributed workers.

    Known limitations

    Does not automatically apply migrations to production. Database-specific snapshot limitations (like MVCC retention) must be reviewed for extremely long-running jobs.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in Data Engineering