From 0e764ca411e9cfbcc6ede6b1d52ca92d21996658 Mon Sep 17 00:00:00 2001 From: astar76 Date: Wed, 11 Nov 2026 17:09:29 -0600 Subject: [PATCH] S000: workflow scaffold Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 79 +++++++++++++++++++++++++++++++++++ ORCHESTRATOR.md | 36 ++++++++++++++++ PLAN.md | 17 ++++++++ Plans/01 First build/.gitkeep | 0 Plans/02 Verify/.gitkeep | 0 Plans/03 Gaps/.gitkeep | 0 Plans/04 UI redesign/.gitkeep | 0 Plans/INDEX.md | 13 ++++++ Plans/_TEMPLATE.md | 24 +++++++++++ docs/DECISIONS.md | 3 ++ docs/PROGRESS.md | 6 +++ 11 files changed, 178 insertions(+) create mode 100644 CLAUDE.md create mode 100644 ORCHESTRATOR.md create mode 100644 PLAN.md create mode 100644 Plans/01 First build/.gitkeep create mode 100644 Plans/02 Verify/.gitkeep create mode 100644 Plans/03 Gaps/.gitkeep create mode 100644 Plans/04 UI redesign/.gitkeep create mode 100644 Plans/INDEX.md create mode 100644 Plans/_TEMPLATE.md create mode 100644 docs/DECISIONS.md create mode 100644 docs/PROGRESS.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e19134e --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,79 @@ +# Nacre + +Nacre is a web browser written from scratch in Rust on the Servo 0.7 engine, with an egui UI, meant to replace the Python/QtWebEngine Nacre as the user's daily browser. Final deliverable: Linux (AppImage, tar.gz) and Windows (Inno Setup installer, portable zip) builds of the browser, published through the `releases/` folder to the user's Forgejo (astar76/Nacre). Vision: [PLAN.md](PLAN.md). + +## 0. Session rules — read first + +1. You are started with **one plan**: `Plans//SNNN-*.md`. Read only: this file, **your plan**, the **last 3 entries** of `docs/PROGRESS.md`, and the files/sections your plan names. +2. **Do not open other files in `Plans/`** (nor `ORCHESTRATOR.md`, nor all of `PLAN.md`). +3. **Tick each checkbox in your plan file the moment it is done**, one by one, never in batches. Right after each tick, sync the tracker (§Tracker). An interrupted plan resumes at its first unchecked box. +4. **Stay in scope.** Out-of-scope ideas go to `docs/PROGRESS.md` ("Later"), not into the code. +5. **Invent nothing**: check the code/docs; if a fact is still missing, ask — the **orchestrator** if you were started by one (never the user directly), otherwise the user. +6. **End of session**: (a) end criteria verified **by commands**, not memory; (b) `docs/PROGRESS.md` entry (≤ 15 lines: done, not done, later); (c) `docs/DECISIONS.md` if a decision binds later plans; (d) tick your line in `Plans/INDEX.md` (no commentary); (e) commit `SNNN: …` and push to `origin`; (f) short report: done, not done, what the user/orchestrator must do, and any instruction that cost more than it gave. +7. **Languages**: answer in English. Code, comments and docs in English. Internal docs (`CLAUDE.md`, `Plans/`, `PROGRESS.md`) in English. +8. Also at session start (user rule): read `docs/HANDOFF.md` and `docs/STATUS.md` if they exist. `docs/DESIGN.md` is the architecture and Servo API cheat sheet; read the parts your plan names. + +## Tracker + +Live checklist of every plan: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h (collection `plans`, one doc per plan id). +After ticking a box: `ArtifactData` `update` with `url` = the tracker, `collection: "plans"`, `doc_id: "SNNN"`, `data: {"status": "running" or "done" (all boxes ticked), "items": [{"text": "", "done": true/false}, … every checkbox of the plan in order], "updated": ""}` and `if_version` = the version returned by your previous write (first time: `get` the doc once to read it; a doc that doesn't exist yet takes no `if_version`). Load the tool with ToolSearch `select:ArtifactData` once. If the tracker call fails, keep working and say so in the report: the plan file is the source of truth. + +## 1. Repository layout + +Root: `/home/astar76/Projects/Nacre` +``` +src/ main, app (winit), window, hub (Servo delegates), tabs, actions, keys, inject, adblock, discord, media, ... +src/store/ settings, history, bookmarks, downloads, vault, permissions, session, apps, scripts +src/net/ bridge (local CONNECT proxy), fetch, tor, dns, download, dlm +src/ui/ egui chrome, menus, dialogs, widgets, pages/* (every nacre:// page) +assets/ bundled resources +docs/ DESIGN, FEATURES, REVIEW, HANDOFF, UI-BRIEF, ui-reference/, PROGRESS, DECISIONS +Plans/ INDEX.md, _TEMPLATE.md, one folder per category +releases/ release files (git-ignored; hub-release-sync uploads them) +``` +Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference only) and `~/Projects/Nacre-rust` (older repo, not a source). `target/` is build output. + +## 2. Facts + +- Cargo package `nacre` 0.4.0, edition 2024, Rust ≥ 1.88. Servo is `=0.7.0` from crates.io, trimmed (no WebXR, WebGPU, multiprocess). Gamepad and Web Bluetooth stay in. +- Status: ~19k lines written, **never compiled**. Review passes were done by reading only. Expect a round of compile errors at the first build; fix them in place, don't restructure. +- User rules: function first; plain egui UI until everything works; the Material You redesign comes afterwards (see `docs/UI-BRIEF.md`); nothing from the original is dropped silently (Servo limits are shown as unavailable, see DESIGN.md "Engine limits"); never connect to Tor or proxies in tests. +- Known gaps and things to check at the first build: `docs/REVIEW.md`. Feature list with file and review state: `docs/FEATURES.md`. +- The original Python Nacre (`~/Documents/Apps/Nacre/nacre`, `config.py` DEFAULTS) is the feature spec. + +## 3. Code rules + +- Write like the neighbouring code. KISS, DRY, YAGNI; no abstraction without ≥ 2 uses. +- New pure logic gets a test; a bug fix gets a regression test when feasible. +- Fix compile errors in place; don't restructure working modules. +- Servo callbacks run on the main thread; `load_web_resource` must answer synchronously (see REVIEW.md). + +## 4. Domain pitfalls (all agents) + +- **Builds**: `nice cargo build --release -j 2` only. The first build takes hours (Servo, SpiderMonkey, WebRender). Never run `cargo test` at the same time as a release build, and never run two cargo commands on the same `target/`. +- Servo needs clang. Start from Servo's own lock versions to avoid pre-release drift (rsa/pkcs1). +- Run apps offscreen or in a hidden nested session (`kwin_wayland --virtual`) unless the user asked to watch. VMs have no real GPU: use software rendering there. +- Never connect to Tor or proxies in tests; `NACRE_NO_BRIDGE=1` disables the bridge for debugging. +- Servo 0.7 can't add request headers, block third-party cookies, do per-WebView private mode, EME/DRM, printing: don't try, see DESIGN.md. +- Several painters on one GL context (one per tab) is unproven; the fallback is in DESIGN.md. +- Use throwaway `XDG_*` dirs for test runs so the user's profile is untouched. + +## 5. Verification tools + +| Tool | Role | Available after | +|---|---|---| +| `nice cargo build --release -j 2` | compile check, produces `target/release/nacre` | now | +| `cargo test` | unit tests (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme) | first successful build; not alongside a build | +| `src/selftest.rs` | in-app self test (smoke run) | check its current state first | +| Smoke test | launch offscreen, write status file and screenshots, look at them | first build | +| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" | + +Don't assume a tool exists: check first. When your plan creates a tool, add its row here. + +## 6. Git + +Remote `origin` = `forgejo:astar76/Nacre.git`; push finished work there. Don't use `gh`, GitHub or other remotes. Releases only through `releases/v/` (see the user's global CLAUDE.md); tell the user the version and contents before publishing. One commit per logical step, message `SNNN: …` in English. No `reset --hard` / force push without an explicit request. + +## 7. Definition of done + +A plan is done when: all end criteria are **verified by command or test**; planned builds/tests are green; nothing regressed; `PROGRESS` / `DECISIONS` are up to date; the INDEX line and tracker are ticked; the work is committed and pushed. Say explicitly what was **not** done or verified. diff --git a/ORCHESTRATOR.md b/ORCHESTRATOR.md new file mode 100644 index 0000000..6fc2924 --- /dev/null +++ b/ORCHESTRATOR.md @@ -0,0 +1,36 @@ +# Orchestrator — Nacre + +You are the **orchestrator**. You do not do the plans' work yourself: you launch, unblock and validate the sessions that do. Read `CLAUDE.md`, then `Plans/INDEX.md`, then the last 3 entries of `docs/PROGRESS.md`. Start from the **first unchecked plan** in INDEX. + +## Files + +- Plans: `Plans//SNNN-*.md`, one folder per category (header gives model, effort, dependencies, files touched, 🧑). Index: `Plans/INDEX.md`. +- Logs: `docs/PROGRESS.md`, `docs/DECISIONS.md`. Vision: `PLAN.md`. +- Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h — sessions update it themselves; you only check it matches the plan files (`ArtifactData list plans` vs. the plans' checkboxes; `update` to repair). + +## Launching sessions + +**Look-ahead rule (check it after EVERY event: start, GO, validation, answer to a session):** count the sessions you started that are *waiting for GO* (not running, not done). If fewer than **3 (default 3)** and unchecked plans remain in scope, start waiting sessions for the next plans in INDEX order right now, until the count is reached. Waiting sessions cost almost nothing and don't touch files: preparing them is never “running in parallel”, and dependencies only gate the GO, not the preparation. Say the count in each status line (`waiting: S014, S015, S016`). + +1. Prepare each look-ahead plan as a nested session (`start_session`, `initiation: "user_asked"`, same folder) with the plan's model and effort. Brief: *“Read CLAUDE.md and Plans//SNNN-xxx.md only. Do not start: wait for GO from the orchestrator.”* plus anything the plan cannot know (state of previous plans, tags, decisions taken since). Do not repeat CLAUDE.md rules. +2. Send **GO** (`SendMessage` to its `local_…` id) when its dependencies are validated. +3. **Parallel** only if the plans are consecutive, none depends on another, their “files touched” don't overlap, and none touches `cargo`: only one cargo build or test may run at a time on the shared `target/`, so any plan that builds or tests runs alone. Otherwise one at a time. + +## Answering sessions + +Sessions talk to **you**, never to the user. Answer from the project goal, `PLAN.md`, `DECISIONS.md` and the code. Disturb the user only for a real necessity (🧑 steps, irreversible or outward-facing actions, a decision that changes the goal); then stop and tell them exactly what to look at, how, and what to answer. Record any decision you take in `docs/DECISIONS.md`. + +## Validating a plan (when its session ends) + +Check with commands, not its report: plan checkboxes all ticked; end criteria hold (rerun only **targeted** tests for what changed); PROGRESS entry present; INDEX line ticked; commit and push to origin present; working tree clean; tracker doc matches. If something is missing, send it back to the same session. Then GO the next one and apply the look-ahead rule. + +Relay to the user any remark that an instruction costs more than it gives, with an alternative. + +## Context and stop + +- Near ~300K context: finish validating the current plan, then tell the user to open a new session with `/orchestrate` (you resume from INDEX). +- If the user says **STOP**: stop the running sessions and your follow-up; on resume, message the same sessions to continue from their first unchecked box. + +## End of a phase / project + +Short report: what changed (before/after), what was verified, what remains, what the user must do. diff --git a/PLAN.md b/PLAN.md new file mode 100644 index 0000000..7931306 --- /dev/null +++ b/PLAN.md @@ -0,0 +1,17 @@ +# Nacre — vision + +## Goal +A daily-driver web browser in Rust on Servo 0.7 with an egui UI, 1:1 in features with the user's Python/QtWebEngine Nacre (new tab page, settings, permissions, vault/autofill, ad blocker, VPN/DNS bridge, downloads, Discord presence, media, import of old profiles). Recipient: the user, replacing their current browser; releases go to their Forgejo (astar76/Nacre). + +## Current state +About 19k lines written across storage, networking, ad blocker, media, importer, updates, keys, Servo glue and a plain egui UI. Reviewed by reading only; never compiled. Architecture: `docs/DESIGN.md`; features: `docs/FEATURES.md`; open checks: `docs/REVIEW.md`; redesign spec: `docs/UI-BRIEF.md`. + +## 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. +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. + +## 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/.gitkeep b/Plans/01 First build/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Plans/02 Verify/.gitkeep b/Plans/02 Verify/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Plans/03 Gaps/.gitkeep b/Plans/03 Gaps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Plans/04 UI redesign/.gitkeep b/Plans/04 UI redesign/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Plans/INDEX.md b/Plans/INDEX.md new file mode 100644 index 0000000..a0be544 --- /dev/null +++ b/Plans/INDEX.md @@ -0,0 +1,13 @@ +# Plans — index + +One session = one plan. Plans live in category folders `Plans//SNNN-slug.md`; one `##` heading per folder below. Start: `Read CLAUDE.md then execute Plans//SNNN-xxx.md (only that one).` — or let the orchestrator run them (`/orchestrate` in a new session). Sessions tick their line here, without commentary. 🧑 = needs the user. + +Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h + +## 01 First build + +## 02 Verify + +## 03 Gaps + +## 04 UI redesign diff --git a/Plans/_TEMPLATE.md b/Plans/_TEMPLATE.md new file mode 100644 index 0000000..d27f400 --- /dev/null +++ b/Plans/_TEMPLATE.md @@ -0,0 +1,24 @@ +# SNNN — {{TITLE}} + +> Category {{NN Category}} · Model: {{Sonnet|Opus}} · Effort: {{medium|high}} · Depends on: {{SNNN|—}} · Size: {{S|M|L}} · Human: {{no|🧑 what}} +> Files touched: {{paths/globs}} + +## Goal +{{What, why, and the AUDIT/PLAN references it handles.}} + +## Read +{{Exact files or sections to read — nothing more.}} + +## Steps +- [ ] {{step}} +- [ ] {{step}} +- [ ] PROGRESS entry, INDEX line, commit `SNNN: …` + +## End criteria +{{Each one checkable by a command or test.}} + +## Pitfalls +{{Known traps.}} + +## Handoff (→ PROGRESS.md) +{{What the next plans need to know.}} diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md new file mode 100644 index 0000000..4330c34 --- /dev/null +++ b/docs/DECISIONS.md @@ -0,0 +1,3 @@ +# Decisions + +`D-NNN — date — decision — why — plans affected`. Never rewrite an entry; supersede it with a new one. diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md new file mode 100644 index 0000000..59aed4c --- /dev/null +++ b/docs/PROGRESS.md @@ -0,0 +1,6 @@ +# Progress + +One entry per session, newest last, ≤ 15 lines: done, verified how, not done, later. + +## Later +-