Philosophy audit of 2026-11-10
Doc status: proposal. Findings and work plan of the audit; no fix in it is a landed contract. Checked 2026-11-10.
Status: findings and work plan. Nothing in this file is a landed contract.
The owner asked to check whether the project reaches its philosophy: a shell that is fully customizable through HTML, CSS and JS, that can express complex effects (glass, 3D, fire), that covers window mechanics, with no restart and no compositor code for these changes. The owner also asked for sensitive points, code smells and improvements, and then asked to record every finding and hand the fixes to parallel work streams ("anote todos os findings e repasse para sessoes opus gerenciar sessoes sonnet e fazer os ajustes").
The audit was read-only: code and docs, with no build, no test run and no check in the live
session. Counts come from grep and wc and are approximate. Items marked "not verified"
need a read before anyone acts on them.
Verdict
The philosophy holds for the web surfaces of the shell. It does not hold for effects on application windows or for window mechanics, which are Rust code in the compositor.
| Case | Today, with no Rust change and no restart | What blocks it |
|---|---|---|
Restyle the chat, bars and panels (profile CSS, theme.css, uiTheme) |
Yes | - |
| Blur, refraction and rim of the bar glass | Yes | Only three CSS variables: --compositor-blur, --compositor-refraction, --compositor-rim-intensity |
A new HTML/JS panel (web-panels.json) |
Yes | Below the chat, and no API for windows or effects |
| Glass on an application window | No | Only the core declares glass, for bars, panels and the chat |
| A new effect (fire) on a window border or on close | No | The only effect target is OverviewF9 (native/smithay/src/themes.rs:117), and F9 has no visual use now |
| 3D tilt or flip of a window | No | The canvas lens is a fixed cylinder in Rust |
| A new wallpaper effect | Partly | Pure WebGL, but the list is closed in the core and needs a rebuild |
| A new tiling layout, snap to halves | No | Grid and Canvas live in Rust (grid.rs, desktop/canvas_mode.rs, desktop/tiling.rs) |
| Change a keyboard shortcut | No | Keysyms are fixed in native/smithay/src/input.rs:146-297; only hot corners are configurable |
| Curve or duration of window open and close | No | Rust constants (canvas.rs:49 300 ms, black_hole.rs:28 400 ms) |
| Window frame in HTML | No | Only the typed parameters of set_window_style |
Cost of each customization layer:
- No restart: profile
style.css(replace_ui), profiletheme.css,uiTheme, plugin panels. - Build, approval and activation: the overlay of the chat host.
- Rebuild and reload of the web surfaces: the trusted React sources.
- Core restart: core changes.
- New login: compositor changes.
Findings
F1. Effects are Rust special cases, and the data-driven engine has a dead target
effects.rs(955 lines) andeffect_pipeline.rs(2211 lines) apply a CSS subset plus GLSL with hot reload, but only to the F9 overview thumbnails (openspec/specs/css-window-effects/spec.md:3).enum EffectTarget { OverviewF9 }is the only target. No slot exists for window open, close, focus, border or rest.- Each new effect became a Rust module: black-hole close (about 1000 lines:
black_hole.rs,plain_black_hole.rs, shaders), canvas lens (about 1900:canvas_warp.rs,plain_warp.rs), window finish and reveal (about 1000:window_finish.rs), glass and alpha mask (about 3500:glass.rs,glass_mask.rs,plain_glass.rs), overview planes and depth (about 1100). - Window pixels never reach web code (
glass.rs:1,openspec/specs/screenshots/spec.md:98). This is a security rule to keep, so an effect on a window has to run in the compositor from data. - Proposals that did not land:
openspec/changes/haze-transition/design.md, thespherelens, per-window CSS effects ofopenspec/changes/archive/2026-10-27-css-window-effects-plan/design.md.
F2. Window mechanics are fixed in Rust
- Layout, focus, move and resize, placement, gestures and keybindings are in the compositor.
- The JS side cannot set geometry or a transform per window, subscribe to input or register
a key. The agent
window_action moveis bounded and rate limited, not a layout engine. - Keybindings: about 85 keysym matches in
input.rs. Onlyhot_cornersis a table sent by the core (web-shell/core/hot-corners.js). - Not verified: what
workspace_motionlets the core tune.
F3. The core and compositor protocol has no schema
- About 61
actionnames sent by the core, aCommandenum innative/smithay/src/desktop.rs:60, and about 94 distinctcapabilities.*references in JS. Both sides are written by hand. scripts/check-host-skew.pycodes two capability checks by hand.- The commands are narrow and product specific (
chat_hold,canvas_organize,workspace_show_all), so every new behavior needs both sides and a capability flag.
F4. State polling and leases in prose
web-shell/core/smithay.js:2296polls the whole state every 100 ms.- Six or more leases with a 60 s grace (
canvas_warp,chat_alpha_glass,workspace_outputs,shared_workspaces,chat_hold,agent_route), each with its own code and its rules only inAGENTS.md. The core has 9setInterval.
F5. Profile CSS gets only a parse
store.js,profile-ui-themes.jsandthemes.jsparse the CSS. Onlytheme-create.js:188refuses@import. No property allowlist was found.replace_uiapplies with no user click and can restyle what is around the approval dialogs, whichAGENTS.mdalready admits.- The host CSP (
server.js:1274:img-src 'self' blob: data:,connect-src 'self') limits exfiltration throughurl(). Not verified: fonts and every protected page.
F6. Authentication is repeated per route
- Three credentials (shell token, launch cookie, host main key) checked across about 54
pathname ===branches ofweb-shell/core/server.js. No route table declares the auth class. Not verified route by route, so a missed check cannot be ruled out.
F7. A panic ends the session
- About 1057
unwrap()andexpect()innative/smithay/srcoutside*_tests.rs. The count is raw and includescfg(test)modules and mutex locks.
F8. Authority of execute_command and of the overlay
- Both run as the user. The consent flows are advisory against a prompt-injected agent
(
openspec/specs/self-maintenance/spec.md). This is a documented risk to keep visible, not a bug.
F9. God files
| File | Lines |
|---|---|
native/smithay/src/desktop/canvas_mode.rs |
4640 |
vendor/interface/host/host.js |
4241 |
web-shell/core/server.js |
3628 |
native/smithay/src/desktop.rs |
3521 |
web-shell/core/smithay.js |
2806 |
native/smithay/src/scene.rs |
2626 |
native/smithay/src/grid.rs |
2441 |
vendor/interface/host/quick-settings.js |
2380 |
Tests: session_lock_tests.rs 6178, wgpu_effects_tests.rs 4503, smithay.test.js 4233,
host-script.test.js 2893. server.js mixes routing, auth, cookies, state and lifecycle;
route modules exist for the lock, the tray, notifications and quick settings only.
F10. Governance of the docs
AGENTS.mdis 64 KB, with one line of 8225 characters. Single bullets mix history, the current contract and exceptions.- 81 docs, about 33.5k lines, with no status marker (current, proposal, history).
F11. Smaller smells
- "heroui" still appears in about 14 files of
vendor/interface/hostand inui-srcafter the move to shadcn. Not verified whether they are class names, comments or code. - 23 empty
catchblocks in the core,desktop.cjsandvendor/interface. - 13 test files use
readFileSync; not verified which ones assert on source text. - Experimental weight:
experiments/,native/wgpu-bridge,native/wgpu-renderer. - Naming drift (
agent-native-os,AGENT_NATIVE_*,river-shell) is staged on purpose (openspec/changes/naming/design.md); the symlinksweb-shell/host|ui|ui-srcare an extra indirection. - The matrix of protected settings (canvas, lens, glass, theme, shared views) grows faster than the tests.
Checked and fine
- Generated HTML runs in
sandbox="allow-scripts"iframes (vendor/interface/ui-src/app.jsx:133,web-shell/core/web-panels.cjs:787). - No TODO, FIXME or HACK markers.
Work streams
Each stream has one managing session and works on its own branch. Order inside a stream is by impact on the philosophy.
| Stream | Findings | Scope |
|---|---|---|
| A. Effects as data | F1 | Per-window effect slots (open, close, focus, border, rest) on the existing CSS and GLSL pipeline; per-window transform, opacity and uniforms as data; then move one built-in effect to a package as the proof |
| B. Mechanics as data | F2 | Keybinding table and animation timing sent by the core, like hot_corners; a written proposal for layout as policy |
| C. Protocol and robustness | F3, F4, F7 | One manifest of commands and capabilities with a contract test; a shared lease helper; triage of unwrap on the render and input paths; a proposal for state events |
| D. Core and host hygiene | F5, F6, F9 (JS), F11 | Route table with an auth class and a test that enumerates it; split of server.js by domain; profile CSS rules; empty catches; HeroUI leftovers |
| E. Docs governance | F10 | Status header on each doc; AGENTS.md reduced to invariants with the per-feature contracts moved to docs, with no rule lost |
Rules for every stream: the security boundaries of AGENTS.md stay (new compositor commands
only on the control connection from the core, no authority for generated HTML, plugins,
agent tools or scheduled turns unless the owner decides so); no change to the live session;
each stream reports a rebased branch with green gates, and one publishing session takes the
branches one at a time.
Stream D status (branch claude/audit-d-hygiene-6fba52, not yet on main)
- F6: the route audit found every route with the credential the contract names, and four routes that served profile data with no credential (
/theme.css,/web-panel-assets/*,/shadcn-host.js,/chat-host.css); they take the launch cookie, and/host-overlay-reloadrefuses an Origin.web-shell/core/route-table.jsdeclares the auth class of every top-level route and one dispatcher enforces it (docs/web-shell-development.md, Route table). - F9 (JavaScript):
server.jswent from 3628 to 1767 lines, intopage-routes.js,mcp-routes.js,mcp-tools.jsand the/apimodulesapi-*-routes.js.vendor/interface/host/host.jsis not split yet. - F5:
web-shell/core/css-rules.jsadds static rules to the profilestyle.cssand the profile UI theme (openspec/specs/profile-ui-themes/spec.md, Static rules). Full isolation of the protected surfaces from/theme.cssstays a proposal. - F11: the empty
catchblocks of the sources carry a reason; no HeroUI code remains, only pointers to the historical doc. The tests that assert on source text are listed, none converted: none has a cheap behavior equivalent.