[patch] Rename the Sample project to Invoker.Demo - #48
Conversation
ktsu.Sdk derives a project's assembly name and package ID from its solution-relative folder path, so the folder `Sample` built the demo as `ktsu.Sample` - a name no single repository should own. Rename the folder, the project file, the solution entry, the source file and its namespace so the identity becomes `ktsu.Invoker.Demo`, matching the `.Demo` convention for non-shipping demonstration projects. Set `IsPackable=false` explicitly rather than leaning on `OutputType=Exe` keeping it off nuget.org. Add ProjectNamingTests, which fails if a project folder, its `.csproj` filename or its solution entry stops agreeing with the family name, so the derived identity cannot drift back unnoticed. Fixes #38 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HPfHJ1kKCSoR9tRHPxMVfF
|
The The job never analyzed any code. It failed while opening its model session: That is an HTTP 402 against the Copilot API for this account's monthly quota, raised before the agent read the diff, so no change to this branch can clear it — there is no fix to port. Clearing it needs a quota or billing change on the account, which is outside what a PR can do. The separate CodeQL I tried to re-run the failed job to confirm it reproduces rather than being transient, but the API refuses it: Generated by Claude Code |
Path.Combine discards everything before a rooted argument, so a solution entry holding an absolute path would have dropped the repository root and tested a file outside it. Path.Join concatenates, which keeps the check inside the repository and reports such an entry as an offender. Addresses the CodeQL cs/path-combine findings on this PR. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HPfHJ1kKCSoR9tRHPxMVfF
|
|
What Sonar actually counted. Querying the analysis for this PR, the new-code coverage debt is one file:
The new test file is correctly not counted — the scanner detects it as test code. The 8 lines are the demo's existing, never-tested body: renaming Why I did not just write a test to cover it. The obvious move is a smoke test calling the demo's entry point — Task queuedTask = Task.Run(() => contextDependent.Invoker.Invoke(ContextDependent.DoWork));
contextDependent.Invoker.DoInvokes();
What I suggest instead. excludes the demo from coverage while leaving it under every other Sonar rule. I cannot set a repository variable, so this is yours to make. Worth noting it is not specific to this PR: every rename in the ktsu-dev/Sdk#36 naming audit that moves a demo or sample project will trip the same gate, so a decision here probably wants to be the pattern for the rest. Everything else on this PR is green: Generated by Claude Code |


Fixes #38
What changed
ktsu.Sdkderives a project's assembly name and package ID from its solution-relative folder path, so the folderSamplebuilt the demo asktsu.Sample— a name no single repository should own.dotnet buildonmainconfirms it:Sample -> Sample/bin/Debug/net10.0/ktsu.Sample.dll.Sample/→Invoker.Demo/,Sample.csproj→Invoker.Demo.csproj, and the solution entry now readsInvoker.Demo. The derived identity isktsu.Invoker.Demo, matching the.Democonvention for non-shipping demonstration projects.Sample.cs→Demo.cs, with namespacektsu.Invoker.Sample→ktsu.Invoker.Demoand classSample→Demo, so the source agrees with the folder it now lives in.IsPackable=falseis set explicitly rather than leaning onOutputType=Exebeing what keeps the demo off nuget.org.CLAUDE.mdrecords the folder-path-is-an-identity-claim rule alongside the renamed project.Nothing was published under
ktsu.Sample, so this corrects a name rather than breaking a package.New test
Invoker.Test/ProjectNamingTests.csguards the convention that produced the bug, in three parts:InvokerorInvoker.<Something>.csprojis named for the folder that decides its identityVerification
dotnet test Invoker.sln— 19/19 pass (16 pre-existing, 3 new), and the same in-c Release.EveryProjectFolderCarriesTheFamilyNameandEverySolutionEntryMatchesItsProjectFileboth fail, namingSample. Restored, and they pass.dotnet buildnow reportsInvoker.Demo -> Invoker.Demo/bin/Debug/net10.0/ktsu.Invoker.Demo.dll.dotnet pack -c Releaseproduces onlyktsu.Invoker.1.2.33.nupkg; the demo is not packed. (That pack run also surfaces pre-existingCP0016ApiCompat errors onInvoker/Invoker.csproj, a project this PR does not touch.)Part of the estate-wide naming audit tracked in ktsu-dev/Sdk#36.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HPfHJ1kKCSoR9tRHPxMVfF
Generated by Claude Code