fix(filesystem): label semantic search paths in cli output

This commit is contained in:
BukeLy 2026-05-26 20:44:28 +08:00
parent 7104602a70
commit 4a158f9e5f
2 changed files with 3 additions and 2 deletions

View file

@ -1204,7 +1204,7 @@ class PIFSCommandExecutor:
return f"# no matches for: {data.get('query', '')}"
lines: list[str] = []
for item in data.get("data", []):
lines.append(str(item.get("path") or "-"))
lines.append(f"path: {item.get('path') or '-'}")
lines.append(f"summary: {self._one_line_value(item.get('summary') or '')}")
if "entity" in item:
lines.append(f"entity: {self._one_line_value(item.get('entity') or '')}")

View file

@ -87,7 +87,7 @@ def test_semantic_search_scope_keeps_ordinary_folders_out_of_source_type_filters
executor.json_output = False
rendered = executor.execute('search-summary "Federal Reserve annual report" /documents')
assert "/documents/report.pdf" in rendered
assert "path: /documents/report.pdf" in rendered
assert "summary: Federal Reserve annual report summary" in rendered
assert "line_text: 1: Federal Reserve supervision and regulation annual report." in rendered
assert "id=dsid_report" not in rendered
@ -150,6 +150,7 @@ def test_entity_relation_search_return_minimal_fields_with_summary(tmp_path):
executor.json_output = False
rendered = executor.execute('search-entity "Federal Reserve" /documents')
assert "path: /documents/market-note.pdf" in rendered
assert "summary: Risk and compliance summary" in rendered
assert "entity: Federal Reserve; Disney" in rendered
assert "file_ref=" not in rendered