diff --git a/Plans/05 Engine/S022-mse-spike.md b/Plans/05 Engine/S022-mse-spike.md new file mode 100644 index 0000000..ed2f358 --- /dev/null +++ b/Plans/05 Engine/S022-mse-spike.md @@ -0,0 +1,36 @@ +# S022 — MediaSource (MSE) spike + +> Category 05 Engine · Model: Opus · Effort: high · Depends on: S006 · Size: M · Human: 🧑 decides go/no-go on the full MSE work +> Files touched: `docs/engine/mse-spike.md` (new), a throwaway prototype (branch or `vendor/` copy, see steps), `tests/smoke/pages/mse-*.html` + +## Goal +YouTube's player needs Media Source Extensions; Servo 0.7 has none, so videos show "Your browser can't play this video" (S006, R4-03). The user wants real YouTube playback in the page (YouTube's own controls, quality menu, PiP), not a yt-dlp workaround. Find out how big adding MSE to Servo is and prove the core path with a minimal prototype, so the user can decide with real numbers. + +## Read +- `docs/DESIGN.md` "Engine limits" and the media section; D-008, D-012 in `docs/DECISIONS.md` +- Servo 0.7 sources in `~/.cargo/registry` (crates `servo`, `script`, `servo-media*`): how `HTMLMediaElement` feeds GStreamer (player, `appsrc`/playbin), where WebIDL interfaces live +- References (read, port ideas, don't copy code): WebKitGTK's GStreamer MSE backend (`Source/WebCore/platform/graphics/gstreamer/mse/`), Firefox `dom/media/mediasource/` (MPL-2.0, same licence as Servo), Chromium only for the spec behaviour + +## Steps +- [ ] Upstream check: does current Servo (git main, issues, PRs, servo-media) have MSE work? Note links, state, and whether it can be backported to 0.7 +- [ ] Map the work for Servo 0.7: WebIDL + DOM (`MediaSource`, `SourceBuffer`, `SourceBufferList`, `URL.createObjectURL(MediaSource)`), byte-stream parsing (fMP4 init/media segments, WebM), feeding GStreamer (appsrc per track, buffered ranges, seeking, `endOfStream`), `isTypeSupported` codecs (VP9, AV1, H.264, Opus, AAC through the installed GStreamer plugins) +- [ ] Decide how Nacre would carry the change: vendored `script` / `servo-media` crates via `[patch.crates-io]` like servo-net (D-012), and measure the rebuild cost of a vendored `script` crate +- [ ] Prototype the smallest path: `MediaSource` + one `SourceBuffer` that plays a local fMP4 or WebM clip appended in chunks (`tests/smoke/pages/mse-basic.html`, clip generated with ffmpeg); a smoke shot shows the clip playing (currentTime advances) +- [ ] Try YouTube with the prototype (heavy-web.txt YouTube steps): record exactly how far it gets and what breaks next +- [ ] Windows: what GStreamer the Windows build needs (bundled runtime size, plugins) for MSE playback +- [ ] Write `docs/engine/mse-spike.md`: findings, sized task list (sessions per part), risks, recommendation; then 🧑 ask the user (through the orchestrator) go / no-go +- [ ] PROGRESS entry, DECISIONS (go/no-go), INDEX line, commit `S022: …` and push + +## End criteria +- `docs/engine/mse-spike.md` exists with the upstream state, the sized plan and a recommendation. +- The prototype smoke shot shows a chunk-appended clip playing, or the doc says exactly why it couldn't. +- The user's go/no-go is recorded in DECISIONS. + +## Pitfalls +- A vendored `script` crate rebuilds slowly: measure before choosing; one cargo command at a time on `target/`. +- Licences: Servo is MPL-2.0; port ideas from WebKit (LGPL/BSD) and Chromium (BSD) without copying code. +- No EME/DRM (DESIGN.md): DRM videos stay unavailable even with MSE. +- Never connect to Tor or proxies. + +## Handoff (→ PROGRESS.md) +Go/no-go, the sized task list for the full MSE plans (if go), and what YouTube still lacks after MSE. diff --git a/Plans/06 Privacy/S023-net-headers-cookies.md b/Plans/06 Privacy/S023-net-headers-cookies.md new file mode 100644 index 0000000..267c81e --- /dev/null +++ b/Plans/06 Privacy/S023-net-headers-cookies.md @@ -0,0 +1,32 @@ +# S023 — Request headers and third-party cookies in servo-net + +> Category 06 Privacy · Model: Opus · Effort: medium · Depends on: S007 · Size: M · Human: no +> Files touched: `vendor/servo-net/` (http_loader.rs, cookie_storage.rs, cookie.rs), `src/hub.rs`, `src/store/settings.rs`, `src/ui/pages/settings.rs`, `docs/DESIGN.md` + +## Goal +Two Servo 0.7 engine limits sit in servo-net, which Nacre already vendors (D-012): the embedder can't add request headers, and can't block third-party cookies. Add both as small, documented patches so Do Not Track / Global Privacy Control headers and "block third-party cookies" really work (today they are limited/unavailable rows in Settings). Part of the privacy work (D-011, R1-16, R1-19). + +## Read +- D-011, D-012 in `docs/DECISIONS.md`; `docs/DESIGN.md` "Engine limits" +- `vendor/servo-net/http_loader.rs` (request header assembly), `cookie_storage.rs`, `cookie.rs` (where cookies are set and sent; how the top-level site of a request is known) + +## Steps +- [ ] Find where outgoing headers are built and where cookies are stored/sent with the request's top-level origin; write the minimal patch points in DESIGN.md +- [ ] Extra request headers: a process-wide, embedder-set list (e.g. `DNT: 1`, `Sec-GPC: 1`) read in http_loader; Nacre sets it from settings; unit test in the vendored crate or a loopback test +- [ ] Third-party cookie blocking: when on, don't store or send cookies whose domain doesn't match the top-level site (keep same-site subdomains); setting in Settings → Privacy, privacy mode turns it on; unit tests for the site matching +- [ ] Settings rows: DNT / GPC and third-party cookies move from limited/unavailable to working rows +- [ ] Verify against a loopback HTTP server (headers echoed, cookies on a cross-site iframe) in a smoke script; no internet needed +- [ ] Keep every servo-net patch listed in DESIGN.md (file, function, why) so a Servo upgrade can re-apply them +- [ ] PROGRESS entry, INDEX line, commit `S023: …` and push + +## End criteria +- The loopback smoke shows the headers arriving and third-party cookies not stored/sent when blocking is on (and still working when off). +- Unit tests for the site matching pass; build green. + +## Pitfalls +- Don't break same-site logins (subdomains, `SameSite=None` on the same site); don't break the bridge proxy. +- One cargo command at a time; vendored crate edits rebuild servo-net and its dependents. +- Never connect to Tor or proxies. + +## Handoff (→ PROGRESS.md) +What the privacy-mode plan (S024) can now switch on. diff --git a/Plans/06 Privacy/S024-privacy-mode.md b/Plans/06 Privacy/S024-privacy-mode.md new file mode 100644 index 0000000..3cc0c5a --- /dev/null +++ b/Plans/06 Privacy/S024-privacy-mode.md @@ -0,0 +1,30 @@ +# S024 — Privacy mode that holds up + +> Category 06 Privacy · Model: Opus · Effort: high · Depends on: S023 · Size: L · Human: no +> Files touched: `src/inject.rs`, `src/hub.rs`, `src/store/settings.rs`, `src/ui/menus.rs` (Protection flyout), `src/ui/pages/settings.rs`, `tests/smoke/`, `docs/DESIGN.md` + +## Goal +R1-16: privacy mode must be genuinely useful: anti-fingerprinting (canvas, WebGL, audio, screen, hardwareConcurrency, deviceMemory, fonts, timezone/language consistency), strict cookies (S023's third-party blocking), tracker blocking, and auto-on in incognito windows; checked with EFF's Cover Your Tracks. Where Servo can't, Nacre adds its own layer (inject.rs scripts) and records it in DESIGN.md. + +## Read +- R1-16 in `docs/review/phase1.md`; D-011 in `docs/DECISIONS.md`; `docs/DESIGN.md` "Engine limits" +- `src/inject.rs` (how scripts are injected per page and frame), the Protection flyout in `src/ui/menus.rs` + +## Steps +- [ ] List the fingerprint surfaces Servo 0.7 exposes (a local test page printing each value) and pick per surface: normalise (common value) or randomise per session/site +- [ ] Inject the spoofing script at document start in every frame when privacy mode is on (per site and global), consistent across APIs (UA ↔ platform ↔ timezone ↔ language) +- [ ] Switch on S023's third-party cookie blocking and privacy headers with privacy mode; incognito windows start with privacy mode on +- [ ] Protection flyout and Settings show what privacy mode does and what's limited by the engine +- [ ] Verify: local fingerprint page before/after (smoke shots + JSON); then one run on coveryourtracks.eff.org (needs internet, no Tor/proxy) and record the result +- [ ] Unit tests for pure logic (value choice, consistency); regression: common sites (heavy-web.txt) still work with privacy mode on +- [ ] PROGRESS entry, INDEX line, commit `S024: …` and push + +## End criteria +- Local fingerprint page shows the normalised values with privacy mode on and real ones off; Cover Your Tracks result recorded; heavy-web smoke still passes with privacy mode on. + +## Pitfalls +- Inconsistent spoofing is itself a fingerprint; break as few sites as possible (captchas are sensitive). +- Never connect to Tor or proxies. + +## Handoff (→ PROGRESS.md) +What's spoofed, what isn't, and site breakage seen. diff --git a/Plans/06 Privacy/S025-cookie-encryption.md b/Plans/06 Privacy/S025-cookie-encryption.md new file mode 100644 index 0000000..b8398bc --- /dev/null +++ b/Plans/06 Privacy/S025-cookie-encryption.md @@ -0,0 +1,30 @@ +# S025 — Cookies encrypted at rest + +> Category 06 Privacy · Model: Opus · Effort: medium · Depends on: S023 · Size: M · Human: no +> Files touched: `src/hub.rs`, `src/store/` (new cookie store), `src/store/vault.rs` (key handling, if reused), `Cargo.toml`, `docs/DESIGN.md` + +## Goal +R1-19: protect cookies against infostealers copying the profile. Run Servo without its plain-file cookie persistence, keep cookies in Nacre's own store encrypted with a key held in the OS keyring (Secret Service/KWallet on Linux, DPAPI on Windows), restore them at start, save them on change/exit; "clear cookies on close" keeps working. + +## Read +- R1-19 in `docs/review/phase1.md`; D-011, D-012 in `docs/DECISIONS.md`; `docs/DESIGN.md` (site data manager: `cookies_for_url`, `set_cookie_for_url`, `clear_cookies`) +- `vendor/servo-net/cookie_storage.rs` and how `Opts.config_dir` persists cookies; `src/store/vault.rs` (existing encryption) + +## Steps +- [ ] Find how Servo 0.7 persists cookies under `config_dir` and the cleanest hook: site data manager calls vs. a small patch in the vendored servo-net to load/save through Nacre +- [ ] Key in the OS keyring (crate choice recorded in DECISIONS; fallback when no keyring: say so in Settings, don't silently write plain text) +- [ ] Encrypted cookie store: load at start before the first page, save on change (debounced) and at exit; migrate existing plain cookies once and delete the plain file +- [ ] "Clear cookies on close" and clear-data page still work; private windows never persist +- [ ] Verify with a restart smoke (log in to a loopback test site, quit, relaunch with SMOKE_HOME, still logged in; the profile has no plain cookie file; the cookie file is unreadable without the key) +- [ ] Unit tests for the store round-trip and the migration +- [ ] PROGRESS entry, INDEX line, commit `S025: …` and push + +## End criteria +- Restart smoke keeps the session; `grep` finds no cookie values in the profile dir; tests pass. + +## Pitfalls +- Windows build: DPAPI path must compile (`cargo check` for the Windows target if installed). +- Don't lose the user's cookies on a failed decrypt: keep a backup until the new store loads. + +## Handoff (→ PROGRESS.md) +Where cookies live now and how to recover when the keyring is unavailable. diff --git a/Plans/INDEX.md b/Plans/INDEX.md index a91e7b9..144aec0 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -32,3 +32,11 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h - [x] [S019 — Settings pages redesign](04%20UI%20redesign/S019-ui-settings.md) · Opus medium - [x] [S020 — Other pages and dialogs redesign](04%20UI%20redesign/S020-ui-pages.md) · Sonnet high - [x] [S021 — Phase 4 review with the user](04%20UI%20redesign/S021-phase4-review.md) · Sonnet medium · 🧑 + +## 05 Engine +- [ ] [S022 — MediaSource (MSE) spike](05%20Engine/S022-mse-spike.md) · Opus high · 🧑 + +## 06 Privacy +- [ ] [S023 — Request headers and third-party cookies in servo-net](06%20Privacy/S023-net-headers-cookies.md) · Opus medium +- [ ] [S024 — Privacy mode that holds up](06%20Privacy/S024-privacy-mode.md) · Opus high +- [ ] [S025 — Cookies encrypted at rest](06%20Privacy/S025-cookie-encryption.md) · Opus medium diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 6107c87..7f89d2c 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -15,3 +15,4 @@ - D-010 — 2026-11-11 — egui's delayed repaints are honoured (repaint observer → `BrowserWindow::redraw_at` → `about_to_wait`) instead of every request redrawing at once; animations that want frames ask with `request_repaint` (every frame) or `request_repaint_after` (paced). The new tab page's settings sub-page is no longer linked from General; Customize on the page replaces it (the sub-page stays for editing shortcuts, opened by "Add shortcut"). — The NTP clock alone kept the window at the display rate; the user's reference has Customize on the page. — S019–S021 and anything that animates - D-011 — 2026-11-12 — Privacy mode (R1-16: anti-fingerprinting, strict cookies, tracker blocking, Cover Your Tracks check, auto-on in incognito) and cookie theft protection (R1-19: Nacre-held cookies encrypted at rest with an OS-keyring key) get their own privacy plan, generated after S021 with /plan-generate; not part of S007. — The user chose it; both are large and touch hub, inject and store. — S007, the new privacy plan - D-012 — 2026-11-12 — servo-net is vendored (`vendor/servo-net`, 0.7.0 + `http2_max_header_list_size(256 KiB)` in `connector.rs` `create_http_client`) via `[patch.crates-io]`. — hyper's 16 KiB HTTP/2 default rejects YouTube's ~19 KiB response headers; Servo can't configure it from the embedder. — any plan that upgrades Servo: drop the patch when servo-net sets the limit, re-run `tests/smoke/heavy-web.txt` +- D-013 — 2026-11-12 — New plans: S022 MSE spike (05 Engine) runs right after S006; privacy plans S023 (request headers + third-party cookies in the vendored servo-net), S024 (privacy mode, R1-16), S025 (encrypted cookies, R1-19) run after S009, before the S010 review. — The user wants real YouTube playback in the page (no yt-dlp workaround) and asked whether missing Servo features can be added from reference engines; the spike sizes MSE before committing weeks to it. — S006–S025 run order