Skip to content

[Bug] memorix ingest log creates duplicate git records on repeated runs #48

@FurryWolfX

Description

@FurryWolfX

Description

Running memorix ingest log multiple times ingests the same commits repeatedly, creating duplicate git-memory records in observations.json. Each duplicate has the same commitHash, title, narrative, facts, and filesModified.

Expected Behavior

Repeated runs of memorix ingest log should skip commits that have already been ingested (same commitHash), similar to how memorix ingest commit works.

Actual Behavior

Every time memorix ingest log is executed, all commits (including previously ingested ones) are stored again, resulting in duplicate entries.

Root Cause

ingest-log.ts lacks deduplication logic, while ingest-commit.ts has it at lines 84-85:

// ingest-commit.ts ✅ Has dedup
const existingObs = await loadObservationsJson(dataDir) as Array<{ commitHash?: string }>;
if (existingObs.some(o => o.commitHash === commit.hash)) { ... }
// ingest-log.ts ❌ Missing dedup check
for (const commit of commits) {
  const result = ingestCommit(commit);
  await storeObservation({  // No check if commit.hash already exists
    ...
    commitHash: commit.hash,
  });
}

Steps to Reproduce

  1. Run memorix ingest log --count 10 in a git project
  2. Run memorix ingest log --count 10 again
  3. Observe: all 10 commits are ingested again (marked ✅), not skipped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions