plans: Medlar, 40 session plans
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
ca70d8d70d
commit
c4d0887317
55 changed files with 1329 additions and 37 deletions
16
CLAUDE.md
16
CLAUDE.md
|
|
@ -1,6 +1,6 @@
|
|||
# Medlar
|
||||
|
||||
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, torrents, 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 plus the browser extension, for the user and for release on Astar Hub. Vision: [PLAN.md](PLAN.md).
|
||||
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
|
||||
|
||||
|
|
@ -25,9 +25,8 @@ Root: the folder holding this file
|
|||
Planned (the Foundation plans create it; keep this list true):
|
||||
crates/core/ engine, limits, queues, store, connector server; no UI code
|
||||
crates/app/ egui app: theme, motion, widgets, views, dialogs, tray
|
||||
crates/cli/ medlar command line and headless mode
|
||||
crates/cli/ command line and headless mode, a library used by the `medlar` binary
|
||||
crates/testserver/ local server with faults for tests (ranges, throttle, cuts, expiry, logins)
|
||||
extension/ browser extension, one source for Firefox and Chromium
|
||||
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
|
||||
|
|
@ -38,9 +37,10 @@ Never modify: everything outside this folder. `~/Projects/*` is read-only refere
|
|||
## 2. Facts
|
||||
|
||||
- Reuse (the user's own code, read-only): Damson `src/motion.rs` (spring presets), `src/theme.rs` (OKLCH roles from a seed); Mulberry `src/ui/shape.rs` (morphing shapes), `src/ui/widgets.rs` (`wavy_slider`, buttons, menus), `src/tray.rs`; Nacre `tools/nested-session.sh`, `tools/hidden.sh` (hidden nested niri runs) and `src/net/dlm.rs` (`custom_body`: the JSON Nacre posts).
|
||||
- Seen on crates.io 2026-11-24: eframe/egui_kittest 0.37.0, tokio 1.54.1, hyper 1.13.0, reqwest 0.13.5, axum 0.8.9, librqbit 9.1.0, suppaftp 13.0.0, russh 0.65.4, rusqlite 0.43.0, ksni 0.3.7. Check the docs of the pinned version before using an API.
|
||||
- This PC: Arch Linux, niri (Wayland), 4 cores, 16 GB, Rust 1.99.1. No node or npm: the extension is plain JavaScript with no build step.
|
||||
- No Firefox or Chromium was found in /usr/bin. Browser tests need a portable browser (ask through the orchestrator before downloading one) or a script that speaks the protocol.
|
||||
- Seen on crates.io 2026-11-24: eframe/egui_kittest 0.37.0, tokio 1.54.1, hyper 1.13.0, reqwest 0.13.5, axum 0.8.9, suppaftp 13.0.0, russh 0.65.4, rusqlite 0.43.0, ksni 0.3.7. Check the docs of the pinned version before using an API.
|
||||
- This PC: Arch Linux, niri (Wayland), 4 cores, 16 GB, Rust 1.99.1.
|
||||
- Download nothing but Rust crates (D-011). Here already: /usr/bin/yt-dlp, /usr/bin/ffmpeg, 7z, bsdtar, unzip, `~/Projects/Mulberry/dist/appimagetool`. Not here: clamscan, node, docker.
|
||||
- The browser side is Nacre's `POST /` JSON (D-003, D-010). A built Nacre is at `~/Projects/Nacre/target/release/nacre`; run it only hidden with a throwaway home.
|
||||
- The line is slow: never download large files for tests. All engine tests use `crates/testserver` on 127.0.0.1.
|
||||
- Ports: Medlar 17616 (D-006). 15151 and 38151 belong to the user's AB Download Manager.
|
||||
|
||||
|
|
@ -56,8 +56,8 @@ Never modify: everything outside this folder. `~/Projects/*` is read-only refere
|
|||
|
||||
## 4. Domain pitfalls (all agents)
|
||||
|
||||
- Never connect to Tor or public proxies, and never join public torrent swarms, trackers or DHT in tests. Torrents are tested in a loopback swarm, proxies against a local stub.
|
||||
- Any web page can reach 127.0.0.1: check `Host` and `Origin`, require the pairing token, no CORS wildcard, and an unpaired add (no `Origin`, for example Nacre) always shows the Add dialog.
|
||||
- Never connect to Tor or public proxies in tests. Proxies are tested against a local stub.
|
||||
- Any web page can reach 127.0.0.1: refuse any request with a web `Origin` or a foreign `Host`, send no CORS headers, and show the Add dialog unless the user turned that off. Remote control and REST need a token.
|
||||
- File names come from servers and pages: strip path parts, control characters and leading dots, cap the length, never overwrite silently.
|
||||
- Child processes (yt-dlp, ffmpeg) get user links: use `--`, never a shell. Cookies and logins never appear in logs or process arguments.
|
||||
- HTTP/2 puts all parts on one connection: force HTTP/1.1 for segments. A 200 answer to a range request means no resume; never write it at an offset.
|
||||
|
|
|
|||
8
PLAN.md
8
PLAN.md
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Goal
|
||||
A download manager for Linux that does everything Free Download Manager does and more: dynamic parts, limits, priorities,
|
||||
queues, scheduling, torrents, video sites, and a local port that takes downloads from browsers. Its Material You interface
|
||||
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.
|
||||
|
|
@ -13,11 +13,11 @@ slider, widgets, tray), Nacre (hidden nested session, hand-off format).
|
|||
|
||||
## Phases
|
||||
1. **Foundation** — workspace, store, settings, the local test server with faults, the screenshot and hidden-run tools.
|
||||
2. **Engine** — HTTP with dynamic parts, resume, retries, mirrors, checksums; FTP, FTPS, SFTP; HLS and DASH. CLI-testable without UI.
|
||||
2. **Engine** — HTTP with dynamic parts, resume, error recovery, continuing from new links, mirrors, checksums; FTP, FTPS, SFTP; HLS and DASH.
|
||||
3. **Interface** — tokens, motion, wavy bars, parts map, main window, add dialog, details, settings.
|
||||
4. **Control** — limits, modes, priorities, queues, scheduler, power actions, quota, automatic limiter.
|
||||
5. **Connector** — port, pairing, Firefox and Chromium extension, media detection, Nacre, native messaging.
|
||||
6. **Torrents and media** — torrent engine and views, yt-dlp, preview, conversion.
|
||||
5. **Connector** — the port a browser sends links to, its protection, and continuing downloads from sent links.
|
||||
6. **Media** — yt-dlp, preview, conversion.
|
||||
7. **Library and tools** — rules, batch, grabber, site explorer, archive peek, unpack, statistics, import, CLI, web remote, tray.
|
||||
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.
|
||||
|
|
|
|||
33
Plans/01 Foundation/S001-workspace-store-settings.md
Normal file
33
Plans/01 Foundation/S001-workspace-store-settings.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# S001 — Workspace, store, settings and strings
|
||||
|
||||
> Category 01 Foundation · Model: Opus · Effort: medium · Depends on: — · Size: M · Human: no
|
||||
> Files touched: Cargo.toml, crates/core/**, crates/*/Cargo.toml, crates/*/src/{lib,main}.rs
|
||||
|
||||
## Goal
|
||||
The Cargo workspace with four crates, and in `core`: task model, SQLite store, settings, paths, string catalogue and logging. FEATURES 8.4 (portable), 8.5, the model behind 2 and 7.
|
||||
|
||||
## Read
|
||||
- docs/FEATURES.md (all)
|
||||
- ~/Projects/Damson/Cargo.toml
|
||||
- ~/Projects/Damson/src/config.rs
|
||||
|
||||
## Steps
|
||||
- [ ] Workspace: `medlar-core`, `medlar` (app), `medlar-cli` (library), `medlar-testserver`; release profile like Damson's; version 0.1.0, MIT
|
||||
- [ ] Paths: XDG dirs, plus portable mode when a `portable` file sits beside the binary; a `MEDLAR_HOME` override for tests
|
||||
- [ ] Task model: task, part, queue, tag, host profile, error kind (empty enum list to fill in S007), states and the legal moves between them, with a test that refuses illegal moves
|
||||
- [ ] Store: rusqlite (bundled), numbered migrations, WAL, one writer thread; survives a kill mid-write (test)
|
||||
- [ ] Settings: serde with defaults, unknown keys kept, a damaged file is moved aside and reported, never fatal
|
||||
- [ ] String catalogue: key to text with plurals and arguments, English built in, user files dropped in a folder; a test fails on a missing key
|
||||
- [ ] Logging to a rotating file; a redaction helper for cookies, tokens, passwords and URL query strings, with tests
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S001: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2` green
|
||||
- `nice cargo build -j 2` without warnings
|
||||
- `MEDLAR_HOME=$(mktemp -d) target/debug/medlar --version` prints 0.1.0
|
||||
|
||||
## Pitfalls
|
||||
Keep `core` free of egui. Secrets never go in SQLite or settings: keep a keyring reference only.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Public API of store and settings, migration number, how to add a string.
|
||||
29
Plans/01 Foundation/S002-test-server.md
Normal file
29
Plans/01 Foundation/S002-test-server.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# S002 — Test server with faults
|
||||
|
||||
> Category 01 Foundation · Model: Sonnet · Effort: high · Depends on: S001 · Size: M · Human: no
|
||||
> Files touched: crates/testserver/**
|
||||
|
||||
## Goal
|
||||
One local server that can behave like every good and bad host, so the engine is tested without the internet.
|
||||
|
||||
## Read
|
||||
- docs/FEATURES.md §1
|
||||
- crates/testserver (skeleton)
|
||||
|
||||
## Steps
|
||||
- [ ] Deterministic content by seed and length, so any byte range can be checked without storing files (up to 100 GB virtual)
|
||||
- [ ] HTTP/1.1 with ranges, ETag, Last-Modified, Content-Disposition variants, redirects, chunked and no-length replies; optional TLS with a generated certificate
|
||||
- [ ] Faults per path or on command: throttle per connection and total, latency, stall, cut after N bytes, reset, 403/404/410/416/429 with Retry-After/500/503, wrong length, ignores Range, changes content mid-way, forces gzip, link that expires after N seconds or requests, cap on connections per client
|
||||
- [ ] Logins (Basic, Digest, cookie, referrer check), an open directory listing, a ZIP and TAR, a small site tree, HLS and DASH fixtures made with /usr/bin/ffmpeg at test time, Metalink files, checksum sidecars
|
||||
- [ ] HTTP and SOCKS5 proxy stubs on loopback that record what passed
|
||||
- [ ] Library API (`TestServer::start()` on port 0, request log, live fault switches) and a `medlar-testserver` binary; row added to CLAUDE.md §5
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S002: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-testserver` green, with a test per fault
|
||||
|
||||
## Pitfalls
|
||||
Bind 127.0.0.1 only. No real network. Keep tests under 30 s in total.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
List of fault names and how to set them.
|
||||
35
Plans/01 Foundation/S003-shell-motion-tools.md
Normal file
35
Plans/01 Foundation/S003-shell-motion-tools.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# S003 — App shell, theme, motion and screenshot tools
|
||||
|
||||
> Category 01 Foundation · Model: Opus · Effort: medium · Depends on: S001 · Size: M · Human: no
|
||||
> Files touched: crates/app/**, tools/**, assets/**
|
||||
|
||||
## Goal
|
||||
An empty but correct window with tokens, colours, springs, icons and fonts, and the tools every later UI plan uses to prove its work. FEATURES 9.1, 9.8.
|
||||
|
||||
## Read
|
||||
- app-taste skill
|
||||
- ~/Projects/Damson/src/{motion,theme}.rs and src/ui/{fonts,icons,morph}.rs
|
||||
- ~/Projects/Damson/tests/shots.rs (first 80 lines)
|
||||
- ~/Projects/Nacre/tools/{hidden,nested-session}.sh
|
||||
- ~/Projects/Damson/tools/gen_icons.py
|
||||
|
||||
## Steps
|
||||
- [ ] eframe 0.37 (glow, wayland, x11) window with app id `medlar`, remembered size, minimum 480×360
|
||||
- [ ] Tokens module: spacing, radius, type, elevation, motion presets; `motion.rs` copied and extended with a velocity-keeping retarget test
|
||||
- [ ] Theme: Caelestia scheme, KDE accent or own colour (D-012), live reload, light, dark, AMOLED, contrast levels, scheme variants; a test checks 4.5:1 text and 3:1 icon contrast for 12 seeds in every mode
|
||||
- [ ] Fonts and Material Symbols embedded with a generator script; app icon drawn as our own SVG (a medlar fruit shape)
|
||||
- [ ] Motion level (off, reduced, normal, expressive) and repaint only while `busy()`
|
||||
- [ ] `tests/shots.rs` harness: `MEDLAR_SHOTS=dir`, light and dark, sizes, `HOVER=x,y`; contact-sheet script
|
||||
- [ ] `tools/hidden.sh`: nested niri run with throwaway home, grab, click, type; rows added to CLAUDE.md §5
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S003: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar` green
|
||||
- shots looked at in light and dark
|
||||
- hidden run draws a window and an idle 5 s uses under 1 % CPU
|
||||
|
||||
## Pitfalls
|
||||
The nested session renders in software: judge layout there, not frame rate. Copy code in, never edit ~/Projects/Damson or Nacre.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Token names, harness usage, how to add an icon.
|
||||
33
Plans/02 Engine/S004-http-core.md
Normal file
33
Plans/02 Engine/S004-http-core.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# S004 — HTTP core with resume and crash-safe files
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: high · Depends on: S002 · Size: L · Human: no
|
||||
> Files touched: crates/core/src/{http,disk,part}*, crates/core/tests/http*
|
||||
|
||||
## Goal
|
||||
Download one file over HTTP(S) in a fixed set of ranges, safely. FEATURES 1.1, 1.4, 1.5, 1.7, 1.14.
|
||||
|
||||
## Read
|
||||
- docs/FEATURES.md §1
|
||||
- crates/core/src (model, store)
|
||||
- testserver README or lib.rs
|
||||
|
||||
## Steps
|
||||
- [ ] Choose and pin the HTTP client after checking its docs: HTTP/1.1 forced for segments, `Accept-Encoding: identity`, redirect control, connect and idle timeouts; record as a decision
|
||||
- [ ] Probe: size, range support proven by a real 206, validators, name (Content-Disposition with RFC 5987, URL, MIME fallback), final URL
|
||||
- [ ] Safe names: no path parts, control characters, leading dots, reserved or overlong names; a fuzz-style test
|
||||
- [ ] Disk writer: free-space check, preallocation with fallback, positioned writes, bounded buffers, fsync policy, `.medlar` partial file, atomic rename, no silent overwrite
|
||||
- [ ] Journal of finished ranges that is never ahead of the data on disk; kill -9 test at 50 random moments resumes to an identical file
|
||||
- [ ] Resume check: validators plus an overlap byte comparison; a changed file stops with its own error
|
||||
- [ ] Servers with no range, no length, lying length, 200 to a range request, gzip anyway: correct result or a clear error, never a corrupt file
|
||||
- [ ] HTTP/2 or 3 single-stream path decided by measurement and recorded (1.14)
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S004: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test http` green, including kill tests
|
||||
- SHA-256 equality on every success path
|
||||
|
||||
## Pitfalls
|
||||
A 200 at an offset corrupts files. Journal order matters: data, then journal. Never trust Content-Length alone.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Part and writer API for S005.
|
||||
32
Plans/02 Engine/S005-dynamic-parts.md
Normal file
32
Plans/02 Engine/S005-dynamic-parts.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# S005 — Dynamic parts and adaptive connections
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: high · Depends on: S004 · Size: L · Human: no
|
||||
> Files touched: crates/core/src/{segment,adapt,host}*, crates/core/tests/parts*
|
||||
|
||||
## Goal
|
||||
Parts split, hand over and merge while running; connections follow what helps. FEATURES 1.2, 1.3, 1.4, 1.6.
|
||||
|
||||
## Read
|
||||
- crates/core/src/{http,disk,part}*
|
||||
- docs/FEATURES.md §1
|
||||
|
||||
## Steps
|
||||
- [ ] Pure scheduler (no I/O) that decides splits from part positions and speeds: take half of the part with the longest time left, aligned, never under the minimum size; property tests for no gap and no overlap
|
||||
- [ ] Live split and steal without reconnecting the donor; neighbouring finished ranges merge in the journal
|
||||
- [ ] Adaptive controller: start at 2, add while total throughput grows beyond noise, step down on 429/503/refusals; per-host memory in the store with expiry
|
||||
- [ ] Caps per download, host and total, changed live up and down
|
||||
- [ ] Per-part errors stay local: backoff with jitter, Retry-After, reconnect, hand the range to another connection
|
||||
- [ ] Stall and slow-part detection: the tail of a file never waits on one crawling connection
|
||||
- [ ] Event stream of part changes (born, split, stolen, merged, done) for the parts map
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S005: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test parts` green
|
||||
- a benchmark against a server throttled per connection shows near-linear gain, and against a server capped in total shows it settles low
|
||||
- numbers in PROGRESS
|
||||
|
||||
## Pitfalls
|
||||
Re-requesting too often looks like abuse: rate-limit new connections per host. The user's line is slow, so adding connections must prove itself.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Event list and snapshot fields.
|
||||
30
Plans/02 Engine/S006-manager.md
Normal file
30
Plans/02 Engine/S006-manager.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# S006 — Download manager, events and snapshots
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: medium · Depends on: S005 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/{manager,events,snapshot,speed}*, crates/core/tests/manager*
|
||||
|
||||
## Goal
|
||||
Many downloads with a lifecycle, and the one API that UI, CLI and connector use. FEATURES 1.1, 2.3 (order only), 7.3 (redownload), parts of 7.2.
|
||||
|
||||
## Read
|
||||
- crates/core/src (model, store, segment)
|
||||
- docs/DECISIONS.md
|
||||
|
||||
## Steps
|
||||
- [ ] Commands: add, start, pause, resume, stop, remove (keep or bin files), redownload, move, rename; all idempotent and safe in any state
|
||||
- [ ] Running set chosen by active limit, priority and order; per-host caps respected
|
||||
- [ ] Snapshot for the UI: cheap, lock-free to read, only changed tasks copied; 10,000 tasks test
|
||||
- [ ] Speed and time-left smoothing that doesn't jump; per-second history ring per task and total
|
||||
- [ ] Per-task log with redaction; counters for statistics
|
||||
- [ ] Start-up restore and clean shutdown: pause everything in under 2 s
|
||||
- [ ] Dev binary or test example that downloads from the test server with text progress
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S006: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test manager` green, with a concurrent command fuzz of 10,000 random operations and no deadlock or illegal state
|
||||
|
||||
## Pitfalls
|
||||
The UI thread must never wait on the engine.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Command and snapshot API, frozen for UI plans.
|
||||
32
Plans/02 Engine/S007-error-recovery.md
Normal file
32
Plans/02 Engine/S007-error-recovery.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# S007 — Error recovery
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: high · Depends on: S006 · Size: L · Human: no
|
||||
> Files touched: crates/core/src/{error,recover,net_state}*, crates/core/tests/recover*
|
||||
|
||||
## Goal
|
||||
Every failure is understood, explained, retried sensibly, and never costs finished bytes. FEATURES 1.17, 1.6.
|
||||
|
||||
## Read
|
||||
- docs/FEATURES.md 1.17
|
||||
- crates/core/src/{manager,http,segment,disk}*
|
||||
|
||||
## Steps
|
||||
- [ ] Error kinds from 1.17, each with severity, retry rule, plain message (what failed, then why) and fix action; a test asserts every kind has all four and no raw OS text leaks
|
||||
- [ ] Retry engine: backoff per kind, per-host circuit breaker, limits per task and "retry forever" option, time until next try in the snapshot
|
||||
- [ ] Network state through NetworkManager D-Bus with a fallback: offline waits instead of failing, resumes on return; captive portal (HTML in place of a file) detected
|
||||
- [ ] Sleep and wake through logind `PrepareForSleep`: pause cleanly, resume after
|
||||
- [ ] Disk: full, read-only, folder gone, drive unplugged and back, permission denied; waits and continues when fixed
|
||||
- [ ] App killed or power lost: auto-resume on next start, with a setting
|
||||
- [ ] Changed or wrong content (size, validators, HTML for a ZIP): asks to restart, keep both or continue from a new link; never mixes two versions
|
||||
- [ ] Recovery matrix test: every fault of the test server times early, middle and late in the file; result is an identical file or the exact expected error with bytes kept
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S007: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test recover` green
|
||||
- matrix written to docs/RECOVERY.md
|
||||
|
||||
## Pitfalls
|
||||
Use a fake D-Bus (dbus-run-session) for NetworkManager and logind; never touch the real ones. Don't retry 404 or 410 blindly.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Error kinds table for UI text and buttons.
|
||||
30
Plans/02 Engine/S008-continue-links.md
Normal file
30
Plans/02 Engine/S008-continue-links.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# S008 — Continue from a new link
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: high · Depends on: S007 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/{relink,adopt}*, crates/core/tests/relink*
|
||||
|
||||
## Goal
|
||||
An expired or dead download carries on from a fresh link, and partial files can be picked up. FEATURES 1.12, 4.6 (matching), 7.8.
|
||||
|
||||
## Read
|
||||
- crates/core/src/{error,disk,segment,manager}*
|
||||
- docs/FEATURES.md 1.12, 4.6, 7.8
|
||||
|
||||
## Steps
|
||||
- [ ] Relink command: probe the new link, compare length and validators, then compare sampled finished ranges and the edges byte for byte before accepting
|
||||
- [ ] Verdicts: same file, probably same (no validators, samples equal), different, cannot tell; each with its message; never continues on "different"
|
||||
- [ ] Headers, cookies, referrer and login replaced with the new link's; old ones dropped
|
||||
- [ ] Server without ranges: explain that it must start over, keep the old partial until the new one is done
|
||||
- [ ] Matcher: given an incoming link (and name, size, page), rank unfinished downloads it may continue; signed-URL query noise ignored; tests with realistic CDN links
|
||||
- [ ] Adopt a partial file: plain truncated file from a browser (`.part`, `.crdownload`), and other managers' partials when the part list is readable and documented; otherwise treat the start of the file as finished only after a byte check
|
||||
- [ ] Expired link on the source page: "open source page" state that waits for a matching link
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S008: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test relink` green: expiring links, swapped content, same size but different bytes, no validators
|
||||
|
||||
## Pitfalls
|
||||
Equal size and name is not the same file. Sampling must include the last finished bytes.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Matcher API for S016 and S024.
|
||||
27
Plans/02 Engine/S009-mirrors-checksums.md
Normal file
27
Plans/02 Engine/S009-mirrors-checksums.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# S009 — Mirrors, Metalink and checksums
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: medium · Depends on: S008 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/{mirror,metalink,verify}*, crates/core/tests/mirror*
|
||||
|
||||
## Goal
|
||||
FEATURES 1.8, 1.13.
|
||||
|
||||
## Read
|
||||
- crates/core/src/{segment,host,relink}*
|
||||
|
||||
## Steps
|
||||
- [ ] Several sources per file: each checked with S008's comparison before its bytes are used; parts spread by measured speed; a bad mirror is dropped alone
|
||||
- [ ] Metalink 3 and 4 files and the `Link`/`Digest` headers; piece hashes repair single pieces
|
||||
- [ ] Checksums MD5, SHA-1, SHA-256, SHA-512, BLAKE3, hashed off the download threads; sources: metalink, sidecar files, headers, pasted text (type detected by length)
|
||||
- [ ] Verify state and progress in the snapshot; mismatch offers repair (piece hashes), other mirror or restart
|
||||
- [ ] XML parsing hardened: size and depth limits, no entities
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S009: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test mirror` green: fast plus slow mirror, lying mirror, corrupt piece repaired
|
||||
|
||||
## Pitfalls
|
||||
Never mix bytes from an unverified mirror.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Verify states for the UI.
|
||||
30
Plans/02 Engine/S010-logins-proxies.md
Normal file
30
Plans/02 Engine/S010-logins-proxies.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# S010 — Logins, cookies and proxies
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: medium · Depends on: S006 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/{auth,cookie,proxy,secret,site}*, crates/core/tests/auth*
|
||||
|
||||
## Goal
|
||||
FEATURES 1.15, 1.16, 2.2 (per-site rules storage), FDM's site manager.
|
||||
|
||||
## Read
|
||||
- crates/core/src/http*
|
||||
- docs/FEATURES.md 1.15, 1.16
|
||||
- ~/Projects/Nacre/Cargo.toml (keyring line)
|
||||
|
||||
## Steps
|
||||
- [ ] Basic, Digest and cookie logins; per-download headers, cookies, referrer, user agent
|
||||
- [ ] Credentials scoped to their host: dropped on cross-host redirects (test), never in logs, process arguments or the store
|
||||
- [ ] Secret Service keyring with a fallback that keeps secrets in memory only and says so
|
||||
- [ ] Site profiles: login, connection cap, limit, user agent, proxy, folder; wildcard match, most specific wins
|
||||
- [ ] Proxies: HTTP, SOCKS5 with remote DNS, system setting; per app, site, download; bypass list
|
||||
- [ ] TLS: system roots, plain explanation of certificate errors, per-site exception only by explicit choice
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S010: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test auth` green, including redaction and redirect leak tests
|
||||
|
||||
## Pitfalls
|
||||
Proxy tests use the stub only. Use a fake Secret Service under dbus-run-session, never the user's keyring.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Site profile fields.
|
||||
29
Plans/02 Engine/S011-ftp-sftp.md
Normal file
29
Plans/02 Engine/S011-ftp-sftp.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# S011 — FTP, FTPS and SFTP
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: medium · Depends on: S010 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/{ftp,sftp,listing}*, crates/core/tests/ftp*
|
||||
|
||||
## Goal
|
||||
FEATURES 1.9, plus directory listing used by the site explorer.
|
||||
|
||||
## Read
|
||||
- crates/core/src/{http,segment,auth}*
|
||||
- suppaftp and russh docs for the pinned versions
|
||||
|
||||
## Steps
|
||||
- [ ] A transport trait drawn from the HTTP path, only as wide as needed
|
||||
- [ ] FTP and FTPS: passive and extended passive, REST resume, SIZE, MDTM, segments when the server allows several logins
|
||||
- [ ] SFTP: password and key logins, host key prompt and known_hosts style store, positioned reads in parallel
|
||||
- [ ] Directory listing (MLSD, LIST variants, SFTP) as one type
|
||||
- [ ] Errors mapped to S007's kinds if it is merged, else to the model's placeholder kinds
|
||||
- [ ] In-process FTP and SFTP test servers on loopback (dev-dependency or small own stub)
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S011: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test ftp` green: resume, cut, wrong login, changed host key refused
|
||||
|
||||
## Pitfalls
|
||||
A changed SFTP host key must never be accepted silently. Never connect to the user's Chromebook for tests.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Listing type for S030.
|
||||
30
Plans/02 Engine/S012-streams.md
Normal file
30
Plans/02 Engine/S012-streams.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# S012 — HLS, DASH, RTSP and MMS
|
||||
|
||||
> Category 02 Engine · Model: Opus · Effort: medium · Depends on: S007, S010 · Size: M · Human: no
|
||||
> Files touched: crates/core/src/stream/**, crates/core/tests/stream*
|
||||
|
||||
## Goal
|
||||
FEATURES 1.10, 1.11, ffmpeg runner used by media plans.
|
||||
|
||||
## Read
|
||||
- crates/core/src/{manager,http}*
|
||||
- docs/DECISIONS.md D-011
|
||||
|
||||
## Steps
|
||||
- [ ] ffmpeg finder and runner: argument lists only, progress parsing, cancel, log tail, missing-tool error kind
|
||||
- [ ] HLS: master and media lists, variants, audio groups, AES-128 clear-key as the list itself offers; live lists record until stopped
|
||||
- [ ] DASH: static and simple dynamic manifests, representation choice
|
||||
- [ ] Fragments in parallel with retry, resume after restart, joined without re-encoding
|
||||
- [ ] RTSP and MMS recorded through ffmpeg with stop and size or time limit
|
||||
- [ ] DRM (Widevine, FairPlay, PlayReady signals) is recognised and refused with a plain message
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S012: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar-core --test stream` green on fixtures made by ffmpeg
|
||||
- ffprobe shows the right duration
|
||||
|
||||
## Pitfalls
|
||||
Links go after `--` or as `-i` values with a protocol whitelist. No DRM handling of any kind.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Stream probe result type.
|
||||
33
Plans/03 Interface/S013-controls.md
Normal file
33
Plans/03 Interface/S013-controls.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# S013 — Controls, dialogs and toasts
|
||||
|
||||
> Category 03 Interface · Model: Opus · Effort: medium · Depends on: S003 · Size: L · Human: no
|
||||
> Files touched: crates/app/src/ui/{widgets,dialog,menu,toast,field}*, crates/app/tests/widgets*
|
||||
|
||||
## Goal
|
||||
Every control in M3 Expressive form, so screens are only assembly. FEATURES 9.4 (controls), 9.7.
|
||||
|
||||
## Read
|
||||
- app-taste and animate skills
|
||||
- crates/app/src/{motion,theme,tokens}*
|
||||
- ~/Projects/Damson/src/ui/widgets.rs
|
||||
- ~/Projects/Mulberry/src/ui/widgets.rs (buttons, menus)
|
||||
|
||||
## Steps
|
||||
- [ ] Buttons (five kinds, sizes), icon buttons that morph on press, toggle buttons, connected button group whose neighbours give way, split button, FAB and FAB menu, floating toolbar
|
||||
- [ ] Text field, number with unit, search, combo, slider, range, switch, checkbox, radio, chips, segmented control with sliding selection, tabs
|
||||
- [ ] Menus and submenus that keep to the window, context menus, tooltips with shortcuts
|
||||
- [ ] Dialogs of fixed widths, side sheet, confirm; Enter, Escape, focus trap and focus return
|
||||
- [ ] Toasts with action and undo, stacked, pause on hover
|
||||
- [ ] Progress-free states for each: hover, press, focus ring, disabled, error, loading after 300 ms
|
||||
- [ ] Gallery screen behind `--gallery`, shots of every control in light, dark and hovered
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S013: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar --test widgets` green: hover, press, keyboard, focus return, popups inside the window
|
||||
- shots looked at
|
||||
|
||||
## Pitfalls
|
||||
Springs for space, critically damped for colour. Nested radii stay concentric. Nothing pushes its neighbours while animating, except the button group by design.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Control names and arguments.
|
||||
34
Plans/03 Interface/S014-wavy-parts-shapes.md
Normal file
34
Plans/03 Interface/S014-wavy-parts-shapes.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# S014 — Wavy bars, parts map, shapes and speed graph
|
||||
|
||||
> Category 03 Interface · Model: Opus · Effort: high · Depends on: S003 · Size: L · Human: no
|
||||
> Files touched: crates/app/src/ui/{wave,parts,shape,graph,odometer}*, crates/app/tests/visuals*
|
||||
|
||||
## Goal
|
||||
The parts of Medlar people will remember, driven by real engine data. FEATURES 9.2–9.6.
|
||||
|
||||
## Read
|
||||
- app-taste and animate skills
|
||||
- ~/Projects/Mulberry/src/ui/shape.rs
|
||||
- ~/Projects/Mulberry/src/ui/widgets.rs `wavy_slider`
|
||||
- docs/FEATURES.md §9
|
||||
|
||||
## Steps
|
||||
- [ ] Wavy line progress: amplitude and travel follow speed through springs, round ends, gap and stop mark, flattens when paused; states for waiting, verifying, unknown size, error, done
|
||||
- [ ] Part-aware wave: gaps between parts glide when parts split, hand over or merge
|
||||
- [ ] Wavy ring for compact places and the tray preview; wavy slider for limits
|
||||
- [ ] Parts map: blocks that split, hand over and merge with springs, hover shows range, speed and server; falls back to a density strip for thousands of ranges
|
||||
- [ ] Morphing shapes: loading indicator, one shape per file kind, completion moment (wave settles, shape becomes a tick), interruptible and played once
|
||||
- [ ] Speed graph with filled area, limit line and hover readout; rolling tabular digits for the big number
|
||||
- [ ] Simulated data in the gallery, with a scrubber for speed and part events; cost measured with 200 bars on screen
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S014: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar --test visuals` green: no NaN, stays in bounds at 0, tiny and 100 %, paused and settled draw no frames
|
||||
- shot sequence looked at
|
||||
- 200 bars under 4 ms CPU per frame in release
|
||||
|
||||
## Pitfalls
|
||||
Motion only while bytes arrive. Phase keeps running smoothly through speed changes. Reduced motion shows a flat, still bar.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
Widget inputs, mapped to S006 snapshot fields.
|
||||
34
Plans/03 Interface/S015-main-window.md
Normal file
34
Plans/03 Interface/S015-main-window.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# S015 — Main window and list
|
||||
|
||||
> Category 03 Interface · Model: Opus · Effort: medium · Depends on: S006, S013, S014 · Size: L · Human: no
|
||||
> Files touched: crates/app/src/{app,bridge}*, crates/app/src/views/{main,list,rail,bar}*, crates/app/tests/main*
|
||||
|
||||
## Goal
|
||||
The daily screen on real data. FEATURES 7.1, 7.4 (undo), 9.5, 9.7, 3.3 (window drop only opens the Add dialog stub).
|
||||
|
||||
## Read
|
||||
- app-taste skill
|
||||
- crates/app/src/ui module list
|
||||
- crates/core snapshot and command API
|
||||
|
||||
## Steps
|
||||
- [ ] Bridge: engine runtime on its own threads, snapshot per frame, repaint only on change
|
||||
- [ ] Layout: collapsing rail (states, queues, tags, types), list, floating toolbar, speed header with graph; 480 px to ultrawide
|
||||
- [ ] Rows in compact and card form: kind shape, name, host, wavy bar, speed, time left, state; fixed heights, ellipsis, virtualised for 10,000
|
||||
- [ ] Search, filters, sort, columns, grouping; multi-select with keyboard, range and lasso; drag to reorder
|
||||
- [ ] Context menu and toolbar actions with undo toasts for removal; delete to bin or keep
|
||||
- [ ] States: empty with Add button, nothing found, offline, error with fix button and next-try countdown, very long names
|
||||
- [ ] Row motion: insert, remove, reorder and move to Done by springs, off for bulk changes over 30 rows
|
||||
- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S015: …`, push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo test -j 2 -p medlar --test main` green
|
||||
- shots at 480, 900, 1600 and 3440 px in light and dark looked at
|
||||
- hidden run against the test server shows a real download finishing
|
||||
- 10,000 rows scroll under 8 ms CPU per frame
|
||||
|
||||
## Pitfalls
|
||||
Never hold engine locks while drawing. Keyboard actions are not animated.
|
||||
|
||||
## Handoff (→ PROGRESS.md)
|
||||
How views get data and send commands.
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue