From 3d535e7f74970503e05cc4ad7a33b2fb12ac7449 Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sat, 17 Oct 2026 23:57:09 +0200 Subject: [PATCH 1/2] deps: @types/bun 1.4.3 (killswitch preflight test types) Bun.Subprocess signalCode is now number | Signals | null; the test result type follows it. --- bun.lock | 6 +++--- package.json | 2 +- packages/opencode/src/tests/killswitch-preflight.test.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bun.lock b/bun.lock index 7939e4158..137b7a055 100644 --- a/bun.lock +++ b/bun.lock @@ -13,7 +13,7 @@ "@earendil-works/pi-tui": "1.2.0", "@opencode-ai/plugin": "1.19.0", "@tsconfig/bun": "1.0.11", - "@types/bun": "1.4.2", + "@types/bun": "1.4.3", "dedent": "^1.7.2", "jsonc-parser": "^3.3.1", "lefthook": "2.1.14", @@ -596,7 +596,7 @@ "@tufjs/models": ["@tufjs/models@4.1.0", "", { "dependencies": { "@tufjs/canonical-json": "2.0.0", "minimatch": "^10.1.1" } }, "sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww=="], - "@types/bun": ["@types/bun@1.4.2", "", { "dependencies": { "bun-types": "1.4.2" } }, "sha512-GimotNn7+ZV0uVArItBbriZsR1oNf0+WTzPkdcFrzShI7k2norL0uzEaJT8T33dWr7O/c9ZDuAFQrctKCi72oQ=="], + "@types/bun": ["@types/bun@1.4.3", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="], "@types/node": ["@types/node@25.5.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw=="], @@ -680,7 +680,7 @@ "bun-ffi-structs": ["bun-ffi-structs@0.3.1", "", { "peerDependencies": { "typescript": "^5" } }, "sha512-3gM7PpVWLyrwxWjcilSiGuhWanhZivvo6l0u573NziPH6f/gwk6McbaYgn7oJWov6pKGRTDbrg94W5DcJsKTtQ=="], - "bun-types": ["bun-types@1.4.2", "", { "dependencies": { "@types/node": "*" } }, "sha512-bxV1FgK7yBIzjRe5zBozIM4Bem11ZJcCXSrjWRG3YWLt8yFDePu4cLjpebO8OvPeIE9trbyPF4fuj3Cia4Fj3w=="], + "bun-types": ["bun-types@1.4.3", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-tinRJNGOmUN+tEAsn2y2e942n9JHRHR42iUYzDH75NmhJqVBokGSQkkfSFdNWwsANIdrK6ACH9t01M452YyTwg=="], "bundle-name": ["bundle-name@4.1.1", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA=="], diff --git a/package.json b/package.json index e5438ee1c..28e232feb 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@earendil-works/pi-tui": "1.2.0", "@opencode-ai/plugin": "1.19.0", "@tsconfig/bun": "1.0.11", - "@types/bun": "1.4.2", + "@types/bun": "1.4.3", "dedent": "^1.7.2", "jsonc-parser": "^3.3.1", "lefthook": "2.1.14", diff --git a/packages/opencode/src/tests/killswitch-preflight.test.ts b/packages/opencode/src/tests/killswitch-preflight.test.ts index 42056f1ec..adadaf516 100644 --- a/packages/opencode/src/tests/killswitch-preflight.test.ts +++ b/packages/opencode/src/tests/killswitch-preflight.test.ts @@ -224,7 +224,7 @@ try { type WriterEvent = { event: string; [key: string]: unknown } type WriterResult = { exitCode: number | null - signalCode: string | null + signalCode: Bun.Subprocess['signalCode'] events: WriterEvent[] stderr: string } @@ -942,7 +942,7 @@ test('finishing the owning lifetime kills a held writer and joins its exit and b // Bun reports a SIGTERM exit as status 143 (128 + 15). const killed = { exitCode: 143, - signalCode: 'SIGTERM', + signalCode: 'SIGTERM' as const, stderr: '', events: [expect.objectContaining({ event: 'held' })], } From 34c8539b157e582c8aefddb6174b2335f4b5c496 Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sun, 18 Oct 2026 00:09:02 +0200 Subject: [PATCH 2/2] mason: widen script signal types to Bun.Subprocess['signalCode'] for @types/bun 1.4.3 @types/bun 1.4.3 declares Subprocess.signalCode as NodeJS.Signals | number | null (a number for signals with no name). The mutation wrapper's Transcript.signal and OwnedChild.signalCode, and the Pi host check's ChildOutcome.signal, now use Bun's own type. Types only: runtime values, the `signal ||` death check, and every recorded JSON (invocation.json, status.json, the Pi failure dump) are unchanged. Bun 1.3.14 already returns a number at runtime for an unnamed signal (probe: kill -35 -> 35), so the recorded format was already string-or-number. --- scripts/check-pi-tool-mapping.ts | 2 +- scripts/run-mutation-bun.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/check-pi-tool-mapping.ts b/scripts/check-pi-tool-mapping.ts index c2822f6da..42c8fc1e2 100644 --- a/scripts/check-pi-tool-mapping.ts +++ b/scripts/check-pi-tool-mapping.ts @@ -33,7 +33,7 @@ interface ChildOutcome { stdout: string stderr: string code: number | null - signal: string | null + signal: Bun.Subprocess['signalCode'] timedOut: boolean joinFailures: string[] } diff --git a/scripts/run-mutation-bun.ts b/scripts/run-mutation-bun.ts index 37fa5be7c..9e169537f 100644 --- a/scripts/run-mutation-bun.ts +++ b/scripts/run-mutation-bun.ts @@ -120,7 +120,10 @@ export type Transcript = { stdout: string stderr: string exitCode: number - signal: string | null + // Bun's own type: a signal name, or the bare number of a signal that has + // no name (such as a Linux real-time signal). Kept as Bun reports it, so + // the audit invocation.json records the same value Bun gave. + signal: Bun.Subprocess['signalCode'] } export type ExecutionEvent = { @@ -612,7 +615,7 @@ export type OwnedChild = { stdout: ReadableStream stderr: ReadableStream exited: Promise - readonly signalCode: string | null + readonly signalCode: Bun.Subprocess['signalCode'] kill: () => void } type Dependencies = {