Audit the given subject against a standard, check every item in scope, and
report the findings. Report, don't fix.
Target
jj show --git
Arguments: $ARGUMENTS
Audit the subject named in the arguments if given. Otherwise audit the changes
in the current commit shown above. If there are no arguments and the commit has
no changes, ask the user what to audit and stop.
Principles
- An audit is a completeness claim, not a sampling. A review says "here is what
I noticed"; an audit says "I checked all of these, and here is what failed"
- The standard comes before the findings. Decide what counts as a failure before
looking, so the findings aren't rationalized after the fact
- Unchecked items are a finding of their own. Disclose every gap in coverage
- A clean audit is a real outcome. Don't manufacture findings to justify the
effort
Workflow
- State the standard: what property must hold for every item in scope? Derive
it from the arguments, the project's conventions, or the relevant docs and
spec. If the arguments name a subject but no standard, propose one in a
sentence and continue with it, saying in the report that you chose it
- Enumerate the population: list every item in scope by mechanical means (
rg,
a file glob, a manifest, a schema), not from memory. Record the count. See
"Scoping the population"
- Write the check: the question asked of one item, and the evidence that
answers it. Run it against one item you expect to pass and one you expect to
fail, to confirm it tells them apart
- Apply the check to every enumerated item. Record each as pass, fail, or not
checked with the reason
- Verify each failure before reporting it: re-read the item, and prefer running
something (a test, a command, a query) over reasoning alone. Drop the
failures that don't hold up
- If nothing fails, report the scope and the clean result, then stop
- Report as in "Reporting". Don't fix anything unless the arguments or a
follow-up ask for it
Scoping the population
The audit is only as good as the enumeration. Bound it along whichever of these
fit:
- Files or directories matching a pattern
- Every member of a declared set: exports, routes, endpoints, migrations,
dependencies, config keys, feature flags, permissions, tables
- Every call site of a function or use of a symbol
- Every entry in a log, changelog, or history over a stated time range
- Every requirement in a spec, checklist, or standard, mapped to where it's
satisfied
When the population is too large to check in full, say so and either narrow the
scope with the user or state the sampling rule and its limits in the report.
Never truncate silently.
These aren't exhaustive. Reason from first principles when none fits cleanly.
Reporting
Open with the scope: what was audited, against what standard, how many items,
and how many were checked. Then the findings, ordered by severity, each with:
- The item, by path and line or by identifier
- What the standard requires and what the item does instead
- The evidence: the command run, the output, or the lines read
- The fix, concretely
Mark each finding as confirmed or suspected. Close with what was not checked and
why, and with how much you trust the enumeration.
1---2name: audit3description: |4 Audit something against a standard, check every item in scope, and report the5 findings and the coverage behind them.6argument-hint: '<what to audit, and against what standard>'7---89Audit the given subject against a standard, check every item in scope, and10report the findings. Report, don't fix.1112# Target1314```!15jj show --git16```1718Arguments: $ARGUMENTS1920Audit the subject named in the arguments if given. Otherwise audit the changes21in the current commit shown above. If there are no arguments and the commit has22no changes, ask the user what to audit and stop.2324# Principles2526- An audit is a completeness claim, not a sampling. A review says "here is what27 I noticed"; an audit says "I checked all of these, and here is what failed"28- The standard comes before the findings. Decide what counts as a failure before29 looking, so the findings aren't rationalized after the fact30- Unchecked items are a finding of their own. Disclose every gap in coverage31- A clean audit is a real outcome. Don't manufacture findings to justify the32 effort3334# Workflow35361. State the standard: what property must hold for every item in scope? Derive37 it from the arguments, the project's conventions, or the relevant docs and38 spec. If the arguments name a subject but no standard, propose one in a39 sentence and continue with it, saying in the report that you chose it402. Enumerate the population: list every item in scope by mechanical means (`rg`,41 a file glob, a manifest, a schema), not from memory. Record the count. See42 "Scoping the population"433. Write the check: the question asked of one item, and the evidence that44 answers it. Run it against one item you expect to pass and one you expect to45 fail, to confirm it tells them apart464. Apply the check to every enumerated item. Record each as pass, fail, or not47 checked with the reason485. Verify each failure before reporting it: re-read the item, and prefer running49 something (a test, a command, a query) over reasoning alone. Drop the50 failures that don't hold up516. If nothing fails, report the scope and the clean result, then stop527. Report as in "Reporting". Don't fix anything unless the arguments or a53 follow-up ask for it5455# Scoping the population5657The audit is only as good as the enumeration. Bound it along whichever of these58fit:5960- Files or directories matching a pattern61- Every member of a declared set: exports, routes, endpoints, migrations,62 dependencies, config keys, feature flags, permissions, tables63- Every call site of a function or use of a symbol64- Every entry in a log, changelog, or history over a stated time range65- Every requirement in a spec, checklist, or standard, mapped to where it's66 satisfied6768When the population is too large to check in full, say so and either narrow the69scope with the user or state the sampling rule and its limits in the report.70Never truncate silently.7172These aren't exhaustive. Reason from first principles when none fits cleanly.7374# Reporting7576Open with the scope: what was audited, against what standard, how many items,77and how many were checked. Then the findings, ordered by severity, each with:7879- The item, by path and line or by identifier80- What the standard requires and what the item does instead81- The evidence: the command run, the output, or the lines read82- The fix, concretely8384Mark each finding as confirmed or suspected. Close with what was not checked and85why, and with how much you trust the enumeration.