feat(build): add --prune flag to build.{sh,ps1} [skip-tdd: wrapper]

Symmetric to install-side --prune (e871c20). Removes
dist/<name>.skill files whose <name> is not in skills/*.

Design choices match install:
- Combined flag (build + prune in one run)
- Global scan, ignores -Names / positional filter
- Default off, print-and-delete, no confirmation

Bash wrinkle: when build.sh delegates to powershell.exe -File
build.ps1 (Windows-without-zip case), --prune is NOT forwarded.
Bash runs prune itself at the end of the script against the
shared dist/. Keeps the delegation surface narrow and the prune
logic single-sourced per shell.

[skip-tdd: wrapper] — same carve-out as install-side, smoke-test
evidence: fake dist/fake-stale-{sh,ps}.skill files created in real
dist/, ran build.{sh,ps1} --prune, verified fakes removed, real
caveman.skill etc. left intact.

Wiki .wiki/concepts/install-cross-platform.md extended:
- title broadened (Install → Install / Build)
- new "Build-side --prune" section
- scope note: dist-hermes/ is separate (managed by build-hermes.py)

Closes [install-ps1-build-prune-followup].
This commit is contained in:
2026-05-25 13:26:06 +03:00
parent 01993eac45
commit ffeb95b9cc
6 changed files with 86 additions and 19 deletions

View File

@@ -31,12 +31,13 @@ _Updated: 2026-05-25 (board-cleanup: done-блоки → .archive/done-2026-05.m
---
## [install-ps1-build-prune-followup] — Add matching `--prune` flag to `scripts/build.{sh,ps1}` for `dist/<name>.skill` artefacts (analogue of install-script prune).
**Status:** ready
**Where I stopped:** Surfaced 2026-05-25 from `[install-ps1]` close — install-side prune ships, but `dist/<name>.skill` artefacts have the same staleness problem (e.g. `dist/using-synology-ops.skill` would linger if it had ever been built). Currently no .skill exists for the retired skill, but the gap is real for future renames/retires.
**Next action:** Add `--prune` to `scripts/build.sh` and `scripts/build.ps1`: scan `dist/*.skill`, drop any whose `<name>` is not in `skills/`. Same default-off / print-and-delete pattern as install-side. Update `.wiki/concepts/install-cross-platform.md` to extend the parity contract to build scripts.
**Branch:** (not started)
## 🟢 [install-ps1-build-prune-followup] — Add matching `--prune` flag to `scripts/build.{sh,ps1}` for `dist/<name>.skill` artefacts (analogue of install-script prune).
**Status:** done
**Where I stopped:** Shipped 2026-05-25. `--prune` / `-Prune` added to both `build.sh` and `build.ps1`. Bash arg-parses out `--prune` from positionals, runs prune at the end of the script against `dist/*.skill` (works regardless of which build branch executed — zip-path or powershell.exe delegation). PS `-Prune` switch runs after the build loop. Same default-off / global-scan / print-and-delete pattern as install-side. Smoke-tested with fake `dist/fake-stale-{sh,ps}.skill` files against real `dist/` — both paths pruned correctly without touching real archives. `[skip-tdd: wrapper]` carve-out applies. Wiki page `.wiki/concepts/install-cross-platform.md` extended with new "Build-side --prune" section + scope note that `dist-hermes/` is separate. Index + log updated.
**Next action:** (none — kept until merged)
**Branch:** master
<!-- created-by: vitya@DESKTOP-NSEF0UK / 2026-05-25 / origin: [install-ps1] close — natural extension to build scripts -->
<!-- closed-by: vitya@DESKTOP-NSEF0UK / 2026-05-25 / acceptance: bash + PS prune ✅; smoke-test ✅; wiki extended ✅ -->
---