Answer the stability and product passes: print each records answer, name its question, drop a misquote to an interrupt, budget the whole prompt
This commit is contained in:
@@ -9,7 +9,7 @@ RECORDS_ANSWERS_PER_CYCLE = 3
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Working:
|
||||
"""The worker runs, resumed with the records' answer when there is one."""
|
||||
answer: str | None = None
|
||||
answered: AnsweredFromRecords | None = None
|
||||
records_answers: int = 0
|
||||
|
||||
|
||||
@@ -69,10 +69,10 @@ def transition(state: State, event: Event) -> State:
|
||||
match state, event:
|
||||
case Working(_, records_answers), WorkerRan(transcript_path):
|
||||
return Judging(transcript_path, records_answers)
|
||||
case Judging(_, records_answers), Ruled(AnsweredFromRecords(answer=answer)) if records_answers < RECORDS_ANSWERS_PER_CYCLE:
|
||||
return Working(answer, records_answers + 1)
|
||||
case Judging(_, records_answers), Ruled(AnsweredFromRecords() as answered) if records_answers < RECORDS_ANSWERS_PER_CYCLE:
|
||||
return Working(answered, records_answers + 1)
|
||||
case Judging(transcript_path, records_answers), Ruled(AnsweredFromRecords(question=question, answer=answer)):
|
||||
return Interrupting(transcript_path, f"{question}\n\nREADME.md or the project's records say:\n{answer}", records_answers)
|
||||
return Interrupting(transcript_path, f"{question}\n\nREADME.md or the project's records say:\n{answer}\n\nThe records answered {records_answers} questions this cycle, so this one comes to you.", records_answers)
|
||||
case Judging(transcript_path, records_answers), Ruled(Interrupt(question=question)):
|
||||
return Interrupting(transcript_path, question, records_answers)
|
||||
case Judging(transcript_path, _), Ruled(Finished() | Unfinished() as verdict):
|
||||
|
||||
Reference in New Issue
Block a user