dobbe

dobbe vuln resolve

Scan, fix, and verify vulnerable dependencies with an agentic feedback loop.

Synopsis

dobbe vuln resolve [OPTIONS]

Description

vuln resolve is dobbe’s flagship command. It orchestrates multiple AI agents in an iterative loop to:

  1. Scan for Dependabot vulnerability alerts
  2. Apply dependency upgrades (patch/minor bumps only)
  3. Run tests and verify no breaking changes
  4. Revert and retry with error feedback if tests fail
  5. Generate an executive summary and create a PR

The pipeline runs up to --max-iterations fix-verify cycles before reporting results.

Pipeline Flowchart

┌─────────────────────────────────────────────────┐
│  dobbe vuln resolve [--repo org/repo]            │
│  (auto-detects from CWD if no flags given)       │
└──────────────────────┬──────────────────────────┘
                       │
                       v
┌─────────────────────────────────────────────────┐
│  1. DISCOVER                                     │
│  - Auto-detect repo from CWD git remote          │
│  - Discover available MCP servers                │
│  - Resolve repo: configured paths -> common      │
│    dirs -> CWD remote match -> clone to tempdir  │
└──────────────────────┬──────────────────────────┘
                       │
                       v
┌─────────────────────────────────────────────────┐
│  2. BRANCH SETUP                                 │
│  - Create feature branch from --base             │
│  - Default branch name: dobbe/vuln-fix-YYYYMMDD  │
└──────────────────────┬──────────────────────────┘
                       │
                       v
┌─────────────────────────────────────────────────┐
│  3. SCAN AGENT                                   │
│  - Fetch Dependabot alerts via MCP or gh CLI     │
│  - Triage each alert: is code path affected?     │
│  - Group alerts by package                       │
│  - Build scan summary with risk levels           │
│  Tools: [Bash, Read, Grep, Glob] + MCP           │
└──────────────────────┬──────────────────────────┘
                       │
                 ┌─────┴──────┐
                 │  Dry run?  │
                 └─────┬──────┘
               yes |       | no
                   v       v
            ┌─────────┐  ┌────────────────────────┐
            │ Report  │  │  4. FIX AGENT           │<────────┐
            │ scan    │  │  - Read scan summary    │         │
            │ results │  │  - Apply PATCH/MINOR    │         │
            │ + exit  │  │    bumps only           │         │
            └─────────┘  │  - Update lockfiles     │         │
                         │  - Skip if no safe fix  │         │
                         │  Tools: [Bash, Read,    │         │
                         │   Grep, Glob, Edit,     │         │
                         │   Write] + MCP          │         │
                         └───────────┬─────────────┘         │
                                     │                       │
                                     v                       │
                         ┌───────────────────────┐           │
                         │  5. GIT COMMIT         │           │
                         │  - Stage all changes   │           │
                         │  - Commit with message │           │
                         └───────────┬────────────┘           │
                                     │                       │
                           ┌─────────┴──────────┐            │
                           │ Changes committed?  │            │
                           └─────────┬──────────┘            │
                         yes |             | no              │
                             v             v                 │
                  ┌────────────────┐  Mark converged,        │
                  │ --skip-verify? │  skip to report         │
                  └───────┬────────┘                         │
                yes |          | no                          │
                    v          v                             │
              Mark converged  ┌─────────────────────┐        │
              skip to report  │  6. VERIFY AGENT    │        │
                              │  - git diff review  │        │
                              │  - Check breaking   │        │
                              │    changes          │        │
                              │  - Run tests        │        │
                              │  - Verify lockfiles │        │
                              │  Tools: [Bash, Read,│        │
                              │   Grep, Glob]       │        │
                              └──────────┬──────────┘        │
                                         │                   │
                                   ┌─────┴─────┐            │
                                   │  Passed?  │            │
                                   └─────┬─────┘            │
                                 yes |       | no           │
                                     │       v              │
                                     │  ┌─────────────┐     │
                                     │  │ Iterations  │     │
                                     │  │ remaining?  │     │
                                     │  └──────┬──────┘     │
                                     │  yes |      | no    │
                                     │      v      │       │
                                     │  ┌────────┐ │       │
                                     │  │ REVERT │ │       │
                                     │  │ Reset  │ │       │
                                     │  │ branch │ │       │
                                     │  │ to base│ │       │
                                     │  │ Feed   │ │       │
                                     │  │ back   ├─┼───────┘
                                     │  │ errors │ │
                                     │  └────────┘ │
                                     │             │
                                     v             v
                         ┌─────────────────────────────┐
                         │  7. REPORT AGENT             │
                         │  - Summarize what was fixed  │
                         │  - What was skipped and why  │
                         │  - Verification results      │
                         │  - Risk assessment           │
                         │  - Next steps                │
                         │  Tools: [Read]               │
                         └──────────────┬───────────────┘
                                        │
                                        v
                         ┌─────────────────────────────┐
                         │  8. CREATE PR                │
                         │  - Push branch               │
                         │  - Create PR via gh CLI      │
                         │  - Include executive summary │
                         │  (skipped if --no-pr or      │
                         │   not converged)             │
                         └─────────────────────────────┘

