fix(opencode): support GREEN diagnostic loop #258

Merged
jwilger merged 2 commits from fix/rgr-green-diagnostic-loop into main 2026-05-18 14:41:28 -07:00
Owner

Why:

  • Approved tests can surface a sequence of GREEN diagnostics before they pass.
  • The process guidance needed to distinguish changed diagnostics from new outer RED cycles.
  • The RGR plugin also needs explicit state/tool support for changed diagnostics, not just prompt guidance.

What:

  • Add plugin regression coverage showing a changed failing output for the same focused command can be re-recorded with rgr_record_red, re-approved, and then permits the next single production edit.
  • Add explicit changed-diagnostic tools: rgr_record_changed_diagnostic and rgr_approve_changed_diagnostic.
  • Expand RGR state with changed-diagnostic stages and diagnostic metadata.
  • Require changed-diagnostic approval before the next GREEN edit and support explicit allowed path scopes for cross-file API-boundary edits.
  • Update RGR rules, skill guidance, and agent prompts to document the inner GREEN diagnostic loop.

Validation:

  • node --test .opencode/plugins/auto-review-discipline-rgr.test.ts --test-name-pattern 'permits a second production edit after changed RED verification is re-recorded for the same command'
  • just opencode-test
Why: - Approved tests can surface a sequence of GREEN diagnostics before they pass. - The process guidance needed to distinguish changed diagnostics from new outer RED cycles. - The RGR plugin also needs explicit state/tool support for changed diagnostics, not just prompt guidance. What: - Add plugin regression coverage showing a changed failing output for the same focused command can be re-recorded with `rgr_record_red`, re-approved, and then permits the next single production edit. - Add explicit changed-diagnostic tools: `rgr_record_changed_diagnostic` and `rgr_approve_changed_diagnostic`. - Expand RGR state with changed-diagnostic stages and diagnostic metadata. - Require changed-diagnostic approval before the next GREEN edit and support explicit allowed path scopes for cross-file API-boundary edits. - Update RGR rules, skill guidance, and agent prompts to document the inner GREEN diagnostic loop. Validation: - `node --test .opencode/plugins/auto-review-discipline-rgr.test.ts --test-name-pattern 'permits a second production edit after changed RED verification is re-recorded for the same command'` - `just opencode-test`
fix(opencode): document GREEN diagnostic loop
All checks were successful
CI / Classify changed paths (pull_request) Successful in 3s
CI / Format check (pull_request) Has been skipped
CI / Clippy (pull_request) Has been skipped
CI / Test (pull_request) Has been skipped
CI / Dependency policy (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / opencode plugin tests (pull_request) Successful in 7s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
auto_review auto_review: no findings
d42d6c0e49
Why:
- Approved tests can reveal a sequence of diagnostics while progressing to GREEN, and the guardrails need regression coverage plus instructions for that inner loop.

What:
- Add plugin coverage showing re-recording changed RED output for the same command permits the next focused edit after approval.
- Update RGR rules, skill guidance, and agent prompts to describe the inner GREEN diagnostic loop.

Validation:
- node --test .opencode/plugins/auto-review-discipline-rgr.test.ts --test-name-pattern 'permits a second production edit after changed RED verification is re-recorded for the same command'
- just opencode-test
auto-review approved these changes 2026-05-18 14:22:02 -07:00
Dismissed
auto-review left a comment

The PR introduces documentation and test updates to clarify the handling of changed diagnostics within the same approved test in the RGR process. These changes aim to streamline the development workflow by avoiding unnecessary new RED cycles. The updates appear safe to merge.

Walkthrough

  • .opencode/agents/build.md: Added guidance on continuing the inner GREEN diagnostic loop when an approved test still fails with a changed expected diagnostic.
  • .opencode/agents/rgr-diagnostic-implementer.md: Clarified that a changed failure in the same approved test is part of the GREEN diagnostic loop.
  • .opencode/plugins/auto-review-discipline-rgr.test.ts: Added a test case to verify the behavior of allowing a second production edit after a changed RED verification is re-recorded.
  • .opencode/rules/tdd-discipline.md: Updated TDD discipline rules to include handling of changed diagnostics within the same approved test.
  • .opencode/skills/outside-in-rgr-microcycle/SKILL.md: Added a section on the GREEN Diagnostic Loop to provide guidance on handling multiple GREEN implementation turns.
The PR introduces documentation and test updates to clarify the handling of changed diagnostics within the same approved test in the RGR process. These changes aim to streamline the development workflow by avoiding unnecessary new RED cycles. The updates appear safe to merge. ## Walkthrough - **.opencode/agents/build.md**: Added guidance on continuing the inner GREEN diagnostic loop when an approved test still fails with a changed expected diagnostic. - **.opencode/agents/rgr-diagnostic-implementer.md**: Clarified that a changed failure in the same approved test is part of the GREEN diagnostic loop. - **.opencode/plugins/auto-review-discipline-rgr.test.ts**: Added a test case to verify the behavior of allowing a second production edit after a changed RED verification is re-recorded. - **.opencode/rules/tdd-discipline.md**: Updated TDD discipline rules to include handling of changed diagnostics within the same approved test. - **.opencode/skills/outside-in-rgr-microcycle/SKILL.md**: Added a section on the GREEN Diagnostic Loop to provide guidance on handling multiple GREEN implementation turns.
fix(opencode): add changed diagnostic RGR tools
All checks were successful
CI / Classify changed paths (pull_request) Successful in 3s
CI / Clippy (pull_request) Has been skipped
CI / Format check (pull_request) Has been skipped
CI / Test (pull_request) Has been skipped
CI / Dependency policy (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / opencode plugin tests (pull_request) Successful in 7s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
auto_review auto_review: 3 warnings
ccff3fe208
Why:
- The GREEN diagnostic loop needs explicit state and tools, not just documentation, so approved tests can progress through changed diagnostics safely.

What:
- Add changed-diagnostic recording and approval tools with explicit RGR states.
- Gate changed diagnostics by focused command, require changed-diagnostic approval, and support explicit allowed path scopes for cross-file GREEN edits.

Validation:
- just opencode-test
jwilger dismissed auto-review's review 2026-05-18 14:35:11 -07:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

jwilger changed title from fix(opencode): document GREEN diagnostic loop to fix(opencode): support GREEN diagnostic loop 2026-05-18 14:35:20 -07:00
auto-review left a comment

This PR introduces support for handling changed diagnostics in the RGR plugin, adding new tools and expanding the RGR state to manage these scenarios. The changes appear well-structured, but the introduction of new stages and error handling requires careful integration with existing components.

Walkthrough

Δ since d42d6c0:

  • auto-review-discipline-rgr.test.ts:
    • Added a new test to verify the behavior of changed diagnostic tools.
  • auto-review-discipline.ts:
    • Introduced new functions to handle changed diagnostics and updated the RGR cycle stages.
    • Added error handling for paths outside the approved diagnostic scope.
  • lib/shared.ts:
    • Expanded the RgrStage type to include new stages for handling changed diagnostics.
This PR introduces support for handling changed diagnostics in the RGR plugin, adding new tools and expanding the RGR state to manage these scenarios. The changes appear well-structured, but the introduction of new stages and error handling requires careful integration with existing components. ## Walkthrough ### Δ since d42d6c0: - **auto-review-discipline-rgr.test.ts**: - Added a new test to verify the behavior of changed diagnostic tools. - **auto-review-discipline.ts**: - Introduced new functions to handle changed diagnostics and updated the RGR cycle stages. - Added error handling for paths outside the approved diagnostic scope. - **lib/shared.ts**: - Expanded the `RgrStage` type to include new stages for handling changed diagnostics.
@ -293,7 +299,7 @@ export const AutoReviewDisciplinePlugin: Plugin = async ({ worktree } = {}) => (
const current = getCycle(context.sessionID);
Owner

🟡 Warning: The stage transition from 'red' to 'red_started' is a breaking change. Ensure that all dependent components are updated to handle this new stage name.

🟡 **Warning:** The stage transition from 'red' to 'red_started' is a breaking change. Ensure that all dependent components are updated to handle this new stage name.
jwilger marked this conversation as resolved
@ -303,10 +309,58 @@ export const AutoReviewDisciplinePlugin: Plugin = async ({ worktree } = {}) => (
async execute(_args, context) {
Owner

🟡 Warning: The stage transition from 'red' to 'red_observed' is a breaking change. Ensure that all dependent components are updated to handle this new stage name.

🟡 **Warning:** The stage transition from 'red' to 'red_observed' is a breaking change. Ensure that all dependent components are updated to handle this new stage name.
jwilger marked this conversation as resolved
@ -1,6 +1,15 @@
import { execFileSync } from "node:child_process";
Owner

🟡 Warning: Lines 1–19: The addition of new RGR stages is a significant change. Ensure that all parts of the system that rely on RGR stages are updated to handle these new stages appropriately.

🟡 **Warning:** **Lines 1–19:** The addition of new RGR stages is a significant change. Ensure that all parts of the system that rely on RGR stages are updated to handle these new stages appropriately.
jwilger marked this conversation as resolved
jwilger deleted branch fix/rgr-green-diagnostic-loop 2026-05-18 14:41:28 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!258
No description provided.