Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f2c8a31
Merge pull request #443 from ambroise-leclerc/master
ambroise-leclerc Oct 31, 2026
fc33cd6
Propose ADR-020 for system services
ambroise-leclerc Oct 31, 2026
b906203
Add ADR-020 prerequisites and address review findings
ambroise-leclerc Oct 31, 2026
6133345
Enable /bigobj for MSVC and default to Release (#464)
ambroise-leclerc Oct 31, 2026
833dabe
Make WebFrontLifeReact project optional, restore RelWithDebInfo defau…
ambroise-leclerc Oct 31, 2026
b19a9dd
Pick a default configuration present in CMAKE_CONFIGURATION_TYPES and…
ambroise-leclerc Nov 1, 2026
06ea727
Use a new directory and refuse overwriting in the Life React instruct…
ambroise-leclerc Nov 1, 2026
10b70f9
Do not set CMAKE_DEFAULT_BUILD_TYPE when CMAKE_DEFAULT_CONFIGS is given
ambroise-leclerc Nov 1, 2026
13f6ae4
Merge pull request #465 from ambroise-leclerc/464-msvc-bigobj-release…
AM-L Nov 1, 2026
c405b7f
Specify root confinement and read-token binding in ADR-020
ambroise-leclerc Nov 1, 2026
e1dead2
Bound token exposure and align the native-backend criterion in ADR-020
ambroise-leclerc Nov 1, 2026
64756ba
Scope token binding and HTML picker authority honestly in ADR-020
ambroise-leclerc Nov 1, 2026
3c532ed
Neutralize active content, declare transport and survive cookie races…
ambroise-leclerc Nov 1, 2026
a014947
State the trust assumption for directories moved out of a root in ADR…
ambroise-leclerc Nov 1, 2026
894da46
Limit the POSIX move guarantee and attach roots to their location in …
ambroise-leclerc Nov 1, 2026
2de6356
Require trusted owners for root ancestors and drop the launch secret …
ambroise-leclerc Nov 1, 2026
4adda4a
Merge pull request #444 from ambroise-leclerc/adr-020-system-services
AM-L Nov 1, 2026
d86bcab
Capture d'image et enregistrement de la vue web pour les tests consom…
ambroise-leclerc Nov 1, 2026
e197cc6
Declare the embedded frontend without consumer-side macros (#467)
ambroise-leclerc Nov 1, 2026
0a9ec88
Count CEF as an embedded engine in embeddedFrontendAvailable and Embe…
ambroise-leclerc Nov 1, 2026
b05425f
Fix the embedded frontend fallback example: limit the try to construc…
ambroise-leclerc Nov 1, 2026
1f7d542
State when each embedded engine reports an unusable runtime and what …
ambroise-leclerc Nov 1, 2026
ecbacd0
Select the embedded frontend in a function template in the fallback e…
ambroise-leclerc Nov 1, 2026
fc3fd46
Merge pull request #471 from ambroise-leclerc/467-embedded-frontend-c…
AM-L Nov 1, 2026
645fce1
Add init, create, install, restore and embed to the automation contra…
ambroise-leclerc Nov 1, 2026
840a551
Advance the developer environment sources to 0.6.4 and refresh the bu…
ambroise-leclerc Nov 1, 2026
7a631c0
Refuse setup grants on environments older than 0.6.4 and document emb…
ambroise-leclerc Nov 1, 2026
4c33e17
Let the automation create operation load the pinned starter and test …
ambroise-leclerc Nov 1, 2026
f9a3ccf
Merge pull request #472 from ambroise-leclerc/466-automation-setup-op…
AM-L Nov 1, 2026
4bda53a
Run authorized native programs and use private temporary spaces from …
ambroise-leclerc Nov 1, 2026
4d7a169
Fix the Windows handle assignment, orphaned programs, ignored SIGCHLD…
ambroise-leclerc Nov 1, 2026
c05a240
Merge develop and fix output starvation, PID reuse and inherited nati…
ambroise-leclerc Nov 1, 2026
d93f9e2
Cancel Windows pipe reads, report a missing authorized program as lau…
ambroise-leclerc Nov 1, 2026
a50b47f
Compile the host probe as C++23 on every platform (#445)
ambroise-leclerc Nov 1, 2026
c8ab04a
Build the process runner on macOS and the probe on MSVC (#445)
ambroise-leclerc Nov 1, 2026
0046756
Reset signal dispositions in the program, validate the request early …
ambroise-leclerc Nov 1, 2026
35750b9
Read UTF-8 arguments and environment in the probe on Windows and use …
ambroise-leclerc Nov 1, 2026
c3f5566
Write the probe's output in binary mode on Windows (#445)
ambroise-leclerc Nov 1, 2026
6f93138
Keep pipe ends above the standard descriptors, bound file reads to 64…
ambroise-leclerc Nov 1, 2026
4b7f639
Keep the exec failure pipe above the standard descriptors (#445)
ambroise-leclerc Nov 1, 2026
04688ab
Merge pull request #473 from ambroise-leclerc/445-consumer-native-pro…
AM-L Nov 1, 2026
60a49dc
Prepare WebFront 0.8.0 release
ambroise-leclerc Nov 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ if(WEBFRONT_IS_TOP_LEVEL)
endif()
add_library(WebFront_options INTERFACE)
target_compile_features(WebFront_options INTERFACE cxx_std_23)
# The header-only library instantiates enough templates for the examples to exceed MSVC's default
# object-file section limit (error C1128).
target_compile_options(WebFront_options INTERFACE "$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
# Do not force-define __cpp_lib_format on the command line: unlike a header setting it after
# actually providing <format>, a command-line -D applies from the start of every translation
# unit, so other standard headers (e.g. <vector>) that gate their own <format> integration on
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ Native engines are detected by default, except in WebFront's own test and fuzzin

For explicit engine selection, `webfront_native_frontend_option(out)` and `webfront_setup_frontends_for_target(MyApp)` are also callable from the parent or other directories. The latter applies setup for all enabled engines; the native helper selects only the platform's native engine and never CEF. See [WKWebView](docs/WKWEBVIEW.md), [WebKitGTK](docs/WEBKITGTK.md) and the [frontend architecture](docs/adr/README.md).

## Test your application

The optional [Jasmine and CTest integration](docs/CONSUMER_TESTING.md) runs browser specs against your application's page. Specs can capture PNG screenshots and image sequences, and can run native programs explicitly authorized by the test owner with `PROGRAMS`, using private temporary spaces for test files. The native-program browser integration is validated on Linux with CEF; see the guide for platform coverage and limitations. Authorized programs run with the user's permissions, so use trusted test code.

To select an embedded engine explicitly, `webfront::embeddedFrontendAvailable` reports whether one is compiled in and `webfront::EmbeddedWebFront` selects it. See [frontend selection](docs/FRONTENDS.md).

## Build and test

```bash
Expand Down
12 changes: 11 additions & 1 deletion cmake/RunWebFrontJasmine.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CTest owns this process. Its timeout remains outside the browser, even if JS stops responding.
file(REMOVE "${DIRECTORY}/report.json")
file(REMOVE_RECURSE "${DIRECTORY}/captures")
# The temporary spaces of the specs never survive into the next run, even if the previous one was killed.
file(REMOVE_RECURSE "${DIRECTORY}/temp")
# An inherited grant must never reach a test that has none: an empty value is read as no grant.
set(host_environment "[==[WEBFRONT_JASMINE_HOST=]==]")
if(HOST)
# The owner's native grant (webfront_add_jasmine_test PROGRAMS); without it the application reads no such file.
set(host_environment "[==[WEBFRONT_JASMINE_HOST=${DIRECTORY}/host-${CONFIG}.json]==]")
endif()
file(READ "${DIRECTORY}/arguments-${CONFIG}.json" json)
string(JSON count LENGTH "${json}")
# Bracket arguments are literal: they keep empty strings and semicolons that a list expansion would lose.
Expand All @@ -26,12 +35,13 @@ if(NOT CMAKE_HOST_WIN32)
set(wrapper "[==[sh]==] ${wrapper}")
endif()
cmake_language(EVAL CODE "execute_process(COMMAND ${wrapper} [==[${CMAKE_COMMAND}]==] -E env
[==[WEBFRONT_JASMINE_CONFIG=${DIRECTORY}/config.json]==]
[==[WEBFRONT_JASMINE_CONFIG=${DIRECTORY}/config.json]==] ${host_environment}
[==[XDG_DATA_HOME=${DIRECTORY}/profile/data]==] [==[XDG_CACHE_HOME=${DIRECTORY}/profile/cache]==]
[==[WEBFRONT_TEST_CEF_PROFILE=${DIRECTORY}/profile/cef]==]
[==[WEBFRONT_TEST_WEBVIEW2_PROFILE=${DIRECTORY}/profile/webview2]==]
${prefix} [==[${PROGRAM}]==]${arguments}
RESULT_VARIABLE status TIMEOUT ${backstop})")
file(REMOVE_RECURSE "${DIRECTORY}/temp")
if(status MATCHES "timeout" OR status STREQUAL "124")
message(FATAL_ERROR "Jasmine application timed out after ${LIMIT} seconds")
endif()
Expand Down
12 changes: 12 additions & 0 deletions cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"Release"
"MinSizeRel"
"RelWithDebInfo")
elseif(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" AND NOT CMAKE_DEFAULT_BUILD_TYPE AND NOT CMAKE_DEFAULT_CONFIGS)
# Only Ninja Multi-Config accepts this variable. Visual Studio and Xcode build Debug unless --config is given.
# The default must belong to CMAKE_CONFIGURATION_TYPES, or generation fails.
foreach(_webfront_candidate RelWithDebInfo Release Debug)
if(_webfront_candidate IN_LIST CMAKE_CONFIGURATION_TYPES)
set(CMAKE_DEFAULT_BUILD_TYPE ${_webfront_candidate})
break()
endif()
endforeach()
if(NOT CMAKE_DEFAULT_BUILD_TYPE AND CMAKE_CONFIGURATION_TYPES)
list(GET CMAKE_CONFIGURATION_TYPES 0 CMAKE_DEFAULT_BUILD_TYPE)
endif()
endif()

# Generate compile_commands.json to make it easier to work with clang based tools
Expand Down
33 changes: 28 additions & 5 deletions cmake/WebFrontJasmine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ function(_webfront_jasmine_quote value output)
endfunction()

# webfront_add_jasmine_test(NAME name TARGET application SPECS files... [ARGS ...]
# [FRONTEND engine] [TIMEOUT seconds] [JASMINE path/to/jasmine.js])
# [FRONTEND engine] [TIMEOUT seconds] [JASMINE path/to/jasmine.js] [PROGRAMS programs...])
# TARGET must retain webfront::testing::JasmineTest before show() in its test-enabled build; the helper defines
# WEBFRONT_JASMINE_TESTING on it, and without that macro JasmineTest is inert. ARGS reach the application literally,
# as individual arguments (empty ones, semicolons and '$<' included).
# as individual arguments (empty ones, semicolons and '$<' included). PROGRAMS is the owner's native grant: the absolute
# paths (generator expressions such as $<TARGET_FILE:tool> are fine) that the specs may run through webFrontHost.run,
# without a shell. Without it every webFrontHost call rejects. See docs/CONSUMER_TESTING.md.
function(webfront_add_jasmine_test)
cmake_parse_arguments(PARSE_ARGV 0 ARG "" "NAME;TARGET;FRONTEND;TIMEOUT;JASMINE" "SPECS;ARGS")
cmake_parse_arguments(PARSE_ARGV 0 ARG "" "NAME;TARGET;FRONTEND;TIMEOUT;JASMINE" "SPECS;ARGS;PROGRAMS")
if(ARG_UNPARSED_ARGUMENTS OR ARG_KEYWORDS_MISSING_VALUES OR NOT ARG_NAME OR NOT ARG_TARGET OR NOT ARG_SPECS)
message(FATAL_ERROR "webfront_add_jasmine_test requires NAME, TARGET, SPECS and valid named arguments")
endif()
Expand Down Expand Up @@ -102,6 +104,9 @@ function(webfront_add_jasmine_test)
set(config "{}")
string(JSON config SET "${config}" files "${files}")
string(JSON config SET "${config}" report "${report}")
# Screenshots and recordings of the specs (webFrontCapture) are written here.
_webfront_jasmine_quote("${directory}/captures" captures)
string(JSON config SET "${config}" captures "${captures}")
file(WRITE "${directory}/config.json" "${config}\n")
set(arguments "[]")
set(index 0)
Expand All @@ -113,7 +118,7 @@ function(webfront_add_jasmine_test)
if(argument STREQUAL "ARGS")
set(in_args ON)
continue()
elseif(argument MATCHES "^(NAME|TARGET|FRONTEND|TIMEOUT|JASMINE|SPECS)$")
elseif(argument MATCHES "^(NAME|TARGET|FRONTEND|TIMEOUT|JASMINE|SPECS|PROGRAMS)$")
set(in_args OFF)
endif()
if(NOT in_args)
Expand All @@ -129,6 +134,24 @@ function(webfront_add_jasmine_test)
math(EXPR index "${index} + 1")
endforeach()
file(GENERATE OUTPUT "${directory}/arguments-$<CONFIG>.json" CONTENT "${arguments}\n")
set(host OFF)
if(ARG_PROGRAMS)
set(host ON)
set(programs "[]")
set(index 0)
foreach(program IN LISTS ARG_PROGRAMS)
if(NOT program MATCHES "^(\\$<|/|[A-Za-z]:[/\\\\])")
message(FATAL_ERROR "A Jasmine PROGRAMS entry must be an absolute path or a generator expression: ${program}")
endif()
_webfront_jasmine_quote("${program}" quoted)
string(JSON programs SET "${programs}" ${index} "${quoted}")
math(EXPR index "${index} + 1")
endforeach()
_webfront_jasmine_quote("${directory}/temp" temporary)
# Generated, not written at configure time: the programs are usually $<TARGET_FILE:...> of the build.
file(GENERATE OUTPUT "${directory}/host-$<CONFIG>.json"
CONTENT "{\"programs\":${programs},\"temporary\":${temporary}}\n")
endif()
set(prefix "")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND ARG_FRONTEND)
find_program(_webfront_jasmine_xvfb xvfb-run REQUIRED)
Expand All @@ -137,7 +160,7 @@ function(webfront_add_jasmine_test)
target_compile_definitions("${ARG_TARGET}" PRIVATE WEBFRONT_JASMINE_TESTING=1)
add_test(NAME "${ARG_NAME}" COMMAND "${CMAKE_COMMAND}"
"-DPROGRAM=$<TARGET_FILE:${ARG_TARGET}>" "-DDIRECTORY=${directory}" "-DCONFIG=$<CONFIG>"
"-DPREFIX=${prefix}" "-DLIMIT=${ARG_TIMEOUT}"
"-DPREFIX=${prefix}" "-DLIMIT=${ARG_TIMEOUT}" "-DHOST=${host}"
-P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/RunWebFrontJasmine.cmake")
math(EXPR outer_timeout "${ARG_TIMEOUT} + 15")
set_tests_properties("${ARG_NAME}" PROPERTIES TIMEOUT "${outer_timeout}" LABELS "web-integration")
Expand Down
27 changes: 21 additions & 6 deletions docs/AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ test configurations also build the launcher for their regression tests. Without
embedded engine, requesting the launcher fails configure instead of opening a system browser.
The implementation is native C++23; no Node.js, npm or Python is required to run the launcher.

Provision an environment containing automation API v1 (0.6.3 or later). Environment 0.6.2
Provision an environment containing automation API v1 (0.6.3 or later). The setup operations (`init`, `create`, `install`,
`restore`, `embed`) need environment **0.6.4 or later**: the launcher checks this at startup, and granting one of them to an
older environment fails with a bootstrap error (status 70) naming the operation, instead of failing each run.
`create` needs the starter archives (`<name>-starter.tgz`, such as `life-starter.tgz` of a distribution build) in the same
directory as the `--environment` archive: the launcher serves only files of that name from there, and the environment's
manifest pins their SHA-512, so the directory is not trusted for content. Environment 0.6.2
predates that API; passing an older environment produces a bootstrap error with status 70.
The launcher takes an explicit archive and its independently trusted SHA-512 SRI. Use a verified
published distribution or build one in this repository:
Expand All @@ -41,8 +46,7 @@ build-agent/test/web/webfront-wf --project "$PWD" --manifest-dir js/developer --
```

`build-distribution/provision.json` gives the resulting integrity. Project packages must also be
installed/restored beforehand through wf. Package installation and network restoration are not
agent tools. Tests use configure-provisioned packages and a local registry, with no public network
installed/restored beforehand through wf, or by an agent granted `install`/`restore`. Tests use configure-provisioned packages and a local registry, with no public network
after provisioning. This source build does not publish a release or change the pinned bootstrap.

## Invocation and authority
Expand All @@ -62,11 +66,14 @@ webfront-agent --project /absolute/project \
```

All executable operations are denied unless granted by the process owner using `--allow`.
Valid grants are `check`, `build`, `test`, `preview`, `inspect` and `interact` (click/fill).
Valid grants are `check`, `build`, `test`, `preview`, `inspect`, `interact` (click/fill) and the project setup
grants `init`, `create`, `install`, `restore` and `embed`. The setup grants write the manifest, the lock, the cache, a new
starter directory or the generated provider header; grant them only for a project whose registry you trust.
The project, environment, manifest directory and grants cannot be changed by MCP or the manifest.
Omit grants to expose session discovery only. In particular, there is no agent tool for shell,
JavaScript evaluation, arbitrary callback calls, `wf run`, `exec`, install, restore or arbitrary
native file reads/writes. An agent edits project files through its separately authorized workspace
JavaScript evaluation, arbitrary callback calls, `wf run`, `exec` or arbitrary
native file reads/writes. `install` and `restore` use the registry already configured by the owner, the manifest or the
default; the operation cannot choose another one. An agent edits project files through its separately authorized workspace
tools, then asks WebFront to verify them.

`--manifest-dir` selects a project-relative manifest directory. `--registry-dir` serves an
Expand Down Expand Up @@ -183,9 +190,17 @@ Operations and their arguments:
| `build`, `preview` | `{entry?}` | Operation's own grant |
| `test` | `{pattern?}` | `test` |
| `inspect` | `{}` | `inspect` |
| `init` | `{name?}` | `init` |
| `create` | `{starter, directory?}` | `create` |
| `install` | `{package?}` (one `name[@range]`; none installs the locked graph) | `install` |
| `restore` | `{}` | `restore` |
| `embed` | `{provider}` or `{entry, output}` | `embed` |
| `click` | `{pageId, elementId}` | `interact` |
| `fill` | `{pageId, elementId, value}` | `interact` |

`name`, `starter`, `package` and `provider` refuse a leading `-`, a backslash and spaces; `directory` and `output` must be
project-relative paths: `create` never replaces an existing directory (`wf` refuses it), while `embed` **replaces** its output header, as
regeneration requires. `embed` needs a provider, or an entry together with an output, never both.
Unknown arguments, wrong sessions, unsupported commands and option-like entry/pattern strings
are refused natively. Entries accept manifest labels (including `app:debug` and `app..debug`);
entry paths must be project-relative. A queued/running operation blocks
Expand Down
31 changes: 31 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

## Unreleased

## 0.8.0 - 2026-11-01

- Run authorized native programs from the specs of `webfront_add_jasmine_test` (#445): `PROGRAMS` is the owner's grant and
`webFrontHost.run({program, args, cwd, env, inheritEnv, timeoutMs, maxOutputBytes, signal})` starts a listed program
directly, without a shell, with literal arguments, an explicit environment, bounded time and output, and a structured result
(`exited`, `signaled`, `timeout`, `cancelled`, `launchFailed`, stdout/stderr and truncation flags). The program and its
process group (POSIX) or job object (Windows) are killed at the timeout, on cancellation and when the program ends.
`makeTemp`/`withTemp`, `writeFile` and `readFile` give private temporary spaces that are removed after success, failure and
cancellation. Without `PROGRAMS` every call rejects; `webfront::testing::runProcess` and `HostSession` are the C++ API. The wf
scripts keep no process capability. The browser specs are validated on Linux; Windows and macOS run the unit tests of the runner in CI. See `docs/CONSUMER_TESTING.md` for
the XML-to-JSON recipe.

- Automation can set a project up end to end (#466): `init`, `create`, `install`, `restore` and `embed` join the contract of
`webfront-agent`, each behind its own `--allow` grant and with plain-name or project-relative arguments (no options, no
traversal). `install` takes one package from the configured registry or installs the locked graph; `embed` takes a manifest
provider, or an entry with an output header. See `docs/AUTOMATION.md`. The environment sources advance to 0.6.4 (unpublished,
the pin stays on 0.6.3). Granting one of these operations to an older environment now fails at startup with a bootstrap error naming
the operation, and `embed` is documented as replacing its output header. `create` now finds the pinned starters (the connection reads them from the
environment manifest) and the launcher serves `<name>-starter.tgz` from beside the environment archive; an end-to-end case
creates, initializes, installs and embeds a project.
- Declare the embedded engine without consumer-side macros (#467): `webfront::embeddedFrontendAvailable` (`constexpr bool`, true
when a native web view or CEF is compiled in) and `webfront::EmbeddedWebFront` (the application type with the native web view,
or with CEF when only CEF is built) exist in every configuration; constructing `EmbeddedWebFront` throws
`std::runtime_error` when the build has no engine. See `docs/FRONTENDS.md`.
- Capture the web view as PNG images (#468): `webFrontCapture.screenshot(name)` and `webFrontCapture.record(name, {seconds,
framesPerSecond})` (also `startRecording`/`stopRecording`) in the specs of `webfront_add_jasmine_test` write
`webfront-jasmine/<name>/captures/<name>.png` and numbered `<name>/0001.png`... for an external encoder such as ffmpeg.
`webfront::frontend::capturePng()` and `webfront::testing::CaptureStore` are the C++ API. WebKitGTK, WKWebView, WebView2 and CEF
implement it. The bridge callbacks start the work on a worker
thread and the page polls, so a capture never blocks the server thread. See `docs/CONSUMER_TESTING.md`.

## 0.7.0 - 2026-10-31

- Cut pull-request CI time (#435): the desktop jobs build with `--parallel 4` and compile the 13 heavy unit-test files four
Expand Down
Loading
Loading