Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions graphify/skills/agents/references/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ new_total = result.get('new_total', 0)
print(json.dumps(result, indent=2, ensure_ascii=False))
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
deleted = list(result.get('deleted_files', []))
if new_total == 0 and not deleted:
# Newly ignored/excluded files are stale in exactly the same way as deleted ones
# (#2773). They must count here too, or adding a .graphifyignore rule with nothing
# else changed exits 'Nothing to update' and never reaches the prune below.
excluded = list(result.get('excluded_files', []))
if new_total == 0 and not deleted and not excluded:
print('No files changed since last run. Nothing to update.')
raise SystemExit(0)
if deleted:
print(f'{len(deleted)} deleted file(s) to prune.')
if excluded:
print(f'{len(excluded)} newly excluded file(s) to prune.')
if new_total > 0:
print(f'{new_total} new/changed file(s) to re-extract.')
"
Expand Down Expand Up @@ -66,11 +72,11 @@ If `code_only` is True: print `[graphify update] Code-only changes detected - sk
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.


If no new files exist (only deletions), create an empty extraction so the merge step can prune:
If no new files exist (only deletions or newly excluded files), create an empty extraction so the merge step can prune:

```bash
if [ ! -f graphify-out/.graphify_extract.json ]; then
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
echo '[graphify update] Nothing to re-extract -- creating empty extraction so the merge can prune.'
$(cat graphify-out/.graphify_python) -c "
import json
from pathlib import Path
Expand All @@ -93,13 +99,21 @@ from graphify.detect import save_manifest
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
deleted = list(incremental.get('deleted_files', []))
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
# Files that left the corpus because an ignore rule or --exclude changed. These are
# NOT deletions — detect_incremental splits them out precisely so they are not
# reported as such (#1908) — but their nodes are just as stale, and graphify's own
# library path prunes both (cli.py: `list(excluded_files) + graph_stale_sources`).
# Without this an added .graphifyignore rule never removes what it excluded, and the
# leak is permanent: save_manifest below drops the excluded row, so on the next run
# the file is neither deleted nor excluded and nothing can prune it again (#2773).
excluded = list(incremental.get('excluded_files', []))
# prune_sources is for genuinely DELETED and newly EXCLUDED files. Changed/re-extracted
# files are handled by build_merge's replace-on-re-extract (#1344): every source_file in
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
# Do NOT add `changed` here: with root= passed, prune_set relativizes to the same base
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
# now that replace — not the dedup pass — reconciles changed files).
prune = list(deleted) or None
prune = (list(deleted) + excluded) or None

# Use build_merge() — reads graph.json directly without NetworkX round-trip
# so edge direction (calls, implements, imports) is always preserved (#801).
Expand Down
26 changes: 20 additions & 6 deletions graphify/skills/amp/references/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ new_total = result.get('new_total', 0)
print(json.dumps(result, indent=2, ensure_ascii=False))
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
deleted = list(result.get('deleted_files', []))
if new_total == 0 and not deleted:
# Newly ignored/excluded files are stale in exactly the same way as deleted ones
# (#2773). They must count here too, or adding a .graphifyignore rule with nothing
# else changed exits 'Nothing to update' and never reaches the prune below.
excluded = list(result.get('excluded_files', []))
if new_total == 0 and not deleted and not excluded:
print('No files changed since last run. Nothing to update.')
raise SystemExit(0)
if deleted:
print(f'{len(deleted)} deleted file(s) to prune.')
if excluded:
print(f'{len(excluded)} newly excluded file(s) to prune.')
if new_total > 0:
print(f'{new_total} new/changed file(s) to re-extract.')
"
Expand Down Expand Up @@ -66,11 +72,11 @@ If `code_only` is True: print `[graphify update] Code-only changes detected - sk
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.


If no new files exist (only deletions), create an empty extraction so the merge step can prune:
If no new files exist (only deletions or newly excluded files), create an empty extraction so the merge step can prune:

```bash
if [ ! -f graphify-out/.graphify_extract.json ]; then
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
echo '[graphify update] Nothing to re-extract -- creating empty extraction so the merge can prune.'
$(cat graphify-out/.graphify_python) -c "
import json
from pathlib import Path
Expand All @@ -93,13 +99,21 @@ from graphify.detect import save_manifest
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
deleted = list(incremental.get('deleted_files', []))
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
# Files that left the corpus because an ignore rule or --exclude changed. These are
# NOT deletions — detect_incremental splits them out precisely so they are not
# reported as such (#1908) — but their nodes are just as stale, and graphify's own
# library path prunes both (cli.py: `list(excluded_files) + graph_stale_sources`).
# Without this an added .graphifyignore rule never removes what it excluded, and the
# leak is permanent: save_manifest below drops the excluded row, so on the next run
# the file is neither deleted nor excluded and nothing can prune it again (#2773).
excluded = list(incremental.get('excluded_files', []))
# prune_sources is for genuinely DELETED and newly EXCLUDED files. Changed/re-extracted
# files are handled by build_merge's replace-on-re-extract (#1344): every source_file in
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
# Do NOT add `changed` here: with root= passed, prune_set relativizes to the same base
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
# now that replace — not the dedup pass — reconciles changed files).
prune = list(deleted) or None
prune = (list(deleted) + excluded) or None

