复核重点(自己做完再对照一遍):Is the sweep exact on a hand-built pair of trees: every case placed in the earlier build at a removed path is reported as stale (violation), every case at a modified path whose definition data differ in a field not listed in ignore_fields is reported as changed (advisory), behaviour-only changes are not maintenance items, a clean build gives an empty result that says so? Are the differences listed field by field with both values, so the owner can see why?
规格
PACKAGE maintenance-sweep - capability 4b (maintenance sweep), a production-run workflow pack: fact producers only.
Read first: contracts/src/pack.ts and views.ts (impact-view@1), packs/workflow/template-gap and case-location, packs/workflow/case-review (formats), hub/runs/packs, hub/runs/engine/README.md (production runs), brief sections 6a and 6b, model K01 R[1] and C05.
Semantics (write them first as tests): the input slot impact as in regression-scope (the caller binds knowledge:impact::.. with the attached kind case). Items are the cases of the EARLIER build that need maintenance in the later build: (1) command removed: the case is placed (earlier build) at a path whose change is removed: requirement command_exists, a violation with code case.command_removed (blocking tier, fix: 'rewrite the case for the replacement command or retire it'); (2) command changed: the case is placed at a path whose change is modified and the definition entries differ: requirement command_unchanged, advisory violation with code case.command_changed whose data lists the differing fields of the definition data (a generic structural diff of the JSON data of the before and after entries, path by path with both values; fields named in the parameter ignore_fields, default none, are skipped); a change only in entries of kind behaviour (documentation text) is NOT a maintenance item; (3) added paths are no maintenance item. A case that is placed at several paths is one item with every reason. Unknown: nothing is claimed about cases the index does not hold (state this in the run-level note of the result, and when the view states skipped sources (skipped.from above zero) say that the earlier build's index lacks that many listed documents, so a clean result is not proof that no case is stale). id/label/summary/fields as in regression-scope (reasons carry code, path, change and the differing fields). A build pair with no maintenance item gives an empty result that says so. Deterministic and order independent.
Deliver the pack under packs/workflow/maintenance-sweep with the same file set as regression-scope (SKILL.md explains how to read the result and which codes are blocking), samples for both codes and a clean case, examples. Tests: hand-built impact views (removed path with two cases, modified signature, modified help text only, behaviour-only change, both reasons on one case, ignore_fields, clean pair, 5,000 cases), order independence, the publish check through the real registry, a production run end to end with a fake knowledge reader.