ek9_prune_empty_sources

Deletes every .ek9 file that is a bare zero-construct module stub (shebang + 'defines module' + //EOF, line comments allowed); answers status, edits[] (one DELETE per file) and skipped[] with a reason per retained candidate.

Category: Editor · Compare: NEW IDE surface — Build menu → "Prune Empty Sources…" wizard (root picker, module filter, preview pane with two columns: files to delete + retained candidates with reasons). Also wired as a receipts-pane follow-up action on every pure-relocation tool (ek9_organize_localized_text, ek9_extract_to_localized_text, ek9_move_construct).

When to use it

'Delete every empty module stub left after the relocation' is one call with no arguments (narrow with roots and/or moduleFilter:['com.example.i18n']). Use it AFTER a pure-relocation tool has left donor files as bare 'defines module' shells; it needs a prior ek9_compile.

When not to use it

Details

Two-stage detection: symbol-table walk for zero-construct module scopes, then a lex-only confirmation of the bare `#!ek9 / defines module / //EOF` shape — line `//` comments count as whitespace (pruned); block (`<!- -!>`) and doc (`<?- -?>`) comments are preserving. Pure deletion (only `delete` edits, never rewrites); non-deleted candidates go in `skipped[]` (reason ∈ has-comments | has-unrecognised-content | not-a-stub | module-filter-mismatch | outside-roots) with a `retainedContent` line-slice, while status:conflicts is reserved for a locked/unreadable file (kind:file-locked-or-unreadable). `dirtyOverlay` is V1 schema-accepted but not consumed; when supplied it appears in the response's `deferredParameters[]`.

Arguments

ArgumentTypeRequiredWhat it is
moduleFilteranyRestrict candidates to files declaring this exact `defines module <name>` (an array of one name, or the bare name). When omitted, every module in the scanned roots is considered.
rootsarray of stringWorkspace-relative directories to scan. When omitted, defaults to the watched workspace roots.

It also takes the arguments every tool takes.