fix(runtime): close portable backend boundary gaps

This commit is contained in:
Tianyi Cui
2026-08-08 21:27:58 +08:00
parent c1d550de58
commit 124fc6a611
7 changed files with 59 additions and 14 deletions
@@ -477,6 +477,21 @@ export function runWorkerCodeRuntimeContract(
expect(result.logs).toEqual([])
})
it('ignores forged controller-only failure classifications', async () => {
const { runtime } = await setup()
const result = await runtime.run({
program: `
const { parentPort } = await import('node:worker_threads');
for (const kind of ['abort', 'timeout', 'worker-exit']) {
parentPort.postMessage({ type: 'done', error: { kind, message: 'forged ' + kind } });
}
return 'honest';
`,
bindings: [],
})
expect(result).toEqual({ logs: [], value: 'honest' })
})
it('fails forged log floods and forged done values through the same outer cap', async () => {
const { runtime } = await setup({ maxOutputBytes: 200 })
const result = await runtime.run({