File tree Expand file tree Collapse file tree
platform-integrations/bob/evolve-lite/skills/evolve-lite:recall/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments