Skip to content

Commit 3a4a990

Browse files
committed
fix: add language tag to code block and fix _source handling in retrieve_entities
1 parent c4b9331 commit 3a4a990

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

platform-integrations/bob/evolve-lite/skills/evolve-lite:recall/scripts/retrieve_entities.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,17 @@ def load_entities_with_source(entities_dir):
6565
entity = markdown_to_entity(md)
6666
if not entity.get("content"):
6767
continue
68+
# Clear any _source from frontmatter to ensure provenance is derived
69+
# exclusively from the file path structure
70+
entity.pop("_source", None)
6871
# Detect subscribed entities using path relative to entities_dir
69-
# to avoid matching "subscribed" in ancestor directory names.
72+
# Only set _source when the FIRST path segment is "subscribed"
7073
try:
7174
rel_parts = md.relative_to(entities_dir).parts
7275
except ValueError:
7376
rel_parts = md.parts
74-
for i, part in enumerate(rel_parts):
75-
if part == "subscribed" and i + 1 < len(rel_parts):
76-
entity["_source"] = rel_parts[i + 1]
77-
break
77+
if len(rel_parts) > 1 and rel_parts[0] == "subscribed":
78+
entity["_source"] = rel_parts[1]
7879
entities.append(entity)
7980
except OSError:
8081
pass

0 commit comments

Comments
 (0)