feat(understand): add review-only path and clarifying prompt for up-to-date graphs

- --review at same commit hash skips to Phase 6, reuses existing graph
- Same commit hash without flags now asks user what they'd like to do
  instead of silently stopping

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lum1104
2026-03-28 11:45:29 +08:00
Unverified
parent 9ec77df3ac
commit 867293ebab
@@ -39,9 +39,12 @@ Determine whether to run a full analysis or incremental update.
|---|---|
| `--full` flag in `$ARGUMENTS` | Full analysis (all phases) |
| No existing graph or meta | Full analysis (all phases) |
| Existing graph + unchanged commit hash | Report "Graph is up to date" and STOP |
| `--review` flag + existing graph + unchanged commit hash | Skip to Phase 6 (review-only — reuse existing assembled graph) |
| Existing graph + unchanged commit hash | Ask the user: "The graph is up to date at this commit. Would you like to: **(a)** run a full rebuild (`--full`), **(b)** run the LLM graph reviewer (`--review`), or **(c)** do nothing?" Then follow their choice. If they pick (c), STOP. |
| Existing graph + changed files | Incremental update (re-analyze changed files only) |
**Review-only path:** Copy the existing `knowledge-graph.json` to `$PROJECT_ROOT/.understand-anything/intermediate/assembled-graph.json`, then jump directly to Phase 6 step 3.
For incremental updates, get the changed file list:
```bash
git diff <lastCommitHash>..HEAD --name-only