Skip to content

[WIP] Inspired by https://github.com/robertbagge/claude-roadhouse-plugin Afte - #285

Closed
bamdadd wants to merge 1 commit into
mainfrom
lintel/fix/7aa85aed-inspired-by-https-github-com-robertbagge
Closed

[WIP] Inspired by https://github.com/robertbagge/claude-roadhouse-plugin Afte#285
bamdadd wants to merge 1 commit into
mainfrom
lintel/fix/7aa85aed-inspired-by-https-github-com-robertbagge

Conversation

@bamdadd

@bamdadd bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner

⚠️ This is a draft PR created by Lintel after a pipeline failure.
The automated workflow could not complete successfully. An engineer should review the changes, fix any issues, and mark the PR as ready.

Summary

Add a self-review quality loop (proud check + world-class check, max 3 iterations) between Phase 2 write-files and Phase 3 test/fix in the implement_structured workflow node, implemented as helper functions in _impl_structured_helpers.py and wired in _impl_structured.py, with full test coverage in a new test file and updated existing tests.

Changes

  • Add self-review constants, _extract_verdict, and _run_self_review_loop to helpers
  • Wire _run_self_review_loop into implement_structured node between Phase 2 and Phase 3
  • Create test_self_review_loop.py with unit and integration tests
  • Update existing test_impl_structured.py for new execute_step call counts

Context

Inspired by https://github.com/robertbagge/claude-roadhouse-plugin

After the agent completes code generation (Phase 2 — write files) and BEFORE running tests/lint/typecheck (Phase 3), add a self-review quality loop.

The Loop

The agent asks itself two questions in sequence. If either returns needs-work, it fixes the issues and re-asks both. Loop continues until both return roadhouse! (max 3 iterations).

Question 1 — Proud Check

Are you proud of the work you have done in this session? Anything you would like to change here and now?

Review the work carefully. Identify any issues, but do NOT edit any files.

Share your feedback, then output your verdict:

<verdict>needs-work</verdict> — you found issues. Describe what needs to be fixed.
<verdict>roadhouse!</verdict> — you found nothing to change. Describe what makes the work good.

Question 2 — World-Class Check

Would you call the work we have been doing on this branch exquisite? Is it world class? If not, what would need to change to make it so?

Review the work carefully. Identify any issues, but do NOT edit any files.

Share your feedback, then output your verdict:

<verdict>needs-work</verdict> — you found issues. Describe what needs to change to make it world class.
<verdict>roadhouse!</verdict> — the work is genuinely world class. Describe what makes it excellent.

Implementation Details

Where

  • File: packages/workflows/src/lintel/workflows/nodes/_impl_structured.py
  • Insert between Phase 2 (write files, line ~132) and Phase 3 (test/fix loop, line ~134)
  • Add constants: MAX_SELF_REVIEW_ITERATIONS = 3, PROUD_REVIEW_PROMPT, WORLD_CLASS_REVIEW_PROMPT

How

  1. Add _extract_verdict(response: str) -> str — parse <verdict>...</verdict> tag from LLM response
  2. Add _run_self_review_loop(...) async function that:
    • Collects a git diff of changes for review context
    • Calls agent_runtime.execute_step() with tools=[] for each review question (read-only)
    • If either verdict is needs-work, calls agent_runtime.execute_step() with sandbox_read_file + sandbox_write_file tools to fix
    • Re-reads diff and loops
    • Records token usage in total_usage
    • Logs progress via StageTracker.append_log()
  3. Call _run_self_review_loop() only when files_to_write is non-empty

Tests

  • packages/workflows/tests/test_self_review_loop.py
  • Test _extract_verdict with various inputs (roadhouse, needs-work, missing tag, case insensitive)
  • Test loop exits after 1 iteration when both pass
  • Test loop retries when proud check fails
  • Test loop retries when world-class check fails
  • Test loop exhausts after MAX_SELF_REVIEW_ITERATIONS
  • Test prompts are sent to LLM correctly
  • Test diff context is included in review messages

Raised by Lintel 🤖

@bamdadd
bamdadd force-pushed the lintel/fix/7aa85aed-inspired-by-https-github-com-robertbagge branch from 124cd47 to ad60961 Compare April 7, 2026 16:53
@bamdadd

bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner Author

Closing to re-implement from scratch

@bamdadd bamdadd closed this Apr 7, 2026
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.

1 participant