Skip to content

Closes #539: clarify --update prune message (split drift vs no-drift)#544

Open
saxster wants to merge 1 commit intosafishamsi:v5from
saxster:fix/539-prune-message-denominator
Open

Closes #539: clarify --update prune message (split drift vs no-drift)#544
saxster wants to merge 1 commit intosafishamsi:v5from
saxster:fix/539-prune-message-denominator

Conversation

@saxster
Copy link
Copy Markdown

@saxster saxster commented Apr 25, 2026

Closes #539.

Summary

Splits the ambiguous Pruned 0 ghost nodes from 13 deleted file(s) message into two unambiguous variants:

  • Drift case (something to prune): Pruned N ghost node(s) from M deleted file(s) — drift detected and corrected.
  • No-drift case (deleted files were already absent): M file(s) deleted since last run, but no ghost nodes were present in the graph — no drift.

Why

The current message reads Pruned 0 ghost nodes from 13 deleted file(s). A reader can't tell whether:

  • (a) 13 files were detected as deleted and 0 of them had nodes worth pruning (benign — graph already clean), or
  • (b) 13 ghost nodes still exist and only 0 got pruned (bug).

The two interpretations have very different operational implications. Splitting the cases removes the ambiguity.

Files changed

  • graphify/skill.md (line 918) — primary skill template
  • graphify/skill-copilot.md (line 821) — Copilot variant carries the same merge step verbatim

The other 9 skill-*.md files don't include the --update merge step inline (they reference it via the canonical skill.md).

Test plan

  • Manual: trigger --update after a deletion (drift) — verify drift message
  • Manual: trigger --update after deleting a file with no graph nodes — verify no-drift message
  • No code changes; pure skill-prompt edit — no test suite impact

Closes safishamsi#539.

The current prune message in the --update flow is ambiguous:

    Pruned 0 ghost nodes from 13 deleted file(s)

A reader can't tell whether (a) 13 files deleted, 0 of them had nodes
worth pruning (benign — graph already clean), or (b) 13 ghost nodes
still exist and only 0 got pruned (bug). The denominator is opaque.

Split into two messages so the semantics are explicit:

- Drift case: "Pruned N ghost node(s) from M deleted file(s) — drift
  detected and corrected."
- No-drift case: "M file(s) deleted since last run, but no ghost
  nodes were present in the graph — no drift."

Applied to both skill.md and skill-copilot.md (the only two skill
files carrying the --update merge step verbatim).
Copilot AI review requested due to automatic review settings April 25, 2026 05:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the --update merge-step logging in the skill templates to remove ambiguity when deleted files are detected, distinguishing between cases where ghost nodes are actually pruned vs. where no graph nodes existed for the deleted files.

Changes:

  • Split the prior ambiguous “Pruned 0 … from M deleted file(s)” output into two explicit messages (drift vs. no-drift).
  • Apply the same message split to both the canonical skill (skill.md) and the Copilot variant (skill-copilot.md).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
graphify/skill.md Updates the merge-step snippet to print distinct drift vs. no-drift messages when pruning deleted-file nodes.
graphify/skill-copilot.md Mirrors the same merge-step logging changes in the Copilot skill variant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread graphify/skill.md
Comment on lines +919 to +921
print(f'Pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s) — drift detected and corrected.')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost nodes were present in the graph — no drift.')
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messages claim “drift detected and corrected” / “no drift”, but this code only checks/removes nodes with node['source_file'] in the deleted set; it doesn’t verify that all drift is corrected or that no other drift exists. Consider tightening the wording to the specific condition (e.g., “ghost-node drift from deleted files detected; pruned …” / “no ghost-node drift from deleted files”).

Suggested change
print(f'Pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s) — drift detected and corrected.')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost nodes were present in the graph — no drift.')
print(f'Ghost-node drift from deleted file(s) detected; pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s).')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost-node drift from deleted files was present in the graph.')

Copilot uses AI. Check for mistakes.
Comment thread graphify/skill-copilot.md
Comment on lines +822 to +824
print(f'Pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s) — drift detected and corrected.')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost nodes were present in the graph — no drift.')
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messages claim “drift detected and corrected” / “no drift”, but this code only checks/removes nodes with node['source_file'] in the deleted set; it doesn’t verify that all drift is corrected or that no other drift exists. Consider tightening the wording to the specific condition (e.g., “ghost-node drift from deleted files detected; pruned …” / “no ghost-node drift from deleted files”).

Suggested change
print(f'Pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s) — drift detected and corrected.')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost nodes were present in the graph — no drift.')
print(f'Pruned {len(to_remove)} ghost node(s) from {len(deleted)} deleted file(s) — ghost-node drift from deleted files detected and pruned.')
else:
print(f'{len(deleted)} file(s) deleted since last run, but no ghost-node drift from deleted files was present in the graph.')

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--update prune message should show denominator so drift is visible

2 participants