Skip to content

Expand ktsu.Semantics.Paths usage across services (#14)#34

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/github-issues-paFBg
May 9, 2026
Merged

Expand ktsu.Semantics.Paths usage across services (#14)#34
matt-edmondson merged 1 commit into
mainfrom
claude/github-issues-paFBg

Conversation

@matt-edmondson
Copy link
Copy Markdown
Contributor

Summary

Closes #14. Public service entry points across the codebase now accept AbsoluteDirectoryPath / AbsoluteFilePath from ktsu.Semantics.Paths instead of raw string, with conversion handled at the Spectre command boundary (mirroring the pattern already used by MergeCommand / CodeGenCommand / ExplorerCommand).

Service signatures migrated

  • MarkdownService.CleanAsync / LintAsyncAbsoluteDirectoryPath
  • RepoService.DiscoverRepositoriesAsync / BuildAndTestAsync / PullAllAsync / UpdatePackagesAsyncAbsoluteDirectoryPath
  • PackagesService.UpdateAsync — overloads for AbsoluteDirectoryPath and AbsoluteFilePath (single .csproj)
  • PackagesService.MigrateToCpmAsyncAbsoluteDirectoryPath
  • SvnMigrateService.MigrateAsyncAbsoluteDirectoryPath target + optional AbsoluteFilePath authors file
  • ImageService.ProcessAsyncAbsoluteDirectoryPath for input + output
  • SyncService.RunAsyncAbsoluteDirectoryPath (was the only remaining string entry point in the project the issue called out)

Command boundary

Each corresponding *Command.cs calls AbsoluteDirectoryPath.Create<...>(Path.GetFullPath(settings.Path)) (or AbsoluteFilePath.Create<...>(...)) once before delegating to the service. PackagesUpdateCommand chooses the file vs. directory overload based on File.Exists to preserve current behaviour where the user can pass a single .csproj.

csproj

Added ktsu.Semantics.Paths package reference to KtsuTools.Markdown, KtsuTools.Repo, KtsuTools.Packages, KtsuTools.SvnMigrate, and KtsuTools.Image.

Tests

Updated RepoServiceTests for the new DiscoverRepositoriesAsync(AbsoluteDirectoryPath) signature. Other test files (MergeServiceTests, SyncServiceTests, CodeGenServiceTests, ImageServiceTests, MarkdownLintTests, SmokeTests) either already used the strong-path types or do not exercise the changed entry points.

Out of scope (per issue)

Path.GetFileName / Path.Combine calls that operate on string results from Directory.EnumerateFiles etc. are kept — the issue explicitly excludes those.

Test plan

  • CI builds the solution successfully (.NET wasn't available in my environment to build locally)
  • Existing unit tests still pass
  • Manual smoke: each migrated command (ktsu markdown clean, ktsu repo discover, ktsu packages update, ktsu svn-migrate, ktsu image process, ktsu sync) accepts a relative path and works end-to-end

https://claude.ai/code/session_015z5JX7CrrvNdfjWDZNV3Hy


Generated by Claude Code

Migrate public service entry points off raw string paths to
AbsoluteDirectoryPath / AbsoluteFilePath, with conversion at the
Spectre command boundary:

- MarkdownService.CleanAsync / LintAsync
- RepoService.DiscoverRepositoriesAsync / BuildAndTestAsync /
  PullAllAsync / UpdatePackagesAsync
- PackagesService.UpdateAsync (overloads for dir + single csproj)
- PackagesService.MigrateToCpmAsync
- SvnMigrateService.MigrateAsync (target dir + optional authors file)
- ImageService.ProcessAsync (input + output dirs)
- SyncService.RunAsync (root path)

Each affected csproj now references ktsu.Semantics.Paths, and each
command translates its string CommandSettings field via
AbsoluteDirectoryPath.Create / AbsoluteFilePath.Create. RepoServiceTests
updated for the new signature.

https://claude.ai/code/session_015z5JX7CrrvNdfjWDZNV3Hy
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

@matt-edmondson matt-edmondson merged commit 264eda3 into main May 9, 2026
5 checks passed
@matt-edmondson matt-edmondson deleted the claude/github-issues-paFBg branch May 9, 2026 06:39
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.

Expand ktsu.Semantics.Paths / StrongPaths usage beyond KtsuTools.Sync

2 participants