agentdiff
agentdiff copied to clipboard
feat: auto-prompt 'agentdiff migrate' when legacy ledger data is detected
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):
- If result is empty, check if
agentdiff-meta:ledger.jsonlexists and is non-empty - If yes, print a one-time prompt: "Found legacy ledger data — run
agentdiff migrateto import it." - Store a marker flag (e.g., in
.git/agentdiff/migration-prompted) so the prompt only appears once
Effort
~20 min. No dependencies.
Not worth