Skip to content

feat: add cross-file symbol references and memory compaction updates - #192

Merged
SummonShenron merged 1 commit into
mainfrom
sonic/working-changes-2026-11-24
Nov 24, 2026
Merged

SummonShenron merged 1 commit into
mainfrom
sonic/working-changes-2026-11-24

Conversation

@SummonShenron

Copy link
Copy Markdown
Owner

feat: add cross-file symbol references and memory compaction updates

Opened with Sonic Assistant.

Co-authored-by: Sonic Assistant <sonic-assistant@users.noreply.github.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
saapp Ready Ready Preview Nov 24, 2026 1:25pm UTC

@SummonShenron

Copy link
Copy Markdown
Owner Author

Sonic Assistant PR Overview

Summary

This PR introduces cross-file validation for code proposals and adds a local trace_symbol tool to improve multi-file editing accuracy. It also updates memory compaction logic to prevent the promotion of low-quality facts derived from summaries of summaries.

What changed

  • Cross-File Validation: Added backend/utils/cross_file.py to detect if a proposal breaks imports or function signatures in other files. Integrated this check into backend/services/agent_workflow.py to validate proposals before application.
  • Symbol Referencing: Added backend/utils/symbol_refs.py to perform case-sensitive, whole-word searches for definitions, imports, and usages within the connected folder. This replaces GitHub-indexed searches that cannot see uncommitted code.
  • Memory Compaction: Modified backend/services/memory_compaction.py to restrict fact promotion to Tier 1 turns, preventing the accumulation of unreliable facts from Tier 2 summaries. Added a reembed-missing command to backend/utils/memory_maintenance.py to fix facts lacking embeddings.
  • UI/UX: Updated backend/components/sonic_changelog.py to include the new multi-file change capabilities and added LOCAL_TRACE_SYMBOL_LINE to backend/services/agent_workflow.py to expose the local search tool in the menu.

Where to look

  • backend/utils/cross_file.py: Review the check logic to understand how it parses Python and JS/TS to identify breaking changes.
  • backend/utils/symbol_refs.py: Examine find_references and classify to see how the system distinguishes between definitions, imports, and usages.
  • backend/services/memory_compaction.py: Check promotes_facts to see how compaction tiers now filter fact extraction.

Risks and gaps

  • Performance: The cross-file check and local symbol search scan the entire folder; while MAX_SCANNED_FILES and MAX_SCANNED_BYTES are defined, large repositories may experience latency.
  • Heuristics: The cross_file and symbol_refs logic relies on AST parsing and regex; it explicitly ignores complex cases like star imports, __getattr__, and dynamic exports, which may lead to missed issues in highly dynamic codebases.

Not fully covered by this overview (diff cut short: backend/utils/cross_file.py, backend/utils/symbol_refs.py, backend/services/agent_workflow.py, backend/utils/self_counters.py, backend/tests/test_cross_file_and_trace.py; not read: backend/tests/test_memory_compaction.py, backend/tests/test_fact_cleanup.py, backend/tests/test_local_edits.py).

Updated for commit af8b56b

@SummonShenron
SummonShenron merged commit c67ea94 into main Nov 24, 2026
2 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — af8b56be Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants