MGost
Live2025-10 → present
- Role
- solo, 119 commits
The local companion to the cloud converter. init, sync and render give you a git-friendly project on disk that stays in step with the server and downloads the rendered document.
A three-pass file-identity matcher.
The hard problem in a sync client is deciding whether a local file is a remote file that moved. Three passes, in order: an exact hash-and-size match resolves silently; a sole surviving basename prompts and defaults to yes; a sole remaining candidate with a differing size prompts too — but explicitly declines when running unattended, because arity alone is not evidence, and "nobody is watching" must not become "patch something over an unrelated file". It replaced an older name-and-size heuristic outright rather than bolting a third signal onto it.
A test suite built to be trusted.
A documented scenario table enumerates thirteen sync cases and the HTTP verbs each should produce. The harness uses real temporary directories with respx answering HTTP, so there is no route registry that can drift out of step with the tests — an explicit fix for what the previous harness got wrong.
A real bug the tests now guard.
timedelta.seconds is never negative, so a delta of minus one second reported 86399 and made an entire branch unreachable.
Windows is a first-class target.
pathlib.Path everywhere, including inside test records, because CI runs on Windows and str(Path) differs there. Conversion to text happens only at JSON and URL boundaries.
Highlights
- Three-pass file-identity matching that refuses to guess when unattended
- A documented thirteen-case scenario suite with mocked HTTP and no network
- Cross-platform CI including Windows
- Lint, tests, coverage and PyPI publishing from CI
Stack
Python 3.13typerhttpxPydanticaiofilesaiopathrichpytest + asyncio/xdist/respxhatchlingMIT