Answer stability round 1: 0 🔴, 4 🟡 (0 misread); a cycle's close takes the task from the cycle, a resolved thread is skipped unread, and tests run git in their own environment
CI / tests (pull_request) Successful in 3m56s
CI / tests (pull_request) Successful in 3m56s
This commit is contained in:
@@ -21,8 +21,6 @@ class Run(typing.Protocol):
|
||||
# Every run is a dataclass, which is what lets closing a cycle replace its fields.
|
||||
__dataclass_fields__: typing.ClassVar[dict[str, typing.Any]]
|
||||
|
||||
@property
|
||||
def task(self) -> str: ...
|
||||
@property
|
||||
def unfinished_evidence(self) -> str: ...
|
||||
@property
|
||||
@@ -35,7 +33,6 @@ class Run(typing.Protocol):
|
||||
class ChunkRun:
|
||||
"""The run of one chunk, for an entry point that never hands it to another process, such as do-epic."""
|
||||
cycle_number: int = 0
|
||||
task: str = ""
|
||||
# The evidence of the latest unfinished verdict; empty before the chunk's first one, and once it finishes.
|
||||
unfinished_evidence: str = ""
|
||||
# Set by each unfinished verdict; None before the chunk's first one, and once it finishes.
|
||||
@@ -44,19 +41,19 @@ class ChunkRun:
|
||||
unfinished_run: int = 0
|
||||
|
||||
|
||||
def closed_cycle[R: Run](run: R, project: ProjectRung | None, concluded: Concluded, archive_folder: pathlib.Path, driver: str, loop: Loop) -> R | Stop:
|
||||
"""The run after a cycle of driver, the entry point, concluded, with the step-up archived; the stop that needs the human, archived, once the chunk has had UNFINISHED_LIMIT unfinished verdicts running."""
|
||||
def closed_cycle[R: Run](run: R, task: str, project: ProjectRung | None, concluded: Concluded, archive_folder: pathlib.Path, driver: str, loop: Loop) -> R | Stop:
|
||||
"""The run after a cycle of driver, the entry point, concluded on the chunk's task, with the step-up archived; the stop that needs the human, archived, once the chunk has had UNFINISHED_LIMIT unfinished verdicts running."""
|
||||
after = after_verdict(run, project, concluded)
|
||||
# A finished chunk drops its route, so it has no step-up, and its run of unfinished verdicts restarts.
|
||||
if after.route is None:
|
||||
return after
|
||||
# The unfinished verdict, archived as the cycle closed, names the route its cycle ended on; the step-up names the one the next cycle runs on.
|
||||
path = transcript_file(loop.session)
|
||||
if path and (failure := archived_step(archive_folder, path, after.task, step_up(concluded.route, after.route), loop.effects)):
|
||||
if path and (failure := archived_step(archive_folder, path, task, step_up(concluded.route, after.route), loop.effects)):
|
||||
return Stop(1, failure.reason)
|
||||
if limit := reached_limit(after, driver):
|
||||
# Archived with the route the next cycle would run on, so a rerun resumes there.
|
||||
return archived_stop(archive_folder, loop.session, after.task, after.route, limit, limit.reason, loop.effects)
|
||||
return archived_stop(archive_folder, loop.session, task, after.route, limit, limit.reason, loop.effects)
|
||||
return after
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user