Skip to content

fix(csv): a blank MemoryDB engine column still slips past replay dedupe #2232

Closed

Description

@cristim

Follow-up from the independent review of #2230 (CSV replay dedupe).

Problem

With #2230, csvDetails builds CacheDetails{Engine: <CSV engine column>} for MemoryDB. If the Engine column is blank (a hand-written or stripped CSV), the MemoryDB rec's dedupe key engine is "" while the existing commitment's key engine is "redis". The duplicate check therefore doesn't match, and an --input-csv replay buys the reservation again. The review reproduced this with the real CSV loader and DuplicateChecker: a blank-engine memorydb row lands in the would-buy list.

This is low likelihood: the CSV writer always emits redis for MemoryDB. But this is a real-money path, so it should fail closed.

Suggested fix

Either refuse a MemoryDB CSV row with an empty engine (preferred: fail loud), or default it to redis to match the main recommendation path (CacheDetails{Engine:"redis"}). Then audit the other services' CSV-detail columns for the same blank-value fail-open, and add a replay test for the blank-engine case.

Activity

  1. cristim commented on Oct 16, 2026

    @cristim
    MemberAuthor

    Fixed by #2230 (merged as 64c8c70). csvDetails now always normalises MemoryDB rows to engine "redis", the value the provider assigns to existing reservations, so blank or valkey rows dedupe correctly and are not bought again. The valkey and blank replay subtests in TestCSVReplay_MemoryDB cover it. (claude-cc-reviewer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions