Repository navigation
Description
urlcode doctor reports the pre-0.4.0-alpha.2 trust model as machine-readable fact. This is not a documentation defect — it is shipped CLI output, and an operator or CI job can gate on it.
Observed
node src/cli.ts doctor on current main:
{"node":"v26.8.2","platform":"darwin","architecture":"arm64","runtime":"node-process",
"functionSandbox":"quickjs-wasm","network":false,"filesystem":false,"guestNetwork":false,
"hostEgress":"revision-pinned-origin-grants", ...}The source is a single hard-coded object literal, src/cli.ts:289. None of those four values is computed from anything — not from the project, not from whether any route declares sandbox: true.
Why it is wrong
Since 0.4.0-alpha.2, function/middleware routes run trusted and in-process with full Node access unless a route declares sandbox: true (src/types.ts, src/runtime.ts splitting on sandbox === true). So for a default project:
"functionSandbox":"quickjs-wasm"— no sandbox is in use at all unless a route opts in."filesystem":false— trusted routes have full filesystem access."network":false/"guestNetwork":false— trusted routes havefetchand sockets.
doctor is what an operator runs to ask the runtime what it is. It currently answers with the security posture of the previous major default, and it answers the same way whether or not a single route is sandboxed.
The repository already disagrees with itself
src/context.ts:46-48 — the agent-facing context — gets this exactly right, including the nuance:
guestNetwork: {value: true, note: 'Trusted (default) functions and middleware run in-process with full Node network access; route \sandbox: true` runs that route in a WASM sandbox without fetch or sockets…'}`
nodeApis: {value: true, note: 'Trusted (default) functions and middleware have full Node built-ins, process, filesystem and npm packages available, same as any other project code…'}
So the correct wording already exists in the codebase. doctor was simply never updated alongside it, and nothing caught the divergence: scripts/check-trust-model-prose.ts scans Markdown (plus llms.txt/llms-full.txt) and cannot see a TypeScript object literal.
Blast radius beyond the CLI
packaging/homebrew/urlcode.rb.template:31 asserts the stale value as a release gate:
assert_equal "quickjs-wasm", report["functionSandbox"]That test passes because the bug is present, so fixing doctor will fail the Homebrew formula test until the template is updated in the same change. The rendered formula in jimhoyd-com/homebrew-urlcode carries the same assertion and is regenerated from this template by scripts/render-homebrew.ts, so the template is the right place to fix it.
Suggested shape
The single functionSandbox field cannot express the current model, because the answer is per-route. Something like:
"functionDefault": "trusted-in-process",
"sandboxEngine": "quickjs-wasm",
"sandboxedRoutes": 0,
"trustedRoutes": 3with network/filesystem/guestNetwork either removed or scoped explicitly to the sandboxed path, since as flat booleans they cannot be true of both modes at once. Counting routes requires a project, and doctor may be run without one — in that case the counts should be omitted rather than guessed.
This is a breaking change to doctor's output shape. It is worth taking deliberately rather than patching the values in place, because the field name functionSandbox encodes the assumption that there is one answer.
Not established
I have not audited every other CLI subcommand's JSON output for the same class of stale claim. doctor was found by following a stale caveat in the Homebrew formula; a systematic pass over src/cli.ts's printed objects is warranted and is not covered by any current check.
Activity