Skip to content

v0.3.8

Choose a tag to compare

@github-actions github-actions released this 26 Nov 12:16
· 75 commits to main since this release
7ee5224

0.3.8

A fourth independent review, of 0.3.7, found seven gaps (#369). This release closes them, together with what an adversarial pass of our own found before asking for another review. No API change. Where a guarantee has a limit, the limit is stated next to it.

Fixed: a failed fill() (#370)

  • Each own accessor on the error is called once per call; 0.3.7 ran a getter 2 or 3 times.
  • A copy keeps the shape of what it replaces: an array keeps its length (a sparse array of length 4 came back with length 1), a Map or Set keeps its subclass prototype, and an accessor that throws is kept as it is.
  • An Error that cannot be rewritten in place (frozen, or holding a field that is neither writable nor configurable) is replaced by a native error with the same prototype. It is a different object, so that error's identity is not kept.
  • A boxed string that carries the value becomes a scrubbed string; 0.3.7 did not detect it.
  • An error that cannot be read at all (a Proxy whose traps throw) is replaced by a plain error that says so; before, the trap's own error replaced the fill error.

What redaction reaches: strings; numbers and bigints whose digits contain the value; own properties, string- and symbol-keyed, enumerable or not; array elements; Map and Set entries.
What it does not reach: property names; symbols and functions; private fields; what only a prototype accessor or a method computes (the text of a URL, Headers or Request); and objects returned as they are, own properties included: binary buffers, Date, RegExp, Promise, WeakMap, WeakSet.
A value shorter than four characters is removed only as a whole token: fill("a") on locator a a7 leaves a7 readable. That is a readability rule, not a secrecy guarantee.

Fixed: reaping an orphaned browser before its profile is reused

  • After the 5 s grace that follows SIGTERM, SIGKILL goes only to what is still the recorded browser (same pid and start time). A pid that passed to another process in that window is left alone.
  • After the 2 s bound that follows SIGKILL, only an entry that has exited and waits to be collected is passed, because it holds no files. A process that is still running makes connectPipe fail with an error naming the pid and the profile, and its pidfile stays for the next attempt. 0.3.7 removed the pidfile and launched either way.
  • On Windows, and wherever the process state cannot be read, a listed process counts as running.

Docs checks (the bundled skill)

  • A clock call is recognized by its written path, with dots or strings in brackets and with or without a leading globalThis, window or self: page["waitForTimeout"](50), globalThis.Bun.sleep(50), window.scheduler.wait(1000). A delay written as arithmetic on numbers (60 * 1000) counts; a written zero does not; Atomics.wait counts only with a timeout. Outside the check: an alias (an import under another name, .call, .apply, .bind), a name built at run time, and an inline callback whose delay is not written as a number.
  • // given: counts only as a real line comment. Page globals (document, window, ...) are accepted only inside a function handed to the page (inline, or declared in the example and passed by name); host globals (process, Bun, tool, ...) only outside one. Not modelled: such a function cannot see the example's own variables, and code passed to the page as a string is not read.

Tests

  • Five new redaction tests: two fail on 0.3.7, three on the commit before their fix. The two docs-check tables fail on the 0.3.7 checker. A new test builds a real uncollected child process and checks that it is told apart from its running parent (Linux and macOS; skipped on Windows and where python3 is missing).
  • The navigation fixture closes its server in its own release step and reports a failed close.
  • Not tested: the reap's branches for a process that survives SIGKILL and for a pid recycled inside the grace window (no test can make either on demand; their inputs are tested), and the fixture's failure paths.

Corrections (2026-11-26)

A further review found these statements above wrong or wider than what 0.3.8 does (#372):

  • "Each own accessor on the error is called once per call": the redaction reads an own property at most once, but the engine calls an error's own name (and message) accessor itself when stack is first read, so such a getter can run twice. A boxed string's own properties are not read at all.
  • "replaced by a native error with the same prototype" and "objects returned as they are": true only within one realm in 0.3.8. An Error or a Date made in another realm (vm.runInNewContext, an iframe) is copied like a plain object, and a SharedArrayBuffer is copied into an object whose byteLength throws. Fixed in the next release.
  • "A value shorter than four characters": 0.3.8 counts UTF-16 code units, so two emoji count as four and are removed even between two letters. The next release counts code points.
  • "SIGKILL goes only to what is still the recorded browser": the pid is re-checked right before the signal, but the check and the signal are two steps; a pid that changes hands between them is not protected.
  • Docs checks: "a delay written as arithmetic on numbers counts" holds for * / + - only (not ** or %); "a written zero does not" does not hold for Atomics.wait(a, 0, 0, 0), which is flagged; (page?.waitForTimeout)(2) is not flagged; globalThis["Bun.sleep"](2) is flagged as if it were Bun.sleep.
  • #356: the raw-TLS scan does not "start a node process to strip types from every source file". It parses JavaScript files directly and strips TypeScript in-process where the runtime provides stripTypeScriptTypes, falling back to one node subprocess for the batch. Why it exceeds 5 s under load is not established.

Known, filed

  • #356: under heavy load the raw-TLS source scan exceeds its 5 s default (it starts a node process to strip types from every source file). On a build box at load 42-59 the full suite passed once and failed on that one test twice (5.5 s, 10.3 s). #364: one slow Windows run of a SQLite test. Neither is touched here.

Verification

Hosted CI: Linux (bun and Node), macOS and Windows pass at the merged head.

What's Changed

  • fix: redaction edge cases, a reap that reports a live orphan and spares a recycled pid, docs checks by path and realm by @code-yeongyu in #370
  • chore(release): 0.3.8 by @code-yeongyu in #371

Full Changelog: v0.3.7...v0.3.8