STEP-07-B — TicketResult Dataclass
Part of: STEP-07 spec
Depends on: #2 (STEP-07-A)
What to build
Add TicketResult to src/operator_v7.py:
@dataclass
class TicketResult:
outcome: str # "pass" | "fail" | "error"
elapsed_s: float = 0.0
tokens: int = 0
tool_calls: int = 0
artifact_paths: List[str] = field(default_factory=list)
reason: str = ""
anchor: Dict[str, Any] = field(default_factory=dict)
Migrate ticket.result from Dict[str, Any] to Optional[TicketResult] in the Ticket dataclass. Update:
to_dict() / from_dict() in operator_v7.py
ticket_io.py YAML round-trip
- All write paths in
agent/runner.py that assign to ticket.result
Invariant preserved
ticket.result defaults to None for backward compat with existing YAML files. Full round-trip lossless.
Gate
pytest tests/ -v still green after migration.
Files
src/operator_v7.py
src/ticket_io.py
agent/runner.py
STEP-07-B — TicketResult Dataclass
Part of: STEP-07 spec
Depends on: #2 (STEP-07-A)
What to build
Add
TicketResulttosrc/operator_v7.py:Migrate
ticket.resultfromDict[str, Any]toOptional[TicketResult]in theTicketdataclass. Update:to_dict()/from_dict()inoperator_v7.pyticket_io.pyYAML round-tripagent/runner.pythat assign toticket.resultInvariant preserved
ticket.resultdefaults toNonefor backward compat with existing YAML files. Full round-trip lossless.Gate
pytest tests/ -vstill green after migration.Files
src/operator_v7.pysrc/ticket_io.pyagent/runner.py