Add negative control test for a sidecar that still matches

Guards against a false positive: an up to date sidecar (the normal
case immediately after extract or the clustering command) must not
trip the new staleness warning or take the reconstruction path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh
(cherry picked from commit 21342bda37)
This commit is contained in:
ayushcodes10 authored and safishamsi committed 2026-09-17 11:01:38 +01:00
1 parent bafe75b86b
commit 11d91c8e17
1 file changed
+11
+11
View File
@@ -702,6 +702,17 @@ def test_export_wiki_recomputes_cohesion_when_sidecar_is_stale(tmp_path):
assert "999999" not in combined, "stale cohesion value leaked into the wiki export"
def test_export_html_uses_sidecar_when_it_still_matches(tmp_path):
"""Negative control: an up to date sidecar must not trigger the stale
path or its warning."""
out = _make_graph(tmp_path)
r = _run(["export", "html"], tmp_path)
assert r.returncode == 0, r.stderr
assert "is stale" not in r.stderr
assert (out / "graph.html").exists()
def test_graph_json_node_ids_are_portable_across_checkout_paths(tmp_path):
"""#1789: the committed graph.json's node ids must be relative to the scan
root — not embed the absolute path — so the same repo yields identical ids