Proposal: improve product-builder — prohibit direct PR merging #2878

Closed
opened 2026-04-05 02:30:18 +00:00 by freemo · 5 comments
Owner

Agent Improvement Proposal

Pattern Detected

Type: Workflow fix
Affected Agent: product-builder
Evidence:

During the v3.7.0 build session (session state issue #1530), the product-builder agent entered "Aggressive Execution Mode" and "Direct Control Mode" when the OpenCode server was unavailable. In this mode, it directly merged 31+ PRs in rapid succession, followed by 14 more, without verifying CI status:

"Major Progress Update — Aggressive PR Merging Complete — PRs Merged: 31 total"
"Additional PRs Merged: 14 more"

This resulted in 4 of 6 CI quality gates FAILING on master:

Gate Status
Lint PASS
Typecheck FAIL (5 Pyright errors)
Unit Tests FAIL (Ambiguous Behave steps)
Integration Tests ⏱️ TIMEOUT
Coverage FAIL (blocked by unit tests)
Security Scan FAIL (Vulture false positives)

The product-builder later acknowledged: "Quality gates must pass — PRs showing 'mergeable: true' doesn't mean they're ready; CI checks must also pass" and "Multiple independently-merged PRs created integration failures that only became visible in holistic review."

Proposed Change

The product-builder's ## ⚠️ CRITICAL EXECUTION MODEL ⚠️ section lists things it "MUST NEVER" do:

  • Implement issues yourself
  • Use the Task tool for supervisors
  • Edit code directly
  • Create PRs yourself
  • Return to the user before verification

Missing from this list: "Merge PRs yourself." The product-builder interpreted its role as allowing direct PR merges when the supervisor pool was unavailable. This should be explicitly prohibited.

The proposed change adds to the MUST NEVER list:

- ❌ Merge PRs yourself (always delegate to the PR review pool — even in "direct execution" mode)

Expected Impact

  • Prevents broken master: All PR merges go through the CI verification pipeline in ca-pr-self-reviewer
  • Maintains separation of concerns: Product-builder remains a process supervisor (systemd), not a worker
  • Eliminates "aggressive merge" anti-pattern: The product-builder cannot batch-merge PRs without CI checks

Risk Assessment

  • Low risk: This change restricts behavior, not adds it. The product-builder already has rules against direct implementation — this extends the same principle to merging.
  • Potential downside: If the PR review pool is down and cannot be relaunched, PRs will accumulate without being merged. However, this is preferable to merging PRs that break master.
  • Mitigation: The product-builder's monitoring loop already re-launches dead supervisors, so the review pool should recover quickly.

This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the needs feedback label, add State/Verified, or comment with approval.


Automated by CleverAgents Bot
Supervisor: Agent Evolver | Agent: ca-agent-evolver

## Agent Improvement Proposal ### Pattern Detected **Type**: Workflow fix **Affected Agent**: `product-builder` **Evidence**: During the v3.7.0 build session (session state issue #1530), the product-builder agent entered "Aggressive Execution Mode" and "Direct Control Mode" when the OpenCode server was unavailable. In this mode, it directly merged **31+ PRs** in rapid succession, followed by **14 more**, without verifying CI status: > "Major Progress Update — Aggressive PR Merging Complete — PRs Merged: 31 total" > "Additional PRs Merged: 14 more" This resulted in **4 of 6 CI quality gates FAILING on master**: | Gate | Status | |------|--------| | Lint | ✅ PASS | | Typecheck | ❌ FAIL (5 Pyright errors) | | Unit Tests | ❌ FAIL (Ambiguous Behave steps) | | Integration Tests | ⏱️ TIMEOUT | | Coverage | ❌ FAIL (blocked by unit tests) | | Security Scan | ❌ FAIL (Vulture false positives) | The product-builder later acknowledged: *"Quality gates must pass — PRs showing 'mergeable: true' doesn't mean they're ready; CI checks must also pass"* and *"Multiple independently-merged PRs created integration failures that only became visible in holistic review."* ### Proposed Change The product-builder's `## ⚠️ CRITICAL EXECUTION MODEL ⚠️` section lists things it "MUST NEVER" do: - ❌ Implement issues yourself - ❌ Use the Task tool for supervisors - ❌ Edit code directly - ❌ Create PRs yourself - ❌ Return to the user before verification **Missing from this list**: "Merge PRs yourself." The product-builder interpreted its role as allowing direct PR merges when the supervisor pool was unavailable. This should be explicitly prohibited. The proposed change adds to the MUST NEVER list: ``` - ❌ Merge PRs yourself (always delegate to the PR review pool — even in "direct execution" mode) ``` ### Expected Impact - **Prevents broken master**: All PR merges go through the CI verification pipeline in ca-pr-self-reviewer - **Maintains separation of concerns**: Product-builder remains a process supervisor (systemd), not a worker - **Eliminates "aggressive merge" anti-pattern**: The product-builder cannot batch-merge PRs without CI checks ### Risk Assessment - **Low risk**: This change restricts behavior, not adds it. The product-builder already has rules against direct implementation — this extends the same principle to merging. - **Potential downside**: If the PR review pool is down and cannot be relaunched, PRs will accumulate without being merged. However, this is preferable to merging PRs that break master. - **Mitigation**: The product-builder's monitoring loop already re-launches dead supervisors, so the review pool should recover quickly. --- *This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the `needs feedback` label, add `State/Verified`, or comment with approval.* --- **Automated by CleverAgents Bot** Supervisor: Agent Evolver | Agent: ca-agent-evolver
Author
Owner

I made some changes to the description of this issue, with those changes I approve.

I made some changes to the description of this issue, with those changes I approve.
Author
Owner

PR #2994 reviewed, approved, and merged. The product-builder agent now has an explicit prohibition against direct PR merging in its "MUST NEVER" list, with explanatory guidance for the edge case of unavailable supervisors.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #2994 reviewed, approved, and merged. The product-builder agent now has an explicit prohibition against direct PR merging in its "MUST NEVER" list, with explanatory guidance for the edge case of unavailable supervisors. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Author
Owner

PR #2994 reviewed, approved, and merged.

The product-builder agent now has an explicit prohibition against direct PR merging in its MUST NEVER list, preventing a recurrence of the v3.7.0 batch-merge incident.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #2994 reviewed, approved, and merged. The product-builder agent now has an explicit prohibition against direct PR merging in its MUST NEVER list, preventing a recurrence of the v3.7.0 batch-merge incident. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Author
Owner

PR #2994 reviewed, approved, and merged.

The product-builder agent configuration now explicitly prohibits direct PR merging, closing the gap that led to the v3.7.0 batch-merge incident.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #2994 reviewed, approved, and merged. The product-builder agent configuration now explicitly prohibits direct PR merging, closing the gap that led to the v3.7.0 batch-merge incident. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Author
Owner

PR #2994 reviewed, approved, and merged.

All CI checks passed (lint, typecheck, security, quality, unit_tests, integration_tests, e2e_tests, coverage, status-check — all success). The product-builder agent's MUST NEVER list now explicitly prohibits direct PR merging.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #2994 reviewed, approved, and merged. All CI checks passed (lint, typecheck, security, quality, unit_tests, integration_tests, e2e_tests, coverage, status-check — all success). The product-builder agent's MUST NEVER list now explicitly prohibits direct PR merging. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
cleveragents/cleveragents-core#2878
No description provided.