Skip to content

fix(callcenter): with_jsonl_audit return type io::Result → Result<Self, AuditError> (unblocks jsonl feature)#410

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/fix-with-jsonl-audit-return-type
May 27, 2026
Merged

fix(callcenter): with_jsonl_audit return type io::Result → Result<Self, AuditError> (unblocks jsonl feature)#410
AdaWorldAPI merged 1 commit into
mainfrom
claude/fix-with-jsonl-audit-return-type

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

UnifiedBridge::with_jsonl_audit (behind the jsonl feature) is declared -> std::io::Result<Self> but its body opens the sink via JsonlAuditSink::new(...)?, which returns Result<_, AuditError>. AuditError has no impl Into<std::io::Error>, so the ? fails to convert — the function does not compile whenever a consumer enables the jsonl feature (E0277: ? couldn't convert the error to std::io::Error).

This makes the jsonl feature currently unusable by any downstream consumer.

Fix

Return Result<Self, crate::audit_sink::AuditError> — the honest type the body already produces, consistent with the sibling builders with_audit_chain / flush / checkpoint (all Result<_, AuditError>). The ? now works without conversion. One-line change.

-    ) -> std::io::Result<Self> {
+    ) -> Result<Self, crate::audit_sink::AuditError> {

Not a breaking change: grep finds no code callers (only a doc-comment reference in audit_sink/mod.rs).

Provenance

Surfaced by AdaWorldAPI/MedCare-rs#154 (medcare_unified_bridge_audited), which enables lance-graph-callcenter/jsonl and hit the broken build. Per the consumer's CLAUDE.md commitment #5 (no silent upstream patches), filed here as a proper PR rather than carried as a local patch.

Test plan

  • cargo check -p lance-graph-callcenter --features jsonl — clean (was E0277)
  • CI green
  • MedCare-rs#154 unblocks once this merges + the medcare vendored clone tracks it

Generated by Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • Breaking Changes
    • Updated error handling for JSONL audit sink initialization to align with the crate's standard error type. Applications using the JSONL audit feature will need to update error handling code.

Review Change Stack

…f, AuditError>

`UnifiedBridge::with_jsonl_audit` (behind the `jsonl` feature) was declared
`-> std::io::Result<Self>` but its body opens the sink via
`JsonlAuditSink::new(base_path.into())?`, which returns
`Result<_, crate::audit_sink::AuditError>`. `AuditError` has no
`impl Into<std::io::Error>`, so the `?` fails to convert — the function
does not compile whenever a consumer enables the `jsonl` feature.

This means the `jsonl` feature is currently unusable: any crate that turns
it on forces `lance-graph-callcenter` to compile `with_jsonl_audit`, which
errors with E0277 (`?couldn't convert the error to std::io::Error`).

Fix: return `Result<Self, crate::audit_sink::AuditError>` — the honest
type the body already produces, and consistent with the sibling builders
`with_audit_chain` / `flush` / `checkpoint` which all return
`Result<_, AuditError>`. The `?` now works without conversion.

No callers exist (grep: only a doc-comment reference in audit_sink/mod.rs),
so this is not a breaking change for any existing code.

Surfaced by AdaWorldAPI/MedCare-rs#154 (medcare_unified_bridge_audited),
which enables `lance-graph-callcenter/jsonl` and hit the broken build.
Per the consumer's commitment #5 (no silent upstream patches), the fix is
filed here as a proper lance-graph PR rather than carried as a local patch.

Verification: `cargo check -p lance-graph-callcenter --features jsonl` — clean.

Generated by [Claude Code](https://claude.ai/code)
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e9005d0-ea12-45a0-97cb-7b73653061d4

📥 Commits

Reviewing files that changed from the base of the PR and between c5ed483 and f023dfc.

📒 Files selected for processing (1)
  • crates/lance-graph-callcenter/src/unified_bridge.rs

📝 Walkthrough

Walkthrough

The with_jsonl_audit method signature changes its return type from std::io::Result<Self> to Result<Self, crate::audit_sink::AuditError>. This aligns error handling for JSONL audit sink creation with the crate's standardized audit error type.

Changes

Error type alignment for JSONL audit

Layer / File(s) Summary
Method signature return type update
crates/lance-graph-callcenter/src/unified_bridge.rs
The with_jsonl_audit method (feature-gated jsonl) return type changes from std::io::Result<Self> to Result<Self, crate::audit_sink::AuditError> to standardize error propagation with the crate's audit error type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A single line takes flight,
Error types now unified bright,
AuditError claims its throne,
Where io::Result once shone alone!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating the return type of with_jsonl_audit from io::Result to Result<Self, AuditError>, which directly addresses the compilation issue that blocks the jsonl feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-with-jsonl-audit-return-type

Comment @coderabbitai help to get the list of available commands and usage tips.

@AdaWorldAPI AdaWorldAPI merged commit 38c966a into main May 27, 2026
4 of 5 checks passed
AdaWorldAPI added a commit that referenced this pull request May 28, 2026
…return-type

fix(callcenter): with_jsonl_audit return type io::Result → Result&lt;Self, AuditError&gt; (unblocks jsonl feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants