github tobiaswuerth/sift v2.2.1

2 hours ago

A security fix, and fixes of what 2.2.0 slowed or left broken: the MCP tool reindex no longer reads files outside a
collection's folder, a home process of an older sift that still runs after an update is named with the command that
stops it, a home can be moved or copied with its stores, keyword searches with NOT are as fast as in 2.1.0 again, a
quoted phrase's memory no longer grows with its length, and an index of many documents no longer stands still on
Windows. The store layout is that of 2.0, so stores need no upgrade; the catalog gains a record of where its home
lies, which older versions of sift 2 go on reading and writing. Stop sift serve and start it again after updating,
and restart or reconnect the agents that use sift: a home process started before goes on running the older code,
without these fixes.

Security

  • The MCP tool reindex read any file its user can read. Given an id made of a collection's name and an absolute
    path (notes/C:/..., a drive-relative or a UNC path too), it read that file into the collection's store, where
    search and get answered it to agents: files of collections kept from agents and files in no collection alike.
    MCP takes no token, so every program on the machine could ask. 2.1.0 did the same. An id's path must now stay
    inside its collection's folder by the rules of the system's own paths (no drive, no root, no . or .. step),
    for every tool and command that takes an id. reindex also no longer tells whether a file lies outside the
    folder, below a link or a junction, in a hidden or ignored folder, or under a name .siftignore leaves out: it
    answers such a path the same without looking. Run sift index once after updating: it drops any document that
    was read from outside its collection's folder.
  • The MCP tool collections showed agents how far a job on a collection kept from them had got, so an agent could
    watch such a collection being indexed file by file. Agents now see neither the collection nor the count of such a
    job.

Fixed

  • Keyword searches with NOT, and nested ones over common words, were slower in 2.2.0 than in 2.1.0: a b c NOT d
    about twice over a million passages, hundreds of nested clauses up to thirty times. The scoring 2.2.0 brought
    looked each passage up by a search over the whole rest of a list, and copied a word's passages for every place a
    query names the word. It now steps forward from the place last found and copies nothing. Over a synthetic store
    of a million passages, with the same hits: NOT queries 0.12 to 0.20 s (2.2.0: 0.23 to 0.52 s; 2.1.0: 0.14 to
    0.22 s), 300 pairs (a AND b) OR ... 0.7 s (4.2 s; 2.7 s), an OR of 1,000 common words 1.4 s (2.0 s; 30 s).
    Hundreds of clauses (a NOT b) OR ... over the commonest words stay about three times slower than in 2.1.0 (200
    of them: 1.2 s against 0.4 s).
  • A quoted phrase that names common words many times needed memory in proportion to its length, and nothing bounded
    it: "a b a b ..." of two common words took 8.7 GB at 100 words and 22 GB at 300 over a million passages, and one
    call of an agent may carry 20 queries. 2.1.0 did the same. A phrase's words are now read and held once each,
    however often the phrase names them: such a phrase takes 2.0 GB at any length, what its two words' own lists
    take, with the same answers.
  • On Linux and macOS, a catalog or a store that sift had read while its file was read-only could not be written
    once the file was made writable again: SQLite gives its log files (-wal, -shm) the file's permissions when it
    makes them, they were left read-only, and sift said the catalog "cannot be written" and to see that the file is
    not read-only, which it no longer was. A database opened for writing now gives its log files its own
    permissions.
  • On Windows, an index that converted many documents could stand still for ten minutes and then skip files until
    the next release. Each converted document (a web page, an office file, a PDF, a mail's HTML body, an attachment)
    opened an event loop of its own, which on Windows leaves a network port unusable for about two minutes. Past
    about 15,000 documents within two minutes the ports ran out: every reader process hung, the files then in the
    readers were given up as "its reader came to no end", and other programs' connections failed meanwhile. A reader
    process now converts all its documents on one event loop. The files skipped so are read again by the next
    sift index with this version.
  • After an update to 2.2.0, a home process of the older sift that was still running, as the one that
    sift serve --stdio starts for agents is until it has been idle for 15 minutes, made every command fail without
    naming the process to stop; sift serve then said that commands "are sent to it as they are"; and the new
    sift serve --stdio and sift ui went on using the older process, which so never left and kept the update from
    agents. All four now refuse such a home process alike, naming its port, its process and the command that stops it
    (taskkill -PID N -F on Windows, kill N elsewhere), and sift serve --stdio passes it nothing and starts a home
    process of its own once the older one has left. After updating, restart or reconnect the agents that use sift.
  • A copy of a home went on using the stores of the original: sift index in the copy wrote them, and sift rm and
    sift move there deleted or moved them. A home moved to another folder, disk or drive letter could not use the
    stores in its own collections/, and no command repaired that. The catalog now records where its home lies, and
    what it names under the home (the stores, and the folders of collections kept there) goes where the home goes;
    stores and folders elsewhere stay, so a copy shares those. This holds once this version has opened the home
    where it lies: run any command, such as sift status, on a home before moving or copying it. Older versions of
    sift 2 go on reading and writing such a catalog.

Don't miss a new sift release

NewReleases is sending notifications on new releases.