Skip to content

Integrate Deepwork Reviews mechanism into Jobs self-review#254

Open
nhorton wants to merge 1 commit intomainfrom
claude/remove-runner-arg-oc2v7
Open

Integrate Deepwork Reviews mechanism into Jobs self-review#254
nhorton wants to merge 1 commit intomainfrom
claude/remove-runner-arg-oc2v7

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Mar 8, 2026

Summary

This PR refactors the Jobs self-review system to use the Deepwork Reviews mechanism (deepwork.review) instead of building review instructions directly. This enables reuse of the Reviews pipeline's instruction file generation and formatting code, reducing duplication and improving consistency across the platform.

Key Changes

  • New adapter functions in quality_gate.py:

    • adapt_reviews_to_review_tasks(): Converts Jobs review dicts into ReviewTask objects that the Reviews pipeline can consume
    • _build_review_instructions_text(): Translates Jobs structured quality criteria into free-text markdown instructions
    • _flatten_output_paths(): Helper to flatten output paths for review tasks
  • Refactored finished_step() in tools.py:

    • Replaced direct instruction file building with calls to write_instruction_files() and format_for_claude() from the Reviews module
    • Removed aiofiles import (no longer needed; Reviews module handles file I/O)
    • Simplified feedback generation to use Reviews-formatted output
    • Added logic to handle cached review results (when all reviews already passed)
    • Removed --external-runner flag from Claude MCP server config (self-review is now the default)
  • Updated tests in test_tools.py:

    • Updated assertions to expect .deepwork/tmp/review_instructions/ directory structure (from Reviews module)
    • Updated file naming expectations to use Reviews deterministic naming scheme
    • Updated feedback content checks to expect subagent_type (from format_for_claude())
    • Clarified test docstrings to reflect Reviews mechanism usage

Implementation Details

The adapter bridges the gap between Jobs' review format (with run_each, quality_criteria, additional_review_guidance) and the Reviews pipeline's ReviewTask dataclass. This allows Jobs to leverage the Reviews module's:

  • Instruction file generation and caching
  • Deterministic file naming with hash-based deduplication
  • Claude-formatted output with subagent invocation details

The refactoring maintains backward compatibility with existing Jobs review configurations while enabling future improvements to the Reviews mechanism to automatically benefit Jobs self-review.

https://claude.ai/code/session_013pcsdysk56DbD3mnXj8qC8

…r self-review

Remove the --external-runner claude arg from the MCP config so Jobs
always uses self-review mode. Refactor the self-review code path in
finished_step to use the Deepwork Reviews mechanism (ReviewTask +
write_instruction_files + format_for_claude) instead of the previous
custom instruction-file generation. Add adapter function
adapt_reviews_to_review_tasks in quality_gate.py that bridges Jobs
review data into ReviewTask objects without modifying the Reviews code.

https://claude.ai/code/session_013pcsdysk56DbD3mnXj8qC8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants