fix(memory,tools): propagate LLM edge confidence and fix tracing span#4745
Merged
Conversation
Closes #4723: resolve_edge_typed passed hardcoded 0.8 instead of edge.confidence to the store in both the non-APEX and APEX-MEM paths. Introduces DEFAULT_EDGE_CONFIDENCE const to eliminate the magic number and forwards edge.confidence.unwrap_or(DEFAULT_EDGE_CONFIDENCE) at both call sites. Adds two regression tests (non-APEX and APEX paths). Closes #4731: resolve_and_validate created a tracing span before the async DNS lookup but entered it after .await, leaving the actual async work invisible in traces. Replaced manual span.enter() with #[tracing::instrument], consistent with the apply_ipi_filter fix (#4730).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolve_edge_typedhardcoded0.8as confidence for all edges in both the non-APEX and APEX-MEM paths, silently discarding the LLM-provided value. IntroducesDEFAULT_EDGE_CONFIDENCE: f32 = 0.8constant and forwardsedge.confidence.unwrap_or(DEFAULT_EDGE_CONFIDENCE)at both call sites inzeph-memory/src/semantic/graph.rs.resolve_and_validatecreated a tracing span before the async DNS lookup but entered it after.await, so the span covered only the synchronous result-checking code. Replaced manualspan.enter()with#[tracing::instrument(name = "tools.scrape.dns.resolve", ...)], consistent with theapply_ipi_filterfix from fix(tools): redact URLs in scrape audit log and fix IPI tracing span #4730.Test plan
cargo nextest run -p zeph-memory --lib— 1448 passed (includes 2 new regression tests:extract_and_store_forwards_edge_confidence_not_hardcoded_08andextract_and_store_apex_forwards_edge_confidence_not_hardcoded_08)cargo nextest run -p zeph-tools --lib— 1228 passedcargo nextest run --workspace --lib --bins— 10422 passedcargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleanCloses #4723
Closes #4731