mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-25 23:32:22 +01:00
fix(harness): ignore dotted email local parts in artifact inference
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user