mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[refactor] reduce xenon C-rank blocks to A (behavior-preserving)
Extract helpers / flatten conditionals in 11 blocks that rated C(11)+ under xenon --max-absolute B, dropping pr_gate.py module rank B->A in the process. Pure move-and-call refactors: each extracted helper holds the original logic verbatim and the caller delegates to it; no control flow, return values, or side effects changed. Sites: validators._extract_strs, sequencing.dev_task_collision_edges, evidence_builder.build_task_handoff, intake_driver._coerce_draft, task.claim_task_for_agent (2 guards), prompter.create_task_from_draft (validate+assignee), pr_gate._gate_decision (3 helpers), orchestrator._handle_stopped_container + _reap_with_service, _impl._create_subtask_from_inputs + complete. _impl helper returns tuple[TaskNature, list[str]] to preserve mypy narrowing of acceptance_criteria at the TaskCreateRequest site. Also fix vulture: rename unused __aexit__ param tb->_tb in test_conventions_cache_put.py (was hidden while xenon short-circuited the gate).
This commit is contained in:
@@ -41,7 +41,7 @@ class _FakeNested:
|
||||
async def __aenter__(self) -> None:
|
||||
self._session.savepoint_started += 1
|
||||
|
||||
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> None:
|
||||
async def __aexit__(self, exc_type: Any, exc: Any, _tb: Any) -> None:
|
||||
if self._session._duplicate:
|
||||
self._session.savepoint_rolled_back = True
|
||||
raise IntegrityError(
|
||||
|
||||
Reference in New Issue
Block a user