Files
RedBear-OS/local
kellito 8637d8bb5b v5.6: redbear-compositor comprehensive fix (W1/W2/W3 + compile errors)
The redbear-compositor had BOTH pre-existing compile errors AND
the round-4 audit items. A single comprehensive pass was needed
because the round-4 fixes depended on the code compiling.

Pre-existing compile errors (blocking, unrelated to the audit):
- ? operator applied to () in several functions — functions now
  return Result<(), io::Error> so the ? is well-typed.
- Compositor::stack_surface_relative referenced but not defined —
  implemented as a real method that computes the surface stacking
  order from the live WlSurface parent links.
- Method argument count mismatches (3 when 2; 4 when 3) — fixed
  at call sites by reading the method signatures and passing the
  correct arguments.

W1 — let _ = stream.write_all(&msg) (14 sites in main.rs):
Replaced with if let Err(err) = ... { ... } that logs via eprintln!
and either early-returns (for send functions) or propagates the
error to the dispatch caller (for send_keyboard_key_event). The
caller's read loop detects the dead stream and breaks. Eliminates
the silent desync vector on partial/failed writes.

W2 — unreachable!() in Wayland opcode dispatch (2 sites):
Replaced with return Err(format!("...")). The dispatch function
returns Result<(), String>, so the caller sees the error and
breaks the read loop. A malformed or malicious client that sends
an unexpected opcode no longer crashes the compositor.

W3 — let _ = self.send_keyboard_key_event(...):
Replaced with if let Err(err) = ... { return Err(err); } — error
propagates to the dispatch caller. Same fix pattern as W1.

Verification:
- cargo check --target x86_64-unknown-redox: zero errors
- grep 'let _ = stream.write_all' main.rs: 0 (was 14)
- grep 'unreachable!' main.rs: 0 (was 2 in opcode dispatch)
- 330 warnings, all pre-existing dead-code warnings on unused
  Wayland protocol constants and structs. No new warnings
  introduced.

Also moved local/docs/SYSTEM-STABILITY-AND-UPSTREAM-SYNC-PLAN.md
to local/docs/archived/ (self-declared historical plan; active
tracking migrated to CONSOLE-TO-KDE-DESKTOP-PLAN and subsystem
plans).
2026-07-26 21:48:16 +09:00
..