Skip to content

Duplicate guard: single-record last_run.json misses interleaved module re-runs #767

@gltanaka

Description

@gltanaka

Problem

The duplicate-run guard (PR #757, issue #751) stores only a single record in .pdd/last_run.json. When a user runs multiple modules sequentially, each run overwrites the previous record:

pdd sync foo        # records foo
pdd sync bar        # overwrites with bar
pdd sync foo        # NOT caught — foo record was lost

The third invocation is exactly the duplicate scenario the guard is meant to prevent, but it passes undetected.

Proposed fix

Store the last N records (e.g. last_runs.jsonl with rotation, or a dict keyed by subcommand + argv), so interleaved module runs don't evict each other's records. The original issue #751 suggested this approach.

Context

Discovered during E2E validation of PR #757. The guard works correctly for immediate back-to-back re-runs of the same command — this only affects interleaved workflows.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions