From 2b23a5acf0f6c8e840764791488bcd0d42153b3b Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sun, 29 Nov 2026 14:21:58 +0530 Subject: [PATCH] Extraction refusal checks include changed-file data File paths and timestamps come from the caller and can enter the extraction queue. Classify both values as transcript content so intake and erasure use the same refusal checks. Signed-off-by: Lareb Zafar --- server/memory/domain/refusals.py | 5 +++++ tests/unit/test_memory_refusals.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/server/memory/domain/refusals.py b/server/memory/domain/refusals.py index df6ffe59c17..cc170bf21cd 100644 --- a/server/memory/domain/refusals.py +++ b/server/memory/domain/refusals.py @@ -85,6 +85,7 @@ def matches(value: Any, patterns: Iterable[Fingerprint]) -> bool: "messages", "last_messages", "session_values", + "changed_files", "extra_tags", "recalled_keys", "extraction_instructions", @@ -148,6 +149,10 @@ def transcript_content(payload: Mapping[str, Any]) -> list[Any]: result.append(role) for field in ("session_values", "extra_tags", "recalled_keys"): result.extend(payload.get(field) or []) + for changed_file in payload.get("changed_files") or []: + result.extend( + changed_file[field] for field in ("path", "modified_at") if changed_file.get(field) + ) for field in ("extraction_instructions", "observation_date", "memory_key"): if payload.get(field): result.append(payload[field]) diff --git a/tests/unit/test_memory_refusals.py b/tests/unit/test_memory_refusals.py index df201ec8649..6856af5804d 100644 --- a/tests/unit/test_memory_refusals.py +++ b/tests/unit/test_memory_refusals.py @@ -290,6 +290,14 @@ def test_every_extraction_field_has_an_explicit_content_classification(): [ ("extraction_instructions", "retired copper lark"), ("session_values", ["retired copper lark"]), + ( + "changed_files", + [{"path": "retired copper lark", "modified_at": "2025-01-01T12:00:00Z"}], + ), + ( + "changed_files", + [{"path": "source/module.py", "modified_at": "retired copper lark"}], + ), ("extra_tags", ["retired copper lark"]), ("recalled_keys", ["retired copper lark"]), ("record_schema", {"choice": ["retired copper lark"]}),