Compare commits

..
139 changed files with 321 additions and 8006 deletions

View file

@ -69,7 +69,6 @@ Never modify: everything outside this folder. `~/Projects/*` is read-only refere
| `python3 tools/gen_assets.py icons` | adds icons: put the name in `tools/icons.txt` first | S003 |
| `nice cargo build --release -j 2` | release build (never at the same time as the tests) | 01 Foundation |
| `nice cargo test -j 2 -p medlar-testserver` / `cargo run -p medlar-testserver -- [--port N] [--tls] [--media] [--proxies]` | local server with faults and proxy stubs; API in the `crates/testserver/src/lib.rs` header | S002 |
| `PORT=… TS=… tools/tray-check/run.sh <name> <driver> [tray] [second]` | close to tray in a hidden niri with a fake tray host (drivers `tray.sh`, `notray.sh`, `min.sh`); testserver on `$TS` | S047 |
| `ssh root@192.168.1.71 hub-release` | release notes on Astar Hub (release only, after the user's yes) | now |
Don't assume a tool exists: check first. When your plan creates a tool, add its row here.

155
Cargo.lock generated
View file

@ -714,42 +714,18 @@ dependencies = [
"thiserror 1.0.69",
]
[[package]]
name = "calloop"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e"
dependencies = [
"bitflags 2.13.2",
"polling",
"rustix 1.1.6",
"tracing",
]
[[package]]
name = "calloop-wayland-source"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [
"calloop 0.13.0",
"calloop",
"rustix 0.38.44",
"wayland-backend",
"wayland-client",
]
[[package]]
name = "calloop-wayland-source"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
dependencies = [
"calloop 0.14.5",
"rustix 1.1.6",
"wayland-backend",
"wayland-client",
]
[[package]]
name = "cbc"
version = "0.2.1"
@ -970,15 +946,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-queue"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03e8bd762f7479489c70ed6c768ddca99d7296857de437a68dcb2a94365b3fae"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.23"
@ -1403,7 +1370,6 @@ dependencies = [
"profiling",
"raw-window-handle",
"serde",
"smithay-clipboard",
"web-time",
"windows-sys 0.61.2",
"winit",
@ -2655,26 +2621,6 @@ dependencies = [
"accesskit_consumer",
]
[[package]]
name = "ksni"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bcc1cb43797140f74b711f1c4a49f48a7a7429f211c5fb78264e7bcd1e99caf"
dependencies = [
"arc-swap",
"async-executor",
"async-io",
"async-lock",
"crossbeam-queue",
"futures-channel",
"futures-lite",
"futures-util",
"pastey",
"serde",
"task-local",
"zbus",
]
[[package]]
name = "kurbo"
version = "0.11.3"
@ -2812,15 +2758,13 @@ checksum = "7ebb8d8732c6a6df3d8f032a82911cfc747e00efb95cc46e8d0acd5b5b88570c"
[[package]]
name = "medlar"
version = "0.1.1"
version = "0.1.0"
dependencies = [
"arboard",
"chrono",
"dirs",
"eframe",
"egui_kittest",
"image",
"ksni",
"log",
"medlar-cli",
"medlar-core",
@ -2832,19 +2776,18 @@ dependencies = [
"tempfile",
"tokio",
"url",
"zbus",
]
[[package]]
name = "medlar-cli"
version = "0.1.1"
version = "0.1.0"
dependencies = [
"medlar-core",
]
[[package]]
name = "medlar-core"
version = "0.1.1"
version = "0.1.0"
dependencies = [
"aes",
"arc-swap",
@ -2888,7 +2831,7 @@ dependencies = [
[[package]]
name = "medlar-testserver"
version = "0.1.1"
version = "0.1.0"
dependencies = [
"md-5",
"rcgen",
@ -3662,12 +3605,6 @@ dependencies = [
"phc",
]
[[package]]
name = "pastey"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4"
[[package]]
name = "pbkdf2"
version = "0.13.0"
@ -4963,8 +4900,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
dependencies = [
"bitflags 2.13.2",
"calloop 0.13.0",
"calloop-wayland-source 0.3.0",
"calloop",
"calloop-wayland-source",
"cursor-icon",
"libc",
"log",
@ -4981,44 +4918,6 @@ dependencies = [
"xkeysym",
]
[[package]]
name = "smithay-client-toolkit"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0"
dependencies = [
"bitflags 2.13.2",
"calloop 0.14.5",
"calloop-wayland-source 0.4.1",
"cursor-icon",
"libc",
"log",
"memmap2",
"rustix 1.1.6",
"thiserror 2.0.21",
"wayland-backend",
"wayland-client",
"wayland-csd-frame",
"wayland-cursor",
"wayland-protocols",
"wayland-protocols-experimental",
"wayland-protocols-misc",
"wayland-protocols-wlr",
"wayland-scanner",
"xkeysym",
]
[[package]]
name = "smithay-clipboard"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226"
dependencies = [
"libc",
"smithay-client-toolkit 0.20.0",
"wayland-backend",
]
[[package]]
name = "smol_str"
version = "0.2.2"
@ -5231,15 +5130,6 @@ dependencies = [
"libc",
]
[[package]]
name = "task-local"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2972044a9e5e448a506a7ff6f0d03b566d8ef4cd6918a58fc59835a0f8666626"
dependencies = [
"pin-project-lite",
]
[[package]]
name = "tempfile"
version = "3.27.0"
@ -5527,7 +5417,6 @@ version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@ -5895,32 +5784,6 @@ dependencies = [
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-experimental"
version = "20250721.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1"
dependencies = [
"bitflags 2.13.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-misc"
version = "0.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8"
dependencies = [
"bitflags 2.13.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-plasma"
version = "0.3.12"
@ -6401,7 +6264,7 @@ dependencies = [
"bitflags 2.13.2",
"block2 0.5.1",
"bytemuck",
"calloop 0.13.0",
"calloop",
"cfg_aliases",
"concurrent-queue",
"core-foundation 0.9.4",
@ -6422,7 +6285,7 @@ dependencies = [
"raw-window-handle",
"redox_syscall 0.4.1",
"rustix 0.38.44",
"smithay-client-toolkit 0.19.2",
"smithay-client-toolkit",
"smol_str",
"tracing",
"unicode-segmentation",

View file

@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "3"
[workspace.package]
version = "0.1.1"
version = "0.1.0"
edition = "2024"
license = "MIT"

View file

@ -12,13 +12,13 @@ FEATURES 6.1 with the system's yt-dlp (D-011).
- `yt-dlp --help` (format, output, progress parts)
## Steps
- [x] Finder and version check, missing and too-old states in plain words
- [x] Probe to JSON: formats, audio, subtitles, chapters, playlists; cached and cancellable
- [x] Add dialog page: quality choice with sizes, audio only, subtitles, playlist picker
- [x] 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
- [x] Errors mapped to kinds: private, removed, region, login, unsupported, too many requests; DRM refused
- [x] Test file `docs/tests/S025-video-sites.md`, with the checks below
- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S025: …`, push
- [ ] Finder and version check, missing and too-old states in plain words
- [ ] Probe to JSON: formats, audio, subtitles, chapters, playlists; cached and cancellable
- [ ] 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
- [ ] 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 check -q -j 2 -p medlar` clean

View file

@ -12,14 +12,14 @@ FEATURES 3.3, 3.4, 3.9.
- ~/Projects/Nacre/Cargo.toml (arboard line)
## Steps
- [x] Rules engine: conditions (extension, MIME, host, size, name pattern) to folder, queue, tags, priority, name template; order, test box, default rule set by type
- [x] Name templates with safe placeholders and collision handling
- [x] Clipboard watcher: off, ask, add; filters; ignores our own copies; privacy note; Wayland limits stated honestly
- [x] Drop links, text, lists and `.metalink` on the window with a full-window drop state
- [x] 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
- [x] Rules and clipboard pages
- [x] Test file `docs/tests/S027-rules-clipboard-drop.md`, with the checks below
- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S027: …`, push
- [ ] Rules engine: conditions (extension, MIME, host, size, name pattern) to folder, queue, tags, priority, name template; order, test box, default rule set by type
- [ ] Name templates with safe placeholders and collision handling
- [ ] Clipboard watcher: off, ask, add; filters; ignores our own copies; privacy note; Wayland limits stated honestly
- [ ] 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 check -q -j 2 -p medlar` clean

View file

@ -12,13 +12,13 @@ FEATURES 8.1, 8.4.
- ksni docs
## Steps
- [x] Tray icon with progress ring and speed tooltip; menu: modes, pause all, resume all, add, show, quit
- [x] Close to tray, start minimised, autostart file; works without a tray host
- [x] Notifications: done, failed, needs login, all done, with actions (open, show folder, continue, retry); grouped, quiet hours
- [x] Launcher progress through the Unity D-Bus signal
- [x] Desktop file, metainfo, MIME and scheme entries checked by their validators when present
- [x] Test file `docs/tests/S033-tray-notify.md`, with the checks below
- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S033: …`, push
- [ ] Tray icon with progress ring and speed tooltip; menu: modes, pause all, resume all, add, show, quit
- [ ] Close to tray, start minimised, autostart file; works without a tray host
- [ ] 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 check -q -j 2 -p medlar` clean

View file

@ -11,13 +11,13 @@ One look and feel, and motion that earns its place (D-008, FEATURES 9.7). Was S0
- crates/app/src/{motion,tokens}*, then the views by `rg` hits only
## Steps
- [x] One list of faults across all screens, by leverage: motion, edges, grid, radii, sizes, states, copy, focus; drop what is by design
- [x] Fix every high and medium motion fault
- [x] Fix every high and medium look fault; no literal colours or radii outside tokens
- [x] Hide every setting, menu entry and tab of a feature that is Later (PLAN.md), so nothing on screen does nothing
- [x] Copy, empty states, AccessKit names, focus and 32 px hit targets
- [x] 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
- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S034: …`, push
- [ ] 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
`nice cargo check -q -j 2 -p medlar` clean

View file

@ -11,13 +11,13 @@ Version 1 is solid, light and complete. Was S037 and S038.
- CLAUDE.md §4, docs/CONNECTOR.md, docs/TEST-REPORT.md
## Steps
- [x] Security review of connector, names, child processes, Metalink and stream parsers, secrets on disk and in logs; fix with one regression test each
- [x] Short fuzz tests of the parsers: headers, Content-Disposition, HLS, DASH, Metalink, listing, patterns
- [x] 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
- [x] Soak script with random faults, pauses, kills and limit changes: 20 minutes, once; every file checked
- [x] 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 (engine level and S044 port tests; hidden UI journey not repeated)
- [x] 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
- [x] `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S037: …`, push
- [ ] 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

View file

@ -12,14 +12,14 @@ Builds that run on older distros without downloads (D-011), a clear repo page an
- docs/FEATURES-CHECK.md, docs/CONNECTOR.md
## Steps
- [x] 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
- [x] glibc and library needs listed, lowest supported glibc stated; system libraries not bundled
- [x] 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
- [x] README with shots from real runs, install, connector steps, limits and known bugs; no hype
- [x] Release notes in docs/releases/0.1.0.md; version set everywhere; checksums made, nothing in releases/ yet
- [x] 🧑 Version, contents, known bugs and the size of bundling yt-dlp and ffmpeg told to the user; wait for the yes
- [x] After the yes: files to releases/v0.1.0/, notes with hub-release, page checked
- [x] docs/STATUS.md, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S039: …`, push
- [ ] 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

View file

@ -11,13 +11,13 @@ Run the checks of the test files of S017, S021, S022, S023, S024, fix what fails
- CLAUDE.md §4 and §5
## Steps
- [x] Build everything, run the existing suite once with a log file, start the app hidden; fix what is broken before anything else
- [x] Doubts first: read the code behind each, add a check or write why it is fine
- [x] Write the tests for all HIGH and MED checks in one go, sharing fixtures and the testserver
- [x] Run them once, all together, log to a file; read only the failures
- [x] Fix all causes in one go; rerun only what failed; three rounds at most, then `KNOWN BUG` with the cause
- [x] Screen checks: one contact sheet, faults fixed in one go, one more sheet (partly: no scenes exist for details, queues, week, countdown or handoff; only set-browser and add-continue sheets were seen)
- [x] Results filled in, `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S041: …`, push
- [ ] 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

View file

@ -11,12 +11,12 @@ Run the checks of the test files of S025, S027, S033, S034, fix what fails, fill
- CLAUDE.md §4 and §5
## Steps
- [x] Doubts first: read the code behind each, add a check or write why it is fine
- [x] Write the tests for all HIGH and MED checks in one go, sharing fixtures and the testserver
- [x] Run them once, all together, log to a file; read only the failures
- [x] Fix all causes in one go; rerun only what failed; three rounds at most, then `KNOWN BUG` with the cause
- [x] Screen checks: one contact sheet, faults fixed in one go, one more sheet
- [x] Results filled in, `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S043: …`, push
- [ ] 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

View file

@ -1,29 +0,0 @@
# S044 — Close the open HIGH checks and wire the video page
> Category 09 Test and release · Model: Opus (gate fix: open HIGH checks) · Effort: medium · Depends on: S037 · Phase: test · Human: no
> Files touched: crates/**, docs/tests/**, docs/TEST-REPORT.md, docs/FEATURES-CHECK.md
## Goal
The package gate (S039) needs no open HIGH check. After S037 these HIGH checks are still not run or failing; give each a harness (unit, integration or kittest, hidden run only where nothing else works), run it, fix what fails. Also make the video feature (FEATURES 6.1) usable from the app.
## Read
- docs/TEST-REPORT.md (S037 line), docs/tests/S037-whole-app.md
- the rows below in their test files; code only where a check needs it
- CLAUDE.md §4 and §5
## Steps
- [x] S017 5, 6, 7, 8, 15, 16 (details panel: removed task, error box, checksum, file gone, hidden headers, checksum field): kittest or integration
- [x] S021 19 (fake `Power` records the Fire(Shutdown) call; Logind never used)
- [x] S024 3, 8, 9, 10, 15 (handoff: medlar: link shows dialog, Continue offered, expired link continued or refused, hash identical) against testserver; S024 14 with Nacre's body replayed by curl if running Nacre hidden fails
- [x] S027 8 and 9 / S037 16 (clipboard Ask): find the cause of no Add window; fix, or prove it is the nested session's clipboard with a test of the watcher logic and mark it KNOWN BUG LOW with the proof
- [x] Video: show `video::Page` in the Add dialog for video links and run yt-dlp tasks through the manager (pause, resume, error kinds); stub yt-dlp tests; S025 16
- [x] S037 open boxes: frame cost with 50 active, journeys pause/restart/continue, expired link, queue with schedule, old store; record results
- [x] Full workspace suite once at the end (absolute TMPDIR); fix failures
- [x] Results filled in, `docs/TEST-REPORT.md` line, `docs/PROGRESS.md` entry, tick S037 boxes now done and its INDEX line, tick this plan's INDEX line, commit `S044: …`, push
## End criteria
- no HIGH row in docs/tests left as "not run" or failing, except a KNOWN BUG with proof that it is outside the app
- workspace suite green
## Pitfalls
Never weaken a test to pass. Fake D-Bus and logind only, testserver on loopback only, throwaway homes only, never download real video. Absolute `TMPDIR`. Release build and tests never at once.

View file

@ -1,26 +0,0 @@
# S045 — installer.sh and Arch package
> Category 10 Distribution · Model: Sonnet · Effort: medium · Depends on: S039 · Phase: test · Human: no
> Files touched: installer.sh, packaging/arch/**, tools/package.sh, README.md, docs/tests/S045-installer-arch.md
## Goal
The user asked for an installer script and an Arch package for 0.1.0. Debian and Fedora packages wait for a build on an older host (the binary needs glibc 2.44); not in this plan.
## Read
- tools/package.sh, the tar.gz's install.sh and uninstall.sh, assets/medlar.desktop, assets/medlar.metainfo.xml, README install section
- the user's global release rules (CLAUDE.md is loaded): file names `<App>-<version>-<platform>.<ext>`, no scripts or .md in releases/
## Steps
- [x] `installer.sh` at the repo root (POSIX sh, shellcheck-clean if shellcheck is present): installs from a given tar.gz or AppImage, or from one found next to it; `--user` (default, ~/.local) or `--system` (/usr/local, sudo only for the copy); desktop file, icons, metainfo, `medlar:` scheme handler; `--uninstall` (and `--purge` for data); refuses when glibc is older than 2.44 with a plain message; verifies SHA256SUMS when present. Optional `--url` download is allowed but the repo is private, so the default path is a local file
- [x] `packaging/arch/PKGBUILD` (+ `.SRCINFO`): `medlar-bin` from the release tar.gz with sha256sums, depends listed from the binary's needs (glibc, libxkbcommon, wayland, etc.), optdepends yt-dlp and ffmpeg, desktop file, icons, metainfo, license
- [x] Build the package with `makepkg` from the local tar.gz (no network: point `source` at the file in dist/ for the build); `namcap` if present; inspect contents with `bsdtar -tf`
- [x] Test, with throwaway roots only: installer.sh `--user` into a temp HOME, `--system` with `DESTDIR`/prefix into a temp dir, uninstall leaves nothing; package contents and file list checked; do NOT `pacman -U` on the real system
- [x] `tools/package.sh` also makes the Arch package as `dist/Medlar-0.1.0-arch-x86_64.pkg.tar.zst` and adds it to `dist/SHA256SUMS-0.1.0`; nothing into releases/ (the orchestrator adds it)
- [x] README: install sections for installer.sh and Arch; test file `docs/tests/S045-installer-arch.md` with Results; PROGRESS entry, tick INDEX, commit `S045: …`, `git push origin HEAD`
## End criteria
- installer installs and uninstalls cleanly in a throwaway home and prefix
- the Arch package builds offline and lists the right files
## Pitfalls
Never touch the real ~/.local, /usr or pacman database. No downloads (D-011). Never put scripts in releases/.

View file

@ -1,29 +0,0 @@
# S046 — 0.1.1: names from the server, raise on arrival, copy in fields
> Category 10 Distribution · Model: Sonnet · Effort: medium · Depends on: S045 · Phase: test · Human: 🧑 yes before release
> Files touched: crates/core/src/http/name.rs and its callers, crates/core/src/connector/**, crates/app/src/views/{incoming,add}/**, crates/app/src/keys.rs, crates/app/src/app.rs, version files, docs/releases/0.1.1.md, docs/tests/S046-fixes-0.1.1.md
## Goal
Three bugs the user found with 0.1.0 (Nacre on a real site):
1. **Name**: the browser hands over a provisional name (`output.bin`) at click time; the real name (archive) only comes with the server's reply (Content-Disposition, or the final link after redirects). Medlar keeps the sender's name, so the file stays `output.bin`.
2. **No raise**: a pushed download does not bring Medlar forward. `incoming.rs` sends `ViewportCommand::Focus` only, which Wayland (niri) ignores without an activation token, and does nothing when the window is hidden to the tray.
3. **Copy in fields**: in Settings (and every text field) Ctrl+C does not copy: `keys::pressed` lets the list's Copy shortcut (Ctrl+C) and Select all (Ctrl+A) eat the events while a text field has focus (`taken()` covers V, X, Z only).
## Read
- crates/core/src/http/name.rs (`pick`), where a task's name is set from a sender or the Add dialog and where the first reply is handled (rg `pick(`)
- crates/app/src/views/incoming.rs (`tick`, `ask`), app.rs lines ~255-330 (show/hide), crates/app/src/keys.rs (`pressed`, `taken`, `fits`)
- docs/CONNECTOR.md (`filename` field)
## Steps
- [x] Name: a name from a sender (connector `filename`, or the Add dialog when the user did not type it) is a hint. On the first reply, when the hint is generic (no extension, or an extension like bin, php, asp, aspx, cgi, html, htm, download, or a known placeholder such as `output.bin`, `download`, `file`) and the reply gives a name (Content-Disposition, else the final link with a file extension), use the reply's name, made safe as today, before any file is created; a name the user typed always wins; collisions handled as today (never overwrite). The Add dialog's probe updates the shown name the same way while the user has not edited it. Unit tests in name.rs and an engine test against testserver (provisional name + Content-Disposition, and a redirect to a named link)
- [x] Raise: on an arrival that shows the Add window or adds a download, if the main window is hidden show it (`Visible(true)`, `Minimized(false)`), then `Focus` and `RequestUserAttention(Critical)` (urgency where focus is refused); same for second-instance hand-over; clear the attention when the window gets focus. A kittest that records the viewport commands
- [x] Copy: while a text field has focus, Ctrl+C, Ctrl+A (and Ctrl+X, Ctrl+V, Ctrl+Z as now) go to the field, not to list shortcuts; settings values that are read-only text (paths, versions, the port, the token) are selectable or have a copy button where egui allows. Unit test for `pressed` with a focused field
- [x] Full workspace suite once (absolute TMPDIR), then release build; hidden smoke test: POST a link with `filename: output.bin` to a testserver URL that answers with Content-Disposition `game.zip`: Add window shows and the file is `game.zip`; window raised in the grab
- [x] Version 0.1.1 everywhere (Cargo, metainfo, PKGBUILD, .SRCINFO); `tools/package.sh` builds tar.gz, AppImage, Arch package and `SHA256SUMS-0.1.1` in dist/; `docs/releases/0.1.1.md`; nothing into releases/
- [x] Test file `docs/tests/S046-fixes-0.1.1.md` with Results, PROGRESS entry, tick INDEX, commit `S046: …`, `git push origin HEAD`
## End criteria
- the three bugs have passing regression tests; suite green; builds smoke-tested
## Pitfalls
File names from servers are hostile: same `safe` rules as today. Never rename over an existing file. Never contact the real site; testserver on loopback only. Release only after the user's yes.

View file

@ -1,30 +0,0 @@
# S047 — Close to tray that works on Wayland
> Category 10 Distribution · Model: Opus (ownership refactor of the app's lifetime) · Effort: medium · Depends on: S046 · Phase: test · Human: 🧑 yes before release
> Files touched: crates/app/src/{main,lib,app,shell,tray,instance}.rs, crates/app/src/views/incoming.rs, docs/tests/S047-close-to-tray.md, docs/releases/0.1.1.md
## Goal
The user closes the window with niri's close (Win+Q) and nothing happens. Cause (`app.rs` `shell()`): on close Medlar sends `CancelClose` then `Visible(false)`, but winit cannot hide a window on Wayland, so the window just stays. Without a tray host the close works; with one it is swallowed.
Wanted: closing hides Medlar to the tray (downloads, port, tray keep going) when the tray is on and a host exists; otherwise it quits cleanly. Show from the tray, a second start, or a browser hand-off brings a window back.
## Approach (check against eframe 0.37 docs before coding)
eframe with `NativeOptions::run_and_return = true` returns from `run_native` when the window closes and reuses its thread-local event loop on the next `run_native` call (winit `run_app_on_demand`). So:
- Move what must outlive a window out of `App` into a `Core`/`Session` owned by `main`: engine/manager bridge, connector `Inbox` source, tray/shell, notifications, launcher, instance socket, settings store. The `App` borrows or holds an `Arc` to it.
- On close with tray: let the close happen (no `CancelClose`); `run_native` returns; `main` waits on the tray/instance/connector for "show" (or "quit"), then calls `run_native` again with the same session. Window size and position come back from `window.ron`.
- Without a tray host, or tray off: close quits as today (pause and save, then exit).
- X11: same path (no special `Visible(false)` case left), so one behaviour everywhere.
- `--minimised` at start: start without a window when a tray host exists (wait for "show"), else open normally.
- Arrivals while hidden (S046 raise): reopen the window, then the Add dialog.
If `run_and_return` cannot reopen on this eframe/winit, stop and report with the error; do not build a second process design without asking.
## Steps
- [x] Read eframe 0.37 `run_and_return` / `run_native` docs and source in ~/.cargo/registry; confirm reopen works with a 20-line spike in a test or example
- [x] Session refactor: long-lived parts out of `App`; nothing else changes behaviour
- [x] Close/show/quit loop in `main` as above; tray Show and Quit, second instance, connector arrival, `--minimised`
- [x] Tests: unit for the decide-on-close logic (tray on/off, host yes/no); hidden nested niri run with a fake StatusNotifierWatcher (bus.rs from S043) on a spare port and throwaway home: send close (niri msg action close-window), process stays, downloads keep going (testserver, throttled), port answers; tray Show reopens; POST to the port reopens with the Add window; Quit ends with tasks saved; without the fake tray, close quits
- [x] Full workspace suite once, release build, smoke as S046; add to docs/releases/0.1.1.md; rebuild packages via tools/package.sh (0.1.1), nothing into releases/
- [x] Test file with Results, PROGRESS, tick INDEX, commit `S047: …`, push
## Pitfalls
The user's Medlar 0.1.0 is running on 17616: never stop it; spare port, throwaway home. Never weaken a test. Idle (hidden) draws no frames and uses ~0 CPU.

View file

@ -1,30 +0,0 @@
# S048 — Servers behind a load balancer with different validators
> Category 10 Distribution · Model: Opus (engine correctness, never mix two files) · Effort: medium · Depends on: S046 · Phase: test · Human: 🧑 yes before release
> Files touched: crates/core/src/http/{mod,fetch,download,parts}.rs, crates/testserver/**, crates/core/tests/**, docs/tests/S048-server-farms.md, docs/releases/0.1.1.md
## Goal
Downloads from romsgames.net (and any site with a server farm) fail at once with "File changed on the server". Seen on 2026-11-26 with four 1-byte range requests to the same link (`static.romsgames.net/.../output.bin?token`):
| range | Server | Last-Modified | ETag | Content-Range total |
|---|---|---|---|---|
| 0-0 | nginx/1.22.0 | Mon, 21 Jul 2025 20:20:29 | W/"bd6dcd82-1982ea51dc7" | 3178089858 |
| 1000000-1000000 | nginx/1.24.0 (Ubuntu) | Sun, 05 Jan 2020 05:35:27 | W/"bd6dcd82-16f743377f5" | 3178089858 |
| 0-0 | nginx/1.24.0 (Ubuntu) | Mon, 21 Jul 2025 20:20:29 | W/"bd6dcd82-1982ea51dc7" | 3178089858 |
| 2000000000-… | nginx/1.24.0 (Ubuntu) | Mon, 21 Jul 2025 20:20:29 | W/"bd6dcd82-1982ea51dc7" | 3178089858 |
All 206, same size, same type; nodes differ only in mtime (nginx ETag = `"<size hex>-<mtime hex>"`). `Validators::same_file` (http/mod.rs) and `send_range` (fetch.rs ~159) call that `Changed`. The user's task 8 failed after 32 KB.
## Rule (never mix two files)
When a reply's validators differ from the known ones but the total size is equal: do not fail. Check bytes instead: compare a sample of bytes already on disk with the same range from this reply (the existing `same_bytes` path in fetch.rs ~205; make the sample big enough, e.g. 64 KiB or what is there) before writing. Bytes equal → mark the task's link as a *farm* (validators unreliable): from then on compare size + byte samples only, send no `If-Range` (a Last-Modified `If-Range` makes other nodes answer 200 full), keep the first validators for display. Bytes differ, or size differs → `Changed` as today. A 200 to a range on a farm is `RangeIgnored`, not `Changed`. Also nginx-style ETags that differ only after the size part count as "maybe the same file" (still checked by bytes).
## Steps
- [x] testserver: a farm mode (several "nodes" with the same bytes but different Last-Modified/ETag picked per request, nginx-style weak ETags), and a liar mode (same size, different bytes) — docs in the lib.rs header
- [x] Engine: the rule above, in probe, parts and resume; the farm flag stored with the task (store migration) so a restart keeps it; parts on a farm still run in parallel
- [x] Tests: farm download with 4 parts completes with the right hash; pause/restart/resume on a farm; liar same-size-different-bytes still fails with Changed and keeps what is there; If-Range not sent on a farm; unit tests for the ETag comparison
- [x] Full workspace suite once (absolute TMPDIR), release build, hidden smoke against testserver farm on a spare port (the user's Medlar 0.1.1 runs on 17616: never stop it)
- [x] `tools/package.sh` (0.1.1, rebuilds dist/), copy the four files to `~/Projects/Medlar/dist/` as well; notes in docs/releases/0.1.1.md
- [x] Test file with Results, PROGRESS, tick INDEX, commit `S048: …`, `git push origin HEAD`
## Pitfalls
Never contact romsgames.net or any real site in tests; testserver only. Never weaken the "two files are never mixed" guarantee.

View file

@ -1,15 +0,0 @@
# S049 — Take focus on niri when a download arrives
> Category 10 Distribution · Model: Sonnet · Effort: medium · Depends on: S046, S047 · Phase: test · Human: no
> Files touched: crates/app/src/views/incoming.rs, crates/app/src/{desktop,shell}.rs or a new `niri.rs`, docs/tests/S049-niri-focus.md
## Goal
On niri, `Focus` and `RequestUserAttention` from an app only mark the window urgent (no activation token from a user input), so a download pushed from the browser does not bring Medlar forward. niri has no per-app "allow activation" window rule (the user's `~/.config/niri/caelestia-windowrules.kdl` now has a Medlar rule with `open-focused true`, which only helps for new windows). The global `debug { honor-xdg-activation-with-invalid-serial }` would let every app steal focus: not wanted.
## Steps
- [x] When `NIRI_SOCKET` is set and an arrival raises the window (S046 path), ask niri over its IPC socket (JSON, `{"Action":{"FocusWindow":{"id":N}}}`; window id from `"Windows"` matched by our PID and app id `medlar`) to focus our window; no shell, no `niri` binary needed; on any error fall back to today's urgency. A setting "Bring Medlar forward when a download arrives" (default on) in Behaviour
- [x] Unit test with a fake socket that records the request; hidden nested niri run: POST a link, focused window id equals Medlar's (spare port, throwaway home)
- [x] Results, PROGRESS, INDEX, commit `S049: …`, push
## Pitfalls
Read the IPC format of niri 26.04 from its docs or `niri msg --json` output before coding. Never touch the user's niri config.

View file

@ -1,17 +0,0 @@
# S050 — Bug hunt, known items first
> Category 10 Distribution · Model: Sonnet · Effort: medium · Depends on: S049 · Phase: test · Human: no
> Files touched: crates/**, docs/tests/S050-bug-hunt.md
## Goal
Fix the bugs already found, smallest and most visible first; commit after each so a cut-off loses nothing. Weekly usage is nearly gone: stop cleanly when told.
## Steps
- [ ] Snail button covers the last row's pause icon at 480x360: the list needs bottom padding equal to the button plus its margin (shots scene at 480x360 to check)
- [ ] Idle CPU 11 % with the Add dialog open, and 160 % right after a download ends: find what keeps repainting (motion running without change, a spinner, a timer) and stop it; idle must draw no frames
- [ ] Tray tooltip speed uses the same smoothed, held value as the big number
- [ ] `control::connector_flood_15` fails (40 ok, 0 busy): read the busy limit in the connector, fix the cause or the test if the test is wrong (never weaken a real guard)
- [ ] Each fix gets a test where feasible; one full suite run at the end; Results in `docs/tests/S050-bug-hunt.md`, PROGRESS, INDEX, commit `S050: …`, push
## Pitfalls
Spare port and throwaway home; absolute TMPDIR under target/tmp. No packages, no releases.

View file

@ -44,33 +44,23 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H
## 06 Media
- [x] [S025](06%20Media/S025-video-sites.md) Video sites through yt-dlp
- [ ] [S025](06%20Media/S025-video-sites.md) Video sites through yt-dlp
## 07 Library and tools
- [x] [S027](07%20Library%20and%20tools/S027-rules-clipboard-drop.md) Rules, clipboard, drag and drop, drop target
- [x] [S033](07%20Library%20and%20tools/S033-tray-notify.md) Tray, notifications and autostart
- [ ] [S027](07%20Library%20and%20tools/S027-rules-clipboard-drop.md) Rules, clipboard, drag and drop, drop target
- [ ] [S033](07%20Library%20and%20tools/S033-tray-notify.md) Tray, notifications and autostart
## 08 Motion and polish
- [x] [S034](08%20Motion%20and%20polish/S034-motion-audit.md) Motion and look pass
- [ ] [S034](08%20Motion%20and%20polish/S034-motion-audit.md) Motion and look pass
## 09 Test and release
- [x] [S041](09%20Test%20and%20release/S041-test-control-connector.md) It runs; tests of details, control and connector
- [x] [S043](09%20Test%20and%20release/S043-test-video-screens.md) Tests of video, rules, tray and every screen
- [x] [S037](09%20Test%20and%20release/S037-whole-app.md) Whole app: use, security, speed, every feature
- [x] [S044](09%20Test%20and%20release/S044-fix-open-high.md) Close the open HIGH checks and wire the video page
- [x] [S039](09%20Test%20and%20release/S039-package-release.md) Package, docs and release 🧑
## 10 Distribution
- [x] [S045](10%20Distribution/S045-installer-arch.md) installer.sh and Arch package
- [x] [S046](10%20Distribution/S046-fixes-0.1.1.md) 0.1.1: names from the server, raise on arrival, copy in fields
- [x] [S047](10%20Distribution/S047-close-to-tray-wayland.md) Close to tray that works on Wayland
- [x] [S048](10%20Distribution/S048-server-farms.md) Servers behind a load balancer with different validators
- [x] [S049](10%20Distribution/S049-niri-focus.md) Take focus on niri when a download arrives
- [ ] [S050](10%20Distribution/S050-bug-hunt.md) Bug hunt, known items first
- [ ] [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)

View file

@ -1,81 +0,0 @@
# Medlar
A download manager for Linux, written in Rust with egui. Downloads are split into dynamic parts and can be paused, resumed
and continued from a new link. The interface follows Material You (M3 Expressive). Version 0.1.1 fixes names, copy and speed, and adds a snail button.
![Main window after a finished download](docs/img/main.png)
![Add dialog](docs/img/add.png)
Both pictures come from a real run of the release build in a hidden session (software rendering).
## What it does
- HTTP and HTTPS in up to 16 dynamic parts, resume after a crash or restart, error recovery, mirrors, checksums.
- FTP, FTPS and SFTP; HLS and DASH streams; Metalink.
- Speed limits (global and per download), priorities, queues, a schedule and "when done" actions.
- A local port, `127.0.0.1:17616`, that takes links from browsers (Nacre's JSON). See [docs/CONNECTOR.md](docs/CONNECTOR.md).
- Video sites through `yt-dlp` (with `ffmpeg`), if both are installed.
- Clipboard watcher, rules, tags and notes, tray icon, one running copy only.
The full list and its state: [docs/FEATURES.md](docs/FEATURES.md) and [docs/FEATURES-CHECK.md](docs/FEATURES-CHECK.md).
## Install
Needs a Linux x86_64 desktop with Wayland or X11, and glibc 2.44 or newer (see "Requirements").
**AppImage:** `chmod +x Medlar-0.1.1-x86_64.AppImage && ./Medlar-0.1.1-x86_64.AppImage`
**tar.gz:** `tar xzf Medlar-0.1.1-Linux-x86_64.tar.gz && cd medlar-0.1.1 && ./install.sh`
installs into `~/.local` (binary, desktop file, icon; no root). `./uninstall.sh` removes it; `./uninstall.sh --purge` also
removes settings and the download list (downloaded files stay).
**installer.sh:** `./installer.sh Medlar-0.1.1-Linux-x86_64.tar.gz` (or with no file: it uses a tar.gz or AppImage beside it).
`--user` (default, `~/.local`) or `--system` (`/usr/local`, sudo only for the copy); `--prefix DIR` picks another folder.
Checks `SHA256SUMS-*` beside the file and refuses glibc older than 2.44. Sets the `medlar:` link handler (user install).
`./installer.sh --uninstall [--purge]` removes it again (`--system` for a system install).
**Arch Linux:** `sudo pacman -U Medlar-0.1.1-arch-x86_64.pkg.tar.zst` (package `medlar-bin`). To build it yourself:
`cd packaging/arch && makepkg -si` (downloads the tar.gz) or `MEDLAR_TARBALL=file:///path/to/Medlar-0.1.1-Linux-x86_64.tar.gz makepkg -si`.
Check the download against `SHA256SUMS-0.1.1`: `sha256sum -c SHA256SUMS-0.1.1`.
**Portable mode:** put a file called `portable` beside `bin/medlar` (tar.gz) or beside the `.AppImage`. Everything is then
kept in a `medlar-data/` folder next to it. `MEDLAR_HOME=<dir>` sets the folder directly and wins over both.
## Requirements
- The binary links only `libc`, `libm` and `libgcc_s` (glibc). Nothing from the system is bundled.
- It was built on Arch Linux with glibc 2.44, and it uses math functions that glibc added in 2.43 and 2.44. **Lowest
supported glibc: 2.44.** It will not start on older distributions. A build for older systems needs an older build host.
It was not tested on any other system.
- Wayland or X11 and a GPU driver (OpenGL) or software rendering.
- Optional: `yt-dlp` and `ffmpeg` on `PATH` for video sites. Medlar does not bundle them (that would add tens of MB and
they go out of date quickly). Without them, everything else works and video links give a plain message.
## Browser steps
1. Start Medlar once and finish or skip the first-run pages. The port is `127.0.0.1:17616` (Settings, Browser).
2. In Nacre (or any program that can POST JSON), set the download-manager address to `http://127.0.0.1:17616/`.
3. Send a link. Medlar shows the Add dialog unless you turned that off.
4. Test by hand: `curl -s -H 'Content-Type: application/json' -d '{"url":"https://example.com/a.zip"}' http://127.0.0.1:17616/`
Requests with a web `Origin` or a foreign `Host` are refused, and no CORS headers are sent.
## Limits and known gaps
Honest state of 0.1.1. The engine is tested hard (unit, integration, fuzz, a 20-minute fault soak with 606 files and no
corrupt one). The interface is tested less.
- The hidden-window user journeys (pause, restart, expired link, schedule) were tested at engine level only, not by
clicking through the window.
- Many screen and motion checks were not run (the details panel, motion audit, drag and drop in the window).
- Video: `yt-dlp` was tested against a stub, not against a real site. Browser cookies and the global speed limit are
not passed to `yt-dlp`.
- The Control sheet is clipped at 480x360 (no scroll).
- The "when done" power call was not run against a fake logind.
- Not built or tested for other CPUs or other libc. No Windows or macOS version.
## Build from source
`cargo build --release -p medlar` (Rust 1.99, edition 2024). `tools/package.sh` makes the tar.gz, the AppImage and the
checksums in `dist/`. Tests: `cargo test --workspace -j 2`. Licence: MIT. Font: Rubik (OFL, `assets/Rubik-OFL.txt`).

Some files were not shown because too many files have changed in this diff Show more