Skip to content

Commit 702012a

Browse files
committed
Record verified rewrite status and remaining gates
Add the upstream export coverage count, note the missing parity-closure examples and protocol fuzz target, mark each completion gate as done, partial, or not started, and reorder the next implementation work.
1 parent 4d22f7d commit 702012a

1 file changed

Lines changed: 46 additions & 23 deletions

File tree

docs/PURE_ZIG_REFACTOR.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ the Zig standard library and launching an installed browser remain in scope.
1919

2020
## Current Rewrite Status
2121

22-
Status snapshot: 2026-07-31.
22+
Status snapshot: 2026-08-03.
2323

2424
The external-browser core is now implemented in Zig on top of pinned Linsang.
2525
The legacy wrapper, C API, compatibility files, and examples have been
@@ -31,12 +31,19 @@ deleted.
3131
| Browser bridge | Bindings, typed arguments and replies, events, deferred replies, JavaScript evaluation, raw data, navigation, and multiple clients are implemented. |
3232
| Content and lifecycle | HTML, directories, custom handlers, external URLs, runtime content replacement, default directories, favicons, directory monitoring, logging, and deterministic shutdown are implemented. |
3333
| Browser integration | Default URL opening, browser discovery, explicit browser selection, typed launch controls, managed profiles, Chromium-family proxies, custom executables and argv, direct child tracking, replacement, and shutdown cleanup are implemented. |
34-
| Current validation | `zig build test`, native builds, Windows x86_64 builds, macOS aarch64 builds, and Windows/macOS test-module cross-compilation pass. |
34+
| Examples and fuzzing | Only the minimal example is retained. The parity-closure examples and the protocol fuzz target are not written. |
35+
| Current validation | `zig build test` passes 17 Zig tests and the Node bridge test. All five release-gate targets build. The build graph contains no C. |
3536

36-
Remaining work is limited to browser window controls and geometry, portable
37-
host high-contrast and parent-process detection, server-side runtimes, optional
38-
native WebViews and handles, and the final parity validation gates. The
39-
coverage ledger below is the authoritative method-level list.
37+
`include/webui.h` at the pinned upstream commit exports 111 functions. The 16
38+
`webui_interface_*` entries are permanently omitted with the C ABI, leaving 95
39+
in scope; 79 are implemented or have an explicit Zig replacement and 16 remain.
40+
Every upstream export appears in the ledger below, which is the authoritative
41+
method-level list.
42+
43+
Remaining work is browser window controls and geometry, portable host
44+
high-contrast and parent-process detection, server-side runtimes, optional
45+
native WebViews and handles, the retained examples, and the final parity
46+
validation gates.
4047

4148
## Original Baseline
4249

@@ -321,6 +328,10 @@ implementations.
321328

322329
### Missing or Partial Backend Capabilities
323330

331+
These rows are the 16 remaining in-scope upstream exports. Every other export
332+
appears in the replacement table below or in the omitted `webui_interface_*`
333+
row.
334+
324335
| Upstream API | Current gap |
325336
|---|---|
326337
| `webui_focus()`, `webui_minimize()`, `webui_maximize()`, `webui_set_hide()` | Runtime browser window lifecycle controls are not implemented. |
@@ -491,18 +502,22 @@ zig build -Dtarget=x86_64-macos
491502
zig build -Dtarget=aarch64-macos
492503
```
493504

494-
- Protocol tests cover every command, truncated packets, invalid lengths,
495-
invalid tokens, and unknown commands.
496-
- Node's built-in test runner covers browser bridge command behavior without
497-
npm dependencies.
498-
- Integration tests cover HTTP content, WebSocket handshake, JavaScript-to-Zig,
499-
Zig-to-JavaScript, disconnect, and shutdown.
500-
- Fuzz input never panics or reads out of bounds. Messages and pending calls
501-
have explicit limits.
502-
- `rg 'webui_new|pub extern fn webui_' src` returns no results.
503-
- The build graph contains only the Zig standard library and pinned Linsang,
504-
with no WebUI or CivetWeb artifact.
505-
- Core integration tests leak no memory under the debug allocator.
505+
All five builds and both test runners pass as of the status snapshot. Gate
506+
status:
507+
508+
- Done: Node's built-in test runner covers browser bridge command behavior
509+
without npm dependencies.
510+
- Done: integration tests cover HTTP content, WebSocket handshake,
511+
JavaScript-to-Zig, Zig-to-JavaScript, disconnect, and shutdown.
512+
- Done: `rg 'webui_new|pub extern fn webui_' src` returns no results.
513+
- Done: the build graph contains only the Zig standard library and pinned
514+
Linsang, with no WebUI or CivetWeb artifact.
515+
- Done: core integration tests leak no memory under the debug allocator.
516+
- Partial: `protocol.zig` has two direct decode tests. Coverage of every
517+
command, truncated packets, invalid lengths, invalid tokens, and unknown
518+
commands is incomplete.
519+
- Not started: a fuzz target proving untrusted input never panics or reads out
520+
of bounds. Messages and pending calls already have explicit limits.
506521

507522
## Main Risks
508523

@@ -518,8 +533,16 @@ zig build -Dtarget=aarch64-macos
518533

519534
## Next Implementation Work
520535

521-
Continue capability parity:
522-
523-
1. Add portable parent-process and host high-contrast detection.
524-
2. Implement or explicitly reject the remaining platform-specific runtime
525-
window controls.
536+
Ordered by cost against ledger progress:
537+
538+
1. Add portable parent-process and host high-contrast detection. Both are small
539+
standard-library accessors that close two ledger rows.
540+
2. Write the retained examples for bindings, dynamic content, public TLS, and
541+
managed browsers.
542+
3. Complete the protocol decode tests and add the fuzz target.
543+
4. Implement or explicitly reject the remaining runtime window controls per
544+
browser and platform. External browsers cannot honor most of them, so an
545+
explicit unsupported error is an acceptable outcome for a given pair.
546+
5. Defer server-side runtimes and native WebViews until after the breaking
547+
release. Runtimes widen the execution surface and WebViews need the separate
548+
design review that the pure Zig boundary requires.

0 commit comments

Comments
 (0)