Skip to content

Conversation

@christso
Copy link
Contributor

@christso christso commented Jan 24, 2026

Summary

  • Track synced files in .allagents/sync-state.json for non-destructive sync
  • First sync overlays without purging (safe for existing workspaces)
  • Subsequent syncs only remove files that were previously synced by allagents
  • Fix WORKSPACE-RULES injection to be idempotent (uses markers)

Changes

File Change
src/models/sync-state.ts NEW - SyncState schema with Zod
src/core/sync-state.ts NEW - Load/save state utilities
src/core/sync.ts Add selective purge, collectSyncedPaths, update sync flow
src/core/transform.ts Fix idempotent WORKSPACE-RULES injection
src/constants.ts Add SYNC_STATE_FILE constant
tests/unit/core/sync-state.test.ts NEW - State utilities tests
tests/unit/core/sync.test.ts Add non-destructive sync tests

Test Plan

  • Unit tests for sync-state utilities (10 tests)
  • Non-destructive sync tests (5 new tests)
  • WORKSPACE-RULES idempotency test
  • Manual integration test with real workspace

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
allagents 3386570 Jan 24 2026, 08:51 AM

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 24, 2026

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5adf383
Status: ✅  Deploy successful!
Preview URL: https://174756e5.allagents.pages.dev
Branch Preview URL: https://feat-non-destructive-sync.allagents.pages.dev

View logs

@christso christso force-pushed the feat/non-destructive-sync branch from 6d2e1af to 26ce22d Compare January 24, 2026 11:12
Adds implementation plan for tracking synced files to enable
non-destructive workspace sync that preserves user-created files.
Track synced files in .allagents/sync-state.json to enable selective
purge. First sync overlays without purging, subsequent syncs only
remove files that were previously synced by allagents.

- Add SyncState model and sync-state utilities
- Add selectivePurgeWorkspace() for selective file removal
- Fix WORKSPACE-RULES injection to be idempotent (markers-based)
- Add collectSyncedPaths() to track files during copy
- Update syncWorkspace flow: load state → selective purge → copy → save state
- Fix exactOptionalPropertyTypes error in workspace command by
  conditionally spreading options
- Replace non-null assertions with optional chaining in collectSyncedPaths
- Use template literal instead of string concatenation
- Remove inferrable type annotation from initWorkspace parameter
- Refactor transform.ts to avoid non-null assertion on array access
@christso christso force-pushed the feat/non-destructive-sync branch from 26ce22d to cc056eb Compare January 24, 2026 21:54
- Add non-destructive sync docs to workspaces guide
- Add sync command details to CLI reference
- Update README with sync behavior notes
- Remove .ralph folder (implementation complete)
@christso christso marked this pull request as ready for review January 24, 2026 22:08
@christso christso merged commit 165e297 into main Jan 24, 2026
1 check passed
@christso christso deleted the feat/non-destructive-sync branch January 24, 2026 22:13
Sign up for free to 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.

2 participants