chore: Simplify shared Roslyn worker internals
Merged
HA
3mo ago+177+177+012345678901234567890123456789-146-146-012345678901234567890123456789
Summary
- Separate shared Roslyn worker wire framing and template rendering from process lifecycle orchestration.
- Keep dynamic-code compilation behavior and worker protocol bytes unchanged.
User Impact
- Execute-dynamic-code compilation, retry, timeout, cancellation, and fallback behavior remain unchanged.
- The smaller worker host makes later lifecycle and assembly-build refactors easier to review independently.
Changes
- Add
SharedRoslynCompilerWorkerProtocolto own request encoding, response header parsing, diagnostic framing, protocol read timeout, quit marker, and worker program template token replacement. - Retarget existing command/template tests directly to the new owner and remove six host test wrappers.
- Add characterization coverage for valid response headers, invalid prefixes, and non-numeric exit codes before extraction.
- Reduce
SharedRoslynCompilerWorkerHostfrom 988 to 865 lines while leaving retry, process lifecycle, assembly build, and shutdown state in the host. - The only non-move production change is passing the current worker
StandardOutputreader intoReadDiagnosticLines; all compile calls run underSharedCompilerWorkerLock, andProcess.StandardOutputreturns the same reader instance used for the response header. - Preserve the existing double
Path.GetFullPathapplication, blocking read behavior, strings, markers, timeout values, andout int exitCodecontract.
Verification
dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"(0 errors, 0 warnings)SharedRoslynCompilerWorkerHostTests(10 passed)ExternalCompilerPathResolverTests(15 passed, including worker-build fallback)StaticFacadeStateGuardTests(20 passed)- Confirmed that removed host wrappers have zero references and the protocol has no reverse dependency on the host.
- No IPC wire shape, CLI/package protocol version, or release input changes.