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
2 changes: 1 addition & 1 deletion .github/scripts/test_public_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class PublicBoundaryTest(unittest.TestCase):
def test_repository_satisfies_public_boundary(self) -> None:
self.assertEqual(boundary.verify(REPOSITORY_ROOT), "1.0.4")
self.assertEqual(boundary.verify(REPOSITORY_ROOT), "1.0.5")

def test_forbidden_private_source_is_detected(self) -> None:
with tempfile.TemporaryDirectory(prefix="public-boundary-") as temporary:
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
]

[workspace.package]
version = "1.0.4"
version = "1.0.5"
edition = "2021"
rust-version = "1.95"
license = "MIT"
Expand Down Expand Up @@ -90,12 +90,12 @@ fs2 = "0.4"
notify = "6"

# Workspace crates
mcp-types = { version = "=1.0.4", path = "crates/mcp-types" }
mcp-client = { version = "=1.0.4", path = "crates/mcp-client" }
mcp-session = { version = "=1.0.4", path = "crates/mcp-session" }
mcp-tools = { version = "=1.0.4", path = "crates/mcp-tools" }
mcp-model-registry = { version = "=1.0.4", path = "crates/mcp-model-registry" }
mcp-acceleration-products = { version = "=1.0.4", path = "crates/mcp-acceleration-products" }
mcp-types = { version = "=1.0.5", path = "crates/mcp-types" }
mcp-client = { version = "=1.0.5", path = "crates/mcp-client" }
mcp-session = { version = "=1.0.5", path = "crates/mcp-session" }
mcp-tools = { version = "=1.0.5", path = "crates/mcp-tools" }
mcp-model-registry = { version = "=1.0.5", path = "crates/mcp-model-registry" }
mcp-acceleration-products = { version = "=1.0.5", path = "crates/mcp-acceleration-products" }

# Testing
mockall = "0.13"
Expand Down
32 changes: 30 additions & 2 deletions crates/mcp-tools/src/domains/display_title.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ pub fn normalize_recall_result_item(item: &mut Value) {
("event_id", "event_id"),
("transcript_id", "transcript_id"),
("doc_id", "doc_id"),
("node_id", "node_id"),
("event_type", "event_type"),
("original_type", "kind"),
("node_type", "node_type"),
Expand All @@ -232,8 +233,24 @@ pub fn normalize_recall_result_item(item: &mut Value) {
}
}

// MemorySearchResult id is the event/node uuid; surface as event_id when missing.
if obj.get("event_id").is_none() {
// UUIDs are table-local identities, not evidence that a source is an event.
// In particular, promoting a doc/node UUID to event_id changes follow-up
// reads and can collide with a real event carrying that same UUID.
let source_kind = obj
.get("source_kind")
.or_else(|| obj.get("result_type"))
.and_then(Value::as_str)
.unwrap_or("")
.to_ascii_lowercase();
if obj.get("event_id").is_none()
&& obj.get("doc_id").is_none()
&& obj.get("node_id").is_none()
&& obj.get("transcript_id").is_none()
&& !matches!(
source_kind.as_str(),
"doc" | "document" | "node" | "knowledge_node" | "knowledgenode" | "transcript"
)
{
if let Some(id) = obj.get("id").cloned() {
obj.insert("event_id".to_string(), id);
}
Expand Down Expand Up @@ -283,6 +300,17 @@ mod tests {
assert_eq!(item["event_id"], "evt-uuid");
}

#[test]
fn normalization_preserves_document_and_node_identities() {
for (kind, field) in [("doc", "doc_id"), ("knowledge_node", "node_id")] {
let mut item = json!({"id":"same-uuid", "result_type":kind,
"metadata": {field:"same-uuid", "title":"stadium graphics"}});
normalize_recall_result_item(&mut item);
assert_eq!(item[field], "same-uuid");
assert!(item.get("event_id").is_none());
}
}

#[test]
fn search_keywords_from_content_preview_when_title_junk() {
let item = json!({
Expand Down
Loading