refactor(aggregate): use standard formatting in build_tier3_context
This commit is contained in:
+5
-5
@@ -309,19 +309,19 @@ def build_tier3_context(file_items: list[dict[str, Any]], screenshot_base_dir: P
|
|||||||
if focus in path_str:
|
if focus in path_str:
|
||||||
is_focus = True
|
is_focus = True
|
||||||
break
|
break
|
||||||
display_name = entry or path_str
|
original = entry if entry and "*" not in entry else (str(path) if path else (entry or "unknown"))
|
||||||
if is_focus or tier == 3 or force_full:
|
if is_focus or tier == 3 or force_full:
|
||||||
suffix = path.suffix.lstrip(".") if path and path.suffix else "text"
|
suffix = path.suffix.lstrip(".") if path and path.suffix else "text"
|
||||||
sections.append(f"### `{display_name}`\n\n```{suffix}\n{content}\n```")
|
sections.append(f"### `{original}`\n\n```{suffix}\n{content}\n```")
|
||||||
elif path:
|
elif path:
|
||||||
if path.suffix == ".py" and not item.get("error"):
|
if path.suffix == ".py" and not item.get("error"):
|
||||||
try:
|
try:
|
||||||
skeleton = parser.get_skeleton(content)
|
skeleton = parser.get_skeleton(content)
|
||||||
sections.append(f"### `{display_name}` (AST Skeleton)\n\n```python\n{skeleton}\n```")
|
sections.append(f"### `{original}` (AST Skeleton)\n\n```python\n{skeleton}\n```")
|
||||||
except Exception:
|
except Exception:
|
||||||
sections.append(f"### `{display_name}`\n\n{summarize.summarise_file(path, content)}")
|
sections.append(f"### `{original}`\n\n{summarize.summarise_file(path, content)}")
|
||||||
else:
|
else:
|
||||||
sections.append(f"### `{display_name}`\n\n{summarize.summarise_file(path, content)}")
|
sections.append(f"### `{original}`\n\n{summarize.summarise_file(path, content)}")
|
||||||
parts = []
|
parts = []
|
||||||
if sections:
|
if sections:
|
||||||
parts.append("## Files (Tier 3 - Focused)\n\n" + "\n\n---\n\n".join(sections))
|
parts.append("## Files (Tier 3 - Focused)\n\n" + "\n\n---\n\n".join(sections))
|
||||||
|
|||||||
Reference in New Issue
Block a user