Skip to content

Add project sync --all with machine-local .lnkprojectcache - #27

Merged
polymorcodeus merged 4 commits into
mainfrom
sync-all
Aug 25, 2026
Merged

Add project sync --all with machine-local .lnkprojectcache#27
polymorcodeus merged 4 commits into
mainfrom
sync-all

Conversation

@polymorcodeus

Copy link
Copy Markdown
Owner

Summary

Adds lnk project sync --all to reconcile every stored project scope in one command, backed by a machine-local .lnkprojectcache that maps stored project IDs to their local checkout paths. Replaces the previous $HOME walk in lnk doctor with cache-driven project discovery.

What's new

  • lnk project sync --all - Reconciles each stored project that has an available cache entry, carrying through --dry-run, --prune-deletions, and --force.
  • .lnkprojectcache - A gitignored, machine-local JSON cache that records each project's ID, local checkout path, and state (available, missing, or not-downloaded).
  • Automatic cache maintenance - project push and project sync record or refresh the project's cache entry on success.
  • lnk project cache --scan <dir> - Explicitly scans provided directories to populate or repair the cache; repeatable.
  • Cache-driven doctor checks - lnk doctor now uses .lnkprojectcache to find orphaned storage, broken project symlinks, and missing checkouts instead of walking $HOME.

Usage

CommandPurpose
lnk project sync --allReconcile every cached project
lnk project sync --all --dry-runPreview reconciliation without changing files
lnk project cache --scan ~/codeDiscover local checkouts under ~/code and update the cache
lnk project cache --scan ~/.config/project --scan ~/workScan multiple directories

Behavior changes / guardrails

  • No default scan roots: project cache --scan requires explicit directories to avoid accidental broad scans of $HOME.
  • Hidden directories are skipped during discovery except for .git itself.
  • not-downloaded cache entries are treated as intentional and are not reported as orphaned storage.
  • Doctor no longer warns about .lnkinclude patterns that match no files; global patterns may intentionally not match in some projects.
  • Projects with no cache entry or a missing cache entry are reported by lnk doctor with a suggestion to run project cache --scan.

Testing

  • Unit tests for ProjectSyncAll, ProjectCache load/save/discover/check, and automatic cache updates on push/sync.
  • Doctor project-issue tests updated to use the cache model.
  • make check runs fmt, vet, lint, unit, and integration suites; all green.

@polymorcodeuspolymorcodeus self-assigned this Aug 25, 2026
@polymorcodeus
polymorcodeus merged commit 37d588f into mainAug 25, 2026
4 checks passed
@polymorcodeus
polymorcodeus deleted the sync-all branch August 25, 2026 20:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@polymorcodeus