feat(skill): add skill_runner to replace per-step manual orchestration#288
Conversation
closes #287) Introduces helpers/skill_runner.py (run-plan-round / run-pr-round subcommands) that encapsulate the full review-round pipeline — build-resume, plan validation, AGENT_LOOP_META attachment, GitHub posting, reviewer invocation, response validation/rendering, and session-state update — in a single CLI call. Supporting changes: - helpers/prompt_builders.py: new module wrapping build_plan_review_prompt and build_review_prompt for use without constructing AgentLoopConfig manually - helpers/state_manager.py: extend build-resume descriptor with completed_reviewer_data, completed_round_number, and current_plan_subject - helpers/run_external.py: add --flow {plan,pr} flag; pr dry-run stub uses AGENT_STATE / pr_review instead of plan-review markers - src/coding_review_agent_loop/unresolved_items.py: expose apply_item_dispositions as public wrapper for skill_runner ledger transition - SKILL.md: collapse 8-step manual orchestration into 3 steps backed by skill_runner - tests/test_skill_helpers.py: add TestSkillRunner with fake-gh isolation and TestRunExternal.test_dry_run_flow_pr_writes_pr_review_stub Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review verdict: Blocking Introduces Blocking issues
Same-PR follow-ups
-- Google Gemini |
|
Review verdict: Blocking The new skill_runner has resume/aggregation bugs that can duplicate posted plans and falsely report approval while same-round followups remain unresolved. Blocking issues
-- OpenAI Codex |
- Fix item ID collisions: use _max_item_number() to compute item_id_offset per reviewer from all seen items (prior + current-round), eliminating duplicate IDs when multiple reviewers run in the same round or items are resolved between rounds - Fix plan re-post on resume: gate plan posting on is_new_round (subject mismatch), not on local_completed being empty; resuming a round where no reviewer has completed no longer re-posts the plan - Fix same-round followups lost when state is blocking: if a reviewer blocks via same_plan_followups/same_pr_followups only (no explicit blocking_items), surface those as blocking_items for the caller; derive overall_state from any_reviewer_blocked rather than round_blocking_items length - Fix pending-comment duplicate detection: compare body_text directly against raw GitHub comment bodies (stripped) instead of via _extract_round_metadata_records - Fix comment fetch for multiline bodies: replace gh api --jq .[].body (splits on newlines) with gh issue view --json comments (parses JSON correctly); update fake gh in tests accordingly - Fix Gemini prose/duplicate-marker normalization: _normalize_raw_response now also strips leading prose before the JSON block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review verdict: Blocking The PR successfully implements Same-PR follow-ups
Prior unresolved item dispositions
-- Google Gemini |
|
Review verdict: Blocking The runner addresses the earlier ID-collision and pending-comment issues, but new-round result reconstruction still mixes prior-round reviewer records into the active round. Blocking issues
Same-PR follow-ups
Prior unresolved item dispositions
-- OpenAI Codex |
- Fix Step 5 new-round contamination: gate completed_reviewer_data reconstruction on `not is_new_round` in both plan and PR commands; previously previous-round blocking records polluted the new round's result, preventing approval even after all current-round reviewers approved - Fix _fetch_pr_diff silent failure: exit with error instead of returning empty string, preventing silent empty-diff review rounds - Rename plan_subject → round_subject in _run_reviewer to reflect dual use (plan sha256 or PR head SHA) - Add _normalize_disposition_values: fix natural-language variants like 'still blocking' → 'blocking' before validation to handle Gemini quirks - Add test_run_pr_round_dry_run_exits_zero to TestSkillRunner Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review verdict: Approved PR #288 successfully introduces Prior unresolved item dispositions
-- Google Gemini |
|
Review verdict: Approved Current head addresses the prior skill_runner orchestration issues and I found no remaining merge-blocking defects in the reviewed diff. Prior unresolved item dispositions
-- OpenAI Codex |
Summary
helpers/skill_runner.pywithrun-plan-roundandrun-pr-roundsubcommands that encapsulate the full review-round pipeline in a single CLI call (build-resume, plan validation, AGENT_LOOP_META attachment, GitHub posting, reviewer invocation, response validation/rendering, session-state update)helpers/prompt_builders.pywrappingbuild_plan_review_prompt/build_review_promptfor use without manualAgentLoopConfigconstructionstate_manager build-resumedescriptor withcompleted_reviewer_data,completed_round_number, andcurrent_plan_subjectfields needed by the ledger-transition algorithm--flow {plan,pr}torun_externalso PR dry-run stubs useAGENT_STATE/pr_reviewmarkersapply_item_dispositionsas a public wrapper inunresolved_items.pyfor the round-to-round ledger transitionTestSkillRunnertests with fake-gh isolation (no real GitHub calls)Closes #287.
Test plan
pytest tests/test_skill_helpers.py— 16 passedrun-plan-roundexits 0 and returns valid JSON resultghfor posting (fake gh fails loudly on comment calls)-- Anthropic Claude