Skip to content

Fetch only Wallpaper Engine's assets, and repack downloads into .kpk - #8

Merged
beingsuz merged 4 commits into
mainfrom
claude/project-thread-41d0cm
Oct 9, 2026
Merged

beingsuz merged 4 commits into
mainfrom
claude/project-thread-41d0cm

Conversation

@beingsuz

@beingsuz beingsuz commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Requested by beingsuz · project thread

Before: "Fetch engine assets" downloaded all of Wallpaper Engine (program, web runtime and UI) to get the one assets folder kirie reads. Every Workshop item haru downloaded stayed a loose folder of files.

After:

  • haru fetches only assets. The button no longer claims a fixed "377 MB", and the progress note shows the real size ("… 42% of N MB").
  • An item haru downloads itself is repacked by kirie convert into one .kpk in haru/packages under haru's data folder, and its folder is removed.
  • Items the Steam client downloads keep their folder, since Steam would fetch it again, and also get a .kpk copy in haru/packages/steam. The library shows the copy while it is current and falls back to the folder once Steam updates the item; the next pass makes the copy again. Copies whose folder is gone are removed, and removing such an item removes both.
  • If kirie is missing or too old to convert, the folder stays and works as before.
  • The library lists packages next to folders, under the Workshop id they came from, with their title, type, preview and properties. Deleting a package removes the file, and the screens remember a package the way they remember a folder.

How:

  • Asset fetch. engine_assets sets tapline's new InstallOptions::paths to ["assets"] (Let an app install take only some of its files tapline#5).
  • Repacking. haru_apply::repack runs kirie convert <folder> -o <packages>/<id>.kpk on a background thread when a download lands. It removes the folder only after haru can open the package.
  • Reading packages. haru_core::package reads .kpk files itself (header, manifest, index, blake3 checks, LZ4), since haru shares no code with kirie. This adds blake3 and lz4_flex.
  • Steam client copies. haru_apply::repack::mirror runs on a background thread whenever the library refreshes. It skips copies that are not older than the item's folder or project.json, and notes items kirie refuses (application wallpapers, an old kirie) in a .<id>.refused file so they are not retried until the item or kirie changes.
  • Library. library::scan_all merges packages first, so a package wins over a folder with the same id. A package's preview is copied out once to .previews/<fingerprint>.<ext>.

Merge order: tapline#5 has merged and tapline is pinned to its main. Repacking needs a kirie release that includes UnhingedSoftware/kirie#14; until then haru keeps folders.

Tested:

  • fmt, clippy -D warnings and cargo test --workspace on Linux. New tests read a package, refuse a damaged one, list a package with its preview, prefer a package over a folder, and read properties from a package.
  • By hand: haru's reader listed a package written by kirie #14's kirie convert, with its preview and project.json.
  • A throwaway test drove mirror with the real kirie binary against a fake Steam library: it made the copy and kept the folder, did nothing on a second pass, listed the copy in the library, and removed the copy once the folder was gone.
  • By hand: repack drove the real kirie binary, wrote haru/packages/7654321.kpk and removed the folder.

Not tested:

  • The UI flow in a window: download, the "Packing it into one file…" row, and the item appearing in the library.
  • An actual asset fetch. This environment cannot reach Steam.
  • Windows and macOS at runtime. The Windows cross-check is left to CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj


Generated by Claude Code

haru asked tapline for all of Wallpaper Engine to get the one folder kirie
reads. It now asks for `assets` alone, through tapline's new
`InstallOptions::paths`, so the program, its web runtime and its UI are no
longer downloaded. The fetch button drops its fixed "377 MB" and the
progress note shows the size of what is actually being fetched.

The tapline pin moves to the branch carrying `paths`; it moves to tapline's
main once that change merges there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0cd6cef5-59a3-409d-8e81-ae929c26677e

📥 Commits

Reviewing files that changed from the base of the PR and between 82d0b2c and cc6c79a.


⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock

📒 Files selected for processing (15)
  • Cargo.toml
  • crates/haru-apply/src/lib.rs
  • crates/haru-apply/src/relaunch.rs
  • crates/haru-apply/src/repack.rs
  • crates/haru-core/Cargo.toml
  • crates/haru-core/src/lib.rs
  • crates/haru-core/src/library.rs
  • crates/haru-core/src/package.rs
  • crates/haru-core/src/properties.rs
  • crates/haru-ui/src/app.rs
  • crates/haru-ui/src/lib.rs
  • crates/haru-ui/src/library.rs
  • crates/haru-ui/src/settings.rs
  • crates/haru-workshop/src/lib.rs
  • tapline

 _____________________________________________
< You shall not pass...without a code review! >
 ---------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

After haru downloads a Workshop item itself, it runs `kirie convert` on
the folder, keeps the package in its own data folder (haru/packages) and
removes the folder, so the item lives on disk as one file. Items the Steam
client downloads stay folders, since Steam would fetch them again. When
kirie is missing or too old to convert, the folder stays and works as
before.

The library lists packages beside folders, under the Workshop id they were
made from, with their title, type and preview (copied out once into
`.previews`), and a package wins over a folder with the same id. Their
properties come from the project.json inside, deleting one removes the
file, and the screens remember a package the way they remember a folder.

haru reads packages itself rather than through kirie's code: header,
manifest, index, hash checks and LZ4, in haru-core's `package` module,
which adds blake3 and lz4_flex.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
@beingsuz beingsuz changed the title Fetch only Wallpaper Engine's assets folder Fetch only Wallpaper Engine's assets, and repack downloads into .kpk Oct 9, 2026
claude added 2 commits October 9, 2026 11:43
Items the Steam client downloaded now also get a .kpk, kept in
packages/steam beside the folder Steam keeps, since Steam fetches a
missing folder again. The library shows the copy while it is current
and falls back to the folder once Steam updates it; a later pass makes
the copy again, and removes copies whose folder is gone. Removing such
an item removes both. Items kirie cannot convert are noted and not
retried until the item or kirie changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg1KotRgE7Ws6DQwhsgTpj
@beingsuz
beingsuz marked this pull request as ready for review October 9, 2026 11:46
@beingsuz
beingsuz merged commit 292ee12 into main Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants