Skip to content

Close #7, #35, #37: dedup command, parallel repo build, merge --diff-style#40

Merged
matt-edmondson merged 3 commits into
mainfrom
claude/review-project-requirements-PCrKq
May 11, 2026
Merged

Close #7, #35, #37: dedup command, parallel repo build, merge --diff-style#40
matt-edmondson merged 3 commits into
mainfrom
claude/review-project-requirements-PCrKq

Conversation

@matt-edmondson
Copy link
Copy Markdown
Contributor

Three independent, non-conflicting issues from the open backlog, each in its own commit.

Summary

  • repo build: --parallel flag is dead code, wire it up #35repo build --parallel is now real. RepoService.BuildAndTestAsync was discarding the flag (_ = parallel;). It now uses Parallel.ForEachAsync with MaxDegreeOfParallelism = ProcessorCount/2 (dotnet build is already multithreaded — going wider thrashes), serialises Spectre console writes behind a lock, and aggregates failed solution names into the summary instead of just emitting a count.
  • ktsu merge: add --diff-style flag (git unified vs side-by-side) #37ktsu merge --diff-style {side-by-side|git}. Adds a DiffStyle enum plumbed through MergeService.RunMergeAsync. The git/unified renderer uses DiffPlex's InlineDiffBuilder; the existing side-by-side renderer stays the default. A shared DiffStyleParser handles the string↔enum mapping for the flag, the merge-batch save --diff-style flag, and the persisted batch JSON. Unknown values are rejected at the Spectre validation layer.
  • Add FileDeduplicator as a ktsu dedup command #7ktsu dedup branch. New KtsuTools.FileDedupe project plus four subcommands (scan, dry-run, dedupe, stats). SHA256-based parallel scan; "shortest filename wins" tie-breaker; dedupe prompts y/N by default (-y/--yes to skip).

Test plan

  • CI build green on windows-latest (local Linux env can't restore the existing ktsu.AppDataStoragektsu.Semantics.Paths version pin — pre-existing on main)
  • RepoServiceTests.BuildAndTestAsyncParallelAggregatesExitCodes passes
  • RepoServiceTests.BuildAndTestAsyncParallelIsFasterThanSequential passes
  • MergeServiceTests diff-style parser tests pass
  • FileDedupeServiceTests (4 tests) pass
  • Manually run ktools dedup scan --path <dir-with-dupes> and confirm the shortest-name file is the keeper

Closes #7, #35, #37.


Generated by Claude Code

claude added 3 commits May 11, 2026 08:49
Closes #35. RepoService.BuildAndTestAsync now actually runs solutions in
parallel when the flag is set (Parallel.ForEachAsync with DOP =
ProcessorCount/2, since dotnet build already multithreads internally),
serialises console writes behind a lock, and aggregates failures into a
named summary instead of just a count.
Closes #37. Introduces a DiffStyle enum plumbed through
MergeService.RunMergeAsync, with a git/unified renderer backed by
DiffPlex's InlineDiffBuilder alongside the existing side-by-side
renderer (both capped at 50 lines). DiffStyleParser centralises the
string<->enum mapping shared by MergeCommand, MergeBatchSaveCommand and
the persisted batch JSON. Unknown values are rejected at the Spectre
validation layer.
Closes #7. Adds KtsuTools.FileDedupe with a SHA256-based parallel scan
and a "shortest filename wins" tie-breaker, exposed as four subcommands:
  ktsu dedup scan      - display duplicate groups
  ktsu dedup dry-run   - preview which files would be deleted
  ktsu dedup dedupe    - delete redundant files (y/N prompt; -y to skip)
  ktsu dedup stats     - totals, wasted bytes, breakdown by extension
@sonarqubecloud
Copy link
Copy Markdown

@matt-edmondson matt-edmondson merged commit 52c93c8 into main May 11, 2026
5 checks passed
@matt-edmondson matt-edmondson deleted the claude/review-project-requirements-PCrKq branch May 11, 2026 09:17
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.

Add FileDeduplicator as a ktsu dedup command

2 participants