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.

All request types

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).

  1. Phase 1 — current-code investigation. What the real code is; a deep, evidence-cited report of the current situation.
  2. Phase 2 — global-app impact. How the audited part is used across the app — its callers/consumers, its job, its blast radius.
  3. 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).
Which phases each Kind runs
KindP1 current-codeP2 global-appP3 best-practice/web
securityyesyesyes (heavy)
find_issuesyesyesno — web only per-finding for a load-bearing current fact
doc_driftyesyesno
revalidate (new in 0.13)yesyesyes — all three across all concern-types, one unified enumerator
customyesyeswhen 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.

Fixing is never inline — but can be auto-queued. An audit never edits code. With 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.

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.

## Action block fields (source: _processes/_shared/presets/audit.md + _processes/03_action/audit/audit.prompt.md)
FieldDefaultMeaning
KindsecurityThe 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.
UpdateModereportAudit-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.
AgentsclaudeRuntime(s) for the section-loop sub-agents (claude | codex | claude, codex); adding codex requires config.json → runtimes.codex: true.
Depthstandardquick | standard | deep — tunes how many sections are swept and how deep each sub-agent reads.
Section loopyesRuns the read-only two-level managed sub-agent loop (_processes/_shared/managed-subagent-loop.md) once per enabled investigation phase.
ConsolidatorclaudeRuntime that synthesises the per-section reports within each phase and the cross-phase roll-up 09_action/action-report.md.
## Git block (default off — an audit writes no code)
FieldDefaultMeaning
Create branchnoNo branch is cut — the audit writes only its report.
Validate against mainnoNo diff to validate against the base branch.
CommitnoNothing is committed by default.
PushnoNothing is pushed by default.
PRnoNo pull request is opened.
PR target branch(blank)Blank resolves to production.
before_commitnoNo approval stop before commit by default.
before_prnoNo 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.

Option A — drop an intake, let the orchestrator route it. Add an 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.
Orchestrator (routes by type)
_processes/02_orchestrator/orchestrator.prompt.md
Option B — run the action prompt directly. Point the agent straight at the audit action orchestrator for an existing audit job.
Audit action orchestrator
_processes/03_action/audit/audit.prompt.md
Two invocation modes — copy blocks show the workflow-internal path (bare _processes/...); prefix with _code_workflow/ when your cwd is the host project root. See How to use → Two invocation modes.

See also