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:
|
||||
is_focus = True
|
||||
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:
|
||||
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:
|
||||
if path.suffix == ".py" and not item.get("error"):
|
||||
try:
|
||||
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:
|
||||
sections.append(f"### `{display_name}`\n\n{summarize.summarise_file(path, content)}")
|
||||
sections.append(f"### `{original}`\n\n{summarize.summarise_file(path, content)}")
|
||||
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 = []
|
||||
if sections:
|
||||
parts.append("## Files (Tier 3 - Focused)\n\n" + "\n\n---\n\n".join(sections))
|
||||
|
||||
Reference in New Issue
Block a user