Audit
A read-only, whole-app (or scoped-folder) deep review that sweeps the codebase across up to three investigation phases and produces per-phase reports plus a roll-up findings report. As of 0.13 (D-61) it is an action-layer orchestrator — its own per-kind multi-phase mini-orchestrator, not a single prompt: it writes no code, runs no clarify step and no stage pipeline, and is defined entirely by its ## Action config. The orchestrator routes it to _processes/03_action/audit/audit.prompt.md (the old _processes/03_action/audit.prompt.md path is a tombstone) and never enters the stage loop.
Source of truth: the registry row in _processes/_shared/request-types.md, the preset _processes/_shared/presets/audit.md, and the action prompt _processes/03_action/audit/audit.prompt.md.
The flow
The orchestrator runs the audit prompt inline (a non-dispatch instruction library, like the doc_upkeep orchestrator). It first reads JOB.md → ## Action to resolve Kind / Scope / Agents / Depth / UpdateMode, then resolves the per-kind phase matrix — which of the three investigation phases this Kind runs (see below). For each enabled phase it runs one read-only instance of the shared managed sub-agent loop (_processes/_shared/managed-subagent-loop.md): a shallow Level-1 orientation pass enumerates the sections for that phase, then one read-only Level-2 sub-agent per section reads its area and returns a capped, evidence-cited per-section report, which the Consolidator folds into a compact per-phase report under 09_action/phases/. The orchestrator then writes the verified roll-up 09_action/action-report.md (section inventory across phases, findings grouped by severity, explicit skipped-surface list). It verifies the report, records completion in PROGRESS.md, and lands the job in 4_done/. When UpdateMode: report_fix, the audit additionally emits one contract-valid Type: feature intake into jobs/0_new/ referencing the reports, then stops (drop-and-tell).
The per-kind phase matrix
The audit decomposes into three investigation phases, and each Kind declares which of them it runs — there is no single fixed pipeline. The matrix is an inline authority the runtime applies directly (no separate recipe file — the Kind set is small and closed).
- Phase 1 — current-code investigation. What the real code is; a deep, evidence-cited report of the current situation.
- Phase 2 — global-app impact. How the audited part is used across the app — its callers/consumers, its job, its blast radius.
- Phase 3 — best-practice / web validation. Revalidate against current libraries, idioms, and standards via
WebFetch/WebSearch(cited URLs, untrusted content, degrade to low confidence when offline).
| Kind | P1 current-code | P2 global-app | P3 best-practice/web |
|---|---|---|---|
security | yes | yes | yes (heavy) |
find_issues | yes | yes | no — web only per-finding for a load-bearing current fact |
doc_drift | yes | yes | no |
revalidate (new in 0.13) | yes | yes | yes — all three across all concern-types, one unified enumerator |
custom | yes | yes | when CustomObjective depends on external current standards |
revalidate is the whole-app/scoped soundness sweep: it runs all three phases across all concern-types — structure, coding standard, find issues, validate docs, security — composed as one unified enumerator (the sections are enumerated once and tagged with their concern groups, not N sequential single-Kind runs), bounded by Depth + per-phase section caps + explicit skipped-surface reporting.
What it is for
An audit is a deep, evidence-backed review of the whole application — or a confined folder when you set a Scope. It exists to find and report, never to change inline: it produces per-phase reports under 09_action/phases/ plus a roll-up 09_action/action-report.md and writes no code.
- Read-only. Every sub-agent runs in read-only mode; the only artifacts written are the reports (and, in
report_fixmode, one follow-up intake — never code). - Whole-app or scoped. A blank
Scopesweeps the whole application; a repo-relative folder confines the sweep. - Multi-phase, per-kind. Each
Kindruns the subset of the three investigation phases its matrix row enables (see the phase matrix). - No clarify step. Unlike pipeline types, an audit has no mandate to pressure-test — its scope and objective come from the
## Actionconfig, so it drops clarify entirely. - Distinct from validate / review. Those check a single diff; an audit is a standalone, section-by-section sweep of the codebase as it stands.
UpdateMode: report (default) it reports and stops; acting on the findings is then a separately-opened quick_fix, feature, or bug job. With UpdateMode: report_fix it is drop-and-tell: after writing its reports it generates one contract-valid Type: feature intake into jobs/0_new/ whose mandate references the audit reports, then stops and tells you to run the orchestrator to pick it up — it is not auto-run or auto-chained.
The logic
An audit sits in the action layer with shape orchestrator (its own per-kind multi-phase mini-orchestrator; reshaped from a singlet in 0.13, D-61). The orchestrator routes it via orchestrator.prompt.md → §C.route — by layer / shape, not by the stage pipeline. An audit JOB.md therefore carries no stage machinery at all.
- Kind — the audit family, a closed vocabulary:
security(default),find_issues,doc_drift,revalidate, orcustom. One parameterisedaudittype covers the whole family; an unrecognised kind is a blocker.operation_recordis not an audit kind. - UpdateMode — audit-scoped
report(default) |report_fix; governs only the post-report behaviour, disjoint fromdoc_upkeep'sapply|report_only(same field name, different vocabulary — never conflated). - Scope — blank sweeps the whole application; a repo-relative folder confines the sweep to that path.
- Routed, not staged — the route hands the job to the action orchestrator and does not run clarify → … → validate; the main orchestrator stays the sole
PROGRESS.mdwriter and sole4_donemover.
The fields
An audit JOB.md carries only the header, ## Git, ## Action, and an optional mandate. There is no ## Stages, no ## Approval gates, and no ## Per-stage config — action types are routed by layer/shape, not by enabled stages.
| Field | Default | Meaning |
|---|---|---|
Kind | security | The audit family — security / find_issues / doc_drift / revalidate / custom; an unrecognised value is a blocker. |
Scope | (blank) | Repo-relative folder to confine the sweep; blank means the whole application. |
UpdateMode | report | Audit-scoped report | report_fix — governs only the post-report behaviour. report_fix emits one Type: feature intake into 0_new/ after the reports, then stops (drop-and-tell). Disjoint from doc_upkeep's apply | report_only. |
CustomObjective | (blank) | Free-form objective that drives the whole sweep — load-bearing only for Kind: custom. |
Agents | claude | Runtime(s) for the section-loop sub-agents (claude | codex | claude, codex); adding codex requires config.json → runtimes.codex: true. |
Depth | standard | quick | standard | deep — tunes how many sections are swept and how deep each sub-agent reads. |
Section loop | yes | Runs the read-only two-level managed sub-agent loop (_processes/_shared/managed-subagent-loop.md) once per enabled investigation phase. |
Consolidator | claude | Runtime that synthesises the per-section reports within each phase and the cross-phase roll-up 09_action/action-report.md. |
| Field | Default | Meaning |
|---|---|---|
Create branch | no | No branch is cut — the audit writes only its report. |
Validate against main | no | No diff to validate against the base branch. |
Commit | no | Nothing is committed by default. |
Push | no | Nothing is pushed by default. |
PR | no | No pull request is opened. |
PR target branch | (blank) | Blank resolves to production. |
before_commit | no | No approval stop before commit by default. |
before_pr | no | No approval stop before PR by default. |
How to run it
There are two copy-path ways to run an audit. Both produce the same 09_action/action-report.md.
audit intake to jobs/0_new/ (via the form or by hand), then send the orchestrator prompt path. It reads JOB.md → Type, routes by layer, and runs the audit logic without entering the stage loop.
_processes/02_orchestrator/orchestrator.prompt.md
_processes/03_action/audit/audit.prompt.md
_processes/...); prefix with _code_workflow/ when your cwd is the host project root. See How to use → Two invocation modes.
See also
All request types
The overview of every type, the routing diagram, and the registry table.
quick_fix
The action type you reach for to fix what an audit finds — independent small fixes in parallel.
doc_upkeep
The doc-governance action type: survey then confined HTML updates against the code and the UI kit.