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 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/workflow-state/data/current/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>), and opt-in criteria: individual compression checks (compression/core-claim-obscured,compression/branch-bloat,compression/detail-overhang,compression/marginal-value-redundancy; barecompressionis refused) and the report criteria (critique,friction,premises,compression-synthesis,role). Without--criteria, a review covers every bundle plustypeandcollection; opt-in criteria are never included unless named.compression-synthesisandrolerun alone on one note with unassessed freshness (statusrefuses them; read output withshow RUN). - Profile — optional; a worker profile from the library's
instructions/worker-profiles.yaml. Without--profilethe review workflow'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 and commonplace-review both cover 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. Under--grouping bundle, a pair with rejected findings is asked alone outside its bundle call, and everytype,collection, compression and report pair is one call each under either grouping. -
Run the sweep:
bash
commonplace-review {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).
This command spawns the configured headless worker CLI, which needs outbound model-API network access and writable harness state outside the workspace. If your runtime runs shell commands in a sandbox that blocks network access or writes outside the workspace, run the sweep outside that sandbox (requesting sandbox bypass or escalated execution up front) rather than probing inside the sandbox first; keep local-only commands (status, show, retry, acknowledge) in the default sandbox.
-
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, 1 otherwise, and 2 when the command itself failed. The guard does not change the exit code, so readguardin the report every time. Handle each case: -
freshorreviewed— the pair has a current result;outcomeispass,warnorfail, orreportfor report criteria. 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. A pair'sjobname is<note>::<criterion-id>; a bundle call's is<note>::<bundle>/*.out-of-attempts— three attempts produced no acceptable review: each ended without a valid result line or returned no answer.problemholds the last rejection. Correction also stops early on no progress before repeating an already rejected prompt/input combination; inspect the diagnostics rather than spending calls on identical feedback (an explicit answer dismissal remains available when another attempt is warranted). 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, a controller failure occurred (missing validation dependencies or corrupt evidence — repair the controller or its inputs before retrying; incomplete captures are not silently backfilled on resume), or the harness reported a usage limit. Results already written stay. Repair the cause 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 and children have 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. Only fixture trials fail on a dirty guard. -
Verify. Rerun step 1. No rows means every selected pair is fresh.
Rules
- A rerun without
--resumeopens a new run directory underkb/workflow-state/data/current/review/runs/, even when nothing is stale. - One process at a time may hold a run; a second exits 2.
--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 command catalogue entry; run
commonplace-review --helpfor full options