Skip to content

run_cycle: resume an existing change request (--from review|resolve|rereview --pr N) #75

Closed

Description

@datacas

Problem

run_cycle.py always starts at implement. When a cycle stops midway, for example after a review because the resolver hit an environment problem, the only way to continue with routing and telemetry is to rerun the whole cycle. That re-implements an issue whose PR already exists. On PR #74 (issue #72) the resolver blocked on an unwritable workspace after a 27-minute implementation and a 9-minute review, and continuing needed an ad-hoc script built from run_cycle internals.

Expected

run_cycle.py can resume an existing change request:

python3 ~/.code-cycle/runtime/run_cycle.py --task 72 --pr 74 --from resolve   # resolve -> rereview loop
python3 ~/.code-cycle/runtime/run_cycle.py --task 72 --pr 74 --from review    # fresh initial review, then loop
python3 ~/.code-cycle/runtime/run_cycle.py --task 72 --pr 74 --from rereview  # rereview first, then loop
  • --from implement is the default and keeps today's behaviour.
  • --from review|resolve|rereview requires --pr and skips the stages before it. resolve and rereview assume the PR's comments carry the previous review, and the stage recovers the findings through review.trusted_authors.
  • A resumed run is a new cycle (new cycle_id). It records how it started, for example a payload token started_from: resolve, so cc-stats doesn't count a resumed cycle as a first pass. First-pass rate must only count cycles that started at implement.
  • The PR's state is checked before dispatching: it is open, the branch exists, and the local --cwd is on that branch. Otherwise the run stops with a clear reason.

Acceptance

  • Default behaviour is unchanged, with a test for it.
  • --from resolve --pr N runs resolve → rereview with the same routing, recording, and iteration limit as a full cycle, with a test using scripted executors.
  • first_pass_rate ignores cycles with started_from other than implement, with a test for it.
  • --from without --pr (other than implement) is refused before any dispatch.
  • Documented in docs/workflows.md (runtime driver) and docs/configuration.md (flags).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions