Commit graph

29 commits

Author SHA1 Message Date
4b9e7b7773
Merge remote-tracking branch 'origin/main' into fix/reserve-panel-work-area
# Conflicts:
#	docs/building.md
2026-10-10 07:24:23 +00:00
bc2c155d24
Merge remote-tracking branch 'origin/main' into fix/activate-app-windows
# Conflicts:
#	docs/building.md
2026-10-10 07:23:50 +00:00
9206088d10
test(frame): check package updates against running sessions
check_update.py installs a test app with weft-pack, runs it with the
real runtime and app shell, and checks the following:
- an update leaves a running session on the bytes and the revision it
  started from;
- a failed update keeps the active revision;
- a later launch gets the update;
- the old revision is collected only after its session ends;
- rollback reactivates the kept revision;
- uninstall refuses new launches without disturbing a running session,
  and a later uninstall removes the revisions.
2026-10-09 17:38:10 +00:00
5253eaf251
fix(compositor): reserve the taskbar strip and lay app windows out in the work area
Application windows opened at the client's default size at the origin,
so one as large as the output hid the taskbar with no way back.

zweft_shell_window_v1 version 3 adds set_exclusive_zone: a panel
reserves a strip along an output edge, and other windows get the new
invalid_exclusive_zone error. weft-servo-shell reserves its 48-pixel
taskbar at the bottom (TASKBAR_HEIGHT, matching --taskbar-height in the
system UI). The compositor computes the work area as the output less the
reserved strips and configures every application window to fill it,
again when the output or a reservation changes.

The desktop harness now uses a 1400x900 X screen so the nested
compositor's whole 1280x800 output is captured. check_activation.py
requires both applications to fill the work area and end at the
reserved strip; check_notes.py finds the Discard button from the window's
right edge and check_confinement.py samples its probes from the measured
page instead of a fixed 800x600 window.
2026-10-09 16:00:38 +00:00
aa67e7f190
fix(compositor): own stacking and focus, and activate app windows on request
The system shell's panel was an ordinary toplevel at winit's default
size, stacked by map order with the applications, and clicking or the
taskbar could never bring an application back to the front.

The compositor now sizes the panel to the output and keeps it beneath
every application window. A newly mapped, clicked or activated
application window is raised, marked activated and given keyboard
focus. weft-appd accepts ACTIVATE_APP for a running session and asks
the compositor to activate that session's window (AppFocusRequest),
and the system UI's taskbar entries send it when chosen.

check_activation.py runs the system shell with a solid panel page and
two test applications: the panel fills the output beneath them, each
launch comes to the front with keyboard focus, ACTIVATE_APP switches
between the sessions with focus, and activating a session that is not
running is refused.
2026-10-09 15:36:55 +00:00
d175bf012e
fix(pack): normalize installed modes and never leave a partial or orphaned owner record
Installed files take fixed modes (0644, or 0755 when executable) and
directories 0755, so a world-writable source cannot install as such.
An owner record created by an installation whose package then fails to
be placed is removed, and records are written under a temporary name
and linked into place, so they are never partial. Archives unpack into
a random private directory that is always removed. Uninstall frees an
ID only when the app data is truly absent, signatures are checked with
verify_strict, and list marks development installs.
2026-10-09 13:59:54 +00:00
88c2e9f6a5
fix(pack): install only trusted packages and bind each app ID to its owner
weft-pack install copied any package into the store: signatures were
never checked, no key was trusted for anything, any publisher could
install over another's app ID and reach its retained data, and the
signing inventory followed symbolic links, so a package could sign and
install files from outside itself.

Installation now requires a signature by a key in the trust store
($XDG_CONFIG_HOME/weft/trusted-keys and /etc/weft/trusted-keys, or
$WEFT_TRUSTED_KEYS alone). Unsigned or untrusted content installs only
with --dev, recorded as development content. The package is copied
into the store, checked and verified on that copy, and renamed into
place, so the verified bytes are the installed bytes.

The first installation of an app ID records its owner beside the app
data; later installations must have the same owner, so neither another
publisher nor a development build can take the ID over. The record
outlives uninstall while app data remains.

The content digest moves to weft_ipc_types::trust and refuses links,
special files and non-UTF-8 paths; it keeps the existing inventory
format, and both committed demo signatures still verify. Catalogs list
only directories named after their package ID. The security guide
described a signature over wapp.toml and app.wasm only; it now
describes the full inventory and the trust and ownership rules.
2026-10-09 13:49:49 +00:00
b45fe27e9b
Merge remote-tracking branch 'origin/fix/session-owned-ipc-relay' into fix/confine-app-renderer 2026-10-09 11:37:44 +00:00
b17b74f310
Merge remote-tracking branch 'origin/fix/enforce-session-grants' into fix/separate-app-data 2026-10-09 11:36:27 +00:00
12e4c1d91a
Merge remote-tracking branch 'origin/main' into fix/enforce-session-grants
# Conflicts:
#	.gitignore
#	README.md
#	docs/building.md
2026-10-09 11:30:01 +00:00
d60152f443
fix(app-shell): confine application pages to their UI files and bridge
An application page could load any local file through file: URLs and
reach any network destination with images, fetch, XHR or WebSockets,
bypassing the component's fetch grants. The shell now checks every
resource load: files inside the UI directory, inline data:, blob: and
about: resources and the session bridge are allowed; anything else
fails with a network error before a request leaves the renderer.

tests/frame/check_confinement.py probes each path on the nested desktop
and requires that no HTTP request or TCP connection reaches the host.
The frame check's slow stylesheet becomes a file next to the page held
back with a file lease, so it stays inside the confined scope.
2026-10-09 09:39:37 +00:00
818a831895
Merge pull request #6: stop reporting readiness without an engine
A runtime built without wasmtime-runtime now exits with an error instead of printing READY; its env-dependent tests are serialised.
2026-10-09 11:19:13 +02:00
e3c2e80142
Merge branch 'main' into fix/runtime-stub-readiness 2026-10-09 10:57:06 +02:00
4d39ec3a8b
Merge branch 'main' into docs/add-engineering-contract 2026-10-09 08:56:42 +00:00
87222599f1
Merge pull request #8: verify native pointer and keyboard input through weft-compositor
tests/frame/check_input.py drives a page through weft-compositor with real X input and checks the presented pixels.
2026-10-09 10:56:29 +02:00
f39a330027
fix(notes): serialise saves and keep unseen notes from being replaced
The editor accepted typing before the stored notes had loaded, and a
load reply then adopted the stored revision for text edited from
nothing, so a save replaced notes the user never saw; the same happened
when typing during a Discard reload. The editor is now read-only until
it holds the stored text.

Two Notes windows saving at once shared one staging file and could each
pass the revision check, storing a mix of both texts. Each save now
holds a lock file while it checks the revision and replaces the notes,
writes its own staging file, syncs it before the rename, and removes
only that file on failure; a lock left by an ended session expires
after ten seconds.

A save larger than the 64 KiB app message limit after JSON encoding was
dropped on its way and left the page waiting forever with Save
disabled. The page now refuses such saves before sending, gives up on a
save after ten seconds without a reply, and the component answers every
request, including malformed ones, so no request goes unanswered.

check_notes.py now pauses weft-runtime with SIGSTOP to make text typed
during a save and keys typed during a Discard reload deterministic; the
previous package fails it by saving text typed before the reload. The
building guide lists the application checks, the pinned toolchain for
reproducing the demo binaries and the demo key path.
2026-10-09 08:55:50 +00:00
4b27d7f16c
fix(notes): store notes exactly and never overwrite newer text
The Notes demo exchanged hand-escaped strings: the page turned every
literal backslash-n into a line break on load and save, the component
escaped only some control characters, so other text produced invalid
replies, and every reply replaced the editor contents, discarding text
typed while a save was in flight. Saves wrote the file in place and
replaced whatever another Notes window had stored.

Requests and replies are now JSON objects. The component reports a
revision (a hash of the stored bytes) with each load; a save names the
revision it was edited from and is refused when the stored notes have
changed since, so a second window's text is never replaced silently. The
file is written beside notes.txt and renamed over it. A save
acknowledgement updates only the saved state, never the editor, and
Discard reloads the stored notes.

tests/frame/check_notes.py edits Notes with real keyboard input on the
nested desktop: text with a literal backslash sequence, quotes, a tab and
non-ASCII characters is stored byte for byte, text typed during a save
survives, and a save after another window changed the file is refused.
It fails against the previous package, which turned the seeded "\n"
into a line break. app.wasm is rebuilt and the package re-signed with the
demo key.
2026-10-09 08:47:01 +00:00
dcc09f319d
docs: add engineering contract, contributor toolkit and templates
Add AGENTS.md as the single engineering contract: sources of truth,
evidence and proof requirements, ownership, working modes, the reviewed
change loop, maintenance isolation, decision authority, dependency and
fork rules, the 0.0.x to 0.1.0 release progression, and branch and
publication rules.

Add .agents/ with scope, implement, verify, maintenance and release
procedures; reviewer, architecture debt scout, simplicity and refactoring
roles; skills for the compositor, Servo rendering, runtime capabilities,
appd sessions, packages and data, Linux deployment, integration
verification and documentation; and verify.py, which runs the existing
check profiles with --locked from any directory, stops on the first
failure and supports --dry-run.

check_toolkit.py validates local links and heading anchors, metadata,
catalog coverage and issue forms. A new contributor-toolkit CI job runs
both. The structure follows the Resina Design System toolkit at
1e768064f57a1e403ab271822383e732795905a6, adapted to WEFT.

