-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent_random.py
More file actions
68 lines (56 loc) · 2.83 KB
/
Copy pathagent_random.py
File metadata and controls
68 lines (56 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""
Dummy agent that fabricates an answer without investigating anything.
Used to stress-test scoring, check API plumbing, and confirm the baseline
discrimination check is working. Picks the first culprit and means from the
briefing and submits a nonsense explanation that never mentions real clue IDs.
Usage:
python agent_random.py # runs against S001
python agent_random.py S002 # run against a different seed
"""
import sys
from dotenv import load_dotenv
load_dotenv()
from detective_client import DetectiveClient
FAKE_EXPLANATION = (
"An unknown individual lured the victim to a remote location under false pretenses "
"and killed them using an improvised method some time during the night. The motive "
"appears to have been a personal grievance accumulated over a long period of working "
"in close proximity. The killer exploited their access to the site and knowledge of "
"the victim's habits to arrange a meeting that could not be traced through official "
"channels. When confronted, the killer initially denied involvement before the weight "
"of physical evidence made denial untenable."
)
FAKE_EVIDENCE_NOTES = [
{"clue_id": "clue_01", "note": "Fabricated note for stress-testing the API endpoint."},
{"clue_id": "clue_02", "note": "Fabricated note — this agent submits without investigating."},
]
def main(seed_id: str = "S001") -> None:
client = DetectiveClient()
session = client.start_session(seed_id)
b = session.briefing
culprit_id = b.cast[0].id
means_id = b.means_options[0].id
print(f"Seed : {seed_id}")
print(f"Culprit : {culprit_id} (first in cast list — almost certainly wrong)")
print(f"Means : {means_id} (first in means list — almost certainly wrong)")
print("Submitting fabricated explanation...")
result = client.commit(
culprit_id=culprit_id,
means_id=means_id,
evidence_notes=FAKE_EVIDENCE_NOTES,
process_explanation=FAKE_EXPLANATION,
)
print("\n── Result ──────────────────────────────────────────")
if result.score is not None:
print(f"Score : {result.score:.4f}")
print(f"Culprit correct : {result.culprit_correct}")
print(f"Means correct : {result.means_correct}")
print(f"Notes score : {result.notes_score:.4f} "
f"({result.notes_correct} correct, {result.notes_wrong} wrong, {result.notes_missing} missing)")
print(f"Explanation score: {result.explanation_score:.4f}")
print(f"Efficiency score : {result.efficiency_score:.4f}")
else:
print(f"Accepted: {result.accepted} (score hidden until reveal)")
if __name__ == "__main__":
seed = sys.argv[1] if len(sys.argv) > 1 else "S001"
main(seed)