Skip to content

refactor(memory): remove ScoredCandidate wrapper and fix entered() span in tiered_retrieval#4881

Merged
bug-ops merged 1 commit into
mainfrom
4866-tiered-retrieval-async-span
Jun 5, 2026
Merged

refactor(memory): remove ScoredCandidate wrapper and fix entered() span in tiered_retrieval#4881
bug-ops merged 1 commit into
mainfrom
4866-tiered-retrieval-async-span

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove ScoredCandidate private single-field wrapper struct from score_candidates; use Vec<RecalledMessage> directly, eliminating the final .map(|s| s.recalled) unwrap and the .recalled field indirection in the sort comparator.
  • Remove debug_span!("memory.tiered.assemble").entered() guard wrapping assemble_within_budget inside async fn escalation_loop. The call is synchronous and nests under the outer memory.tiered.retrieve instrument span; the extra guard was a flagged anti-pattern per project convention.

Changes

  • crates/zeph-memory/src/tiered_retrieval.rs — two localized edits, behavior unchanged
  • CHANGELOG.md[Unreleased] section updated

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — 0 warnings
  • cargo nextest run --workspace --lib --bins — 10510 passed, 21 skipped
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • cargo doc --no-deps -p zeph-memory --all-features — no broken intra-doc links
  • grep -rn "ScoredCandidate" crates/ — no output (struct fully removed)
  • grep -n "\.entered()" crates/zeph-memory/src/tiered_retrieval.rs — no output

Closes #4866
Closes #4867

@github-actions github-actions Bot added refactor Code refactoring without functional changes documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/S Small PR (11-50 lines) and removed refactor Code refactoring without functional changes labels Jun 5, 2026
@bug-ops
bug-ops enabled auto-merge (squash) June 5, 2026 22:54
…an in tiered_retrieval

Remove the single-field ScoredCandidate wrapper struct from score_candidates;
use Vec<RecalledMessage> directly, eliminating the final .map(|s| s.recalled)
unwrap and the .recalled field indirection in the sort comparator.

Remove the debug_span().entered() guard wrapping assemble_within_budget inside
the async escalation_loop. The call is synchronous and already nested under the
outer memory.tiered.retrieve instrument span; the extra guard was a flagged
anti-pattern with no tracing benefit.

Closes #4866
Closes #4867
@bug-ops
bug-ops force-pushed the 4866-tiered-retrieval-async-span branch from 5d5dbdf to a138e56 Compare June 5, 2026 23:00
@github-actions github-actions Bot added the refactor Code refactoring without functional changes label Jun 5, 2026
@bug-ops
bug-ops merged commit 06c3889 into main Jun 5, 2026
32 checks passed
@bug-ops
bug-ops deleted the 4866-tiered-retrieval-async-span branch June 5, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) refactor Code refactoring without functional changes rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant