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
This commit is contained in:
ayushcodes10andClaude Sonnet 5 committed 2026-09-16 14:00:18 +05:30
1 parent 12c50b975a
commit 21342bda37
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