stacks
stacks copied to clipboard
iterating on Stacks' event stream store
If it's not obvious by the code quality, Stacks is my first substantive Rust project. In addition to learning on the go I've been sketching out a bunch of ideas.
The rough edges really show in the persistence layer, which is all in store.rs. This issue is an attempt to describe where I'd like to get to, and an invitation for input from anyone who is into this sort of thing.
Persistence in Stacks is roughly, a stream of events (think event sourcing/modeling) stored in sled and a CAS, kept on the file system via cacache's api. The actually app works against a materialized view of the event stream (view.rs).
Something I've been tripping over myself to tease out is, there's interesting meta information that is associated with the content of a clip, and other meta information associated with the particular instance of clipping some given content.
For example, the time and the app you clipped some content from is interesting. If you later interact with the same content, that's interesting too. Sometimes you "clean up" a clip, by quickly editing, in order to paste it for a given context. This is now new content with a new content hash, but it's still interesting to see when and how it relates to the original content. It seems to make most sense to track this information against the unique event sled ids (which is a scru128) in the event stream.
And then there's interesting meta information fundamentally related to the content, regardless of when and how that content is used. Primarily there's mime type and content type. Mime type is currently roughly the http mime type that makes sense to associate with the content. And the content type is additional specialization of the content, which is mostly relevant for text content. Is it HTML, JSON, Markdown, a URL, email, etc. Some other meta information that would be interesting are things like, image dimensions, Open graph data for urls, word count, tiktoken counts etc.
(still fleshing this out)