Face unlock window: live camera preview, Snap, thumbnails, one password on Apply
CI / test (push) Failing after 12m30s

Settings > Session "Add or remove faces…" (and "Remove…" on a face) opens a
compositor-drawn Face unlock window instead of running root steps one by one:

- chandra-face camera runs as the user (no password): it streams a small live
  picture with the face box and a cropped thumbnail per snap; the snaps'
  embeddings stay in that process, nothing is written to disk.
- Click a snap to drop it; mark saved faces Remove/Keep.
- Apply saves the snaps as one face and removes the marked ones in one root
  `chandra-face apply` (JSON on stdin, validated) through run0/pkexec: one
  password prompt.
- New raster host function image-pixels (host-wasm, wasmhost, native) for the
  window's pictures.

Tests: camera session and apply in face/test_face.py; the window end to end
against a fake tool in compositor/host/face_test.mbt. Docs explain why the
change itself still needs root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
This commit is contained in:
Claude committed 2026-11-26 02:36:29 +00:00
1 parent 0a9787ae36
commit 9f7489cfea
74 files changed
+2617 -89

No files matched your search

+6 -5
View File
@@ -336,9 +336,10 @@ interface network {
}
/// Face unlock (docs/face-unlock.md): the session user's enrolled faces and whether the password
/// dialog and sudo try the face first. Every change runs chandra-face through run0 or pkexec, so
/// polkit asks for an administrator's password before anything happens; the module never sees a
/// camera picture or any face data, only labels.
/// dialog and sudo try the face first. Faces are added and removed in the compositor's Face unlock
/// window, whose Apply runs chandra-face through run0 or pkexec once, so polkit asks for an
/// administrator's password before anything changes; the module never sees a camera picture or
/// any face data, only labels.
interface face-unlock {
record face-status {
/// Why face unlock can't work yet ("python3-opencv is not installed"), or empty.
@@ -363,9 +364,9 @@ interface face-unlock {
status: func() -> face-status;
/// The enrolled faces, oldest first.
faces: func() -> list<face>;
/// Add a face: after the password, the camera looks for about ten seconds.
/// Open the Face unlock window (live camera picture, Snap, saved faces, one Apply).
enroll: func();
/// Forget face `index` of `faces`.
/// Open the Face unlock window with face `index` of `faces` marked for removal.
remove: func(index: u32);
/// Try the face first in the password dialog and sudo, or stop.
set-in-use: func(on: bool);