# Runnable audit examples

The audit examples are ordinary Markdown files:
[context.md](../examples/audit/context.md) and
[context-minimal.md](../examples/audit/context-minimal.md). They can be edited by a prompt
author, generated by an existing template engine, or checked out from a
knowledge-base build. No custom source format is required.

~~~sh
moon run cmd/main -- audit examples/audit/context.md \
  --policy examples/audit/policy.json
~~~

The same check in machine-readable form is suitable for a release job:

~~~sh
moon run cmd/main -- audit \
  examples/audit/context.md examples/audit/context-minimal.md \
  --policy examples/audit/policy.json \
  --json --report _build/context-audit-batch.json
~~~

Batch output keeps one report per input in order and adds a summary of passed,
warning, failed, and unreadable artifacts.

To review a report change between two builds:

~~~sh
moon run cmd/main -- diff \
  _build/context-audit-before.json _build/context-audit-after.json \
  --json --report _build/context-audit-diff.json
~~~

The diff aligns artifacts by path and records additions, removals, fingerprint
changes, issue-code changes, and newly unreadable inputs. A changed report exits
with status 1 so a release job can require an explicit review.

To exercise the failure path, lower the budget or require a marker that is not
present:

~~~sh
moon run cmd/main -- audit examples/audit/context.md \
  --budget 20 --require "A citation policy"
~~~

## Complete fresh-checkout verification

~~~sh
moon update
moon fmt --check
moon check --target all --deny-warn --warn-list=-implicit_impl_as_method-test_unqualified_package
moon build --target all
moon test --target all
moon run cmd/main -- audit examples/audit/context.md --budget 1800
~~~

See [the audit contract](audit.md), [production workflows](production-workflows.md),
and [the release guide](releasing.md) for the report format and CI checklist.
