Repository navigation
v0.8.3
[0.8.3] - 2026-11-10
Bug-fix release (Argon review of 0.8.2 + Muse verification + Sonnet cross-review). The search contract, tools and limits are unchanged.
Fixed
- Index lock race + heartbeat (Argon #1, high). The lock file now carries a random token;
releaseLockonly deletes the lock when the file still carries our token, so an old process that wakes up after its lock was stolen no longer deletes the new owner's lock. A heartbeat renews the lock timestamp every 10 s while it is held, so a build running longer than the 30 s staleness timeout cannot have its lock stolen. The acquire side is hardened too (Argon 0.8.3 review): an unreadable lock is only treated as stale when the file itself is old (a just-created empty lock is a live lock being written, not a corrupt one); a stale lock is re-checked immediately before unlinking, so a second process cannot delete the new owner's lock in the steal window; the heartbeat writes atomically (temp file + rename) instead of truncating in place. Round 2:isLockHeldByLiveProcessuses the same mtime rule, so an empty lock file counts as held instead of letting a load run over a just-started build. - read_file ignores Obsidian embeds (Argon #2, high).
read_filenow resolves image references the same way diagnostics does:![[pic.png]]resolves by filename across the whole library,![[attachments/pic.png]]resolves vault-root first..markdownand.mdxare treated as Markdown too (image references resolve;save_fileappends references for them). Two gaps from the Argon 0.8.3 review are fixed: on a cold start (or right after a save) every Obsidian embed reported "not found" because the filename map came from an empty/stale index — the resolver now builds/refreshes the index first; and a ref that escapes the library (![[../../outside.png]]) is reported broken instead of probing whether a file exists outside the root (the content was already blocked downstream, but the existence signal alone was a side channel). Round 2: backslashes in a ref (folder\pic.png, synced from Windows) are normalized on every platform; and when another process is still building the index, the resolver waits up to ~2 s for it to finish instead of reporting every embed as missing. Round 3: the non-Obsidian branch inread_filenormalizes backslashes too (an inlineused to report ENOENT on Linux/macOS while diagnostics called it valid); the cold-start wait runs at most once per 5 s, so a note with many images cannot block oneread_filefor 20 s. - Filename dates that do not exist (Argon #4).
extractDateno longer lets an invalid date roll over (20260231and2026-02-31used to become 2026-03-03); the parsed components must match the source, otherwise the file falls back to its modification time. The filename regex also has digit boundaries, so a longer digit run (order-20261108123.md) is not read as a date. The same rollover check now applies to a front-matterdate:(Argon 0.8.3 review), and a trailing YAML comment there is stripped before parsing (date: 2026-10-28 # meetingused to parse as Invalid Date and silently fall back). Round 2: a quoted YAML date (date: "2026-02-31") no longer bypasses the check — the quotes are stripped before matching, since V8 parses the quoted string and rolls it over; years 0–99 are set withsetFullYearinstead ofnew Date(y, …)(which maps them to 1900–1999). Round 3: any leading/trailing quote chars are stripped, paired or not — V8 parses even unpaired quotes leniently and rolls over, so leaving one in is worse than stripping it (the bare check below still validates the date). - Date bounds parsed in local time (Argon #5). A date-only bound (
modified_after: "2026-10-28") is now that calendar day in the server's local timezone, not UTC midnight — in UTC+8 the old code missed files modified that morning. The tool descriptions say so. File dates are now stored on the same basis (Argon #6): a filename/front-matter date is a local calendar day, so adate_from/date_tofilter no longer misses it by a day in negative-offset timezones. The on-disk index format version is bumped (2 → 3) so existing indexes rebuild with the new basis. - Tag extraction boundaries (Argon #10). A YAML trailing
#comment is no longer read as a tag (tags: # commentis empty;- alpha # c1isalpha); fenced code blocks are skipped (#includein code is not a tag); a body tag must contain at least one letter (#123is not a tag). Inline code was already excluded (the#there is preceded by a backtick, not whitespace). Argon 0.8.3 review fixes: inline code that contains a space (`git commit #amend`) is now stripped before the tag scan; fenced blocks are stripped on CRLF line endings too (the old regex only matched\n, so a Windows note's code block leaked tags); a comment aftertags:no longer eats the block list below it. Sonnet cross-review fixes: a#inside a flow list is a tag character, not a comment (tags: [#a, #b]used to loseb— a 0.8.2 regression; only a#after the closing]starts a comment); a fence indented up to 3 spaces is still a fence (a fence under a list item used to be missed); an unclosed fence swallows the rest of the note, so a#tagafter it is not extracted. Carbon final review fixes: the fence stripper is now a line-by-line CommonMark scan instead of two regexes — a 4+ backtick fence no longer loses the real tags after it (the S3 unclosed-fence cleanup turned the old 4+ backtick tag leak into tag loss, a 0.8.3 regression; the old regex only recognised exactly 3 backticks, so the closing fence never matched and everything after the opening fence was stripped); inline code now matches opening/closing backtick runs of the same length (foo #barused to leak#bar); a quoted]inside a flow list no longer truncates it (tags: ["a]b", c]used to return onlya); a multiline flow list is not extracted at all instead of producing a dirty[tag;addTagrejects only real dirty characters ([,],{,},") — an earlier strict allowlist dropped legitimate front-matter tags with spaces or dots (machine learning,node.js,c++), a 0.8.3 regression caught by Sonnet's final review; it also trims again after stripping quotes/#so a quoted whitespace-only value is not stored as a blank tag (Carbon r2 review). - Diagnostics no longer hashes filename-only files (Argon #11, low).
.json/.csv/.logfiles are data, not notes: reading them just to hash for duplicates wasted I/O and reported noise. - Linux clipboard: empty is not unsupported (Argon #12, low). When
wl-pasteorxclipexists but returns nothing, the result isempty, notunsupported(previously both ended inunsupported). Argon 0.8.3 review fixes the headless misreport the other way: a tool that is installed but has no desktop session exits non-zero, so it now reportsunsupportedinstead ofempty— the distinction is made from the command's actual exit status, not awhichcheck. Sonnet cross-review: the exit code cannot make that distinction at all — xclip exits 1 both when the clipboard is empty in a real X session ("Error: target STRING not available") and when there is no display ("Error: Can't open display"), so the 0.8.3 fix still reported an empty clipboard asunsupported. The distinction is now made from the stderr text (not available/Nothing is copied= empty;Can't open display/Failed to connect to a Wayland server= no session), verified against a real Xvfb + xclip session. Carbon final review:execFileAsyncnow setsLC_ALL: 'C'so a non-English locale cannot translate the stderr text the matcher depends on (xclip itself does not localise, but the timeout path leaves stderr empty and the pin costs one line). - read_file no longer waits out the full index build on a cold start (Sonnet, medium).
resolveNoteImageRefused toawait ensureReady()unconditionally, so a first read of a note with an Obsidian embed blocked for the whole build (~2.6 s on a 10k-note library, over a minute at 100k-note scale — past many MCP clients' call timeouts). It now only waits for the build when the index is already ready (a fast refresh); on a cold start it kicks the build off in the background and resolves with what needs no index (vault-root and note-relative paths). Only a basename-only ref (![[pic.png]]) reportsbrokenthis once, and a retry after the build finds it. The bounded wait for another process's build (round 2, ~2 s, once per 5 s) is kept, but only when the lock is foreign — waiting for our own background build is the block this removes. Argon round 5: the fire-and-forget change also skipped the fast disk load, so even a perfectly good on-disk index was ignored on the first read after startup (first basename refbroken, later ones fine). Fixed: when no build is in flight and the disk copy is trusted, the resolver first does a fastawait load()and uses the index if it lands; only when there is truly no usable index on disk does it fall back to the background build + empty map. Carbon final review: the fast load did not updatelastRefreshMs, so therefreshIfNeeded()right after it still synchronously awaited one full scan (292 ms on a 6k-note library). The refresh after a fast load is now a background refresh ({ background: true }); a foreground refresh is only awaited whenneedsRefreshis set (a file was just saved), matchingsearchInner.
Changed
- Incremental refresh test hardening (CI #10 flake, 1/100). The test now gives every write a distinct mtime (seconds apart) so it verifies the refresh logic, not the filesystem's timestamp granularity. An instrumented reproduction script (
test/incr-repro.mjs) is kept for diagnosis; the exact trigger of the 1% miss is still undetermined (the same-millisecond mtime hypothesis was ruled out by the earlier reproduction). Same-millisecond rewrites with identical size remain invisible to a stat-based refresh by design. - Clipboard test platform guard (test only). The
stderr separates empty from no sessiontest fakes xclip/wl-paste on PATH, which only exists on the Linux clipboard path — on Windows/macOS it would fail against the real clipboard (PowerShell / macOS reader). It now returns early unlessprocess.platform === 'linux'(Sonnet FIXED2 review). - Test cache hygiene. The small-budget test server now gets its own
MEMDRIVE_CACHE_DIRin the scratch dir instead of falling back to the default cache location and leaving an orphan hash folder behind.
Not fixed (deferred)
- #3 Windows open_image special characters — needs a Windows test first (create
a,b.pnganda;b.png, open each withopen_image). - Symlink escape probe (Argon round 2) — a symlink directory inside the library pointing outside the root (
notes/ext_link -> /etc) lets a ref like![[ext_link/passwd]]probe whether a file exists outside the root (the content is blocked byassertInsideRealRoot; only the existence signal leaks). Requires a symlink the user created inside their own library; known limitation, not fixed. - Lock steal residual TOCTOU (Argon round 2) — the double
isLockStealable()check before unlinking narrows the steal window to microseconds, but without a nativeflock(Node has none) it is not a true compare-and-swap. Accepted residual risk. - #6 chunk/highlight surrogate split, #7 highlight NFKC mapping, #8 save_file append newline, #13 backup timestamp collision — deferred; #9 (image filename sanitizing) is not a bug (refs round-trip correctly via
encodeImageSrc).