Review round 1: fix stop-condition ordering bug and directive inconsistencies
Adversarial review of the build found two defects that would have mattered in a
real run:
- Round reports were sorted lexicographically, so with rounds 9, 10 and 11 on
disk the two-quiet-rounds gate read rounds 11 and 9 as the latest pair. That
is the check that decides when the loop stops. Now ordered numerically, with a
self-test case covering it.
- validate.mjs crashed with a Node stack trace on a missing flag value or a
directory path. Both now report and exit 3 or 2.
Directive fixes:
- Directive 01 told the agent to mark items `needs-second-pass`, a status the
schema does not have, so the record would have been rejected. Single-pass
items now simply stay candidates.
- Clarified that `leaky` is a field to set, not a status.
- Added a Paths section to directives 01 and 02: the `../` links resolve on
GitHub but are not write paths, and the agent works from the project root.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>