Run review batches
Type: types/instruction.md
Review chosen notes against chosen criteria so that every selected (note, criterion) pair has a fresh result file. commonplace-review run gates launches the reviewer workers, checks each review and writes the results; the agent running this procedure chooses the scope, runs the command and settles what the report hands back. Do not launch reviewer sub-agents yourself, and do not review the pairs in your own context.
A result is fresh while the hashes it records still match the note's watched parts (title, description or body, as the criterion's watches: declares; the whole note when it declares none) and the criterion's text. Results live under kb/reports/state/review/results/<note-path>/<criterion-id>.md.
Inputs
- Notes — files or directories. A directory means its reviewable notes, not recursively; it skips indexes, collection contracts and type specs. Name files in a validation-ignored directory one by one.
- Criteria — catalog gate ids (
prose/source-residue), bundle names (prose), the lensestypeandcollection(ortype/<name>,collection/<path>), andcritique, the one report criterion.--all-gatesmeans every bundle plustypeandcollection;critiqueis never included unless named. - Profile — optional; a worker profile from the library's
instructions/review-profiles.yaml. Without--profilethe file'sdefaultis used.
Steps
- Check what the sweep would ask. This launches nothing:
bash
commonplace-review status {notes...} --criteria {criteria...} --stale
Each row is a pair that is missing or stale (with note, criterion or both changed). If there are none, stop: every pair is fresh. Without --criteria, status covers all gates; run gates requires the criteria to be named or --all-gates.
-
Choose the grouping. A launch's fixed context dominates its cost. For several catalog gates on each note, add
--grouping bundle: one worker per note and bundle asks that bundle's stale gates together, and each gate still gets its own result file. Keep the default--grouping pairfor one or two gates per note, or when each gate must be judged in a separate context. Thetype,collectionandcritiquepairs are one call each under either grouping. -
Run the sweep:
bash
commonplace-review run gates {notes...} --criteria {criteria...} [--grouping bundle] [--profile NAME]
It asks only pairs without a fresh result. --force asks fresh pairs too; use it only when the user asks for a new judgment of fresh pairs. --max-workers N bounds concurrent workers (default 4).
-
Read the JSON report. It names
run-dir, givescountsby pair state,stopped,guardand one entry per pair withstate,outcomeandproblem. The exit code is 0 only when every pair has a current result and the guard is clean, 1 otherwise, and 2 when the command itself failed. Handle each case: -
freshorreviewed— the pair has a current result;outcomeispass,warnorfail, orreportfor critique. problem— the worker reported that it could not judge the pair;problemholds its reason. Fix the cause if it is in the note or the environment. Then either run the sweep again, which opens a new run, or dismiss the problem withcommonplace-review retry {run-dir} {job}and continue the same run with--resume {run-dir}. A resumed run replays a problem that was not dismissed. The job name is the pair'sjobfield (<note>::<criterion-id>).out-of-attempts— three attempts produced no acceptable review: each ended without a valid result line or returned no answer.problemholds the last rejection. Run the sweep again; if the same pair fails again, report it with the rejection text.stoppedis set, pairsnot-run— a launch failed for a reason outside the task, or the harness reported a usage limit. Results already written stay. Repair the environment or wait for the limit to reset, then rerun with--resume {run-dir}and the same notes and criteria. If the resumed run reports a launch that an earlier controller left unsettled, confirm that its process has exited, then runcommonplace-review acknowledge {run-dir} {launch}.-
guard.changedis non-empty — these checkout paths changed while the run was open. Other sessions' edits show up too, so inspect each path and decide whether a worker wrote it; nothing is reverted for you. A worker must write only its output file under the run directory. -
Verify. Rerun step 1. No rows means every selected pair is fresh.
Rules
- A rerun without
--resumeopens a new run directory underkb/reports/state/review/runs/, even when nothing is stale. --resumereplays every call whose work is unchanged. Give the same notes and criteria, and either no--profileor the one the run was opened with.retry {run-dir} {job} --key {key}dismisses one recorded answer instead of the problems. The answer's result file already makes the pair fresh, so the rerun needs--force.- Editing a criterion stales every pair that names it, even when the edit only rewords it: its hash changes. Collect related edits to one gate before sweeping, and sweep its pairs once afterwards.
- Do not edit or move result files to make a pair fresh. Delete an orphaned result, one whose note or criterion is gone, as an ordinary file;
commonplace-review statuslists them apart.
Verify
commonplace-review status {notes...} --criteria {criteria...} --staleprints no rows.- The report's
guard.cleanis true, or every path it named has been inspected and explained.
Relevant Notes:
- Review system — operates-on: the result files, freshness rules and command surface this procedure drives
- Commands — operates-on: the full
commonplace-reviewoption reference