Unify host app home to ~/sciclaw and add migrate --unify#118
Unify host app home to ~/sciclaw and add migrate --unify#118drpedapati wants to merge 1 commit intomainfrom
migrate --unify#118Conversation
Deploying sciclaw with
|
| Latest commit: |
e106d88
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f9d5ecbd.sciclaw.pages.dev |
| Branch Preview URL: | https://codex-migrate-config-from--p.sciclaw.pages.dev |
|
@codex please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e106d88cce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case ActionRemoveDir: | ||
| if err := os.RemoveAll(action.Source); err != nil { | ||
| result.Errors = append(result.Errors, err) |
There was a problem hiding this comment.
Stop unify cleanup after any migration error
The --unify executor continues into ActionRemoveDir even after earlier ActionMoveFile/ActionMoveDir failures are recorded, so a partial-copy failure (e.g., permission denied or disk-full) can still trigger os.RemoveAll(~/.picoclaw) and destroy the only intact source data. This should short-circuit cleanup/symlink creation when any prior action has failed to prevent irreversible data loss in failed migrations.
Useful? React with 👍 / 👎.
| dirs := []struct{ from, to string }{ | ||
| {"backups", "backups"}, | ||
| {"templates", "templates"}, | ||
| {"skills", "global-skills"}, | ||
| } |
There was a problem hiding this comment.
Migrate legacy workspace directory during --unify
The unify plan only moves backups, templates, and skills, but the same flow rewrites configs containing ~/.picoclaw/workspace to ~/sciclaw (rewriteUnifiedConfigPath) and then deletes the entire legacy directory. On installs where the real workspace is still under ~/.picoclaw/workspace, this drops workspace files and repoints users to an empty path. Add workspace migration (or skip rewrite/removal when legacy workspace exists) before removing the old root.
Useful? React with 👍 / 👎.
Motivation
~/.picoclaw+~/sciclaw) with a single, visible host root~/sciclawto simplify user mental model and backups.Description
pkg/pathsthat exposes a cachedAppHome()and helpers:ConfigPath(),AuthPath(),BackupsDir(),TemplatesDir(), andGlobalSkillsDir(); it respectsSCICLAW_HOME, falls back to legacy~/.picoclawonly when appropriate, and includesResetForTest().pkg/paths(gateway, local executor, auth store, models, snapshot, doctor, launchd service, backup, env/docker helpers, templates, venv candidates, etc.).migrate --unifyinpkg/migrateand CLI wiring to plan and execute moving files/dirs from~/.picoclawinto~/sciclaw, renameskills/→global-skills/, rewrite legacyworkspaceentries in the migrated config, remove the old directory, and create a symlink~/.picoclaw -> ~/sciclaw(supports--dry-runand--force).~/sciclaw(Dockerfile,docker-compose.yml,Makefile, README, docs, skill docs).pkg/pathsand small helpers used by migration and update code to preserve VM-local/home/ubuntu/.picoclawbehavior where applicable.Testing
go test ./pkg/paths -vand allpkg/pathstests passed.go test ./pkg/migrateandpkg/migratetests passed.go build ./...successfully to verify the whole repository compiles after changes.Codex Task