diff --git a/CLAUDE.md b/CLAUDE.md index ad06754..004e57a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,21 +2,14 @@ Medlar is a download manager for Linux in Rust and egui: all of Free Download Manager's features and more, downloads split into dynamic parts, limits, priorities, queues, video sites, a local port that takes downloads from browsers, and a Material You (M3 Expressive) interface with spring motion and wavy progress bars. What it must do: [docs/FEATURES.md](docs/FEATURES.md). Final deliverable: a tested AppImage and tar.gz, for the user and for release on Astar Hub. Vision: [PLAN.md](PLAN.md). -## 0. Session rules — read first +## 0. Session rules -0. If `docs/HANDOFF.md` exists, read it and `docs/STATUS.md` 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` if it is set; (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, short (the user is on a tight budget). Code, comments and user-facing text in English. Internal docs (`CLAUDE.md`, `Plans/`, `PROGRESS.md`) in English. - -## Tracker - -Live checklist of every plan: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H (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. Started with **one plan** (`Plans//SNNN-*.md`): read only your plan and what it names. Not other plans, `ORCHESTRATOR.md` or all of `PLAN.md`. Only the orchestrator reads `docs/HANDOFF.md`, `docs/STATUS.md`. +2. **Few steps, short output**: batch reads and edits, cap command output, never read the same thing twice. +3. **No testing while building**: no tests written or run, no screenshots, no app runs, no release builds, unless the plan says `Phase: test`. One compile check: `nice cargo check -q -j 2 -p medlar`. Write your test file `docs/tests/SNNN-slug.md` (checks in words, from `docs/tests/_TEMPLATE.md`). +4. Stay in scope; ideas go to `docs/PROGRESS.md` (“Later”). Invent nothing: check the code or docs, else ask the orchestrator (the user if there is none). +5. **End**: boxes ticked, PROGRESS entry (≤ 5 lines), `docs/DECISIONS.md` if a decision binds later plans, INDEX line ticked, commit `SNNN: …` and push to `origin` if it is set. Report what was not done and not tested. The orchestrator writes the tracker (https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H, collection `plans`). +6. **Languages**: English, short. ## 1. Repository layout @@ -29,7 +22,7 @@ crates/cli/ command line and headless mode, a library used by the `medlar crates/testserver/ local server with faults for tests (ranges, throttle, cuts, expiry, logins) tools/ screenshot, hidden-run, icon and packaging scripts assets/ icon, fonts, Material Symbols -docs/ FEATURES, PROGRESS, DECISIONS, STATUS, CONNECTOR; tracker.html is the tracker page's source +docs/ FEATURES, PROGRESS, DECISIONS, STATUS, CONNECTOR, tests/ (one test file per plan); tracker.html is the tracker page's source Plans/ one plan per session ``` Never modify: everything outside this folder. `~/Projects/*` is read-only reference (copy code in, never edit there). `~/.abdm` and the running AB Download Manager are the user's: never stop, read or reconfigure them. @@ -47,10 +40,10 @@ Never modify: everything outside this folder. `~/Projects/*` is read-only refere ## 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. -- UI work loads the `app-taste` skill first and follows it; motion work also loads `animate`. Interface colours, radii, spacing, type and motion come from tokens only. +- Test phase: new pure logic gets a test; a bug fix gets a regression test when feasible. +- UI work reads `~/.claude/skills/app-taste/SKILL.md` once; motion work also `animate`. Interface colours, radii, spacing, type and motion come from tokens only. - Wavy bars and other motion run only while something really changes; idle draws no frames. -- `core` never depends on egui. Every engine behaviour has a test against `testserver`, including the failure paths. +- `core` never depends on egui. Every engine behaviour and its failure paths get a check in the test file, run against `testserver` in the test phase. - Errors reach the user as plain words: what failed, then why. Every user string goes through the string catalogue (FEATURES 8.5). - Follow the pattern of real products only for mechanics; the look, name, icon and copy are Medlar's own. @@ -65,7 +58,7 @@ Never modify: everything outside this folder. `~/Projects/*` is read-only refere - Run apps hidden (kittest or nested niri) with a throwaway `XDG_*` home unless the user asks to watch. Power actions are tested against a fake logind only. - DRM, captchas and paywalls are never worked around. -## 5. Verification tools +## 5. Verification tools (test phase only, except the compile check) | Tool | Role | Available after | |---|---|---| @@ -86,4 +79,4 @@ Remote: Astar Hub only (`forgejo:astar76/Medlar.git`, see the user's global CLAU ## 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. Say explicitly what was **not** done or verified. +A plan is done when it compiles, its boxes and INDEX line are ticked, its test file exists and it is committed. The **project** is done when the test phase has passed. Compiled is not tested: say so. diff --git a/ORCHESTRATOR.md b/ORCHESTRATOR.md index d791ba9..c0fa1e9 100644 --- a/ORCHESTRATOR.md +++ b/ORCHESTRATOR.md @@ -1,36 +1,11 @@ # Orchestrator — Medlar -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. +How plans are run (one worker at a time, budget, checks, testing at the end) is in the `orchestrate` skill. This file holds only what is special to this project. -## 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/XouimfVJS6FYVKskGJ8s7H — 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** 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 “Use the caveman skill (`caveman:caveman`) for all replies; code, docs and commits stay normal English.” 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 at most two run at once, only one of them builds or runs tests at a time (4 cores, 16 GB). 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. The user does not want to be stopped (D-004): take the recommended choice yourself and record it. Disturb them only for a real necessity (a release, 🧑 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 (pushed if `origin` is set) 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. +- Plans: `Plans//SNNN-*.md`; index `Plans/INDEX.md`, in its order. Logs: `docs/PROGRESS.md`, `docs/DECISIONS.md`. Test files: `docs/tests/`, results: `docs/TEST-REPORT.md`. Plans up to S019 have automatic tests of their own and no test file. +- Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H (collection `plans`, one doc per plan id; written once, when a plan ends). `Plans/Later/` is not run. +- Decide alone (D-004), except: a release, 🧑 steps, what cannot be undone or leaves this PC, a change of the goal. +- Merging: `main` is fast-forwarded after each finished category (D-014). Pushes go to Astar Hub only. +- Never touch `~/.abdm`, port 15151, or anything outside this folder. +- Binding decision (kept here so branches merge cleanly): D-060 — 2026-11-25 — One worker at a time; no tests, screenshots or release builds in build plans; each plan leaves `docs/tests/SNNN-slug.md`; tests run in category 09. Replaces D-016 and the per-plan test rules — the user: weekly limit gone too fast, testing while working too heavy — all unstarted plans (S017, S021 on) +- Version 1 is cut to 13 plans after S009, S012, S016 (the user, 2026-11-25): see INDEX “Later”. diff --git a/PLAN.md b/PLAN.md index 6cd31b5..c569302 100644 --- a/PLAN.md +++ b/PLAN.md @@ -5,7 +5,7 @@ A download manager for Linux that does everything Free Download Manager does and queues, scheduling, video sites, and a local port that takes downloads from browsers. Its Material You interface uses M3 Expressive shapes, spring motion and wavy progress bars that show what the engine is really doing. Recipient: the user, as their daily download manager, then anyone who gets a release from Astar Hub. -Done means every item in [docs/FEATURES.md](docs/FEATURES.md) §1–9 works and has been tested. +Version 1 is done when every item in [docs/FEATURES.md](docs/FEATURES.md) §1–9, except those under Later, works and has been tested. ## Current state New project. No code yet. Reusable code of the user's own: Damson (motion, theme, kittest screenshots), Mulberry (shapes, wavy @@ -22,5 +22,8 @@ slider, widgets, tray), Nacre (hidden nested session, hand-off format). 8. **Motion and polish** — `/improve-animations` audit, its fixes, an app-taste pass over every screen, performance. 9. **Release** — AppImage and tar.gz, older-distro test, docs, repo page. Publishing needs the user's yes. +## Later (after version 1) +Automatic limiter, quota, metered lines (2.4, 2.5); preview and conversion (6.2, 6.3); archive peek, unpack, join, scan (3.7, 7.5); site grabber and explorer (3.5, 3.6); statistics, import and export (7.6, 7.7); command line, headless, REST and web remote (8.2, 8.3 except single instance). Plans: `Plans/Later/`. + ## Out of scope FEATURES §10. diff --git a/Plans/03 Interface/S017-details.md b/Plans/03 Interface/S017-details.md index ca41a8a..568da34 100644 --- a/Plans/03 Interface/S017-details.md +++ b/Plans/03 Interface/S017-details.md @@ -1,6 +1,6 @@ # S017 — Details panel and file actions -> Category 03 Interface · Model: Opus · Effort: medium · Depends on: S015, S009 · Size: M · Human: no +> Category 03 Interface · Model: Sonnet · Effort: medium · Depends on: S015, S009 · Phase: build · Human: no > Files touched: crates/app/src/views/details*, crates/core/src/files*, crates/app/tests/details* ## Goal @@ -18,10 +18,14 @@ FEATURES 7.2, 7.3, 7.4, 9.3 in place. - [ ] Live edits: limit, parts, priority, queue, link, login - [ ] Log with copy, filter and redaction; properties copyable - [ ] Error section: what, why, when tried, next try, all fixes +- [ ] Test file `docs/tests/S017-details.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S017: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar --test details` green +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar (details) green - shots of every tab and the error state looked at ## Pitfalls diff --git a/Plans/04 Control/S021-queues-schedule-power.md b/Plans/04 Control/S021-queues-schedule-power.md index 1784fc9..24a7dd7 100644 --- a/Plans/04 Control/S021-queues-schedule-power.md +++ b/Plans/04 Control/S021-queues-schedule-power.md @@ -1,6 +1,6 @@ # S021 — Queues, scheduler and power actions -> Category 04 Control · Model: Opus · Effort: medium · Depends on: S019 · Size: M · Human: no +> Category 04 Control · Model: Sonnet · Effort: medium · Depends on: S019 · Phase: build · Human: no > Files touched: crates/core/src/{queue,schedule,power,run}*, crates/core/tests/schedule* ## Goal @@ -12,15 +12,20 @@ FEATURES 2.6–2.9. ## Steps - [ ] Queues: folder, limit, active count, order, schedule, done action; move tasks between them -- [ ] Schedules: times, weekdays, once, mode by time grid; time zone, daylight saving and missed-while-asleep rules with tests on a virtual clock +- [ ] Schedules: times, weekdays, once, mode by time grid; time zone, daylight saving and missed-while-asleep rules; the clock is injectable - [ ] Dependencies and delayed start; cycles refused - [ ] When done: shut down, suspend, hibernate, log out, lock, quit, run command, with a cancellable countdown; conditions (all, queue, task) - [ ] logind through zbus, inhibit suspend while downloading; capabilities checked first - [ ] Run program: argument list with placeholders, no shell, timeout, output in the log +- [ ] Test file `docs/tests/S021-queues-schedule-power.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S021: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test schedule` green against a fake logind +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (schedule) green against a fake logind +- daylight saving, time zone and missed-while-asleep on a virtual clock ## Pitfalls Never call the real logind power methods in tests. A failed download must not trigger a shutdown unless chosen. diff --git a/Plans/04 Control/S022-control-screens.md b/Plans/04 Control/S022-control-screens.md index 76d8136..c903d2a 100644 --- a/Plans/04 Control/S022-control-screens.md +++ b/Plans/04 Control/S022-control-screens.md @@ -1,10 +1,10 @@ # S022 — Control screens -> Category 04 Control · Model: Opus · Effort: medium · Depends on: S015, S018, S020, S021 · Size: M · Human: no +> Category 04 Control · Model: Sonnet · Effort: medium · Depends on: S015, S018, S021 · Phase: build · Human: no > Files touched: crates/app/src/views/{modes,queues,schedule}*, crates/app/tests/control* ## Goal -FEATURES 2.1–2.9 and 9.5 on screen. +FEATURES 2.1–2.3, 2.6–2.9 and 9.5 on screen (automatic limiter and quota are Later). ## Read - app-taste and animate skills @@ -12,16 +12,20 @@ FEATURES 2.1–2.9 and 9.5 on screen. - crates/app/src/ui/{wave,graph}* ## Steps -- [ ] Mode switch in the toolbar as a connected group, snail included, with the reason when the automatic limiter or a quota acts +- [ ] Mode switch in the toolbar as a connected group, snail included - [ ] Limit dial: wavy slider with spring handle, log scale, typing and units - [ ] Priority control in rows and details, share preview; "only this one" - [ ] Queue page: cards with live totals, drag tasks and order, edit sheet - [ ] Week grid for modes and starts: paint by drag, keyboard too -- [ ] Quota card and metered notice; done-action picker with countdown sheet +- [ ] Done-action picker with countdown sheet +- [ ] Test file `docs/tests/S022-control-screens.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S022: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar --test control` green: drag keeps the grab point, keyboard equivalent works +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar (control) green: drag keeps the grab point, keyboard equivalent works - shots looked at ## Pitfalls diff --git a/Plans/05 Connector/S023-port-server.md b/Plans/05 Connector/S023-port-server.md index 0ece75e..ad2a8f4 100644 --- a/Plans/05 Connector/S023-port-server.md +++ b/Plans/05 Connector/S023-port-server.md @@ -1,6 +1,6 @@ # S023 — The port and its protection -> Category 05 Connector · Model: Opus · Effort: high · Depends on: S016 · Size: M · Human: no +> Category 05 Connector · Model: Opus (network security) · Effort: medium · Depends on: S016 · Phase: build · Human: no > Files touched: crates/core/src/connector/**, crates/core/tests/connector*, docs/CONNECTOR.md ## Goal @@ -14,17 +14,22 @@ A browser hands links to 127.0.0.1:17616; nothing else can abuse it. FEATURES 4. ## Steps - [ ] Server on loopback only, changeable port, on and off live, port-in-use state that names the fix - [ ] `GET /` ping with name and version; `POST /` with one link or a list, unknown fields ignored, size and rate limits, answers 2xx quickly -- [ ] Refuses foreign `Host` (DNS rebinding), any web `Origin`, form content types and preflights; no CORS headers; tests for each attack +- [ ] Refuses foreign `Host` (DNS rebinding), any web `Origin`, form content types and preflights; no CORS headers - [ ] Checks links (http, https, ftp, ftps, sftp, stream schemes only), names and headers; hop-by-hop and injection headers dropped - [ ] Cookies, referrer and user agent used for the download and kept through the keyring module - [ ] Sender log: when, what, accepted or why not; sender process name from /proc/net/tcp where possible - [ ] docs/CONNECTOR.md: format, examples with curl, security notes +- [ ] Test file `docs/tests/S023-port-server.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S023: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test connector` green +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (connector) green - Nacre's exact body (copied as a fixture) is accepted by curl - every attack test refused +- every attack: foreign Host, web Origin, form content type, preflight, header injection ## Pitfalls Never bind 0.0.0.0. Port 15151 is the user's AB Download Manager. No secrets in the sender log. diff --git a/Plans/05 Connector/S024-handoff-flow.md b/Plans/05 Connector/S024-handoff-flow.md index 2a6bb0a..b7265a6 100644 --- a/Plans/05 Connector/S024-handoff-flow.md +++ b/Plans/05 Connector/S024-handoff-flow.md @@ -1,6 +1,6 @@ # S024 — Hand-off flow and Nacre test -> Category 05 Connector · Model: Opus · Effort: medium · Depends on: S018, S023 · Size: M · Human: no +> Category 05 Connector · Model: Sonnet · Effort: medium · Depends on: S018, S023 · Phase: build · Human: no > Files touched: crates/app/src/views/{incoming,connector}*, crates/app/src/instance*, assets/*.desktop, crates/app/tests/incoming* ## Goal @@ -18,13 +18,17 @@ From a click in the browser to a running or continued download. FEATURES 4.4, 4. - [ ] Setting "add without asking" with type and size rules, off by default - [ ] Connector page: state, port, test link button, sender log, steps for Nacre's custom manager - [ ] Single instance by socket; a second launch hands over its arguments; `medlar:` scheme and `.metalink` in the desktop file -- [ ] Hidden run: Nacre with a throwaway home and Medlar on a spare port; a click on a test-server link arrives and downloads. If Nacre can't be driven, replay its body and say so -- [ ] Expired-link run: download, expire, send a fresh link, file completes identical +- [ ] Test file `docs/tests/S024-handoff-flow.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S024: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar --test incoming` green +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar (incoming) green - hidden run log and shots looked at +- hidden run: Nacre with a throwaway home, Medlar on a spare port, a click arrives and downloads (else replay its body and say so) +- download, expire the link, send a fresh one, file completes identical ## Pitfalls Run Nacre only with a throwaway home. `medlar:` links come from web pages, so they always show the dialog. diff --git a/Plans/06 Media/S025-video-sites.md b/Plans/06 Media/S025-video-sites.md index ecea5bf..bb49b0e 100644 --- a/Plans/06 Media/S025-video-sites.md +++ b/Plans/06 Media/S025-video-sites.md @@ -1,6 +1,6 @@ # S025 — Video sites through yt-dlp -> Category 06 Media · Model: Opus · Effort: medium · Depends on: S012, S016 · Size: M · Human: no +> Category 06 Media · Model: Sonnet · Effort: medium · Depends on: S012, S016 · Phase: build · Human: no > Files touched: crates/core/src/ytdlp*, crates/app/src/views/video*, crates/core/tests/ytdlp* ## Goal @@ -17,12 +17,16 @@ FEATURES 6.1 with the system's yt-dlp (D-011). - [ ] Add dialog page: quality choice with sizes, audio only, subtitles, playlist picker - [ ] Run as a task: progress template parsed to parts and speed, pause by stop and resume, limits passed on, cookies through a private temp file - [ ] Errors mapped to kinds: private, removed, region, login, unsupported, too many requests; DRM refused -- [ ] A stub yt-dlp script for tests that replays recorded outputs +- [ ] Test file `docs/tests/S025-video-sites.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S025: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test ytdlp` green with the stub +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (ytdlp) green with the stub - one `#[ignore]` test against the local test server's generic page +- a stub yt-dlp that replays recorded outputs ## Pitfalls Links after `--`; config files ignored; cookies file mode 600 and removed. No bypassing of protections. Don't download from real video sites in tests. diff --git a/Plans/07 Library and tools/S027-rules-clipboard-drop.md b/Plans/07 Library and tools/S027-rules-clipboard-drop.md index 3483842..fbcf4c7 100644 --- a/Plans/07 Library and tools/S027-rules-clipboard-drop.md +++ b/Plans/07 Library and tools/S027-rules-clipboard-drop.md @@ -1,6 +1,6 @@ # S027 — Rules, clipboard, drag and drop, drop target -> Category 07 Library and tools · Model: Opus · Effort: medium · Depends on: S016, S018 · Size: M · Human: no +> Category 07 Library and tools · Model: Sonnet · Effort: medium · Depends on: S016, S018 · Phase: build · Human: no > Files touched: crates/core/src/rules*, crates/app/src/{clipboard,drop}*, crates/app/src/views/{rules,target}* ## Goal @@ -18,10 +18,14 @@ FEATURES 3.3, 3.4, 3.9. - [ ] Drop links, text, lists and `.metalink` on the window with a full-window drop state - [ ] Floating drop target: small wavy ring with speed, own always-on-top window where the compositor allows, else a compact window; accepts drops; context menu - [ ] Rules and clipboard pages +- [ ] Test file `docs/tests/S027-rules-clipboard-drop.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S027: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test rules` and app tests green +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (rules) and app tests green - hidden run drops a link and shots looked at ## Pitfalls diff --git a/Plans/07 Library and tools/S033-tray-notify.md b/Plans/07 Library and tools/S033-tray-notify.md index 9f0b09a..57f87f7 100644 --- a/Plans/07 Library and tools/S033-tray-notify.md +++ b/Plans/07 Library and tools/S033-tray-notify.md @@ -1,6 +1,6 @@ # S033 — Tray, notifications and autostart -> Category 07 Library and tools · Model: Sonnet · Effort: high · Depends on: S022, S024 · Size: M · Human: no +> Category 07 Library and tools · Model: Sonnet · Effort: medium · Depends on: S022, S024 · Phase: build · Human: no > Files touched: crates/app/src/{tray,notify,launcher,autostart}* ## Goal @@ -17,10 +17,14 @@ FEATURES 8.1, 8.4. - [ ] Notifications: done, failed, needs login, all done, with actions (open, show folder, continue, retry); grouped, quiet hours - [ ] Launcher progress through the Unity D-Bus signal - [ ] Desktop file, metainfo, MIME and scheme entries checked by their validators when present +- [ ] Test file `docs/tests/S033-tray-notify.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S033: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar` green against fake StatusNotifier and Notifications services under dbus-run-session +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar green against fake StatusNotifier and Notifications services under dbus-run-session ## Pitfalls Never use the user's session bus in tests. diff --git a/Plans/08 Motion and polish/S034-motion-audit.md b/Plans/08 Motion and polish/S034-motion-audit.md index bed7092..f190f87 100644 --- a/Plans/08 Motion and polish/S034-motion-audit.md +++ b/Plans/08 Motion and polish/S034-motion-audit.md @@ -1,32 +1,26 @@ -# S034 — Animation audit +# S034 — Motion and look pass -> Category 08 Motion and polish · Model: Opus · Effort: high · Depends on: S022, S024, S026, S027, S028, S029, S030, S032, S033 · Size: M · Human: no -> Files touched: animation-plans/**, docs/PROGRESS.md +> Category 08 Motion and polish · Model: Opus (design judgement) · Effort: medium · Depends on: S017, S022, S024, S025, S027, S033 · Phase: build · Human: no +> Files touched: crates/app/** ## Goal -Run `/improve-animations` at standard depth over the finished app, as D-008 sets out. Plans only, no source changes. +One look and feel, and motion that earns its place (D-008, FEATURES 9.7). Was S034, S035 and S036: find and fix in one go, no separate plan files. ## Read -- improve-animations and app-taste skills -- crates/app/src/{motion,tokens}* -- crates/app/src/ui and views (motion calls) +- `~/.claude/skills/app-taste/SKILL.md`, `~/.claude/skills/improve-animations/SKILL.md` (rules only) +- crates/app/src/{motion,tokens}*, then the views by `rg` hits only ## Steps -- [ ] Recon: where motion lives, tokens, personality, a frequency tier for each animated surface -- [ ] Audit the eight categories named in the skill; the web remote page included -- [ ] Re-read the code at each finding; drop the by-design and duplicate ones -- [ ] Findings table by leverage and up to four missed opportunities -- [ ] A self-contained plan for every HIGH and MEDIUM finding in `animation-plans/`, with exact values and a feel check -- [ ] Update S035's steps: one checkbox per plan, and sync its tracker doc; split to S035b if more than ten +- [ ] One list of faults across all screens, by leverage: motion, edges, grid, radii, sizes, states, copy, focus; drop what is by design +- [ ] Fix every high and medium motion fault +- [ ] Fix every high and medium look fault; no literal colours or radii outside tokens +- [ ] Hide every setting, menu entry and tab of a feature that is Later (PLAN.md), so nothing on screen does nothing +- [ ] Copy, empty states, AccessKit names, focus and 32 px hit targets +- [ ] Test file `docs/tests/S034-motion-audit.md`: each fixed motion with normal, reduced and off; keyboard only; sizes 480, 900, 1600, 3440; light, dark, AMOLED; long names and big numbers - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S034: …`, push ## End criteria -- `ls animation-plans` shows README and the plans -- every finding cites file:line that exists -- `git diff --stat -- crates` is empty +`nice cargo check -q -j 2 -p medlar` clean ## Pitfalls -Subagents only if the orchestrator allows; inline otherwise. "Already right" is a valid result. - -## Handoff (→ PROGRESS.md) -Order of fixes. +Polish within the look, no redesign. "Already right" is a valid result. diff --git a/Plans/08 Motion and polish/S035-motion-fixes.md b/Plans/08 Motion and polish/S035-motion-fixes.md deleted file mode 100644 index fb111c6..0000000 --- a/Plans/08 Motion and polish/S035-motion-fixes.md +++ /dev/null @@ -1,30 +0,0 @@ -# S035 — Animation fixes - -> Category 08 Motion and polish · Model: Opus · Effort: medium · Depends on: S034 · Size: L · Human: no -> Files touched: crates/app/**, crates/core/remote/**, animation-plans/README.md - -## Goal -Carry out the plans from S034. - -## Read -- animation-plans/README.md, then each plan as it is worked on -- animate skill - -## Steps -- [ ] Carry out each plan in the README order, with its own verification and feel check -- [ ] Shot sequences before and after for each changed motion -- [ ] Reduced and off levels checked for every change -- [ ] Idle and busy frame cost no worse than before -- [ ] README statuses set to DONE, or skipped with a reason -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S035: …`, push - -## End criteria -- `nice cargo test -j 2 -p medlar` green -- every plan DONE or explained -- idle CPU under 1 % - -## Pitfalls -Stay inside each plan's boundaries. - -## Handoff (→ PROGRESS.md) -What can only be judged on real hardware. diff --git a/Plans/08 Motion and polish/S036-taste-pass.md b/Plans/08 Motion and polish/S036-taste-pass.md deleted file mode 100644 index 93d3502..0000000 --- a/Plans/08 Motion and polish/S036-taste-pass.md +++ /dev/null @@ -1,32 +0,0 @@ -# S036 — app-taste pass over every screen - -> Category 08 Motion and polish · Model: Opus · Effort: medium · Depends on: S035 · Size: L · Human: no -> Files touched: crates/app/** - -## Goal -One look and feel everywhere. FEATURES 9.7. - -## Read -- app-taste skill -- crates/app/src/views list -- tests/shots.rs - -## Steps -- [ ] Shot set of every screen, state, size (480, 900, 1600, 3440), light, dark and AMOLED, with long names and big numbers -- [ ] Walk the app-taste rules screen by screen; list the faults, then fix: edges, grid, radii, sizes, states -- [ ] Copy pass: verbs, plain errors, sentence case, empty states -- [ ] Keyboard-only pass and AccessKit names; focus visible everywhere; hit targets 32 px -- [ ] Consistency of icons, tooltips and shortcuts -- [ ] Second shot set compared with the first -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S036: …`, push - -## End criteria -- `nice cargo test -j 2 -p medlar` green -- no literal colours or radii outside tokens (grep check added as a test) -- shots looked at - -## Pitfalls -Polish within the look, no redesign. - -## Handoff (→ PROGRESS.md) -— diff --git a/Plans/08 Motion and polish/S037-performance-security.md b/Plans/08 Motion and polish/S037-performance-security.md deleted file mode 100644 index bf4ea32..0000000 --- a/Plans/08 Motion and polish/S037-performance-security.md +++ /dev/null @@ -1,33 +0,0 @@ -# S037 — Speed, idle use, security and long runs - -> Category 08 Motion and polish · Model: Opus · Effort: high · Depends on: S036 · Size: L · Human: no -> Files touched: crates/** - -## Goal -Solid and light. CLAUDE.md §4. - -## Read -- CLAUDE.md §4 -- docs/RECOVERY.md -- docs/CONNECTOR.md -- docs/PROGRESS.md "Later" - -## Steps -- [ ] Profiles: start time, idle CPU and wake-ups, memory with 10,000 tasks, frame cost with 50 active, throughput on loopback against curl -- [ ] Fix what stands out; record before and after -- [ ] Security review of connector, REST, remote, names, archives, child processes, secrets on disk and in logs; regression test per fix -- [ ] Fuzz tests for parsers: headers, Content-Disposition, HLS, DASH, Metalink, ZIP, listing, patterns -- [ ] Two-hour soak with random faults, pauses, kills and limit changes; files checked -- [ ] Dependency check with `cargo tree -d` and licence list -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S037: …`, push - -## End criteria -- `nice cargo test -j 2` green -- soak log with zero corrupt files -- numbers in PROGRESS - -## Pitfalls -Don't run builds and soak at the same time. Attack tests stay on loopback. - -## Handoff (→ PROGRESS.md) -Known limits. diff --git a/Plans/09 Release/S038-feature-sweep.md b/Plans/09 Release/S038-feature-sweep.md deleted file mode 100644 index 7ee2536..0000000 --- a/Plans/09 Release/S038-feature-sweep.md +++ /dev/null @@ -1,29 +0,0 @@ -# S038 — Check every feature against the list - -> Category 09 Release · Model: Opus · Effort: medium · Depends on: S025, S037 · Size: L · Human: no -> Files touched: docs/FEATURES-CHECK.md, crates/** - -## Goal -Prove FEATURES §1–9, line by line. - -## Read -- docs/FEATURES.md -- docs/DECISIONS.md - -## Steps -- [ ] Table in docs/FEATURES-CHECK.md: id, proof (test, command or shot), result -- [ ] Run or watch each proof in a hidden run with a throwaway home -- [ ] Fix small gaps here; larger ones become new plans through the orchestrator -- [ ] First run to finished download, as a new user with no settings -- [ ] Upgrade test: old store and settings from an early commit still open -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S038: …`, push - -## End criteria -- no FEATURES id without a row (script check) -- every row passes or has a plan id - -## Pitfalls -Code existing is not proof. - -## Handoff (→ PROGRESS.md) -Open gaps. diff --git a/Plans/09 Release/S039-packaging.md b/Plans/09 Release/S039-packaging.md deleted file mode 100644 index f2b73b1..0000000 --- a/Plans/09 Release/S039-packaging.md +++ /dev/null @@ -1,31 +0,0 @@ -# S039 — AppImage and tar.gz - -> Category 09 Release · Model: Opus · Effort: medium · Depends on: S038 · Size: M · Human: no -> Files touched: tools/package*, packaging/** - -## Goal -Builds that run on older distros, without downloads (D-011). - -## Read -- CLAUDE.md §2 -- user's global build rules (AppImage, smoke test) -- ~/Projects/Mulberry/scripts or dist layout (read only) - -## Steps -- [ ] tar.gz with install and uninstall scripts for the user's home, desktop file, icons, completions, man page, unit file -- [ ] AppImage with the appimagetool in ~/Projects/Mulberry/dist (copied to a temp folder), same files, portable-mode support -- [ ] glibc and library needs listed with `objdump`/`ldd`; lowest supported glibc stated; system libraries not bundled -- [ ] Smoke test of both builds: launch hidden, download from the test server, write a status file and shots, look at them -- [ ] yt-dlp and ffmpeg missing on PATH: designed state checked; size of bundling them reported for the user's choice -- [ ] Checksums and `releases/` layout prepared, nothing placed there -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S039: …`, push - -## End criteria -- both artefacts pass the smoke test -- `dist/` listing with sizes - -## Pitfalls -appimagetool may try to fetch its runtime: use an existing runtime file, or stop and report through the orchestrator. Don't write into releases/. - -## Handoff (→ PROGRESS.md) -Version and contents for the user. diff --git a/Plans/09 Release/S040-docs-release.md b/Plans/09 Release/S040-docs-release.md deleted file mode 100644 index ec739f6..0000000 --- a/Plans/09 Release/S040-docs-release.md +++ /dev/null @@ -1,31 +0,0 @@ -# S040 — Docs and release - -> Category 09 Release · Model: Sonnet · Effort: high · Depends on: S039 · Size: M · Human: 🧑 approve version and contents before publishing -> Files touched: README.md, docs/releases/**, releases/** - -## Goal -A clear repo page and, after a yes, the first release. - -## Read -- docs/FEATURES-CHECK.md -- docs/CONNECTOR.md -- user's global release rules - -## Steps -- [ ] README: what it does, shots from real runs, install, connector steps, limits; no hype -- [ ] Screenshots and a short motion clip from the hidden session -- [ ] Release notes in docs/releases/0.1.0.md; version set everywhere -- [ ] 🧑 Tell the user the version and contents and wait for the yes; ask about bundling yt-dlp and ffmpeg -- [ ] After the yes: files to releases/v0.1.0/, notes with hub-release, page checked -- [ ] docs/STATUS.md final state -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S040: …`, push - -## End criteria -- `grep -c` finds no placeholder in README -- after approval the release page lists every file with matching checksums - -## Pitfalls -Nothing goes into releases/ before the yes: the sync service publishes it at once. - -## Handoff (→ PROGRESS.md) -— diff --git a/Plans/09 Test and release/S037-whole-app.md b/Plans/09 Test and release/S037-whole-app.md new file mode 100644 index 0000000..850aa63 --- /dev/null +++ b/Plans/09 Test and release/S037-whole-app.md @@ -0,0 +1,29 @@ +# S037 — Whole app: use, security, speed, every feature + +> Category 09 Test and release · Model: Opus (security review) · Effort: medium · Depends on: S043 · Phase: test · Human: no +> Files touched: crates/**, docs/FEATURES-CHECK.md, docs/tests/S037-whole-app.md, docs/TEST-REPORT.md + +## Goal +Version 1 is solid, light and complete. Was S037 and S038. + +## Read +- docs/FEATURES.md without the Later ids (PLAN.md) +- CLAUDE.md §4, docs/CONNECTOR.md, docs/TEST-REPORT.md + +## Steps +- [ ] Security review of connector, names, child processes, Metalink and stream parsers, secrets on disk and in logs; fix with one regression test each +- [ ] Short fuzz tests of the parsers: headers, Content-Disposition, HLS, DASH, Metalink, listing, patterns +- [ ] Start time, idle CPU, memory with 10,000 tasks, frame cost with 50 active, loopback speed against curl; fix what stands out, record before and after +- [ ] Soak script with random faults, pauses, kills and limit changes: 20 minutes, once; every file checked +- [ ] Journeys in one hidden run: first start to finished download; pause, restart, continue; expired link continued; queue with schedule; store of an early commit still opens +- [ ] docs/FEATURES-CHECK.md: one row per version 1 id with proof and result; Results in `docs/tests` count as proof; small gaps fixed here +- [ ] `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S037: …`, push + +## End criteria +- `nice cargo test -j 2` green, except listed known bugs +- soak with zero corrupt files +- gate: no open HIGH check or HIGH `KNOWN BUG` (`rg -n "\| — \||KNOWN BUG|not run" docs/tests`) +- every version 1 id has a row that passes or names its bug + +## Pitfalls +Code existing is not proof. No build while the soak runs. Attack tests stay on loopback. Cut off: go on from the first unchecked box; the results so far are in the files. diff --git a/Plans/09 Test and release/S039-package-release.md b/Plans/09 Test and release/S039-package-release.md new file mode 100644 index 0000000..a0236ac --- /dev/null +++ b/Plans/09 Test and release/S039-package-release.md @@ -0,0 +1,30 @@ +# S039 — Package, docs and release + +> Category 09 Test and release · Model: Sonnet · Effort: medium · Depends on: S037 · Phase: test · Human: 🧑 approve version and contents before publishing +> Files touched: tools/package*, packaging/**, README.md, docs/releases/**, releases/** + +## Goal +Builds that run on older distros without downloads (D-011), a clear repo page and, after a yes, the first release. Was S039 and S040. + +## Read +- CLAUDE.md §2, the user's global build and release rules +- ~/Projects/Mulberry/scripts or dist layout (read only) +- docs/FEATURES-CHECK.md, docs/CONNECTOR.md + +## Steps +- [ ] tar.gz with install and uninstall scripts for the user's home, desktop file, icons; AppImage with the appimagetool in ~/Projects/Mulberry/dist (copied to a temp folder), portable-mode support +- [ ] glibc and library needs listed, lowest supported glibc stated; system libraries not bundled +- [ ] Smoke test of both builds: launch hidden, download from the test server, status file and shots, looked at; yt-dlp and ffmpeg missing on PATH +- [ ] README with shots from real runs, install, connector steps, limits and known bugs; no hype +- [ ] Release notes in docs/releases/0.1.0.md; version set everywhere; checksums made, nothing in releases/ yet +- [ ] 🧑 Version, contents, known bugs and the size of bundling yt-dlp and ffmpeg told to the user; wait for the yes +- [ ] After the yes: files to releases/v0.1.0/, notes with hub-release, page checked +- [ ] docs/STATUS.md, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S039: …`, push + +## End criteria +- both builds pass the smoke test +- no placeholder in README +- after approval the release page lists every file with matching checksums + +## Pitfalls +appimagetool may try to fetch its runtime: use an existing runtime file, or stop and report. Nothing goes into releases/ before the yes: the sync service publishes it at once. diff --git a/Plans/09 Test and release/S041-test-control-connector.md b/Plans/09 Test and release/S041-test-control-connector.md new file mode 100644 index 0000000..1c13676 --- /dev/null +++ b/Plans/09 Test and release/S041-test-control-connector.md @@ -0,0 +1,27 @@ +# S041 — It runs; tests of details, control and connector + +> Category 09 Test and release · Model: Sonnet · Effort: medium · Depends on: S034 · Phase: test · Human: no +> Files touched: crates/core/**, crates/app/src/views/{details,modes,queues,schedule,incoming,connector}*, docs/tests/**, docs/TEST-REPORT.md + +## Goal +Run the checks of the test files of S017, S021, S022, S023, S024, fix what fails, fill in every Result. + +## Read +- those test files, all in one command; code only where a check needs it +- CLAUDE.md §4 and §5 + +## Steps +- [ ] Build everything, run the existing suite once with a log file, start the app hidden; fix what is broken before anything else +- [ ] Doubts first: read the code behind each, add a check or write why it is fine +- [ ] Write the tests for all HIGH and MED checks in one go, sharing fixtures and the testserver +- [ ] Run them once, all together, log to a file; read only the failures +- [ ] Fix all causes in one go; rerun only what failed; three rounds at most, then `KNOWN BUG` with the cause +- [ ] Screen checks: one contact sheet, faults fixed in one go, one more sheet +- [ ] Results filled in, `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S041: …`, push + +## End criteria +- the tests written here pass, except listed known bugs +- no `—` left in a Result column of these files + +## Pitfalls +Never weaken a test to pass. Fake D-Bus and logind only, testserver on loopback only, throwaway homes only. `TMPDIR=target/tmp`. diff --git a/Plans/09 Test and release/S043-test-video-screens.md b/Plans/09 Test and release/S043-test-video-screens.md new file mode 100644 index 0000000..d5bdb43 --- /dev/null +++ b/Plans/09 Test and release/S043-test-video-screens.md @@ -0,0 +1,26 @@ +# S043 — Tests of video, rules, tray and every screen + +> Category 09 Test and release · Model: Sonnet · Effort: medium · Depends on: S041 · Phase: test · Human: no +> Files touched: crates/**, docs/tests/**, docs/TEST-REPORT.md + +## Goal +Run the checks of the test files of S025, S027, S033, S034, fix what fails, fill in every Result. + +## Read +- those test files, all in one command; code only where a check needs it +- CLAUDE.md §4 and §5 + +## Steps +- [ ] Doubts first: read the code behind each, add a check or write why it is fine +- [ ] Write the tests for all HIGH and MED checks in one go, sharing fixtures and the testserver +- [ ] Run them once, all together, log to a file; read only the failures +- [ ] Fix all causes in one go; rerun only what failed; three rounds at most, then `KNOWN BUG` with the cause +- [ ] Screen checks: one contact sheet, faults fixed in one go, one more sheet +- [ ] Results filled in, `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S043: …`, push + +## End criteria +- the tests written here pass, except listed known bugs +- no `—` left in a Result column of these files + +## Pitfalls +Never weaken a test to pass. Fake D-Bus and logind only, testserver on loopback only, throwaway homes only. `TMPDIR=target/tmp`. diff --git a/Plans/INDEX.md b/Plans/INDEX.md index 79a4082..9570c04 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -1,6 +1,6 @@ # 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. +One plan = one worker. 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). Workers tick their line here, without commentary. 🧑 = needs the user. Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H @@ -34,7 +34,6 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H ## 04 Control - [x] [S019](04%20Control/S019-limiter-priority.md) Limiter, modes and priority shares -- [ ] [S020](04%20Control/S020-auto-limit-quota.md) Automatic limiter, quota and metered lines - [ ] [S021](04%20Control/S021-queues-schedule-power.md) Queues, scheduler and power actions - [ ] [S022](04%20Control/S022-control-screens.md) Control screens @@ -46,27 +45,23 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H ## 06 Media - [ ] [S025](06%20Media/S025-video-sites.md) Video sites through yt-dlp -- [ ] [S026](06%20Media/S026-preview-convert.md) Preview and conversion ## 07 Library and tools - [ ] [S027](07%20Library%20and%20tools/S027-rules-clipboard-drop.md) Rules, clipboard, drag and drop, drop target -- [ ] [S028](07%20Library%20and%20tools/S028-archives.md) Archive peek, unpack, join and scan -- [ ] [S029](07%20Library%20and%20tools/S029-grabber-explorer.md) Site grabber and explorer -- [ ] [S030](07%20Library%20and%20tools/S030-stats-import.md) Statistics, import and export -- [ ] [S031](07%20Library%20and%20tools/S031-cli-rest.md) Command line, headless and REST -- [ ] [S032](07%20Library%20and%20tools/S032-web-remote.md) Web remote - [ ] [S033](07%20Library%20and%20tools/S033-tray-notify.md) Tray, notifications and autostart ## 08 Motion and polish -- [ ] [S034](08%20Motion%20and%20polish/S034-motion-audit.md) Animation audit -- [ ] [S035](08%20Motion%20and%20polish/S035-motion-fixes.md) Animation fixes -- [ ] [S036](08%20Motion%20and%20polish/S036-taste-pass.md) app-taste pass over every screen -- [ ] [S037](08%20Motion%20and%20polish/S037-performance-security.md) Speed, idle use, security and long runs +- [ ] [S034](08%20Motion%20and%20polish/S034-motion-audit.md) Motion and look pass -## 09 Release +## 09 Test and release -- [ ] [S038](09%20Release/S038-feature-sweep.md) Check every feature against the list -- [ ] [S039](09%20Release/S039-packaging.md) AppImage and tar.gz -- [ ] [S040](09%20Release/S040-docs-release.md) Docs and release 🧑 +- [ ] [S041](09%20Test%20and%20release/S041-test-control-connector.md) It runs; tests of details, control and connector +- [ ] [S043](09%20Test%20and%20release/S043-test-video-screens.md) Tests of video, rules, tray and every screen +- [ ] [S037](09%20Test%20and%20release/S037-whole-app.md) Whole app: use, security, speed, every feature +- [ ] [S039](09%20Test%20and%20release/S039-package-release.md) Package, docs and release 🧑 + +## Later (after version 1; not run by /orchestrate) + +Plans kept in `Plans/Later/`: S020 automatic limiter and quota, S026 preview and conversion, S028 archives, S029 site grabber, S030 statistics and import, S031 command line and REST, S032 web remote. `/plan-generate later` updates them first. Merged: S035, S036 into S034; S038 into S037; S040 into S039; S042 into S041 and S043. diff --git a/Plans/04 Control/S020-auto-limit-quota.md b/Plans/Later/S020-auto-limit-quota.md similarity index 69% rename from Plans/04 Control/S020-auto-limit-quota.md rename to Plans/Later/S020-auto-limit-quota.md index bd16174..7003ac6 100644 --- a/Plans/04 Control/S020-auto-limit-quota.md +++ b/Plans/Later/S020-auto-limit-quota.md @@ -1,6 +1,6 @@ # S020 — Automatic limiter, quota and metered lines -> Category 04 Control · Model: Opus · Effort: medium · Depends on: S007, S019 · Size: M · Human: no +> Category 04 Control · Model: Opus (control loop) · Effort: medium · Depends on: S007, S019 · Phase: build · Human: no > Files touched: crates/core/src/{autolimit,quota,metered}*, crates/core/tests/autolimit* ## Goal @@ -12,15 +12,20 @@ FEATURES 2.4, 2.5. ## Steps - [ ] Latency probe without extra traffic (TCP connect or RTT to current hosts, optional gateway ping), baseline and queueing delay estimate -- [ ] Controller that backs off when delay rises and recovers gently; simulated line tests (bottleneck, buffer bloat, competing flow) +- [ ] Controller that backs off when delay rises and recovers gently - [ ] Quota per day, week or month with reset day, warning and stop, override for one download - [ ] Metered connection through NetworkManager: pause, limit or ignore; big-file threshold - [ ] Snapshot says why a limit is in force +- [ ] Test file `docs/tests/S020-auto-limit-quota.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S020: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test autolimit` green with a virtual clock +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (autolimit) green with a virtual clock - no oscillation over 20 % in the simulator +- simulated line: bottleneck, buffer bloat, competing flow ## Pitfalls The user's line is about 425 KB/s: constants must work there and on gigabit. Fake D-Bus only. diff --git a/Plans/06 Media/S026-preview-convert.md b/Plans/Later/S026-preview-convert.md similarity index 75% rename from Plans/06 Media/S026-preview-convert.md rename to Plans/Later/S026-preview-convert.md index 214d29c..b028dad 100644 --- a/Plans/06 Media/S026-preview-convert.md +++ b/Plans/Later/S026-preview-convert.md @@ -1,6 +1,6 @@ # S026 — Preview and conversion -> Category 06 Media · Model: Sonnet · Effort: high · Depends on: S017, S025 · Size: M · Human: no +> Category 06 Media · Model: Sonnet · Effort: medium · Depends on: S017, S025 · Phase: build · Human: no > Files touched: crates/core/src/{preview,convert}*, crates/app/src/views/{preview,convert}* ## Goal @@ -17,10 +17,14 @@ FEATURES 6.2, 6.3. - [ ] Text and archive head preview; hex for the rest; size caps - [ ] Convert: presets (MP4, MKV, WebM, MP3, Opus, FLAC, remux), own presets, queue with progress and cancel, keep or replace the source - [ ] Auto-convert as a rule action +- [ ] Test file `docs/tests/S026-preview-convert.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S026: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test convert` green with ffmpeg-made samples +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (convert) green with ffmpeg-made samples - ffprobe confirms results - shots looked at diff --git a/Plans/07 Library and tools/S028-archives.md b/Plans/Later/S028-archives.md similarity index 71% rename from Plans/07 Library and tools/S028-archives.md rename to Plans/Later/S028-archives.md index a74fa8f..dc4b5a4 100644 --- a/Plans/07 Library and tools/S028-archives.md +++ b/Plans/Later/S028-archives.md @@ -1,6 +1,6 @@ # S028 — Archive peek, unpack, join and scan -> Category 07 Library and tools · Model: Opus · Effort: medium · Depends on: S017, S018 · Size: M · Human: no +> Category 07 Library and tools · Model: Opus (hostile archives) · Effort: medium · Depends on: S017, S018 · Phase: build · Human: no > Files touched: crates/core/src/archive/**, crates/app/src/views/archive*, crates/core/tests/archive* ## Goal @@ -17,10 +17,14 @@ FEATURES 3.7, 7.5. - [ ] Join split files (.001, .part, multi-volume) after all parts are done - [ ] Scan hook: any command with a placeholder, clamscan preset when found; quarantine state - [ ] Archive tab and post-action settings +- [ ] Test file `docs/tests/S028-archives.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S028: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test archive` green: traversal, symlink, bomb and huge-count archives refused +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (archive) green: traversal, symlink, bomb and huge-count archives refused ## Pitfalls Zip slip and bombs. Check paths after normalising, cap ratio and count, extract to a temp folder, then move. diff --git a/Plans/07 Library and tools/S029-grabber-explorer.md b/Plans/Later/S029-grabber-explorer.md similarity index 74% rename from Plans/07 Library and tools/S029-grabber-explorer.md rename to Plans/Later/S029-grabber-explorer.md index 511d37a..b2425a9 100644 --- a/Plans/07 Library and tools/S029-grabber-explorer.md +++ b/Plans/Later/S029-grabber-explorer.md @@ -1,6 +1,6 @@ # S029 — Site grabber and explorer -> Category 07 Library and tools · Model: Opus · Effort: medium · Depends on: S011, S016, S027 · Size: M · Human: no +> Category 07 Library and tools · Model: Sonnet · Effort: medium · Depends on: S011, S016, S027 · Phase: build · Human: no > Files touched: crates/core/src/{grab,explore}*, crates/app/src/views/{grab,explore}*, crates/core/tests/grab* ## Goal @@ -17,10 +17,14 @@ FEATURES 3.5, 3.6: collect links from a web page or folder listing. - [ ] Optional save of pages with links rewritten for offline reading - [ ] Explorer for FTP, SFTP and open directory listings (Apache, nginx, h5ai): tree, multi-select, whole-folder download keeping the structure - [ ] Results view with tree, filters, select by pattern, send to Add or a queue +- [ ] Test file `docs/tests/S029-grabber-explorer.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S029: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test grab` green on the test site tree: loops, traps, off-host links and huge pages handled +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (grab) green on the test site tree: loops, traps, off-host links and huge pages handled - shots looked at ## Pitfalls diff --git a/Plans/07 Library and tools/S030-stats-import.md b/Plans/Later/S030-stats-import.md similarity index 75% rename from Plans/07 Library and tools/S030-stats-import.md rename to Plans/Later/S030-stats-import.md index dc453cf..46ed864 100644 --- a/Plans/07 Library and tools/S030-stats-import.md +++ b/Plans/Later/S030-stats-import.md @@ -1,6 +1,6 @@ # S030 — Statistics, import and export -> Category 07 Library and tools · Model: Sonnet · Effort: high · Depends on: S015, S021 · Size: M · Human: no +> Category 07 Library and tools · Model: Sonnet · Effort: medium · Depends on: S015, S021 · Phase: build · Human: no > Files touched: crates/core/src/{stats,port}*, crates/app/src/views/stats*, crates/core/tests/port* ## Goal @@ -17,10 +17,14 @@ FEATURES 7.6, 7.7. - [ ] Export and import of lists (JSON, text, CSV, Metalink) and full backup without secrets - [ ] Import from aria2 session files; AB Download Manager and FDM only from exports with a documented or sample format, otherwise say not supported - [ ] Merge rules for duplicates, preview before import +- [ ] Test file `docs/tests/S030-stats-import.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S030: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test port` green with round trips +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (port) green with round trips - shots in light and dark looked at ## Pitfalls diff --git a/Plans/07 Library and tools/S031-cli-rest.md b/Plans/Later/S031-cli-rest.md similarity index 77% rename from Plans/07 Library and tools/S031-cli-rest.md rename to Plans/Later/S031-cli-rest.md index 05da6c9..fbd5d7d 100644 --- a/Plans/07 Library and tools/S031-cli-rest.md +++ b/Plans/Later/S031-cli-rest.md @@ -1,6 +1,6 @@ # S031 — Command line, headless and REST -> Category 07 Library and tools · Model: Opus · Effort: medium · Depends on: S021, S024 · Size: M · Human: no +> Category 07 Library and tools · Model: Sonnet · Effort: medium · Depends on: S021, S024 · Phase: build · Human: no > Files touched: crates/cli/**, crates/core/src/rest*, crates/app/src/main* ## Goal @@ -18,10 +18,14 @@ FEATURES 8.2 (API), 8.3. - [ ] REST plus event stream with the same commands, token per client, scopes (read, control), off by default, loopback unless remote control is on - [ ] Shell completions (bash, zsh, fish) and man page generated - [ ] Terminal progress with parts, plain when not a terminal +- [ ] Test file `docs/tests/S031-cli-rest.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S031: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-cli` green +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-cli green - scripted end-to-end run against the test server without a display ## Pitfalls diff --git a/Plans/07 Library and tools/S032-web-remote.md b/Plans/Later/S032-web-remote.md similarity index 73% rename from Plans/07 Library and tools/S032-web-remote.md rename to Plans/Later/S032-web-remote.md index af25c35..86e1015 100644 --- a/Plans/07 Library and tools/S032-web-remote.md +++ b/Plans/Later/S032-web-remote.md @@ -1,6 +1,6 @@ # S032 — Web remote -> Category 07 Library and tools · Model: Opus · Effort: medium · Depends on: S031 · Size: M · Human: no +> Category 07 Library and tools · Model: Opus (login and web security) · Effort: medium · Depends on: S031 · Phase: build · Human: no > Files touched: crates/core/src/remote*, crates/core/remote/**, crates/core/tests/remote* ## Goal @@ -17,10 +17,14 @@ FEATURES 8.2: control Medlar from a phone on the LAN. - [ ] Look from the same roles: wavy SVG bars, light and dark, reduced motion, phone first - [ ] Security: rate-limited login, hashed password, HttpOnly SameSite cookie, CSRF token, CSP, `Host` check, sessions list and revoke; optional own TLS certificate - [ ] Settings page for it +- [ ] Test file `docs/tests/S032-web-remote.md`, with the checks below - [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S032: …`, push ## End criteria -- `nice cargo test -j 2 -p medlar-core --test remote` green, with auth, CSRF and rebinding tests +`nice cargo check -q -j 2 -p medlar` clean + +## Checks for the test file (do not run now) +- automatic tests in medlar-core (remote) green, with auth, CSRF and rebinding tests - page checked in the built-in browser at phone and desktop width ## Pitfalls diff --git a/Plans/_TEMPLATE.md b/Plans/_TEMPLATE.md index d27f400..bdb3bf5 100644 --- a/Plans/_TEMPLATE.md +++ b/Plans/_TEMPLATE.md @@ -1,24 +1,21 @@ -# 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.}} +# SNNN — {{TITLE}} + +> Category {{NN Category}} · Model: {{Sonnet | Opus (reason)}} · Effort: medium · Depends on: {{SNNN|—}} · Phase: {{build|test}} · Human: {{no|🧑 what}} +> Files touched: {{paths/globs}} + +## Goal +{{What the user can do afterwards, and the PLAN references it handles.}} + +## Read +{{Exact files or sections — 8 at most.}} + +## Steps +- [ ] {{step, 4–8 in all; no tests unless Phase: test}} +- [ ] Test file `docs/tests/SNNN-slug.md` +- [ ] PROGRESS entry, INDEX line, commit `SNNN: …` + +## End criteria +{{One compile check. Phase: test plans: the test commands.}} + +## Pitfalls +{{Known traps.}} diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 8a6f89e..626814c 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -1,31 +1,25 @@ -# Handoff (orchestrator, 2026-11-25 08:00) +# Handoff (2026-11-25, after the switch to the light rules) -**Goal**: run the 40 plans of `Plans/INDEX.md` with `/orchestrate`; end with a tested AppImage and tar.gz, published only after the user's yes (S040). +**Goal**: version 1 of Medlar in 13 plans after S009, S012 and S016, then a tested AppImage and tar.gz, published only after the user's yes (S039). -**Phase**: 01 Foundation done. 02 Engine: S009, S012 left. 03 Interface: S016, S017 left. 04 Control: S019 done, S020–S022 left. Then 05–09. +**Phase**: 15 plans done (S001–S008, S010, S011, S013–S015, S018, S019). Building goes on in INDEX order; testing is category 09. -**Done and validated (15 of 40)**: S001–S008, S010, S011, S013–S015, S018, S019. Code in `crates/`, one entry per plan in `docs/PROGRESS.md`. All tests green on 83ef4be, run by the orchestrator. +**In progress**: S009, S012, S016 run the old way in the worktree `orchestrate-0ad55c` (branch `claude/orchestrate-0ad55c`). Its orchestrator was told to start nothing else, merge `main` into its branch when they end, and fast-forward `main`. Check with `git log main` before starting; S009, S012 and S016 have no test file and need none (they have tests). -**In progress**: nothing; every session is idle, the tree is clean. - -**Next three**: start and GO S009 (core), S012 (core), S016 (app); all their dependencies are done. S020 and S021 (core) are ready too. - -**How the sessions are run**: one shared worktree and branch, three at once (D-016), small GO message naming the other running plans, own decision numbers for each (next free: D-052), own hunks only, questions to the orchestrator. Sessions can only be started on a turn the user began, so start enough waiting ones then. Sessions tick boxes in one batch whatever they are told; the tracker then gets one sync. +**Next three**: S017, S021, S022, by `/orchestrate` in a new session (one `plan-worker` at a time; rules in the `orchestrate` skill). Do not GO the old waiting sessions s017, s020, s021. **Known bugs and gaps** (details in PROGRESS) - The debug build opens no window in `tools/hidden.sh`; the release build does. Cause unknown (S013). - Nothing deletes a task's keyring item yet; S024 (or whoever saves task secrets first) must, and keep items shared by KeepBoth (S010). - The app does not set `ClientOptions::known_hosts`; no prompt for SFTP host keys, no field for `Site::key` (S011, S018). -- Queue fields `paused`, `max_active`, `schedule`, `after`, `start_at` are not read by the manager: check that S021 covers them (S006's notes say S009). +- Queue fields `paused`, `max_active`, `schedule`, `after`, `start_at` are not read by the manager: S021 must cover them. - `recover.rs` test bus still has the system's service files (S010 fixed its own). `/tmp` quota: use `TMPDIR=target/tmp` for tests; timing tests suffer under load. - The real NetworkManager, logind, keyring, FTP servers, GPU and the slow line were never tried. -**Commands**: `nice cargo test -j 2`, `nice cargo build --release -j 2` (never both), `cargo test -p medlar --test shots`, `tools/hidden.sh`. +**Commands**: build plans `nice cargo check -q -j 2 -p medlar`; test phase `nice cargo test -j 2`, `nice cargo build --release -j 2` (never both), `tools/hidden.sh`. -**Decisions**: D-014 (main is fast-forwarded after each validated category; on 2026-11-25 the user also had it merged at 15 plans), D-016 (three at once), D-017 to D-051 in `docs/DECISIONS.md`. The user wants caveman replies and low credit use; overnight: decide alone, publish nothing, no extra credits. +**Decisions**: D-060 in `ORCHESTRATOR.md` (one worker, no tests while building, test files in `docs/tests/`); version 1 cut to 13 plans, the rest in `Plans/Later/` (PLAN.md “Later”); D-014 (main fast-forwarded after each category). Next free: D-061, or what `docs/DECISIONS.md` says. Short caveman replies; publish nothing; no extra credits. -**Budget**: about 2.3 % of the weekly limit per plan, 12 to 15 % of a 5-hour window; weekly was at 35 % with 15 plans done. +**Budget**: the old way cost about 2.3 % of the week per plan. The new way is not measured yet: write the percent per plan here after the first run. Weekly was at 44 % on 2026-11-25. -**Open questions** -- The user's power-off request was for the night of 2026-11-25 only; it did not trigger. -- Rules that cost more than they give: 3 waiting sessions (1 is enough), a tracker sync per box (start and end are enough). +**Open questions**: none. The tracker counts five merged plans (S035, S036, S038, S040, S042, in “Later”) as done. diff --git a/docs/STATUS.md b/docs/STATUS.md index 1ef730e..5f7047f 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -1,4 +1,3 @@ # Status -15 of 40 plans done and validated on 2026-11-25 (S001–S008, S010, S011, S013–S015, S018, S019). Next: S009, S012, S016. -The current plan is the first unchecked line in `Plans/INDEX.md`. How things stand: [HANDOFF.md](HANDOFF.md). +15 plans done; S009, S012 and S016 running the old way; 13 plans left for version 1 (2026-11-25). The current plan is the first unchecked line in `Plans/INDEX.md`. How things stand: [HANDOFF.md](HANDOFF.md). diff --git a/docs/tests/_TEMPLATE.md b/docs/tests/_TEMPLATE.md new file mode 100644 index 0000000..1d4ae10 --- /dev/null +++ b/docs/tests/_TEMPLATE.md @@ -0,0 +1,22 @@ +# SNNN — {{TITLE}}: test file + +Written by the worker that built it, run by the test phase. Nothing here has been tested until its Result says so. + +## Built +{{Files and main functions, one line each: `path` · what it does. How to reach it: screen, command or call.}} + +## Checks +Risk: HIGH = data loss, security, crash, wrong result · MED = feature broken · LOW = looks or comfort. +How: unit · integration · screen · by hand. + +| # | Risk | Do this | Expect | How | Result | +|---|---|---|---|---|---| +| 1 | HIGH | {{exact input or steps}} | {{exact outcome}} | {{unit}} | — | + +Cover: the normal path, empty and huge input, bad input, the dependency failing or missing, stop and restart in the middle, two at once, old data still opening. Leave out what cannot happen here. + +## Needs +{{Fixtures, stubs, servers, ports, a throwaway home; what must never be touched (real accounts, real devices, public servers).}} + +## Doubts +{{What the author is least sure of, shortcuts taken, existing tests this change may break. Most valuable section: never leave it out.}}