Skip to content

fix(convos): honor mined state during dry runs - #2134

Merged
igorls merged 1 commit into
MemPalace:developfrom
fatkobra:fix/2118-convo-dry-run-dedup
Aug 3, 2026
Merged

fix(convos): honor mined state during dry runs#2134
igorls merged 1 commit into
MemPalace:developfrom
fatkobra:fix/2118-convo-dry-run-dedup

Conversation

@fatkobra

@fatkobra fatkobra commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • open an existing palace with create=False and read-only intent during conversation dry-runs
  • prefetch the same source-mtime and content-hash state used by a real mine
  • apply the unchanged-source skip check in dry-run mode
  • treat a missing palace or collection as empty prior state without creating it

Root cause

_mine_convos_impl() set collection to None during dry-runs, built empty deduplication maps, and gated _is_unchanged_since_last_mine() behind not dry_run.

A dry-run therefore could not make the same unchanged-source decision as the subsequent real run.

Tests

  • an unchanged, previously mined transcript is skipped during a dry-run, including when a different target wing is passed
  • a modified transcript remains visible as pending work
  • a dry-run against a missing palace reports pending work without creating the palace directory

Closes #2118

How to test

Run

python3 -m ruff format mempalace/convo_miner.py tests/test_convo_miner.py
python -m ruff format --check .
python -m ruff check .
python -m pytest tests/test_convo_miner.py \
  -k "dry_run_skips_unchanged_mined_file or dry_run_keeps_modified_file_as_work or dry_run_missing_palace_does_not_create_it" \
  -q
python -m pytest tests/test_convo_miner.py -q
python -m pytest tests/ -v

Checklist

  • Tests pass (python -m pytest tests/ -v)
  • No hardcoded paths
  • Linter passes (ruff check .)

@igorls
igorls merged commit a4fc26e into MemPalace:develop Aug 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mine --dry-run always reports 0 skipped files (dedup check bypassed in dry-run mode)

2 participants