Process Optimization: Scan → Remediate → Validate Workflow

docs / process / process-optimization

← all docs

Process Optimization: Scan → Remediate → Validate Workflow

Applies the standard current-state / waste / future-state / impact framework to the process in process-operate-vvah.md.

1. Current State (as documented in the process doc)

Setup (once) → estimate → scan (S0–S9) → triage report.md (human) →
remediate (S10, edits code) → git diff review (human) → validate (S11) →
act on verdict (human) → merge/escalate

Eight steps, four of them requiring a human in the loop (triage, diff review, verdict action, escalation), three of them spending model budget (scan, remediate, validate).

2. Identify Waste

Type Where it shows up Why it's waste
Waiting Analyst triages report.md in a separate sitting from the scan; remediation often waits for a human to pick findings The scan → triage handoff has no forcing function — findings can sit unread for days between Steps 3 and 4 of the process doc.
Rework remediate run without --mode report-only first, diff turns out unwanted, requires git checkout -- and a re-run Skipping the report-only preview (Step 1 alternative in the runbook) turns a review step into a revert-and-retry cycle.
Handoffs Analyst runs scan → developer owns remediate/validate on their own repo → AppSec re-reviews needs_review verdicts Three handoffs per finding in the worst case; each is a queue with no SLA defined today.
Over-processing Running --stop-after s9 scans repeatedly on an unchanged repo because --resume / caching isn't habitual Checkpointing exists (--resume, state DB) but is opt-in per invocation — easy to forget and re-pay the S1–S9 cost.
Manual work Credential/profile setup (setup-and-credentials.md) is a manual, per-environment procedure; CI/CD wiring is entirely bespoke per team No shipped CI template — every team re-derives the same scan --stop-after s9 wrapper.
Cost drift estimate is optional and easy to skip; actual token spend is only visible after the fact via util/metrics.py accounting, not surfaced mid-run Teams can commit to a full scan on a huge repo without a pre-flight cost gate.

3. Future State (recommendations)

Recommendation Addresses Effort
Make estimate a required pre-scan step in the runbook and in CI (fail the job if projected tokens exceed a threshold) Cost drift Low — process/tooling change only, no VVAH code change
Default to --mode report-only for the first remediation pass per repo, require an explicit second command to apply Rework from unwanted diffs Low — process convention, already supported by the CLI
Add an SLA to the RACI: triage within 1 business day of scan completion; needs_review verdicts reviewed within 2 business days (already stated as a metric target in the process doc — formalize as a tracked SLA) Waiting, handoff drift Low — ownership/process, no tooling change
Ship a minimal CI job template (GitHub Actions/GitLab CI) wrapping scan --stop-after s9 + SARIF upload, as a reusable artifact in this project's samples/ Manual, duplicated CI wiring Medium — one-time authoring effort, reusable across teams
Habitual --resume: document it as the default invocation pattern (already true in run-a-detection-scan.md Step 4), and consider a wrapper script in samples/ that always adds --resume Over-processing / repeated cost Low — script authoring, no VVAH change
Batch setup across environments: script the .env + profile copy for repeat environments (dev/staging/prod runners) instead of manual setup-and-credentials.md walk-through each time Manual setup work Medium — one scripted install path per environment class
Track verdict distribution monthly (already a metric in the process doc) to catch a rising needs_review rate early — that's a leading indicator of a backend/config regression, not individual bad findings Handoff/rework caused by systemic issues going unnoticed Low — reporting cadence, data already exists in DTOs

4. Estimated Impact

5. Implementation Plan

  1. Update process-operate-vvah.md's RACI/Metrics with the SLA additions above (process-only, do now).
  2. Add a --resume-by-default wrapper script and a CI job template under samples/ (next iteration).
  3. Add a monthly verdict-distribution check to whoever owns the Metrics section's cadence.
  4. Revisit this document each time the process-doc's Review Cadence triggers (quarterly).