Proposal: improve implementation-orchestrator — add coverage-improver dispatch when coverage drops below 97% threshold #5375

Open
opened 2026-04-09 06:16:37 +00:00 by HAL9000 · 1 comment
Owner

Agent Improvement Proposal

Pattern Detected

Type: capability_gap
Affected Agent: implementation-orchestrator
Evidence: Issue #5363 (filed 2026-04-09) documents that test coverage is at 84.42%, which is 12.58 percentage points below the required 97% threshold. This is a v3.5.0 Deliverable #13 blocker. The coverage-improver agent exists in the system but is never dispatched by any supervisor — it is only listed as "manually invoked by user" in the agent registry.

Detailed Evidence

From issue #5363:

Coverage report: 84.42%
Key files with low coverage:
- src/cleveragents/cli/commands/plan.py: 60.24%
- src/cleveragents/agents/base.py: 82.78%
- src/cleveragents/application/services/plan_executor.py: 76.54%

From CONTRIBUTING.md:

Test Coverage: Unit test coverage must be maintained at or above 97% at all times. This is verified using the nox -e coverage_report command.

From the agent registry (system prompt):

coverage-improver: This subagent should only be called manually by the user.

Root cause: The coverage-improver agent exists but has no automated supervisor that monitors coverage and dispatches it when coverage drops. The implementation-orchestrator focuses on issues and PRs but has no coverage monitoring logic.

Impact: Coverage has been at 84.42% (or lower) for an extended period. This blocks v3.5.0 milestone completion and violates the CONTRIBUTING.md quality gate.

Proposed Change

Add coverage monitoring to implementation-orchestrator.md as a periodic check:

Add a new section to the orchestrator's analysis loop:

Every N cycles (e.g., every 10 cycles, ~20 minutes), the orchestrator should:

  1. Check if there is an open issue with Type/Bug label mentioning coverage below 97%
  2. If coverage is below threshold AND no coverage-improver worker is currently active:
    • Dispatch a coverage-improver worker as a high-priority task
    • Track the worker session ID
    • Do NOT dispatch additional coverage-improver workers if one is already running
  3. If coverage is at or above 97%: skip coverage dispatch

The check should be lightweight — simply look for open issues with titles containing "coverage" and "97%" or "below" to detect the coverage gap without running nox directly.

Specific guidance to add to the orchestrator's analysis loop:

### Coverage Monitoring (Every 10 Cycles)

Check for coverage gap issues:
1. Query Forgejo for open issues with labels Type/Bug AND title containing "coverage" AND "97%"
2. If such issues exist AND no coverage-improver worker is active:
   - Dispatch coverage-improver as a high-priority worker
   - Log: "Coverage below threshold — dispatching coverage-improver"
3. Only one coverage-improver worker at a time
4. After coverage-improver completes, verify coverage issue is closed

Expected Impact

  • Coverage gap fixed: The coverage-improver agent will be automatically dispatched when coverage drops below 97%, rather than waiting for manual intervention
  • v3.5.0 unblocked: Deliverable #13 (coverage ≥ 97%) will be addressed automatically
  • Quality gate enforcement: Coverage will be maintained as a continuous quality gate, not just a one-time check
  • Low overhead: The check is lightweight (one Forgejo API query per 10 cycles)

Risk Assessment

  • Low risk: The coverage-improver agent already exists and is designed for this purpose. We are simply automating its dispatch.
  • Potential concern: Coverage-improver may take a long time to run and consume a worker slot. Mitigation: only dispatch one at a time, and it runs as a normal worker alongside other workers.
  • Potential concern: Coverage-improver may fail or produce incorrect tests. Mitigation: it goes through the same PR review process as all other implementation work.
  • No regression risk: This is an additive change — it adds a new check to the orchestrator loop without modifying existing logic.

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: agent-evolver

## Agent Improvement Proposal ### Pattern Detected **Type**: capability_gap **Affected Agent**: `implementation-orchestrator` **Evidence**: Issue #5363 (filed 2026-04-09) documents that test coverage is at **84.42%**, which is 12.58 percentage points below the required 97% threshold. This is a v3.5.0 Deliverable #13 blocker. The `coverage-improver` agent exists in the system but is never dispatched by any supervisor — it is only listed as "manually invoked by user" in the agent registry. ### Detailed Evidence From issue #5363: ``` Coverage report: 84.42% Key files with low coverage: - src/cleveragents/cli/commands/plan.py: 60.24% - src/cleveragents/agents/base.py: 82.78% - src/cleveragents/application/services/plan_executor.py: 76.54% ``` From CONTRIBUTING.md: > Test Coverage: Unit test coverage must be maintained at or above 97% at all times. This is verified using the `nox -e coverage_report` command. From the agent registry (system prompt): > coverage-improver: This subagent should only be called manually by the user. **Root cause**: The `coverage-improver` agent exists but has no automated supervisor that monitors coverage and dispatches it when coverage drops. The implementation-orchestrator focuses on issues and PRs but has no coverage monitoring logic. **Impact**: Coverage has been at 84.42% (or lower) for an extended period. This blocks v3.5.0 milestone completion and violates the CONTRIBUTING.md quality gate. ### Proposed Change Add coverage monitoring to `implementation-orchestrator.md` as a periodic check: **Add a new section to the orchestrator's analysis loop:** Every N cycles (e.g., every 10 cycles, ~20 minutes), the orchestrator should: 1. Check if there is an open issue with `Type/Bug` label mentioning coverage below 97% 2. If coverage is below threshold AND no coverage-improver worker is currently active: - Dispatch a `coverage-improver` worker as a high-priority task - Track the worker session ID - Do NOT dispatch additional coverage-improver workers if one is already running 3. If coverage is at or above 97%: skip coverage dispatch The check should be lightweight — simply look for open issues with titles containing "coverage" and "97%" or "below" to detect the coverage gap without running nox directly. **Specific guidance to add to the orchestrator's analysis loop:** ``` ### Coverage Monitoring (Every 10 Cycles) Check for coverage gap issues: 1. Query Forgejo for open issues with labels Type/Bug AND title containing "coverage" AND "97%" 2. If such issues exist AND no coverage-improver worker is active: - Dispatch coverage-improver as a high-priority worker - Log: "Coverage below threshold — dispatching coverage-improver" 3. Only one coverage-improver worker at a time 4. After coverage-improver completes, verify coverage issue is closed ``` ### Expected Impact - **Coverage gap fixed**: The coverage-improver agent will be automatically dispatched when coverage drops below 97%, rather than waiting for manual intervention - **v3.5.0 unblocked**: Deliverable #13 (coverage ≥ 97%) will be addressed automatically - **Quality gate enforcement**: Coverage will be maintained as a continuous quality gate, not just a one-time check - **Low overhead**: The check is lightweight (one Forgejo API query per 10 cycles) ### Risk Assessment - **Low risk**: The coverage-improver agent already exists and is designed for this purpose. We are simply automating its dispatch. - **Potential concern**: Coverage-improver may take a long time to run and consume a worker slot. Mitigation: only dispatch one at a time, and it runs as a normal worker alongside other workers. - **Potential concern**: Coverage-improver may fail or produce incorrect tests. Mitigation: it goes through the same PR review process as all other implementation work. - **No regression risk**: This is an additive change — it adds a new check to the orchestrator loop without modifying existing logic. --- *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: agent-evolver
Author
Owner

Label compliance fix applied:

  • Added missing labels to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5375
No description provided.