Skip to content

drzero-autonomous

Autonomous repository improvement loop with two-phase propose-then-solve workflow using domain specialist agents

experimental
IDE:
codex
Version:
0.1.0
Owner:epic-platform-sre
drzero
autonomous
improvement
ci
quality

DrZero Autonomous Mode

Two-phase autonomous repository improvement loop. Analyzes CI state and codebase quality, generates prioritized WorkItems, then solves them through domain specialists. Default Codex plugin behavior is 3 iterations with 3 WorkItems per iteration, unless drzero.yml overrides dr_zero.max_iterations or dr_zero.tasks_per_iteration.

Installation Prerequisite

Install the DrZero Codex bundle before using this skill:

make codex-install-drzero SCOPE=repo

Workflow

Phase 1: Propose

  • Dispatch agent: drzero-proposer
  • Analyze CI failures, linting errors, test gaps, quality scores
  • Generate ranked WorkItems using proposer scoring (arXiv:2601.07055 Section 3.2):
    • Format score: (1 + think + tool + answer) / 4 if integrity passes
    • Difficulty score: (K - num_successes) / (K - 1) across K solver attempts
    • Combined: (0.5 * format_score + difficulty_score) / 1.5 (range [0.0, 1.0], rescaled to [0, 1] from paper Eq. 4)
  • Present WorkItems for user approval

Phase 2: Solve

For each approved WorkItem:

  • Dispatch agent: drzero-solver (routes to domain specialists)
  • Domain routing based on WorkItem domain field
  • Dispatch agent: drzero-security for review
  • Validate changes pass CI checks

WorkItem Contract

{
  "id": "wi-YYYYMMDD-NNN",
  "description": "Resolve 12 linting violations blocking CI in build-metadata.js",
  "domain": "devops",
  "scope_boundary": ["scripts/build-metadata.js"],
  "acceptance_test": "npm run lint",
  "estimated_difficulty": 0.3,
  "constraints": ["Must not change build output"],
  "rationale": "CI is blocked by linting failures in the metadata build script"
}

Session Management

  • Track progress in .codex/drzero-session.json
  • Log all WorkItems and outcomes
  • Report session summary on completion

Available Domain Specialists

architecture, backend, compliance, database, devops, documentation, frontend, gitops, implementation, infrastructure, monitoring, networking, performance, secrets, security, testing

Scoring Architecture (arXiv:2601.07055)

Proposer (HRPO — Hop-grouped Relative Policy Optimization, Paper Section 3.2):

  • Format score: (1 + think + tool + answer) / 4 if integrity passes
  • Difficulty score: (K - num_successes) / (K - 1) across K solver attempts
  • Combined: (0.5 * format_score + difficulty_score) / 1.5 (range [0.0, 1.0], rescaled to [0, 1] from paper Eq. 4)
  • Scores computed by: dr0.scoring.compute_proposer_hrpo_reward
  • Field name: hrpo_combined (renamed from legacy grpo_combined)

Solver (GRPO — Group Relative Policy Optimization, Paper Section 3.3):

  • Deterministic reward from acceptance-test evidence
  • Reward: 1.0 when acceptance_test_exit_code == 0, otherwise 0.0
  • Scores computed by: dr0.scoring.compute_solver_grpo_reward
  • Field name: grpo_score (renamed from legacy hrpo_score)

Related Assets