Skip to content

fix: fail check mode when delete would remove orphan files#1436

Open
dyoshikawa-claw wants to merge 13 commits intomainfrom
fix/issue-1431
Open

fix: fail check mode when delete would remove orphan files#1436
dyoshikawa-claw wants to merge 13 commits intomainfrom
fix/issue-1431

Conversation

@dyoshikawa-claw
Copy link
Copy Markdown
Collaborator

Summary

  • make fail when orphan files would be deleted
  • add regression coverage for dry-run/delete diff detection
  • add CLI-level tests for check mode behavior

Testing

  • pnpm vitest run src/types/feature-processor.test.ts src/types/dir-feature-processor.test.ts
  • pnpm vitest run src/lib/generate.test.ts src/cli/commands/generate.test.ts
  • pnpm vitest run src/lib/generate.test.ts src/cli/commands/generate.test.ts src/mcp/generate.test.ts

Closes #1431

dyoshikawa and others added 4 commits April 5, 2026 20:14
…esystem reads

- Remove includeNonDeletable parameter from all processor interfaces and
  implementations since it was never called with true
- Hoist loadToolFiles/loadToolDirsToDelete calls to avoid duplicate
  filesystem scans in check+delete mode
- Remove redundant orphan check conditions subsumed by orphanCount logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ands/subagents empty handling

Extract a shared helper to eliminate duplicated rulesyncFiles.length === 0
branching across generateRulesCore, generateIgnoreCore, generateMcpCore,
and generateHooksCore. Also apply the same empty-rulesync handling to
generateCommandsCore and generateSubagentsCore so check mode correctly
detects delete-only diffs for those features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
removeOrphanAiFiles/removeOrphanAiDirs already return orphan count
in dry-run mode, making the manual Set+filter check unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

--check does not block on files that would be deleted by rulesync

2 participants