# Use build_merge() — reads graph.json directly without NetworkX round-trip
# so edge direction (calls, implements, imports) is always preserved (#801).
Expand Down
26 changes: 20 additions & 6 deletions graphify/skills/claude/references/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ new_total = result.get('new_total', 0)
print(json.dumps(result, indent=2, ensure_ascii=False))
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
deleted = list(result.get('deleted_files', []))
if new_total == 0 and not deleted:
# Newly ignored/excluded files are stale in exactly the same way as deleted ones
# (#2773). They must count here too, or adding a .graphifyignore rule with nothing
# else changed exits 'Nothing to update' and never reaches the prune below.
excluded = list(result.get('excluded_files', []))
if new_total == 0 and not deleted and not excluded:
print('No files changed since last run. Nothing to update.')
raise SystemExit(0)
if deleted:
print(f'{len(deleted)} deleted file(s) to prune.')
if excluded:
print(f'{len(excluded)} newly excluded file(s) to prune.')
if new_total > 0:
print(f'{new_total} new/changed file(s) to re-extract.')
"
Expand Down Expand Up @@ -66,11 +72,11 @@ If `code_only` is True: print `[graphify update] Code-only changes detected - sk
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.


If no new files exist (only deletions), create an empty extraction so the merge step can prune:
If no new files exist (only deletions or newly excluded files), create an empty extraction so the merge step can prune:

```bash
if [ ! -f graphify-out/.graphify_extract.json ]; then
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
echo '[graphify update] Nothing to re-extract -- creating empty extraction so the merge can prune.'
$(cat graphify-out/.graphify_python) -c "
import json
from pathlib import Path
Expand All @@ -93,13 +99,21 @@ from graphify.detect import save_manifest
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
deleted = list(incremental.get('deleted_files', []))
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
# Files that left the corpus because an ignore rule or --exclude changed. These are
# NOT deletions — detect_incremental splits them out precisely so they are not
# reported as such (#1908) — but their nodes are just as stale, and graphify's own
# library path prunes both (cli.py: `list(excluded_files) + graph_stale_sources`).
# Without this an added .graphifyignore rule never removes what it excluded, and the
# leak is permanent: save_manifest below drops the excluded row, so on the next run
# the file is neither deleted nor excluded and nothing can prune it again (#2773).
excluded = list(incremental.get('excluded_files', []))
# prune_sources is for genuinely DELETED and newly EXCLUDED files. Changed/re-extracted
# files are handled by build_merge's replace-on-re-extract (#1344): every source_file in
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
# Do NOT add `changed` here: with root= passed, prune_set relativizes to the same base
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
# now that replace — not the dedup pass — reconciles changed files).
prune = list(deleted) or None
prune = (list(deleted) + excluded) or None

