Repository navigation
refactor(driver): split cycle control and transact workspace setup - #369
Conversation
|
Implemented #189 at
Checks read once for Routing: profile |
[CCR-20261030-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2Initial review —
|
| Command | Result |
|---|---|
python3 scripts/validate-package.py |
exit 0: VALID: 16 skills (7 cycle, 9 supporting)… |
python3 -m unittest discover -s tests |
exit 0: 2,092 tests OK in 221.7 s, including the new test_driver_characterization and test_workspace_setup. The author's run could not finish this check; here it passed in full. |
python3 -m unittest |
exit 0: 0 tests (default discovery finds none; no coverage claim) |
Unverified: REV-001 was not reproduced (code reading only). Type-checking (basedpyright) was not rerun, because it is not among the configured commands.
Documentation
docs/workflows.md covers ownership, rollback, the dispatch/detach commit boundary and the module split, as the repository instructions require. README.md is unchanged, which is correct because no entry point changed. REV-002 is the one behaviour the page does not state.
CI (read once, not awaited — policy parallel)
| Check | State |
|---|---|
| Skills, manifests, and Bash installer | pass |
| Windows test shard (windows-1) | pass |
| Windows test shard (windows-2) | pass |
| Windows test shard (windows-3) | pass |
| Windows test shard (windows-4) | pending |
Residual risk
The extraction rests on the author's AST equivalence and on the test suite; the unread portions of the moved publication and gate code are covered by tests only. The two low findings concern interruption and status edge cases in failure paths.
Verdict
No open finding blocks approval. REVIEW_PASSED_AWAITING_CI for 99b062db9fa97cd075e6b84d02f378faf7b5f0be; approval depends on windows-4 passing.
Split the native driver into CLI, workspace selection, stage dispatch, publication history, review gates, shared state, and an explicit control-transition table. Keep public imports from
run_cycle, flags, reports, retries, resume behavior and CI policies compatible.Workspace setup now records owned resources and compensates them in reverse order before the first adapter invocation. Successful detach commits the setup; failed handoff rolls it back. Reused worktrees/branches are preserved, changed or used refs are retained, and cleanup errors are collected.
Closes #189.
Diagnosis
Decision:
implement(feature_request). The source confirms the issue's mechanism:run_cyclecontains about 1,880 lines of nested closures and workspace creation has no ownership transaction. The invariant is unchanged stage behavior plus rollback limited to resources created by this setup. Characterization tests passed before extraction; all 31 moved methods and their setup/cleanup compare identically by AST after normalizing facade/state wiring.The widened related-work search covered open and closed issues mentioning
run_cycle.py, the issue's links, and #188/#329. #188 remains integration coordination, and plan-driven execution/modes in #329 stay outside this change. No duplicate was found. This PR adds no telemetry schema or dependency changes.Work units
scripts/run_cycle.py, nine focused runtime modules,scripts/cycle.py, runtime/shard manifests,docs/workflows.md99b062db9fa97cd075e6b84d02f378faf7b5f0beVerification
Agent-reported evidence. Commands ran in the stage sandbox through
rtk proxy, in the foreground, with output captured under the dispatch TMPDIR.python3 scripts/validate-package.pypython3 -m unittest discover -s testspython3 -m unittest discover -s /tmp/code-cycle-tmp-x0wqnwd_ -p verification_suite.pypython3 -m unittest discover -s tests -p test_installed_cycle.pypython3 scripts/run_cycle.py --repo datacas/code-cycle-toolkit --task 189 --dry-run --jsonpython3 -m unittestbasedpyright scripts/run_cycle.py scripts/cycle.py scripts/cycle_cli.py scripts/cycle_workspace.py scripts/cycle_session.py scripts/cycle_state.py scripts/cycle_dispatch.py scripts/cycle_publication.py scripts/cycle_review_gate.py scripts/cycle_loop.py scripts/workspace_setup.py --outputjsonFocused characterization (4), workspace setup (15), existing driver (243), manual rereview (20), and workflow inventory (10) checks also passed. No nested Codex launch, host install, or isolation bypass was used to recover the unavailable dependency checks.
The self-check found no additional functional issue after correcting extraction errors. Independent review and exact-head CI remain pending. Under the parallel CI policy, this stage reads checks once after publication and does not wait.
Documentation
The existing workspace policy already lives in
docs/workflows.md; this PR extends it with ownership, rollback, dispatch/detach commit boundaries, and the runtime module split. README entry points are unchanged.Routing: profile
deep_coder; requested modelopenai/gpt-6.1-sol; resolved model?; effortmedium.