opencode/packages/codemode/test
Ryan Vogel 3d1addb2ac fix(core): ask the webfetch permission for Code Mode fetch calls
The execute (Code Mode) tool exposes a `fetch` global that went straight to
the network. The webfetch tool asks the `webfetch` permission for every URL,
but Code Mode did not, so a `webfetch: deny` rule or a Console "Can't fetch
the web" policy did nothing against a model that used `execute` to send data
to any server.

- core: the tool registry now asserts the `webfetch` permission (resource =
  the URL, same shape as the webfetch tool) in the extension.before hook of
  every fetch a Code Mode program makes. A denied URL throws inside the
  program and its progress row settles as an error. Tool.node now depends on
  Permission.node.
- codemode: extension globals were called before their `extension.before`
  hook ran, so a failing hook only hid the result while the request had
  already been sent. The hook now runs first and a denied call never reaches
  the host function. A denied async global still rejects its promise; any
  other denied global throws.

Verified: new cases in codemode/test/codemode.test.ts (denied host function
is never called) and core/test/tool-execute.test.ts (webfetch deny rule fails
the script's fetch, allow rule lets it through, each URL is asserted) both go
red without the fix. bun typecheck in core and codemode, codemode suite
(1415 pass), core suite (only pre-existing local failures: ripgrep download
and macOS bash 3.2 shell tests, also failing on dev), bun run check.
2026-10-26 14:30:37 -04:00
..
fixtures test(codemode): isolate OpenAPI fixtures (#49667) 2026-09-17 23:01:36 -05:00
test262 feat(codemode): add WeakMap and WeakSet (#51257) 2026-09-25 00:15:19 -05:00
array-callbacks-test262.test.ts fix(codemode): honor Uint8Array.from mappers, compare byte searches without coercion, skip flatMap holes, and truncate fractional radixes (#57285) 2026-10-20 00:16:55 -05:00
array-core-test262.test.ts feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00
callbacks.test.ts fix(codemode): coerce built-in arguments as in JS instead of requiring numbers and strings (#50492) 2026-09-21 23:04:04 -05:00
codemode.test.ts fix(core): ask the webfetch permission for Code Mode fetch calls 2026-10-26 14:30:37 -04:00
constructor-test262.test.ts feat(codemode): resolve constructor to the owning built-in (#48233) 2026-09-09 20:14:29 -05:00
date-test262.test.ts feat(codemode): complete date parity (#37960) 2026-07-20 12:13:16 -05:00
enumeration.test.ts refactor(codemode): move built-ins onto real prototypes with native function objects (#48608) 2026-09-12 02:19:30 -05:00
errors.test.ts fix(codemode): compare with == by IsLooselyEqual and stop deep-walking operands for opaque references (#50830) 2026-09-24 00:36:41 -05:00
extensions.test.ts feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00
for-await-test262.test.ts refactor(codemode): type program values and let built-ins answer for themselves (#50191) 2026-09-21 11:03:16 -05:00
generator-test262.test.ts fix(codemode): bind generator parameters at the call, not the first next() (#50489) 2026-09-21 22:42:10 -05:00
groupby-test262.test.ts feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00
json-callbacks-test262.test.ts feat(codemode): bind this and arguments in functions, add Function.prototype.call, apply, and bind (#50831) 2026-09-24 16:34:46 -05:00
labeled-control-test262.test.ts feat(codemode): support labeled control flow (#38035) 2026-07-20 23:36:24 -05:00
lexical-test262.test.ts fix(codemode): enforce lexical temporal dead zones (#37358) 2026-07-16 22:26:45 -05:00
LICENSE.test262 test(codemode): add Test262 string coverage (#35940) 2026-07-08 15:51:54 -05:00
LICENSE.wpt feat(codemode): add atob, btoa, and crypto.randomUUID (#48290) 2026-09-10 01:21:41 -05:00
limits.test.ts test(codemode): extend promise limit timeout (#50693) 2026-09-22 13:22:21 -04:00
new-expression.test.ts feat(codemode): bind this and arguments in functions, add Function.prototype.call, apply, and bind (#50831) 2026-09-24 16:34:46 -05:00
object-coercion-test262.test.ts refactor(codemode): give programs their own objects and arrays (#48527) 2026-09-11 13:36:35 -05:00
openapi.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
parity.test.ts feat(codemode): add WeakMap and WeakSet (#51257) 2026-09-25 00:15:19 -05:00
promise-test262.test.ts feat(codemode): assimilate promise thenables (#38237) 2026-07-21 23:32:02 -05:00
promise.test.ts fix(codemode): run each job to completion (#54276) 2026-10-20 13:19:00 -05:00
regexp-math-test262.test.ts refactor(codemode): treat prototype-named keys as ordinary data (#48218) 2026-09-09 16:54:55 -05:00
set-methods-test262.test.ts feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00
signature.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
stdlib.test.ts fix(codemode): honor Uint8Array.from mappers, compare byte searches without coercion, skip flatMap holes, and truncate fractional radixes (#57285) 2026-10-20 00:16:55 -05:00
string-core-test262.test.ts chore: generate 2026-08-08 04:21:03 +00:00
string-date-methods-test262.test.ts feat(codemode): add substr, well-formed, and Date string methods (#48275) 2026-09-09 23:29:34 -05:00
string-regexp-test262.test.ts chore: generate 2026-08-08 04:21:03 +00:00
string-search-test262.test.ts chore: generate 2026-08-08 04:21:03 +00:00
test262.test.ts test(codemode): run test262 files verbatim from a local checkout (#48446) 2026-09-11 10:40:02 -05:00
tool-paths.test.ts feat(codemode): honor program valueOf and toString in operators and conversions (#50837) 2026-09-24 18:45:48 -05:00
var-hoisting-test262.test.ts fix(codemode): live Map/Set forEach, generator prototypes, repeated function declarations, delete on non-references (#50450) 2026-09-21 18:09:45 -05:00
web-wpt.test.ts feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00