Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,28 @@ Notable changes to the native `ai-hist` CLI are documented here.

### Rust API

- `ChangeQuery::session(source, session_id)` restricts a change-feed drain
to one session: the same `Change` values the unfiltered drain reports for
that session, tombstones included, read through each table's
`(source, session_id)` index rather than the whole revision range. It is a
one-shot read (a session's backfill), so naming a consumer alongside it is
`Error::InvalidArgument`. A prompt with no session belongs to no session's
drain, and a trajectory is the session its id names under the `trajectory`
source.
- `SessionStore::session_identities(IdentityQuery { after, limit })` pages
every `(source_name, session_id)` the store holds evidence under, catalogued
or not: the union of the catalog, prompts, events, tool calls, file edits,
markers, relationships (by parent), presences, commit links, connector
observations and trajectories. It is a merge of covering index seeks, so no
payload is read; each page reads one snapshot, and an empty session id is
no session. `SessionIdentity` names a stored session, including one
under a source this build does not know, and is the type
`ChangeQuery::session` holds. `storage::session_identities_after` is the
same read, and now covers every one of those tables rather than the catalog,
prompts and events alone, and reads each page on one snapshot even on an
autocommit connection. `sessions` gains `idx_sessions_identity` on
`(source, session_id)`, added by the first writable open; until then a
read-only store answers `session_identities` with `StaleSchema`.
- The change feed reports every evidence table and each row exactly as
stored. `ChangeKind` gains `History`, `Presence`, `CommitLink`,
`Trajectory`, `SourceObservation` and `ObservationEvidence` (`ALL` lists
Expand Down
2 changes: 1 addition & 1 deletion crates/ai-hist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() -> Result<(), ai_hist::Error> {
}
```

Default features expose `SessionStore` — `open`, `discover`, `sync`, `hydrate`, `watch`, `sessions`, `session`, `changes_since`, `head_revision` — plus `Source::capabilities()`, the typed evidence structs and one `Error` enum; see `docs/sourcing-sdk.md` in the repository. Optional features: `export` (consistent snapshots and change capture), `opencode-backup`, `git-hooks`, `fs-events`. The legacy `delivery` feature aliases `export`; upload jobs and workers are owned by the probe package, `plugins/relayhistory/rust`. Workspace crates enable `unstable-internal` for connection-level maintenance APIs.
Default features expose `SessionStore` — `open`, `discover`, `sync`, `hydrate`, `watch`, `sessions`, `session`, `session_identities`, `changes_since`, `head_revision` — plus `Source::capabilities()`, the typed evidence structs and one `Error` enum; see `docs/sourcing-sdk.md` in the repository. Optional features: `export` (consistent snapshots and change capture), `opencode-backup`, `git-hooks`, `fs-events`. The legacy `delivery` feature aliases `export`; upload jobs and workers are owned by the probe package, `plugins/relayhistory/rust`. Workspace crates enable `unstable-internal` for connection-level maintenance APIs.

The embedder guide — store options, the sync lifecycle and its locking, the evidence model, accounting semantics, versioning and feature flags — is [`docs/sourcing-sdk.md`](https://github.com/AgentWorkforce/relayhistory/blob/main/docs/sourcing-sdk.md), and [`examples/rust-consumer`](https://github.com/AgentWorkforce/relayhistory/tree/main/examples/rust-consumer) is a standalone project that consumes this crate from crates.io. Cargo semver is the contract; the crate's default-feature public API is snapshotted in the repository at `crates/ai-hist/public-api.txt` and diffed in CI.

Expand Down
16 changes: 16 additions & 0 deletions crates/ai-hist/public-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ pub ai_hist::Change::source_name: alloc::string::String
pub ai_hist::ChangeQuery::batch: usize
pub ai_hist::ChangeQuery::consumer: core::option::Option<alloc::string::String>
pub ai_hist::ChangeQuery::kinds: core::option::Option<alloc::vec::Vec<ai_hist::ChangeKind>>
pub ai_hist::ChangeQuery::session: core::option::Option<ai_hist::SessionIdentity>
impl ai_hist::ChangeQuery
pub fn ai_hist::ChangeQuery::batch(self, usize) -> Self
pub fn ai_hist::ChangeQuery::consumer(self, impl core::convert::Into<alloc::string::String>) -> Self
pub fn ai_hist::ChangeQuery::kinds(self, impl core::iter::traits::collect::IntoIterator<Item = ai_hist::ChangeKind>) -> Self
pub fn ai_hist::ChangeQuery::session(self, impl core::convert::Into<alloc::string::String>, impl core::convert::Into<alloc::string::String>) -> Self
pub struct ai_hist::Changes
impl ai_hist::Changes
pub fn ai_hist::Changes::commit(&self) -> anyhow::Result<ai_hist::Watermark, ai_hist::Error>
Expand Down Expand Up @@ -384,6 +386,12 @@ pub ai_hist::HydrateReport::diagnostics: alloc::vec::Vec<ai_hist::Diagnostic>
pub ai_hist::HydrateReport::related: alloc::vec::Vec<ai_hist::SessionRef>
pub ai_hist::HydrateReport::session: ai_hist::SessionRef
pub ai_hist::HydrateReport::status: ai_hist::HydrateStatus
#[non_exhaustive] pub struct ai_hist::IdentityQuery
pub ai_hist::IdentityQuery::after: core::option::Option<ai_hist::SessionIdentity>
pub ai_hist::IdentityQuery::limit: usize
impl ai_hist::IdentityQuery
pub fn ai_hist::IdentityQuery::after(self, ai_hist::SessionIdentity) -> Self
pub fn ai_hist::IdentityQuery::limit(self, usize) -> Self
#[non_exhaustive] pub struct ai_hist::Marker
pub ai_hist::Marker::kind: alloc::string::String
pub ai_hist::Marker::marker_uid: alloc::string::String
Expand Down Expand Up @@ -558,6 +566,12 @@ pub ai_hist::SessionFileEdit::tool_name: core::option::Option<alloc::string::Str
pub ai_hist::SessionFileEdit::tool_use_id: alloc::string::String
pub ai_hist::SessionFileEdit::ts_ms: core::option::Option<i64>
pub ai_hist::SessionFileEdit::user_modified: core::option::Option<i64>
#[non_exhaustive] pub struct ai_hist::SessionIdentity
pub ai_hist::SessionIdentity::session_id: alloc::string::String
pub ai_hist::SessionIdentity::source_name: alloc::string::String
impl ai_hist::SessionIdentity
pub fn ai_hist::SessionIdentity::new(impl core::convert::Into<alloc::string::String>, impl core::convert::Into<alloc::string::String>) -> Self
pub fn ai_hist::SessionIdentity::source(&self) -> core::option::Option<ai_hist::Source>
pub struct ai_hist::SessionMarker
pub ai_hist::SessionMarker::id: i64
pub ai_hist::SessionMarker::kind: alloc::string::String
Expand Down Expand Up @@ -635,6 +649,8 @@ pub fn ai_hist::SessionStore::session(&self, &ai_hist::SessionRef, ai_hist::Sess
pub fn ai_hist::SessionStore::sessions(&self, ai_hist::CatalogQuery) -> ai_hist::CatalogIter
pub fn ai_hist::SessionStore::sync(&self, ai_hist::SyncOptions) -> core::result::Result<ai_hist::SyncReport, ai_hist::Error>
pub fn ai_hist::SessionStore::watch(&self, ai_hist::WatchOptions) -> core::result::Result<ai_hist::WatchHandle, ai_hist::Error>
impl ai_hist::SessionStore
pub fn ai_hist::SessionStore::session_identities(&self, ai_hist::IdentityQuery) -> core::result::Result<alloc::vec::Vec<ai_hist::SessionIdentity>, ai_hist::Error>
pub struct ai_hist::SessionToolCall
pub ai_hist::SessionToolCall::args_json: core::option::Option<alloc::string::String>
pub ai_hist::SessionToolCall::id: i64
Expand Down
Loading
Loading