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: Audit something against a standard, check every item in scope, and report the findings and the coverage behind them.4---56Audit the given subject against a standard, check every item in scope, and7report the findings. Report, don't fix.89# Target1011```!12jj show --git13```1415Arguments: $ARGUMENTS1617Audit the subject named in the arguments if given. Otherwise audit the changes18in the current commit shown above. If there are no arguments and the commit has19no changes, ask the user what to audit and stop.2021# Principles2223- An audit is a completeness claim, not a sampling. A review says "here is what24 I noticed"; an audit says "I checked all of these, and here is what failed"25- The standard comes before the findings. Decide what counts as a failure before26 looking, so the findings aren't rationalized after the fact27- Unchecked items are a finding of their own. Disclose every gap in coverage28- A clean audit is a real outcome. Don't manufacture findings to justify the29 effort3031# Workflow32331. State the standard: what property must hold for every item in scope? Derive34 it from the arguments, the project's conventions, or the relevant docs and35 spec. If the arguments name a subject but no standard, propose one in a36 sentence and continue with it, saying in the report that you chose it372. Enumerate the population: list every item in scope by mechanical means (`rg`,38 a file glob, a manifest, a schema), not from memory. Record the count. See39 "Scoping the population"403. Write the check: the question asked of one item, and the evidence that41 answers it. Run it against one item you expect to pass and one you expect to42 fail, to confirm it tells them apart434. Apply the check to every enumerated item. Record each as pass, fail, or not44 checked with the reason455. Verify each failure before reporting it: re-read the item, and prefer running46 something (a test, a command, a query) over reasoning alone. Drop the47 failures that don't hold up486. If nothing fails, report the scope and the clean result, then stop497. Report as in "Reporting". Don't fix anything unless the arguments or a50 follow-up ask for it5152# Scoping the population5354The audit is only as good as the enumeration. Bound it along whichever of these55fit:5657- Files or directories matching a pattern58- Every member of a declared set: exports, routes, endpoints, migrations,59 dependencies, config keys, feature flags, permissions, tables60- Every call site of a function or use of a symbol61- Every entry in a log, changelog, or history over a stated time range62- Every requirement in a spec, checklist, or standard, mapped to where it's63 satisfied6465When the population is too large to check in full, say so and either narrow the66scope with the user or state the sampling rule and its limits in the report.67Never truncate silently.6869These aren't exhaustive. Reason from first principles when none fits cleanly.7071# Reporting7273Open with the scope: what was audited, against what standard, how many items,74and how many were checked. Then the findings, ordered by severity, each with:7576- The item, by path and line or by identifier77- What the standard requires and what the item does instead78- The evidence: the command run, the output, or the lines read79- The fix, concretely8081Mark each finding as confirmed or suspected. Close with what was not checked and82why, and with how much you trust the enumeration.