Repository navigation
Add .NET intelligence, verification, MCP hosting, and native binaries #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Telli
merged 4 commits into
main
from
codex/dotnet-intelligence-verification-mcp-binaries
Oct 16, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f1bd8fb
feat: add .NET intelligence, verification, MCP hosting, and native re…
Telli f597334
fix: address MCP, semantic analysis, and verification review findings
Telli 08b0cda
fix: release workspace SQLite pools when hosts shut down
Telli 3e4d107
test: observe turn startup without racing session snapshots
Telli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| param( | ||
| [Parameter(Mandatory)][ValidateSet('win-x64','win-arm64','linux-x64','linux-arm64','osx-x64','osx-arm64')][string]$Runtime, | ||
| [Parameter(Mandatory)][ValidatePattern('^\d+\.\d+\.\d+([-.][0-9A-Za-z.-]+)?$')][string]$Version, | ||
| [string]$OutputDirectory = 'artifacts/binaries' | ||
| ) | ||
| $ErrorActionPreference = 'Stop' | ||
| $repositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path | ||
| $outputRoot = [System.IO.Path]::GetFullPath($OutputDirectory) | ||
| $scratch = Join-Path ([System.IO.Path]::GetTempPath()) ('sharpclaw-publish-' + [Guid]::NewGuid().ToString('N')) | ||
| try { | ||
| $publish = Join-Path $scratch 'publish' | ||
| $stage = Join-Path $scratch 'stage' | ||
| New-Item -ItemType Directory -Path $stage,$outputRoot -Force | Out-Null | ||
| & dotnet publish (Join-Path $repositoryRoot 'src/SharpClaw.Code.Cli/SharpClaw.Code.Cli.csproj') --configuration Release --runtime $Runtime --self-contained true --output $publish --disable-build-servers ` | ||
| -p:PackAsTool=false -p:PublishSingleFile=true -p:PublishTrimmed=false -p:PublishAot=false ` | ||
| -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true ` | ||
| "-p:Version=$Version" "-p:PackageVersion=$Version" "-p:InformationalVersion=$Version" -p:IncludeSourceRevisionInInformationalVersion=false | ||
| if ($LASTEXITCODE -ne 0) { throw "Binary publish failed: $Runtime" } | ||
| $sourceExecutable = if ($Runtime.StartsWith('win-')) { 'SharpClaw.Code.Cli.exe' } else { 'SharpClaw.Code.Cli' } | ||
| $executable = if ($Runtime.StartsWith('win-')) { 'sharpclaw.exe' } else { 'sharpclaw' } | ||
| Copy-Item (Join-Path $publish $sourceExecutable) (Join-Path $stage $executable) | ||
| Copy-Item (Join-Path $repositoryRoot 'LICENSE') $stage | ||
| Copy-Item (Join-Path $repositoryRoot 'README.md') $stage | ||
| $stem = "sharpclaw-$Version-$Runtime" | ||
| if ($Runtime.StartsWith('win-')) { | ||
| $archive = Join-Path $outputRoot "$stem.zip" | ||
| Compress-Archive -Path (Join-Path $stage '*') -DestinationPath $archive -Force | ||
| } else { | ||
| & chmod +x (Join-Path $stage $executable) | ||
| if ($LASTEXITCODE -ne 0) { throw 'Could not preserve executable permission.' } | ||
| $archive = Join-Path $outputRoot "$stem.tar.gz" | ||
| & tar -czf $archive -C $stage $executable LICENSE README.md | ||
| if ($LASTEXITCODE -ne 0) { throw 'Could not create binary archive.' } | ||
| } | ||
| $checksum = (Get-FileHash $archive -Algorithm SHA256).Hash.ToLowerInvariant() | ||
| [System.IO.File]::WriteAllText("$archive.sha256", "$checksum $([System.IO.Path]::GetFileName($archive))`n") | ||
| Write-Host "Created $archive" | ||
| } finally { | ||
| if (Test-Path $scratch) { Remove-Item $scratch -Recurse -Force } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| param( | ||
| [Parameter(Mandatory)][string]$Archive, | ||
| [Parameter(Mandatory)][ValidateSet('win-x64','win-arm64','linux-x64','linux-arm64','osx-x64','osx-arm64')][string]$Runtime, | ||
| [Parameter(Mandatory)][string]$Version | ||
| ) | ||
| $ErrorActionPreference = 'Stop' | ||
| $repositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path | ||
| $architecture = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant() | ||
| $platform = if ($IsWindows) { 'win' } elseif ($IsMacOS) { 'osx' } else { 'linux' } | ||
| if ("$platform-$architecture" -ne $Runtime) { throw "Smoke must execute on a matching runner: expected $Runtime, got $platform-$architecture." } | ||
| $scratch = Join-Path ([System.IO.Path]::GetTempPath()) ('sharpclaw-binary-smoke-' + [Guid]::NewGuid().ToString('N')) | ||
| $previousBinary = $env:SHARPCLAW_TEST_BINARY | ||
| try { | ||
| $extract = Join-Path $scratch 'extract' | ||
| $workspace = Join-Path $scratch 'workspace' | ||
| New-Item -ItemType Directory -Path $extract,$workspace -Force | Out-Null | ||
| $archivePath = (Resolve-Path $Archive).Path | ||
| $checksumPath = "$archivePath.sha256" | ||
| if (!(Test-Path $checksumPath)) { throw 'Binary archive checksum is missing.' } | ||
| $expected = (Get-Content $checksumPath -Raw).Split(' ')[0] | ||
| if ((Get-FileHash $archivePath -Algorithm SHA256).Hash.ToLowerInvariant() -ne $expected) { throw 'Binary archive checksum mismatch.' } | ||
| if ($IsWindows) { Expand-Archive $archivePath $extract } | ||
| else { | ||
| & tar -xzf $archivePath -C $extract | ||
| if ($LASTEXITCODE -ne 0) { throw 'Archive extraction failed.' } | ||
| } | ||
| $executableName = if ($IsWindows) { 'sharpclaw.exe' } else { 'sharpclaw' } | ||
| $binary = Join-Path $extract $executableName | ||
| $files = @(Get-ChildItem $extract -File | Select-Object -ExpandProperty Name | Sort-Object) | ||
| if (($files -join ',') -ne ((@($executableName,'LICENSE','README.md') | Sort-Object) -join ',')) { throw 'Archive must contain exactly executable, LICENSE, and README.md.' } | ||
| # An empty PATH and isolated runtime roots prove the native bundle starts without resolving an ambient dotnet host. | ||
| $start = [System.Diagnostics.ProcessStartInfo]::new($binary) | ||
| $start.UseShellExecute = $false | ||
| $start.RedirectStandardOutput = $true | ||
| $start.RedirectStandardError = $true | ||
| $start.WorkingDirectory = $workspace | ||
| $start.ArgumentList.Add('--output-format'); $start.ArgumentList.Add('json'); $start.ArgumentList.Add('version') | ||
| $start.Environment['PATH'] = '' | ||
| foreach ($key in @('DOTNET_ROOT','DOTNET_ROOT_X64','DOTNET_ROOT_ARM64')) { $start.Environment[$key] = (Join-Path $scratch 'no-dotnet') } | ||
| $start.Environment['DOTNET_MULTILEVEL_LOOKUP'] = '0' | ||
| $process = [System.Diagnostics.Process]::Start($start) | ||
| $stdout = $process.StandardOutput.ReadToEndAsync(); $stderr = $process.StandardError.ReadToEndAsync() | ||
| if (!$process.WaitForExit(30000)) { $process.Kill($true); throw 'Self-contained startup timed out.' } | ||
| $text = $stdout.GetAwaiter().GetResult(); $errorText = $stderr.GetAwaiter().GetResult() | ||
| if ($process.ExitCode -ne 0) { throw "No-runtime version failed: $errorText" } | ||
| $process.Dispose() | ||
| $versionResult = $text | ConvertFrom-Json | ||
| if ($versionResult.succeeded -ne $true -or $versionResult.data.InformationalVersion -ne $Version) { throw "Binary did not report release identity $Version`: $text" } | ||
| [System.IO.File]::WriteAllText((Join-Path $workspace 'note.txt'), 'offline binary SQLite index smoke') | ||
| & $binary --cwd $workspace --output-format json verify --permission-mode dangerFullAccess | ||
| if ($LASTEXITCODE -ne 0) { throw 'Non-.NET verification skip failed.' } | ||
| & $binary --cwd $workspace --output-format json index refresh | ||
| if ($LASTEXITCODE -ne 0) { throw 'SQLite index refresh failed.' } | ||
| & $binary --cwd $workspace --output-format json index stats | ||
| if ($LASTEXITCODE -ne 0) { throw 'SQLite index stats failed.' } | ||
| # Real SDK client tests launch the relocated native binary, exercise both default and elevated calls, | ||
| # and prove bundled SQLite, Roslyn BuildHost, semantic rename/undo, and actual build/TRX test results. | ||
| $env:SHARPCLAW_TEST_BINARY = $binary | ||
| & dotnet test (Join-Path $repositoryRoot 'tests/SharpClaw.Code.IntegrationTests/SharpClaw.Code.IntegrationTests.csproj') --configuration Release --filter 'FullyQualifiedName~InboundMcpStdioTests' --disable-build-servers | ||
| if ($LASTEXITCODE -ne 0) { throw 'Relocated binary MCP/semantic/build/test smoke failed.' } | ||
| Write-Host "Binary smoke passed: $Runtime $Version" | ||
| } finally { | ||
| $env:SHARPCLAW_TEST_BINARY = $previousBinary | ||
| if (Test-Path $scratch) { Remove-Item $scratch -Recurse -Force } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.