Bug Description
SYNAPSE embed expansion treats unresolved targets inconsistently:
| Macro type |
Missing target behavior |
{{embed [[Page]]}} |
Replaced with empty string (macro swallowed) |
{{embed ((uuid))}} |
Left unchanged in output |
Downstream RAG sees silent content loss in one case and raw Logseq macros in the other.
Clean Architecture lens
| Aspect |
Assessment |
| Ring |
Interface Adapter (synapse.py) |
| SOLID |
Liskov / consistency — same conceptual operation (embed resolve) should share failure semantics |
| Uncle Bob |
Clean Code: symmetric error paths; pick one policy and document it |
Steps to Reproduce
# Missing page
"- {{embed [[NoSuchPage]]}}\n" → ''
# Missing block uuid
"- {{embed ((00000000-0000-0000-0000-000000000000))}}\n" → '{{embed ((...))}}'
Expected Behavior
Documented, symmetric policy, e.g.:
- Always strip macro and insert
"", or
- Always leave a visible sentinel like
[unresolved embed]
Suggested fix
- Align block + page branches in
_expand_macros_and_embeds_impl
- Add parametrized tests in
tests/test_synapse.py
- Note behavior in
docs/ARCHITECTURE.md SYNAPSE section
Context
Local code study wave 10 runtime probe.
Bug Description
SYNAPSE embed expansion treats unresolved targets inconsistently:
{{embed [[Page]]}}{{embed ((uuid))}}Downstream RAG sees silent content loss in one case and raw Logseq macros in the other.
Clean Architecture lens
synapse.py)Steps to Reproduce
Expected Behavior
Documented, symmetric policy, e.g.:
"", or[unresolved embed]Suggested fix
_expand_macros_and_embeds_impltests/test_synapse.pydocs/ARCHITECTURE.mdSYNAPSE sectionContext
Local code study wave 10 runtime probe.