Validation, against the committed lockfiles:
- verify.py toolkit: checker passes, 28 runner/checker tests pass
- verify.py portable, demos, packages: pass
- verify.py linux, runtime, servo-embed: fail on existing defects
  (clippy collapsible_if in the winit backend, three clippy lints in
  weft-runtime with wasmtime-runtime, and an E0308 in the selected Servo
  revision's servo-layout); the runner reports the failing status

Add CONTRIBUTING.md, issue forms for defects and changes, maintenance
problems and decisions of direction, and a pull request template asking
for ownership, proof and the validation actually performed. README.md
links the contribution guide.
2026-10-09 08:34:48 +00:00
0d30ed4ed9
Merge branch 'main' into ci/drop-windows-job 2026-10-09 10:29:22 +02:00
51ca194acb
fix(runtime): close fetch and preopen gaps in grant enforcement
A component with a host-specific fetch grant could reach another origin
by setting its own Host header, and could inject request lines through
the method string, which ureq writes unvalidated. Fetch now accepts only
standard methods and refuses Host, framing and hop-by-hop headers. Fetch
grants accept canonical DNS names and dotted IPv4 addresses only, so a
grant can never be written in a form that silently never matches.

--preopen split host and guest at the first `::`, so a host path
containing `::` widened the preopened directory; it now splits from the
right, and appd refuses host paths that are not UTF-8 or contain `::`.

appd validated capabilities one at a time, creating the data directory
before a later capability was refused, and required HOME even for
packages without filesystem capabilities. It now checks every capability
first, resolves host directories only when needed, validates the app ID
with the rule weft-pack uses (now shared in weft_ipc_types::package), and
reports 400, 404, 403 or 500 according to the cause. user-dirs.dirs is
read as a shell would: the last assignment wins, $HOME must be followed
by a slash, escaped values are ignored and a relative XDG_CONFIG_HOME is
not used.

The grants probe now also overwrites, renames, removes and creates
directories in read-only data, and sends a forged Host header, an
injected method and a file: URL; it fails when directory permissions of
a read-only preopen are widened or the header check is removed. A new
CI job builds the runtime with its engine and fetch support and runs the
check. The mount test that sets WEFT_APP_STORE now holds the env lock.

Package images are still located separately from directory installs;
deriving grants from the verified image is part of resolving one package
descriptor.
2026-10-09 08:25:40 +00:00
29a7f6f508
ci: build and test on Linux only
WEFT OS targets Linux and systemd. The Windows runner only compiled and
tested the crates without Linux system libraries, which says nothing
about a supported configuration, and was the slowest job in every run.

The job is now `portable` on Ubuntu, matching the verification profile
of the same name. The building guide, README and development
environment notes now state that builds are validated on Linux only.
2026-10-09 08:16:59 +00:00
f41937bd7e
Merge branch 'fix/runtime-stub-readiness' into fix/enforce-session-grants 2026-10-09 07:58:07 +00:00
ae176aae93
test: verify native pointer and keyboard input through weft-compositor
Nothing checked that input reaches a page through the compositor; the
Servo hosts' input forwarding had only been compiled.

tests/frame/check_input.py runs weft-servo-shell with
tests/frame/input.html on the nested desktop and injects real X input
with xdotool into weft-compositor's window. The compositor's winit backend
routes it through its seat to the Wayland client, which has no X display.
The page must react in its presented pixels: clicks 6 px either side of
the boundary between its halves change only the half under the pointer,
and the a and Shift+a key presses arrive with the right key value and
modifier. The harness gives the compositor's X window input focus, as a
window manager would; the client's keyboard focus comes from the
compositor's click-to-focus.

The nested desktop setup shared with check_frame.py moves to
tests/frame/session.py. Xvfb now reports the display it picked through
-displayfd, so concurrent runs cannot share an X server, and a run clears
only the logs and capture it writes.

Validation:
- check_input.py: 3 of 3 runs pass; two concurrent runs pass
- negative pages fail: no script; left click handled by the right half;
  an element extending the left half 20 px across the boundary; a key
  handler ignoring Shift
- check_frame.py --host system, --host app, --host app --slow-style 3 pass
  after the refactor
- unverified: key release and repeat, pointer motion and button release
  events, wheel, focus loss, non-US layouts, non-ASCII text, scale changes,
  weft-app-shell input
2026-10-09 01:18:53 +00:00
64f8cff6fd
fix(shells): paint and present Servo frames and report readiness truthfully
With servo-embed, weft-servo-shell and weft-app-shell did not compile
against the selected Servo revision: the keyboard event shape, key and
mouse action variants, frame readback, shutdown, URL type and window
handle APIs had changed. The frame path never called WebView::paint; the
software path rebuilt its softbuffer surface every frame and read pixels
without painting, and the EGL path presented nothing. weft-app-shell
printed READY right after creating its WebView, before any frame, and its
feature-disabled build printed READY and parked. Servo also disables CSS
Grid by default, which the system UI uses.

Both hosts now build against the selected API. Each frame is painted with
WebView::paint and presented: the software path reads the painted frame
back, presents the context and copies it into a persistent softbuffer
surface; the EGL path presents its window context. Nothing is presented
before Servo's first repaint request. Shutdown drops the WebView and
Servo, whose drop completes the shutdown, and exits the event loop. Both
hosts enable layout_grid_enabled.

weft-app-shell prints READY on the first frame presented after the
document has loaded and Servo reports its rendering settled: on load
completion it requests WebView::take_screenshot, which completes only once
every frame has fired load, render-blocking resources, images and web
fonts are done and the rendering is up to date. Feature-disabled builds of
both hosts exit with an error instead of reporting readiness. weft-appd
does not consume the app shell's READY yet.

tests/frame/check_frame.py runs weft-compositor nested on Xvfb with the
winit backend, starts a host showing tests/frame/reference.html and checks
the presented pixels (four colour quadrants and text). For the app host
the page must be on screen within two seconds of READY; --slow-style
delays a render-blocking stylesheet that reveals the page, so premature
readiness fails.

Validation (Ubuntu 24.04, Mesa 25.2.8 llvmpipe, software path):
- check_frame.py --host system, --host app and --host app --slow-style 3:
  5 of 5 runs pass each
- negative fixtures fail: page with red and green swapped; a fake host
  printing READY without rendering; a local build printing READY on its
  first presented frame (--slow-style 4, 3 of 3)
- cargo clippy -D warnings with and without servo-embed; cargo fmt --check
- unverified: EGL path, DRM, resize, output scale, idle wakeup, input
2026-10-09 01:02:26 +00:00
f6d5cf102c
fix(runtime): stop reporting readiness without an engine
Built without the wasmtime-runtime feature, weft-runtime printed READY
and exited without executing anything. weft-appd treats READY on the
runtime's stdout as the readiness signal, so such a build made a session
appear to start successfully although no component ran.

The feature-disabled build now exits with an error naming the missing
feature, so appd sees the runtime close without READY and stops the
session. The binary still builds for the portable type, lint and unit
checks. The Nix package keeps building the engine-enabled runtime.

Validation:
- new unit test: run_module in a feature-disabled build returns an error
  naming the feature; it fails against the previous stub
- feature-disabled binary against a minimal package: exits 1 with the
  error and prints no READY
- cargo test -p weft-runtime (5 passed), clippy -D warnings, fmt --check
2026-10-09 00:55:07 +00:00
93b67834a7
build: select compiling Servo and Stylo fork revisions
Both Servo hosts tracked the marcoallegretti/servo `servo-weft` branch,
which the lockfile resolved to 8e7dc40. That revision's servo-layout does
not compile (E0308 and E0716 in build_backdrop_filter). WEFT also resolved
upstream Stylo dca3934, where backdrop-filter is gated behind
layout.unimplemented, because the Servo fork's own [patch] for Stylo does
not apply to dependents.

Pin Servo by revision to f0bb1aa (8e7dc40 plus the build fix) and add a
root [patch."https://github.com/servo/stylo"] selecting the
marcoallegretti/stylo fork at f1ba496 for all eight Stylo crates Servo
uses. Cargo.lock changes only the 66 source lines of those packages.

Record both pins, their reachable branches, purpose and removal
conditions in SERVO_PIN.md, and restate its limitations against executed
evidence. Update the Nix outputHashes: the Stylo hash is recomputed for
f1ba496 with the method that reproduces the previous dca3934 value; the
Servo hash is not yet known for f0bb1aa and is left as lib.fakeHash, so
Nix builds report the expected value instead of using a stale one.

Validation:
- cargo metadata --locked: ok; no servo/stylo sources remain in the lock
- cargo check -p weft-servo-shell --features servo-embed --locked:
  all of Servo, including servo-layout, compiles; the remaining errors are
  in the shell's own embedder code
- cargo fmt --check; portable workspace tests: 78 passed
- Nix fetchgit could not run here (archive downloads and the sandbox's
  TLS to the proxy fail), so the Servo hash remains unverified
2026-10-09 00:13:08 +00:00
2ae05312dc docs: correct openSUSE package names verified against rpmfind
- Replace Mesa-libEGL-devel and Mesa-libGLES-devel (do not exist on
  openSUSE) with libglvnd-devel (Khronos EGL/GLES dispatch headers)
- Replace libseat-devel (does not exist on openSUSE) with seatd-devel

Package names confirmed via rpmfind.net against Tumbleweed and Leap
repositories.
2026-03-12 20:52:34 +01:00
7b4dbcdaf6 docs: replace apt-get/Debian package references with openSUSE/zypper
- README.md: zypper install with openSUSE package names
- docs/building.md: zypper install with openSUSE package names
- crates/weft-servo-shell/SERVO_PIN.md: openSUSE package names,
  remove Fedora/RHEL note
2026-03-12 20:48:17 +01:00
e3504c324b feat(infra): NixOS VM config, CI type-check job, documentation
- flake.nix, infra/nixos/: NixOS VM with Mesa, virtio-gpu, Wayland,
  systemd user services for compositor and session supervisor
- infra/vm/: QEMU build and run scripts
- .github/workflows/ci.yml: add Linux job to type-check weft-servo-shell
  and weft-app-shell with --features servo-embed
- docs/architecture.md, docs/security.md, docs/building.md: replace
  stale pre-implementation design documents
- README.md: rewrite to reflect current codebase
- crates/weft-servo-shell/SERVO_PIN.md: update implementation status and add
  SpiderMonkey process boundary statement
2026-03-12 20:03:25 +01:00