Repository navigation
run_cycle: resume an existing change request (--from review|resolve|rereview --pr N) - #95
Conversation
run_cycle.py always started at implement, so continuing a cycle that stopped midway meant implementing an issue whose PR already existed. --from review|resolve|rereview --pr N now skips the earlier stages and runs the rest with the same routing, recording and iteration limit. A resume without --pr, --pr without a resume, and --local-only with a resume are refused before any dispatch; the CLI then reads the pull request with gh and stops unless it is open, its head branch exists and --cwd has that branch checked out. A resumed run is a new cycle whose rows carry started_from (telemetry schema 5). first_pass_approved is only written for cycles that started at implement, and both first-pass readers (Telemetry.first_pass_rate and cc-stats) ignore rows from resumed cycles. Closes #75
[CCR-20260925-001] · ? · ?/?→? · ? · schema:1Review summaryReviewed PR #95, “run_cycle: resume an existing change request (--from review|resolve|rereview --pr N),” against The resume flow, stage selection, telemetry tagging, first-pass accounting, documentation, and tests were reviewed. The review found one blocking correctness issue. Findings[REV-001] · medium · open · - · blocks:yes — Resume accepts a stale checkout of the PR branchPath:
Security triage
Verification
CI
Residual riskUntil the local checkout is checked against the PR head SHA, a resumed run can operate on stale code even when its branch name matches. No live executor cycle was run as part of this review. VerdictCHANGES_REQUESTED — |
[CCT-20260925-001] · ? · ?/?→? · ? · triaged:3ec28a749467dcfed16bf1a5158036c24979e237 · schema:1Triage recorded before any code change. Every finding was judged against [REV-001] · medium · open · valid · blocks:yes — Resume accepts a stale checkout of the PR branch
|
… head check_change_request compared only the branch name, so a worktree on the PR's branch but behind or ahead of it passed and a resumed review or resolution would work on code that isn't the pull request. It now reads headRefOid and requires the checked-out HEAD commit to equal it. Resolves REV-001 on #95.
[CCR-20260925-001] · ? · ?/?→? · ? · schema:1[CCT-20260925-001] · ? · ?/?→? · ? · triaged:3ec28a749467dcfed16bf1a5158036c24979e237 · schema:1Resolution summaryFunctional status: Applied fixes[REV-001] · medium · resolved · valid · blocks:yes — Resume accepts a stale checkout of the PR branchPath: The guard now also requests Verification:
Post-change workflow
Residual riskNo live resumed cycle has been dispatched against real executors. The guard was exercised against the live PR, and the stage loop was exercised with scripted executors. |
[CCR-20260925-001] · ? · ?/?→? · ? · schema:1[CCR-20260925-002] · ? · ?/?→? · ? · schema:1Re-review summaryRe-reviewed PR #95 against Since the prior review, commit Previous findings[REV-001] · medium · resolved · - · blocks:yes — Resume accepts a stale checkout of the PR branchPrevious location: The prior finding is corrected and verified by execution. The resume guard now requests Security triage
Verification
CI
Residual riskThe stale-checkout guard is covered by its regression test and the full suite. Live execution with real cycle executors was not performed. VerdictAPPROVED — the only prior blocking finding, |
Closes #75 — #75
What changes
run_cycle.py --from implement|review|resolve|rereview(defaultimplement, today's behaviour) and--pr N.review: fresh initial review, then the resolve → rereview loop.resolve: enters the loop at resolution; the stage recovers the earlier findings from the PR's comments throughreview.trusted_authors.rereview: rereview first, then the loop.--max-iterations.--fromother thanimplementwithout--pr,--prwith--from implement,--local-onlywith a resume, and an unsafe--prreference.ghand stops with a named reason unless it is open, its head branch exists (gh api repos/<head>/branches/<branch>), and--cwdhas that branch checked out. A configuredcode_hostother than GitHub is refused, since onlyghis used.cycle_id). Every row now carriesstarted_from(telemetry schema 5).first_pass_approvedis only written on cycles that started atimplement.Telemetry.first_pass_rate(measured routing) andcc-stats'_first_passignore rows whosestarted_fromisn'timplement. Rows without the field read asimplement.docs/workflows.md(runtime driver),docs/configuration.md(flags),docs/telemetry.md/docs/instrumentation.md(field),CHANGELOG.md.Verification
python3 -m unittest discover -s tests→ 698 tests, OKpython3 scripts/validate-package.py→ VALIDstarted_from=implement.--from resolveruns resolve → rereview with scripted executors and stops at--max-iterations.--from reviewand--from rerevieware covered. A resume without--pris refused before dispatch, in-process and through the CLI with no DB created. The PR check covers closed, missing-branch and wrong-branch cases.first_pass_rateandcc-statsignore resumed cycles.--from resolvewithout--pr→--from resolve requires --pr.--from resolve --pr 94(merged) →pull request 94 is MERGED, not open, and no DB is created.Residual risk