Skip to content

NuGet Packages

Build Governor publishes two NuGet packages for building custom tooling on top of its memory metrics and OOM classifier.

Shared message DTOs for client-service communication over named pipes. No Windows dependency — can be referenced from any .NET project.

<PackageReference Include="Gov.Protocol" Version="1.*" />
TypeDirectionPurpose
AcquireTokensRequestClient -> ServiceRequest tokens before a build tool runs
AcquireTokensResponseService -> ClientGrant or deny with lease ID and commit ratio
ReleaseTokensRequestClient -> ServiceReturn tokens with process stats (peak memory, exit code, duration)
ReleaseTokensResponseService -> ClientFailure classification, retry recommendation
HeartbeatRequestClient -> ServiceKeep a lease alive during long operations
HeartbeatResponseService -> ClientConfirm lease is still valid
StatusRequestClient -> ServiceQuery pool state
StatusResponseService -> ClientTokens, leases, commit ratio, recommended parallelism

The FailureClassification enum: Success, NormalCompileError, LikelyOOM, LikelyPagingDeath, Unknown.

Use this package when you want to:

  • Build a custom wrapper for a different build tool
  • Communicate with the governor service programmatically
  • Integrate governor awareness into your own build tooling

Windows memory metrics, OOM classification, GPU metrics, process monitoring, and auto-start client. Depends on Windows APIs.

<PackageReference Include="Gov.Common" Version="1.*" />
ClassPurpose
WindowsMemoryMetricsRead system commit charge and calculate token budgets via GlobalMemoryStatusEx
FailureClassifierClassify build failures using an evidence-weighted model
GovernorClientFail-safe named pipe client with auto-start support
GovernorAutoStartMutex-guarded governor startup (locates and launches Gov.Service.exe)
ProcessMetricsPer-process memory monitoring via psapi.dll (100 ms sampling)
GpuMetricsNVIDIA GPU status via nvidia-smi (VRAM, utilization, temperature)

Use this package when you want to:

  • Read system commit charge and memory pressure levels
  • Classify build failures as OOM vs normal errors
  • Auto-start the governor service from your own tools
  • Monitor per-process memory consumption
  • Query GPU memory status

Build Governor operates entirely locally on Windows:

AspectDetail
Data accessedSystem commit charge, per-process memory via Windows APIs, GPU metrics via nvidia-smi, named pipe IPC
Data NOT accessedNo network requests, no telemetry, no credential storage, no build artifact inspection
PermissionsStandard user for CLI/wrappers, Administrator for Service installation only

See SECURITY.md for vulnerability reporting.