Options

Option Type Default Description
--repo / -r str auto-detect Repository to fix (org/repo). Auto-detected from current directory if omitted.
--severity / -s str critical,high,medium,low Comma-separated severity filter
--max-iterations int 3 Max fix-verify iterations (1-10)
--base str main Base branch to branch from
--branch str auto Branch name for fixes
--create-pr / --no-pr bool True Create PR on convergence
--dry-run bool False Scan only, no edits
--skip-verify bool False Skip verification step
--format / -f str table Output format: table, json, markdown
--timeout int 300 Claude subprocess timeout in seconds (envvar: DOBBE_TIMEOUT_CLAUDE)
--yes / -y bool False Skip confirmation prompts
--from-scan str - Path to scan JSON from dobbe vuln scan --format json. Use '-' for stdin.

When run from inside a git repository with no --repo flag, auto-detects the repo from the current directory’s git remote URL.

Agent Tool Access

Each pipeline agent has scoped tool permissions:

Agent Tools Why
Scan Bash, Read, Grep, Glob + MCP Read-only analysis of alerts and code
Fix Bash, Read, Grep, Glob, Edit, Write + MCP Needs to modify dependency files
Verify Bash, Read, Grep, Glob Read + run tests, no edits allowed
Report Read Read-only access to generate summary

MCP tools (e.g., mcp__github__*) are added when available for the scan and fix agents.

Pipeline Stages

Stage 1: Discovery

Discovers available MCP servers from ~/.claude/settings.json and resolves the repository location:

  1. If no --repo flag, auto-detect from current directory’s git remote URL
  2. Check configured local_paths in ~/.dobbe/config.toml
  3. Scan common project directories (~/projects, ~/code, ~/src, etc.)
  4. Check if current directory’s git remote matches the --repo slug
  5. Fall back to shallow clone (git clone --depth 1) into a temp directory

Stage 2: Branch Setup

Creates a feature branch from the base branch. Default branch name follows the pattern dobbe/vuln-fix-YYYYMMDD. Custom names can be set with --branch.

Stage 3: Scan

The scan agent fetches Dependabot alerts and triages each one:

Stage 4: Fix

The fix agent reads the scan summary and applies upgrades:

Stage 5: Git Commit

Stages all changes and creates a commit. If no changes were made (e.g., all packages skipped), the pipeline marks convergence and moves to the report stage.

Stage 6: Verify

The verify agent reviews the changes:

If verification fails, the pipeline reverts the branch to the base, feeds the error details back to the fix agent, and starts the next iteration.

Stage 7: Report

Generates a plain-text executive summary (under 500 words) covering:

Stage 8: Create PR

If the pipeline converged (tests pass) and --create-pr is enabled, pushes the branch and creates a PR via gh pr create with the executive summary as the body.

Transcript Saving

Each pipeline run saves a full conversation log (all agent messages with timestamps) that can be reviewed for debugging or auditing. The conversation includes agent names, iteration numbers, and detailed summaries.

Examples

Fix the current repository (auto-detect)

cd ~/projects/api
dobbe vuln resolve

Fix a single repository by name

dobbe vuln resolve --repo acme/web-app

Dry run - scan and report without making changes

dobbe vuln resolve --repo acme/web-app --dry-run

Skip verification for fast iteration

dobbe vuln resolve --repo acme/web-app --skip-verify --max-iterations 1

Custom branch and base

dobbe vuln resolve --repo acme/web-app --base develop --branch fix/security-march

JSON output for CI integration

dobbe vuln resolve --repo acme/web-app --format json

Using Pre-computed Scan Results

When you run dobbe vuln scan followed by dobbe vuln resolve on the same repo, the scan agent runs twice - the same expensive Claude invocation analyzing the same alerts. The --from-scan option lets you pass pre-computed scan results to resolve, skipping the redundant scan agent entirely.

How it works

┌──────────────────────────────────┐
│  Load scan JSON (file or stdin)  │
└──────────────────┬───────────────┘
                   │
                   v
┌──────────────────────────────────┐
│  Match repo -> build summary     │
└──────────────────┬───────────────┘
                   │
                   v
┌──────────────────────────────────┐
│  FIX AGENT (skip scan agent)     │
│  ... rest of pipeline unchanged  │
└──────────────────────────────────┘

From a saved file

dobbe vuln scan --repo acme/web-app --format json --output scan.json
dobbe vuln resolve --repo acme/web-app --from-scan scan.json

Piping directly

dobbe vuln scan --repo acme/web-app --format json | dobbe vuln resolve --repo acme/web-app --from-scan -

Notes

Convergence Logic

The pipeline converges (succeeds) when any of these conditions are met:

  1. Verify passes - all tests pass and no breaking changes detected
  2. No changes committed - all packages skipped (no safe fix available)
  3. Skip verify - --skip-verify flag bypasses verification

If the pipeline exhausts all iterations without converging, the report agent still generates a summary explaining what failed and why. No PR is created in this case.

See Also