ce-code-review: send deleted files as a deletion manifest instead of full preimages, and stop them from forcing the full spine
Problem
ce-code-review handles deleted files as if they were added code. In a dead-code pruning PR this sends the review down the full path. Every persona then reads the body of every deleted file, and none of the findings come from those bodies.
The review does need to know what is being deleted. A pruning change is correct only if each deleted file was dead, and its usual defects are orphans left behind in the files that survive. Neither question needs nine reviewers to read the deleted source.
Observed behavior (v3.27.0; review-scope.py and references/scope.md are unchanged in v3.30.3)
-
review-scope.pyadds deleted lines toexec_nontest_lines(total = int(added) + int(deleted)), so a pruning PR reachesFULL_EXEC_LINE_MIN = 200andsize_band: largeon deletions alone. That is a floor: the gate cannot choose lite or focused. -
The shared diff is
git diff -U10 $BASE, which includes the full preimage of each deleted file. Every persona receives it. -
Two rounds on a private React Native repo:
PR Lines Deleted files full.diffAgents Findings Dead-code pruning +495 / −5193 74 (46% of diff bytes) 312 KB 9 (5 personas + merge, validator, report) 7 Payment-path pruning +1510 / −3869 38 372 KB 9 (6 personas + 3 leaves) 4 -
None of the 11 findings is on a deleted file. All of them are orphans in surviving files: unused locals and props, styles, feature flags and assets with no reader left.
-
Mid-tier personas read the staged diff in chunks:
maintainabilityused 5–10Readcalls andproject-standards4–5 per round. One session spent 46 diff reads on a single round. -
Dropping the deleted-file bodies alone shrinks the first diff from 312 KB to 183 KB.
Expected behavior
- Deletion is a first-class signal, not a line count. The scope helper reports deleted files separately (for example
deleted_filesanddeleted_lines). Every reviewer receives a deletion manifest: each deleted path with what it exported, and whether it has import-time side effects (registrations, config plugins, top-level calls). - Bodies stay out of the shared diff. Build the shared diff with
git diff -U10 --irreversible-delete $BASE. Git keeps thedeleted file modeheader and the path, and omits the preimage. Personas that need a body read it on demand withgit show <base>:<path>, whichdispatch-reviewers.mdalready allows. - Correctness and adversarial ask whether each deleted file was dead. That means checking what static imports miss: references by string (assets, config plugins), routes resolved from file names (for example expo-router, Next.js), import-time registration, and deleted tests whose subject still ships. Other personas look for orphans in the surviving files.
- Deleted files alone do not force the full spine. Whole-file deletions count toward a separate band. That band can move a change from lite to focused, but it is not a floor for full. Modified lines in files that survive keep counting as they do today.
Acceptance criteria
- A PR whose changed lines are mostly whole-file deletions, with fewer than 200 executable added or modified lines, takes focused rather than full.
- The shared diff carries no preimage for deleted files, and every reviewer prompt includes the deletion manifest.
- A deleted file that is still referenced by string or by file-based routing produces a correctness or adversarial finding. Add a regression fixture for this.
- On a fixture with about 70 deleted files, the run makes fewer than half the diff
Readcalls it makes today.
Triage: leaving open — valid review-scope / diff-cost bug.
On current main, skills/ce-code-review/scripts/review-scope.py still counts added + deleted into exec_nontest_lines, so a deletion-heavy prune PR can hit FULL_EXEC_LINE_MIN and force the full spine on deleted volume alone. The shared git diff -U10 preimage then gets inlined for every persona.
Worth fixing at the scope + shared-diff layer (deletion manifest / exclude full preimages from persona payloads; stop deletions from dominating the size band). No community PR yet.