Fixes
Release rolling / release (push) Successful in 10m16s

This commit is contained in:
2026-08-18 23:56:09 -04:00
parent 7184b17553
commit eb0683abe3
11 changed files with 170 additions and 13 deletions
@@ -29,6 +29,22 @@ test('mutate paths use a denylist (base system read-only, rest writable)', async
t.absent(s.bareAgentPathAllowedMutate('/'))
})
test('normalize guest script strips ctx redeclare and export', async (t) => {
const s = load()
const n = s.bareAgentNormalizeGuestScript
const exported = n(
'export async function run(ctx, argv) {\n const vfs = ctx.vfs\n}\nexport { run }\n'
)
t.ok(exported.includes('async function run(ctx, argv)'))
t.absent(exported.includes('export'))
const rebound = n('const ctx = {}\nctx.console.log(1)\n')
t.ok(rebound.includes('async function run(ctx, argv)'))
t.absent(/const ctx/.test(rebound))
const plain = n('ctx.console.log("hi")')
t.ok(plain.includes('async function run(ctx, argv)'))
t.ok(plain.includes('ctx.console.log'))
})
test('reads allow any absolute path including kernel /proc', async (t) => {
const s = load()
t.ok(s.bareAgentPathAllowedRead('/home/guest/x'))