From 622c5037fad21a3bdbd4aac01f553d8f9b876cc2 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Mon, 24 Aug 2026 06:14:52 -0400 Subject: [PATCH] Make the triage baseline use the same fingerprint the scanner compares create_fingerprint() in triage.py hashes with SHA-256 while the scanner computes get_fingerprint() with SHA-1 in _rust_core/src/issues.rs, over the identical rule_id|file_path|line_number|code string. The TUI writes its SHA-256 digests into .pyspector_baseline.json and cli.py then compares them against SHA-1 values, so nothing ever matches and a baseline saved from the triage view suppresses nothing. Switch triage.py to SHA-1 so the two agree. No existing baseline written by the TUI can regress, since none of them were ever matched. Signed-off-by: Arpit Jain --- src/pyspector/triage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyspector/triage.py b/src/pyspector/triage.py index 18111bd4..3b94c475 100644 --- a/src/pyspector/triage.py +++ b/src/pyspector/triage.py @@ -13,7 +13,7 @@ def create_fingerprint(issue: Dict[str, Any]) -> str: # Use rule ID, file path relative to a potential project root, and the line content # This makes the fingerprint stable across different checkout directories unique_string = f"{issue.get('rule_id', '')}|{issue.get('file_path', '')}|{issue.get('line_number', '')}|{issue.get('code', '').strip()}" - return hashlib.sha256(unique_string.encode('utf-8')).hexdigest() + return hashlib.sha1(unique_string.encode('utf-8')).hexdigest() class PySpectorTriage(App): """An interactive TUI for triaging PySpector findings."""