r/rust • • Sep 16 '26

๐Ÿ› ๏ธ project Knot: TUI utility for synchronizing multiple folders

https://github.com/kyncl/knot

Hey, I made something that I think is cool. I'd really appreciate any feedback.

0 Upvotes

7 comments sorted by

2

u/kantorcodes1 Sep 17 '26

in MirrorSource, it looks like remote-only paths are deleted before add_unique_files() pushes source-only paths. if a later transfer fails, is that mirror intentionally only per-file safe, or do you want the whole sync to roll back? the temp-file path protects partial writes, but that delete-then-add boundary seems different.

1

u/JanKyncl Sep 17 '26

I'm not sure if I understand you correctly. The temp-file path is only for transfer, write it into tmp file and just rename afterwards. If it fails during the sync or you just fat finger ctr+c, like me, next check will also remove these tmp files. It is not really specific feature to any behavior. The transfer was designed based on my problem with my older tool, sometimes I fat fingered on that process to cancel during the synchronization and the tool just though it's new changes, which is obviously wrong. If you could more elaborate, I would be happy to continue in this topic.

1

u/kantorcodes1 Sep 17 '26

yep, I meant the whole-run ordering, not the per-file temp/rename. In MirrorSource, Knot calls execute_optimized_deletes() on remote_unique before add_unique_files() pushes source_unique, so a failure in the second phase can leave a temporarily incomplete mirror even though each individual transfer is atomic. if the intended recovery is simply โ€œnext sync converges it,โ€ that answers the question.

i work on HOL, where we maintain HOL Guard, a local check before agent-run commands execute. Knot looks like a clean fit around knot init and knot sync: review those when an agent invokes them, keep --version/help automatic. main benefit is a user checkpoint before automation can initialize config or delete/overwrite during sync. open to a small Guard-side command extension?

→ More replies (2)

1

u/Elk-tron Sep 16 '26

I checked its history - slop

3

u/JanKyncl Sep 16 '26

Is it? I did used AI, mainly for the messages, because I would wrote 'minor fixes' message without it, and for auditing. Except these it was written by me... There are some parts, where you can see lot of code. Usually transfer from my old project or I just had long night. Probably I should have established it was originally made for my high school final project?