# Use build_merge() — reads graph.json directly without NetworkX round-trip
# so edge direction (calls, implements, imports) is always preserved (#801).
Expand Down
26 changes: 20 additions & 6 deletions graphify/skills/claw/references/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ new_total = result.get('new_total', 0)
print(json.dumps(result, indent=2, ensure_ascii=False))
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
deleted = list(result.get('deleted_files', []))
if new_total == 0 and not deleted:
# Newly ignored/excluded files are stale in exactly the same way as deleted ones
# (#2773). They must count here too, or adding a .graphifyignore rule with nothing
# else changed exits 'Nothing to update' and never reaches the prune below.
excluded = list(result.get('excluded_files', []))
if new_total == 0 and not deleted and not excluded:
print('No files changed since last run. Nothing to update.')
raise SystemExit(0)
if deleted:
print(f'{len(deleted)} deleted file(s) to prune.')
if excluded:
print(f'{len(excluded)} newly excluded file(s) to prune.')
if new_total > 0:
print(f'{new_total} new/changed file(s) to re-extract.')
"
Expand Down Expand Up @@ -66,11 +72,11 @@ If `code_only` is True: print `[graphify update] Code-only changes detected - sk
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.


If no new files exist (only deletions), create an empty extraction so the merge step can prune:
If no new files exist (only deletions or newly excluded files), create an empty extraction so the merge step can prune:

```bash
if [ ! -f graphify-out/.graphify_extract.json ]; then
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
echo '[graphify update] Nothing to re-extract -- creating empty extraction so the merge can prune.'
$(cat graphify-out/.graphify_python) -c "
import json
from pathlib import Path
Expand All @@ -93,13 +99,21 @@ from graphify.detect import save_manifest
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
deleted = list(incremental.get('deleted_files', []))
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
# Files that left the corpus because an ignore rule or --exclude changed. These are
# NOT deletions — detect_incremental splits them out precisely so they are not
# reported as such (#1908) — but their nodes are just as stale, and graphify's own
# library path prunes both (cli.py: `list(excluded_files) + graph_stale_sources`).
# Without this an added .graphifyignore rule never removes what it excluded, and the
# leak is permanent: save_manifest below drops the excluded row, so on the next run
# the file is neither deleted nor excluded and nothing can prune it again (#2773).
excluded = list(incremental.get('excluded_files', []))
# prune_sources is for genuinely DELETED and newly EXCLUDED files. Changed/re-extracted
# files are handled by build_merge's replace-on-re-extract (#1344): every source_file in
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
# Do NOT add `changed` here: with root= passed, prune_set relativizes to the same base
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
# now that replace — not the dedup pass — reconciles changed files).
prune = list(deleted) or None
prune = (list(deleted) + excluded) or None

# Use build_merge() — reads graph.json directly without NetworkX round-trip
# so edge direction (calls, implements, imports) is always preserved (#801).
Expand Down
26 changes: 20 additions & 6 deletions graphify/skills/codex/references/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ new_total = result.get('new_total', 0)
print(json.dumps(result, indent=2, ensure_ascii=False))
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
deleted = list(result.get('deleted_files', []))
if new_total == 0 and not deleted:
# Newly ignored/excluded files are stale in exactly the same way as deleted ones
# (#2773). They must count here too, or adding a .graphifyignore rule with nothing
# else changed exits 'Nothing to update' and never reaches the prune below.
excluded = list(result.get('excluded_files', []))
if new_total == 0 and not deleted and not excluded:
print('No files changed since last run. Nothing to update.')
raise SystemExit(0)
if deleted:
print(f'{len(deleted)} deleted file(s) to prune.')
if excluded:
print(f'{len(excluded)} newly excluded file(s) to prune.')
if new_total > 0:
print(f'{new_total} new/changed file(s) to re-extract.')
"
Expand Down Expand Up @@ -66,11 +72,11 @@ If `code_only` is True: print `[graphify update] Code-only changes detected - sk
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.


If no new files exist (only deletions), create an empty extraction so the merge step can prune:
If no new files exist (only deletions or newly excluded files), create an empty extraction so the merge step can prune:

```bash
if [ ! -f graphify-out/.graphify_extract.json ]; then
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
echo '[graphify update] Nothing to re-extract -- creating empty extraction so the merge can prune.'
$(cat graphify-out/.graphify_python) -c "
import json
from pathlib import Path
Expand All @@ -93,13 +99,21 @@ from graphify.detect import save_manifest
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
deleted = list(incremental.get('deleted_files', []))
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
# Files that left the corpus because an ignore rule or --exclude changed. These are
# NOT deletions — detect_incremental splits them out precisely so they are not
# reported as such (#1908) — but their nodes are just as stale, and graphify's own
# library path prunes both (cli.py: `list(excluded_files) + graph_stale_sources`).
# Without this an added .graphifyignore rule never removes what it excluded, and the
# leak is permanent: save_manifest below drops the excluded row, so on the next run
# the file is neither deleted nor excluded and nothing can prune it again (#2773).
excluded = list(incremental.get('excluded_files', []))
# prune_sources is for genuinely DELETED and newly EXCLUDED files. Changed/re-extracted
# files are handled by build_merge's replace-on-re-extract (#1344): every source_file in
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
# Do NOT add `changed` here: with root= passed, prune_set relativizes to the same base
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
# now that replace — not the dedup pass — reconciles changed files).
prune = list(deleted) or None
prune = (list(deleted) + excluded) or None

# Use build_merge() — reads graph.json directly without NetworkX round-trip
# so edge direction (calls, implements, imports) is always preserved (#801).
Expand Down
Loading
Loading