Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

test(render): assert comparison directive precedes the first cluster heading (#726)

nnhhoang779c486d673c
diff --git a/tests/test_render_v3.py b/tests/test_render_v3.py
index 2132b1b4..0603658c 100644
--- a/tests/test_render_v3.py
+++ b/tests/test_render_v3.py
@@ -531,6 +531,13 @@ class SynthesisDirectiveSurvivesTruncationTests(unittest.TestCase):
report = sample_report()
text = render.render_comparison_multi([("Topic A", report), ("Topic B", report)])
self.assertIn("SYNTHESIS CONTRACT", text)
+ # Survive head-truncation: the directive must precede the FIRST entity
+ # evidence cluster heading (H3 in the comparison path), not merely the
+ # envelope close tag — that is the real point a `| head -N` capture cuts.
+ self.assertLess(
+ text.index("SYNTHESIS CONTRACT"),
+ text.index("### Ranked Evidence Clusters"),
+ )
self.assertLess(
text.index("SYNTHESIS CONTRACT"),
text.index("<!-- END EVIDENCE FOR SYNTHESIS -->"),