agentdiff icon indicating copy to clipboard operation
agentdiff copied to clipboard

feat: auto-prompt 'agentdiff migrate' when legacy ledger data is detected

Open codeprakhar25 opened this issue 6 months ago • 1 comments

What

When agentdiff list or agentdiff status finds agentdiff-meta:ledger.jsonl (old format) but an empty agentdiff-meta:traces.jsonl (new format), prompt the user to run agentdiff migrate.

Why

Existing users upgrading to a new version see zero traces until they discover and manually run agentdiff migrate. Silent data disappearance on upgrade is a trust-killer for an audit tool.

How

In load_meta_traces() (or the entry point for list/status):

  1. If result is empty, check if agentdiff-meta:ledger.jsonl exists and is non-empty
  2. If yes, print a one-time prompt: "Found legacy ledger data — run agentdiff migrate to import it."
  3. Store a marker flag (e.g., in .git/agentdiff/migration-prompted) so the prompt only appears once

Effort

~20 min. No dependencies.

codeprakhar25 avatar May 12 '26 12:05 codeprakhar25

Not worth

codeprakhar25 avatar May 13 '26 13:05 codeprakhar25