WIP: Local Sync #1

Draft
jmarya wants to merge 2 commits from mdsync into main
Owner

Sync Vikunja into a local markdown task format

Sync Vikunja into a local markdown task format
feat: implement local sync
All checks were successful
ci/woodpecker/pr/rust-test/2 Pipeline was successful
ci/woodpecker/pr/rust-test/1 Pipeline was successful
ci/woodpecker/pr/rust-test/3 Pipeline was successful
03743c27d5
jmarya force-pushed mdsync from 03743c27d5
All checks were successful
ci/woodpecker/pr/rust-test/2 Pipeline was successful
ci/woodpecker/pr/rust-test/1 Pipeline was successful
ci/woodpecker/pr/rust-test/3 Pipeline was successful
to 6dd3d1f4e6
Some checks failed
moira/test moira/test — failed
2026-07-28 07:55:10 +00:00
Compare
Finishes the local sync as a one-way pull: Vikunja stays the source of
truth and the local tree is a derived backup.

Reconciliation. Repeat runs previously left debris behind: a retitled
task produced a second note under its new name, and a task deleted
upstream kept its note forever. Sync now records what it wrote in a
.vk-sync.json manifest at the output root and reconciles against it, so
renames move notes and deletions remove them. Only paths listed in the
manifest are ever rewritten or deleted, so unrelated files in the output
directory are never touched, and a corrupt manifest degrades to writing
rather than deleting.

Project hierarchy. Projects are laid out mirroring Vikunja's
parent/child structure instead of being flattened. Siblings whose titles
sanitize to the same segment get their id appended so they can no longer
share a directory, and a malformed parent chain is depth-capped rather
than looping forever.

Done tasks. Tasks came from whichever view happened to be first, so
inclusion of done tasks was incidental. They are now fetched from the
task endpoint with an explicit filter, re-checked locally in case the
server ignores it, and exposed as --done.

Pseudo-projects such as Favorites duplicate tasks that already live in a
real project. They are now detected by their non-positive id rather than
the literal English title, which never matched on localized instances.

Also adds --project to sync a subset (entries for projects outside the
run are carried forward, never pruned), --archived, and --dry-run, plus
a per-project progress line and a change summary. Exits non-zero when
any operation failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jmarya force-pushed mdsync from 96fe9e0604
Some checks failed
moira/test moira/test — failed
to 109dbf59e6
Some checks failed
moira/test moira/test — failed
2026-07-28 08:31:49 +00:00
Compare
Some checks failed
moira/test moira/test — failed
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin mdsync:mdsync
git switch mdsync

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff mdsync
git switch mdsync
git rebase main
git switch main
git merge --ff-only mdsync
git switch mdsync
git rebase main
git switch main
git merge --no-ff mdsync
git switch main
git merge --squash mdsync
git switch main
git merge --ff-only mdsync
git switch main
git merge mdsync
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jmarya/vk!1
No description provided.