diff --git a/PLAN.md b/PLAN.md index 7931306..d952681 100644 --- a/PLAN.md +++ b/PLAN.md @@ -9,9 +9,11 @@ About 19k lines written across storage, networking, ad blocker, media, importer, ## Phases 1. **First build** — make it compile (`nice cargo build --release -j 2`), fix errors in place, get the binary to start. 2. **Verify** — run the unit tests, smoke test offscreen (page renders, tabs, settings), check the shared-GL painter question; fix what breaks. -3. **Gaps** — work through `docs/REVIEW.md`, then candidates: reader mode, translate, split view, MPRIS media keys, gamepad rumble. +3. **Gaps** — work through `docs/REVIEW.md`, fix the user's review items, add MPRIS media keys (other candidates deferred, D-002). 4. **UI redesign** — Material You (tonal-spot schemes, spring motion, expressive shapes) and the animated new tab page per `docs/UI-BRIEF.md`, using the `app-taste` skill. Starts only after the framework works. 5. Packaging and release (Linux AppImage/tar.gz, Windows installer and zip) when the user asks. +Each of phases 1–4 ends with a user review plan (D-003). + ## Out of scope Chrome extensions, Widevine/DRM, printing, per-WebView private mode, third-party cookie blocking (Servo 0.7 limits, shown as unavailable); anything copied from the older `Nacre-rust` repo. diff --git a/Plans/01 First build/S001-compile.md b/Plans/01 First build/S001-compile.md new file mode 100644 index 0000000..2b7b3b3 --- /dev/null +++ b/Plans/01 First build/S001-compile.md @@ -0,0 +1,39 @@ +# S001 — Compile to a binary + +> Category 01 First build · Model: Opus · Effort: medium · Depends on: — · Size: L · Human: no +> Files touched: `src/**`, `Cargo.toml`, `Cargo.lock` + +## Goal +Make the never-compiled ~19.5k lines build: `nice cargo build --release -j 2` produces `target/release/nacre`. Fix compile errors in place without restructuring (CLAUDE.md §2, §3). A previous run already built Servo (`target/release/deps/libservo-*.rlib` exists), so only the `nacre` crate should need rebuilding. Also commit the uncommitted self-test work (`src/selftest.rs`, hooks in `app.rs`/`window.rs`/`main.rs`, Discord client id in `settings.rs`) and `docs/UI-BRIEF.md` + `docs/ui-reference/`. + +## Read +- `docs/DESIGN.md` (whole; it is the Servo 0.7 API cheat sheet) +- `docs/REVIEW.md` +- Only the source files that compile errors point at; for Servo API questions read the crate sources in `~/.cargo/registry/src/*/servo-0.7.0/` and friends rather than guessing. + +## Steps +- [ ] Commit the pending work as is (`S001: commit self-test WIP and UI brief`) so fixes start from a clean tree +- [ ] Check toolchain: `rustc --version` ≥ 1.88, `clang --version`; run `nice cargo build --release -j 2 --message-format short 2>&1 | tail -150` and save the full log to the scratchpad +- [ ] Fix name-resolution / import / missing-item errors (`E0432`, `E0433`, `E0425`, `E0412`, `E0599` on wrong paths) across all modules; rebuild +- [ ] Fix type and trait errors (mismatched types, missing trait impls, wrong Servo/egui/winit signatures) module by module; rebuild after each module group +- [ ] Fix borrow-checker and lifetime errors (`E0499`, `E0502`, `E0505`, `E0597`) with the smallest local change (clone, scope, split borrow); rebuild +- [ ] Build is clean of errors; then fix warnings that point at real bugs (unused results, unreachable code); leave style warnings +- [ ] `target/release/nacre --help` (or `--version`) runs and exits 0 without opening a window; if it has no such flag, check `ldd target/release/nacre` resolves everything +- [ ] Update `docs/HANDOFF.md` "State" (compiles now) and add anything surprising about Servo's API to `docs/DESIGN.md` cheat sheet +- [ ] PROGRESS entry, INDEX line, commit `S001: …` and push + +## End criteria +- `nice cargo build --release -j 2` exits 0. +- `test -x target/release/nacre`. +- `git status --short` is empty after the commit. + +## Pitfalls +- Never run two cargo commands at once on `target/`; never `cargo clean` (rebuilding Servo takes hours). +- Pipe build output through `tail`/`grep -E '^(error|warning: unused)'`; full logs eat context. Use `--message-format short`. +- rustc stops at some phases: fixing resolve errors reveals type errors, which reveal borrow errors. Expect several rounds. +- Don't restructure modules or change behaviour to make an error go away; if an API truly doesn't exist in Servo 0.7, keep the feature, mark it as an engine limit (DESIGN.md) and record it in PROGRESS. +- If `Cargo.lock` drift breaks Servo deps (rsa/pkcs1 pre-releases), pin to Servo 0.7's own lock versions. +- If the session gets long, commit what compiles so far (`S001: wip …`); the plan resumes at the first unchecked box. + +## Handoff (→ PROGRESS.md) +Binary path, build time of the nacre crate alone, any feature degraded to make it compile (with file:line). diff --git a/Plans/01 First build/S002-unit-tests.md b/Plans/01 First build/S002-unit-tests.md new file mode 100644 index 0000000..d942b96 --- /dev/null +++ b/Plans/01 First build/S002-unit-tests.md @@ -0,0 +1,31 @@ +# S002 — Unit tests green + +> Category 01 First build · Model: Sonnet · Effort: high · Depends on: S001 · Size: M · Human: no +> Files touched: `src/**` (test modules and the code they expose bugs in) + +## Goal +Run the unit test suite for the first time and make it pass (CLAUDE.md §5 lists the tested modules). Test failures that show real bugs get fixed in the code, not in the test. + +## Read +- `docs/DESIGN.md` § Layout only +- The test modules that fail, and the functions they test + +## Steps +- [ ] Make sure no other cargo process runs (`pgrep -a cargo`); run `nice cargo test --release -j 2 --no-run 2>&1 | grep -E '^error' -A5 | head -150` and fix test-only compile errors +- [ ] Run `nice cargo test --release -j 2 2>&1 | grep -E 'test result|FAILED|panicked' ` and list failures +- [ ] For each failing test decide: bug in code (fix code) or wrong expectation (fix test, say why in the commit); fix them one module at a time +- [ ] Make sure no test touches the network beyond loopback, Tor, a proxy or the user's profile (grep tests for `http`, `tor`, `dirs::`); fix any that do +- [ ] Full suite green twice in a row (flaky check) +- [ ] Update CLAUDE.md §5 `cargo test` row with the real command and run time +- [ ] PROGRESS entry, INDEX line, commit `S002: …` and push + +## End criteria +- `nice cargo test --release -j 2` exits 0, twice in a row. +- No test reads `~/.config/nacre` or `~/.local/share/nacre` (grep). + +## Pitfalls +- `--release` shares the Servo build from S001; a debug-profile test build would recompile Servo for hours. +- Never run tests while a build is running. + +## Handoff (→ PROGRESS.md) +Test count, run time, which code bugs the tests found. diff --git a/Plans/01 First build/S003-first-launch.md b/Plans/01 First build/S003-first-launch.md new file mode 100644 index 0000000..7aa437f --- /dev/null +++ b/Plans/01 First build/S003-first-launch.md @@ -0,0 +1,34 @@ +# S003 — First launch and smoke harness + +> Category 01 First build · Model: Opus · Effort: medium · Depends on: S002 · Size: M · Human: no +> Files touched: `tools/smoke.sh` (new), `tests/smoke/*.txt` (new), `src/selftest.rs`, `src/app.rs`/`src/window.rs` only for launch bugs, `CLAUDE.md` §5 + +## Goal +Get the binary to start, render a real page and quit cleanly, offscreen, and turn `src/selftest.rs` (`NACRE_SCRIPT`) into a reusable smoke tool for the Verify plans. + +## Read +- `src/selftest.rs` (whole) +- `docs/DESIGN.md` § Layout and the GL/painter section +- User's global CLAUDE.md "Building" (offscreen runs, software GL) + +## Steps +- [ ] Find an offscreen display that works here: `kwin_wayland --virtual` (preferred, nested and hidden) or Xvfb/`weston --backend=headless`; note which +- [ ] Write `tools/smoke.sh