File size: 1,328 Bytes
a617acd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Any, Dict, List, Literal, Optional

from pydantic import BaseModel, Field


TaskId = Literal["easy", "medium", "hard"]
ActionType = Literal["submit_finding", "flag_human_review", "noop"]


class AuditFinding(BaseModel):
    document_id: str = Field(description="ID of the document containing potential violation")
    violation_type: str = Field(description="Violation category")
    evidence: List[str] = Field(default_factory=list, description="Supporting document IDs")
    confidence: float = Field(ge=0.0, le=1.0)


class AuditAction(BaseModel):
    action_type: ActionType
    task_id: TaskId
    finding: Optional[AuditFinding] = None
    note: str = ""


class AuditObservation(BaseModel):
    session_id: str
    task_id: TaskId
    documents: List[Dict[str, Any]]
    findings_submitted: int
    steps_remaining: int
    current_partial_score: float


class AuditReward(BaseModel):
    value: float
    normalized: float = Field(ge=0.0, le=1.0)
    reason: str


class StepResult(BaseModel):
    observation: AuditObservation
    reward: AuditReward
    done: bool
    info: Dict[str, Any] = Field(default_factory=dict)


class EnvState(BaseModel):
    session_id: str
    task_id: TaskId
    steps_remaining: int
    findings_submitted: int
    partial_score: float
    found_truth_keys: List[str]