Recover from stale RFDB nodes that survive commit_batch cleanup despite having their file field listed in changed_files. Use when: (1) re-running an enricher/orchestrator step but old data with the same file field stays in the graph, (2) commit_batch(changed_files=[X], ...) reports success but a query later still returns nodes with file = X, (3) you re-pointed structural nodes (e.g., DIRECTORY/FILE) from a synthetic file path to real file paths and the old synthetic-path nodes won't go away, (4) graph-stream / find_by_type returns a mix of "stale" and "new" nodes for the same logical entity. Root cause: handle_commit_batch calls engine.find_by_attr({file: X}) to enumerate nodes-to-delete, but that query path returns only a PARTIAL set after compaction (L1 segments and the file→nodes index can desync). Workaround: enumerate stale nodes via the TS rfdb client queryNodes({file: X}) (different code path that finds all of them) and call deleteNode(id) per node, then re-commit the intended state. Related: rfdb-manifest-l1-carryforward (same L1 family).
$npx -y skills add disentinel/grafema --skill rfdb-stale-node-cleanupInstalls into the current project.
Run `npx skills use "https://github.com/disentinel/grafema" --skill "disentinel/grafema/rfdb-stale-node-cleanup"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/disentinel/grafema" that are relevant to the current task. Run `npx skills add "https://github.com/disentinel/grafema"` and select the relevant skills, then follow their instructions.