From 30430acfeaf81e5c4857aaacef5c1e6abb0d8765 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Sun, 25 Oct 2026 17:04:43 +0000 Subject: [PATCH] fix(harness): ignore dotted email local parts in artifact inference --- src/agent_evidence.py | 6 ++++-- tests/test_agent_evidence.py | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/agent_evidence.py b/src/agent_evidence.py index d8adcbf9d..d961485e1 100644 --- a/src/agent_evidence.py +++ b/src/agent_evidence.py @@ -255,11 +255,13 @@ def _artifact_match_is_callable(instruction: str, match: re.Match[str], path: st def _artifact_match_is_email_host(instruction: str, match: re.Match[str]) -> bool: - """Reject the domain portion of an email address as an output path.""" + """Reject either dotted portion of an email address as an output path.""" start = match.start("path") prefix = instruction[max(0, start - 80):start] - return bool(re.search(r"[A-Za-z0-9_.+-]+@$", prefix)) + return instruction[match.end("path"):].startswith("@") or bool( + re.search(r"[A-Za-z0-9_.+-]+@$", prefix) + ) def _workspace_path_identity(value: str) -> str: diff --git a/tests/test_agent_evidence.py b/tests/test_agent_evidence.py index cdc34b678..d3edf62a4 100644 --- a/tests/test_agent_evidence.py +++ b/tests/test_agent_evidence.py @@ -21,6 +21,13 @@ def test_infers_only_explicit_output_or_edit_paths(): assert requirements.verifier_required is True +def test_email_address_is_not_an_output_artifact(): + requirements = infer_completion_requirements( + "Write a summary and email it to jane.doe@example.com." + ) + assert requirements.required_artifacts == () + + def test_known_workspace_inputs_are_not_inferred_as_output_artifacts(): requirements = infer_completion_requirements( "My clues are saved in /tmp_workspace/inputs/clues.md, the required answer "