relayburn-sdk: implement search + export_ledger + export_stamps verbs#303
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a new ChangesSearch and Export Verbs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Wraps the FTS5 search and JSONL export APIs on relayburn_ledger::Ledger behind the SDK surface. Each verb appears in two forms: - LedgerHandle method (sync, anyhow::Result), reusing the open ledger. - Free function form, which opens its own handle from LedgerOpenOptions's ledger_home. `search` returns a SearchResult that echoes the query alongside BM25-ranked SearchHits. `export_ledger` and `export_stamps` buffer the JSONL output into Vec<serde_json::Value> and return an `impl Iterator` — relayburn ledgers are small enough that buffering is fine for v1; we can add a streaming variant later without breaking callers. Includes unit tests against a tempfile-backed ledger covering FTS5 hits, session-filter scoping, and round-tripping a turn / stamp through the export iterator. Part of #246
367d416 to
eedd229
Compare
Summary
Fill in `crates/relayburn-sdk/src/export_verbs.rs` with the three new verbs from the #259 redesign:
Each verb is callable as a `LedgerHandle` method and as a free function. Exports use the buffered approach (write into a `Vec`, split on newlines, parse each line) — relayburn ledgers are small enough that this is fine, and the iterator surface lets us add a streaming variant later.
Part of #246.
Test plan
Stacking
Stacked on #300 (module stubs) — base is `claude/sdk-module-stubs` and will rebase to `main` once that lands.
🤖 Generated with Claude Code