feat(daemon): arc migrate v2-to-v3 CLI — ingest v2 state into SQLite#31
Open
Codename-11 wants to merge 1 commit into
Open
feat(daemon): arc migrate v2-to-v3 CLI — ingest v2 state into SQLite#31Codename-11 wants to merge 1 commit into
Codename-11 wants to merge 1 commit into
Conversation
Offline, idempotent migration that reads ~/.arc/history.json, per-profile chat-sessions, and activity.log (or logs/events.ndjson) and writes rows to agents / agent_events / meta tables in the v3 SQLite store. v2 files are preserved. Supports --dry-run and --json. Idempotence is guarded by a meta row (migration_v2_to_v3_completed_at). A second run short-circuits as "already migrated, nothing to do". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arc migrate v2-to-v3CLI command (offline, does not require the daemon) that ingests v2 state into the v3 SQLite store at~/.arc/arc.db.migrateV2ToV3()function inpackages/daemon/src/migrations/v2-to-v3.ts— readshistory.json, per-profilechat-sessions/*.json, andactivity.log(orlogs/events.ndjson); writes rows intoagents,agent_events, andmeta.metarow (migration_v2_to_v3_completed_at). A second invocation reports "already migrated, nothing to do".--dry-run(counts only, no DB writes) and--json.Mapping
history.jsonlaunch entry becomes oneagentsrow (status=completed,launch_mode=native, deterministicv2-<sha1>id, metadata JSON preserves tool/outcome/exitCode).agent_eventswithepoch=1: assistant/user/system →stdout,toolCalls[]→tool_call(+tool_resultif result/error present),role=tool→tool_result.agent_eventswithkind=status, correlated to an agent via timestamp window (+/- 10 min, same profile). Unmatched lines are counted asskipped.Test plan
npx tsc --noEmitpassesnpx vitest run tests/migrate-v2-to-v3.test.ts— 5/5 passarc.db; second run reports "already migrated")