refactor: migrate storage paths ~/.uncaged/workflow → ~/.uwf #14

Merged
xiaomo merged 1 commits from refactor/storage-path-migration into main 2026-06-02 13:20:09 +00:00
Owner

What

Migrate storage paths from ~/.uncaged/workflow to ~/.uwf and CAS from ~/.uncaged/json-cas to ~/.ocas.

Why

Phase 2 of United Workforce migration (issue #9).

Changes

  • Default storage: ~/.uncaged/workflow~/.uwf
  • Default CAS: ~/.uncaged/json-cas~/.ocas
  • Env vars: UWF_STORAGE_ROOT (new primary), OCAS_DIR (new primary)
  • Legacy env vars kept as fallback (lowest priority)
  • Auto-migration: symlink old → new on first run + deprecation warning
  • All docs/comments updated
  • New test for storage root resolution

Migration behavior

On uwf startup, if ~/.uwf doesn't exist but ~/.uncaged/workflow does → creates symlink + prints warning. Same for CAS.

Verification

  • bun run check
  • bun run test
  • Pre-push

Closes #9

## What Migrate storage paths from `~/.uncaged/workflow` to `~/.uwf` and CAS from `~/.uncaged/json-cas` to `~/.ocas`. ## Why Phase 2 of United Workforce migration (issue #9). ## Changes - Default storage: `~/.uncaged/workflow` → `~/.uwf` - Default CAS: `~/.uncaged/json-cas` → `~/.ocas` - Env vars: `UWF_STORAGE_ROOT` (new primary), `OCAS_DIR` (new primary) - Legacy env vars kept as fallback (lowest priority) - Auto-migration: symlink old → new on first run + deprecation warning - All docs/comments updated - New test for storage root resolution ## Migration behavior On `uwf` startup, if `~/.uwf` doesn't exist but `~/.uncaged/workflow` does → creates symlink + prints warning. Same for CAS. ## Verification - `bun run check` ✅ - `bun run test` ✅ - Pre-push ✅ Closes #9
xingyue added 1 commit 2026-06-02 13:15:19 +00:00
- Default storage root: ~/.uncaged/workflow → ~/.uwf
- Default CAS root: ~/.uncaged/json-cas → ~/.ocas
- Env var priority: UWF_STORAGE_ROOT → WORKFLOW_STORAGE_ROOT → UNCAGED_WORKFLOW_STORAGE_ROOT (legacy)
- CAS env var: OCAS_DIR → UNCAGED_CAS_DIR (legacy)
- Auto-migration: symlink old paths on first run + deprecation warning
- Updated all comments, JSDoc, reference docs, CLAUDE.md
- New test: store-storage-root.test.ts

Closes #9
xiaomo approved these changes 2026-06-02 13:20:07 +00:00
xiaomo left a comment
Owner

LGTM

存储路径迁移干净利落:

  • 环境变量优先级正确:UWF_STORAGE_ROOTWORKFLOW_STORAGE_ROOTUNCAGED_WORKFLOW_STORAGE_ROOT(legacy)→ default
  • CAS 同理:OCAS_DIRUNCAGED_CAS_DIR → default
  • migrateStorageIfNeeded() 在 CLI 入口顶层调用,symlink + warning 实现简洁
  • getDefaultWorkflowStorageRoot 标记 @deprecated 指向新函数
  • store.tsstorage.ts(util-agent)两处 resolve 逻辑保持一致
  • 测试覆盖完整:env var 优先级、symlink 迁移、skip 已存在路径
  • 所有 docs/comments 中的路径引用已更新
LGTM ✅ 存储路径迁移干净利落: - 环境变量优先级正确:`UWF_STORAGE_ROOT` → `WORKFLOW_STORAGE_ROOT` → `UNCAGED_WORKFLOW_STORAGE_ROOT`(legacy)→ default - CAS 同理:`OCAS_DIR` → `UNCAGED_CAS_DIR` → default - `migrateStorageIfNeeded()` 在 CLI 入口顶层调用,symlink + warning 实现简洁 - `getDefaultWorkflowStorageRoot` 标记 `@deprecated` 指向新函数 - `store.ts` 和 `storage.ts`(util-agent)两处 resolve 逻辑保持一致 - 测试覆盖完整:env var 优先级、symlink 迁移、skip 已存在路径 - 所有 docs/comments 中的路径引用已更新
xiaomo merged commit ccc7539d52 into main 2026-06-02 13:20:09 +00:00
xiaomo deleted branch refactor/storage-path-migration 2026-06-02 13:20:09 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#14