Claude d2eaddd423
code-modernization: shard extract-rules by module and document workflow resume
extract-rules.js gains a module mode: when the caller passes `modules`
(built from the map stage's topology.json, or from the directory tree),
it runs one focused extractor per module in ordered batches, refereeing
each batch's fresh rules before the next batch starts, instead of
pointing three whole-estate lens agents at legacy/<system> every round.
Batches are ordered parallel() barriers so agent spawn order is a pure
function of the args and prior results, which keeps resumeFromRunId
replays cache-hitting. Lens mode is unchanged for callers without a
module list (identical prompts and return fields).

The script now guards the runtime's per-run agent cap and the token
budget before every fan-out and degrades to a partial catalog with named
gaps (skippedModules, failedModules, unverifiedRules, skippedPhases,
re-passable rerunModules) instead of failing with no result; referee-less
rules are returned rather than dropped, and a wrong-citation redirect can
no longer confirm the same rule twice.

The command doc now builds the module list from topology.json (inline
script), sizes the run honestly, records the Run ID, and spells out the
interrupted-run path: resume a stopped/failed run with resumeFromRunId,
follow up a completed-with-failures run with just the affected shards,
and read journal.jsonl before declaring anything lost.
2026-09-03 01:26:52 +00:00
..