Semantic search over a Markdown knowledge base, served over MCP.
Which names reach the index and which names can be read back were decided by
different code. The index walk (collect_source_files_under in
grooveseek/src/indexer.rs) and the live watcher (should_process_parts in
grooveseek/src/watcher.rs) looked at exclusion rules, extensions and links,
never at the name. The read side — kb://doc/ URIs and the lexical check
get_document runs before it touches the disk — asked is_safe_relative in
grooveseek/src/resources.rs, which on Windows refused a colon and a reserved
device name.
On Windows the verbatim \\?\ prefix, which a canonical knowledge-base path
carries, lets files exist under names Win32 will not open as written: CON.md,
or anything under a directory called dir.. The walk indexed them; search
found them; no URI was offered for them and get_document refused them
(AW-43). The same gap ran the other way for spellings that Win32 rewrites:
b.md. and dir./x.md passed the lexical check and were only refused after a
look at the disk (AW-42), and a/b?.md came back as “unavailable” rather than
“not found” (AW-40).
Three review rounds on #319 each found another instance on this one axis. The question this record answers is where the rule for “a name the index can hold” lives, so the next instance is a change to one function rather than a fourth patch.
get_document must not be able to answer differently.CON.md and b.md. are names on this server and not
elsewhere, and get_document’s one-spelling rule would need an exception
for names Win32 itself rewrites.Chosen option: 3.
resources::doc_is_addressable is the one predicate for a name the index
can hold. It is is_safe_relative plus what only a document name must
satisfy: not empty, no . segment and no empty one (./a.md, a//b.md, a
trailing /) — on every platform.is_safe_relative refuses, on Windows, besides the colon and device names:
a segment ending in a dot or a space, and < > " | ? * or a control
character. On Unix all of these stay ordinary names.groove index Done in line (the MCP rebuild_index reply does not carry
the count). The walk judges only paths under the knowledge base as kb_path
spells it.get_document asks it before the first stat. What its spelling check still
answers is a name the index could hold that is not the document’s one
spelling: a case variant, an 8.3 short name, a symlinked directory.groove index (or
rebuild_index), whose sweep deletes what the walk no longer collects.
Until then groove doctor reports them on Windows as
name-not-spellable-on-windows, from the database alone.get_document and a kb://doc/
URI accept; the next finding on this axis is a line in one function.a?b.md and a.md. get the misspelling answer without a
look.CON.md or kept under dir./ is not searchable
until it is renamed. The warning and the Done in count say so... between backslashes (a\..\b.md),
which get_document already refused, is now left out of the index as well.
groove doctor does not report a row an earlier version stored for it,
since its finding is Windows only; the next full index removes the row.get_document cannot open that
spelling. The predicate judges that lossy spelling and accepts it, so the
first Good point above does not hold for such names. This record does not
change that; it is tracked separately.doctor exits 1 over them meanwhile.
The watcher removes such a row sooner when its file goes: deleting the file
deindexes it, and renaming it to a name the index can hold moves the row.the_spelling_refusal_names_nothing_for_spellings_the_lexical_check_lets_through
in grooveseek/src/server.rs was left unedited, as tests are in this
project. Its inputs (./HiddenVault/a.md and the like) are now refused at
the lexical check, so it no longer reaches the spelling check and its doc
comment describes the older order. Both checks give the same reply, so what
it asserts — the refusal names no path — still holds.grooveseek/src/resources.rs,
indexer.rs, watcher.rs, doctor.rs and server.rs pin each clause per
platform, and grooveseek/tests/index_unspellable_names.rs runs
groove index on Windows over a knowledge base holding CON.md.