Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ include/webfront/system/*Data.hpp text eol=lf
js/developer/environment/* text eol=lf

# Starter archives and every hashed distribution input must be identical on Windows.
js/developer/tools/starters/pi/* text eol=lf
examples/life/ui/* text eol=lf
js/developer/tools/* text eol=lf

Expand Down
22 changes: 15 additions & 7 deletions .github/scripts/check-no-ai-attribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,36 @@ revision="$head"
if [ -n "$base" ]; then
revision="$base..$head"
fi
if ! git rev-list "$revision" >"$commits"; then
# One Git process supplies all records. Bash matches each line directly, avoiding four grep
# processes and two git-show processes per regression case (especially costly on macOS).
if ! git log --no-show-signature --no-notes --no-decorate --no-patch --no-color --no-graph -z --format='%H%x00%an <%ae>%n%cn <%ce>%x00%B' "$revision" >"$commits"; then
echo "::error::unable to list the commits in $revision"
exit 1
fi
shopt -s nocasematch
matches_lines() {
local line
while IFS= read -r line; do
if [[ "$line" =~ $2 ]]; then return 0; fi
done <<<"$1"
return 1
}

status=0
while read -r sha; do
ident="$(git show -s --format='%an <%ae>%n%cn <%ce>' "$sha")"
message="$(git show -s --format='%B' "$sha")"
if grep -qiE "$identity" <<<"$ident"; then
while IFS= read -r -d '' sha && IFS= read -r -d '' ident && IFS= read -r -d '' message; do
if matches_lines "$ident" "$identity"; then
echo "::error::$sha has an AI author or committer"
status=1
fi
if grep -qiE "$trailer" <<<"$message"; then
if matches_lines "$message" "$trailer"; then
echo "::error::$sha message contains AI attribution"
status=1
fi
done <"$commits"

# Do not print untrusted PR text into workflow commands/logs.
for field in PR_TITLE PR_BODY; do
if grep -qiE "$trailer" <<<"${!field-}"; then
if matches_lines "${!field-}" "$trailer"; then
echo "::error::$field contains AI attribution"
status=1
fi
Expand Down
52 changes: 50 additions & 2 deletions .github/scripts/test-no-ai-attribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ export GIT_COMMITTER_NAME='Alice Example' GIT_COMMITTER_EMAIL='alice@example.org
git init -q "$work"
cd -- "$work"

# These checks inspect Git metadata, not the index/worktree or the porcelain commit command.
# commit-tree creates the same real commit chain without scanning the index or updating reflogs.
tree="$(git mktree </dev/null)"
commit() {
git -c core.hooksPath=/dev/null -c commit.gpgSign=false commit -q --allow-empty -m "$1"
git rev-parse HEAD
local parent='' sha
local arguments=(commit-tree "$tree" -m "$1")
if [ -f "$work/parent" ]; then
read -r parent <"$work/parent"
arguments+=(-p "$parent")
fi
sha="$(git -c commit.gpgSign=false "${arguments[@]}")"
printf '%s\n' "$sha" >"$work/parent"
printf '%s\n' "$sha"
}

expect() {
local expected="$1" label="$2" actual=0
shift 2
Expand All @@ -35,6 +46,43 @@ expect 0 'base excluded from range' "$root" "$clean"
expect 0 'empty range' "$clean" "$clean"
expect 1 'invalid revision fails' "$clean" missing-revision

# Signed commits must have exactly the same record framing under user log settings.
# A fixture verifier exercises Git's signature display without keys or network access.
signed() {
printf 'tree %s\nparent %s\nauthor Alice Example <alice@example.org> 1700000000 +0000\ncommitter Alice Example <alice@example.org> 1700000000 +0000\ngpgsig -----BEGIN PGP SIGNATURE-----\n invalid\n -----END PGP SIGNATURE-----\n\n%s\n' "$tree" "$1" "$2" |
git hash-object -t commit -w --stdin
}
cat >"$work/verify-signature" <<'VERIFY'
#!/usr/bin/env bash
: >"${0%/*}/signature-checked"
cat >/dev/null
printf 'gpg: Good signature from "Alice Example"\n' >&2
printf '[GNUPG:] GOODSIG 0123456789ABCDEF Alice Example\n'
printf '[GNUPG:] VALIDSIG 0123456789ABCDEF0123456789ABCDEF01234567 2023-11-14 1700000000 0 4 0 1 10 00 0123456789ABCDEF0123456789ABCDEF01234567\n'
VERIFY
chmod +x "$work/verify-signature"
git config gpg.program "$work/verify-signature"
git config log.showSignature true
git config log.decorate full
git config log.showNotes true
git config format.pretty oneline
signed_clean="$(signed "$clean" 'Ordinary signed change')"
expect 0 'signed clean commit with user log settings' "$clean" "$signed_clean"
signed_dirty="$(signed "$signed_clean" 'Generated-by: Codex <codex@openai.com>')"
expect 1 'signed attribution with user log settings' "$clean" "$signed_dirty"
# A second signed record verifies that the parser stays aligned across the range.
signed_after="$(signed "$signed_dirty" 'Another ordinary signed change')"
expect 1 'signed attribution before a clean commit' "$clean" "$signed_after"
if [ -e "$work/signature-checked" ]; then
echo 'FAIL: user signature display invoked the verifier during metadata parsing'
exit 1
fi
git config --unset gpg.program
git config --unset log.showSignature
git config --unset log.decorate
git config --unset log.showNotes
git config --unset format.pretty

for name in 'Claude Martin' 'Jules Dupont' 'Gemini Rossi' 'Vibe Hansen' 'Copilot Smith'; do
sha="$(GIT_AUTHOR_NAME="$name" GIT_COMMITTER_NAME="$name" commit 'Ordinary change')"
expect 0 "human author and committer: $name" "$clean" "$sha"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/DeveloperDistribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches: [develop, master]
paths:
- 'js/developer/environment/**'
- 'js/developer/tools/starters/pi/**'
- 'js/developer/scripts/**'
- 'examples/life/ui/**'
- 'js/developer/tools/**'
Expand All @@ -23,7 +22,6 @@ on:
branches: [develop, master]
paths:
- 'js/developer/environment/**'
- 'js/developer/tools/starters/pi/**'
- 'js/developer/scripts/**'
- 'examples/life/ui/**'
- 'js/developer/tools/**'
Expand Down Expand Up @@ -70,7 +68,7 @@ jobs:
run: |
wf run build build-distribution
wf run build build-distribution-repeat
for name in environment.tgz pi-starter.tgz life-starter.tgz provision.json DeveloperReleaseData.hpp; do
for name in environment.tgz life-starter.tgz provision.json DeveloperReleaseData.hpp; do
cmp "build-distribution/$name" "build-distribution-repeat/$name"
done
echo "environment.tgz sha512-$(openssl dgst -sha512 -binary build-distribution/environment.tgz | base64 -w0)"
Expand Down Expand Up @@ -99,7 +97,6 @@ jobs:
if-no-files-found: error
path: |
build-distribution/environment.tgz
build-distribution/pi-starter.tgz
build-distribution/life-starter.tgz
build-distribution/provision.json
build-distribution/DeveloperReleaseData.hpp
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The README introduces WebFront through the Game of Life walkthrough, demonstrati
- `include/webfront/frontend/`: system-browser, CEF, optional Windows WebView2 and macOS WKWebView frontend adapters.
- `examples/`: only Hello World (`hello-world/`) and Game of Life (`life/`, with console, developer and embedded stages).
- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), the wf scripts that build it (`scripts/`), build and vendoring tools. The repository is itself a `wf` project (`webfront.project.json` and its lock at the root): the environment builds itself, and its pure JavaScript specs (`test/developer/`) run with `wf test`. `docs/NODE_TOOLS_MIGRATION.md` records where each former Node.js tool went. Production C++ remains header-only in `include/webfront/`.
- `js/developer/tools/starters/pi/`, `test/fixtures/`, `test/web/fixtures/`: retained package and regression fixtures, not public example applications.
- `test/fixtures/`, `test/web/fixtures/`: retained regression fixtures, not public example applications.
- `test/unit/`: Catch2 unit tests; `test/web/`: real-browser integration (`suite/` is the WebFront project of the Jasmine specs, run by `webtest` through `wf test`); `test/driver/`: `webfront-wf`, the non-interactive `wf` driver for tests; `test/fuzz/`, `test/fixtures/`; `test/cmake/`: CMake test scripts and sub-projects. The `RepositoryLayout` CTest case pins the tracked root.
- `cmake/`: build modules (frontends, CEF, CPM, compiler options); `.github/`: workflows, `.github/CONTRIBUTING.md`.
- `.devcontainer/`: devcontainer and its Dockerfile; `docs/`: documentation, `docs/CHANGELOG.md`, `docs/Doxyfile.in`.
Expand Down
21 changes: 21 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

## Unreleased

- Remove the retired PI starter from source distributions and `wf create`; Life remains the maintained React/C++ starter.
Preserve real-time fallbacks in scoped test clocks, release preparation cancellation before the test frame runs,
and retain independent reproducibility, bootstrap-refresh and packaged permission checks. The attribution audit
ignores user signature/log display settings.

### Fixed

- Script injection works before the page body exists, including a driver handshake completed during HTML parsing.

- `wf test` supports WebKit engines without `AbortSignal.any()` (#335), preserving cancellation/deadline reports and
exit codes. Deadline and cleanup timers and the external cancellation listener are released on every exit.
The driver also remembers a watchdog close requested before the browser handshake; a late connection closes
without launching a command. Environment sources advance to 0.6.2 while the release and test-bootstrap pins remain on published 0.6.1.
- Browser regressions advance deadlines, grace periods and dev polling explicitly instead of sleeping. Native command
cancellation uses a release handshake, repeated type checks reuse immutable fixture bytes, cache/command fixtures
drop the large application-only dependency graph after the Life checks, and the shared bridge
runner avoids full binary debug dumps. Retired PI and Signal Studio application tests are removed; Life retains
React/TSX, preview, reproducible generation and rootless embedded coverage. Reproducibility compares two identical
builds, followed by a separate bootstrap refresh; packaged-script permission checks remain end-to-end.


### Added

- Tests, regeneration and CI without a JavaScript runtime or package manager (#318, epic #303). Configuring with `ENABLE_TESTING=ON` downloads, and
Expand Down
31 changes: 21 additions & 10 deletions docs/DEVELOPER_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ its SHA-512 rather than resolving a mutable `latest` channel. An explicit
`DeveloperBootstrapOptions{.environment = url, .integrity = trustedHash}` still selects a different
HTTPS/CORS repository or a same-origin test fixture. Users install no JavaScript tooling.

The environment archive contains pinned Life and PI starter descriptors. `wf create life` downloads and
The current environment archive contains the pinned Life starter descriptor. `wf create life` downloads and
verifies that separate archive, creates a new `ui` directory and prints the install/preview/embed
commands. Existing directories are never replaced. The trusted environment hash protects both
its own code and the starter descriptor; `provision.json` on the server is not a new trust anchor.
Expand Down Expand Up @@ -136,9 +136,8 @@ Reconfigure the native build with
`WebFrontLifeEmbedded` and run it. Recompilation is explicit. The resulting binary needs neither
project sources, downloaded cache nor network.

The PI starter remains available through `wf create pi` for existing projects and regression
coverage. Its sources are maintained under `js/developer/tools/starters/pi/`; the public C++
examples are limited to Hello World and Life. Existing embedded React/Babel providers remain supported.
The current distribution provides the Life starter; the retired PI starter is no longer shipped.
The former embedded React/Babel providers have been removed; use the generated application provider.

## Project manifest (`webfront.project.json`)

Expand Down Expand Up @@ -582,13 +581,13 @@ wf run build build-developer-environment --refresh-bootstrap

`js/developer/scripts/build.mjs` bundles the environment and compiler with the locked esbuild-wasm (run in the script's
Worker), includes esbuild.wasm, xterm styles and licenses, and writes deterministic `environment.tgz`, `life-starter.tgz`,
`pi-starter.tgz`, `provision.json` and `DeveloperReleaseData.hpp`. The version and public base URL are in
`provision.json` and `DeveloperReleaseData.hpp`. The version and public base URL are in
`js/developer/tools/distribution.json`. `--refresh-bootstrap` additionally refreshes the two checked-in JS bundles, their
input checksums (`bundles.json`, over `js/developer/tools/bundle-inputs.json`) and the pinned header; the core headers that embed
the bundles come from `cmake --build <dir> --target webfront-embedded-assets`. Without
that flag, it writes only to the output directory. `site.mjs` stages a build into the GitHub Pages site and `pin.mjs`
checks the pinned header against the published archive. The headers of the core's embedded assets are rendered by `js/core/EmbedAsset.cmake`, in pure CMake (see below). The archives have the package identifiers
`@webfront/developer-environment`, `@webfront/life-starter` and `@webfront/pi-starter`. They are distributed as static
`@webfront/developer-environment` and `@webfront/life-starter`. They are distributed as static
GitHub Pages downloads; no npm publication or scope ownership is required.

The `SelfBuild*` CTest cases run the scripts on a copy of the sources, with the dependencies installed from the local
Expand Down Expand Up @@ -637,9 +636,21 @@ WKWebView and all 14 Linux CEF/Xvfb cases with both GCC and Clang in
The packed 0.3.0 version passes WKWebView and all 14 GCC CEF/Xvfb cases in
[run 39490581423](https://github.com/ambroise-leclerc/WebFront/actions/runs/39490581423).
For Linux, select CEF and Xvfb instead; the same developer tests use the selected test frontend.
`DeveloperBrowserIntegration` exercises the real WASM compiler, local registry, `wf test` under the locked jasmine-core (pass, fail, pending, asynchronous failures, pattern, time limit, Ctrl+C, non-interactive report to C++), build without navigation, incremental dev reload/error/recovery/Ctrl+C, PI and Life previews, C++ generation/animation and
repeatable header generation. Its CTest fixtures then build that **browser-generated** header and run
`DeveloperEmbeddedIntegration` and `LifeEmbeddedIntegration` from empty working directories
`DeveloperBrowserIntegration` exercises the real WASM compiler, local registry, `wf test` under the locked jasmine-core (pass, fail, pending, asynchronous failures, pattern, time limit, Ctrl+C, non-interactive report to C++), build without navigation, incremental dev reload/error/recovery/Ctrl+C, the Life preview, C++ generation/animation and repeatable header generation. Its CTest fixtures then build that
**browser-generated** header and run `LifeEmbeddedIntegration` from an empty working directory
with no developer callbacks.
The standard CEF-off suite also checks project transactions, path rejection, PI, Life rules and boundaries, MIME types,
Deadline and grace-period regressions advance a scoped clock instead of sleeping for seconds; Worker startup,
bridge transfers and UI rendering still use the real browser. Dev polling is advanced explicitly after a committed
edit, and native command cancellation waits on a test-controlled release rather than an arbitrary linger duration.
Repeated type checks reuse immutable package bytes after the first real bridge read. After the Life application
checks, cache/command fixtures drop React DOM and retain a small real dependency graph, avoiding repeated transfers
of unrelated server/development bundles while preserving restore, integrity, compilation and rollback assertions. Retired PI and Signal Studio
application tests are removed; bridge scalars, arrays, exceptions and Promise rejection remain covered by the shared
bridge suite, and React/TSX/embedding by the maintained Life example. The browser suite remains one CTest case:
its total duration is reported without subdividing it into artificial timing units. Snapshot/NodeNext assertions
use the already installed real TypeScript compiler in the browser workflow. Developer specs, including cancellation
and clock regressions, run through the repository's own `wf test`. Two identical self-build invocations verify byte reproducibility; a separate build verifies bootstrap refresh.
The packaged-script permission rejection is also exercised end to end.

The standard CEF-off suite also checks project transactions, path rejection, Life rules and boundaries, MIME types,
bootstrap freshness, package resolution, gzip generation, interruption and offline cache reuse.
5 changes: 5 additions & 0 deletions docs/NODE_TOOLS_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ tracked file; this note and the files of the guard are among its listed exceptio

The specs run with `wf test` on the repository (`webfront.project.json`, `test.specs`); the CTest case `DeveloperSpecs` runs them
on a copy of the sources, and the `wf-package` job on the checkout with its lock.

The cancellation/listener/timer regression of #335 is in `testing-specs.mjs`, and its scoped-clock regression is in
`timers-specs.mjs`, sharing `test/developer/timers.mjs` with the browser integration fixture. Both run with `wf test`.
The bounded-snapshot and NodeNext/no-emit checks retain the real compiler already installed by the developer browser
workflow; no separate host runner or fallback was restored when rebasing #335 over #344.
Loading
Loading