From 928b997c57069c78e191be0bc0aacb3b182529b0 Mon Sep 17 00:00:00 2001 From: Zebang Cheng Date: Fri, 29 May 2026 15:33:31 +0000 Subject: [PATCH] fix(skill): preserve scan-result.json across Phase 7 cleanup for incremental runs (#293) --- understand-anything-plugin/skills/understand/SKILL.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/understand-anything-plugin/skills/understand/SKILL.md b/understand-anything-plugin/skills/understand/SKILL.md index b66dcc2..610a9dd 100644 --- a/understand-anything-plugin/skills/understand/SKILL.md +++ b/understand-anything-plugin/skills/understand/SKILL.md @@ -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 ```