Skip to content

fix(synapse): truncate cyclic page embed chains without text duplication (#65)#75

Merged
MarcoPorcellato merged 2 commits into
mainfrom
fix/65-cyclic-page-embed
Jun 29, 2026
Merged

fix(synapse): truncate cyclic page embed chains without text duplication (#65)#75
MarcoPorcellato merged 2 commits into
mainfrom
fix/65-cyclic-page-embed

Conversation

@MarcoPorcellato

Copy link
Copy Markdown
Owner

Summary

  • Replace visited_pages add/discard with an immutable embed_page_chain propagated through _expand_macros_and_embeds_impl.
  • Seed the chain from the host page title in to_context_enriched_chunks so A→B→A cycles truncate at the re-entrant edge (before inner after instead of duplicated parent literals).
  • Add regression test test_expand_cyclic_page_embed_does_not_duplicate_parent_text.
  • Document embed-chain semantics in docs/ARCHITECTURE.md §3.2.1.

Closes #65

Test plan

  • make all (Ruff, Mypy, pytest)
  • Cyclic A↔B page embed reproduces expected expanded string

Made with Cursor

MarcoPorcellato and others added 2 commits June 29, 2026 19:18
Replace visited_pages discard with an immutable embed_page_chain seeded
from the host page in to_context_enriched_chunks.

Closes #65

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@MarcoPorcellato MarcoPorcellato merged commit 1d15656 into main Jun 29, 2026
5 checks passed
@MarcoPorcellato MarcoPorcellato deleted the fix/65-cyclic-page-embed branch June 29, 2026 17:21
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.

fix(synapse): cyclic page embed expansion duplicates parent literal text

1 participant