v0.3.1
Fixes a crash on startup, and the index is now ~40% smaller
If dsx was crashing for you with TypeError: undefined is not an object (evaluating 'record.message.role'), this release fixes it. Just upgrade — no
flags, no config, nothing to migrate.
The crash
Some transcripts store messages in a flat shape (role and text directly on
the record, with an epoch-millisecond timestamp) instead of the usual nested
message object. A few also contain permission audit entries that are labeled
as messages but carry no message content at all. Indexing assumed the nested
shape and died on the first record that didn't match, taking the whole run with
it — including dsx with no arguments, since that refreshes the index before
opening the TUI.
All three shapes are now handled. Sessions that previously killed the indexer
show up normally in list, search, show, and export, and their timestamps
resolve correctly.
Smaller index
The full-text index used to keep its own verbatim copy of every message, on top
of the transcripts already on disk. That copy was about two thirds of the
index file. It's gone: search now reads matching lines back from the source
transcript when it builds result snippets.
On a real ~6 GB session store:
| before | after | |
|---|---|---|
~/.cache/dsx/index.db |
1,521 MB | 949 MB |
| indexed blocks | 670k | 1,261k |
| bytes per block | 2,270 | 752 |
The "before" number is from a partial index (it had crashed partway). Like for
like, the index holds nearly twice the content in about 60% of the space.
Search output is unchanged — same results, same highlighting. Queries returning
50 hits take 260-400 ms on that store.
What happens when you upgrade
First run rebuilds the index from scratch, because the storage format changed.
Expect a few minutes on a large session store (about 7 minutes for 6,000+
files); after that, refreshes are incremental as usual. The rebuild reclaims the
old file's disk space rather than leaving it allocated.
One small caveat: search matches on word stems, so a result that matched only
via a stem variant (searching running, text says runs) shows its snippet
without highlighting rather than highlighting the wrong word.
Verification
Full reindex of a 6,262-file / 877,439-line store, plus CLI search, show, and
export against the previously-crashing sessions, TUI launch, unit tests, and
typecheck.