mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-22 12:59:06 +00:00
* chore: raise the Node floor to 22.15 and make zstd unconditional Node's built-in zstd in node:zlib arrived in 22.15. With the floor at 22.13 every reader of Codex's compressed .jsonl.zst rollouts had to check for it, and the daily cache kept a separate generation for Nodes without it so a later Node upgrade would still re-derive their days. That split could not survive another cache bump. The engines field, the launcher's version check, .nvmrc, the README and the CI pins now say 22.15. The VS Code extension applies the same floor when it picks a Node to run the CLI, and its runtime notice names it. Removed: the optional zstd exports, zstdSupported and requireZstd in fs-utils, the skipped-compressed-rollouts notice in launcher-homes, and the 76/77 split in the daily cache, which is now 77 for every Node. * docs: say 22.15 wherever the Node floor is stated
38 lines
1.7 KiB
TypeScript
38 lines
1.7 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { chooseRuntime, meetsFloor } from '../src/runtime'
|
|
|
|
describe('meetsFloor', () => {
|
|
it('needs 22.15 or later', () => {
|
|
expect(meetsFloor('22.15.0')).toBe(true)
|
|
expect(meetsFloor('24.21.0')).toBe(true)
|
|
expect(meetsFloor('22.14.9')).toBe(false)
|
|
expect(meetsFloor('20.19.0')).toBe(false)
|
|
})
|
|
})
|
|
|
|
describe('chooseRuntime', () => {
|
|
const probes: Record<string, { version: string; sqlite: boolean }> = {
|
|
'/old/node': { version: '20.11.0', sqlite: false },
|
|
'/new/node': { version: '22.15.0', sqlite: true },
|
|
}
|
|
const probe = (bin: string) => probes[bin] ?? null
|
|
|
|
it("uses the editor's own Node when it is new enough and has node:sqlite", () => {
|
|
expect(chooseRuntime({ host: { version: '24.21.0', sqlite: true }, configured: '', candidates: ['/new/node'], probe })).toEqual({ kind: 'host', version: '24.21.0' })
|
|
})
|
|
|
|
it('prefers a configured Node that works', () => {
|
|
expect(chooseRuntime({ host: { version: '24.21.0', sqlite: true }, configured: '/new/node', candidates: [], probe })).toEqual({ kind: 'node', bin: '/new/node', version: '22.15.0' })
|
|
})
|
|
|
|
it('falls back to a discovered Node when the editor is too old', () => {
|
|
expect(chooseRuntime({ host: { version: '20.18.0', sqlite: false }, configured: '/old/node', candidates: ['/missing', '/old/node', '/new/node'], probe }))
|
|
.toEqual({ kind: 'node', bin: '/new/node', version: '22.15.0' })
|
|
})
|
|
|
|
it('runs degraded on the editor when nothing else works', () => {
|
|
expect(chooseRuntime({ host: { version: '20.18.0', sqlite: false }, configured: '', candidates: ['/old/node'], probe }))
|
|
.toEqual({ kind: 'degraded', version: '20.18.0', sqlite: false })
|
|
})
|
|
})
|