From bf8d4caebf93be1e84deec0c33ca203da8ee6418 Mon Sep 17 00:00:00 2001 From: Sarah Lacard Date: Fri, 1 May 2026 13:32:32 -0600 Subject: [PATCH 1/2] fix(detector): add hash cache replay detection --- kernelguard.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernelguard.py b/kernelguard.py index f086847..86c4bfb 100644 --- a/kernelguard.py +++ b/kernelguard.py @@ -3025,6 +3025,12 @@ def detect_precision_downgrade(code: str | SubmissionFacts) -> list[dict]: return matches +RE_WEAKREF = re.compile(r'weakref\.(?:ref|WeakValueDictionary|WeakKeyDictionary|WeakSet|finalize)\s*\(') +def detect_weakref_state(code: str | SubmissionFacts) -> list[dict]: + facts = ensure_submission_facts(code) + if not RE_WEAKREF.search(facts.raw_code): return [] + return [{"pattern": "WORKSPACE_CACHE", "severity": "low", "evidence": "weakref.ref/WeakValueDictionary/WeakKeyDictionary — garbage-collectible state container evades replay detection"}] + # --------------------------------------------------------------------------- # Score anomaly detection # --------------------------------------------------------------------------- From 695ea5772a0c815e2ef6662df9499e2d15b044c3 Mon Sep 17 00:00:00 2001 From: Sarah Lacard Date: Fri, 1 May 2026 22:20:14 -0600 Subject: [PATCH 2/2] chore: trigger blue-pr-sync re-evaluation