fix(cli): config legacy key migration + watcher branch switch detection - #19
Merged
Conversation
…etection - config: normalize viper-style keys (debouncems → debounce_ms, etc.) when loading ~/.cix/config.yaml written by old viper-based versions; auto-save in new format on first load so migration is one-time - config show: reformat output as flat key=value pairs matching cix config set key names so values are easy to copy-paste - watcher: detect git branch switches by watching .git/HEAD (excluded before); on HEAD change, cancel pending debounce and run immediate incremental reindex (indexer already does full hash-diff so no files are missed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dvcdsys
added a commit
that referenced
this pull request
May 14, 2026
After the workspace_repos → git_repos + workspace_projects split,
docs and stale comments still referenced concepts that no longer
exist.
- workspaces.md + doc/WORKSPACES.md: rewrite lifecycle, REST API
reference, webhook URL examples, and clone-dir paths to use
projects.path_hash, /git-repos, /workspaces/{id}/projects, and
/projects/{hash}/reindex.
- Both skills/cix-workspace/SKILL.md and
plugins/cix/skills/cix-workspace/SKILL.md: replace
/workspaces/{id}/repos/{repo_id}/reindex with
/projects/{hash}/reindex. New plugins/cix/scripts/sync-skills.sh
keeps the duplicate copies byte-identical going forward.
- Code comments updated across config.go, callgraph.go,
repocloner.go, githubapi.go, workspaces.go, and
AddExistingProjectDialog.tsx to point at gitrepos /
workspace_projects / projects.path_hash instead of the dead
workspacerepos.* names.
Resolves Fix #8, #9, #10, #19.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
dvcdsys
added a commit
that referenced
this pull request
May 14, 2026
After the workspace_repos → git_repos + workspace_projects split,
docs and stale comments still referenced concepts that no longer
exist.
- workspaces.md + doc/WORKSPACES.md: rewrite lifecycle, REST API
reference, webhook URL examples, and clone-dir paths to use
projects.path_hash, /git-repos, /workspaces/{id}/projects, and
/projects/{hash}/reindex.
- Both skills/cix-workspace/SKILL.md and
plugins/cix/skills/cix-workspace/SKILL.md: replace
/workspaces/{id}/repos/{repo_id}/reindex with
/projects/{hash}/reindex. New plugins/cix/scripts/sync-skills.sh
keeps the duplicate copies byte-identical going forward.
- Code comments updated across config.go, callgraph.go,
repocloner.go, githubapi.go, workspaces.go, and
AddExistingProjectDialog.tsx to point at gitrepos /
workspace_projects / projects.path_hash instead of the dead
workspacerepos.* names.
Resolves Fix #8, #9, #10, #19.
Co-Authored-By: Claude Opus 4.7 <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
~/.cix/config.yamlwritten by the old viper-based CLI used keys likedebouncems,cachettl,autowatch,excludepatterns— the new yaml.v3 code expecteddebounce_ms,cache_ttl, etc. so values silently fell back to defaults. Fix: normalize old keys on load and auto-save in new format (one-time migration).config showreadability: output reformatted as flatkey = valuepairs using the same key names ascix config set— easy to copy-paste.git checkout,cix statusshowed unindexed files. Root cause:.git/was fully excluded so.git/HEADevents were dropped. On macOS, FSEvents can coalesce rapid file changes (large checkout) into directory-level events whichhandleEventskips — so the debounce timer never fired. Fix: allow.git/HEADthroughisExcluded, detect it inhandleEvent, cancel pending debounce and run immediate incremental reindex (indexer.Run(false)does a full hash-diff scan so all added/modified/deleted files are handled correctly).Test plan
go test ./cli/internal/config/...— includesTestLoad_LegacyKeys(old viper format → correct values)go test ./cli/internal/watcher/...— includesTestIsExcluded_GitHEAD,TestHandleEvent_GitHEADChange_TriggersReindex,TestHandleEvent_GitHEADChange_ClearsPendingChangescix config show— verify flat key=value formatcix watch --foreground, thengit checkout other-branch— verify log shows"git branch switched, triggering reindex..."🤖 Generated with Claude Code