Repository navigation
Conversation
| pub(super) fn local_intents(&self) -> Result<Vec<LocalMutation>> { | ||
| self.store | ||
| .work(LOCAL_SCOPE)? | ||
| .into_iter() | ||
| .map(|work| serde_json::from_value(work.payload).map_err(Into::into)) | ||
| .collect() | ||
| } |
There was a problem hiding this comment.
A conflict local intent is permanent and wedges its paths forever.
local_intents() reads store.work(LOCAL_SCOPE), which selects state IN ('pending','running','conflict'). Nothing in the tree ever moves a row out of conflict:
WorkStore::complete_conflictis never called anywhere in the repo (dead code).store.cancelis only used bycancel_missing_uploads(UPLOAD_SCOPE).enqueue_intent/enqueue_deletesgo throughwrite_plan(.., replace=false), whose upsert only re-arms whenpayload/dependencies/resourcediffer or the row iscancelled— re-detecting the same mutation leaves the row inconflict.
Concrete failure: user renames a placeholder, apply_mutation returns Conflict("rename destination identity changed at {to}") (e.g. the destination was replaced between detection and execution). From then on, for the lifetime of the journal file:
protected_paths()permanently containsfromandto, sotry_walkputs them inhandled_renamesand skipshandle_entryfor them — no upload, no hydrate/dehydrate, ever.handle_deleted_entriespermanently skips those paths, so a later genuine local delete is never propagated.protected_object_ids()/protected_snapshot_ids()permanently protect that object id inreconcile_remote_object_state_with_protected_ids, andschedule()permanently drops every materialization action under those paths.enqueue_deletessetsdepends_onon child object ids, andrefresh_readytreats a non-completeparent as unsatisfied, so one conflicted child delete blocks every ancestor directory delete indefinitely.status().conflicts > 0forever, sopublish_work_statuspins the tray to "Sync needs attention".
The journal is also never pruned on this path, so a restart doesn't clear it. There needs to be a path out of conflict (call complete_conflict, cancel, or re-arm on re-detection) before this is shipped.
Deep review pass (second reviewer)Did a focused second pass over the ~14k lines of new non-test code. No correctness or security defects found that I could confirm. One low-severity robustness nit posted inline on What I verified in detail, and why each held up: Durable journal (
Server delete guard
Download pinning / hydration authority
Path/prefix handling
Incremental baseline selection ( 🤖 Generated with Claude Code |
Summary
Interrupted sync and large remote trees need progress that survives restart and continues without another remote change. This PR shares a durable SQLite operation lifecycle between folder-agent materialization and CFAPI synchronization.
This remains a draft. Remaining work includes narrowing host-ancestor guards so unrelated file operations progress, changed-content policy, directory/parent effects with issued dependencies, remaining conflict choices, production planner cutover, removal of the old CFAPI executor and real existing-root reconciliation tests. No legacy execution switch is planned.
Validation
/DEBUG:NONEafter hitting LNK1140. Earlier Linux folder-agent scenarios pass.Context Refresh
just context-refreshand updatedocs/agent-context.mdafter the production cutover; implementation documentation is maintained indocs/durable-sync-work.mdthroughout.