Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeszack

Relationships

#4481 repo prune follow-ups: report failed writes apart from skips, resolved path in errors, upgrade note indent, matcher tests

Opened by zack · 11/6/2026· Shipped 11/6/2026

What

Non-blocking review suggestions left over from the verification of #4447 (PR swamp-club/swamp#3646, swamp repo prune).

  1. A failed write is reported as a skip and exits 0. ToolSettingsPruner.apply (src/domain/repo/tool_settings_pruner.ts) records a file it cannot write or delete in skipped with the reason "it could not be changed: ...", and the command succeeds. A --json consumer cannot tell a deliberate skip (symlink, outside the repo) from a failed write without matching prose. Report failures in their own failed array and exit non-zero when any change failed.
  2. The not-a-repo error shows the raw path argument. notARepository(input.path) in src/libswamp/repo/prune.ts prints "Not a swamp repository: .. Run 'swamp repo init' first." when no path is given. Use the resolved repoPath.value, as repo upgrade does.
  3. The leftover note's indentation. In LogRepoUpgradeRenderer (src/presentation/renderers/repo_init.ts), leftoverSettingsLines is written with a two-space indent even when no "Tools: [...] -> [...]" line is above it. Other top-level warnings in that renderer start at column 0.
  4. No unit test for src/domain/repo/audit_hook_command.ts. Its matchers moved out of repo_service.ts and are now exported. Pin the binary spellings on their own: quoted .exe, absolute path, trailing text rejected, and the claude optional --tool claude suffix.
  5. Smaller items:
    • A hook event key named __proto__ is dropped when hooks are rebuilt on a plain object in pruneClaudeSettings / flatHooksRule; build with Object.fromEntries or a null-prototype object.
    • repoInit has only a failure-path test for prunableSettings; add the success path, as repoUpgrade has.
    • I/O failures in repoPrune surface as validationFailed; a more accurate error kind would help JSON consumers.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 18 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/6/2026, 6:00:29 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack11/6/2026, 4:36:55 PM
Editable. Press Enter to edit.

system commented 11/6/2026, 4:35:59 PM

Classified automatically when this issue was filed.

  • Type: Bug

If you feel this classification is incorrect, add a ripple to tell us so.

Sign in to post a ripple.