From 21342bda3766dd28fe0be96441468dde45bc4aa1 Mon Sep 17 00:00:00 2001 From: ayushcodes10 Date: Mon, 14 Sep 2026 17:27:20 +0530 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh --- tests/test_cli_export.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_cli_export.py b/tests/test_cli_export.py index 7bbf38979..6b629c956 100644 --- a/tests/test_cli_export.py +++ b/tests/test_cli_export.py @@ -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