Merge pull request #332 from ZebangCheng/fix/phase7-preserve-scan-result

fix(skill): preserve scan-result.json across Phase 7 cleanup for incremental runs (#293)
This commit is contained in:
Yuxiang Lin
2026-06-01 17:53:12 +08:00
committed by GitHub
Unverified
@@ -770,9 +770,16 @@ Report to the user: `[Phase 7/7] Saving knowledge graph...`
}
```
4. Clean up intermediate files:
4. Clean up intermediate files, **preserving `scan-result.json`** so future incremental runs can skip Phase 1 SCAN (see issue #293):
```bash
rm -rf $PROJECT_ROOT/.understand-anything/intermediate
# Preserve scan-result.json — Phase 1's deterministic file inventory.
# Future incremental runs (Phase 2 compute-batches.mjs --changed-files=…)
# need this inventory; without it, Phase 1 must re-dispatch and pay ~157k
# tokens / ~158s per incremental run.
INTER="$PROJECT_ROOT/.understand-anything/intermediate"
if [ -d "$INTER" ]; then
find "$INTER" -mindepth 1 -maxdepth 1 -not -name 'scan-result.json' -exec rm -rf {} +
fi
rm -rf $PROJECT_ROOT/.understand-anything/tmp
```