From 08a5fc783d7f4e0a99f7ee5a8e3607759ffeee07 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 00:49:51 +0200 Subject: [PATCH] Ack Cut K0: portable cultmesh-kotlin build.ps1, pwsh interop harness, Kotlin parity note build.ps1 picks kotlinc/kotlinc.bat and java/java.exe by platform and joins paths and the classpath with the platform separator, so it runs under PowerShell 7 on Linux (Yggdrasil's Kotlin verify image) and unchanged on Windows. The TypeScript interop harness invokes pwsh off Windows. The parity doc says twice that Kotlin does not yet conform to its RUDP claims until the ack campaign's Cut K lands. Co-Authored-By: Claude Sonnet 5.5 --- docs/cultnet-transport-parity.md | 4 ++++ packages/cultmesh-kotlin/build.ps1 | 16 +++++++++------- .../test/interop/cultnet-interop.test.ts | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/cultnet-transport-parity.md b/docs/cultnet-transport-parity.md index d0779196..cda2dfb3 100644 --- a/docs/cultnet-transport-parity.md +++ b/docs/cultnet-transport-parity.md @@ -39,6 +39,8 @@ language now converge across the targeted runtimes, while production service adoption still varies by runtime and older TCP/LiteNetLib/WebSocket bodies have not all been lowered behind the shared transport port. +> **Kotlin does not yet conform to the RUDP claims in this document.** `CultMesh.kt` lacks the stray-packet hardening of `3bf1c0c`, and it will lack the ack, receipt, FORWARD-TSN and expiry work of the ack campaign until that campaign's Cut K lands. Read every RUDP statement here as covering C#, TypeScript, Rust and Python only. + ## Invariants - `cultnet.schema.v0` payloads are transport-neutral. Message schemas must not @@ -471,6 +473,8 @@ Current progress: core schema-message RUDP matrix is live in the TypeScript interop gate; broader service adoption remains the unclaimed layer. +> **Kotlin does not yet conform to the RUDP claims in this document.** `CultMesh.kt` lacks the stray-packet hardening of `3bf1c0c`, and it will lack the ack, receipt, FORWARD-TSN and expiry work of the ack campaign until that campaign's Cut K lands. Read every RUDP statement here as covering C#, TypeScript, Rust and Python only. + ## RUDP Packet Contract V0 `cultnet.transport.rudp.v0` packets start with a fixed binary header, followed diff --git a/packages/cultmesh-kotlin/build.ps1 b/packages/cultmesh-kotlin/build.ps1 index aabacbcd..e744cb02 100644 --- a/packages/cultmesh-kotlin/build.ps1 +++ b/packages/cultmesh-kotlin/build.ps1 @@ -4,26 +4,28 @@ param( ) $ErrorActionPreference = "Stop" +$onWindows = [Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT +$pathSeparator = [IO.Path]::PathSeparator $repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) -$src = Join-Path $PSScriptRoot "src\main\kotlin" -$out = Join-Path $repoRoot "artifacts\cultmesh-kotlin" +$src = Join-Path $PSScriptRoot (Join-Path "src" (Join-Path "main" "kotlin")) +$out = Join-Path (Join-Path $repoRoot "artifacts") "cultmesh-kotlin" $jarPath = Join-Path $out "cultmesh-kotlin.jar" -$kotlinc = Join-Path $KotlinHome "bin\kotlinc.bat" -$kotlinStdlib = Join-Path $KotlinHome "lib\kotlin-stdlib.jar" -$java = Join-Path $JavaHome "bin\java.exe" +$kotlinc = Join-Path (Join-Path $KotlinHome "bin") $(if ($onWindows) { "kotlinc.bat" } else { "kotlinc" }) +$kotlinStdlib = Join-Path (Join-Path $KotlinHome "lib") "kotlin-stdlib.jar" +$java = Join-Path (Join-Path $JavaHome "bin") $(if ($onWindows) { "java.exe" } else { "java" }) if (-not (Test-Path $kotlinc)) { throw "kotlinc not found: $kotlinc" } if (-not (Test-Path $kotlinStdlib)) { throw "kotlin stdlib not found: $kotlinStdlib" } if (-not (Test-Path $java)) { throw "java not found: $java" } $env:JAVA_HOME = $JavaHome -$env:PATH = "$(Join-Path $JavaHome 'bin');$env:PATH" +$env:PATH = "$(Join-Path $JavaHome 'bin')$pathSeparator$env:PATH" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $out New-Item -ItemType Directory -Force $out | Out-Null $sources = Get-ChildItem $src -Recurse -Filter *.kt | Select-Object -ExpandProperty FullName & $kotlinc @sources -jvm-target 1.8 -classpath $kotlinStdlib -d $jarPath if ($LASTEXITCODE -ne 0) { throw "kotlinc failed with exit code $LASTEXITCODE" } -& $java -cp "$jarPath;$kotlinStdlib" org.gamecult.cultmesh.CultMeshKt +& $java -cp "$jarPath$pathSeparator$kotlinStdlib" org.gamecult.cultmesh.CultMeshKt if ($LASTEXITCODE -ne 0) { throw "cultmesh-kotlin self-test failed with exit code $LASTEXITCODE" } Write-Host "Built $jarPath" diff --git a/packages/cultnet-ts/test/interop/cultnet-interop.test.ts b/packages/cultnet-ts/test/interop/cultnet-interop.test.ts index 756ef97d..d2e7b71e 100644 --- a/packages/cultnet-ts/test/interop/cultnet-interop.test.ts +++ b/packages/cultnet-ts/test/interop/cultnet-interop.test.ts @@ -2798,7 +2798,7 @@ async function runDotnetTestFilter( async function buildKotlinInteropPeer(): Promise { kotlinInteropPeerBuild ??= execFileAsync( - "powershell", + process.platform === "win32" ? "powershell" : "pwsh", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", resolve(cultmeshKotlinRoot, "build.ps1")], { cwd: cultLibRoot,