feat(core,cli): add ao migrate (V3 inventory + plan, dry-run only)#1717
Draft
harshitsinghbhandari wants to merge 1 commit into
Draft
feat(core,cli): add ao migrate (V3 inventory + plan, dry-run only)#1717harshitsinghbhandari wants to merge 1 commit into
harshitsinghbhandari wants to merge 1 commit into
Conversation
Replaces ao migrate-storage with a single ao migrate command that inventories the AO storage tree and prints a step-by-step V3 migration plan plus a structured JSON record. Detects identity-system drift accumulated since PR #1466: - V1 bare-basename projectIds vs V2 hashed - doubled-prefix tmux names (ao-ao-orchestrator) - storageKey-prefixed legacy tmux names in metadata - numbered orchestrators (ao-orchestrator-1..N) - legacy ~/.worktrees/ paths inside session JSON - root-level *-observability dir leak (153 dirs on real disks) - stranded ~/.worktrees/ leaves - same-repo dual registrations - lingering storageKey fields in config.yaml Execution is gated in v0.6.0: --execute and --rollback exit 1 with a feedback notice. The intent is to collect real-world dry-run output before any disk writes land. Execution unlocks in v0.6.1. The ao start legacy-storage warning now points at ao migrate --dry-run. Public API in @aoagents/ao-core: inventoryV3, planV3, formatBytes plus their types. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Contributor
Test Coverage Report
Per-file breakdown
Uncovered lines
|
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
Replaces
ao migrate-storagewith a singleao migratecommand. Inventories the AO storage tree, detects identity-system drift accumulated since PR #1466, and prints a step-by-step V3 migration plan plus a structured JSON record.Execution is intentionally gated in this PR.
ao migrate --executeandao migrate --rollbackexit 1 with a feedback notice pointing users at a tracking issue. The intent is to collect real-world dry-run output from a few users before any disk-mutating code lands. Execution unlocks in v0.6.1.Why now
Hash usage and identity drift are documented in detail at
~/.ao/agent-orchestrator/ao-131/ao-hashes-report.html(forensic report from a real user disk: 8 projects, 153 leaked observability dirs, two competing project-ID formats, four prefix-collision schemes, three live tmux conventions, ~12 dead exports). PR #1466 introduced the V2 storage layout but left every other identifier layer fragmented. This is the missing other half.What V3 changes (proposed; only
--dry-runlands here)projectId{name}_{hash10}coexistao2, no dash)tmuxName= sessionId{prefix}-orchestrator-Nnumbered{prefix}-orchestrator; archive on re-spawn~/.agent-orchestrator/{hash}-observability/(leaks)projects/{id}/observability/~/.worktrees/, some inprojects/projects/{id}/worktrees/git ls-remoteper spawn.next-session-id.json, scan as reconcilerWhat this PR ships
packages/core/src/migration/v3.ts—inventoryV3()+planV3()(pure, no FS writes)packages/cli/src/commands/migrate.ts— Commander wiring with gated--execute/--rollbackpackages/cli/src/commands/migrate-storage.ts(43 LOC); internal V1→V2 helpers stay incore/src/migration/storage-v2.tswarnAboutLegacyStorageinstartup-preflight.tsto point atao migrate --dry-run@aoagents/ao-core:inventoryV3,planV3,formatBytes+ typesWhat this PR does NOT ship
ao updateAll of the above land in v0.6.1 once feedback from this dry-run is collected.
Sample output (run against a sandbox copy of a real disk)
Test plan
pnpm typecheck— full monorepo, cleanpnpm lint— 0 errors (49 pre-existing warnings unrelated to this PR)pnpm --filter @aoagents/ao-core test— 1124 passed, including the new 17 V3 testspnpm build— full monorepo, clean~/.agent-orchestrator(162 obs dirs, 8 projects, mixed V1/V2, numbered orchestrators, same-repo duplicate) — output matches expectationsao migrate --executeexits 1 with feedback noticeao migrate --rollbackexits 1 with feedback noticeao migrate-storagerejected with "unknown command" errorFollow-up issues to file (not in this PR)
--executeafter feedback reviewao update🤖 Generated with Claude Code